Skip to content

Commit

Permalink
Merge pull request #3865 from kiwicom/fix/select-prefix-spacing
Browse files Browse the repository at this point in the history
fix(Select): fixed spacing between prefix and customValueText
  • Loading branch information
mainframev committed May 31, 2023
2 parents fd0316c + 4ad843e commit fa35b11
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
10 changes: 4 additions & 6 deletions packages/orbit-components/src/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,8 @@ SelectSuffix.defaultProps = {
theme: defaultTheme,
};

const StyledCustomValue = styled(({ _prefix, theme, _filled, _disabled, ...props }) => (
<div {...props} />
))`
${({ theme, _filled, disabled, prefix }) => css`
const StyledCustomValue = styled(({ _theme, _filled, _disabled, ...props }) => <div {...props} />)`
${({ theme, _filled, disabled }) => css`
color: ${(disabled && theme.orbit.paletteInkLight) ||
(_filled ? theme.orbit.colorTextInput : theme.orbit.colorPlaceholderInput)};
Expand All @@ -257,7 +255,7 @@ const StyledCustomValue = styled(({ _prefix, theme, _filled, _disabled, ...props
position: absolute;
height: 100%;
top: 0;
${left}: ${prefix ? "48px" : theme.orbit.spaceSmall};
${left}: ${theme.orbit.spaceSmall};
bottom: 0;
pointer-events: none;
`}
Expand Down Expand Up @@ -370,7 +368,7 @@ const Select = React.forwardRef<HTMLSelectElement, Props>((props, ref) => {
)}
<StyledSelectWrapper>
{customValueText && (
<StyledCustomValue disabled={disabled} _filled={filled} prefix={prefix}>
<StyledCustomValue disabled={disabled} _filled={filled}>
{customValueText}
</StyledCustomValue>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/Select/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Event = Common.Event<React.SyntheticEvent<HTMLSelectElement>>;
interface Option {
readonly key?: string;
readonly value: string | number;
readonly label?: React.ReactNode;
readonly label?: string;
readonly disabled?: boolean;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/SkipNavigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const SkipNavigation = ({
}: Props) => {
const [links, setLinks] = React.useState<HTMLAnchorElement[]>([]);
const [mappedLinks, setMappedLinks] = React.useState<MappedOptions[]>([]);
const [innerPages, setPages] = React.useState<{ value: number; label?: React.ReactNode }[]>([]);
const [innerPages, setPages] = React.useState<{ value: number; label?: string }[]>([]);
const [show, setShow] = React.useState(false);

const handleLinksClick = (ev: React.SyntheticEvent<HTMLSelectElement>) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/orbit-components/src/SkipNavigation/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ interface Action {
export interface Props {
readonly actions?: Action[];
readonly feedbackUrl?: string;
readonly firstSectionLabel?: React.ReactNode;
readonly firstActionLabel?: React.ReactNode;
readonly feedbackLabel?: React.ReactNode;
readonly firstSectionLabel?: string;
readonly firstActionLabel?: string;
readonly feedbackLabel?: string;
}

export interface MappedOptions {
readonly key?: string;
readonly value: string | number;
readonly label?: React.ReactNode;
readonly label?: string;
readonly disabled?: boolean;
}
2 changes: 1 addition & 1 deletion scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async function getChangelogMessage() {
process.exit(0);
} else {
await $`yarn install`;
await $`yarn lerna publish --no-private --conventional-commits --create-release github`;
await $`yarn lerna publish --no-private --conventional-commits --create-release github --skip-npm`;
await $`yarn docs changelog`;
await $`git add docs/src/data/log.md && git commit -m "docs: update changelog" && git push`;
const timestamp = await getLatestReleaseTime();
Expand Down

0 comments on commit fa35b11

Please sign in to comment.