lituix 0.1.23 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ import { type ReactiveController, type ReactiveControllerHost, type TemplateResult } from "lit";
2
+ /**
3
+ * Material 水波纹:button / button-group-item / card 三个可点击件共用。
4
+ *
5
+ * 用法:
6
+ * static styles = [tokens, baseStyles, rippleStyles, css`...`];
7
+ * private _ripple = new RippleController(this);
8
+ * <div @pointerdown=${(e) => this.ripple && !this.disabled && this._ripple.add(e)}>
9
+ * ${this._ripple.render()}
10
+ * </div>
11
+ */
12
+ export interface RippleItem {
13
+ id: number;
14
+ /** 以按下元素左上角为原点的落点 */
15
+ x: number;
16
+ y: number;
17
+ /** 直径,略大于元素最长边,保证铺满 */
18
+ size: number;
19
+ }
20
+ export declare const RIPPLE_DURATION_MS = 560;
21
+ /** 动画名固定为 lui-ripple,组件样式统一吃这一段,不再各自声明 */
22
+ export declare const rippleStyles: import("lit").CSSResult;
23
+ export declare class RippleController implements ReactiveController {
24
+ readonly host: ReactiveControllerHost & HTMLElement;
25
+ items: RippleItem[];
26
+ private _id;
27
+ constructor(host: ReactiveControllerHost & HTMLElement);
28
+ /** 挂上按下事件的目标元素上的一点生成一条波纹 */
29
+ add: (event: PointerEvent) => void;
30
+ render(): TemplateResult;
31
+ /** 组件断开时清掉 pending 的波纹,避免下次接入瞬间闪旧帧 */
32
+ hostDisconnected(): void;
33
+ }
34
+ //# sourceMappingURL=ripple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ripple.d.ts","sourceRoot":"","sources":["../../src/utils/ripple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAE3G;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,0CAA0C;AAC1C,eAAO,MAAM,YAAY,yBA4BxB,CAAC;AAEF,qBAAa,gBAAiB,YAAW,kBAAkB;IACzD,QAAQ,CAAC,IAAI,EAAE,sBAAsB,GAAG,WAAW,CAAC;IAEpD,KAAK,EAAE,UAAU,EAAE,CAAM;IAEzB,OAAO,CAAC,GAAG,CAAK;gBAEJ,IAAI,EAAE,sBAAsB,GAAG,WAAW;IAKtD,4BAA4B;IAC5B,GAAG,GAAI,OAAO,YAAY,KAAG,IAAI,CAiB/B;IAEF,MAAM,IAAI,cAAc;IAgBxB,sCAAsC;IACtC,gBAAgB,IAAI,IAAI;CAGzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lituix",
3
- "version": "0.1.23",
3
+ "version": "0.1.26",
4
4
  "description": "Framework-agnostic UI components based on Lit Web Components",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",