Skip to content
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

ActionList Component: Primer CSS Implementation #1657

Merged
merged 86 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
1f7d08e
add storybook, start actionlist
langermank Oct 4, 2021
5eb8831
story composition, some katie edits
langermank Oct 4, 2021
20c18e9
Merge branch 'main' of https://github.com/primer/css into actionlist
langermank Oct 5, 2021
5867862
auto grid test
langermank Oct 5, 2021
26f4464
one grid option
langermank Oct 5, 2021
b39f941
you win flexbox, you win
langermank Oct 5, 2021
7734667
back on that grid grind
langermank Oct 5, 2021
9c70c46
story for each item context
langermank Oct 5, 2021
a7967fe
import stories
langermank Oct 5, 2021
a375fef
add CSS friendly args for controls
langermank Oct 6, 2021
6fcbe26
more conditionals
langermank Oct 6, 2021
f98f7ce
push
langermank Oct 6, 2021
32bbc68
fix import
langermank Oct 6, 2021
e7e5eac
clean up deps
langermank Oct 6, 2021
bb73c0f
fix borders + hover state
langermank Oct 7, 2021
8f4c3e5
add navigational to story
langermank Oct 7, 2021
a518486
primitive-ize
langermank Oct 7, 2021
71ef4a3
break out files
langermank Oct 7, 2021
138b596
a11y fix
langermank Oct 8, 2021
5fc9181
list stories
langermank Oct 8, 2021
2f8018a
add all theme viewer, more css edge cases
langermank Oct 8, 2021
60b0047
story cleanup
langermank Oct 8, 2021
f76d9a4
actionList becomes ActionList
langermank Oct 11, 2021
0f5d3cf
story syntax improvements
langermank Oct 11, 2021
a8aadc4
bind stories, organize
langermank Oct 11, 2021
937c41f
nested nav exploration
langermank Oct 14, 2021
688b4cb
pseudo hover to support nested lists
langermank Oct 14, 2021
591b33c
cleanup
langermank Oct 15, 2021
58962ca
Merge branch 'main' of https://github.com/primer/css into actionlist
langermank Oct 15, 2021
87987ed
organize pattern stories
langermank Oct 15, 2021
d6dee96
finding a better way to deal with state/nesting
langermank Oct 16, 2021
d851f3b
move state up one level
langermank Oct 18, 2021
5bcd780
handle single level nesting
langermank Oct 18, 2021
b0248c6
collapsible
langermank Oct 18, 2021
4caf59e
collapse story in sub item nav
langermank Oct 18, 2021
a0494c6
new collapse icon position, grid refactor
langermank Oct 19, 2021
ae75710
toggle expanded state
langermank Oct 19, 2021
188a387
cleanup
langermank Oct 19, 2021
edc0bf3
rename classes, better nesting, single select
langermank Oct 20, 2021
fc3d68d
multi select support
langermank Oct 20, 2021
300adf8
start docs!
langermank Oct 20, 2021
6e81c36
new animations
langermank Oct 21, 2021
142497c
docs
langermank Oct 21, 2021
6570ce2
Merge branch 'main' of https://github.com/primer/css into actionlist
langermank Oct 21, 2021
6963255
more docs
langermank Oct 22, 2021
1086ccc
action item features docs
langermank Oct 22, 2021
75c8e64
a11y docs (storybook)
langermank Oct 22, 2021
7874e76
fix docs codeblocks
langermank Oct 25, 2021
cc233fc
format code snippet (a little)
langermank Oct 26, 2021
b57e9f8
Merge branch 'main' of https://github.com/primer/css into actionlist
langermank Oct 26, 2021
59d6f11
pull in pre-release primitives
langermank Oct 26, 2021
77d98cd
fix danger primitive
langermank Oct 26, 2021
879b4b4
cleanup
langermank Oct 26, 2021
43829fe
linting playing tricks on me
langermank Oct 26, 2021
a816d75
linty fresh
langermank Oct 26, 2021
1d3a5eb
renaming classes fun times
langermank Oct 26, 2021
800a180
add disabled variant
langermank Oct 27, 2021
b0280f1
formatting struggles
langermank Oct 27, 2021
fa041cc
danger visual danger color
langermank Oct 27, 2021
f1f129e
add viewport maps to layout vars
langermank Oct 27, 2021
df652e8
test stylelint
langermank Oct 27, 2021
1f9c579
finish docs
langermank Oct 27, 2021
f67dbea
revert primitive upgrade
langermank Oct 28, 2021
ce906f7
Merge branch 'main' of https://github.com/primer/css into actionlist
langermank Oct 28, 2021
ce0e4cc
Merge branch 'main' into actionlist
jonrohan Oct 28, 2021
3a4c91b
primitives patch take 2, sidebar story
langermank Oct 28, 2021
5787b3a
Merge branch 'actionlist' of https://github.com/primer/css into actio…
langermank Oct 28, 2021
9249695
Merge branch 'main' into actionlist
jonrohan Oct 28, 2021
5b28b0b
change calc function
langermank Oct 28, 2021
d358672
Merge branch 'main' of https://github.com/primer/css into actionlist
langermank Oct 28, 2021
6770fe7
remove fix script
langermank Oct 28, 2021
32a1e12
lint, docs fixes
langermank Oct 28, 2021
7ac2cca
Stylelint auto-fixes
actions-user Oct 28, 2021
6a68c22
guessing the storybook link for docs
langermank Oct 28, 2021
e442b62
Merge branch 'actionlist' of https://github.com/primer/css into actio…
langermank Oct 28, 2021
7c793ed
testing scss imports
langermank Oct 29, 2021
e421409
Merge branch 'main' of https://github.com/primer/css into actionlist
langermank Oct 29, 2021
e7344cb
lint
langermank Oct 29, 2021
27d7ac4
default background
langermank Oct 29, 2021
c67690e
handle padding for sizes
langermank Oct 29, 2021
a7ac5e1
remove comments
langermank Oct 29, 2021
8474859
Stylelint auto-fixes
actions-user Oct 29, 2021
a1eb1ba
Merge branch 'main' of https://github.com/primer/css into actionlist
langermank Nov 1, 2021
ea5f71b
Merge branch 'main' into actionlist
jonrohan Nov 2, 2021
73090da
Create poor-walls-occur.md
jonrohan Nov 2, 2021
d6dd77c
Update poor-walls-occur.md
jonrohan Nov 2, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,29 @@ SizeMedium.args = {
size: 'ActionList-content--sizeMedium'
}

export const SizeMediumWithDescription = ListItemTemplate.bind({})
SizeMediumWithDescription.args = {
...ListItemTemplate.args,
text: 'Medium item',
description: 'Some descriptive text',
size: 'ActionList-content--sizeMedium'
}

export const SizeLarge = ListItemTemplate.bind({})
SizeLarge.args = {
...ListItemTemplate.args,
text: 'Large item',
size: 'ActionList-content--sizeLarge'
}

export const SizeLargeWithDescription = ListItemTemplate.bind({})
SizeLargeWithDescription.args = {
...ListItemTemplate.args,
text: 'Large item',
description: 'Some descriptive text',
size: 'ActionList-content--sizeLarge'
}

export const VisualLeading = ListItemTemplate.bind({})
VisualLeading.storyName = '[Visuals] Leading'
VisualLeading.args = {
Expand Down
24 changes: 15 additions & 9 deletions src/actionlist/action-list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
display: block;
}

// stylelint-disable-next-line selector-max-specificity
&.ActionList-item--hasSubItem {
// stylelint-disable-next-line selector-max-specificity
> .ActionList-content > .ActionList-item-label {
Expand Down Expand Up @@ -169,12 +168,10 @@
&[aria-checked='false'],
&[aria-selected='false'] {
// multiselect checkmark
// stylelint-disable-next-line selector-max-specificity
.ActionList-item-multiSelectCheckmark {
visibility: hidden;
opacity: 0;
transition:
visibility 0 linear $actionList-item-checkmark-transition-timing,
transition: visibility 0 linear $actionList-item-checkmark-transition-timing,
opacity $actionList-item-checkmark-transition-timing;
}

Expand Down Expand Up @@ -289,10 +286,12 @@
user-select: none;
border-radius: $border-radius;
transition: $actionList-item-bg-transition;
grid-template-rows: minmax($actionList-item-height-sm, max-content); // 20px with 12px padding = [32px total]
// grid-template-rows: minmax($actionList-item-height-sm, max-content); // 20px with 12px padding = [32px total]
grid-template-rows: min-content;
grid-template-areas: 'leadingAction leadingVisual label trailingVisual trailingAction';
grid-template-columns: min-content min-content minmax(min-content, auto) min-content min-content;
align-items: center;
// line-height: normal;

// column-gap persists with empty grid-areas, margin applies only when children exist
> :not(:last-child) {
Expand All @@ -306,16 +305,21 @@
// sizes

&.ActionList-content--sizeMedium {
grid-template-rows: minmax($actionList-item-height-md, max-content); // 28px with 12px padding = [40px total]
// 44px total height
// stylelint-disable-next-line primer/spacing
padding: $actionList-item-padding-vertical-md $actionList-item-padding-horizontal;
vdepizzol marked this conversation as resolved.
Show resolved Hide resolved
}

&.ActionList-content--sizeLarge {
grid-template-rows: minmax($actionList-item-height-lg, max-content); // 36px with 12px padding = [48px total]
// 48px total height
// stylelint-disable-next-line primer/spacing
padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
}

// On pointer:coarse (mobile), all list items are large
@media (pointer: coarse) {
grid-template-rows: minmax($actionList-item-height-lg, max-content);
// stylelint-disable-next-line primer/spacing
padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
}

&.ActionList-content--blockDescription {
Expand Down Expand Up @@ -399,6 +403,9 @@
.ActionList-item-label {
position: relative; // for pseudo dividers
font-weight: $font-weight-normal;
// we need a strict value here for grid alignment
// stylelint-disable-next-line primer/typography
line-height: $actionList-item-label-line-height;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

line-height 20px

color: var(--color-fg-default);
}

Expand Down Expand Up @@ -426,7 +433,6 @@
// has 20px leading visual
.ActionList-content--visual20 + .ActionList--subGroup {
.ActionList-item--subItem {
// stylelint-disable-next-line primer/spacing
padding-left: $spacer-3 * 1.75;
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/actionlist/action-list-variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$actionList-item-height-sm: 20px !default;
$actionList-item-height-md: 28px !default;
$actionList-item-height-lg: 36px !default;
$actionList-item-height-sm: $spacer-2 * 2.5 !default;
$actionList-item-label-line-height: $spacer-2 * 2.5 !default;
$actionList-item-padding-vertical-md: $spacer-2 * 1.25 !default;
$actionList-item-padding-vertical-lg: $spacer-2 * 1.75 !default;
$actionList-item-padding-vertical: $spacer-1 * 1.5 !default;
$actionList-item-padding-horizontal: $spacer-2 !default;
$actionList-item-bg-transition: background 33.333ms linear !default; // 2 frames on a 60hz monitor
Expand Down
1 change: 0 additions & 1 deletion src/actionlist/action-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
.ActionList-item--navActive {
// stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
.ActionList-item-label::before,
// stylelint-disable-next-line selector-max-specificity
+ .ActionList-item .ActionList-item-label::before {
visibility: hidden;
}
Expand Down