Skip to content

Commit

Permalink
feat(split-button): Make dividers consistent (#9298)
Browse files Browse the repository at this point in the history
**Related Issue:** #8142 

## Summary
Made the dividers look consistent for all split button appearances.
  • Loading branch information
josercarcamo authored May 14, 2024
1 parent d3cf99c commit 2fa432d
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 33 deletions.
100 changes: 80 additions & 20 deletions packages/calcite-components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3681,7 +3681,7 @@ export namespace Components {
"setFocus": () => Promise<void>;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickList {
/**
Expand Down Expand Up @@ -3737,7 +3737,7 @@ export namespace Components {
"setFocus": (focusId?: ListFocusId) => Promise<void>;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickListGroup {
/**
Expand All @@ -3750,7 +3750,7 @@ export namespace Components {
"headingLevel": HeadingLevel;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickListItem {
/**
Expand Down Expand Up @@ -5304,6 +5304,9 @@ export namespace Components {
SelectionMode
>;
}
/**
* @deprecated Use the `calcite-tile` component instead.
*/
interface CalciteTileSelect {
/**
* When `true`, the component is checked.
Expand Down Expand Up @@ -5358,6 +5361,9 @@ export namespace Components {
*/
"width": Extract<"auto" | "full", Width>;
}
/**
* @deprecated Use the `calcite-tile-group` component instead.
*/
interface CalciteTileSelectGroup {
/**
* When `true`, interaction is prevented and the component is displayed with lower opacity.
Expand Down Expand Up @@ -5398,6 +5404,9 @@ export namespace Components {
*/
"value": string;
}
/**
* @deprecated Use the `calcite-card`, `calcite-notice`, `calcite-panel`, or `calcite-tile` component instead.
*/
interface CalciteTip {
/**
* When `true`, the close button is not present on the component.
Expand Down Expand Up @@ -5428,12 +5437,18 @@ export namespace Components {
*/
"selected": boolean;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface CalciteTipGroup {
/**
* The component header text for all nested `calcite-tip`s.
*/
"groupTitle": string;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface CalciteTipManager {
/**
* When `true`, does not display or position the component.
Expand Down Expand Up @@ -5555,7 +5570,7 @@ export namespace Components {
"selectionMode": SelectionMode;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalciteValueList {
/**
Expand Down Expand Up @@ -5631,7 +5646,7 @@ export namespace Components {
"setFocus": (focusId?: ListFocusId) => Promise<void>;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalciteValueListItem {
/**
Expand Down Expand Up @@ -7026,7 +7041,7 @@ declare global {
"calciteListFilter": void;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalcitePickListElement extends Components.CalcitePickList, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalcitePickListElementEventMap>(type: K, listener: (this: HTMLCalcitePickListElement, ev: CalcitePickListCustomEvent<HTMLCalcitePickListElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand All @@ -7043,7 +7058,7 @@ declare global {
new (): HTMLCalcitePickListElement;
};
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalcitePickListGroupElement extends Components.CalcitePickListGroup, HTMLStencilElement {
}
Expand All @@ -7066,7 +7081,7 @@ declare global {
};
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalcitePickListItemElement extends Components.CalcitePickListItem, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalcitePickListItemElementEventMap>(type: K, listener: (this: HTMLCalcitePickListItemElement, ev: CalcitePickListItemCustomEvent<HTMLCalcitePickListItemElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -7555,6 +7570,9 @@ declare global {
interface HTMLCalciteTileSelectElementEventMap {
"calciteTileSelectChange": void;
}
/**
* @deprecated Use the `calcite-tile` component instead.
*/
interface HTMLCalciteTileSelectElement extends Components.CalciteTileSelect, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteTileSelectElementEventMap>(type: K, listener: (this: HTMLCalciteTileSelectElement, ev: CalciteTileSelectCustomEvent<HTMLCalciteTileSelectElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand All @@ -7569,6 +7587,9 @@ declare global {
prototype: HTMLCalciteTileSelectElement;
new (): HTMLCalciteTileSelectElement;
};
/**
* @deprecated Use the `calcite-tile-group` component instead.
*/
interface HTMLCalciteTileSelectGroupElement extends Components.CalciteTileSelectGroup, HTMLStencilElement {
}
var HTMLCalciteTileSelectGroupElement: {
Expand Down Expand Up @@ -7597,6 +7618,9 @@ declare global {
interface HTMLCalciteTipElementEventMap {
"calciteTipDismiss": void;
}
/**
* @deprecated Use the `calcite-card`, `calcite-notice`, `calcite-panel`, or `calcite-tile` component instead.
*/
interface HTMLCalciteTipElement extends Components.CalciteTip, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteTipElementEventMap>(type: K, listener: (this: HTMLCalciteTipElement, ev: CalciteTipCustomEvent<HTMLCalciteTipElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand All @@ -7611,6 +7635,9 @@ declare global {
prototype: HTMLCalciteTipElement;
new (): HTMLCalciteTipElement;
};
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface HTMLCalciteTipGroupElement extends Components.CalciteTipGroup, HTMLStencilElement {
}
var HTMLCalciteTipGroupElement: {
Expand All @@ -7620,6 +7647,9 @@ declare global {
interface HTMLCalciteTipManagerElementEventMap {
"calciteTipManagerClose": void;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface HTMLCalciteTipManagerElement extends Components.CalciteTipManager, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteTipManagerElementEventMap>(type: K, listener: (this: HTMLCalciteTipManagerElement, ev: CalciteTipManagerCustomEvent<HTMLCalciteTipManagerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -7694,7 +7724,7 @@ declare global {
"calciteListFilter": void;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalciteValueListElement extends Components.CalciteValueList, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteValueListElementEventMap>(type: K, listener: (this: HTMLCalciteValueListElement, ev: CalciteValueListCustomEvent<HTMLCalciteValueListElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand All @@ -7721,7 +7751,7 @@ declare global {
"calciteValueListItemDragHandleBlur": ListItemAndHandle;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalciteValueListItemElement extends Components.CalciteValueListItem, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteValueListItemElementEventMap>(type: K, listener: (this: HTMLCalciteValueListItemElement, ev: CalciteValueListItemCustomEvent<HTMLCalciteValueListItemElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -11540,7 +11570,7 @@ declare namespace LocalJSX {
"overlayPositioning"?: OverlayPositioning;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickList {
/**
Expand Down Expand Up @@ -11595,7 +11625,7 @@ declare namespace LocalJSX {
"selectionFollowsFocus"?: boolean;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickListGroup {
/**
Expand All @@ -11608,7 +11638,7 @@ declare namespace LocalJSX {
"headingLevel"?: HeadingLevel;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickListItem {
/**
Expand Down Expand Up @@ -13221,6 +13251,9 @@ declare namespace LocalJSX {
SelectionMode
>;
}
/**
* @deprecated Use the `calcite-tile` component instead.
*/
interface CalciteTileSelect {
/**
* When `true`, the component is checked.
Expand Down Expand Up @@ -13275,6 +13308,9 @@ declare namespace LocalJSX {
*/
"width"?: Extract<"auto" | "full", Width>;
}
/**
* @deprecated Use the `calcite-tile-group` component instead.
*/
interface CalciteTileSelectGroup {
/**
* When `true`, interaction is prevented and the component is displayed with lower opacity.
Expand Down Expand Up @@ -13314,6 +13350,9 @@ declare namespace LocalJSX {
*/
"value"?: string;
}
/**
* @deprecated Use the `calcite-card`, `calcite-notice`, `calcite-panel`, or `calcite-tile` component instead.
*/
interface CalciteTip {
/**
* When `true`, the close button is not present on the component.
Expand Down Expand Up @@ -13348,12 +13387,18 @@ declare namespace LocalJSX {
*/
"selected"?: boolean;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface CalciteTipGroup {
/**
* The component header text for all nested `calcite-tip`s.
*/
"groupTitle"?: string;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface CalciteTipManager {
/**
* When `true`, does not display or position the component.
Expand Down Expand Up @@ -13487,7 +13532,7 @@ declare namespace LocalJSX {
"selectionMode"?: SelectionMode;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalciteValueList {
/**
Expand Down Expand Up @@ -13566,7 +13611,7 @@ declare namespace LocalJSX {
"selectionFollowsFocus"?: boolean;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalciteValueListItem {
/**
Expand Down Expand Up @@ -13813,15 +13858,15 @@ declare module "@stencil/core" {
"calcite-pagination": LocalJSX.CalcitePagination & JSXBase.HTMLAttributes<HTMLCalcitePaginationElement>;
"calcite-panel": LocalJSX.CalcitePanel & JSXBase.HTMLAttributes<HTMLCalcitePanelElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-pick-list": LocalJSX.CalcitePickList & JSXBase.HTMLAttributes<HTMLCalcitePickListElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-pick-list-group": LocalJSX.CalcitePickListGroup & JSXBase.HTMLAttributes<HTMLCalcitePickListGroupElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-pick-list-item": LocalJSX.CalcitePickListItem & JSXBase.HTMLAttributes<HTMLCalcitePickListItemElement>;
"calcite-popover": LocalJSX.CalcitePopover & JSXBase.HTMLAttributes<HTMLCalcitePopoverElement>;
Expand Down Expand Up @@ -13855,21 +13900,36 @@ declare module "@stencil/core" {
"calcite-text-area": LocalJSX.CalciteTextArea & JSXBase.HTMLAttributes<HTMLCalciteTextAreaElement>;
"calcite-tile": LocalJSX.CalciteTile & JSXBase.HTMLAttributes<HTMLCalciteTileElement>;
"calcite-tile-group": LocalJSX.CalciteTileGroup & JSXBase.HTMLAttributes<HTMLCalciteTileGroupElement>;
/**
* @deprecated Use the `calcite-tile` component instead.
*/
"calcite-tile-select": LocalJSX.CalciteTileSelect & JSXBase.HTMLAttributes<HTMLCalciteTileSelectElement>;
/**
* @deprecated Use the `calcite-tile-group` component instead.
*/
"calcite-tile-select-group": LocalJSX.CalciteTileSelectGroup & JSXBase.HTMLAttributes<HTMLCalciteTileSelectGroupElement>;
"calcite-time-picker": LocalJSX.CalciteTimePicker & JSXBase.HTMLAttributes<HTMLCalciteTimePickerElement>;
/**
* @deprecated Use the `calcite-card`, `calcite-notice`, `calcite-panel`, or `calcite-tile` component instead.
*/
"calcite-tip": LocalJSX.CalciteTip & JSXBase.HTMLAttributes<HTMLCalciteTipElement>;
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
"calcite-tip-group": LocalJSX.CalciteTipGroup & JSXBase.HTMLAttributes<HTMLCalciteTipGroupElement>;
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
"calcite-tip-manager": LocalJSX.CalciteTipManager & JSXBase.HTMLAttributes<HTMLCalciteTipManagerElement>;
"calcite-tooltip": LocalJSX.CalciteTooltip & JSXBase.HTMLAttributes<HTMLCalciteTooltipElement>;
"calcite-tree": LocalJSX.CalciteTree & JSXBase.HTMLAttributes<HTMLCalciteTreeElement>;
"calcite-tree-item": LocalJSX.CalciteTreeItem & JSXBase.HTMLAttributes<HTMLCalciteTreeItemElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-value-list": LocalJSX.CalciteValueList & JSXBase.HTMLAttributes<HTMLCalciteValueListElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-value-list-item": LocalJSX.CalciteValueListItem & JSXBase.HTMLAttributes<HTMLCalciteValueListItemElement>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,14 @@
}
}

:host([appearance="outline"]) {
--calcite-split-button-background: transparent;
}

:host([appearance="outline-fill"]) {
--calcite-split-button-background: theme("colors.background.foreground.1");
}

:host([appearance="outline"]),
:host([appearance="outline-fill"]) {
&:host([kind="brand"]),
&:host([kind="danger"]),
&:host([kind="neutral"]),
&:host([kind="inverse"]) {
--calcite-split-button-background: transparent;
}
&:host([kind="brand"]) {
--calcite-split-button-divider: theme("colors.brand");
}
Expand All @@ -70,7 +68,6 @@
}
&:host([kind="neutral"]) {
--calcite-split-button-divider: theme("borderColor.color.1");
--calcite-split-button-background: theme("borderColor.color.1");
}
&:host([kind="inverse"]) {
--calcite-split-button-divider: var(--calcite-color-inverse);
Expand Down Expand Up @@ -125,13 +122,15 @@
}

@include disabled() {
.divider-container {
@apply opacity-disabled;
}

calcite-dropdown > calcite-button {
@apply pointer-events-none;
}
&:host([appearance="outline-fill"]),
&:host([appearance="outline"]) {
.divider-container {
background-color: transparent;
}
}
}

@include base-component();

0 comments on commit 2fa432d

Please sign in to comment.