diff --git a/frontend/__snapshots__/lemon-ui-lemon-select--clearable.png b/frontend/__snapshots__/lemon-ui-lemon-select--clearable.png index 173e6083b8d7f..ddb733f7769c0 100644 Binary files a/frontend/__snapshots__/lemon-ui-lemon-select--clearable.png and b/frontend/__snapshots__/lemon-ui-lemon-select--clearable.png differ diff --git a/frontend/__snapshots__/lemon-ui-lemon-select--custom-element.png b/frontend/__snapshots__/lemon-ui-lemon-select--custom-element.png index f5f49e01f6c14..fd74d1a9f72df 100644 Binary files a/frontend/__snapshots__/lemon-ui-lemon-select--custom-element.png and b/frontend/__snapshots__/lemon-ui-lemon-select--custom-element.png differ diff --git a/frontend/__snapshots__/lemon-ui-lemon-select--flat.png b/frontend/__snapshots__/lemon-ui-lemon-select--flat.png index 014fa2c439173..5988b5802d517 100644 Binary files a/frontend/__snapshots__/lemon-ui-lemon-select--flat.png and b/frontend/__snapshots__/lemon-ui-lemon-select--flat.png differ diff --git a/frontend/__snapshots__/lemon-ui-lemon-select--full-width.png b/frontend/__snapshots__/lemon-ui-lemon-select--full-width.png index 43c60b1213a32..fed02e9e5858e 100644 Binary files a/frontend/__snapshots__/lemon-ui-lemon-select--full-width.png and b/frontend/__snapshots__/lemon-ui-lemon-select--full-width.png differ diff --git a/frontend/__snapshots__/lemon-ui-lemon-select--long-options.png b/frontend/__snapshots__/lemon-ui-lemon-select--long-options.png index b5e107be8cf4f..c2fea75877d90 100644 Binary files a/frontend/__snapshots__/lemon-ui-lemon-select--long-options.png and b/frontend/__snapshots__/lemon-ui-lemon-select--long-options.png differ diff --git a/frontend/__snapshots__/lemon-ui-lemon-select--mixed-values-types.png b/frontend/__snapshots__/lemon-ui-lemon-select--mixed-values-types.png index 014fa2c439173..5988b5802d517 100644 Binary files a/frontend/__snapshots__/lemon-ui-lemon-select--mixed-values-types.png and b/frontend/__snapshots__/lemon-ui-lemon-select--mixed-values-types.png differ diff --git a/frontend/__snapshots__/lemon-ui-lemon-select--nested-select.png b/frontend/__snapshots__/lemon-ui-lemon-select--nested-select.png index 014fa2c439173..5988b5802d517 100644 Binary files a/frontend/__snapshots__/lemon-ui-lemon-select--nested-select.png and b/frontend/__snapshots__/lemon-ui-lemon-select--nested-select.png differ diff --git a/frontend/__snapshots__/lemon-ui-lemon-select--sectioned-options.png b/frontend/__snapshots__/lemon-ui-lemon-select--sectioned-options.png index 014fa2c439173..5988b5802d517 100644 Binary files a/frontend/__snapshots__/lemon-ui-lemon-select--sectioned-options.png and b/frontend/__snapshots__/lemon-ui-lemon-select--sectioned-options.png differ diff --git a/frontend/__snapshots__/scenes-app-dashboards--new-select-variables.png b/frontend/__snapshots__/scenes-app-dashboards--new-select-variables.png index c4d3fc8fb4f30..4ce0948c7ad66 100644 Binary files a/frontend/__snapshots__/scenes-app-dashboards--new-select-variables.png and b/frontend/__snapshots__/scenes-app-dashboards--new-select-variables.png differ diff --git a/frontend/src/lib/components/TaxonomicPopover/TaxonomicPopover.tsx b/frontend/src/lib/components/TaxonomicPopover/TaxonomicPopover.tsx index 35eae8a066bbd..9220bf6477c4c 100644 --- a/frontend/src/lib/components/TaxonomicPopover/TaxonomicPopover.tsx +++ b/frontend/src/lib/components/TaxonomicPopover/TaxonomicPopover.tsx @@ -75,47 +75,45 @@ export function TaxonomicPopover - { - onChange?.(payload as ValueType, type, item) - setVisible(false) - }} - taxonomicGroupTypes={groupTypes ?? [groupType]} - eventNames={eventNames} - hogQLTable={hogQLTable} - excludedProperties={excludedProperties} - /> - } - sameWidth={false} - actionable - visible={visible} - onClickOutside={() => { - setVisible(false) - }} - > - {isClearButtonShown ? ( - , - tooltip: 'Clear selection', - onClick: (e) => { - e.stopPropagation() - onChange?.('' as ValueType, groupType, null) - setLocalValue('' as ValueType) - }, - divider: false, - }} - {...buttonPropsFinal} - /> - ) : ( - - )} - - + { + onChange?.(payload as ValueType, type, item) + setVisible(false) + }} + taxonomicGroupTypes={groupTypes ?? [groupType]} + eventNames={eventNames} + hogQLTable={hogQLTable} + excludedProperties={excludedProperties} + /> + } + sameWidth={false} + actionable + visible={visible} + onClickOutside={() => { + setVisible(false) + }} + > + {isClearButtonShown ? ( + , + tooltip: 'Clear selection', + onClick: (e) => { + e.stopPropagation() + onChange?.('' as ValueType, groupType, null) + setLocalValue('' as ValueType) + }, + divider: false, + }} + {...buttonPropsFinal} + /> + ) : ( + + )} + ) } diff --git a/frontend/src/lib/lemon-ui/LemonButton/LemonButton.scss b/frontend/src/lib/lemon-ui/LemonButton/LemonButton.scss index 14d6014f2055b..95cf04c36bf94 100644 --- a/frontend/src/lib/lemon-ui/LemonButton/LemonButton.scss +++ b/frontend/src/lib/lemon-ui/LemonButton/LemonButton.scss @@ -164,6 +164,11 @@ .LemonButtonWithSideAction { position: relative; + width: fit-content; + + &--full-width { + width: 100%; + } } .LemonButtonWithSideAction__spacer { diff --git a/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx b/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx index f1be7aa2ff855..7cd59c8a401b4 100644 --- a/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx +++ b/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx @@ -246,7 +246,12 @@ export const LemonButton: React.FunctionComponent +
{workingButton}
span { - padding-right: 0 !important; - } - - .LemonButton__content { - gap: 0.5rem; - - .LemonSelect--button--clearable { - margin-left: auto; - } - } - } -} - -.posthog-3000 { - .LemonButton.LemonSelect--clearable { - .LemonButton__content { - gap: 0.25rem; - - .LemonSelect--button--clearable { - .LemonButton__chrome { - padding: 0.0625rem !important; - } - } - } - } -} diff --git a/frontend/src/lib/lemon-ui/LemonSelect/LemonSelect.stories.tsx b/frontend/src/lib/lemon-ui/LemonSelect/LemonSelect.stories.tsx index 6b78f42d26663..5fe4835da5abd 100644 --- a/frontend/src/lib/lemon-ui/LemonSelect/LemonSelect.stories.tsx +++ b/frontend/src/lib/lemon-ui/LemonSelect/LemonSelect.stories.tsx @@ -21,7 +21,7 @@ export default meta const Template: StoryFn = (props: LemonSelectProps) => { return (
- {(['small', undefined] as const).map((size, index) => ( + {(['small', 'medium', 'large', undefined] as const).map((size, index) => (
size={capitalizeFirstLetter(size || 'unspecified')}
diff --git a/frontend/src/lib/lemon-ui/LemonSelect/LemonSelect.tsx b/frontend/src/lib/lemon-ui/LemonSelect/LemonSelect.tsx index fda1df597097c..e5b596203e354 100644 --- a/frontend/src/lib/lemon-ui/LemonSelect/LemonSelect.tsx +++ b/frontend/src/lib/lemon-ui/LemonSelect/LemonSelect.tsx @@ -1,5 +1,3 @@ -import './LemonSelect.scss' - import clsx from 'clsx' import React, { useMemo } from 'react' @@ -143,12 +141,21 @@ export function LemonSelect({ closeParentPopoverOnClickInside={menu?.closeParentPopoverOnClickInside} > : undefined} type="secondary" status="stealth" + sideAction={ + isClearButtonShown + ? { + icon: , + divider: false, + onClick: () => { + onChange?.(null as T) + }, + } + : null + } {...buttonProps} > @@ -158,19 +165,6 @@ export function LemonSelect({ ? activeLeaf.label : value ?? {placeholder}} - {isClearButtonShown && ( - } - tooltip="Clear selection" - onClick={() => { - onChange?.(null as T) - }} - /> - )} )