@activecollab/components 2.0.471 → 2.0.472
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/components/PillButton/Styles.js +3 -3
- package/dist/cjs/components/PillButton/Styles.js.map +1 -1
- package/dist/esm/components/PillButton/Styles.d.ts.map +1 -1
- package/dist/esm/components/PillButton/Styles.js +3 -3
- package/dist/esm/components/PillButton/Styles.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,12 +11,12 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
11
11
|
var StyledPillIcon = exports.StyledPillIcon = _styledComponents.default.span.withConfig({
|
|
12
12
|
displayName: "Styles__StyledPillIcon",
|
|
13
13
|
componentId: "sc-14yhio0-0"
|
|
14
|
-
})(["display:inline-flex;flex-shrink:0;color:var(--color-theme-600);
|
|
14
|
+
})(["display:inline-flex;flex-shrink:0;color:var(--color-theme-600);svg{width:18px;height:18px;fill:currentColor;}"]);
|
|
15
15
|
StyledPillIcon.displayName = "StyledPillIcon";
|
|
16
16
|
var StyledPillPlaceholder = exports.StyledPillPlaceholder = _styledComponents.default.span.withConfig({
|
|
17
17
|
displayName: "Styles__StyledPillPlaceholder",
|
|
18
18
|
componentId: "sc-14yhio0-1"
|
|
19
|
-
})(["overflow:hidden;text-overflow:ellipsis;
|
|
19
|
+
})(["overflow:hidden;text-overflow:ellipsis;"]);
|
|
20
20
|
StyledPillPlaceholder.displayName = "StyledPillPlaceholder";
|
|
21
21
|
var activeStyle = (0, _styledComponents.css)(["background-color:var(--pill-background-active);color:var(--color-primary);", "{color:var(--color-primary);}"], StyledPillIcon);
|
|
22
22
|
var hoverTextStyle = (0, _styledComponents.css)(["color:var(--color-theme-900);", "{color:var(--color-theme-900);}"], StyledPillIcon);
|
|
@@ -36,7 +36,7 @@ var compactStyle = (0, _styledComponents.css)(["", "{display:none;}"], StyledPil
|
|
|
36
36
|
var StyledPillButton = exports.StyledPillButton = _styledComponents.default.button.withConfig({
|
|
37
37
|
displayName: "Styles__StyledPillButton",
|
|
38
38
|
componentId: "sc-14yhio0-2"
|
|
39
|
-
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;padding:0 ", ";border:none;border-radius:var(--ac-br-rounded);font-size:0.875rem;font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none
|
|
39
|
+
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;padding:0 ", ";border:none;border-radius:var(--ac-br-rounded);font-size:0.875rem;font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none;&:focus{outline:none;}&:disabled{cursor:default;opacity:50%;pointer-events:none;}", " ", " ", " ", " ", " ", " &[aria-haspopup][aria-expanded=\"true\"],.c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"]{", "}"], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle, function (props) {
|
|
40
40
|
return props.$size === "small" ? "24px" : "26px";
|
|
41
41
|
}, function (props) {
|
|
42
42
|
return props.$inset === "tight" ? "6px" : "10px";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","_FontStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledPillIcon","exports","styled","span","withConfig","displayName","componentId","StyledPillPlaceholder","activeStyle","css","hoverTextStyle","toneStyle","tone","compactStyle","StyledPillButton","button","FontStyle","BoxSizingStyle","props","$size","$inset","$empty","$tone","$iconOnly","$compact","$active"],"sources":["../../../../src/components/PillButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillButtonProps } from \"./PillButton\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledPillButtonProps {\n $tone: NonNullable<PillButtonProps[\"tone\"]>;\n $active: boolean;\n $empty: boolean;\n $iconOnly: boolean;\n $compact: PillButtonProps[\"compact\"];\n $size: NonNullable<PillButtonProps[\"size\"]>;\n $inset: NonNullable<PillButtonProps[\"inset\"]>;\n}\n\nexport const StyledPillIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n color: var(--color-theme-600);\n
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","_FontStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledPillIcon","exports","styled","span","withConfig","displayName","componentId","StyledPillPlaceholder","activeStyle","css","hoverTextStyle","toneStyle","tone","compactStyle","StyledPillButton","button","FontStyle","BoxSizingStyle","props","$size","$inset","$empty","$tone","$iconOnly","$compact","$active"],"sources":["../../../../src/components/PillButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillButtonProps } from \"./PillButton\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledPillButtonProps {\n $tone: NonNullable<PillButtonProps[\"tone\"]>;\n $active: boolean;\n $empty: boolean;\n $iconOnly: boolean;\n $compact: PillButtonProps[\"compact\"];\n $size: NonNullable<PillButtonProps[\"size\"]>;\n $inset: NonNullable<PillButtonProps[\"inset\"]>;\n}\n\nexport const StyledPillIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n color: var(--color-theme-600);\n\n svg {\n width: 18px;\n height: 18px;\n fill: currentColor;\n }\n`;\n\nStyledPillIcon.displayName = \"StyledPillIcon\";\n\nexport const StyledPillPlaceholder = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nStyledPillPlaceholder.displayName = \"StyledPillPlaceholder\";\n\nconst activeStyle = css`\n background-color: var(--pill-background-active);\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n`;\n\nconst hoverTextStyle = css`\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: var(--color-theme-900);\n }\n`;\n\nconst toneStyle = (tone: StyledPillButtonProps[\"$tone\"]) => {\n switch (tone) {\n case \"alternate\":\n return css`\n background-color: var(--color-theme-300);\n\n &:hover,\n &:focus-visible {\n background-color: var(--color-theme-400);\n ${hoverTextStyle}\n }\n `;\n case \"ghost\":\n return css`\n background-color: transparent;\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:focus-visible {\n background-color: var(--pill-background);\n }\n\n .c-pill-host:hover &.c-pill-button--ghost:hover,\n &:hover {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n case \"outlined\":\n return css`\n background-color: transparent;\n border: 1px solid var(--color-theme-700);\n\n &:hover,\n &:focus-visible {\n border-color: var(--color-primary);\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n }\n `;\n default:\n return css`\n background-color: var(--pill-background);\n\n &:hover,\n &:focus-visible {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n }\n};\n\nconst compactStyle = css`\n ${StyledPillPlaceholder} {\n display: none;\n }\n`;\n\nexport const StyledPillButton = styled.button<StyledPillButtonProps>`\n ${FontStyle}\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-shrink: 0;\n max-width: 100%;\n height: ${(props) => (props.$size === \"small\" ? \"24px\" : \"26px\")};\n margin: 0;\n padding: 0 ${(props) => (props.$inset === \"tight\" ? \"6px\" : \"10px\")};\n border: none;\n border-radius: var(--ac-br-rounded);\n font-size: 0.875rem;\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n color: ${(props) =>\n props.$empty ? \"var(--color-theme-700)\" : \"var(--color-theme-800)\"};\n cursor: pointer;\n user-select: none;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n\n ${(props) => toneStyle(props.$tone)}\n\n ${(props) =>\n props.$tone === \"ghost\" &&\n props.$empty &&\n css`\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 0;\n }\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:hover,\n &:focus-visible,\n &[aria-expanded=\"true\"] {\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 1;\n }\n }\n `}\n\n ${(props) =>\n props.$iconOnly &&\n css`\n width: 36px;\n padding: 0;\n\n ${StyledPillIcon} svg {\n width: 16px;\n height: 16px;\n }\n `}\n\n ${(props) => props.$compact === true && compactStyle}\n\n ${(props) =>\n props.$compact === \"mobile\" &&\n css`\n @media (max-width: 768px) {\n ${compactStyle}\n }\n `}\n\n /* An active pill keeps its look on hover and focus. */\n ${(props) =>\n props.$active &&\n css`\n &,\n &:hover,\n &:focus-visible {\n ${activeStyle}\n }\n `}\n\n /* Last, so an open trigger shows the active look in every tone. */\n &[aria-haspopup][aria-expanded=\"true\"],\n .c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"] {\n ${activeStyle}\n }\n`;\n\nStyledPillButton.displayName = \"StyledPillButton\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAAyC,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA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D,UAACK,KAAK;EAAA,OACNA,KAAK,CAACO,OAAO,QACbhB,qBAAG,uCAIGD,WAAW,CAEhB;AAAA,GAKCA,WAAW,CAEhB;AAEDM,gBAAgB,CAACT,WAAW,GAAG,kBAAkB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/PillButton/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,UAAU,qBAAqB;IAC7B,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/PillButton/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,UAAU,qBAAqB;IAC7B,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,cAAc,qEAU1B,CAAC;AAIF,eAAO,MAAM,qBAAqB,qEAGjC,CAAC;AAkFF,eAAO,MAAM,gBAAgB,0FA2F5B,CAAC"}
|
|
@@ -4,12 +4,12 @@ import { FontStyle } from "../FontStyle";
|
|
|
4
4
|
export const StyledPillIcon = styled.span.withConfig({
|
|
5
5
|
displayName: "Styles__StyledPillIcon",
|
|
6
6
|
componentId: "sc-14yhio0-0"
|
|
7
|
-
})(["display:inline-flex;flex-shrink:0;color:var(--color-theme-600);
|
|
7
|
+
})(["display:inline-flex;flex-shrink:0;color:var(--color-theme-600);svg{width:18px;height:18px;fill:currentColor;}"]);
|
|
8
8
|
StyledPillIcon.displayName = "StyledPillIcon";
|
|
9
9
|
export const StyledPillPlaceholder = styled.span.withConfig({
|
|
10
10
|
displayName: "Styles__StyledPillPlaceholder",
|
|
11
11
|
componentId: "sc-14yhio0-1"
|
|
12
|
-
})(["overflow:hidden;text-overflow:ellipsis;
|
|
12
|
+
})(["overflow:hidden;text-overflow:ellipsis;"]);
|
|
13
13
|
StyledPillPlaceholder.displayName = "StyledPillPlaceholder";
|
|
14
14
|
const activeStyle = css(["background-color:var(--pill-background-active);color:var(--color-primary);", "{color:var(--color-primary);}"], StyledPillIcon);
|
|
15
15
|
const hoverTextStyle = css(["color:var(--color-theme-900);", "{color:var(--color-theme-900);}"], StyledPillIcon);
|
|
@@ -29,6 +29,6 @@ const compactStyle = css(["", "{display:none;}"], StyledPillPlaceholder);
|
|
|
29
29
|
export const StyledPillButton = styled.button.withConfig({
|
|
30
30
|
displayName: "Styles__StyledPillButton",
|
|
31
31
|
componentId: "sc-14yhio0-2"
|
|
32
|
-
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;padding:0 ", ";border:none;border-radius:var(--ac-br-rounded);font-size:0.875rem;font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none
|
|
32
|
+
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;padding:0 ", ";border:none;border-radius:var(--ac-br-rounded);font-size:0.875rem;font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none;&:focus{outline:none;}&:disabled{cursor:default;opacity:50%;pointer-events:none;}", " ", " ", " ", " ", " ", " &[aria-haspopup][aria-expanded=\"true\"],.c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"]{", "}"], FontStyle, BoxSizingStyle, props => props.$size === "small" ? "24px" : "26px", props => props.$inset === "tight" ? "6px" : "10px", props => props.$empty ? "var(--color-theme-700)" : "var(--color-theme-800)", props => toneStyle(props.$tone), props => props.$tone === "ghost" && props.$empty && css(["", ",", "{opacity:0;}.c-pill-host:hover &.c-pill-button--ghost,&:hover,&:focus-visible,&[aria-expanded=\"true\"]{", ",", "{opacity:1;}}"], StyledPillIcon, StyledPillPlaceholder, StyledPillIcon, StyledPillPlaceholder), props => props.$iconOnly && css(["width:36px;padding:0;", " svg{width:16px;height:16px;}"], StyledPillIcon), props => props.$compact === true && compactStyle, props => props.$compact === "mobile" && css(["@media (max-width:768px){", "}"], compactStyle), props => props.$active && css(["&,&:hover,&:focus-visible{", "}"], activeStyle), activeStyle);
|
|
33
33
|
StyledPillButton.displayName = "StyledPillButton";
|
|
34
34
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","StyledPillIcon","span","withConfig","displayName","componentId","StyledPillPlaceholder","activeStyle","hoverTextStyle","toneStyle","tone","compactStyle","StyledPillButton","button","props","$size","$inset","$empty","$tone","$iconOnly","$compact","$active"],"sources":["../../../../src/components/PillButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillButtonProps } from \"./PillButton\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledPillButtonProps {\n $tone: NonNullable<PillButtonProps[\"tone\"]>;\n $active: boolean;\n $empty: boolean;\n $iconOnly: boolean;\n $compact: PillButtonProps[\"compact\"];\n $size: NonNullable<PillButtonProps[\"size\"]>;\n $inset: NonNullable<PillButtonProps[\"inset\"]>;\n}\n\nexport const StyledPillIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n color: var(--color-theme-600);\n
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","StyledPillIcon","span","withConfig","displayName","componentId","StyledPillPlaceholder","activeStyle","hoverTextStyle","toneStyle","tone","compactStyle","StyledPillButton","button","props","$size","$inset","$empty","$tone","$iconOnly","$compact","$active"],"sources":["../../../../src/components/PillButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillButtonProps } from \"./PillButton\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledPillButtonProps {\n $tone: NonNullable<PillButtonProps[\"tone\"]>;\n $active: boolean;\n $empty: boolean;\n $iconOnly: boolean;\n $compact: PillButtonProps[\"compact\"];\n $size: NonNullable<PillButtonProps[\"size\"]>;\n $inset: NonNullable<PillButtonProps[\"inset\"]>;\n}\n\nexport const StyledPillIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n color: var(--color-theme-600);\n\n svg {\n width: 18px;\n height: 18px;\n fill: currentColor;\n }\n`;\n\nStyledPillIcon.displayName = \"StyledPillIcon\";\n\nexport const StyledPillPlaceholder = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nStyledPillPlaceholder.displayName = \"StyledPillPlaceholder\";\n\nconst activeStyle = css`\n background-color: var(--pill-background-active);\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n`;\n\nconst hoverTextStyle = css`\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: var(--color-theme-900);\n }\n`;\n\nconst toneStyle = (tone: StyledPillButtonProps[\"$tone\"]) => {\n switch (tone) {\n case \"alternate\":\n return css`\n background-color: var(--color-theme-300);\n\n &:hover,\n &:focus-visible {\n background-color: var(--color-theme-400);\n ${hoverTextStyle}\n }\n `;\n case \"ghost\":\n return css`\n background-color: transparent;\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:focus-visible {\n background-color: var(--pill-background);\n }\n\n .c-pill-host:hover &.c-pill-button--ghost:hover,\n &:hover {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n case \"outlined\":\n return css`\n background-color: transparent;\n border: 1px solid var(--color-theme-700);\n\n &:hover,\n &:focus-visible {\n border-color: var(--color-primary);\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n }\n `;\n default:\n return css`\n background-color: var(--pill-background);\n\n &:hover,\n &:focus-visible {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n }\n};\n\nconst compactStyle = css`\n ${StyledPillPlaceholder} {\n display: none;\n }\n`;\n\nexport const StyledPillButton = styled.button<StyledPillButtonProps>`\n ${FontStyle}\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-shrink: 0;\n max-width: 100%;\n height: ${(props) => (props.$size === \"small\" ? \"24px\" : \"26px\")};\n margin: 0;\n padding: 0 ${(props) => (props.$inset === \"tight\" ? \"6px\" : \"10px\")};\n border: none;\n border-radius: var(--ac-br-rounded);\n font-size: 0.875rem;\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n color: ${(props) =>\n props.$empty ? \"var(--color-theme-700)\" : \"var(--color-theme-800)\"};\n cursor: pointer;\n user-select: none;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n\n ${(props) => toneStyle(props.$tone)}\n\n ${(props) =>\n props.$tone === \"ghost\" &&\n props.$empty &&\n css`\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 0;\n }\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:hover,\n &:focus-visible,\n &[aria-expanded=\"true\"] {\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 1;\n }\n }\n `}\n\n ${(props) =>\n props.$iconOnly &&\n css`\n width: 36px;\n padding: 0;\n\n ${StyledPillIcon} svg {\n width: 16px;\n height: 16px;\n }\n `}\n\n ${(props) => props.$compact === true && compactStyle}\n\n ${(props) =>\n props.$compact === \"mobile\" &&\n css`\n @media (max-width: 768px) {\n ${compactStyle}\n }\n `}\n\n /* An active pill keeps its look on hover and focus. */\n ${(props) =>\n props.$active &&\n css`\n &,\n &:hover,\n &:focus-visible {\n ${activeStyle}\n }\n `}\n\n /* Last, so an open trigger shows the active look in every tone. */\n &[aria-haspopup][aria-expanded=\"true\"],\n .c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"] {\n ${activeStyle}\n }\n`;\n\nStyledPillButton.displayName = \"StyledPillButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAYxC,OAAO,MAAMC,cAAc,GAAGJ,MAAM,CAACK,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qHAUxC;AAEDJ,cAAc,CAACG,WAAW,GAAG,gBAAgB;AAE7C,OAAO,MAAME,qBAAqB,GAAGT,MAAM,CAACK,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+CAG/C;AAEDC,qBAAqB,CAACF,WAAW,GAAG,uBAAuB;AAE3D,MAAMG,WAAW,GAAGT,GAAG,kHAInBG,cAAc,CAGjB;AAED,MAAMO,cAAc,GAAGV,GAAG,uEAGtBG,cAAc,CAGjB;AAED,MAAMQ,SAAS,GAAIC,IAAoC,IAAK;EAC1D,QAAQA,IAAI;IACV,KAAK,WAAW;MACd,OAAOZ,GAAG,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Icon = styled__default["default"].span.withConfig({
|
|
27202
27202
|
displayName: "Styles__StyledPillIcon",
|
|
27203
27203
|
componentId: "sc-14yhio0-0"
|
|
27204
|
-
})(["display:inline-flex;flex-shrink:0;color:var(--color-theme-600);
|
|
27204
|
+
})(["display:inline-flex;flex-shrink:0;color:var(--color-theme-600);svg{width:18px;height:18px;fill:currentColor;}"]);
|
|
27205
27205
|
StyledPillIcon.displayName = "StyledPillIcon";
|
|
27206
27206
|
var StyledPillPlaceholder = styled__default["default"].span.withConfig({
|
|
27207
27207
|
displayName: "Styles__StyledPillPlaceholder",
|
|
27208
27208
|
componentId: "sc-14yhio0-1"
|
|
27209
|
-
})(["overflow:hidden;text-overflow:ellipsis;
|
|
27209
|
+
})(["overflow:hidden;text-overflow:ellipsis;"]);
|
|
27210
27210
|
StyledPillPlaceholder.displayName = "StyledPillPlaceholder";
|
|
27211
27211
|
var activeStyle = styled.css(["background-color:var(--pill-background-active);color:var(--color-primary);", "{color:var(--color-primary);}"], StyledPillIcon);
|
|
27212
27212
|
var hoverTextStyle = styled.css(["color:var(--color-theme-900);", "{color:var(--color-theme-900);}"], StyledPillIcon);
|
|
@@ -27226,7 +27226,7 @@
|
|
|
27226
27226
|
var StyledPillButton = styled__default["default"].button.withConfig({
|
|
27227
27227
|
displayName: "Styles__StyledPillButton",
|
|
27228
27228
|
componentId: "sc-14yhio0-2"
|
|
27229
|
-
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;padding:0 ", ";border:none;border-radius:var(--ac-br-rounded);font-size:0.875rem;font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none
|
|
27229
|
+
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;padding:0 ", ";border:none;border-radius:var(--ac-br-rounded);font-size:0.875rem;font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none;&:focus{outline:none;}&:disabled{cursor:default;opacity:50%;pointer-events:none;}", " ", " ", " ", " ", " ", " &[aria-haspopup][aria-expanded=\"true\"],.c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"]{", "}"], FontStyle, BoxSizingStyle, function (props) {
|
|
27230
27230
|
return props.$size === "small" ? "24px" : "26px";
|
|
27231
27231
|
}, function (props) {
|
|
27232
27232
|
return props.$inset === "tight" ? "6px" : "10px";
|