Skip to content

Commit cb8314b

Browse files
committed
fix(contextual-help): update metadata
1 parent ae3885a commit cb8314b

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

components/contextualhelp/dist/metadata.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"--mod-contextual-help-body-sans-serif-font-style",
1616
"--mod-contextual-help-body-sans-serif-font-weight",
1717
"--mod-contextual-help-body-size",
18+
"--mod-contextual-help-border-radius",
1819
"--mod-contextual-help-content-spacing",
1920
"--mod-contextual-help-heading-size",
2021
"--mod-contextual-help-link-spacing",
@@ -34,9 +35,12 @@
3435
"--spectrum-contextual-help-body-sans-serif-font-style",
3536
"--spectrum-contextual-help-body-sans-serif-font-weight",
3637
"--spectrum-contextual-help-body-size",
38+
"--spectrum-contextual-help-border-radius",
3739
"--spectrum-contextual-help-content-spacing",
40+
"--spectrum-contextual-help-link-spacing",
3841
"--spectrum-contextual-help-min-inline-size",
3942
"--spectrum-contextual-help-minimum-width",
43+
"--spectrum-contextual-help-padding",
4044
"--spectrum-contextual-help-title-color",
4145
"--spectrum-contextual-help-title-font-style",
4246
"--spectrum-contextual-help-title-font-weight",
@@ -48,16 +52,23 @@
4852
"--spectrum-body-color",
4953
"--spectrum-body-sans-serif-font-style",
5054
"--spectrum-body-sans-serif-font-weight",
51-
"--spectrum-heading-color",
55+
"--spectrum-component-to-menu-large",
56+
"--spectrum-component-to-menu-medium",
57+
"--spectrum-corner-radius-large-default",
5258
"--spectrum-line-height-200",
59+
"--spectrum-picker-popover-animation-distance",
5360
"--spectrum-sans-font-family-stack",
5461
"--spectrum-spacing-300",
5562
"--spectrum-spacing-400",
63+
"--spectrum-title-color",
5664
"--spectrum-title-line-height",
5765
"--spectrum-title-sans-serif-font-style",
5866
"--spectrum-title-sans-serif-font-weight"
5967
],
60-
"passthroughs": [],
68+
"passthroughs": [
69+
"--mod-popover-animation-distance",
70+
"--mod-popover-corner-radius"
71+
],
6172
"high-contrast": [
6273
"--highcontrast-contextual-help-body-color",
6374
"--highcontrast-contextual-help-title-color"

components/contextualhelp/index.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@
3030
--spectrum-contextual-help-link-spacing: var(--spectrum-spacing-300);
3131
--spectrum-contextual-help-padding: var(--spectrum-spacing-400);
3232

33+
--spectrum-contextual-help-border-radius: var(--mod-contextual-help-border-radius, var(--mod-popover-corner-radius));
34+
3335
/* @passthrough start */
34-
--mod-popover-corner-radius: var(--spectrum-corner-radius-large-default);
36+
/* stylelint-disable-next-line spectrum-tools/no-unused-custom-properties -- used to assign Popover mods */
37+
--spectrum-picker-popover-animation-distance: var(--spectrum-component-to-menu-medium);
38+
3539
--mod-popover-animation-distance: var(--spectrum-picker-popover-animation-distance);
40+
--mod-popover-corner-radius: var(--spectrum-corner-radius-large-default);
3641
/* @passthrough end */
3742
}
3843

@@ -46,9 +51,13 @@
4651
}
4752

4853
.spectrum-ContextualHelp-popover {
54+
/* stylelint-disable-next-line spectrum-tools/no-unused-custom-properties -- used to assign Popover mods */
55+
--spectrum-picker-popover-animation-distance: var(--spectrum-component-to-menu-large);
56+
4957
padding: var(--mod-contextual-help-padding, var(--spectrum-contextual-help-padding));
5058
font-size: var(--mod-contextual-help-body-size, var(--spectrum-contextual-help-body-size));
5159
color: var(--highcontrast-contextual-help-body-color, var(--mod-contextual-help-body-color, var(--spectrum-body-color)));
60+
border-radius: var(--spectrum-contextual-help-border-radius);
5261

5362
max-inline-size: var(--mod-contextual-help-popover-maximum-width);
5463

components/contextualhelp/stories/template.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export const Template = ({
2121
customStyles = {},
2222
customClasses = [],
2323
} = {}, context = {}) => {
24+
const { globals = {} } = context;
25+
const scale = globals.scale ?? "medium";
26+
2427
return html`
2528
<div
2629
class=${classMap({
@@ -34,7 +37,7 @@ export const Template = ({
3437
isOpen: true,
3538
trigger: (passthrough) => ActionButton({
3639
...passthrough,
37-
size: "xs",
40+
size: scale === "medium" ? "xs" : "s",
3841
iconName,
3942
iconSet,
4043
customClasses: [`${rootClass}-button`],

0 commit comments

Comments
 (0)