Skip to content

Commit 66c4c1a

Browse files
committed
Wip
1 parent 09009cc commit 66c4c1a

File tree

8 files changed

+11
-9
lines changed

8 files changed

+11
-9
lines changed

packages/react/src/ActionList/ActionList.docs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"name": "variant",
18-
"type": "'inset' | 'full'",
18+
"type": "'inset' | 'horizontal-inset' | 'full'",
1919
"defaultValue": "'inset'",
2020
"description": "`inset` children are offset (vertically and horizontally) from list edges. `full` children are flush (vertically and horizontally) with list edges"
2121
},

packages/react/src/ActionList/ActionList.module.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
list-style: none;
1212
}
1313

14-
&:where([data-variant='inset']) {
14+
&:where([data-variant='horizontal-inset']) {
1515
padding-block: var(--base-size-8);
16+
}
1617

18+
&:where([data-variant='inset'], [data-variant='horizontal-inset']) {
1719
/* this is only to match default experience */
1820
& .ActionListItem {
1921
margin-inline: var(--base-size-8);

packages/react/src/ActionList/ActionList.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Playground.argTypes = {
4545
control: {
4646
type: 'radio',
4747
},
48-
options: ['inset', 'full'],
48+
options: ['inset', 'horizontal-inset', 'full'],
4949
},
5050
selectionVariant: {
5151
control: {

packages/react/src/ActionList/Heading.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
margin-inline-start: var(--base-size-8);
66
}
77

8-
&:where([data-list-variant='inset']) {
8+
&:where([data-list-variant='inset'], [data-list-variant='horizontal-inset']) {
99
/* stylelint-disable-next-line primer/spacing */
1010
margin-inline-start: calc(var(--control-medium-paddingInline-condensed) + var(--base-size-8));
1111
}

packages/react/src/ActionList/Item.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
187187
paddingY: '6px', // custom value off the scale
188188
lineHeight: '16px',
189189
minHeight: 5,
190-
marginX: listVariant === 'inset' ? 2 : 0,
190+
marginX: listVariant === 'inset' || listVariant === 'horizontal-inset' ? 2 : 0,
191191
borderRadius: 2,
192192
transition: 'background 33.333ms linear',
193193
color: getVariantStyles(variant, disabled, inactive || loading).color,
@@ -211,7 +211,7 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
211211
appearance: 'none',
212212
background: 'unset',
213213
border: 'unset',
214-
width: listVariant === 'inset' ? 'calc(100% - 16px)' : '100%',
214+
width: listVariant === 'inset' || listVariant === 'horizontal-inset' ? 'calc(100% - 16px)' : '100%',
215215
fontFamily: 'unset',
216216
textAlign: 'unset',
217217
marginY: 'unset',

packages/react/src/ActionList/shared.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export type ActionListProps = React.PropsWithChildren<{
120120
/**
121121
* `inset` children are offset (vertically and horizontally) from `List`’s edges, `full` children are flush (vertically and horizontally) with `List` edges
122122
*/
123-
variant?: 'inset' | 'full'
123+
variant?: 'inset' | 'horizontal-inset' | 'full'
124124
/**
125125
* Whether multiple Items or a single Item can be selected.
126126
*/

packages/react/src/SelectPanel/SelectPanel.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ export function SelectPanel({
501501
onInputRefChanged={onInputRefChanged}
502502
placeholderText={placeholderText}
503503
{...listProps}
504-
variant="full"
504+
variant="horizontal-inset"
505505
role="listbox"
506506
// browsers give aria-labelledby precedence over aria-label so we need to make sure
507507
// we don't accidentally override props.aria-label

packages/react/src/deprecated/ActionList/List.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export interface ListPropsBase {
6262
* - `"inset"` - `List` children are offset (vertically and horizontally) from `List`’s edges
6363
* - `"full"` - `List` children are flush (vertically and horizontally) with `List` edges
6464
*/
65-
variant?: 'inset' | 'full'
65+
variant?: 'inset' | 'horizontal-inset' | 'full'
6666

6767
/**
6868
* For `Item`s which can be selected, whether `multiple` `Item`s or a `single` `Item` can be selected

0 commit comments

Comments
 (0)