Skip to content

Commit

Permalink
chore(components): make combobox consistent (#5979)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking authored Jan 9, 2025
1 parent 0d425a7 commit fb8c10c
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 174 deletions.
10 changes: 6 additions & 4 deletions app/src/components/combobox/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import { css } from "@emotion/react";
export const comboBoxCSS = css`
&[data-size="M"] {
--combobox-vertical-padding: 6px;
--combobox-horizontal-padding: 6px;
--combobox-start-padding: 8px;
--combobox-end-padding: 6px;
}
&[data-size="L"] {
--combobox-vertical-padding: 10px;
--combobox-horizontal-padding: var(--ac-global-dimension-static-size-200);
--combobox-start-padding: var(--ac-global-dimension-static-size-200);
--combobox-end-padding: var(--ac-global-dimension-static-size-200);
}
color: var(--ac-global-text-color-900);
&[data-required] {
Expand All @@ -25,8 +27,8 @@ export const comboBoxCSS = css`
position: relative;
.react-aria-Input {
padding: var(--combobox-vertical-padding)
var(--combobox-horizontal-padding);
padding: var(--combobox-vertical-padding) var(--combobox-end-padding)
var(--combobox-vertical-padding) var(--combobox-start-padding);
}
.react-aria-Button {
background: none;
Expand Down
1 change: 1 addition & 0 deletions app/src/components/field/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const fieldBaseCSS = css`
transition: all 0.2s ease-in-out;
margin: 0;
flex: 1 1 auto;
font-size: var(--ac-global-font-size-s);
min-width: var(--ac-global-input-field-min-width);
background-color: var(--ac-global-input-field-background-color);
color: var(--ac-global-text-color-900);
Expand Down
32 changes: 17 additions & 15 deletions app/stories/ComboBox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Meta, StoryFn } from "@storybook/react";

import { Flex } from "@phoenix/components";
import { Flex, View } from "@phoenix/components";
import {
ComboBox,
ComboBoxItem,
Expand Down Expand Up @@ -62,20 +62,22 @@ export default meta;

const Template: StoryFn<ComboBoxProps<object>> = (args) => (
<ThemeWrapper>
<ComboBox {...args}>
<ComboBoxItem textValue="Chocolate" key={"chocolate"}>
Chocolate
</ComboBoxItem>
<ComboBoxItem textValue="Mint" key={"mint"}>
Mint
</ComboBoxItem>
<ComboBoxItem textValue="Strawberry" key={"strawberry"}>
Strawberry
</ComboBoxItem>
<ComboBoxItem textValue="Vanilla" key={"vanilla"}>
Vanilla
</ComboBoxItem>
</ComboBox>
<View width="300px">
<ComboBox {...args}>
<ComboBoxItem textValue="Chocolate" key={"chocolate"}>
Chocolate
</ComboBoxItem>
<ComboBoxItem textValue="Mint" key={"mint"}>
Mint
</ComboBoxItem>
<ComboBoxItem textValue="Strawberry" key={"strawberry"}>
Strawberry
</ComboBoxItem>
<ComboBoxItem textValue="Vanilla" key={"vanilla"}>
Vanilla
</ComboBoxItem>
</ComboBox>
</View>
</ThemeWrapper>
);

Expand Down
Loading

0 comments on commit fb8c10c

Please sign in to comment.