Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(popover): apply component tokens to arrow #10386

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/calcite-components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7104,7 +7104,7 @@ declare global {
new (): HTMLCalciteListItemElement;
};
interface HTMLCalciteListItemGroupElementEventMap {
"calciteInternalListItemGroupDefaultSlotChange": DragEvent;
"calciteInternalListItemGroupDefaultSlotChange": void;
}
interface HTMLCalciteListItemGroupElement extends Components.CalciteListItemGroup, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteListItemGroupElementEventMap>(type: K, listener: (this: HTMLCalciteListItemGroupElement, ev: CalciteListItemGroupCustomEvent<HTMLCalciteListItemGroupElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -7850,7 +7850,7 @@ declare global {
new (): HTMLCalciteTileSelectGroupElement;
};
interface HTMLCalciteTimePickerElementEventMap {
"calciteInternalTimePickerChange": string;
"calciteInternalTimePickerChange": void;
}
interface HTMLCalciteTimePickerElement extends Components.CalciteTimePicker, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteTimePickerElementEventMap>(type: K, listener: (this: HTMLCalciteTimePickerElement, ev: CalciteTimePickerCustomEvent<HTMLCalciteTimePickerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -11461,7 +11461,7 @@ declare namespace LocalJSX {
/**
* Fires when changes occur in the default slot, notifying parent lists of the changes.
*/
"onCalciteInternalListItemGroupDefaultSlotChange"?: (event: CalciteListItemGroupCustomEvent<DragEvent>) => void;
"onCalciteInternalListItemGroupDefaultSlotChange"?: (event: CalciteListItemGroupCustomEvent<void>) => void;
}
interface CalciteLoader {
/**
Expand Down Expand Up @@ -13813,7 +13813,7 @@ declare namespace LocalJSX {
* Specifies the Unicode numeral system used by the component for localization.
*/
"numberingSystem"?: NumberingSystem;
"onCalciteInternalTimePickerChange"?: (event: CalciteTimePickerCustomEvent<string>) => void;
"onCalciteInternalTimePickerChange"?: (event: CalciteTimePickerCustomEvent<void>) => void;
/**
* Specifies the size of the component.
*/
Expand Down
19 changes: 15 additions & 4 deletions packages/calcite-components/src/components/popover/popover.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
t9n,
themed,
} from "../../tests/commonTests";
import { FloatingCSS } from "../../utils/floating-ui";
import { CSS } from "./resources";

describe("calcite-popover", () => {
Expand Down Expand Up @@ -710,10 +711,16 @@ describe("calcite-popover", () => {
</calcite-popover>
`,
{
"--calcite-popover-background-color": {
shadowSelector: `.${CSS.container}`,
targetProp: "backgroundColor",
},
"--calcite-popover-background-color": [
{
shadowSelector: `.${CSS.container}`,
targetProp: "backgroundColor",
},
{
shadowSelector: `.${FloatingCSS.arrow}`,
targetProp: "fill",
},
],
"--calcite-popover-border-color": [
{
shadowSelector: `.${CSS.container}`,
Expand All @@ -723,6 +730,10 @@ describe("calcite-popover", () => {
shadowSelector: `.${CSS.header}`,
targetProp: "borderBlockEndColor",
},
{
shadowSelector: `.${FloatingCSS.arrow} .${FloatingCSS.arrowStroke}`,
Elijbet marked this conversation as resolved.
Show resolved Hide resolved
targetProp: "stroke",
},
],
"--calcite-popover-corner-radius": {
shadowSelector: `.${CSS.container}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
border-radius: var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));
}

.calcite-floating-ui-arrow {
fill: var(--calcite-popover-background-color, var(--calcite-color-foreground-1));
.calcite-floating-ui-arrow__stroke {
Elijbet marked this conversation as resolved.
Show resolved Hide resolved
stroke: var(--calcite-popover-border-color, var(--calcite-color-border-3));
}
}

.header {
@apply flex
flex-auto
Expand Down
2 changes: 2 additions & 0 deletions packages/calcite-components/src/utils/floating-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ export type FloatingLayout = Extract<Layout, "vertical" | "horizontal">;
export const FloatingCSS = {
animation: "calcite-floating-ui-anim",
animationActive: "calcite-floating-ui-anim--active",
arrow: "calcite-floating-ui-arrow",
arrowStroke: "calcite-floating-ui-arrow__stroke",
};

function getMiddleware({
Expand Down
Loading