diff --git a/cosmoz-autocomplete.stories-CUChUx4L.js b/cosmoz-autocomplete.stories-CR_zUoSR.js similarity index 99% rename from cosmoz-autocomplete.stories-CUChUx4L.js rename to cosmoz-autocomplete.stories-CR_zUoSR.js index d5ab61c..824e1ba 100644 --- a/cosmoz-autocomplete.stories-CUChUx4L.js +++ b/cosmoz-autocomplete.stories-CR_zUoSR.js @@ -815,7 +815,10 @@ const styles$2 = tagged ` text-transform: var(--cosmoz-input-label-text-transform); font-weight: var(--cosmoz-input-label-font-weight); } - + .wrap:has(#input:not(:placeholder-shown)) slot[name='suffix']::slotted(*), + .wrap:has(#input:not(:placeholder-shown)) slot[name='prefix']::slotted(*) { + transform: translateY(var(--label-translate-y)); + } :host([always-float-label]) label, #input:not(:placeholder-shown) + label { transform: translateY( @@ -830,6 +833,11 @@ const styles$2 = tagged ` transform: translateY(var(--label-translate-y)); } + :host([always-float-label]) slot[name='suffix']::slotted(*), + :host([always-float-label]) slot[name='prefix']::slotted(*) { + transform: translateY(var(--label-translate-y)); + } + :host(:not(always-float-label):focus-within) #input::placeholder, :host(:focus-within) label { color: var(--focused-color); @@ -981,6 +989,9 @@ const observedAttributes$2 = [ const Input = (host) => { const { type = 'text', pattern, allowedPattern, autocomplete, value, readonly, disabled, min, max, step, maxlength, } = host, { onChange, onFocus, onInput, onRef } = useInput(host); const onBeforeInput = useAllowedPattern(allowedPattern); + useImperativeApi({ + focus: () => host.shadowRoot?.querySelector('#input')?.focus(), + }, []); return render(x ` import('./cosmoz-autocomplete.stories-CUChUx4L.js') + "./stories/cosmoz-autocomplete.stories.js": () => import('./cosmoz-autocomplete.stories-CR_zUoSR.js') }; function importFn(path) { return importers[path](); diff --git a/project.json b/project.json index 31e9b2a..e8bcd96 100644 --- a/project.json +++ b/project.json @@ -1 +1 @@ -{"generatedAt":1717438780016,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"npm","version":"10.5.0"},"framework":{"name":"@web/storybook-framework-web-components"},"renderer":"@storybook/web-components","storybookVersion":"7.6.17","storybookVersionSpecifier":"7.6.17","language":"javascript","storybookPackages":{"@storybook/builder-vite":{"version":"7.6.17"},"@storybook/storybook-deployer":{"version":"2.8.16"},"@storybook/web-components":{"version":"7.6.17"},"@web/storybook-builder":{"version":null},"@web/storybook-framework-web-components":{"version":"0.1.2"},"storybook":{"version":"7.6.19"}},"addons":{"@storybook/addon-essentials":{"version":"7.6.19"},"@storybook/addon-links":{"version":"7.6.19"}}} +{"generatedAt":1717574642399,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"npm","version":"10.5.0"},"framework":{"name":"@web/storybook-framework-web-components"},"renderer":"@storybook/web-components","storybookVersion":"7.6.17","storybookVersionSpecifier":"7.6.17","language":"javascript","storybookPackages":{"@storybook/builder-vite":{"version":"7.6.17"},"@storybook/storybook-deployer":{"version":"2.8.16"},"@storybook/web-components":{"version":"7.6.17"},"@web/storybook-builder":{"version":null},"@web/storybook-framework-web-components":{"version":"0.1.2"},"storybook":{"version":"7.6.19"}},"addons":{"@storybook/addon-essentials":{"version":"7.6.19"},"@storybook/addon-links":{"version":"7.6.19"}}}