Skip to content

Commit

Permalink
Padding Quiet select input (#2658)
Browse files Browse the repository at this point in the history
* build: change padding for select input when the appearance is Quiet

* chore: changeset

* chore: updating changeset
  • Loading branch information
chloe0592 authored Dec 4, 2023
1 parent 237f5bd commit e7981d9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/lemon-keys-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools-uikit/select-utils': patch
'@commercetools-uikit/design-system': patch
---

Use smaller padding for `SelectInput` component when the appearance is `quiet`.
1 change: 1 addition & 0 deletions design-system/materials/custom-properties.css
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@
--padding-for-collapsible-panel-section-description-as-condensed: 0 0
var(--spacing-40);
--padding-for-input: 16px;
--padding-for-input-as-quiet: 8px;
--padding-for-multiline-input: 8px;
--padding-for-localized-rich-text-input-label: var(--spacing-20) 12px;
--padding-for-localized-rich-text-dropdown-button: 5px var(--spacing-20);
Expand Down
1 change: 1 addition & 0 deletions design-system/materials/custom-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@
"--padding-for-collapsible-panel-section-description": "0 0 var(--spacing-40)",
"--padding-for-collapsible-panel-section-description-as-condensed": "0 0 var(--spacing-40)",
"--padding-for-input": "16px",
"--padding-for-input-as-quiet": "8px",
"--padding-for-multiline-input": "8px",
"--padding-for-localized-rich-text-input-label": "var(--spacing-20) 12px",
"--padding-for-localized-rich-text-dropdown-button": "5px var(--spacing-20)",
Expand Down
2 changes: 2 additions & 0 deletions design-system/materials/internals/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,8 @@ decisionGroupsByTheme:
choice: '0 0 var(--spacing-40)'
padding-for-input:
choice: spacing-30
padding-for-input-as-quiet:
choice: spacing-20
padding-for-multiline-input:
choice: spacing-20
padding-for-localized-rich-text-input-label:
Expand Down
2 changes: 2 additions & 0 deletions design-system/src/design-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ export const themes = {
paddingForCollapsiblePanelSectionDescriptionAsCondensed:
'0 0 var(--spacing-40)',
paddingForInput: '16px',
paddingForInputAsQuiet: '8px',
paddingForMultilineInput: '8px',
paddingForLocalizedRichTextInputLabel: 'var(--spacing-20) 12px',
paddingForLocalizedRichTextDropdownButton: '5px var(--spacing-20)',
Expand Down Expand Up @@ -1281,6 +1282,7 @@ const designTokens = {
paddingForCollapsiblePanelSectionDescriptionAsCondensed:
'var(--padding-for-collapsible-panel-section-description-as-condensed, 0 0 var(--spacing-40))',
paddingForInput: 'var(--padding-for-input, 16px)',
paddingForInputAsQuiet: 'var(--padding-for-input-as-quiet, 8px)',
paddingForMultilineInput: 'var(--padding-for-multiline-input, 8px)',
paddingForLocalizedRichTextInputLabel:
'var(--padding-for-localized-rich-text-input-label, var(--spacing-20) 12px)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ const controlStyles = (props: TProps) => (base: TBase, state: TState) => {
if (props.isReadOnly) return 'default';
return 'pointer';
})(),
padding: `0 ${designTokens.paddingForInput}`,
padding:
props.appearance === 'quiet'
? `0 ${designTokens.paddingForInputAsQuiet}`
: `0 ${designTokens.paddingForInput}`,
transition: `border-color ${designTokens.transitionStandard},
box-shadow ${designTokens.transitionStandard}`,
outline: 0,
Expand Down

1 comment on commit e7981d9

@vercel
Copy link

@vercel vercel bot commented on e7981d9 Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.