@code0-tech/pictor 0.15.0 → 0.16.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,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
- export interface InputLabelProps {
2
+ import { Component } from '../../utils';
3
+ export interface InputLabelProps extends Component<HTMLLabelElement> {
3
4
  children: React.ReactNode | React.ReactElement;
4
5
  }
5
6
  export declare const InputLabel: React.FC<InputLabelProps>;
@@ -1,12 +1,23 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { c as s } from "../../_virtual/compiler-runtime.js";
3
- const i = (o) => {
4
- const t = s.c(2), {
5
- children: l
6
- } = o;
7
- let e;
8
- return t[0] !== l ? (e = /* @__PURE__ */ r("label", { className: "input__label", children: l }), t[0] = l, t[1] = e) : e = t[1], e;
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { c as p } from "../../_virtual/compiler-runtime.js";
3
+ import "../../utils/contextStore.js";
4
+ import "react";
5
+ import { mergeComponentProps as c } from "../../utils/component.js";
6
+ import "js-md5";
7
+ const d = (i) => {
8
+ const t = p.c(6);
9
+ let e, r;
10
+ if (t[0] !== i) {
11
+ const {
12
+ children: l,
13
+ ...m
14
+ } = i;
15
+ e = l, r = c("input__label", m), t[0] = i, t[1] = e, t[2] = r;
16
+ } else
17
+ e = t[1], r = t[2];
18
+ let o;
19
+ return t[3] !== e || t[4] !== r ? (o = /* @__PURE__ */ n("label", { ...r, children: e }), t[3] = e, t[4] = r, t[5] = o) : o = t[5], o;
9
20
  };
10
21
  export {
11
- i as InputLabel
22
+ d as InputLabel
12
23
  };
@@ -1,4 +1,5 @@
1
1
  export * from './CheckboxInput';
2
+ export * from './ColorInput';
2
3
  export * from './DateInput';
3
4
  export * from './EditorInput';
4
5
  export * from './EmailInput';
@@ -1,73 +1,80 @@
1
- import { CheckboxInput as r } from "./CheckboxInput.js";
2
- import { DateInput as p, DateInputContent as n, DateInputControl as u, DateInputField as I, DateInputNextTrigger as i, DateInputPrevTrigger as m, DateInputTrigger as l } from "./DateInput.js";
3
- import { EditorInput as a } from "./EditorInput.js";
4
- import { EmailInput as g, emailValidation as F } from "./EmailInput.js";
5
- import { FileInput as S, FileInputContext as c, FileInputDropzone as s, FileInputHiddenInput as D, FileInputItem as T, FileInputItemDeleteTrigger as P, FileInputItemGroup as C, FileInputItemName as w, FileInputItemPreview as b, FileInputItemPreviewImage as V, FileInputItemSizeText as v, FileInputTrigger as M } from "./FileInput.js";
6
- import { Input as h } from "./Input.js";
7
- import { InputDescription as E } from "./InputDescription.js";
8
- import { InputLabel as H } from "./InputLabel.js";
9
- import { InputMessage as k } from "./InputMessage.js";
10
- import { InputSuggestionMenuContent as A, InputSuggestionMenuContentItems as L } from "./InputSuggestion.js";
11
- import { NumberInput as q } from "./NumberInput.js";
12
- import { PasswordInput as J, passwordValidation as K } from "./PasswordInput.js";
13
- import { PinInput as Q, PinInputField as U, PinInputHiddenField as W } from "./PinInput.js";
14
- import { RadioGroup as Y } from "./RadioGroup.js";
15
- import { RadioInput as _ } from "./RadioInput.js";
16
- import { SelectContent as ee, SelectInput as te, SelectItem as re, SelectItemText as oe, SelectPortal as pe, SelectTrigger as ne, SelectValue as ue, SelectViewport as Ie } from "./SelectInput.js";
17
- import { SwitchInput as me } from "./SwitchInput.js";
18
- import { TextAreaInput as xe } from "./TextAreaInput.js";
19
- import { TextInput as fe } from "./TextInput.js";
20
- import { useForm as Fe } from "./useForm.js";
21
- import { buildDefaultSyntax as Se } from "./Input.syntax.hook.js";
1
+ import { CheckboxInput as o } from "./CheckboxInput.js";
2
+ import { ColorInput as p, ColorInputContent as n, ColorInputControl as u, ColorInputSwatch as I, ColorInputTrigger as i, ColorInputValueText as l } from "./ColorInput.js";
3
+ import { DateInput as x, DateInputContent as a, DateInputControl as f, DateInputField as g, DateInputNextTrigger as F, DateInputPrevTrigger as d, DateInputTrigger as C } from "./DateInput.js";
4
+ import { EditorInput as c } from "./EditorInput.js";
5
+ import { EmailInput as s, emailValidation as D } from "./EmailInput.js";
6
+ import { FileInput as w, FileInputContext as V, FileInputDropzone as b, FileInputHiddenInput as h, FileInputItem as v, FileInputItemDeleteTrigger as M, FileInputItemGroup as N, FileInputItemName as z, FileInputItemPreview as E, FileInputItemPreviewImage as G, FileInputItemSizeText as H, FileInputTrigger as R } from "./FileInput.js";
7
+ import { Input as y } from "./Input.js";
8
+ import { InputDescription as L } from "./InputDescription.js";
9
+ import { InputLabel as q } from "./InputLabel.js";
10
+ import { InputMessage as J } from "./InputMessage.js";
11
+ import { InputSuggestionMenuContent as O, InputSuggestionMenuContentItems as Q } from "./InputSuggestion.js";
12
+ import { NumberInput as W } from "./NumberInput.js";
13
+ import { PasswordInput as Y, passwordValidation as Z } from "./PasswordInput.js";
14
+ import { PinInput as $, PinInputField as tt, PinInputHiddenField as et } from "./PinInput.js";
15
+ import { RadioGroup as rt } from "./RadioGroup.js";
16
+ import { RadioInput as nt } from "./RadioInput.js";
17
+ import { SelectContent as It, SelectInput as it, SelectItem as lt, SelectItemText as mt, SelectPortal as xt, SelectTrigger as at, SelectValue as ft, SelectViewport as gt } from "./SelectInput.js";
18
+ import { SwitchInput as dt } from "./SwitchInput.js";
19
+ import { TextAreaInput as St } from "./TextAreaInput.js";
20
+ import { TextInput as Tt } from "./TextInput.js";
21
+ import { useForm as Dt } from "./useForm.js";
22
+ import { buildDefaultSyntax as wt } from "./Input.syntax.hook.js";
22
23
  export {
23
- r as CheckboxInput,
24
- p as DateInput,
25
- n as DateInputContent,
26
- u as DateInputControl,
27
- I as DateInputField,
28
- i as DateInputNextTrigger,
29
- m as DateInputPrevTrigger,
30
- l as DateInputTrigger,
31
- a as EditorInput,
32
- g as EmailInput,
33
- S as FileInput,
34
- c as FileInputContext,
35
- s as FileInputDropzone,
36
- D as FileInputHiddenInput,
37
- T as FileInputItem,
38
- P as FileInputItemDeleteTrigger,
39
- C as FileInputItemGroup,
40
- w as FileInputItemName,
41
- b as FileInputItemPreview,
42
- V as FileInputItemPreviewImage,
43
- v as FileInputItemSizeText,
44
- M as FileInputTrigger,
45
- h as Input,
46
- E as InputDescription,
47
- H as InputLabel,
48
- k as InputMessage,
49
- A as InputSuggestionMenuContent,
50
- L as InputSuggestionMenuContentItems,
51
- q as NumberInput,
52
- J as PasswordInput,
53
- Q as PinInput,
54
- U as PinInputField,
55
- W as PinInputHiddenField,
56
- Y as RadioGroup,
57
- _ as RadioInput,
58
- ee as SelectContent,
59
- te as SelectInput,
60
- re as SelectItem,
61
- oe as SelectItemText,
62
- pe as SelectPortal,
63
- ne as SelectTrigger,
64
- ue as SelectValue,
65
- Ie as SelectViewport,
66
- me as SwitchInput,
67
- xe as TextAreaInput,
68
- fe as TextInput,
69
- Se as buildDefaultSyntax,
70
- F as emailValidation,
71
- K as passwordValidation,
72
- Fe as useForm
24
+ o as CheckboxInput,
25
+ p as ColorInput,
26
+ n as ColorInputContent,
27
+ u as ColorInputControl,
28
+ I as ColorInputSwatch,
29
+ i as ColorInputTrigger,
30
+ l as ColorInputValueText,
31
+ x as DateInput,
32
+ a as DateInputContent,
33
+ f as DateInputControl,
34
+ g as DateInputField,
35
+ F as DateInputNextTrigger,
36
+ d as DateInputPrevTrigger,
37
+ C as DateInputTrigger,
38
+ c as EditorInput,
39
+ s as EmailInput,
40
+ w as FileInput,
41
+ V as FileInputContext,
42
+ b as FileInputDropzone,
43
+ h as FileInputHiddenInput,
44
+ v as FileInputItem,
45
+ M as FileInputItemDeleteTrigger,
46
+ N as FileInputItemGroup,
47
+ z as FileInputItemName,
48
+ E as FileInputItemPreview,
49
+ G as FileInputItemPreviewImage,
50
+ H as FileInputItemSizeText,
51
+ R as FileInputTrigger,
52
+ y as Input,
53
+ L as InputDescription,
54
+ q as InputLabel,
55
+ J as InputMessage,
56
+ O as InputSuggestionMenuContent,
57
+ Q as InputSuggestionMenuContentItems,
58
+ W as NumberInput,
59
+ Y as PasswordInput,
60
+ $ as PinInput,
61
+ tt as PinInputField,
62
+ et as PinInputHiddenField,
63
+ rt as RadioGroup,
64
+ nt as RadioInput,
65
+ It as SelectContent,
66
+ it as SelectInput,
67
+ lt as SelectItem,
68
+ mt as SelectItemText,
69
+ xt as SelectPortal,
70
+ at as SelectTrigger,
71
+ ft as SelectValue,
72
+ gt as SelectViewport,
73
+ dt as SwitchInput,
74
+ St as TextAreaInput,
75
+ Tt as TextInput,
76
+ wt as buildDefaultSyntax,
77
+ D as emailValidation,
78
+ Z as passwordValidation,
79
+ Dt as useForm
73
80
  };
@@ -1,86 +1,86 @@
1
- import { jsxs as N, jsx as o, Fragment as v } from "react/jsx-runtime";
2
- import { c as z } from "../../_virtual/compiler-runtime.js";
3
- import { toast as T } from "sonner";
1
+ import { jsxs as I, jsx as o, Fragment as w } from "react/jsx-runtime";
2
+ import { c as v } from "../../_virtual/compiler-runtime.js";
3
+ import { toast as F } from "sonner";
4
4
  import '../../assets/components/toast/Toast.style.css';/* empty css */
5
5
  import "../../utils/contextStore.js";
6
6
  import "react";
7
- import { mergeComponentProps as j } from "../../utils/component.js";
7
+ import { mergeComponentProps as P } from "../../utils/component.js";
8
8
  import "js-md5";
9
- import { IconCircleX as w, IconAlertCircle as F, IconCircleCheck as P, IconInfoCircle as S, IconCircleDot as u } from "@tabler/icons-react";
10
- import { Text as b } from "../text/Text.js";
11
- import { Flex as C } from "../flex/Flex.js";
12
- const k = ["primary", "secondary", "tertiary", "info", "success", "warning", "error"], A = (r) => k.includes(r);
13
- function U({
9
+ import { IconCircleX as S, IconAlertCircle as b, IconCircleCheck as k, IconInfoCircle as A, IconCircleDot as y } from "@tabler/icons-react";
10
+ import { Text as D } from "../text/Text.js";
11
+ import { Flex as x } from "../flex/Flex.js";
12
+ const E = ["primary", "secondary", "tertiary", "info", "success", "warning", "error"], R = (r) => E.includes(r);
13
+ function Y({
14
14
  wrapper: r,
15
- ...e
15
+ ...t
16
16
  }) {
17
- return T.custom((s) => {
18
- const t = /* @__PURE__ */ o(D, { id: s, ...e, children: e.children });
19
- return /* @__PURE__ */ o(v, { children: r ? r(t) : t });
17
+ return F.custom((s) => {
18
+ const e = /* @__PURE__ */ o(X, { id: s, ...t, children: t.children });
19
+ return /* @__PURE__ */ o(w, { children: r ? r(e) : e });
20
20
  }, {
21
- duration: e.duration ?? 4e3
21
+ duration: t.duration ?? 4e3
22
22
  });
23
23
  }
24
- function D(r) {
25
- const e = z.c(24);
26
- let s, t, i, c, n, l;
27
- if (e[0] !== r) {
24
+ function X(r) {
25
+ const t = v.c(28);
26
+ let s, e, c, i, l, n, a, m;
27
+ if (t[0] !== r) {
28
28
  const {
29
- color: h,
30
- icon: I,
31
- title: x,
32
- children: g,
33
- duration: R,
34
- ...y
29
+ color: C,
30
+ icon: g,
31
+ title: $,
32
+ children: T,
33
+ duration: B,
34
+ ...N
35
35
  } = r;
36
- i = I, l = x, s = g, t = h === void 0 ? "secondary" : h;
37
- let p;
38
- e[7] !== t ? (p = A(t), e[7] = t, e[8] = p) : p = e[8], c = p;
39
- const $ = c ? {} : {
36
+ c = g, m = $, s = T, e = C === void 0 ? "secondary" : C;
37
+ let h;
38
+ t[9] !== e ? (h = R(e), t[9] = e, t[10] = h) : h = t[10], i = h;
39
+ const j = i ? {} : {
40
40
  style: {
41
- color: t,
42
- ...y.style
41
+ color: e,
42
+ ...N.style
43
43
  }
44
- };
45
- n = j(`toast toast--${c ? t : "secondary"}`, {
46
- ...y,
47
- ...$
48
- }), e[0] = r, e[1] = s, e[2] = t, e[3] = i, e[4] = c, e[5] = n, e[6] = l;
44
+ }, z = e === "error";
45
+ l = z ? "alert" : "status", n = z ? "assertive" : "polite", a = P(`toast toast--${i ? e : "secondary"}`, {
46
+ ...N,
47
+ ...j
48
+ }), t[0] = r, t[1] = s, t[2] = e, t[3] = c, t[4] = i, t[5] = l, t[6] = n, t[7] = a, t[8] = m;
49
49
  } else
50
- s = e[1], t = e[2], i = e[3], c = e[4], n = e[5], l = e[6];
51
- let a;
52
- e[9] !== t || e[10] !== i || e[11] !== c ? (a = i ?? (c && /* @__PURE__ */ o(E, { color: t })), e[9] = t, e[10] = i, e[11] = c, e[12] = a) : a = e[12];
53
- let m;
54
- e[13] !== l ? (m = /* @__PURE__ */ o(b, { size: "md", hierarchy: "primary", children: l }), e[13] = l, e[14] = m) : m = e[14];
50
+ s = t[1], e = t[2], c = t[3], i = t[4], l = t[5], n = t[6], a = t[7], m = t[8];
55
51
  let d;
56
- e[15] !== a || e[16] !== m ? (d = /* @__PURE__ */ o(C, { className: "toast__header", children: /* @__PURE__ */ N(C, { className: "toast__header-wrapper", children: [
57
- a,
58
- m
59
- ] }) }), e[15] = a, e[16] = m, e[17] = d) : d = e[17];
52
+ t[11] !== e || t[12] !== c || t[13] !== i ? (d = c ?? (i && /* @__PURE__ */ o(q, { color: e })), t[11] = e, t[12] = c, t[13] = i, t[14] = d) : d = t[14];
60
53
  let _;
61
- e[18] !== s ? (_ = s && /* @__PURE__ */ o("div", { className: "toast__content", children: s }), e[18] = s, e[19] = _) : _ = e[19];
54
+ t[15] !== m ? (_ = /* @__PURE__ */ o(D, { size: "md", hierarchy: "primary", children: m }), t[15] = m, t[16] = _) : _ = t[16];
62
55
  let f;
63
- return e[20] !== n || e[21] !== d || e[22] !== _ ? (f = /* @__PURE__ */ N("div", { ...n, children: [
56
+ t[17] !== d || t[18] !== _ ? (f = /* @__PURE__ */ o(x, { className: "toast__header", children: /* @__PURE__ */ I(x, { className: "toast__header-wrapper", children: [
64
57
  d,
65
58
  _
66
- ] }), e[20] = n, e[21] = d, e[22] = _, e[23] = f) : f = e[23], f;
59
+ ] }) }), t[17] = d, t[18] = _, t[19] = f) : f = t[19];
60
+ let p;
61
+ t[20] !== s ? (p = s && /* @__PURE__ */ o("div", { className: "toast__content", children: s }), t[20] = s, t[21] = p) : p = t[21];
62
+ let u;
63
+ return t[22] !== l || t[23] !== n || t[24] !== a || t[25] !== f || t[26] !== p ? (u = /* @__PURE__ */ I("div", { role: l, "aria-live": n, ...a, children: [
64
+ f,
65
+ p
66
+ ] }), t[22] = l, t[23] = n, t[24] = a, t[25] = f, t[26] = p, t[27] = u) : u = t[27], u;
67
67
  }
68
- const E = (r) => {
69
- const e = z.c(1), {
68
+ const q = (r) => {
69
+ const t = v.c(1), {
70
70
  color: s
71
71
  } = r;
72
- let t;
73
- return e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = {
74
- primary: /* @__PURE__ */ o(u, { className: "toast__icon", size: 16 }),
75
- secondary: /* @__PURE__ */ o(u, { className: "toast__icon", size: 16 }),
76
- tertiary: /* @__PURE__ */ o(u, { className: "toast__icon", size: 16 }),
77
- info: /* @__PURE__ */ o(S, { className: "toast__icon", size: 16 }),
78
- success: /* @__PURE__ */ o(P, { className: "toast__icon", size: 16 }),
79
- warning: /* @__PURE__ */ o(F, { className: "toast__icon", size: 16 }),
80
- error: /* @__PURE__ */ o(w, { className: "toast__icon", size: 16 })
81
- }, e[0] = t) : t = e[0], t[s] ?? null;
72
+ let e;
73
+ return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = {
74
+ primary: /* @__PURE__ */ o(y, { className: "toast__icon", size: 16 }),
75
+ secondary: /* @__PURE__ */ o(y, { className: "toast__icon", size: 16 }),
76
+ tertiary: /* @__PURE__ */ o(y, { className: "toast__icon", size: 16 }),
77
+ info: /* @__PURE__ */ o(A, { className: "toast__icon", size: 16 }),
78
+ success: /* @__PURE__ */ o(k, { className: "toast__icon", size: 16 }),
79
+ warning: /* @__PURE__ */ o(b, { className: "toast__icon", size: 16 }),
80
+ error: /* @__PURE__ */ o(S, { className: "toast__icon", size: 16 })
81
+ }, t[0] = e) : e = t[0], e[s] ?? null;
82
82
  };
83
83
  export {
84
- D as Toast,
85
- U as toast
84
+ X as Toast,
85
+ Y as toast
86
86
  };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from './components/breadcrumb/Breadcrumb';
6
6
  export * from './components/button/Button';
7
7
  export * from './components/button-group/ButtonGroup';
8
8
  export * from './components/card/Card';
9
+ export * from './components/chart/index';
9
10
  export * from './components/col/Col';
10
11
  export * from './components/command/Command';
11
12
  export * from './components/container/Container';