From 16fbb66843c1d6f18ba774b303f30cd368ba847f Mon Sep 17 00:00:00 2001 From: zdhxiong Date: Sat, 19 Oct 2024 17:41:28 +0800 Subject: [PATCH] remove @lit-labs/motion. fixed #354 --- packages/mdui/package.json | 1 - packages/mdui/src/components/text-field/index.ts | 15 +-------------- .../mdui/src/components/text-field/style.less | 1 + pnpm-lock.yaml | 10 ---------- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/packages/mdui/package.json b/packages/mdui/package.json index 92d33154..5bd22567 100644 --- a/packages/mdui/package.json +++ b/packages/mdui/package.json @@ -49,7 +49,6 @@ }, "homepage": "https://www.mdui.org", "dependencies": { - "@lit-labs/motion": "^1.0.7", "@lit/localize": "^0.12.1", "@lit/reactive-element": "^2.0.4", "@material/material-color-utilities": "^0.3.0", diff --git a/packages/mdui/src/components/text-field/index.ts b/packages/mdui/src/components/text-field/index.ts index bf63ef2b..a8d1a69e 100644 --- a/packages/mdui/src/components/text-field/index.ts +++ b/packages/mdui/src/components/text-field/index.ts @@ -6,7 +6,6 @@ import { live } from 'lit/directives/live.js'; import { createRef, ref } from 'lit/directives/ref.js'; import { when } from 'lit/directives/when.js'; import { msg } from '@lit/localize'; -import { animate } from '@lit-labs/motion'; import { $ } from '@mdui/jq/$.js'; import '@mdui/jq/methods/css.js'; import { MduiElement } from '@mdui/shared/base/mdui-element.js'; @@ -15,7 +14,6 @@ import { HasSlotController } from '@mdui/shared/controllers/has-slot.js'; import { defaultValue } from '@mdui/shared/decorators/default-value.js'; import { watch } from '@mdui/shared/decorators/watch.js'; import { booleanConverter } from '@mdui/shared/helpers/decorator.js'; -import { getDuration, getEasing } from '@mdui/shared/helpers/motion.js'; import { observeResize } from '@mdui/shared/helpers/observeResize.js'; import { nothingTemplate } from '@mdui/shared/helpers/template.js'; import '@mdui/shared/icons/cancel--outlined.js'; @@ -904,18 +902,7 @@ export class TextField private renderLabel(): TemplateResult { return this.label - ? html`` + ? html`` : nothingTemplate; } diff --git a/packages/mdui/src/components/text-field/style.less b/packages/mdui/src/components/text-field/style.less index 8171050e..fb66d7ed 100644 --- a/packages/mdui/src/components/text-field/style.less +++ b/packages/mdui/src/components/text-field/style.less @@ -208,6 +208,7 @@ overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; + transition: all var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard); .top(16); .color(on-surface-variant); .typescale(body-large); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 318f1d79..8ae90043 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -185,9 +185,6 @@ importers: '@floating-ui/utils': specifier: ^0.2.4 version: 0.2.4 - '@lit-labs/motion': - specifier: ^1.0.7 - version: 1.0.7 '@lit/localize': specifier: ^0.12.1 version: 0.12.1 @@ -546,9 +543,6 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@lit-labs/motion@1.0.7': - resolution: {integrity: sha512-odykI6Talw274lYRWQvrGNplHzRy5QAtYEMbqonX6oesEuDQq1nR9Mis38X587jinj68Gjria0mlzqowJ1FACw==} - '@lit-labs/ssr-dom-shim@1.2.0': resolution: {integrity: sha512-yWJKmpGE6lUURKAaIltoPIE/wrbY3TEkqQt+X0m+7fQNnAv0keydnYvbiJFP1PnMhizmIWRWOG5KLhYyc/xl+g==} @@ -4241,10 +4235,6 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@lit-labs/motion@1.0.7': - dependencies: - lit: 3.1.4 - '@lit-labs/ssr-dom-shim@1.2.0': {} '@lit/localize-tools@0.7.2':