diff --git a/packages/calcite-components/src/assets/styles/includes.scss b/packages/calcite-components/src/assets/styles/includes.scss index 30047710696..4032894b781 100644 --- a/packages/calcite-components/src/assets/styles/includes.scss +++ b/packages/calcite-components/src/assets/styles/includes.scss @@ -62,6 +62,10 @@ @apply opacity-100; } } + + .interaction-container { + display: contents; + } } // used for host-specific styling when the `disabled` mixin cannot be applied on the host (e.g., `display: contents`) diff --git a/packages/calcite-components/src/components.d.ts b/packages/calcite-components/src/components.d.ts index e13a2459e2f..f75b38aa453 100644 --- a/packages/calcite-components/src/components.d.ts +++ b/packages/calcite-components/src/components.d.ts @@ -4659,9 +4659,6 @@ export namespace Components { * Specifies the number of columns the component should span. */ "colSpan": number; - /** - * When true, prevents user interaction. Notes: This prop should use the - */ "disabled": boolean; /** * Use this property to override individual strings used by the component. @@ -12090,9 +12087,6 @@ declare namespace LocalJSX { * Specifies the number of columns the component should span. */ "colSpan"?: number; - /** - * When true, prevents user interaction. Notes: This prop should use the - */ "disabled"?: boolean; /** * Use this property to override individual strings used by the component. diff --git a/packages/calcite-components/src/components/action/action.tsx b/packages/calcite-components/src/components/action/action.tsx index f6491fbb0c9..e32b50045fc 100644 --- a/packages/calcite-components/src/components/action/action.tsx +++ b/packages/calcite-components/src/components/action/action.tsx @@ -17,6 +17,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { @@ -308,24 +309,26 @@ export class Action return ( - - - {this.renderIndicatorText()} + + + + {this.renderIndicatorText()} + ); } diff --git a/packages/calcite-components/src/components/block/block.tsx b/packages/calcite-components/src/components/block/block.tsx index b4c08e66dd4..1ae4072f4d6 100644 --- a/packages/calcite-components/src/components/block/block.tsx +++ b/packages/calcite-components/src/components/block/block.tsx @@ -21,6 +21,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { connectLocalized, disconnectLocalized, LocalizedComponent } from "../../utils/locale"; @@ -372,24 +373,26 @@ export class Block return ( -
- {headerNode} - -
+ {headerNode} + + +
); } diff --git a/packages/calcite-components/src/components/button/button.tsx b/packages/calcite-components/src/components/button/button.tsx index f9de70225ec..ec3f889c666 100644 --- a/packages/calcite-components/src/components/button/button.tsx +++ b/packages/calcite-components/src/components/button/button.tsx @@ -15,6 +15,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { connectLabel, disconnectLabel, getLabelText, LabelableComponent } from "../../utils/label"; @@ -272,35 +273,37 @@ export class Button ); return ( - - {loaderNode} - {this.iconStart ? iconStartEl : null} - {this.hasContent ? contentEl : null} - {this.iconEnd ? iconEndEl : null} - + + + {loaderNode} + {this.iconStart ? iconStartEl : null} + {this.hasContent ? contentEl : null} + {this.iconEnd ? iconEndEl : null} + + ); } diff --git a/packages/calcite-components/src/components/checkbox/checkbox.tsx b/packages/calcite-components/src/components/checkbox/checkbox.tsx index 7199fff7cdf..503d8fb8ce8 100644 --- a/packages/calcite-components/src/components/checkbox/checkbox.tsx +++ b/packages/calcite-components/src/components/checkbox/checkbox.tsx @@ -21,6 +21,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { isActivationKey } from "../../utils/key"; @@ -256,23 +257,25 @@ export class Checkbox render(): VNode { return ( - - + + + + ); } diff --git a/packages/calcite-components/src/components/chip-group/chip-group.tsx b/packages/calcite-components/src/components/chip-group/chip-group.tsx index 902c594e99e..5f33b1f8506 100644 --- a/packages/calcite-components/src/components/chip-group/chip-group.tsx +++ b/packages/calcite-components/src/components/chip-group/chip-group.tsx @@ -15,6 +15,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { createObserver } from "../../utils/observers"; @@ -241,19 +242,22 @@ export class ChipGroup implements InteractiveComponent { render(): VNode { const role = this.selectionMode === "none" || this.selectionMode === "multiple" ? "group" : "radiogroup"; + const { disabled } = this; return ( -
- (this.slotRefEl = el as HTMLSlotElement)} - /> -
+ +
+ (this.slotRefEl = el as HTMLSlotElement)} + /> +
+
); } } diff --git a/packages/calcite-components/src/components/chip/chip.tsx b/packages/calcite-components/src/components/chip/chip.tsx index af8ebdc3cc3..2f753088aba 100644 --- a/packages/calcite-components/src/components/chip/chip.tsx +++ b/packages/calcite-components/src/components/chip/chip.tsx @@ -39,6 +39,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { connectLocalized, disconnectLocalized, LocalizedComponent } from "../../utils/locale"; @@ -372,7 +373,8 @@ export class Chip } render(): VNode { - const disableInteraction = this.disabled || (!this.disabled && !this.interactive); + const { disabled } = this; + const disableInteraction = disabled || (!disabled && !this.interactive); const role = this.selectionMode === "multiple" && this.interactive ? "checkbox" @@ -383,43 +385,45 @@ export class Chip : undefined; return ( -
(this.containerEl = el)} - > - {this.selectionMode !== "none" && this.renderSelectionIcon()} - {this.renderChipImage()} - {this.icon && this.renderIcon()} - - - - {this.closable && this.renderCloseButton()} -
+ +
(this.containerEl = el)} + > + {this.selectionMode !== "none" && this.renderSelectionIcon()} + {this.renderChipImage()} + {this.icon && this.renderIcon()} + + + + {this.closable && this.renderCloseButton()} +
+
); } diff --git a/packages/calcite-components/src/components/color-picker/color-picker.tsx b/packages/calcite-components/src/components/color-picker/color-picker.tsx index 10b9ac3a549..c75030b44cd 100644 --- a/packages/calcite-components/src/components/color-picker/color-picker.tsx +++ b/packages/calcite-components/src/components/color-picker/color-picker.tsx @@ -49,6 +49,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { isActivationKey } from "../../utils/key"; @@ -762,176 +763,178 @@ export class ColorPicker ); return ( -
-
- -
-
-
- -
-
- -
-
- {alphaChannel ? ( + +
+
+ +
+
+
+ +
- ) : null} -
-
- {noHex && noChannels ? null : ( -
-
- {noHex ? null : ( -
- + +
- )} - {noChannels ? null : ( - - - {this.renderChannelsTabTitle("rgb")} - {this.renderChannelsTabTitle("hsv")} - - {this.renderChannelsTab("rgb")} - {this.renderChannelsTab("hsv")} - - )} + ) : null}
- )} - {noSaved ? null : ( -
-
- -
- - -
-
- {savedColors.length > 0 ? ( -
- {[ - ...savedColors.map((color) => ( - +
+ {noHex ? null : ( +
+ - )), - ]} +
+ )} + {noChannels ? null : ( + + + {this.renderChannelsTabTitle("rgb")} + {this.renderChannelsTabTitle("hsv")} + + {this.renderChannelsTab("rgb")} + {this.renderChannelsTab("hsv")} + + )}
- ) : null} -
- )} -
+
+ )} + {noSaved ? null : ( +
+
+ +
+ + +
+
+ {savedColors.length > 0 ? ( +
+ {[ + ...savedColors.map((color) => ( + + )), + ]} +
+ ) : null} +
+ )} +
+ ); } diff --git a/packages/calcite-components/src/components/combobox-item/combobox-item.tsx b/packages/calcite-components/src/components/combobox-item/combobox-item.tsx index 521694cd6d1..65bff31bb56 100644 --- a/packages/calcite-components/src/components/combobox-item/combobox-item.tsx +++ b/packages/calcite-components/src/components/combobox-item/combobox-item.tsx @@ -20,6 +20,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { ComboboxChildElement } from "../combobox/interfaces"; @@ -223,10 +224,11 @@ export class ComboboxItem implements ConditionalSlotComponent, InteractiveCompon } render(): VNode { + const { disabled } = this; const isSingleSelect = isSingleLike(this.selectionMode); - const showDot = isSingleSelect && !this.disabled; + const showDot = isSingleSelect && !disabled; const defaultIcon = isSingleSelect ? "dot" : "check"; - const iconPath = this.disabled ? "" : defaultIcon; + const iconPath = disabled ? "" : defaultIcon; const classes = { [CSS.label]: true, @@ -238,17 +240,19 @@ export class ComboboxItem implements ConditionalSlotComponent, InteractiveCompon return ( ); } diff --git a/packages/calcite-components/src/components/combobox/combobox.tsx b/packages/calcite-components/src/components/combobox/combobox.tsx index 187a7e839e9..cb7d81401a9 100644 --- a/packages/calcite-components/src/components/combobox/combobox.tsx +++ b/packages/calcite-components/src/components/combobox/combobox.tsx @@ -46,6 +46,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { connectLabel, disconnectLabel, getLabelText, LabelableComponent } from "../../utils/label"; @@ -1648,81 +1649,83 @@ export class Combobox const isClearable = !this.clearDisabled && this.value?.length > 0; return ( -
+
- {this.renderIconStart()} - {!singleSelectionMode && !singleSelectionDisplay && this.renderChips()} - {!singleSelectionMode && - !allSelectionDisplay && [ - this.renderSelectedIndicatorChip(), - this.renderSelectedIndicatorChipCompact(), - this.renderAllSelectedIndicatorChip(), - this.renderAllSelectedIndicatorChipCompact(), - ]} - - {this.renderInput()} + {this.renderIconStart()} + {!singleSelectionMode && !singleSelectionDisplay && this.renderChips()} + {!singleSelectionMode && + !allSelectionDisplay && [ + this.renderSelectedIndicatorChip(), + this.renderSelectedIndicatorChipCompact(), + this.renderAllSelectedIndicatorChip(), + this.renderAllSelectedIndicatorChipCompact(), + ]} + + {this.renderInput()} +
+ {isClearable ? ( + + ) : null} + {this.renderIconEnd()}
- {isClearable ? ( - + {this.renderListBoxOptions()} + + {this.renderFloatingUIContainer()} + + {this.validationMessage ? ( + ) : null} - {this.renderIconEnd()} -
-
    - {this.renderListBoxOptions()} -
- {this.renderFloatingUIContainer()} - - {this.validationMessage ? ( - - ) : null} + ); } diff --git a/packages/calcite-components/src/components/date-picker-day/date-picker-day.tsx b/packages/calcite-components/src/components/date-picker-day/date-picker-day.tsx index 6950429d70a..0a87d051fea 100644 --- a/packages/calcite-components/src/components/date-picker-day/date-picker-day.tsx +++ b/packages/calcite-components/src/components/date-picker-day/date-picker-day.tsx @@ -16,6 +16,7 @@ import { connectInteractive, disconnectInteractive, InteractiveComponent, + InteractiveContainer, updateHostInteraction, } from "../../utils/interactive"; import { isActivationKey } from "../../utils/key"; @@ -168,14 +169,17 @@ export class DatePickerDay implements InteractiveComponent { onClick={this.onClick} onKeyDown={this.keyDownHandler} role="button" + tabIndex={this.active && !this.disabled ? 0 : -1} > -