Skip to content

Commit

Permalink
fix(toggletip): open prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ariellalgilmore committed Jan 11, 2024
1 parent ac4c361 commit 8213fd4
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,18 @@ const defaultArgs = {
titleText: 'This is an example title',
value: '',
warn: false,
warnText: 'please notice the warning',
}
warnText: 'please notice the warning',
};

const controls = {
disabled: {
control: 'boolean',
description: `Specify if the dropdown should be disabled, or not.`,
},
direction: {
control: 'select', options: directionOptions,
description: `Dropdown direction`
control: 'select',
options: directionOptions,
description: `Dropdown direction`,
},
hideLabel: {
control: 'boolean',
Expand All @@ -102,8 +103,9 @@ const controls = {
description: `Specify if the dropdown should be read only, or not.`,
},
size: {
control: 'select', options: sizes,
description: `Dropdown size.`
control: 'select',
options: sizes,
description: `Dropdown size.`,
},
titleText: {
control: 'text',
Expand Down Expand Up @@ -136,7 +138,7 @@ export const Default = {
`
)}
</cds-combo-box>
`
`,
};

export const WithLayer = {
Expand All @@ -159,7 +161,7 @@ export const WithLayer = {
</cds-combo-box>
</div>
</sb-template-layers>
`
`,
};

export const Playground = {
Expand Down Expand Up @@ -204,8 +206,8 @@ export const Playground = {
`
)}
</cds-combo-box>
`
}
`,
};

const meta = {
title: 'Components/Combo box',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,18 @@ const defaultArgs = {
type: null,
value: '',
warn: false,
warnText: 'please notice the warning',
}
warnText: 'please notice the warning',
};

const controls = {
disabled: {
control: 'boolean',
description: `Specify if the dropdown should be disabled, or not.`,
},
direction: {
control: 'select', options: directionOptions,
description: `Dropdown direction.`
control: 'select',
options: directionOptions,
description: `Dropdown direction.`,
},
hideLabel: {
control: 'boolean',
Expand Down Expand Up @@ -114,16 +115,18 @@ const controls = {
description: `Specify if the dropdown should be read only, or not.`,
},
size: {
control: 'select', options: sizes,
description: `Dropdown size.`
control: 'select',
options: sizes,
description: `Dropdown size.`,
},
titleText: {
control: 'text',
description: `Text that will be read by a screen reader when visiting this control.`,
},
type: {
control: 'select', options: types,
description: `Dropdown size.`
control: 'select',
options: types,
description: `Dropdown size.`,
},
value: {
control: 'text',
Expand Down Expand Up @@ -153,7 +156,7 @@ export const Default = {
`
)}
</cds-dropdown>
`
`,
};

export const Inline = {
Expand All @@ -170,7 +173,7 @@ export const Inline = {
`
)}
</cds-dropdown>
`
`,
};

export const InlineWithLayer = {
Expand All @@ -193,7 +196,7 @@ export const InlineWithLayer = {
</cds-dropdown>
</div>
</sb-template-layers>
`
`,
};

export const WithLayer = {
Expand All @@ -216,7 +219,7 @@ export const WithLayer = {
</cds-dropdown>
</div>
</sb-template-layers>
`
`,
};

export const Playground = {
Expand All @@ -239,32 +242,32 @@ export const Playground = {
warn,
warnText,
}) =>
html`
<cds-dropdown
?open=${open}
?disabled="${disabled}"
?hide-label=${hideLabel}
helper-text=${ifDefined(helperText)}
?invalid=${invalid}
?read-only=${readOnly}
invalid-text=${invalidText}
direction="${direction}"
title-text=${ifDefined(titleText)}
size="${ifDefined(size)}"
type="${ifDefined(type)}"
value=${ifDefined(value)}
label=${ifDefined(label)}
?warn=${warn}
warn-text=${warnText}>
${items.map(
(elem) => html`
<cds-dropdown-item ?disabled=${elem.disabled} value="${elem.value}"
>${elem.text}</cds-dropdown-item
>
`
)}
</cds-dropdown>
`
html`
<cds-dropdown
?open=${open}
?disabled="${disabled}"
?hide-label=${hideLabel}
helper-text=${ifDefined(helperText)}
?invalid=${invalid}
?read-only=${readOnly}
invalid-text=${invalidText}
direction="${direction}"
title-text=${ifDefined(titleText)}
size="${ifDefined(size)}"
type="${ifDefined(type)}"
value=${ifDefined(value)}
label=${ifDefined(label)}
?warn=${warn}
warn-text=${warnText}>
${items.map(
(elem) => html`
<cds-dropdown-item ?disabled=${elem.disabled} value="${elem.value}"
>${elem.text}</cds-dropdown-item
>
`
)}
</cds-dropdown>
`,
};

export const Skeleton = {
Expand All @@ -273,8 +276,8 @@ export const Skeleton = {
skip: true,
},
},
render: () => html` <cds-dropdown-skeleton></cds-dropdown-skeleton> `
}
render: () => html` <cds-dropdown-skeleton></cds-dropdown-skeleton> `,
};

const meta = {
title: 'Components/Dropdown',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ const levels = {
};

const defaultArgs = {
level: '0'
}
level: '0',
};

const controls = {
level: {
control: 'radio', options: levels,
description: `Specify the layer level.`
control: 'radio',
options: levels,
description: `Specify the layer level.`,
},
}
};

export const Default = {
render: () => html`
Expand All @@ -44,7 +45,7 @@ export const Default = {
<style>
${styles}
</style>
`
`,
};

export const CustomLevel = {
Expand All @@ -56,7 +57,7 @@ export const CustomLevel = {
<style>
${styles}
</style>
`
`,
};

export const UseLayer = {
Expand All @@ -70,17 +71,17 @@ export const UseLayer = {
});

return html`
<cds-layer>
<div class="example-layer-test-component use-layer"></div>
<cds-layer>
<div class="example-layer-test-component use-layer"></div>
<cds-layer>
<div class="example-layer-test-component use-layer"></div>
</cds-layer>
</cds-layer>
</cds-layer>
<style>
${styles}
</style>
`
}
<style>
${styles}
</style>
`;
},
};

export const Playground = {
Expand All @@ -91,7 +92,7 @@ export const Playground = {
skip: true,
},
},
render: ({level}) => html`
render: ({ level }) => html`
<cds-layer level="${level}">
<div class="example-layer-test-component">Test component</div>
</cds-layer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const tooltipAlignments = {

const defaultArgs = {
alignment: 'bottom',
open: false,
open: true,
};

const controls = {
Expand Down Expand Up @@ -64,7 +64,7 @@ export const Default = {
<br />
<div style="display: flex; align-items: center">
<cds-toggletip alignment="bottom" open>
Toggletip label -- using <code>defaultOpen</code> prop
Toggletip label -- using <code>open</code> prop
<p slot="body-text">
Lorem ipsum dolor sit amet, di os consectetur adipiscing elit, sed
Expand All @@ -83,7 +83,7 @@ export const Playground = {
args: defaultArgs,
render: ({ alignment, open }) => html`
<cds-toggletip alignment="${alignment}" ?open="${open}">
Toggletip label
Toggletip label -- using <code>open</code> prop
<p slot="body-text">
Lorem ipsum dolor sit amet, di os consectetur adipiscing elit, sed do
Expand Down

0 comments on commit 8213fd4

Please sign in to comment.