@seahax/elemental 0.5.6 → 0.5.8

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.
package/README.md CHANGED
@@ -14,8 +14,7 @@ Contains everything you need to build anything from a single component up to a f
14
14
  - No Dependencies
15
15
  - Tiny Bundle Size
16
16
 
17
- [![NPM](https://img.shields.io/npm/v/%40seahax%2Felemental?color=red)](https://www.npmjs.com/package/@seahax/elemental) [![BundleJS (GZIP)](https://img.shields.io/bundlejs/size/%40seahax/elemental?label=bundlejs%20(gzip))
18
- ](https://bundlejs.com/?q=%40seahax%2Felemental%40latest&treeshake=%5B*%5D) [![builds.sr.ht status](https://builds.sr.ht/~seahax/elemental/commits/main/merge.yaml.svg)](https://builds.sr.ht/~seahax/elemental/commits/main/merge.yaml?)
17
+ [![NPM](https://img.shields.io/npm/v/%40seahax%2Felemental?color=red)](https://www.npmjs.com/package/@seahax/elemental) [![BundleJS (GZIP)](https://img.shields.io/bundlejs/size/%40seahax/elemental?label=bundlejs%20(gzip))](https://bundlejs.com/?q=%40seahax%2Felemental%40latest&treeshake=%5B*%5D) [![builds.sr.ht status](https://builds.sr.ht/~seahax/elemental/commits/main/merge.yaml.svg)](https://builds.sr.ht/~seahax/elemental/commits/main/merge.yaml?)
19
18
 
20
19
  ## Define A Web Component
21
20
 
@@ -0,0 +1,2 @@
1
+ /** Space separated class string helper. */
2
+ export declare function classes(classes: readonly (string | boolean | null | undefined)[] | Readonly<Record<string, boolean | null | undefined>>): string | null;
@@ -0,0 +1,8 @@
1
+ //#region src/classes.ts
2
+ function e(e) {
3
+ return (Array.isArray(e) ? e.filter(Boolean).join(" ") : Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ")) || null;
4
+ }
5
+ //#endregion
6
+ export { e as classes };
7
+
8
+ //# sourceMappingURL=classes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classes.js","names":[],"sources":["../src/classes.ts"],"sourcesContent":["/** Space separated class string helper. */\nexport function classes(\n classes: readonly (string | boolean | null | undefined)[] | Readonly<Record<string, boolean | null | undefined>>,\n): string | null {\n return (\n (Array.isArray(classes)\n ? classes.filter(Boolean).join(' ')\n : Object.entries(classes)\n .filter(([, value]) => value)\n .map(([key]) => key)\n .join(' ')) || null\n );\n}\n"],"mappings":";AACA,SAAgB,EACd,GACe;AACf,SACG,MAAM,QAAQ,EAAQ,GACnB,EAAQ,OAAO,QAAQ,CAAC,KAAK,IAAI,GACjC,OAAO,QAAQ,EAAQ,CACpB,QAAQ,GAAG,OAAW,EAAM,CAC5B,KAAK,CAAC,OAAS,EAAI,CACnB,KAAK,IAAI,KAAK"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './classes.ts';
1
2
  export * from './createStore.ts';
2
3
  export * from './defineComponent.ts';
3
4
  export * from './hooks/useAsync.ts';
package/dist/index.js CHANGED
@@ -1,17 +1,18 @@
1
- import { createStore as e } from "./createStore.js";
2
- import { useRef as t } from "./hooks/useRef.js";
3
- import { defineComponent as n } from "./defineComponent.js";
4
- import { useDisconnectCallback as r } from "./hooks/useDisconnect.js";
5
- import { useEffect as i } from "./hooks/useEffect.js";
6
- import { useAsync as a } from "./hooks/useAsync.js";
7
- import { useHost as o } from "./hooks/useHost.js";
8
- import { useAttributes as s } from "./hooks/useAttributes.js";
9
- import { useChildEffect as c } from "./hooks/useChildEffect.js";
10
- import { useDocument as l } from "./hooks/useDocument.js";
11
- import { useElementInternals as u } from "./hooks/useElementInternals.js";
12
- import { useForm as d, useFormDisabled as f, useFormResetCallback as p, useFormRestoreCallback as m } from "./hooks/useForm.js";
13
- import { useParent as h } from "./hooks/useParent.js";
14
- import { useStore as g } from "./hooks/useStore.js";
15
- import { useRoute as _ } from "./hooks/useRoute.js";
16
- import { html as v } from "./html.js";
17
- export { e as createStore, n as defineComponent, v as h, v as html, a as useAsync, s as useAttributes, c as useChildEffect, r as useDisconnectCallback, l as useDocument, i as useEffect, u as useElementInternals, d as useForm, f as useFormDisabled, p as useFormResetCallback, m as useFormRestoreCallback, o as useHost, h as useParent, t as useRef, _ as useRoute, g as useStore };
1
+ import { classes as e } from "./classes.js";
2
+ import { createStore as t } from "./createStore.js";
3
+ import { useRef as n } from "./hooks/useRef.js";
4
+ import { defineComponent as r } from "./defineComponent.js";
5
+ import { useDisconnectCallback as i } from "./hooks/useDisconnect.js";
6
+ import { useEffect as a } from "./hooks/useEffect.js";
7
+ import { useAsync as o } from "./hooks/useAsync.js";
8
+ import { useHost as s } from "./hooks/useHost.js";
9
+ import { useAttributes as c } from "./hooks/useAttributes.js";
10
+ import { useChildEffect as l } from "./hooks/useChildEffect.js";
11
+ import { useDocument as u } from "./hooks/useDocument.js";
12
+ import { useElementInternals as d } from "./hooks/useElementInternals.js";
13
+ import { useForm as f, useFormDisabled as p, useFormResetCallback as m, useFormRestoreCallback as h } from "./hooks/useForm.js";
14
+ import { useParent as g } from "./hooks/useParent.js";
15
+ import { useStore as _ } from "./hooks/useStore.js";
16
+ import { useRoute as v } from "./hooks/useRoute.js";
17
+ import { html as y } from "./html.js";
18
+ export { e as classes, t as createStore, r as defineComponent, y as h, y as html, o as useAsync, c as useAttributes, l as useChildEffect, i as useDisconnectCallback, u as useDocument, a as useEffect, d as useElementInternals, f as useForm, p as useFormDisabled, m as useFormResetCallback, h as useFormRestoreCallback, s as useHost, g as useParent, n as useRef, v as useRoute, _ as useStore };
package/package.json CHANGED
@@ -21,5 +21,5 @@
21
21
  "publishConfig": {
22
22
  "access": "public"
23
23
  },
24
- "version": "0.5.6"
24
+ "version": "0.5.8"
25
25
  }