Skip to content

Commit

Permalink
fix: action sheet divider width
Browse files Browse the repository at this point in the history
  • Loading branch information
malangcat committed Jan 21, 2025
1 parent 702df41 commit 1738c73
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 28 deletions.
5 changes: 3 additions & 2 deletions docs/public/rootage/components/action-sheet.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
},
"content": {
"color": "$color.bg.layer-floating",
"paddingX": "$dimension.spacing-x.global-gutter",
"cornerTopRadius": "$radius.s5",
"enterDuration": "$duration.s6",
"enterTimingFunction": "$timing-function.enter-expressive",
"exitDuration": "$duration.s4",
"exitTimingFunction": "$timing-function.exit"
},
"header": {
"paddingX": "$dimension.spacing-x.global-gutter",
"paddingY": "$dimension.s3_5",
"gap": "$dimension.s1"
},
Expand All @@ -43,7 +43,8 @@
},
"divider": {
"strokeWidth": "1px",
"strokeColor": "$color.stroke.neutral"
"strokeColor": "$color.stroke.neutral",
"marginX": "$dimension.spacing-x.global-gutter"
}
}
}
Expand Down
33 changes: 22 additions & 11 deletions docs/public/rootage/parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -9433,17 +9433,6 @@
"key": "layer-floating"
}
},
{
"key": "paddingX",
"value": {
"type": "token",
"group": [
"dimension",
"spacing-x"
],
"key": "global-gutter"
}
},
{
"key": "cornerTopRadius",
"value": {
Expand Down Expand Up @@ -9499,6 +9488,17 @@
{
"key": "header",
"property": [
{
"key": "paddingX",
"value": {
"type": "token",
"group": [
"dimension",
"spacing-x"
],
"key": "global-gutter"
}
},
{
"key": "paddingY",
"value": {
Expand Down Expand Up @@ -9634,6 +9634,17 @@
],
"key": "neutral"
}
},
{
"key": "marginX",
"value": {
"type": "token",
"group": [
"dimension",
"spacing-x"
],
"key": "global-gutter"
}
}
]
}
Expand Down
13 changes: 12 additions & 1 deletion packages/qvism-preset/src/recipes/action-sheet-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,27 @@ const actionSheetItem = defineRecipe({
display: "flex",
alignItems: "center",
justifyContent: "center",
position: "relative",

backgroundColor: vars.base.enabled.root.color,
minHeight: vars.base.enabled.root.minHeight,
paddingInline: vars.base.enabled.root.paddingX,
paddingBlock: vars.base.enabled.root.paddingY,
boxShadow: `inset 0 calc(-1 * ${rootVars.base.enabled.divider.strokeWidth}) 0 ${rootVars.base.enabled.divider.strokeColor}`,

[pseudo(active)]: {
backgroundColor: vars.base.pressed.root.color,
},

"&:after": {
content: "''",
display: "block",
position: "absolute",
left: rootVars.base.enabled.divider.marginX,
right: rootVars.base.enabled.divider.marginX,
bottom: 0,
height: rootVars.base.enabled.divider.strokeWidth,
background: rootVars.base.enabled.divider.strokeColor,
},
},
label: {
fontSize: vars.base.enabled.label.fontSize,
Expand Down
15 changes: 13 additions & 2 deletions packages/qvism-preset/src/recipes/action-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const actionSheet = defineRecipe({
zIndex: "calc(var(--sheet-z-index) + var(--layer-index, 0))",

background: vars.base.enabled.content.color,
paddingInline: vars.base.enabled.content.paddingX,
borderTopLeftRadius: vars.base.enabled.content.cornerTopRadius,
borderTopRightRadius: vars.base.enabled.content.cornerTopRadius,

Expand All @@ -64,10 +63,22 @@ const actionSheet = defineRecipe({
display: "flex",
flexDirection: "column",
alignItems: "center",
position: "relative",

boxShadow: `inset 0 calc(-1 * ${vars.base.enabled.divider.strokeWidth}) 0 ${vars.base.enabled.divider.strokeColor}`,
paddingInline: vars.base.enabled.header.paddingX,
paddingBlock: vars.base.enabled.header.paddingY,
gap: vars.base.enabled.header.gap,

"&:after": {
content: "''",
display: "block",
position: "absolute",
left: vars.base.enabled.divider.marginX,
right: vars.base.enabled.divider.marginX,
bottom: 0,
height: vars.base.enabled.divider.strokeWidth,
background: vars.base.enabled.divider.strokeColor,
},
},
title: {
color: vars.base.enabled.title.color,
Expand Down
3 changes: 2 additions & 1 deletion packages/rootage/components/action-sheet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ data:
exitOpacity: 0
content:
color: $color.bg.layer-floating
paddingX: $dimension.spacing-x.global-gutter
cornerTopRadius: $radius.s5
enterDuration: $duration.s6
enterTimingFunction: $timing-function.enter-expressive
# Do we need translateY definition here?
exitDuration: $duration.s4
exitTimingFunction: $timing-function.exit
header:
paddingX: $dimension.spacing-x.global-gutter
paddingY: $dimension.s3_5
gap: $dimension.s1
title:
Expand All @@ -39,3 +39,4 @@ data:
divider:
strokeWidth: 1px
strokeColor: $color.stroke.neutral
marginX: $dimension.spacing-x.global-gutter
14 changes: 12 additions & 2 deletions packages/stylesheet/actionSheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
word-break: break-all;
z-index: calc(var(--sheet-z-index) + var(--layer-index, 0));
background: var(--seed-v3-color-bg-layer-floating);
padding-inline: var(--seed-v3-dimension-spacing-x-global-gutter);
border-top-left-radius: var(--seed-v3-radius-s5);
border-top-right-radius: var(--seed-v3-radius-s5);
}
Expand All @@ -69,10 +68,21 @@
display: flex;
flex-direction: column;
align-items: center;
box-shadow: inset 0 calc(-1 * 1px) 0 var(--seed-v3-color-stroke-neutral);
position: relative;
padding-inline: var(--seed-v3-dimension-spacing-x-global-gutter);
padding-block: var(--seed-v3-dimension-s3_5);
gap: var(--seed-v3-dimension-s1);
}
.actionSheet__header:after {
content: '';
display: block;
position: absolute;
left: var(--seed-v3-dimension-spacing-x-global-gutter);
right: var(--seed-v3-dimension-spacing-x-global-gutter);
bottom: 0;
height: 1px;
background: var(--seed-v3-color-stroke-neutral);
}
.actionSheet__title {
color: var(--seed-v3-color-fg-neutral-muted);
font-size: var(--seed-v3-font-size-s4);
Expand Down
12 changes: 11 additions & 1 deletion packages/stylesheet/actionSheetItem.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@
display: flex;
align-items: center;
justify-content: center;
position: relative;
background-color: var(--seed-v3-color-bg-layer-floating);
min-height: 50px;
padding-inline: var(--seed-v3-dimension-spacing-x-global-gutter);
padding-block: var(--seed-v3-dimension-s3_5);
box-shadow: inset 0 calc(-1 * 1px) 0 var(--seed-v3-color-stroke-neutral);
}
.actionSheetItem__root:is(:active, [data-active]) {
background-color: var(--seed-v3-color-bg-layer-floating-pressed);
}
.actionSheetItem__root:after {
content: '';
display: block;
position: absolute;
left: var(--seed-v3-dimension-spacing-x-global-gutter);
right: var(--seed-v3-dimension-spacing-x-global-gutter);
bottom: 0;
height: 1px;
background: var(--seed-v3-color-stroke-neutral);
}
.actionSheetItem__label {
font-size: var(--seed-v3-font-size-s5);
line-height: var(--seed-v3-line-height-s5);
Expand Down
28 changes: 25 additions & 3 deletions packages/stylesheet/component.css
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,6 @@
word-break: break-all;
z-index: calc(var(--sheet-z-index) + var(--layer-index, 0));
background: var(--seed-v3-color-bg-layer-floating);
padding-inline: var(--seed-v3-dimension-spacing-x-global-gutter);
border-top-left-radius: var(--seed-v3-radius-s5);
border-top-right-radius: var(--seed-v3-radius-s5);
flex-direction: column;
Expand Down Expand Up @@ -1351,12 +1350,24 @@
}

.actionSheet__header {
box-shadow: inset 0 calc(-1 * 1px) 0 var(--seed-v3-color-stroke-neutral);
padding-inline: var(--seed-v3-dimension-spacing-x-global-gutter);
padding-block: var(--seed-v3-dimension-s3_5);
align-items: center;
gap: var(--seed-v3-dimension-s1);
flex-direction: column;
display: flex;
position: relative;
}

.actionSheet__header:after {
content: "";
left: var(--seed-v3-dimension-spacing-x-global-gutter);
right: var(--seed-v3-dimension-spacing-x-global-gutter);
background: var(--seed-v3-color-stroke-neutral);
height: 1px;
display: block;
position: absolute;
bottom: 0;
}

.actionSheet__title {
Expand Down Expand Up @@ -1384,16 +1395,27 @@
min-height: 50px;
padding-inline: var(--seed-v3-dimension-spacing-x-global-gutter);
padding-block: var(--seed-v3-dimension-s3_5);
box-shadow: inset 0 calc(-1 * 1px) 0 var(--seed-v3-color-stroke-neutral);
justify-content: center;
align-items: center;
display: flex;
position: relative;
}

.actionSheetItem__root:is(:active, [data-active]) {
background-color: var(--seed-v3-color-bg-layer-floating-pressed);
}

.actionSheetItem__root:after {
content: "";
left: var(--seed-v3-dimension-spacing-x-global-gutter);
right: var(--seed-v3-dimension-spacing-x-global-gutter);
background: var(--seed-v3-color-stroke-neutral);
height: 1px;
display: block;
position: absolute;
bottom: 0;
}

.actionSheetItem__label {
font-size: var(--seed-v3-font-size-s5);
line-height: var(--seed-v3-line-height-s5);
Expand Down
2 changes: 1 addition & 1 deletion packages/stylesheet/component.min.css

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions packages/vars/lib/component/action-sheet.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export declare const vars: {
},
"content": {
"color": "var(--seed-v3-color-bg-layer-floating)",
"paddingX": "var(--seed-v3-dimension-spacing-x-global-gutter)",
"cornerTopRadius": "var(--seed-v3-radius-s5)",
"enterDuration": "var(--seed-v3-duration-s6)",
"enterTimingFunction": "var(--seed-v3-timing-function-enter-expressive)",
"exitDuration": "var(--seed-v3-duration-s4)",
"exitTimingFunction": "var(--seed-v3-timing-function-exit)"
},
"header": {
"paddingX": "var(--seed-v3-dimension-spacing-x-global-gutter)",
"paddingY": "var(--seed-v3-dimension-s3_5)",
"gap": "var(--seed-v3-dimension-s1)"
},
Expand All @@ -37,7 +37,8 @@ export declare const vars: {
},
"divider": {
"strokeWidth": "1px",
"strokeColor": "var(--seed-v3-color-stroke-neutral)"
"strokeColor": "var(--seed-v3-color-stroke-neutral)",
"marginX": "var(--seed-v3-dimension-spacing-x-global-gutter)"
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/vars/lib/component/action-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export const vars = {
},
"content": {
"color": "var(--seed-v3-color-bg-layer-floating)",
"paddingX": "var(--seed-v3-dimension-spacing-x-global-gutter)",
"cornerTopRadius": "var(--seed-v3-radius-s5)",
"enterDuration": "var(--seed-v3-duration-s6)",
"enterTimingFunction": "var(--seed-v3-timing-function-enter-expressive)",
"exitDuration": "var(--seed-v3-duration-s4)",
"exitTimingFunction": "var(--seed-v3-timing-function-exit)"
},
"header": {
"paddingX": "var(--seed-v3-dimension-spacing-x-global-gutter)",
"paddingY": "var(--seed-v3-dimension-s3_5)",
"gap": "var(--seed-v3-dimension-s1)"
},
Expand All @@ -37,7 +37,8 @@ export const vars = {
},
"divider": {
"strokeWidth": "1px",
"strokeColor": "var(--seed-v3-color-stroke-neutral)"
"strokeColor": "var(--seed-v3-color-stroke-neutral)",
"marginX": "var(--seed-v3-dimension-spacing-x-global-gutter)"
}
}
}
Expand Down

0 comments on commit 1738c73

Please sign in to comment.