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

Fix(dependencies/chip): latest input dependencies and new styling for the chip tested #151

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"dependencies": {
"@lit-labs/virtualizer": "^2.0.0",
"@neovici/cosmoz-dropdown": "^4.0.0",
"@neovici/cosmoz-input": "^4.0.0",
"@neovici/cosmoz-input": "^4.1.1",
"@neovici/cosmoz-utils": "^6.0.0",
"@pionjs/pion": "^2.0.0",
"lit-html": "^2.0.0 || ^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type AProps<I> = Omit<Props<I>, keyof RProps<I>> &

const blank = () => nothing;

const inputParts = ['input', 'control', 'label', 'line', 'error']
const inputParts = ['input', 'control', 'label', 'line', 'error', 'chip', 'chip-text', 'chip-clear']
Copy link
Contributor

Choose a reason for hiding this comment

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

inputParts gets set on <cosmoz-input [..] exportparts=${inputParts}, but the parts you have added to the list are not part of cosmoz-input. This change has no effect.

.map((part) => `${part}: input-${part}`)
.join();

Expand Down
39 changes: 37 additions & 2 deletions stories/cosmoz-autocomplete.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,44 @@ const css = html`
.textProperty=${'text'}
.value=${colors[0]}
></cosmoz-autocomplete>
`;
`,
contourStyling = () => html` <style>
cosmoz-autocomplete {
--cosmoz-input-border-radius: 4px;
--cosmoz-input-padding: 8px 0;
--cosmoz-input-label-width: auto;
--cosmoz-input-no-placeholder-label-bg: white;
--cosmoz-input-label-padding: 0;
--cosmoz-input-line-display: none;
--cosmoz-input-contour-size: 1px;
--cosmoz-input-background: white;
--cosmoz-autocomplete-chip-border-radius: 4px;
}
cosmoz-autocomplete::part(input-control) {
margin: 0 8px;
}
cosmoz-autocomplete::part(chip-clear) {
margin-left: 4px;
}
Comment on lines +98 to +103
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should expose these as css variables: --cosmoz-autocomplete-input-control-margin and --cosmoz-autocomplete-chip-clear-margin, instead of relying on parts. Parts are good, but css variables are better, because they cascade.

</style>
<cosmoz-autocomplete
.label=${'Choose color'}
.source=${colors}
.limit=${5}
.textProperty=${'text'}
.value=${colors[0]}
contour
Copy link
Contributor

Choose a reason for hiding this comment

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

What is up with this contour attribute?

></cosmoz-autocomplete>`;

export { basic, single, hideEmpty, defaultIndex, disabled, placeholder };
export {
basic,
single,
hideEmpty,
defaultIndex,
disabled,
placeholder,
contourStyling,
};

export const overflown = () => html` ${css}
<cosmoz-autocomplete
Expand Down
Loading