@code0-tech/pictor 0.10.1 → 0.10.2

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,20 +1,20 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import t from "react";
1
+ import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
+ import n from "react";
3
3
  import "../../utils/contextStore.js";
4
- import { mergeComponentProps as l } from "../../utils/component.js";
4
+ import { mergeComponentProps as a } from "../../utils/component.js";
5
5
  import "js-md5";
6
6
  import '../../assets/components/breadcrumb/Breadcrumb.style.css';/* empty css */
7
- import { IconChevronRight as a } from "@tabler/icons-react";
8
- const j = (m) => {
7
+ import { IconChevronRight as d } from "@tabler/icons-react";
8
+ const j = (i) => {
9
9
  const {
10
- splitter: n = /* @__PURE__ */ r(a, { size: 16 }),
11
- children: o,
12
- ...i
13
- } = m, c = t.Children.count(o);
14
- return /* @__PURE__ */ r("div", { ...l("breadcrumb", i), children: t.Children.map(o, (p, e) => /* @__PURE__ */ s(t.Fragment, { children: [
15
- p,
16
- e < c - 1 ? /* @__PURE__ */ r("span", { className: "breadcrumb__splitter", children: n }) : null
17
- ] }, e)) });
10
+ splitter: m = /* @__PURE__ */ t(d, { size: 16 }),
11
+ children: l,
12
+ ...c
13
+ } = i, e = n.Children.toArray(l).filter((r) => r != null), s = e.length;
14
+ return /* @__PURE__ */ t("div", { ...a("breadcrumb", c), children: e.map((r, o) => /* @__PURE__ */ p(n.Fragment, { children: [
15
+ r,
16
+ o < s - 1 ? /* @__PURE__ */ t("span", { className: "breadcrumb__splitter", children: m }) : null
17
+ ] }, o)) });
18
18
  };
19
19
  export {
20
20
  j as Breadcrumb
@@ -2,7 +2,7 @@ import { default as React, ReactElement } from 'react';
2
2
  import { ButtonProps } from '../button/Button';
3
3
  import { Component, Color } from '../../utils';
4
4
  export interface ButtonGroupType extends Component<HTMLDivElement> {
5
- children: ReactElement<ButtonProps>[];
5
+ children: ReactElement<ButtonProps> | ReactElement<ButtonProps>[];
6
6
  color?: Color;
7
7
  }
8
8
  export declare const ButtonGroup: React.FC<ButtonGroupType>;
@@ -1,31 +1,33 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { c as u } from "../../_virtual/compiler-runtime.js";
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { c as _ } from "../../_virtual/compiler-runtime.js";
3
+ import b from "react";
3
4
  import '../../assets/components/button-group/ButtonGroup.style.css';/* empty css */
4
5
  import "../../utils/contextStore.js";
5
- import "react";
6
- import { mergeComponentProps as c } from "../../utils/component.js";
6
+ import { mergeComponentProps as h } from "../../utils/component.js";
7
7
  import "js-md5";
8
- const v = (p) => {
9
- const t = u.c(10);
8
+ const B = (e) => {
9
+ const t = _.c(8);
10
10
  let o, r;
11
- if (t[0] !== p) {
11
+ if (t[0] !== e) {
12
12
  const {
13
- children: n,
14
- color: i,
15
- ...l
16
- } = p;
17
- o = n, r = c(`button-group button-group--${i === void 0 ? "secondary" : i}`, l), t[0] = p, t[1] = o, t[2] = r;
13
+ children: f,
14
+ color: m,
15
+ ...a
16
+ } = e, d = m === void 0 ? "secondary" : m, s = b.Children.toArray(f).filter(v), l = s.length;
17
+ o = h(`button-group button-group--${d}`, a);
18
+ let i;
19
+ t[3] !== l ? (i = (g, u) => {
20
+ let c = "button-group__item";
21
+ return u === l - 1 ? c = "button-group__last" : u === 0 && (c = "button-group__first"), /* @__PURE__ */ p("div", { className: c, children: g }, `button-group-${u}`);
22
+ }, t[3] = l, t[4] = i) : i = t[4], r = s.map(i), t[0] = e, t[1] = o, t[2] = r;
18
23
  } else
19
24
  o = t[1], r = t[2];
20
- let e;
21
- if (t[3] !== o) {
22
- let n;
23
- t[5] !== o.length ? (n = (i, l) => /* @__PURE__ */ s("div", { className: `${l == 0 || l == o.length - 1 ? l == 0 ? "button-group__first" : "button-group__last" : "button-group__item"}`, children: i }, i.key ?? `button-group-${l}`), t[5] = o.length, t[6] = n) : n = t[6], e = o.map(n), t[3] = o, t[4] = e;
24
- } else
25
- e = t[4];
26
- let m;
27
- return t[7] !== r || t[8] !== e ? (m = /* @__PURE__ */ s("div", { ...r, children: e }), t[7] = r, t[8] = e, t[9] = m) : m = t[9], m;
25
+ let n;
26
+ return t[5] !== o || t[6] !== r ? (n = /* @__PURE__ */ p("div", { ...o, children: r }), t[5] = o, t[6] = r, t[7] = n) : n = t[7], n;
28
27
  };
28
+ function v(e) {
29
+ return e != null;
30
+ }
29
31
  export {
30
- v as ButtonGroup
32
+ B as ButtonGroup
31
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {