@cronocode/react-box 3.0.12 → 3.0.14

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.
Files changed (73) hide show
  1. package/README.md +8 -7
  2. package/array.d.ts +13 -0
  3. package/box.cjs +1 -1
  4. package/box.d.ts +8 -9
  5. package/box.mjs +16 -16
  6. package/components/button.d.ts +7 -6
  7. package/components/checkbox.d.ts +5 -3
  8. package/components/checkbox.mjs +4 -4
  9. package/components/dataGrid/contracts/dataGridContract.d.ts +36 -0
  10. package/components/dataGrid/dataGridCell.d.ts +8 -0
  11. package/components/dataGrid/dataGridGroupRow.d.ts +6 -0
  12. package/components/dataGrid/dataGridHeaderCell.d.ts +6 -0
  13. package/components/dataGrid/dataGridPagination.d.ts +6 -0
  14. package/components/dataGrid/dataGridRow.d.ts +6 -0
  15. package/components/dataGrid/models/cellModel.d.ts +10 -0
  16. package/components/dataGrid/models/columnModel.d.ts +36 -0
  17. package/components/dataGrid/models/gridModel.d.ts +44 -0
  18. package/components/dataGrid/models/groupRowCellModel.d.ts +10 -0
  19. package/components/dataGrid/models/groupRowModel.d.ts +23 -0
  20. package/components/dataGrid/models/rowModel.d.ts +16 -0
  21. package/components/dataGrid/useGrid.d.ts +3 -0
  22. package/components/dataGrid.cjs +1 -1
  23. package/components/dataGrid.d.ts +2 -7
  24. package/components/dataGrid.mjs +656 -18
  25. package/components/dropdown.cjs +1 -1
  26. package/components/dropdown.d.ts +2 -2
  27. package/components/dropdown.mjs +63 -62
  28. package/components/flex.d.ts +2 -1
  29. package/components/form.cjs +1 -1
  30. package/components/form.mjs +11 -8
  31. package/components/grid.d.ts +2 -1
  32. package/components/radioButton.cjs +1 -1
  33. package/components/radioButton.d.ts +7 -6
  34. package/components/radioButton.mjs +9 -9
  35. package/components/semantics.cjs +1 -1
  36. package/components/semantics.d.ts +27 -25
  37. package/components/semantics.mjs +26 -25
  38. package/components/textarea.d.ts +7 -6
  39. package/components/textbox.d.ts +7 -6
  40. package/components/tooltip.cjs +1 -1
  41. package/components/tooltip.d.ts +1 -1
  42. package/components/tooltip.mjs +20 -22
  43. package/core/boxConstants.d.ts +1 -0
  44. package/core/boxStyles.d.ts +112 -37
  45. package/core/boxStylesFormatters.d.ts +1 -1
  46. package/core/classNames.d.ts +1 -1
  47. package/core/extends/boxComponents.d.ts +391 -0
  48. package/core/{boxExtends.d.ts → extends/boxExtends.d.ts} +4 -1
  49. package/core/extends/useComponents.d.ts +2 -0
  50. package/core/theme/theme.d.ts +1 -3
  51. package/core/theme/themeContext.d.ts +2 -4
  52. package/core/useStyles.d.ts +2 -2
  53. package/core/variables.d.ts +1 -0
  54. package/core.cjs +4 -4
  55. package/core.mjs +634 -511
  56. package/hooks/useVisibility.d.ts +9 -1
  57. package/icons/arrowIcon.d.ts +2 -0
  58. package/icons/dotsIcon.d.ts +2 -0
  59. package/icons/groupingIcon.d.ts +2 -0
  60. package/icons/pinIcon.d.ts +2 -0
  61. package/package.json +1 -1
  62. package/types.d.ts +35 -6
  63. package/utils/fn/fnUtils.d.ts +4 -0
  64. package/utils/memo.d.ts +5 -0
  65. package/utils/object/objectUtils.d.ts +1 -1
  66. package/components/dataGrid/dataGridContract.d.ts +0 -24
  67. package/components/dataGrid/useGridData.d.ts +0 -7
  68. package/components/label.cjs +0 -1
  69. package/components/label.d.ts +0 -5
  70. package/components/label.mjs +0 -10
  71. package/core/theme/defaultTheme.d.ts +0 -3
  72. package/core/theme/themeContract.d.ts +0 -25
  73. package/core/theme/useTheme.d.ts +0 -2
@@ -1 +1 @@
1
- "use strict";const r=require("react/jsx-runtime"),n=require("react"),h=require("../box.cjs"),L=require("./textbox.cjs"),G=require("./flex.cjs"),Q=require("../core.cjs"),X=require("./baseSvg.cjs"),Z=require("./tooltip.cjs"),K=require("./button.cjs");function ee(i,m){const{name:p,defaultValue:g,value:y,multiple:u,isSearchable:w,searchPlaceholder:B,children:A,hideArrow:H,onChange:s,...Y}=i,[J,j]=n.useState(Array.isArray(g)?g:g?[g]:[]),c="value"in i?Array.isArray(y)?y:y?[y]:[]:J,[D,R]=n.useState(""),[a,U,b]=Q.useVisibility(),q=n.useRef(null),T=n.useRef(null),[V,W]=n.useState(0),I=n.useMemo(()=>V>window.innerHeight/2,[V]),$=n.useMemo(()=>{var e;return I?((e=b.current)==null?void 0:e.getBoundingClientRect().height)??0:0},[I,b]),l=n.useMemo(()=>(Array.isArray(A)?A:[A]).flatMap(e=>e),[A]),_=n.useMemo(()=>l.filter(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownItem"}),[l]),f=n.useMemo(()=>_.filter(e=>w&&D?P(e).toLowerCase().includes(D.toLowerCase()):!0),[w,D,l]),x=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownUnselect"}),[l]),O=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownSelectAll"}),[l]),N=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownEmptyItem"}),[l]),C=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownDisplay"}),[l]),z=n.useMemo(()=>{if(C)return C.props.children(c,a);const e=f.filter(o=>c.includes(o.props.value));if(u&&e.length>1)return e.map(o=>P(o)).join(", ");const t=e.at(0);return(t==null?void 0:t.props.children)??(t==null?void 0:t.props.value)??(u?null:x==null?void 0:x.props.children)},[u,f,c,x,a]),k=n.useCallback((e,...t)=>{if(t.length===0)j([]),s==null||s(void 0,[]);else if(u&&t.length>1){const o=t.map(d=>d.props.value);j(o),s==null||s(void 0,o)}else if(t.length===1){const o=t[0];if(u){const d=c.filter(M=>M!==o.props.value);d.length===c.length&&d.push(o.props.value),j(d),s==null||s(o.props.value,d)}else j([o.props.value]),s==null||s(o.props.value,[o.props.value])}u?(e.stopPropagation(),setTimeout(()=>{var o;return(o=q.current)==null?void 0:o.focus()},0)):(U(!1),setTimeout(()=>{var o;return(o=b.current)==null?void 0:o.focus()},0))},[u,c,j]);n.useEffect(()=>{a?setTimeout(()=>{var e,t,o;(e=q.current)==null||e.focus(),(o=(t=T.current)==null?void 0:t.querySelector('[aria-selected="true"]'))==null||o.scrollIntoView({block:"nearest"})},0):R("")},[a]);const E=O&&u&&f.length>c.length,F=x&&f.length>0&&!E;return r.jsxs(h,{width:"fit-content",children:[c.map(e=>r.jsx(L,{ref:m,name:p,type:"hidden",value:JSON.stringify(e)??""},JSON.stringify(e))),r.jsxs(K,{ref:b,type:"button",component:"dropdown",onClick:()=>U(e=>!e),props:{tabIndex:0},...Y,children:[w&&r.jsx(L,{display:a&&w?"block":"none",clean:!0,flex1:!0,width:1,minHeight:5,placeholder:B,value:D,onChange:e=>R(e.target.value),ref:q,props:{onClick:e=>{a&&w&&e.stopPropagation()}}}),r.jsx(G,{component:"dropdown.display",display:a&&w?"none":"flex",children:z}),!H&&r.jsx(h,{children:r.jsx(X,{viewBox:"0 0 10 6",width:"0.6rem",rotate:a?180:0,children:r.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 4 4 4-4"})})})]}),a&&r.jsx(Z,{ref:T,top:I?void 0:0,bottom:I?2:void 0,style:{transform:`translateY(-${$}px)`},onPositionChange:e=>W(e.top-window.scrollY),children:(f.length>0||N)&&r.jsxs(h,{component:"dropdown.items",children:[F&&r.jsx(h,{component:"dropdown.unselect",selected:c.length===0,...x.props,props:{onClick:e=>k(e)}}),E&&r.jsx(h,{component:"dropdown.selectAll",...O.props,props:{onClick:e=>k(e,..._)}}),f.map(e=>{const{value:t,onClick:o,...d}=e.props;return r.jsx(h,{component:"dropdown.item",theme:u?"multiple":"single",selected:c.includes(t),...d,props:{onClick:M=>{o==null||o(M),k(M,e)}}},t)}),f.length===0&&N&&r.jsx(h,{component:"dropdown.emptyItem",...N.props})]})})]})}function S(i){const m=p=>null;return m.displayName=i,m}const v=n.forwardRef(ee);v.Item=S("DropdownItem");v.Unselect=S("DropdownUnselect");v.SelectAll=S("DropdownSelectAll");v.EmptyItem=S("DropdownEmptyItem");v.Display=S("DropdownDisplay");function P(i){var m;if(i==null)return"";if(typeof i=="object"){const p=(m=i.props)==null?void 0:m.children;return p==null?"":typeof p=="object"?(Array.isArray(p)?p:[p]).map(y=>P(y)).join(""):p.toString()}return i.toString()}module.exports=v;
1
+ "use strict";const r=require("react/jsx-runtime"),n=require("react"),h=require("../box.cjs"),L=require("./textbox.cjs"),G=require("./flex.cjs"),Q=require("../core.cjs"),X=require("./baseSvg.cjs"),Z=require("./tooltip.cjs"),K=require("./button.cjs");function ee(i,m){const{name:p,defaultValue:g,value:y,multiple:u,isSearchable:w,searchPlaceholder:B,children:D,hideIcon:H,onChange:s,...Y}=i,[J,j]=n.useState(Array.isArray(g)?g:g?[g]:[]),c="value"in i?Array.isArray(y)?y:y?[y]:[]:J,[I,U]=n.useState(""),[a,T,b]=Q.useVisibility(),N=n.useRef(null),V=n.useRef(null),[_,F]=n.useState(0),A=n.useMemo(()=>_>window.innerHeight/2,[_]),W=n.useMemo(()=>{var e;return A?((e=b.current)==null?void 0:e.getBoundingClientRect().height)??0:0},[A,b]),l=n.useMemo(()=>(Array.isArray(D)?D:[D]).flatMap(e=>e),[D]),O=n.useMemo(()=>l.filter(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownItem"}),[l]),f=n.useMemo(()=>O.filter(e=>w&&I?R(e).toLowerCase().includes(I.toLowerCase()):!0),[w,I,l]),x=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownUnselect"}),[l]),C=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownSelectAll"}),[l]),k=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownEmptyItem"}),[l]),M=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownDisplay"}),[l]),$=n.useMemo(()=>{if(M)return typeof M.props.children=="function"?M.props.children(c,a):M.props.children;const e=f.filter(o=>c.includes(o.props.value));if(u&&e.length>1)return e.map(o=>R(o)).join(", ");const t=e.at(0);return(t==null?void 0:t.props.children)??(t==null?void 0:t.props.value)??(u?null:x==null?void 0:x.props.children)},[u,f,c,x,a]),P=n.useCallback((e,...t)=>{if(t.length===0)j([]),s==null||s(void 0,[]);else if(u&&t.length>1){const o=t.map(d=>d.props.value);j(o),s==null||s(void 0,o)}else if(t.length===1){const o=t[0];if(u){const d=c.filter(q=>q!==o.props.value);d.length===c.length&&d.push(o.props.value),j(d),s==null||s(o.props.value,d)}else j([o.props.value]),s==null||s(o.props.value,[o.props.value])}u?(e.stopPropagation(),setTimeout(()=>{var o;return(o=N.current)==null?void 0:o.focus()},0)):(T(!1),setTimeout(()=>{var o;return(o=b.current)==null?void 0:o.focus()},0))},[u,c,j]);n.useEffect(()=>{a?setTimeout(()=>{var e,t,o;(e=N.current)==null||e.focus(),(o=(t=V.current)==null?void 0:t.querySelector('[aria-selected="true"]'))==null||o.scrollIntoView({block:"nearest"})},0):U("")},[a]);const E=C&&u&&f.length>c.length,z=x&&f.length>0&&!E;return r.jsxs(h,{width:"fit-content",children:[c.map(e=>r.jsx(L,{ref:m,name:p,type:"hidden",value:JSON.stringify(e)??""},JSON.stringify(e))),r.jsxs(K,{ref:b,type:"button",component:"dropdown",onClick:()=>T(e=>!e),props:{tabIndex:0},...Y,children:[w&&r.jsx(L,{display:a&&w?"block":"none",clean:!0,flex1:!0,width:1,minHeight:5,placeholder:B,value:I,onChange:e=>U(e.target.value),ref:N,props:{onClick:e=>{a&&w&&e.stopPropagation()}}}),r.jsx(G,{component:"dropdown.display",display:a&&w?"none":"flex",children:$??r.jsx(r.Fragment,{children:" "})}),!H&&r.jsx(h,{children:r.jsx(X,{viewBox:"0 0 10 6",width:"0.6rem",rotate:a?180:0,children:r.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 4 4 4-4"})})})]}),a&&r.jsx(Z,{ref:V,top:A?void 0:0,bottom:A?2:void 0,style:{transform:`translateY(-${W}px)`},onPositionChange:e=>F(e.top-window.scrollY),children:(f.length>0||k)&&r.jsxs(h,{component:"dropdown.items",children:[z&&r.jsx(h,{component:"dropdown.unselect",selected:c.length===0,...x.props,props:{onClick:e=>P(e)}}),E&&r.jsx(h,{component:"dropdown.selectAll",...C.props,props:{onClick:e=>P(e,...O)}}),f.map(e=>{const{value:t,onClick:o,...d}=e.props;return r.jsx(h,{component:"dropdown.item",variant:u?"multiple":void 0,selected:c.includes(t),...d,props:{onClick:q=>{o==null||o(q),P(q,e)}}},t)}),f.length===0&&k&&r.jsx(h,{component:"dropdown.emptyItem",...k.props})]})})]})}function S(i){const m=p=>null;return m.displayName=i,m}const v=n.forwardRef(ee);v.Item=S("DropdownItem");v.Unselect=S("DropdownUnselect");v.SelectAll=S("DropdownSelectAll");v.EmptyItem=S("DropdownEmptyItem");v.Display=S("DropdownDisplay");function R(i){var m;if(i==null)return"";if(typeof i=="object"){const p=(m=i.props)==null?void 0:m.children;return p==null?"":typeof p=="object"?(Array.isArray(p)?p:[p]).map(y=>R(y)).join(""):p.toString()}return i.toString()}module.exports=v;
@@ -7,7 +7,7 @@ interface Props<TVal> extends BoxProps<'button'> {
7
7
  multiple?: boolean;
8
8
  isSearchable?: boolean;
9
9
  searchPlaceholder?: string;
10
- hideArrow?: boolean;
10
+ hideIcon?: boolean;
11
11
  onChange?: (value: Maybe<TVal>, values: TVal[]) => void;
12
12
  }
13
13
  interface DropdownItemProps<TVal> extends BoxProps {
@@ -15,7 +15,7 @@ interface DropdownItemProps<TVal> extends BoxProps {
15
15
  onClick?(e: React.MouseEvent): void;
16
16
  }
17
17
  interface DropdownDisplayProps<TVal> extends Omit<BoxProps, 'children'> {
18
- children: (selectedValues: TVal[], isOpen: boolean) => React.ReactNode;
18
+ children: ((selectedValues: TVal[], isOpen: boolean) => React.ReactNode) | React.ReactNode;
19
19
  }
20
20
  interface DropdownType {
21
21
  <TVal>(props: Props<TVal>, ref: Ref<HTMLInputElement>): React.ReactNode;
@@ -1,42 +1,43 @@
1
- import { jsxs as U, jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as Z, useState as B, useRef as M, useMemo as c, useCallback as K, useEffect as ee } from "react";
1
+ import { jsxs as B, jsx as n, Fragment as Z } from "react/jsx-runtime";
2
+ import { forwardRef as K, useState as V, useRef as J, useMemo as c, useCallback as ee, useEffect as te } from "react";
3
3
  import h from "../box.mjs";
4
- import q from "./textbox.mjs";
5
- import te from "./flex.mjs";
6
- import { b as oe } from "../core.mjs";
7
- import re from "./baseSvg.mjs";
8
- import ne from "./tooltip.mjs";
9
- import le from "./button.mjs";
10
- function se(s, m) {
11
- const { name: p, defaultValue: g, value: y, multiple: a, isSearchable: w, searchPlaceholder: F, children: S, hideArrow: W, onChange: r, ..._ } = s, [$, x] = B(Array.isArray(g) ? g : g ? [g] : []), i = "value" in s ? Array.isArray(y) ? y : y ? [y] : [] : $, [I, O] = B(""), [d, R, b] = oe(), P = M(null), C = M(null), [E, z] = B(0), N = c(() => E > window.innerHeight / 2, [E]), G = c(() => {
4
+ import M from "./textbox.mjs";
5
+ import oe from "./flex.mjs";
6
+ import { b as re } from "../core.mjs";
7
+ import ne from "./baseSvg.mjs";
8
+ import le from "./tooltip.mjs";
9
+ import se from "./button.mjs";
10
+ function pe(s, m) {
11
+ const { name: p, defaultValue: g, value: y, multiple: a, isSearchable: w, searchPlaceholder: q, children: S, hideIcon: W, onChange: r, ..._ } = s, [$, x] = V(Array.isArray(g) ? g : g ? [g] : []), i = "value" in s ? Array.isArray(y) ? y : y ? [y] : [] : $, [A, R] = V(""), [d, C, b] = re(), T = J(null), E = J(null), [L, z] = V(0), N = c(() => L > window.innerHeight / 2, [L]), G = c(() => {
12
12
  var e;
13
13
  return N ? ((e = b.current) == null ? void 0 : e.getBoundingClientRect().height) ?? 0 : 0;
14
- }, [N, b]), n = c(
14
+ }, [N, b]), l = c(
15
15
  () => (Array.isArray(S) ? S : [S]).flatMap((e) => e),
16
16
  [S]
17
- ), L = c(() => n.filter((e) => {
17
+ ), H = c(() => l.filter((e) => {
18
18
  var t;
19
19
  return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownItem";
20
- }), [n]), f = c(() => L.filter((e) => w && I ? V(e).toLowerCase().includes(I.toLowerCase()) : !0), [w, I, n]), v = c(() => n.find((e) => {
20
+ }), [l]), f = c(() => H.filter((e) => w && A ? O(e).toLowerCase().includes(A.toLowerCase()) : !0), [w, A, l]), v = c(() => l.find((e) => {
21
21
  var t;
22
22
  return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownUnselect";
23
- }), [n]), H = c(() => n.find((e) => {
23
+ }), [l]), Y = c(() => l.find((e) => {
24
24
  var t;
25
25
  return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownSelectAll";
26
- }), [n]), T = c(() => n.find((e) => {
26
+ }), [l]), j = c(() => l.find((e) => {
27
27
  var t;
28
28
  return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownEmptyItem";
29
- }), [n]), Y = c(() => n.find((e) => {
29
+ }), [l]), k = c(() => l.find((e) => {
30
30
  var t;
31
31
  return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownDisplay";
32
- }), [n]), Q = c(() => {
33
- if (Y) return Y.props.children(i, d);
32
+ }), [l]), Q = c(() => {
33
+ if (k)
34
+ return typeof k.props.children == "function" ? k.props.children(i, d) : k.props.children;
34
35
  const e = f.filter((o) => i.includes(o.props.value));
35
36
  if (a && e.length > 1)
36
- return e.map((o) => V(o)).join(", ");
37
+ return e.map((o) => O(o)).join(", ");
37
38
  const t = e.at(0);
38
39
  return (t == null ? void 0 : t.props.children) ?? (t == null ? void 0 : t.props.value) ?? (a ? null : v == null ? void 0 : v.props.children);
39
- }, [a, f, i, v, d]), j = K(
40
+ }, [a, f, i, v, d]), U = ee(
40
41
  (e, ...t) => {
41
42
  if (t.length === 0)
42
43
  x([]), r == null || r(void 0, []);
@@ -46,52 +47,52 @@ function se(s, m) {
46
47
  } else if (t.length === 1) {
47
48
  const o = t[0];
48
49
  if (a) {
49
- const u = i.filter((k) => k !== o.props.value);
50
+ const u = i.filter((P) => P !== o.props.value);
50
51
  u.length === i.length && u.push(o.props.value), x(u), r == null || r(o.props.value, u);
51
52
  } else
52
53
  x([o.props.value]), r == null || r(o.props.value, [o.props.value]);
53
54
  }
54
55
  a ? (e.stopPropagation(), setTimeout(() => {
55
56
  var o;
56
- return (o = P.current) == null ? void 0 : o.focus();
57
- }, 0)) : (R(!1), setTimeout(() => {
57
+ return (o = T.current) == null ? void 0 : o.focus();
58
+ }, 0)) : (C(!1), setTimeout(() => {
58
59
  var o;
59
60
  return (o = b.current) == null ? void 0 : o.focus();
60
61
  }, 0));
61
62
  },
62
63
  [a, i, x]
63
64
  );
64
- ee(() => {
65
+ te(() => {
65
66
  d ? setTimeout(() => {
66
67
  var e, t, o;
67
- (e = P.current) == null || e.focus(), (o = (t = C.current) == null ? void 0 : t.querySelector('[aria-selected="true"]')) == null || o.scrollIntoView({ block: "nearest" });
68
- }, 0) : O("");
68
+ (e = T.current) == null || e.focus(), (o = (t = E.current) == null ? void 0 : t.querySelector('[aria-selected="true"]')) == null || o.scrollIntoView({ block: "nearest" });
69
+ }, 0) : R("");
69
70
  }, [d]);
70
- const J = H && a && f.length > i.length, X = v && f.length > 0 && !J;
71
- return /* @__PURE__ */ U(h, { width: "fit-content", children: [
72
- i.map((e) => /* @__PURE__ */ l(q, { ref: m, name: p, type: "hidden", value: JSON.stringify(e) ?? "" }, JSON.stringify(e))),
73
- /* @__PURE__ */ U(
74
- le,
71
+ const F = Y && a && f.length > i.length, X = v && f.length > 0 && !F;
72
+ return /* @__PURE__ */ B(h, { width: "fit-content", children: [
73
+ i.map((e) => /* @__PURE__ */ n(M, { ref: m, name: p, type: "hidden", value: JSON.stringify(e) ?? "" }, JSON.stringify(e))),
74
+ /* @__PURE__ */ B(
75
+ se,
75
76
  {
76
77
  ref: b,
77
78
  type: "button",
78
79
  component: "dropdown",
79
- onClick: () => R((e) => !e),
80
+ onClick: () => C((e) => !e),
80
81
  props: { tabIndex: 0 },
81
82
  ..._,
82
83
  children: [
83
- w && /* @__PURE__ */ l(
84
- q,
84
+ w && /* @__PURE__ */ n(
85
+ M,
85
86
  {
86
87
  display: d && w ? "block" : "none",
87
88
  clean: !0,
88
89
  flex1: !0,
89
90
  width: 1,
90
91
  minHeight: 5,
91
- placeholder: F,
92
- value: I,
93
- onChange: (e) => O(e.target.value),
94
- ref: P,
92
+ placeholder: q,
93
+ value: A,
94
+ onChange: (e) => R(e.target.value),
95
+ ref: T,
95
96
  props: {
96
97
  onClick: (e) => {
97
98
  d && w && e.stopPropagation();
@@ -99,73 +100,73 @@ function se(s, m) {
99
100
  }
100
101
  }
101
102
  ),
102
- /* @__PURE__ */ l(te, { component: "dropdown.display", display: d && w ? "none" : "flex", children: Q }),
103
- !W && /* @__PURE__ */ l(h, { children: /* @__PURE__ */ l(re, { viewBox: "0 0 10 6", width: "0.6rem", rotate: d ? 180 : 0, children: /* @__PURE__ */ l("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m1 1 4 4 4-4" }) }) })
103
+ /* @__PURE__ */ n(oe, { component: "dropdown.display", display: d && w ? "none" : "flex", children: Q ?? /* @__PURE__ */ n(Z, { children: " " }) }),
104
+ !W && /* @__PURE__ */ n(h, { children: /* @__PURE__ */ n(ne, { viewBox: "0 0 10 6", width: "0.6rem", rotate: d ? 180 : 0, children: /* @__PURE__ */ n("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m1 1 4 4 4-4" }) }) })
104
105
  ]
105
106
  }
106
107
  ),
107
- d && /* @__PURE__ */ l(
108
- ne,
108
+ d && /* @__PURE__ */ n(
109
+ le,
109
110
  {
110
- ref: C,
111
+ ref: E,
111
112
  top: N ? void 0 : 0,
112
113
  bottom: N ? 2 : void 0,
113
114
  style: { transform: `translateY(-${G}px)` },
114
115
  onPositionChange: (e) => z(e.top - window.scrollY),
115
- children: (f.length > 0 || T) && /* @__PURE__ */ U(h, { component: "dropdown.items", children: [
116
- X && /* @__PURE__ */ l(
116
+ children: (f.length > 0 || j) && /* @__PURE__ */ B(h, { component: "dropdown.items", children: [
117
+ X && /* @__PURE__ */ n(
117
118
  h,
118
119
  {
119
120
  component: "dropdown.unselect",
120
121
  selected: i.length === 0,
121
122
  ...v.props,
122
- props: { onClick: (e) => j(e) }
123
+ props: { onClick: (e) => U(e) }
123
124
  }
124
125
  ),
125
- J && /* @__PURE__ */ l(h, { component: "dropdown.selectAll", ...H.props, props: { onClick: (e) => j(e, ...L) } }),
126
+ F && /* @__PURE__ */ n(h, { component: "dropdown.selectAll", ...Y.props, props: { onClick: (e) => U(e, ...H) } }),
126
127
  f.map((e) => {
127
128
  const { value: t, onClick: o, ...u } = e.props;
128
- return /* @__PURE__ */ l(
129
+ return /* @__PURE__ */ n(
129
130
  h,
130
131
  {
131
132
  component: "dropdown.item",
132
- theme: a ? "multiple" : "single",
133
+ variant: a ? "multiple" : void 0,
133
134
  selected: i.includes(t),
134
135
  ...u,
135
136
  props: {
136
- onClick: (k) => {
137
- o == null || o(k), j(k, e);
137
+ onClick: (P) => {
138
+ o == null || o(P), U(P, e);
138
139
  }
139
140
  }
140
141
  },
141
142
  t
142
143
  );
143
144
  }),
144
- f.length === 0 && T && /* @__PURE__ */ l(h, { component: "dropdown.emptyItem", ...T.props })
145
+ f.length === 0 && j && /* @__PURE__ */ n(h, { component: "dropdown.emptyItem", ...j.props })
145
146
  ] })
146
147
  }
147
148
  )
148
149
  ] });
149
150
  }
150
- function A(s) {
151
+ function D(s) {
151
152
  const m = (p) => null;
152
153
  return m.displayName = s, m;
153
154
  }
154
- const D = Z(se);
155
- D.Item = A("DropdownItem");
156
- D.Unselect = A("DropdownUnselect");
157
- D.SelectAll = A("DropdownSelectAll");
158
- D.EmptyItem = A("DropdownEmptyItem");
159
- D.Display = A("DropdownDisplay");
160
- function V(s) {
155
+ const I = K(pe);
156
+ I.Item = D("DropdownItem");
157
+ I.Unselect = D("DropdownUnselect");
158
+ I.SelectAll = D("DropdownSelectAll");
159
+ I.EmptyItem = D("DropdownEmptyItem");
160
+ I.Display = D("DropdownDisplay");
161
+ function O(s) {
161
162
  var m;
162
163
  if (s == null) return "";
163
164
  if (typeof s == "object") {
164
165
  const p = (m = s.props) == null ? void 0 : m.children;
165
- return p == null ? "" : typeof p == "object" ? (Array.isArray(p) ? p : [p]).map((y) => V(y)).join("") : p.toString();
166
+ return p == null ? "" : typeof p == "object" ? (Array.isArray(p) ? p : [p]).map((y) => O(y)).join("") : p.toString();
166
167
  }
167
168
  return s.toString();
168
169
  }
169
170
  export {
170
- D as default
171
+ I as default
171
172
  };
@@ -1,5 +1,6 @@
1
1
  import { RefAttributes } from 'react';
2
2
  import { BoxProps } from '../box';
3
3
  import { ExtractElementFromTag } from '../core/coreTypes';
4
- declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div">(props: BoxProps<TTag> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
4
+ import { ComponentsAndVariants } from '../types';
5
+ declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div", TKey extends keyof ComponentsAndVariants = never>(props: BoxProps<TTag, TKey> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
5
6
  export default _default;
@@ -1 +1 @@
1
- "use strict";const m=require("react/jsx-runtime"),o=require("react"),a=require("../box.cjs"),f=require("../core.cjs");function l(r){const{onSubmit:n,props:s}=r,t=o.useRef(null),u=o.useCallback(e=>{e.preventDefault();const i=f.FormUtils.getFormEntries(t.current);n(i,e)},[]),c={...s,onSubmit:u,ref:t};return m.jsx(a,{tag:"form",...r,props:c})}module.exports=l;
1
+ "use strict";const m=require("react/jsx-runtime"),n=require("react"),a=require("../box.cjs"),f=require("../core.cjs");function l(r){const{onSubmit:t,props:s}=r,e=n.useRef(null),u=n.useCallback(o=>{o.preventDefault();const i=f.FormUtils.getFormEntries(e.current);t(i,o)},[t]),c={...s,onSubmit:u,ref:e};return m.jsx(a,{tag:"form",...r,props:c})}module.exports=l;
@@ -1,15 +1,18 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
2
  import { useRef as a, useCallback as i } from "react";
3
3
  import p from "../box.mjs";
4
- import { F as c } from "../core.mjs";
5
- function x(o) {
6
- const { onSubmit: m, props: n } = o, r = a(null), e = i((t) => {
7
- t.preventDefault();
8
- const f = c.getFormEntries(r.current);
9
- m(f, t);
10
- }, []), s = { ...n, onSubmit: e, ref: r };
4
+ import { e as c } from "../core.mjs";
5
+ function F(o) {
6
+ const { onSubmit: r, props: e } = o, t = a(null), n = i(
7
+ (m) => {
8
+ m.preventDefault();
9
+ const f = c.getFormEntries(t.current);
10
+ r(f, m);
11
+ },
12
+ [r]
13
+ ), s = { ...e, onSubmit: n, ref: t };
11
14
  return /* @__PURE__ */ u(p, { tag: "form", ...o, props: s });
12
15
  }
13
16
  export {
14
- x as default
17
+ F as default
15
18
  };
@@ -1,5 +1,6 @@
1
1
  import { RefAttributes } from 'react';
2
2
  import { BoxProps } from '../box';
3
3
  import { ExtractElementFromTag } from '../core/coreTypes';
4
- declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div">(props: BoxProps<TTag> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
4
+ import { ComponentsAndVariants } from '../types';
5
+ declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div", TKey extends keyof ComponentsAndVariants = never>(props: BoxProps<TTag, TKey> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
5
6
  export default _default;
@@ -1 +1 @@
1
- "use strict";const n=require("react/jsx-runtime"),r=require("react"),u=require("../box.cjs"),s=require("../core.cjs"),c=["name","onInput","onChange","value","autoFocus","readOnly","defaultChecked"];function a(t,o){const e=s.ObjectUtils.buildProps(t,c,{type:"radio"});return n.jsx(u,{ref:o,tag:"input",component:"radioButton",...e})}const i=r.forwardRef(a);module.exports=i;
1
+ "use strict";const e=require("react/jsx-runtime"),n=require("react"),r=require("../box.cjs"),u=require("../core.cjs"),s=["name","onInput","onChange","value","autoFocus","readOnly","defaultChecked"];function c(t,i){const o=u.ObjectUtils.buildProps(t,s,{type:"radio"});return e.jsx(r,{tag:"input",component:"radioButton",...o})}const a=n.forwardRef(c);module.exports=a;
@@ -1,10 +1,11 @@
1
- import { BoxProps } from '../box';
2
- type RadioButtonProps = Omit<BoxProps<'input'>, 'ref' | 'tag'>;
3
- type BoxTagProps = Required<RadioButtonProps>['props'];
1
+ import { RefAttributes } from 'react';
2
+ import { BoxProps, BoxTagProps } from '../box';
3
+ import { ComponentsAndVariants } from '../types';
4
4
  declare const tagProps: readonly ["name", "onInput", "onChange", "value", "autoFocus", "readOnly", "defaultChecked"];
5
5
  type TagPropsType = (typeof tagProps)[number];
6
- type RadioButtonTagProps = Omit<BoxTagProps, TagPropsType | 'type'>;
7
- interface Props extends Omit<RadioButtonProps, 'props'> {
6
+ type RadioButtonProps<TKey extends keyof ComponentsAndVariants> = Omit<BoxProps<'input', TKey>, 'tag' | 'props'>;
7
+ type RadioButtonTagProps = Omit<BoxTagProps<'input'>, TagPropsType | 'type'>;
8
+ interface Props<TKey extends keyof ComponentsAndVariants> extends RadioButtonProps<TKey> {
8
9
  name?: string;
9
10
  props?: RadioButtonTagProps;
10
11
  onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -14,5 +15,5 @@ interface Props extends Omit<RadioButtonProps, 'props'> {
14
15
  readOnly?: boolean;
15
16
  defaultChecked?: boolean;
16
17
  }
17
- declare const _default: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLInputElement>>;
18
+ declare const _default: <TKey extends keyof ComponentsAndVariants = "radioButton">(props: Props<TKey> & RefAttributes<HTMLInputElement>) => React.ReactNode;
18
19
  export default _default;
@@ -1,13 +1,13 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as a } from "react";
3
- import e from "../box.mjs";
4
- import { O as u } from "../core.mjs";
5
- const i = ["name", "onInput", "onChange", "value", "autoFocus", "readOnly", "defaultChecked"];
6
- function p(o, t) {
7
- const r = u.buildProps(o, i, { type: "radio" });
8
- return /* @__PURE__ */ n(e, { ref: t, tag: "input", component: "radioButton", ...r });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import a from "../box.mjs";
4
+ import { O as e } from "../core.mjs";
5
+ const u = ["name", "onInput", "onChange", "value", "autoFocus", "readOnly", "defaultChecked"];
6
+ function i(o, p) {
7
+ const t = e.buildProps(o, u, { type: "radio" });
8
+ return /* @__PURE__ */ r(a, { tag: "input", component: "radioButton", ...t });
9
9
  }
10
- const c = a(p);
10
+ const c = n(i);
11
11
  export {
12
12
  c as default
13
13
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),s=require("react"),r=require("../box.cjs");function t(e,n){return s.forwardRef((o,i)=>c.jsx(r,{tag:e,ref:i,component:e,...n,...o}))}const a=t("label"),m=t("article"),u=t("aside"),H=t("details"),f=t("figcaption"),l=t("figure"),S=t("footer"),g=t("header"),d=t("main"),h=t("mark"),M=t("nav"),b=t("menu"),p=t("section"),z=t("summary"),F=t("time"),k=t("p"),y=t("h1",{fontSize:14*2.5}),v=t("h2",{fontSize:14*2}),A=t("h3",{fontSize:14*1.75}),L=t("h4",{fontSize:14*1.5}),j=t("h5",{fontSize:14*1.25}),q=t("h6",{fontSize:14*1}),x=t("a"),P=t("img");exports.Article=m;exports.Aside=u;exports.Details=H;exports.Figcaption=f;exports.Figure=l;exports.Footer=S;exports.H1=y;exports.H2=v;exports.H3=A;exports.H4=L;exports.H5=j;exports.H6=q;exports.Header=g;exports.Img=P;exports.Label=a;exports.Link=x;exports.Main=d;exports.Mark=h;exports.Menu=b;exports.Nav=M;exports.P=k;exports.Section=p;exports.Summary=z;exports.Time=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),s=require("react"),a=require("../box.cjs");function n(t,e){return s.forwardRef((o,i)=>c.jsx(a,{tag:t,ref:i,component:t,...e,...o}))}const r=n("label"),u=n("span",{inline:!0}),m=n("article"),l=n("aside"),H=n("details"),S=n("figcaption"),f=n("figure"),g=n("footer"),d=n("header"),p=n("main"),h=n("mark"),M=n("nav"),b=n("menu"),z=n("section"),F=n("summary"),k=n("time"),y=n("p"),v=n("h1",{fontSize:14*2.5}),A=n("h2",{fontSize:14*2}),L=n("h3",{fontSize:14*1.75}),j=n("h4",{fontSize:14*1.5}),q=n("h5",{fontSize:14*1.25}),x=n("h6",{fontSize:14*1}),P=n("a"),R=n("img");exports.Article=m;exports.Aside=l;exports.Details=H;exports.Figcaption=S;exports.Figure=f;exports.Footer=g;exports.H1=v;exports.H2=A;exports.H3=L;exports.H4=j;exports.H5=q;exports.H6=x;exports.Header=d;exports.Img=R;exports.Label=r;exports.Link=P;exports.Main=p;exports.Mark=h;exports.Menu=b;exports.Nav=M;exports.P=y;exports.Section=z;exports.Span=u;exports.Summary=F;exports.Time=k;
@@ -1,29 +1,31 @@
1
1
  import { RefAttributes } from 'react';
2
2
  import { BoxProps } from '../box';
3
3
  import { ExtractElementFromTag } from '../core/coreTypes';
4
- type SemanticComponentType<TTag extends keyof React.JSX.IntrinsicElements> = (props: Omit<BoxProps<TTag>, 'ref' | 'tag'> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
5
- export declare const Label: SemanticComponentType<"label">;
6
- export declare const Article: SemanticComponentType<"article">;
7
- export declare const Aside: SemanticComponentType<"aside">;
8
- export declare const Details: SemanticComponentType<"details">;
9
- export declare const Figcaption: SemanticComponentType<"figcaption">;
10
- export declare const Figure: SemanticComponentType<"figure">;
11
- export declare const Footer: SemanticComponentType<"footer">;
12
- export declare const Header: SemanticComponentType<"header">;
13
- export declare const Main: SemanticComponentType<"main">;
14
- export declare const Mark: SemanticComponentType<"mark">;
15
- export declare const Nav: SemanticComponentType<"nav">;
16
- export declare const Menu: SemanticComponentType<"menu">;
17
- export declare const Section: SemanticComponentType<"section">;
18
- export declare const Summary: SemanticComponentType<"summary">;
19
- export declare const Time: SemanticComponentType<"time">;
20
- export declare const P: SemanticComponentType<"p">;
21
- export declare const H1: SemanticComponentType<"h1">;
22
- export declare const H2: SemanticComponentType<"h2">;
23
- export declare const H3: SemanticComponentType<"h3">;
24
- export declare const H4: SemanticComponentType<"h4">;
25
- export declare const H5: SemanticComponentType<"h5">;
26
- export declare const H6: SemanticComponentType<"h6">;
27
- export declare const Link: SemanticComponentType<"a">;
28
- export declare const Img: SemanticComponentType<"img">;
4
+ import { ComponentsAndVariants } from '../types';
5
+ type SemanticComponentType<TTag extends keyof React.JSX.IntrinsicElements, TKey extends keyof ComponentsAndVariants = never> = (props: Omit<BoxProps<TTag, TKey>, 'tag'> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
6
+ export declare const Label: SemanticComponentType<"label", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
7
+ export declare const Span: SemanticComponentType<"span", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
8
+ export declare const Article: SemanticComponentType<"article", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
9
+ export declare const Aside: SemanticComponentType<"aside", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
10
+ export declare const Details: SemanticComponentType<"details", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
11
+ export declare const Figcaption: SemanticComponentType<"figcaption", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
12
+ export declare const Figure: SemanticComponentType<"figure", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
13
+ export declare const Footer: SemanticComponentType<"footer", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
14
+ export declare const Header: SemanticComponentType<"header", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
15
+ export declare const Main: SemanticComponentType<"main", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
16
+ export declare const Mark: SemanticComponentType<"mark", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
17
+ export declare const Nav: SemanticComponentType<"nav", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
18
+ export declare const Menu: SemanticComponentType<"menu", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
19
+ export declare const Section: SemanticComponentType<"section", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
20
+ export declare const Summary: SemanticComponentType<"summary", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
21
+ export declare const Time: SemanticComponentType<"time", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
22
+ export declare const P: SemanticComponentType<"p", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
23
+ export declare const H1: SemanticComponentType<"h1", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
24
+ export declare const H2: SemanticComponentType<"h2", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
25
+ export declare const H3: SemanticComponentType<"h3", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
26
+ export declare const H4: SemanticComponentType<"h4", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
27
+ export declare const H5: SemanticComponentType<"h5", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
28
+ export declare const H6: SemanticComponentType<"h6", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
29
+ export declare const Link: SemanticComponentType<"a", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
30
+ export declare const Img: SemanticComponentType<"img", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
29
31
  export {};
@@ -1,33 +1,34 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import { forwardRef as i } from "react";
3
3
  import r from "../box.mjs";
4
- function o(t, n) {
5
- return i((c, e) => /* @__PURE__ */ s(r, { tag: t, ref: e, component: t, ...n, ...c }));
4
+ function n(o, t) {
5
+ return i((c, e) => /* @__PURE__ */ s(r, { tag: o, ref: e, component: o, ...t, ...c }));
6
6
  }
7
- const p = o("label"), u = o("article"), S = o("aside"), h = o("details"), l = o("figcaption"), H = o("figure"), d = o("footer"), g = o("header"), z = o("main"), k = o("mark"), x = o("nav"), F = o("menu"), M = o("section"), b = o("summary"), v = o("time"), y = o("p"), A = o("h1", { fontSize: 14 * 2.5 }), L = o("h2", { fontSize: 14 * 2 }), j = o("h3", { fontSize: 14 * 1.75 }), w = o("h4", { fontSize: 14 * 1.5 }), B = o("h5", { fontSize: 14 * 1.25 }), D = o("h6", { fontSize: 14 * 1 }), I = o("a"), P = o("img");
7
+ const p = n("label"), u = n("span", { inline: !0 }), S = n("article"), l = n("aside"), h = n("details"), H = n("figcaption"), d = n("figure"), g = n("footer"), z = n("header"), k = n("main"), x = n("mark"), F = n("nav"), M = n("menu"), b = n("section"), v = n("summary"), y = n("time"), A = n("p"), L = n("h1", { fontSize: 14 * 2.5 }), j = n("h2", { fontSize: 14 * 2 }), w = n("h3", { fontSize: 14 * 1.75 }), B = n("h4", { fontSize: 14 * 1.5 }), D = n("h5", { fontSize: 14 * 1.25 }), I = n("h6", { fontSize: 14 * 1 }), P = n("a"), R = n("img");
8
8
  export {
9
- u as Article,
10
- S as Aside,
9
+ S as Article,
10
+ l as Aside,
11
11
  h as Details,
12
- l as Figcaption,
13
- H as Figure,
14
- d as Footer,
15
- A as H1,
16
- L as H2,
17
- j as H3,
18
- w as H4,
19
- B as H5,
20
- D as H6,
21
- g as Header,
22
- P as Img,
12
+ H as Figcaption,
13
+ d as Figure,
14
+ g as Footer,
15
+ L as H1,
16
+ j as H2,
17
+ w as H3,
18
+ B as H4,
19
+ D as H5,
20
+ I as H6,
21
+ z as Header,
22
+ R as Img,
23
23
  p as Label,
24
- I as Link,
25
- z as Main,
26
- k as Mark,
27
- F as Menu,
28
- x as Nav,
29
- y as P,
30
- M as Section,
31
- b as Summary,
32
- v as Time
24
+ P as Link,
25
+ k as Main,
26
+ x as Mark,
27
+ M as Menu,
28
+ F as Nav,
29
+ A as P,
30
+ b as Section,
31
+ u as Span,
32
+ v as Summary,
33
+ y as Time
33
34
  };
@@ -1,10 +1,11 @@
1
- import { BoxProps } from '../box';
2
- type TextareaProps = Omit<BoxProps<'textarea'>, 'ref' | 'tag'>;
3
- type BoxTagProps = Required<TextareaProps>['props'];
1
+ import { RefAttributes } from 'react';
2
+ import { BoxProps, BoxTagProps } from '../box';
3
+ import { ComponentsAndVariants } from '../types';
4
4
  declare const tagProps: readonly ["name", "onInput", "onChange", "placeholder", "value", "defaultValue", "rows", "cols", "autoFocus", "maxLength", "minLength", "readOnly"];
5
5
  type TagPropsType = (typeof tagProps)[number];
6
- type TextareaTagProps = Omit<BoxTagProps, TagPropsType>;
7
- interface Props extends Omit<TextareaProps, 'props'> {
6
+ type TextareaProps<TKey extends keyof ComponentsAndVariants> = Omit<BoxProps<'textarea', TKey>, 'tag' | 'props'>;
7
+ type TextareaTagProps = Omit<BoxTagProps<'textarea'>, TagPropsType | 'type'>;
8
+ interface Props<TKey extends keyof ComponentsAndVariants> extends TextareaProps<TKey> {
8
9
  name?: string;
9
10
  props?: TextareaTagProps;
10
11
  onInput?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
@@ -20,5 +21,5 @@ interface Props extends Omit<TextareaProps, 'props'> {
20
21
  readOnly?: boolean;
21
22
  required?: boolean;
22
23
  }
23
- declare const _default: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLTextAreaElement>>;
24
+ declare const _default: <TKey extends keyof ComponentsAndVariants = "textarea">(props: Props<TKey> & RefAttributes<HTMLTextAreaElement>) => React.ReactNode;
24
25
  export default _default;
@@ -1,11 +1,12 @@
1
- import { BoxProps } from '../box';
2
- type TextareaProps = Omit<BoxProps<'input'>, 'ref' | 'tag'>;
3
- type BoxTagProps = Required<TextareaProps>['props'];
1
+ import { RefAttributes } from 'react';
2
+ import { BoxProps, BoxTagProps } from '../box';
3
+ import { ComponentsAndVariants } from '../types';
4
4
  declare const tagProps: readonly ["name", "onInput", "onChange", "type", "placeholder", "defaultValue", "autoFocus", "readOnly", "required", "value", "pattern"];
5
5
  type TagPropsType = (typeof tagProps)[number];
6
- type TextboxTagProps = Omit<BoxTagProps, TagPropsType>;
6
+ type TextareaProps<TKey extends keyof ComponentsAndVariants> = Omit<BoxProps<'input', TKey>, 'tag' | 'props'>;
7
+ type TextboxTagProps = Omit<BoxTagProps<'input'>, TagPropsType | 'type'>;
7
8
  type TextboxType = 'date' | 'datetime-local' | 'email' | 'hidden' | 'month' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
8
- interface Props extends Omit<TextareaProps, 'props'> {
9
+ interface Props<TKey extends keyof ComponentsAndVariants> extends TextareaProps<TKey> {
9
10
  name?: string;
10
11
  props?: TextboxTagProps;
11
12
  onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -19,5 +20,5 @@ interface Props extends Omit<TextareaProps, 'props'> {
19
20
  readOnly?: boolean;
20
21
  step?: number | string;
21
22
  }
22
- declare const _default: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLInputElement>>;
23
+ declare const _default: <TKey extends keyof ComponentsAndVariants = "textbox">(props: Props<TKey> & RefAttributes<HTMLInputElement>) => React.ReactNode;
23
24
  export default _default;