@lit-material/divider 0.0.3 → 0.1.0

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.
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "kind": "variable",
11
11
  "name": "styles",
12
- "default": "css` :host { display: block; box-sizing: border-box; height: 1px; width: 100%; background-color: var(--md-sys-color-outline-variant, #cac4d0); } /* Inset: indented from the axis perpendicular to the line itself — the inline (left/right) axis for a horizontal divider. */ :host([inset-start]) { margin-inline-start: 16px; width: auto; } :host([inset-end]) { margin-inline-end: 16px; width: auto; } :host([orientation=\"vertical\"]) { display: inline-block; align-self: stretch; height: auto; width: 1px; } /* Vertical: \"inset\" indents the block (top/bottom) axis instead. */ :host([orientation=\"vertical\"][inset-start]) { margin-inline-start: 0; margin-block-start: 16px; width: 1px; } :host([orientation=\"vertical\"][inset-end]) { margin-inline-end: 0; margin-block-end: 16px; width: 1px; } `"
12
+ "default": "css` :host { display: block; box-sizing: border-box; height: 1px; width: 100%; background-color: var(--md-sys-color-outline-variant, #cac4d0); } :host([hidden]) { display: none; } /* Inset: indented from the axis perpendicular to the line itself — the inline (left/right) axis for a horizontal divider. */ :host([inset-start]) { margin-inline-start: 16px; width: auto; } :host([inset-end]) { margin-inline-end: 16px; width: auto; } :host([orientation=\"vertical\"]) { display: inline-block; align-self: stretch; height: auto; width: 1px; } /* Vertical: \"inset\" indents the block (top/bottom) axis instead. */ :host([orientation=\"vertical\"][inset-start]) { margin-inline-start: 0; margin-block-start: 16px; width: 1px; } :host([orientation=\"vertical\"][inset-end]) { margin-inline-end: 0; margin-block-end: 16px; width: 1px; } `"
13
13
  }
14
14
  ],
15
15
  "exports": [
@@ -138,6 +138,27 @@
138
138
  }
139
139
  }
140
140
  ]
141
+ },
142
+ {
143
+ "kind": "javascript-module",
144
+ "path": "src/react.ts",
145
+ "declarations": [
146
+ {
147
+ "kind": "variable",
148
+ "name": "Divider",
149
+ "description": "React wrapper for `<lit-material-divider>`."
150
+ }
151
+ ],
152
+ "exports": [
153
+ {
154
+ "kind": "js",
155
+ "name": "Divider",
156
+ "declaration": {
157
+ "name": "Divider",
158
+ "module": "src/react.ts"
159
+ }
160
+ }
161
+ ]
141
162
  }
142
163
  ]
143
164
  }
@@ -1 +1 @@
1
- {"version":3,"file":"divider-styles.d.ts","sourceRoot":"","sources":["../src/divider-styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAwClB,CAAC"}
1
+ {"version":3,"file":"divider-styles.d.ts","sourceRoot":"","sources":["../src/divider-styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA4ClB,CAAC"}
@@ -8,6 +8,10 @@ export const styles = css `
8
8
  background-color: var(--md-sys-color-outline-variant, #cac4d0);
9
9
  }
10
10
 
11
+ :host([hidden]) {
12
+ display: none;
13
+ }
14
+
11
15
  /* Inset: indented from the axis perpendicular to the line itself — the
12
16
  inline (left/right) axis for a horizontal divider. */
13
17
  :host([inset-start]) {
@@ -1 +1 @@
1
- {"version":3,"file":"divider-styles.js","sourceRoot":"","sources":["../src/divider-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCxB,CAAC"}
1
+ {"version":3,"file":"divider-styles.js","sourceRoot":"","sources":["../src/divider-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CxB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { LitMaterialDivider } from "./divider.js";
2
+ /** React wrapper for `<lit-material-divider>`. */
3
+ export declare const Divider: import("@lit/react").ReactWebComponent<LitMaterialDivider, {}>;
4
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,kDAAkD;AAClD,eAAO,MAAM,OAAO,gEAKlB,CAAC"}
package/dist/react.js ADDED
@@ -0,0 +1,13 @@
1
+ // Generated by tools/framework-bindings.mjs from custom-elements.json. Do not edit.
2
+ // React 18 and 19 wrappers: properties set as properties, events as `on<Event>` props.
3
+ import * as React from "react";
4
+ import { createComponent } from "@lit/react";
5
+ import { LitMaterialDivider } from "./divider.js";
6
+ /** React wrapper for `<lit-material-divider>`. */
7
+ export const Divider = createComponent({
8
+ tagName: "lit-material-divider",
9
+ elementClass: LitMaterialDivider,
10
+ react: React,
11
+ displayName: "Divider",
12
+ });
13
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,uFAAuF;AACvF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,kDAAkD;AAClD,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;IACrC,OAAO,EAAE,sBAAsB;IAC/B,YAAY,EAAE,kBAAkB;IAChC,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,SAAS;CACvB,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
3
+ "version": 1.1,
4
+ "tags": [
5
+ {
6
+ "name": "lit-material-divider",
7
+ "description": "Material Design 3 divider — a thin line that groups or separates content, typically inside a list or between sections. Purely visual: no slot, no shadow DOM content at all (`render()` returns nothing) — the host element itself *is* the line, styled directly via `:host`. No dependency on `@lit-material/core` (nothing to click or focus). `insetStart`/`insetEnd` indent the line on the axis perpendicular to it (inline/left-right for a horizontal divider, block/top-bottom for a vertical one) — e.g. to align a divider under a list item's text with a leading icon it doesn't run under. Both unset is a full-bleed divider; both set is MD3's \"middle inset\" variant.",
8
+ "attributes": [
9
+ {
10
+ "name": "orientation"
11
+ },
12
+ {
13
+ "name": "inset-start"
14
+ },
15
+ {
16
+ "name": "inset-end"
17
+ }
18
+ ],
19
+ "references": [
20
+ {
21
+ "name": "Documentation",
22
+ "url": "https://lit.rws8.tech/components/divider/"
23
+ }
24
+ ]
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@lit-material/divider",
4
+ "version": "0.1.0",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "lit-material-divider",
11
+ "description": "Material Design 3 divider — a thin line that groups or separates content, typically inside a list or between sections. Purely visual: no slot, no shadow DOM content at all (`render()` returns nothing) — the host element itself *is* the line, styled directly via `:host`. No dependency on `@lit-material/core` (nothing to click or focus). `insetStart`/`insetEnd` indent the line on the axis perpendicular to it (inline/left-right for a horizontal divider, block/top-bottom for a vertical one) — e.g. to align a divider under a list item's text with a leading icon it doesn't run under. Both unset is a full-bleed divider; both set is MD3's \"middle inset\" variant.",
12
+ "doc-url": "https://lit.rws8.tech/components/divider/",
13
+ "attributes": [
14
+ {
15
+ "name": "orientation",
16
+ "value": {
17
+ "type": "DividerOrientation"
18
+ }
19
+ },
20
+ {
21
+ "name": "inset-start",
22
+ "value": {
23
+ "type": "boolean"
24
+ }
25
+ },
26
+ {
27
+ "name": "inset-end",
28
+ "value": {
29
+ "type": "boolean"
30
+ }
31
+ }
32
+ ],
33
+ "slots": [],
34
+ "events": [],
35
+ "js": {
36
+ "properties": [
37
+ {
38
+ "name": "insetEnd",
39
+ "type": "boolean"
40
+ },
41
+ {
42
+ "name": "insetStart",
43
+ "type": "boolean"
44
+ },
45
+ {
46
+ "name": "orientation",
47
+ "type": "DividerOrientation"
48
+ }
49
+ ],
50
+ "events": []
51
+ }
52
+ }
53
+ ]
54
+ }
55
+ }
56
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lit-material/divider",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "description": "Material Design 3 divider web component (horizontal or vertical, optionally inset).",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -8,7 +8,7 @@
8
8
  "email": "bohdaq@gmail.com",
9
9
  "url": "https://github.com/bohdaq"
10
10
  },
11
- "homepage": "https://github.com/bohdaq/lit-material#readme",
11
+ "homepage": "https://lit.rws8.tech/components/divider/",
12
12
  "bugs": "https://github.com/bohdaq/lit-material/issues",
13
13
  "repository": {
14
14
  "type": "git",
@@ -30,18 +30,42 @@
30
30
  ".": {
31
31
  "types": "./dist/index.d.ts",
32
32
  "default": "./dist/index.js"
33
+ },
34
+ "./react": {
35
+ "types": "./dist/react.d.ts",
36
+ "default": "./dist/react.js"
37
+ },
38
+ "./jsx": {
39
+ "types": "./types/jsx.d.ts"
40
+ },
41
+ "./vue": {
42
+ "types": "./types/vue.d.ts"
33
43
  }
34
44
  },
35
45
  "files": [
36
46
  "dist",
37
- "custom-elements.json"
47
+ "custom-elements.json",
48
+ "types"
38
49
  ],
50
+ "web-types": "./dist/web-types.json",
39
51
  "publishConfig": {
40
52
  "access": "public"
41
53
  },
42
54
  "dependencies": {
43
55
  "lit": "^3.2.0",
44
- "@lit-material/tokens": "0.0.2"
56
+ "@lit-material/tokens": "0.1.0"
57
+ },
58
+ "peerDependencies": {
59
+ "@lit/react": "^1.0.0",
60
+ "react": ">=18"
61
+ },
62
+ "peerDependenciesMeta": {
63
+ "@lit/react": {
64
+ "optional": true
65
+ },
66
+ "react": {
67
+ "optional": true
68
+ }
45
69
  },
46
70
  "devDependencies": {
47
71
  "@lit-labs/ssr": "^3.3.1",
package/types/jsx.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ // Generated by tools/framework-bindings.mjs from custom-elements.json. Do not edit.
2
+ // React 19 renders custom elements natively; this types them in JSX. Load it with
3
+ // `import type {} from "<package>/jsx";`. React 19 adds a listener for `on<event>` props as written.
4
+ import type { DetailedHTMLProps, HTMLAttributes } from "react";
5
+ import type { LitMaterialDivider } from "../dist/divider.js";
6
+
7
+ type ElementProps<E, K extends keyof E> = Omit<DetailedHTMLProps<HTMLAttributes<E>, E>, K> & Partial<Pick<E, K>>;
8
+
9
+ declare module "react" {
10
+ namespace JSX {
11
+ interface IntrinsicElements {
12
+ /** Material Design 3 divider — a thin line that groups or separates content, typically inside a list or between sections. Purely visual: no slot, no shadow DOM content at all (`render()` returns nothing) — the host element itself *is* the line, styled directly via `:host`. No dependency on `@lit-material/core` (nothing to click or focus). `insetStart`/`insetEnd` indent the line on the axis perpendicular to it (inline/left-right for a horizontal divider, block/top-bottom for a vertical one) — e.g. to align a divider under a list item's text with a leading icon it doesn't run under. Both unset is a full-bleed divider; both set is MD3's "middle inset" variant. */
13
+ "lit-material-divider": ElementProps<LitMaterialDivider, "insetEnd" | "insetStart" | "orientation">;
14
+ }
15
+ }
16
+ }
package/types/vue.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ // Generated by tools/framework-bindings.mjs from custom-elements.json. Do not edit.
2
+ // Types the elements in Vue templates (Volar). Load it with `import type {} from "<package>/vue";`, and
3
+ // tell the compiler they're custom elements: compilerOptions.isCustomElement = (tag) => tag.startsWith("lit-material-").
4
+ import type { DefineComponent } from "vue";
5
+ import type { LitMaterialDivider } from "../dist/divider.js";
6
+
7
+ declare module "vue" {
8
+ interface GlobalComponents {
9
+ /** Material Design 3 divider — a thin line that groups or separates content, typically inside a list or between sections. Purely visual: no slot, no shadow DOM content at all (`render()` returns nothing) — the host element itself *is* the line, styled directly via `:host`. No dependency on `@lit-material/core` (nothing to click or focus). `insetStart`/`insetEnd` indent the line on the axis perpendicular to it (inline/left-right for a horizontal divider, block/top-bottom for a vertical one) — e.g. to align a divider under a list item's text with a leading icon it doesn't run under. Both unset is a full-bleed divider; both set is MD3's "middle inset" variant. */
10
+ "lit-material-divider": DefineComponent<Partial<Pick<LitMaterialDivider, "insetEnd" | "insetStart" | "orientation">>>;
11
+ }
12
+ }