@elliemae/ds-pills-v2 3.70.0-next.7 → 3.70.0-next.71
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.
- package/dist/cjs/TruncatedTooltipText.js +34 -18
- package/dist/cjs/TruncatedTooltipText.js.map +2 -2
- package/dist/cjs/components/Pill.js +2 -1
- package/dist/cjs/components/Pill.js.map +2 -2
- package/dist/cjs/components/TextComponent.js +2 -2
- package/dist/cjs/components/TextComponent.js.map +2 -2
- package/dist/cjs/components/styled.js +62 -20
- package/dist/cjs/components/styled.js.map +2 -2
- package/dist/cjs/components/types/DropdownPill.js +55 -53
- package/dist/cjs/components/types/DropdownPill.js.map +2 -2
- package/dist/cjs/components/types/InputPill.js +91 -61
- package/dist/cjs/components/types/InputPill.js.map +2 -2
- package/dist/cjs/components/types/LabelOnlyPill.js +22 -2
- package/dist/cjs/components/types/LabelOnlyPill.js.map +2 -2
- package/dist/cjs/components/types/LabelPill.js +11 -2
- package/dist/cjs/components/types/LabelPill.js.map +2 -2
- package/dist/cjs/components/types/MenuButtonPill.js +11 -2
- package/dist/cjs/components/types/MenuButtonPill.js.map +2 -2
- package/dist/cjs/components/types/ReadOnlyPill.js +11 -2
- package/dist/cjs/components/types/ReadOnlyPill.js.map +2 -2
- package/dist/cjs/components/types/RemovablePill.js +15 -5
- package/dist/cjs/components/types/RemovablePill.js.map +2 -2
- package/dist/cjs/components/types/ValuePill.js +22 -1
- package/dist/cjs/components/types/ValuePill.js.map +2 -2
- package/dist/cjs/config/useValidateProps.js +63 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +3 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/parts/DSPillButton/react-desc-prop-types.js +8 -2
- package/dist/cjs/parts/DSPillButton/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/parts/DSPillGroup/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +19 -9
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/slot-props.js +42 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-pills-v2-valid.js +1 -1
- package/dist/cjs/typescript-testing/typescript-pills-v2-valid.js.map +2 -2
- package/dist/esm/TruncatedTooltipText.js +35 -19
- package/dist/esm/TruncatedTooltipText.js.map +2 -2
- package/dist/esm/components/Pill.js +3 -2
- package/dist/esm/components/Pill.js.map +2 -2
- package/dist/esm/components/TextComponent.js +2 -2
- package/dist/esm/components/TextComponent.js.map +2 -2
- package/dist/esm/components/styled.js +62 -20
- package/dist/esm/components/styled.js.map +2 -2
- package/dist/esm/components/types/DropdownPill.js +55 -53
- package/dist/esm/components/types/DropdownPill.js.map +2 -2
- package/dist/esm/components/types/InputPill.js +92 -62
- package/dist/esm/components/types/InputPill.js.map +2 -2
- package/dist/esm/components/types/LabelOnlyPill.js +22 -2
- package/dist/esm/components/types/LabelOnlyPill.js.map +2 -2
- package/dist/esm/components/types/LabelPill.js +11 -2
- package/dist/esm/components/types/LabelPill.js.map +2 -2
- package/dist/esm/components/types/MenuButtonPill.js +11 -2
- package/dist/esm/components/types/MenuButtonPill.js.map +2 -2
- package/dist/esm/components/types/ReadOnlyPill.js +11 -2
- package/dist/esm/components/types/ReadOnlyPill.js.map +2 -2
- package/dist/esm/components/types/RemovablePill.js +15 -5
- package/dist/esm/components/types/RemovablePill.js.map +2 -2
- package/dist/esm/components/types/ValuePill.js +22 -1
- package/dist/esm/components/types/ValuePill.js.map +2 -2
- package/dist/esm/config/useValidateProps.js +33 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +3 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/package.json +1 -4
- package/dist/esm/parts/DSPillButton/react-desc-prop-types.js +8 -2
- package/dist/esm/parts/DSPillButton/react-desc-prop-types.js.map +2 -2
- package/dist/esm/parts/DSPillGroup/react-desc-prop-types.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +20 -10
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +19 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-pills-v2-valid.js +1 -1
- package/dist/esm/typescript-testing/typescript-pills-v2-valid.js.map +2 -2
- package/dist/types/TruncatedTooltipText.d.ts +3 -1
- package/dist/types/components/TextComponent.d.ts +2 -0
- package/dist/types/components/styled.d.ts +5 -4
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +3 -0
- package/dist/types/parts/DSPillGroup/react-desc-prop-types.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +11 -2
- package/package.json +22 -20
- package/dist/types/parts/DSPillButton/tests/DSPillButton.test.d.ts +0 -1
- package/dist/types/parts/DSPillGroup/tests/DSPillGroup.test.d.ts +0 -1
- package/dist/types/tests/DSPill.a11y.test.d.ts +0 -1
- package/dist/types/tests/DSPill.exports.test.d.ts +0 -1
- package/dist/types/tests/DSPill.get-owner-props.test.d.ts +0 -1
- package/dist/types/tests/DSPill.test.d.ts +0 -1
- package/dist/types/tests/DSPillGroup.test.d.ts +0 -1
- package/dist/types/tests/events/DSPill.events.keyboard.test.d.ts +0 -1
- package/dist/types/tests/events/DSPill.events.test.d.ts +0 -1
- package/dist/types/tests/events/DSPillGroup.events.keyboard.test.d.ts +0 -1
- package/dist/types/tests/events/DSPillGroup.events.test.d.ts +0 -1
- package/dist/types/typescript-testing/typescript-pills-v2-valid.d.ts +0 -1
|
@@ -59,9 +59,16 @@ const TooltipContainer = import_ds_system.styled.div`
|
|
|
59
59
|
border-radius: 2px;
|
|
60
60
|
font-size: 13px;
|
|
61
61
|
color: ${({ theme }) => theme.colors.neutral[600]};
|
|
62
|
-
pointer-events: none;
|
|
63
62
|
`;
|
|
64
|
-
const
|
|
63
|
+
const TruncatedTooltipDetectionBox = import_ds_system.styled.div`
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: -15px;
|
|
66
|
+
right: -15px;
|
|
67
|
+
width: calc(100% + 30px);
|
|
68
|
+
height: calc(100% + 30px);
|
|
69
|
+
z-index: -1;
|
|
70
|
+
`;
|
|
71
|
+
const TruncatedTooltipText = ({ value = "", placement = "top", disableTooltip = false }) => {
|
|
65
72
|
const [showTooltip, setShowTooltip] = (0, import_react.useState)(false);
|
|
66
73
|
const { refs, floatingStyles, arrowStyles, context } = (0, import_ds_floating_context.useFloatingContext)({
|
|
67
74
|
placement,
|
|
@@ -75,22 +82,31 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
|
|
|
75
82
|
const handleMouseLeave = (0, import_react.useCallback)(() => {
|
|
76
83
|
setShowTooltip(false);
|
|
77
84
|
}, []);
|
|
78
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
86
|
+
TruncatedSpan,
|
|
87
|
+
{
|
|
88
|
+
innerRef: refs.setReference,
|
|
89
|
+
onMouseEnter: disableTooltip ? void 0 : handleMouseEnter,
|
|
90
|
+
onMouseLeave: disableTooltip ? void 0 : handleMouseLeave,
|
|
91
|
+
children: [
|
|
92
|
+
value,
|
|
93
|
+
!disableTooltip && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
+
import_ds_floating_context.FloatingWrapper,
|
|
95
|
+
{
|
|
96
|
+
innerRef: refs.setFloating,
|
|
97
|
+
isOpen: showTooltip,
|
|
98
|
+
floatingStyles,
|
|
99
|
+
context,
|
|
100
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipContainer, { children: [
|
|
101
|
+
value,
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TruncatedTooltipDetectionBox, {}),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_floating_context.PopoverArrow, { ...arrowStyles })
|
|
104
|
+
] })
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
);
|
|
94
110
|
};
|
|
95
111
|
var TruncatedTooltipText_default = TruncatedTooltipText;
|
|
96
112
|
//# sourceMappingURL=TruncatedTooltipText.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/TruncatedTooltipText.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\n\nconst TruncatedSpan = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\n\nconst TruncatedSpan = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n/** Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency */\nconst TooltipContainer = styled.div`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n overflow-wrap: break-word;\n word-break: break-word;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n`;\n\n/**\n * Mirrors DSTooltipV3's StyledMouseOverDetectionBox \u2014 extends hover area 15px on all sides,\n * covering the 12px floating offset gap so the tooltip doesn't close while the mouse crosses it.\n */\nconst TruncatedTooltipDetectionBox = styled.div`\n position: absolute;\n top: -15px;\n right: -15px;\n width: calc(100% + 30px);\n height: calc(100% + 30px);\n z-index: -1;\n`;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n disableTooltip?: boolean;\n}\n\nconst TruncatedTooltipText = ({ value = '', placement = 'top', disableTooltip = false }: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <TruncatedSpan\n innerRef={refs.setReference}\n onMouseEnter={disableTooltip ? undefined : handleMouseEnter}\n onMouseLeave={disableTooltip ? undefined : handleMouseLeave}\n >\n {value}\n {!disableTooltip && (\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer>\n {value}\n <TruncatedTooltipDetectionBox />\n <PopoverArrow {...arrowStyles} />\n </TooltipContainer>\n </FloatingWrapper>\n )}\n </TruncatedSpan>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\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,MAE1C;AAAA;AAAA,QACA,CAAC,kBACA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf,QAAQ;AAAA,YACR;AAAA,YACA;AAAA,YAEA,uDAAC,oBACE;AAAA;AAAA,cACD,4CAAC,gCAA6B;AAAA,cAC9B,4CAAC,2CAAc,GAAG,aAAa;AAAA,eACjC;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAGA,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -36,6 +36,7 @@ var React = __toESM(require("react"));
|
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
38
|
var import_constants = require("../constants/index.js");
|
|
39
|
+
var import_useValidateProps = require("../config/useValidateProps.js");
|
|
39
40
|
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
40
41
|
var import_types = require("./types/index.js");
|
|
41
42
|
const pillComponentGetter = {
|
|
@@ -50,7 +51,7 @@ const pillComponentGetter = {
|
|
|
50
51
|
};
|
|
51
52
|
const DSPillV2 = (props) => {
|
|
52
53
|
const propsWithDefaults = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.DSPillV2DefaultProps);
|
|
53
|
-
(0,
|
|
54
|
+
(0, import_useValidateProps.useValidateProps)(propsWithDefaults, import_react_desc_prop_types.DSPillV2PropTypesSchema);
|
|
54
55
|
const { type } = propsWithDefaults;
|
|
55
56
|
const PillComponent = pillComponentGetter[type];
|
|
56
57
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PillComponent, { ...propsWithDefaults });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Pill.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { describe, useMemoMergePropsWithDefault
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { DSPillName } from '../constants/index.js';\nimport { useValidateProps } from '../config/useValidateProps.js';\nimport { DSPillV2DefaultProps, DSPillV2PropTypesSchema, type DSPillT } from '../react-desc-prop-types.js';\nimport {\n DropdownPill,\n InputPill,\n LabelPill,\n LabelOnlyPill,\n MenuButtonPill,\n ReadOnlyPill,\n RemovablePill,\n ValuePill,\n} from './types/index.js';\n\nconst pillComponentGetter: Record<string, React.ComponentType<DSPillT.InternalProps>> = {\n dropdown: DropdownPill,\n menubutton: MenuButtonPill,\n input: InputPill,\n label: LabelPill,\n labelOnly: LabelOnlyPill,\n readonly: ReadOnlyPill,\n removable: RemovablePill,\n value: ValuePill,\n};\n\nconst DSPillV2: React.ComponentType<DSPillT.Props> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSPillT.InternalProps>(props, DSPillV2DefaultProps);\n useValidateProps(propsWithDefaults, DSPillV2PropTypesSchema);\n const { type } = propsWithDefaults;\n const PillComponent = pillComponentGetter[type];\n\n return <PillComponent {...propsWithDefaults} />;\n};\n\nDSPillV2.displayName = DSPillName;\nconst DSPillV2WithSchema = describe(DSPillV2).description('Pill');\nDSPillV2WithSchema.propTypes = DSPillV2PropTypesSchema;\n\nexport { DSPillV2, DSPillV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiCd;AAjCT,8BAAuD;AAEvD,uBAA2B;AAC3B,8BAAiC;AACjC,mCAA4E;AAC5E,mBASO;AAEP,MAAM,sBAAkF;AAAA,EACtF,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO;AACT;AAEA,MAAM,WAA+C,CAAC,UAAU;AAC9D,QAAM,wBAAoB,sDAAoD,OAAO,iDAAoB;AACzG,gDAAiB,mBAAmB,oDAAuB;AAC3D,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,gBAAgB,oBAAoB,IAAI;AAE9C,SAAO,4CAAC,iBAAe,GAAG,mBAAmB;AAC/C;AAEA,SAAS,cAAc;AACvB,MAAM,yBAAqB,kCAAS,QAAQ,EAAE,YAAY,MAAM;AAChE,mBAAmB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,8 +33,8 @@ __export(TextComponent_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(TextComponent_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_TruncatedTooltipText = require("../TruncatedTooltipText.js");
|
|
37
36
|
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_TruncatedTooltipText = require("../TruncatedTooltipText.js");
|
|
38
38
|
var import_styled = require("./styled.js");
|
|
39
|
-
const TextComponent = import_react.default.memo(({ labelTruncated, label, pillSize }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledTextWrapper, { pillSize, children: labelTruncated ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TruncatedTooltipText.TruncatedTooltipText, { value: label }) : label }));
|
|
39
|
+
const TextComponent = import_react.default.memo(({ labelTruncated, disableTruncationTooltip, label, pillSize, getOwnerProps }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledTextWrapper, { pillSize, variant: "b2", component: "span", getOwnerProps, children: labelTruncated ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TruncatedTooltipText.TruncatedTooltipText, { value: label, disableTooltip: disableTruncationTooltip }) : label }));
|
|
40
40
|
//# sourceMappingURL=TextComponent.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/TextComponent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { TruncatedTooltipText } from '../TruncatedTooltipText.js';\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { TruncatedTooltipText } from '../TruncatedTooltipText.js';\nimport type { DSPillT } from '../react-desc-prop-types.js';\nimport { StyledTextWrapper } from './styled.js';\n\nexport const TextComponent = React.memo<{\n labelTruncated: DSPillT.InternalProps['labelTruncated'];\n disableTruncationTooltip: DSPillT.InternalProps['disableTruncationTooltip'];\n label: DSPillT.InternalProps['label'];\n pillSize: DSPillT.InternalProps['size'];\n getOwnerProps?: () => object;\n}>(({ labelTruncated, disableTruncationTooltip, label, pillSize, getOwnerProps }) => (\n <StyledTextWrapper pillSize={pillSize} variant=\"b2\" component=\"span\" getOwnerProps={getOwnerProps}>\n {labelTruncated ? <TruncatedTooltipText value={label} disableTooltip={disableTruncationTooltip} /> : label}\n </StyledTextWrapper>\n));\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADaD;AAbtB,mBAAkB;AAClB,kCAAqC;AAErC,oBAAkC;AAE3B,MAAM,gBAAgB,aAAAA,QAAM,KAMhC,CAAC,EAAE,gBAAgB,0BAA0B,OAAO,UAAU,cAAc,MAC7E,4CAAC,mCAAkB,UAAoB,SAAQ,MAAK,WAAU,QAAO,eAClE,2BAAiB,4CAAC,oDAAqB,OAAO,OAAO,gBAAgB,0BAA0B,IAAK,OACvG,CACD;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var styled_exports = {};
|
|
30
30
|
__export(styled_exports, {
|
|
31
31
|
StyledAgnosticPillRegion: () => StyledAgnosticPillRegion,
|
|
32
|
+
StyledDSInputText: () => StyledDSInputText,
|
|
32
33
|
StyledDropdownPillWrapper: () => StyledDropdownPillWrapper,
|
|
33
34
|
StyledInputPillWrapper: () => StyledInputPillWrapper,
|
|
34
35
|
StyledLabelOnlyPillWrapper: () => StyledLabelOnlyPillWrapper,
|
|
@@ -46,9 +47,11 @@ __export(styled_exports, {
|
|
|
46
47
|
module.exports = __toCommonJS(styled_exports);
|
|
47
48
|
var React = __toESM(require("react"));
|
|
48
49
|
var import_ds_button_v2 = require("@elliemae/ds-button-v2");
|
|
50
|
+
var import_ds_form_input_text = require("@elliemae/ds-form-input-text");
|
|
49
51
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
50
52
|
var import_ds_menu_button = require("@elliemae/ds-menu-button");
|
|
51
53
|
var import_ds_system = require("@elliemae/ds-system");
|
|
54
|
+
var import_ds_typography = require("@elliemae/ds-typography");
|
|
52
55
|
var import_constants = require("../constants/index.js");
|
|
53
56
|
var import_constants2 = require("../parts/DSPillButton/constants/index.js");
|
|
54
57
|
var import_constants3 = require("../parts/DSPillGroup/constants/index.js");
|
|
@@ -74,9 +77,14 @@ const borderOutside = ({
|
|
|
74
77
|
z-index: ${zIndex || ""};
|
|
75
78
|
}
|
|
76
79
|
`;
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
const b2FontMirror = import_ds_system.css`
|
|
81
|
+
font-size: 0.8125rem;
|
|
82
|
+
line-height: 1rem;
|
|
83
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
84
|
+
font-size: 1rem;
|
|
85
|
+
line-height: 1.2307692308rem;
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
80
88
|
const commonPillWrapperCss = import_ds_system.css`
|
|
81
89
|
position: relative;
|
|
82
90
|
|
|
@@ -93,15 +101,9 @@ const commonPillWrapperCss = import_ds_system.css`
|
|
|
93
101
|
height: fit-content;
|
|
94
102
|
place-items: start normal;
|
|
95
103
|
|
|
96
|
-
font-size
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
font-size: 1rem;
|
|
100
|
-
}
|
|
101
|
-
line-height: ${lineHeight17Base16}rem;
|
|
102
|
-
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
103
|
-
line-height: ${lineHeight17Base13}rem;
|
|
104
|
-
}
|
|
104
|
+
/** PUI typography: the pill label owns b2 via styled(DSTypography); font-size/line-height no
|
|
105
|
+
* longer live here. Only the InputPill wrapper re-adds b2 (see b2FontMirror) for its
|
|
106
|
+
* consumer-rendered input. color + font-weight stay here for inheritance into the label. */
|
|
105
107
|
user-select: ${({ disabled, applyAriaDisabled }) => disabled || applyAriaDisabled ? "none" : "auto"};
|
|
106
108
|
color: ${({ theme }) => theme.colors.brand["800"]};
|
|
107
109
|
word-break: break-word;
|
|
@@ -138,6 +140,9 @@ const StyledInputPillWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid,
|
|
|
138
140
|
slot: import_constants.PILL_V2_SLOTS.WRAPPER
|
|
139
141
|
})`
|
|
140
142
|
${commonPillWrapperCss}
|
|
143
|
+
/** The only place the b2 mirror is still needed: the input is a consumer render-prop, not a
|
|
144
|
+
* DSTypography component. All other pill text nodes own b2 via styled(DSTypography). */
|
|
145
|
+
${b2FontMirror}
|
|
141
146
|
|
|
142
147
|
background: ${(props) => props.theme.colors.neutral["000"]};
|
|
143
148
|
padding: 0;
|
|
@@ -155,22 +160,55 @@ const StyledInputPillWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid,
|
|
|
155
160
|
${(props) => props.inputHasFocus ? borderOutside({ color: props.theme.colors.brand[500] }) : ""}
|
|
156
161
|
}
|
|
157
162
|
|
|
158
|
-
|
|
163
|
+
/** DSInputText renders its own bordered wrapper (StyledInputWrapper, slot "root"). The pill owns the
|
|
164
|
+
* border/background/focus-ring, so strip the wrapper's chrome and let it size to the input. */
|
|
165
|
+
& .DSInputtext-root {
|
|
166
|
+
border: none !important;
|
|
167
|
+
/* DSInputText draws its own focus ring as an inset outline on this wrapper; suppress it so only
|
|
168
|
+
* the pill's :focus-within border (below) shows, exactly as the legacy DSInput did. */
|
|
169
|
+
outline: none !important;
|
|
170
|
+
border-radius: 0 !important;
|
|
171
|
+
background: transparent !important;
|
|
172
|
+
min-height: 0 !important;
|
|
173
|
+
padding: 0 !important;
|
|
174
|
+
width: 100%;
|
|
175
|
+
/* Fill the pill row so the input stretches to the full height (as the legacy wrapper did),
|
|
176
|
+
* keeping the typed value vertically centered when the clear button grows the row. */
|
|
177
|
+
height: 100%;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** The input is a consumer render-prop (DSInputText's native input by default). Match the legacy
|
|
181
|
+
* visual exactly: transparent, borderless, pill-controlled width, no padding, 8px left margin.
|
|
182
|
+
* DSInputText adds its own padding, themed font-family and an italic placeholder — neutralize those
|
|
183
|
+
* so the typed value and placeholder render identically to the previous DSInput. */
|
|
184
|
+
& input {
|
|
159
185
|
outline: none !important;
|
|
160
186
|
border: none !important;
|
|
161
187
|
box-shadow: none !important;
|
|
162
188
|
border-radius: 0 !important;
|
|
163
189
|
height: 100%;
|
|
164
190
|
background: transparent;
|
|
165
|
-
width: ${(props) => `${props.inputWidth
|
|
191
|
+
width: ${(props) => `${props.inputWidth}px`};
|
|
166
192
|
padding: 0;
|
|
167
193
|
margin: 0 0 0 8px;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
height:
|
|
194
|
+
/* Inherit the wrapper's b2 line-height so the empty field keeps its previous height; revert
|
|
195
|
+
* DSInputText's themed font-family/color/placeholder back to the UA defaults the legacy DSInput
|
|
196
|
+
* rendered with, so the typed value and placeholder look identical. */
|
|
197
|
+
line-height: inherit;
|
|
198
|
+
font-family: revert;
|
|
199
|
+
color: revert;
|
|
200
|
+
|
|
201
|
+
::placeholder {
|
|
202
|
+
color: revert;
|
|
203
|
+
font-style: revert;
|
|
204
|
+
font-weight: revert;
|
|
205
|
+
}
|
|
172
206
|
}
|
|
173
207
|
`;
|
|
208
|
+
const StyledDSInputText = (0, import_ds_system.styled)(import_ds_form_input_text.DSInputText, {
|
|
209
|
+
name: import_constants.DSPillV2Name,
|
|
210
|
+
slot: import_constants.PILL_V2_SLOTS.PILL_INPUT
|
|
211
|
+
})``;
|
|
174
212
|
const StyledDropdownPillWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSPillV2Name, slot: import_constants.PILL_V2_SLOTS.WRAPPER })`
|
|
175
213
|
${commonPillWrapperCss}
|
|
176
214
|
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
@@ -264,8 +302,10 @@ const StyledPillGroup = (0, import_ds_system.styled)(import_ds_grid.Grid, { name
|
|
|
264
302
|
}
|
|
265
303
|
}
|
|
266
304
|
`;
|
|
267
|
-
const StyledSpanWithTooltip = import_ds_system.styled.
|
|
305
|
+
const StyledSpanWithTooltip = (0, import_ds_system.styled)(import_ds_typography.DSTypography, { name: import_constants.DSPillV2Name, slot: import_constants.PILL_V2_SLOTS.LABEL })`
|
|
268
306
|
${commonSpanStyles}
|
|
307
|
+
/** b2 hardcodes font-weight 400; inherit so the per-pill-type weight (semibold/regular) wins. */
|
|
308
|
+
font-weight: inherit;
|
|
269
309
|
outline: none;
|
|
270
310
|
:focus {
|
|
271
311
|
${(props) => borderOutside({ color: props.theme.colors.brand[700], size: 2, zIndex: 3 })}
|
|
@@ -353,7 +393,9 @@ const StyledAgnosticPillRegion = import_ds_system.styled.div`
|
|
|
353
393
|
display: flex;
|
|
354
394
|
padding: 2px;
|
|
355
395
|
`;
|
|
356
|
-
const StyledTextWrapper = import_ds_system.styled.
|
|
396
|
+
const StyledTextWrapper = (0, import_ds_system.styled)(import_ds_typography.DSTypography, { name: import_constants.DSPillV2Name, slot: import_constants.PILL_V2_SLOTS.LABEL })`
|
|
357
397
|
${commonSpanStyles}
|
|
398
|
+
/** b2 hardcodes font-weight 400; inherit so the per-pill-type weight (semibold/regular) wins. */
|
|
399
|
+
font-weight: inherit;
|
|
358
400
|
`;
|
|
359
401
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/styled.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSMenuButton } from '@elliemae/ds-menu-button';\nimport { css, styled } from '@elliemae/ds-system';\nimport { PILL_V2_SLOTS, DSPillV2Name } from '../constants/index.js';\nimport { PILL_BUTTON_SLOTS } from '../parts/DSPillButton/constants/index.js';\nimport { PILL_GROUP_SLOTS } from '../parts/DSPillGroup/constants/index.js';\n\n// =============================================================================\n// Common CSS\n// =============================================================================\n\nexport const borderOutside = ({\n color,\n size = 1,\n zIndex = 0,\n borderRadius = '12px',\n}: {\n color: string;\n size?: number;\n zIndex?: number;\n borderRadius?: string;\n}) => css<{ disabled?: boolean; applyAriaDisabled?: boolean; readOnly?: boolean }>`\n :after {\n content: ' ';\n position: absolute;\n top: -${size}px;\n left: -${size}px;\n right: -${size}px;\n bottom: -${size}px;\n border: ${size}px solid ${color};\n border-top-left-radius: ${borderRadius};\n border-top-right-radius: ${borderRadius};\n border-bottom-left-radius: ${borderRadius};\n border-bottom-right-radius: ${borderRadius};\n pointer-events: none;\n z-index: ${zIndex || ''};\n }\n`;\n\nconst fontSize13Base16 = 13 / 16;\nconst lineHeight17Base13 = 17 / 13;\nconst lineHeight17Base16 = 17 / 16;\nconst commonPillWrapperCss = css<{\n pillSize: 'm' | 's';\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n readOnly?: boolean;\n}>`\n position: relative;\n\n width: fit-content;\n\n background-color: ${({ theme }) => theme.colors.brand[250]};\n\n outline: none;\n\n padding: 0px 12px 0 12px;\n\n border-radius: 12px;\n\n height: fit-content;\n place-items: start normal;\n\n font-size: 1rem;\n font-size: ${fontSize13Base16}rem;\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: 1rem;\n }\n line-height: ${lineHeight17Base16}rem;\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n line-height: ${lineHeight17Base13}rem;\n }\n user-select: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'none' : 'auto')};\n color: ${({ theme }) => theme.colors.brand['800']};\n word-break: break-word;\n`;\n\nconst commonSpanStyles = css<{ pillSize: 'm' | 's' }>`\n display: grid;\n padding: ${(props) => (props?.pillSize === 'm' ? '4px 0' : '1px 0')};\n align-self: center;\n`;\n\ninterface InputPillWrapperProps {\n value: string;\n inputWidth: number;\n inputHasFocus: boolean;\n hasError: boolean;\n pillSize: 'm' | 's';\n disabled?: boolean;\n}\n\n// =============================================================================\n// Pills wrappers\n// =============================================================================\n\nexport const StyledLabelPillWrapper = styled(Grid, { name: DSPillV2Name, slot: PILL_V2_SLOTS.WRAPPER })<{\n pillSize: 'm' | 's';\n hasIcon: boolean;\n applyAriaDisabled?: boolean;\n readOnly?: boolean;\n}>`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\nexport const StyledLabelOnlyPillWrapper = styled(Grid, { name: DSPillV2Name, slot: PILL_V2_SLOTS.WRAPPER })<{\n pillSize: 'm' | 's';\n hasIcon: boolean;\n applyAriaDisabled?: boolean;\n}>`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\ntype StyledValuePillWrapperPropsT = {\n pillSize: 'm' | 's';\n hasIcon: boolean;\n hasIconRight: boolean;\n applyAriaDisabled: boolean;\n};\n\nexport const StyledValuePillWrapper = styled(Grid, {\n name: DSPillV2Name,\n slot: PILL_V2_SLOTS.WRAPPER,\n})<StyledValuePillWrapperPropsT>`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n padding-right: ${(props) => (props.hasIconRight ? '0px !important' : '12px')};\n`;\n\nexport const StyledInputPillWrapper = styled(Grid, {\n name: DSPillV2Name,\n slot: PILL_V2_SLOTS.WRAPPER,\n})<InputPillWrapperProps>`\n ${commonPillWrapperCss}\n\n background: ${(props) => props.theme.colors.neutral['000']};\n padding: 0;\n\n ${({ theme, hasError }) => {\n if (hasError) return borderOutside({ color: theme.colors.danger[900] });\n return borderOutside({ color: theme.colors.brand[500] });\n }}\n\n :focus-within {\n ${(props) => (props.inputHasFocus ? borderOutside({ color: props.theme.colors.brand[700], size: 2 }) : '')}\n }\n\n :active {\n ${(props) => (props.inputHasFocus ? borderOutside({ color: props.theme.colors.brand[500] }) : '')}\n }\n\n & .em-ds-input {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n border-radius: 0 !important;\n height: 100%;\n background: transparent;\n width: ${(props) => `${props.inputWidth + (props.value === '' ? 24 : 0)}px`};\n padding: 0;\n margin: 0 0 0 8px;\n }\n\n & .em-ds-input__tooltip-ref {\n height: 100%;\n }\n`;\n\nexport const StyledDropdownPillWrapper = styled(Grid, { name: DSPillV2Name, slot: PILL_V2_SLOTS.WRAPPER })<{\n pillSize: 'm' | 's';\n}>`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n\n padding: 0 0 0 12px;\n`;\n\ntype StyledMenuButtonPillWrapperPropsT = {\n pillSize: 'm' | 's';\n hasIconRight: boolean;\n hasIconLeft: boolean;\n disabled?: boolean;\n};\n\nexport const StyledReadonlyPillWrapper = styled(Grid, {\n name: DSPillV2Name,\n slot: PILL_V2_SLOTS.WRAPPER,\n})<StyledMenuButtonPillWrapperPropsT>`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-right: ${(props) => (props.hasIconRight ? '0 !important' : '12px')};\n padding-left: ${(props) => (props.hasIconLeft ? '0 !important' : '12px')};\n`;\n\ntype StyledRemovablePillWrapperPropsT = {\n pillSize: 'm' | 's';\n disabled: boolean;\n applyAriaDisabled: boolean;\n hasIcon: boolean;\n};\n\nexport const StyledRemovablePillWrapper = styled(Grid, {\n name: DSPillV2Name,\n slot: PILL_V2_SLOTS.WRAPPER,\n})<StyledRemovablePillWrapperPropsT>`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n padding-right: 0px;\n`;\n\n// =============================================================================\n// Pill group\n// =============================================================================\n\nexport const StyledPillGroup = styled(Grid, { name: DSPillV2Name, slot: PILL_GROUP_SLOTS.PILL_GROUP })`\n width: ${({ width }) => width};\n display: flex;\n flex-wrap: wrap;\n row-gap: 8px;\n\n // Pill edges\n & .ds-pill-wrapper {\n &:not(:first-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n &:not(:last-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n\n // Pill paddings to the left / right\n & .ds-pill-wrapper-label,\n & .ds-pill-wrapper-value,\n & .ds-pill-wrapper-readonly {\n &:not(:first-of-type) {\n padding-left: 8px;\n }\n &:not(:last-of-type) {\n padding-right: 8px;\n }\n }\n\n & .ds-pill-wrapper-removable:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper-dropdown:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper {\n :not(:first-of-type) {\n .ds-pill-button-left {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n :not(:last-of-type) {\n .ds-pill-button-right {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n`;\n\n// =============================================================================\n// Extra stuff\n// =============================================================================\n\nexport const StyledSpanWithTooltip = styled.span<{ pillSize: 'm' | 's' }>`\n ${commonSpanStyles}\n outline: none;\n :focus {\n ${(props) => borderOutside({ color: props.theme.colors.brand[700], size: 2, zIndex: 3 })}\n }\n`;\n\nexport const StyledPillButton = styled(DSButtonV3, {\n name: DSPillV2Name,\n slot: PILL_BUTTON_SLOTS.PILL_BUTTON,\n preserveLegacyDataTestId: true,\n})<{\n width: string | number;\n height: string | number;\n}>`\n display: grid;\n place-items: center;\n\n position: relative;\n\n padding: 0;\n ${({ width, height, theme }) => {\n if (String(width).includes('px') && String(height).includes('px'))\n return `\n width: ${parseInt(width as string, 10) / 13}rem;\n height: ${parseInt(height as string, 10) / 13}rem;\n\n @media (max-width: ${theme.breakpoints?.small}) {\n width: ${parseInt(width as string, 10) / 16}rem;\n height: ${parseInt(height as string, 10) / 16}rem;\n }`;\n\n return `\n width: ${width};\n height: ${height};\n `;\n }}\n\n border-radius: 12px;\n\n :focus {\n ${(props) => borderOutside({ color: props.theme.colors.brand[700], size: 2, zIndex: 1, borderRadius: 'inherit' })}\n }\n\n cursor: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'not-allowed' : 'default')};\n\n :hover {\n background-color: ${({ disabled, applyAriaDisabled, theme }) =>\n disabled || applyAriaDisabled ? 'transparent' : theme.colors.brand[200]};\n }\n\n & svg {\n fill: ${({ disabled, applyAriaDisabled, theme }) => {\n if (disabled) return '#5C6574';\n if (applyAriaDisabled) return theme.colors.neutral[500];\n return theme.colors.brand[700];\n }};\n }\n`;\n\nexport const StyledPillMenuButton = styled(DSMenuButton, { name: DSPillV2Name, slot: PILL_V2_SLOTS.PILL_MENU_BUTTON })<{\n width: string;\n height: string;\n}>`\n display: grid;\n place-items: center;\n\n position: relative;\n\n padding: 0;\n ${({ width, height, theme }) => {\n if (String(width).includes('px') && String(height).includes('px'))\n return `\n width: ${parseInt(width, 10) / 13}rem;\n height: ${parseInt(height, 10) / 13}rem;\n\n @media (max-width: ${theme.breakpoints?.small}) {\n width: ${parseInt(width, 10) / 16}rem;\n height: ${parseInt(height, 10) / 16}rem;\n }`;\n\n return `\n width: ${width};\n height: ${height};\n `;\n }}\n\n border-radius: 12px;\n\n :focus {\n ${(props) => borderOutside({ color: props.theme.colors.brand[700], size: 2, zIndex: 1, borderRadius: 'inherit' })}\n }\n\n cursor: pointer;\n`;\n\nexport const StyledAgnosticPillRegion = styled.div`\n display: flex;\n padding: 2px;\n`;\n\nexport const StyledTextWrapper = styled.span<{ pillSize: 'm' | 's' }>`\n ${commonSpanStyles}\n`;\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;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA2B;AAC3B,qBAAqB;AACrB,4BAA6B;AAC7B,uBAA4B;AAC5B,uBAA4C;AAC5C,IAAAA,oBAAkC;AAClC,IAAAA,oBAAiC;AAM1B,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,eAAe;AACjB,MAKM;AAAA;AAAA;AAAA;AAAA,YAIM,IAAI;AAAA,aACH,IAAI;AAAA,cACH,IAAI;AAAA,eACH,IAAI;AAAA,cACL,IAAI,YAAY,KAAK;AAAA,8BACL,YAAY;AAAA,+BACX,YAAY;AAAA,iCACV,YAAY;AAAA,kCACX,YAAY;AAAA;AAAA,eAE/B,UAAU,EAAE;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { DSInputText } from '@elliemae/ds-form-input-text';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSMenuButton } from '@elliemae/ds-menu-button';\nimport { css, styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { PILL_V2_SLOTS, DSPillV2Name } from '../constants/index.js';\nimport { PILL_BUTTON_SLOTS } from '../parts/DSPillButton/constants/index.js';\nimport { PILL_GROUP_SLOTS } from '../parts/DSPillGroup/constants/index.js';\n\n// =============================================================================\n// Common CSS\n// =============================================================================\n\nexport const borderOutside = ({\n color,\n size = 1,\n zIndex = 0,\n borderRadius = '12px',\n}: {\n color: string;\n size?: number;\n zIndex?: number;\n borderRadius?: string;\n}) => css<{ disabled?: boolean; applyAriaDisabled?: boolean; readOnly?: boolean }>`\n :after {\n content: ' ';\n position: absolute;\n top: -${size}px;\n left: -${size}px;\n right: -${size}px;\n bottom: -${size}px;\n border: ${size}px solid ${color};\n border-top-left-radius: ${borderRadius};\n border-top-right-radius: ${borderRadius};\n border-bottom-left-radius: ${borderRadius};\n border-bottom-right-radius: ${borderRadius};\n pointer-events: none;\n z-index: ${zIndex || ''};\n }\n`;\n\n/**\n * b2 typography mirrored as raw CSS \u2014 kept ONLY for the InputPill, whose input is a consumer\n * render-prop (`inputRender`) and cannot be a DSTypography component. Every other pill text node\n * renders via `styled(DSTypography)` variant=\"b2\". Keep in sync with ds-typography b2 (font-size\n * 13px, line-height 16px at both the mobile 16px and desktop 13px roots). End-state: consume an\n * exported ds-typography b2 css mixin instead of mirroring.\n */\nconst b2FontMirror = css`\n font-size: 0.8125rem;\n line-height: 1rem;\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: 1rem;\n line-height: 1.2307692308rem;\n }\n`;\nconst commonPillWrapperCss = css<{\n pillSize: 'm' | 's';\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n readOnly?: boolean;\n}>`\n position: relative;\n\n width: fit-content;\n\n background-color: ${({ theme }) => theme.colors.brand[250]};\n\n outline: none;\n\n padding: 0px 12px 0 12px;\n\n border-radius: 12px;\n\n height: fit-content;\n place-items: start normal;\n\n /** PUI typography: the pill label owns b2 via styled(DSTypography); font-size/line-height no\n * longer live here. Only the InputPill wrapper re-adds b2 (see b2FontMirror) for its\n * consumer-rendered input. color + font-weight stay here for inheritance into the label. */\n user-select: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'none' : 'auto')};\n color: ${({ theme }) => theme.colors.brand['800']};\n word-break: break-word;\n`;\n\nconst commonSpanStyles = css<{ pillSize: 'm' | 's' }>`\n display: grid;\n padding: ${(props) => (props?.pillSize === 'm' ? '4px 0' : '1px 0')};\n align-self: center;\n`;\n\ninterface InputPillWrapperProps {\n value: string;\n inputWidth: number;\n inputHasFocus: boolean;\n hasError: boolean;\n pillSize: 'm' | 's';\n disabled?: boolean;\n}\n\n// =============================================================================\n// Pills wrappers\n// =============================================================================\n\nexport const StyledLabelPillWrapper = styled(Grid, { name: DSPillV2Name, slot: PILL_V2_SLOTS.WRAPPER })<{\n pillSize: 'm' | 's';\n hasIcon: boolean;\n applyAriaDisabled?: boolean;\n readOnly?: boolean;\n}>`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\nexport const StyledLabelOnlyPillWrapper = styled(Grid, { name: DSPillV2Name, slot: PILL_V2_SLOTS.WRAPPER })<{\n pillSize: 'm' | 's';\n hasIcon: boolean;\n applyAriaDisabled?: boolean;\n}>`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\ntype StyledValuePillWrapperPropsT = {\n pillSize: 'm' | 's';\n hasIcon: boolean;\n hasIconRight: boolean;\n applyAriaDisabled: boolean;\n};\n\nexport const StyledValuePillWrapper = styled(Grid, {\n name: DSPillV2Name,\n slot: PILL_V2_SLOTS.WRAPPER,\n})<StyledValuePillWrapperPropsT>`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n padding-right: ${(props) => (props.hasIconRight ? '0px !important' : '12px')};\n`;\n\nexport const StyledInputPillWrapper = styled(Grid, {\n name: DSPillV2Name,\n slot: PILL_V2_SLOTS.WRAPPER,\n})<InputPillWrapperProps>`\n ${commonPillWrapperCss}\n /** The only place the b2 mirror is still needed: the input is a consumer render-prop, not a\n * DSTypography component. All other pill text nodes own b2 via styled(DSTypography). */\n ${b2FontMirror}\n\n background: ${(props) => props.theme.colors.neutral['000']};\n padding: 0;\n\n ${({ theme, hasError }) => {\n if (hasError) return borderOutside({ color: theme.colors.danger[900] });\n return borderOutside({ color: theme.colors.brand[500] });\n }}\n\n :focus-within {\n ${(props) => (props.inputHasFocus ? borderOutside({ color: props.theme.colors.brand[700], size: 2 }) : '')}\n }\n\n :active {\n ${(props) => (props.inputHasFocus ? borderOutside({ color: props.theme.colors.brand[500] }) : '')}\n }\n\n /** DSInputText renders its own bordered wrapper (StyledInputWrapper, slot \"root\"). The pill owns the\n * border/background/focus-ring, so strip the wrapper's chrome and let it size to the input. */\n & .DSInputtext-root {\n border: none !important;\n /* DSInputText draws its own focus ring as an inset outline on this wrapper; suppress it so only\n * the pill's :focus-within border (below) shows, exactly as the legacy DSInput did. */\n outline: none !important;\n border-radius: 0 !important;\n background: transparent !important;\n min-height: 0 !important;\n padding: 0 !important;\n width: 100%;\n /* Fill the pill row so the input stretches to the full height (as the legacy wrapper did),\n * keeping the typed value vertically centered when the clear button grows the row. */\n height: 100%;\n }\n\n /** The input is a consumer render-prop (DSInputText's native input by default). Match the legacy\n * visual exactly: transparent, borderless, pill-controlled width, no padding, 8px left margin.\n * DSInputText adds its own padding, themed font-family and an italic placeholder \u2014 neutralize those\n * so the typed value and placeholder render identically to the previous DSInput. */\n & input {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n border-radius: 0 !important;\n height: 100%;\n background: transparent;\n width: ${(props) => `${props.inputWidth}px`};\n padding: 0;\n margin: 0 0 0 8px;\n /* Inherit the wrapper's b2 line-height so the empty field keeps its previous height; revert\n * DSInputText's themed font-family/color/placeholder back to the UA defaults the legacy DSInput\n * rendered with, so the typed value and placeholder look identical. */\n line-height: inherit;\n font-family: revert;\n color: revert;\n\n ::placeholder {\n color: revert;\n font-style: revert;\n font-weight: revert;\n }\n }\n`;\n\n// Only wraps the default input (no consumer `inputRender`) \u2014 that's the one case where the target is\n// a known, stable component and `styled(Component, {name, slot})` can apply, exposing `dsPillInput`.\nexport const StyledDSInputText = styled(DSInputText, {\n name: DSPillV2Name,\n slot: PILL_V2_SLOTS.PILL_INPUT,\n})``;\n\nexport const StyledDropdownPillWrapper = styled(Grid, { name: DSPillV2Name, slot: PILL_V2_SLOTS.WRAPPER })<{\n pillSize: 'm' | 's';\n}>`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n\n padding: 0 0 0 12px;\n`;\n\ntype StyledMenuButtonPillWrapperPropsT = {\n pillSize: 'm' | 's';\n hasIconRight: boolean;\n hasIconLeft: boolean;\n disabled?: boolean;\n};\n\nexport const StyledReadonlyPillWrapper = styled(Grid, {\n name: DSPillV2Name,\n slot: PILL_V2_SLOTS.WRAPPER,\n})<StyledMenuButtonPillWrapperPropsT>`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-right: ${(props) => (props.hasIconRight ? '0 !important' : '12px')};\n padding-left: ${(props) => (props.hasIconLeft ? '0 !important' : '12px')};\n`;\n\ntype StyledRemovablePillWrapperPropsT = {\n pillSize: 'm' | 's';\n disabled: boolean;\n applyAriaDisabled: boolean;\n hasIcon: boolean;\n};\n\nexport const StyledRemovablePillWrapper = styled(Grid, {\n name: DSPillV2Name,\n slot: PILL_V2_SLOTS.WRAPPER,\n})<StyledRemovablePillWrapperPropsT>`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n padding-right: 0px;\n`;\n\n// =============================================================================\n// Pill group\n// =============================================================================\n\nexport const StyledPillGroup = styled(Grid, { name: DSPillV2Name, slot: PILL_GROUP_SLOTS.PILL_GROUP })`\n width: ${({ width }) => width};\n display: flex;\n flex-wrap: wrap;\n row-gap: 8px;\n\n // Pill edges\n & .ds-pill-wrapper {\n &:not(:first-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n &:not(:last-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n\n // Pill paddings to the left / right\n & .ds-pill-wrapper-label,\n & .ds-pill-wrapper-value,\n & .ds-pill-wrapper-readonly {\n &:not(:first-of-type) {\n padding-left: 8px;\n }\n &:not(:last-of-type) {\n padding-right: 8px;\n }\n }\n\n & .ds-pill-wrapper-removable:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper-dropdown:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper {\n :not(:first-of-type) {\n .ds-pill-button-left {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n :not(:last-of-type) {\n .ds-pill-button-right {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n`;\n\n// =============================================================================\n// Extra stuff\n// =============================================================================\n\nexport const StyledSpanWithTooltip = styled(DSTypography, { name: DSPillV2Name, slot: PILL_V2_SLOTS.LABEL })<{\n pillSize: 'm' | 's';\n}>`\n ${commonSpanStyles}\n /** b2 hardcodes font-weight 400; inherit so the per-pill-type weight (semibold/regular) wins. */\n font-weight: inherit;\n outline: none;\n :focus {\n ${(props) => borderOutside({ color: props.theme.colors.brand[700], size: 2, zIndex: 3 })}\n }\n`;\n\nexport const StyledPillButton = styled(DSButtonV3, {\n name: DSPillV2Name,\n slot: PILL_BUTTON_SLOTS.PILL_BUTTON,\n preserveLegacyDataTestId: true,\n})<{\n width: string | number;\n height: string | number;\n}>`\n display: grid;\n place-items: center;\n\n position: relative;\n\n padding: 0;\n ${({ width, height, theme }) => {\n if (String(width).includes('px') && String(height).includes('px'))\n return `\n width: ${parseInt(width as string, 10) / 13}rem;\n height: ${parseInt(height as string, 10) / 13}rem;\n\n @media (max-width: ${theme.breakpoints?.small}) {\n width: ${parseInt(width as string, 10) / 16}rem;\n height: ${parseInt(height as string, 10) / 16}rem;\n }`;\n\n return `\n width: ${width};\n height: ${height};\n `;\n }}\n\n border-radius: 12px;\n\n :focus {\n ${(props) => borderOutside({ color: props.theme.colors.brand[700], size: 2, zIndex: 1, borderRadius: 'inherit' })}\n }\n\n cursor: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'not-allowed' : 'default')};\n\n :hover {\n background-color: ${({ disabled, applyAriaDisabled, theme }) =>\n disabled || applyAriaDisabled ? 'transparent' : theme.colors.brand[200]};\n }\n\n & svg {\n fill: ${({ disabled, applyAriaDisabled, theme }) => {\n if (disabled) return '#5C6574';\n if (applyAriaDisabled) return theme.colors.neutral[500];\n return theme.colors.brand[700];\n }};\n }\n`;\n\nexport const StyledPillMenuButton = styled(DSMenuButton, { name: DSPillV2Name, slot: PILL_V2_SLOTS.PILL_MENU_BUTTON })<{\n width: string;\n height: string;\n}>`\n display: grid;\n place-items: center;\n\n position: relative;\n\n padding: 0;\n ${({ width, height, theme }) => {\n if (String(width).includes('px') && String(height).includes('px'))\n return `\n width: ${parseInt(width, 10) / 13}rem;\n height: ${parseInt(height, 10) / 13}rem;\n\n @media (max-width: ${theme.breakpoints?.small}) {\n width: ${parseInt(width, 10) / 16}rem;\n height: ${parseInt(height, 10) / 16}rem;\n }`;\n\n return `\n width: ${width};\n height: ${height};\n `;\n }}\n\n border-radius: 12px;\n\n :focus {\n ${(props) => borderOutside({ color: props.theme.colors.brand[700], size: 2, zIndex: 1, borderRadius: 'inherit' })}\n }\n\n cursor: pointer;\n`;\n\nexport const StyledAgnosticPillRegion = styled.div`\n display: flex;\n padding: 2px;\n`;\n\nexport const StyledTextWrapper = styled(DSTypography, { name: DSPillV2Name, slot: PILL_V2_SLOTS.LABEL })<{\n pillSize: 'm' | 's';\n}>`\n ${commonSpanStyles}\n /** b2 hardcodes font-weight 400; inherit so the per-pill-type weight (semibold/regular) wins. */\n font-weight: inherit;\n`;\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;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA2B;AAC3B,gCAA4B;AAC5B,qBAAqB;AACrB,4BAA6B;AAC7B,uBAA4B;AAC5B,2BAA6B;AAC7B,uBAA4C;AAC5C,IAAAA,oBAAkC;AAClC,IAAAA,oBAAiC;AAM1B,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,eAAe;AACjB,MAKM;AAAA;AAAA;AAAA;AAAA,YAIM,IAAI;AAAA,aACH,IAAI;AAAA,cACH,IAAI;AAAA,eACH,IAAI;AAAA,cACL,IAAI,YAAY,KAAK;AAAA,8BACL,YAAY;AAAA,+BACX,YAAY;AAAA,iCACV,YAAY;AAAA,kCACX,YAAY;AAAA;AAAA,eAE/B,UAAU,EAAE;AAAA;AAAA;AAW3B,M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AAA;AAAA;AAIE,MAAM,2BAAuB,yBAAO,oCAAc,EAAE,MAAM,+BAAc,MAAM,+BAAc,iBAAiB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUjH,CAAC,EAAE,OAAO,QAAQ,MAAM,MAAM;AAC9B,MAAI,OAAO,KAAK,EAAE,SAAS,IAAI,KAAK,OAAO,MAAM,EAAE,SAAS,IAAI;AAC9D,WAAO;AAAA,eACE,SAAS,OAAO,EAAE,IAAI,EAAE;AAAA,cACzB,SAAS,QAAQ,EAAE,IAAI,EAAE;AAAA;AAAA,yBAEd,MAAM,aAAa,KAAK;AAAA,eAClC,SAAS,OAAO,EAAE,IAAI,EAAE;AAAA,gBACvB,SAAS,QAAQ,EAAE,IAAI,EAAE;AAAA;AAGrC,SAAO;AAAA,aACE,KAAK;AAAA,cACJ,MAAM;AAAA;AAElB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,MAKG,CAAC,UAAU,cAAc,EAAE,OAAO,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,MAAM,GAAG,QAAQ,GAAG,cAAc,UAAU,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAM9G,MAAM,2BAA2B,wBAAO;AAAA;AAAA;AAAA;AAKxC,MAAM,wBAAoB,yBAAO,mCAAc,EAAE,MAAM,+BAAc,MAAM,+BAAc,MAAM,CAAC;AAAA,IAGnG,gBAAgB;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": ["import_constants"]
|
|
7
7
|
}
|
|
@@ -36,63 +36,65 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_ds_dropdownmenu_v2 = require("@elliemae/ds-dropdownmenu-v2");
|
|
37
37
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
38
38
|
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
40
|
var import_react = __toESM(require("react"));
|
|
40
41
|
var import_uid = require("uid");
|
|
41
42
|
var import_DSPillButton = require("../../parts/DSPillButton/DSPillButton.js");
|
|
42
43
|
var import_TextComponent = require("../TextComponent.js");
|
|
43
44
|
var import_styled = require("../styled.js");
|
|
44
45
|
var import_constants = require("../../constants/index.js");
|
|
45
|
-
const DropdownPill = import_react.default.memo(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
);
|
|
46
|
+
const DropdownPill = import_react.default.memo((props) => {
|
|
47
|
+
const { label, size, labelTruncated, disableTruncationTooltip, dropdownProps, innerRef, ariaLabel, onDropdownClick } = props;
|
|
48
|
+
const ownerProps = (0, import_ds_props_helpers.useOwnerProps)(props);
|
|
49
|
+
const chevronRef = (0, import_react.useRef)(null);
|
|
50
|
+
const pillUid = (0, import_react.useMemo)(() => `ds-pill-${(0, import_uid.uid)()}`, []);
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
52
|
+
import_styled.StyledDropdownPillWrapper,
|
|
53
|
+
{
|
|
54
|
+
pillSize: size,
|
|
55
|
+
id: pillUid,
|
|
56
|
+
className: "ds-pill-wrapper ds-pill-wrapper-dropdown",
|
|
57
|
+
cols: ["auto", "minmax(24px, auto)"],
|
|
58
|
+
gutter: "2px",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyItems: "center",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
|
+
import_TextComponent.TextComponent,
|
|
64
|
+
{
|
|
65
|
+
pillSize: size,
|
|
66
|
+
getOwnerProps: ownerProps.getOwnerProps,
|
|
67
|
+
labelTruncated,
|
|
68
|
+
disableTruncationTooltip,
|
|
69
|
+
label
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
import_ds_dropdownmenu_v2.DSDropdownMenuV2,
|
|
74
|
+
{
|
|
75
|
+
placementOrderPreference: ["bottom-start", "bottom", "bottom-end", "right-end", "top-start", "top", "top-end"],
|
|
76
|
+
...dropdownProps,
|
|
77
|
+
onClickOutside: (e) => {
|
|
78
|
+
if ("code" in e && e.code === "Escape") chevronRef.current?.focus();
|
|
79
|
+
if (dropdownProps.onClickOutside) dropdownProps.onClickOutside(e);
|
|
80
|
+
},
|
|
81
|
+
wrapperStyles: { w: "100%", h: "100%" },
|
|
82
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledAgnosticPillRegion, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
import_DSPillButton.DSPillButton,
|
|
84
|
+
{
|
|
85
|
+
className: "ds-pill-focus-point",
|
|
86
|
+
"data-testid": import_constants.PILL_V2_DATA_TESTID.PILL_DROPDOWN_CHEVRON,
|
|
87
|
+
innerRef: (0, import_ds_system.mergeRefs)(chevronRef, innerRef),
|
|
88
|
+
"aria-label": ariaLabel || label,
|
|
89
|
+
type: "right",
|
|
90
|
+
onClick: onDropdownClick,
|
|
91
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.ChevronSmallDown, { color: ["brand-primary", "800"], width: 20, height: 20 })
|
|
92
|
+
}
|
|
93
|
+
) })
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
});
|
|
98
100
|
//# sourceMappingURL=DropdownPill.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/types/DropdownPill.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu-v2';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useMemo, useRef } from 'react';\nimport { uid } from 'uid';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\nimport { DSPillButton } from '../../parts/DSPillButton/DSPillButton.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledAgnosticPillRegion, StyledDropdownPillWrapper } from '../styled.js';\nimport { PILL_V2_DATA_TESTID } from '../../constants/index.js';\n\nexport const DropdownPill = React.memo<DSPillT.InternalProps>(\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu-v2';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useMemo, useRef } from 'react';\nimport { uid } from 'uid';\nimport type { DSPillT } from '../../react-desc-prop-types.js';\nimport { DSPillButton } from '../../parts/DSPillButton/DSPillButton.js';\nimport { TextComponent } from '../TextComponent.js';\nimport { StyledAgnosticPillRegion, StyledDropdownPillWrapper } from '../styled.js';\nimport { PILL_V2_DATA_TESTID } from '../../constants/index.js';\n\nexport const DropdownPill = React.memo<DSPillT.InternalProps>((props) => {\n const { label, size, labelTruncated, disableTruncationTooltip, dropdownProps, innerRef, ariaLabel, onDropdownClick } =\n props;\n const ownerProps = useOwnerProps(props);\n const chevronRef = useRef<HTMLButtonElement | null>(null);\n\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n return (\n <StyledDropdownPillWrapper\n pillSize={size}\n id={pillUid}\n className=\"ds-pill-wrapper ds-pill-wrapper-dropdown\"\n cols={['auto', 'minmax(24px, auto)']}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n >\n <TextComponent\n pillSize={size}\n getOwnerProps={ownerProps.getOwnerProps}\n labelTruncated={labelTruncated}\n disableTruncationTooltip={disableTruncationTooltip}\n label={label}\n />\n <DSDropdownMenuV2\n placementOrderPreference={['bottom-start', 'bottom', 'bottom-end', 'right-end', 'top-start', 'top', 'top-end']}\n {...dropdownProps}\n onClickOutside={(e) => {\n if ('code' in e && e.code === 'Escape') chevronRef.current?.focus();\n if (dropdownProps.onClickOutside) dropdownProps.onClickOutside(e);\n }}\n wrapperStyles={{ w: '100%', h: '100%' }}\n >\n <StyledAgnosticPillRegion>\n <DSPillButton\n className=\"ds-pill-focus-point\"\n data-testid={PILL_V2_DATA_TESTID.PILL_DROPDOWN_CHEVRON}\n innerRef={mergeRefs(chevronRef, innerRef as TypescriptHelpersT.AnyRef<HTMLButtonElement>)}\n aria-label={ariaLabel || label}\n type=\"right\"\n onClick={onDropdownClick}\n >\n <ChevronSmallDown color={['brand-primary', '800']} width={20} height={20} />\n </DSPillButton>\n </StyledAgnosticPillRegion>\n </DSDropdownMenuV2>\n </StyledDropdownPillWrapper>\n );\n});\n", "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