Skip to content

fix(Select): preset style for value and options #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wicked-worms-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cube-dev/ui-kit": patch
---

Change preset style of the Select component and its options to `t3` to match TextInput.
1 change: 1 addition & 0 deletions src/components/forms/TextInput/TextInputBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const INPUT_WRAPPER_STYLES: Styles = {
focused: 1,
},
boxSizing: 'border-box',
transition: 'theme',

Prefix: {
...ADD_STYLES,
Expand Down
10 changes: 7 additions & 3 deletions src/components/pickers/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ const SelectWrapperElement = tasty({

Value: {
...DEFAULT_INPUT_STYLES,
preset: 't3m',
preset: {
'': 't3',
'[data-type="primary"]': 't3m',
},
color: 'inherit',
opacity: {
'': 1,
Expand Down Expand Up @@ -176,7 +179,7 @@ const OptionElement = tasty({
'pressed | selected': '#purple',
disabled: '#dark.3',
},
preset: 't3m',
preset: 't3',
transition: 'theme',
},
});
Expand Down Expand Up @@ -382,6 +385,7 @@ function Select<T extends object>(
mods={modifiers}
styles={outerStyles}
data-size={size}
data-type={type}
>
<HiddenSelect
state={state}
Expand All @@ -394,7 +398,7 @@ function Select<T extends object>(
ref={triggerRef}
styles={inputStyles}
data-size={size}
data-type={type || 'neutral'}
data-type={type}
mods={modifiers}
>
{prefix ? <div data-element="Prefix">{prefix}</div> : null}
Expand Down