lism-css 0.1.8 → 0.2.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.
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import i from "../Lism/index.js";
3
- function m({ size: t = !0, layout: o, ...r }) {
4
- return /* @__PURE__ */ n(o || i, { isContainer: t, ...r });
3
+ function m({ size: t, layout: o, ...r }) {
4
+ return /* @__PURE__ */ n(o || i, { isContainer: t || !0, ...r });
5
5
  }
6
6
  export {
7
7
  m as default
@@ -1,53 +1,60 @@
1
- import b from "./presets.js";
2
- import S from "../../lib/helper/atts.js";
3
- function d(u) {
4
- const a = {}, e = u.match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);
5
- if (e) {
6
- const [, r, v] = e, f = /(\w+)=["']([^"']*)["']/g;
7
- let l;
8
- for (; (l = f.exec(r)) !== null; ) {
9
- const [, t, g] = l;
10
- a[t] = g;
1
+ import p from "./presets.js";
2
+ import h from "../../lib/helper/atts.js";
3
+ function b(c) {
4
+ const i = {}, l = c.match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);
5
+ if (l) {
6
+ const [, g, v] = l, u = /([\w-]+)=["']([^"']*)["']/g;
7
+ let a;
8
+ for (; (a = u.exec(g)) !== null; ) {
9
+ const [, t, f] = a;
10
+ if (t === "style") {
11
+ const s = {};
12
+ f.split(";").forEach((r) => {
13
+ const [e, o] = r.split(":").map((n) => n.trim());
14
+ e && o && (s[e] = o);
15
+ }), i[t] = s;
16
+ } else
17
+ i[t] = f;
11
18
  }
12
- return { svgProps: a, svgContent: v };
19
+ return { svgProps: i, svgContent: v };
13
20
  }
14
21
  return {};
15
22
  }
16
- function y({
17
- lismClass: u,
18
- className: a = "",
19
- style: e = {},
23
+ function w({
24
+ lismClass: c,
25
+ className: i = "",
26
+ style: l = {},
20
27
  // variant,
21
- as: r,
28
+ as: g,
22
29
  tag: v,
23
- scale: f,
24
- offset: l,
30
+ scale: u,
31
+ offset: a,
25
32
  icon: t,
26
- label: g,
33
+ label: f,
27
34
  exProps: s = {},
28
- ...o
35
+ ...r
29
36
  }) {
30
- let n = v || "span", m = "";
31
- if (o.viewBox)
32
- n = "svg";
37
+ let e = v || "span", o = "";
38
+ if (r.viewBox)
39
+ e = "svg";
33
40
  else if (t)
34
41
  if (typeof t == "string")
35
42
  if (t.startsWith("<svg")) {
36
- n = "_SVG_";
37
- const { svgProps: i = {}, svgContent: c = "" } = d(t), { class: h, style: _, ...C } = i;
38
- a = S(a, h), e = { ..._ }, s = { ...s, ...C }, m = c;
43
+ e = "_SVG_";
44
+ const { svgProps: n = {}, svgContent: m = "" } = b(t), { class: S, style: C, ..._ } = n;
45
+ i = h(i, S), l = { ...l, ...C }, s = { ...s, ..._, fill: "currentColor" }, o = m;
39
46
  } else {
40
- const i = b[t] || null;
41
- i != null && (n = "_SVG_", s = { ...s, ...i });
47
+ const n = p[t] || null;
48
+ n != null && (e = "_SVG_", s = { ...s, ...n });
42
49
  }
43
50
  else if (typeof t == "object" && t.as) {
44
- const { as: i, ...c } = t;
45
- n = i, s = { ...s, ...c };
51
+ const { as: n, ...m } = t;
52
+ e = n, s = { ...s, ...m };
46
53
  } else
47
- n = t;
48
- else r && (n = r);
49
- return g ? (s["aria-label"] = g, s.role = "img") : s["aria-hidden"] = "true", f && (e["--scale"] = f), l && (e["--offset"] = l), o.lismClass = S(u, "l--icon", a), o.style = { ...e }, { Component: n, lismProps: o, exProps: s, content: m };
54
+ e = t;
55
+ else g && (e = g);
56
+ return f ? (s["aria-label"] = f, s.role = "img") : s["aria-hidden"] = "true", u && (l["--scale"] = u), a && (l["--offset"] = a), r.lismClass = h(c, "l--icon", i), r.style = { ...l }, { Component: e, lismProps: r, exProps: s, content: o };
50
57
  }
51
58
  export {
52
- y as default
59
+ w as default
53
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lism-css",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "A layout-first CSS framework for websites.",
5
5
  "author": {
6
6
  "name": "ddryo",
@@ -15,6 +15,5 @@ const Layout = layout || Lism;
15
15
 
16
16
  <script>
17
17
  import setModal from '../../../dist/components/Modal/setModal';
18
- console.log('modal.astro');
19
18
  setModal();
20
19
  </script>