@cronocode/react-box 3.0.12 → 3.0.13
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 +8 -7
- package/box.cjs +1 -1
- package/box.d.ts +8 -9
- package/box.mjs +16 -16
- package/components/button.d.ts +7 -6
- package/components/checkbox.d.ts +5 -3
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.mjs +4 -4
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.mjs +1 -1
- package/components/flex.d.ts +2 -1
- package/components/form.cjs +1 -1
- package/components/form.mjs +8 -5
- package/components/grid.d.ts +2 -1
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.d.ts +7 -6
- package/components/radioButton.mjs +9 -9
- package/components/semantics.cjs +1 -1
- package/components/semantics.d.ts +27 -25
- package/components/semantics.mjs +26 -25
- package/components/textarea.d.ts +7 -6
- package/components/textbox.d.ts +7 -6
- package/components/tooltip.d.ts +1 -1
- package/core/boxStyles.d.ts +4 -2
- package/core/extends/boxComponents.d.ts +306 -0
- package/core/{boxExtends.d.ts → extends/boxExtends.d.ts} +4 -1
- package/core/extends/useComponents.d.ts +2 -0
- package/core/theme/theme.d.ts +1 -3
- package/core/theme/themeContext.d.ts +2 -4
- package/core/useStyles.d.ts +3 -3
- package/core.cjs +4 -4
- package/core.mjs +237 -230
- package/package.json +1 -1
- package/types.d.ts +46 -6
- package/components/label.cjs +0 -1
- package/components/label.d.ts +0 -5
- package/components/label.mjs +0 -10
- package/core/theme/defaultTheme.d.ts +0 -3
- package/core/theme/themeContract.d.ts +0 -25
- package/core/theme/useTheme.d.ts +0 -2
package/README.md
CHANGED
|
@@ -114,13 +114,14 @@ export const { extendedProps, extendedPropTypes } = Box.extend(
|
|
|
114
114
|
|
|
115
115
|
```JS
|
|
116
116
|
import '@cronocode/react-box';
|
|
117
|
-
import { ExtractBoxStyles } from '@cronocode/react-box/types';
|
|
118
|
-
import { extendedProps, extendedPropTypes } from './path-to-your-b0x-extends-declaration';
|
|
117
|
+
import { ExtractBoxStyles, ExtractComponentsAndVariants } from '@cronocode/react-box/types';
|
|
118
|
+
import { extendedProps, extendedPropTypes, components } from './path-to-your-b0x-extends-declaration';
|
|
119
119
|
|
|
120
120
|
declare module '@cronocode/react-box/types' {
|
|
121
121
|
namespace Augmented {
|
|
122
122
|
interface BoxProps extends ExtractBoxStyles<typeof extendedProps> {}
|
|
123
123
|
interface BoxPropTypes extends ExtractBoxStyles<typeof extendedPropTypes> {}
|
|
124
|
+
interface ComponentsTypes extends ExtractComponentsAndVariants<typeof components> {}
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
```
|
|
@@ -130,14 +131,14 @@ declare module '@cronocode/react-box/types' {
|
|
|
130
131
|
In the project root file (main.tsx) use `Theme.setup`
|
|
131
132
|
|
|
132
133
|
```JS
|
|
133
|
-
import
|
|
134
|
+
import Box from '@cronocode/react-box';
|
|
134
135
|
|
|
135
|
-
|
|
136
|
+
Box.components({
|
|
136
137
|
button: {
|
|
137
138
|
styles: {
|
|
138
139
|
px: 4
|
|
139
140
|
},
|
|
140
|
-
|
|
141
|
+
variants: {
|
|
141
142
|
mytheme: {
|
|
142
143
|
px: 8
|
|
143
144
|
}
|
|
@@ -157,13 +158,13 @@ function MyComponent() {
|
|
|
157
158
|
}
|
|
158
159
|
```
|
|
159
160
|
|
|
160
|
-
or is possible to use Button with specific
|
|
161
|
+
or is possible to use Button with specific variant
|
|
161
162
|
|
|
162
163
|
```JS
|
|
163
164
|
import Button from '@cronocode/react-box/components/button';
|
|
164
165
|
|
|
165
166
|
function MyComponent() {
|
|
166
|
-
return <Button
|
|
167
|
+
return <Button variant="mytheme">Click me</Button>
|
|
167
168
|
}
|
|
168
169
|
```
|
|
169
170
|
|
package/box.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react"),e=require("./core.cjs");function
|
|
1
|
+
"use strict";const t=require("react"),e=require("./core.cjs");function T(n,l){const{tag:c="div",children:a,props:m,className:x,style:i,disabled:B,required:p,checked:g,selected:f}=n,h=e.useStyles(n,c==="svg"),r=t.useMemo(()=>{const P=e.classNames(h,x).join(" "),s={...m,className:P};return e.BoxUtils.assignBooleanProp(B,"disabled",s),e.BoxUtils.assignBooleanProp(p,"required",s),e.BoxUtils.assignBooleanProp(g,"checked",s),e.BoxUtils.assignBooleanProp(f,"selected",s),i&&(s.style=i),l&&(s.ref=l),s},[n]),[v,u]=t.useState(!1),d=typeof a=="function";return d&&(r.onMouseEnter=()=>u(!0),r.onMouseLeave=()=>u(!1)),t.createElement(c,r,d?a({isHover:v}):a)}const o=t.memo(t.forwardRef(T));o.extend=e.BoxExtends.extend;o.components=e.BoxExtends.components;o.Theme=e.Theme;o.useTheme=e.Theme.useTheme;o.getVariableValue=e.Variables.getVariableValue;module.exports=o;
|
package/box.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { default as React,
|
|
1
|
+
import { default as React, RefAttributes } from 'react';
|
|
2
2
|
import { ClassNameType } from './core/classNames';
|
|
3
3
|
import { ExtractElementFromTag } from './core/coreTypes';
|
|
4
|
-
import { BoxStyleProps } from './types';
|
|
5
|
-
import { default as BoxExtends } from './core/boxExtends';
|
|
4
|
+
import { BoxStyleProps, ComponentsAndVariants } from './types';
|
|
5
|
+
import { default as BoxExtends } from './core/extends/boxExtends';
|
|
6
6
|
import { default as Theme } from './core/theme/theme';
|
|
7
7
|
import { default as Variables } from './core/variables';
|
|
8
8
|
type AllProps<TTag extends keyof React.JSX.IntrinsicElements> = React.ComponentProps<TTag>;
|
|
9
9
|
type TagPropsType<TTag extends keyof React.JSX.IntrinsicElements> = Omit<AllProps<TTag>, 'className' | 'style' | 'ref' | 'disabled' | 'required' | 'checked'>;
|
|
10
|
-
interface Props<TTag extends keyof React.JSX.IntrinsicElements> extends BoxStyleProps {
|
|
10
|
+
interface Props<TTag extends keyof React.JSX.IntrinsicElements, TKey extends keyof ComponentsAndVariants> extends BoxStyleProps<TKey> {
|
|
11
11
|
children?: React.ReactNode | ((props: {
|
|
12
12
|
isHover: boolean;
|
|
13
13
|
}) => React.ReactNode);
|
|
@@ -16,16 +16,15 @@ interface Props<TTag extends keyof React.JSX.IntrinsicElements> extends BoxStyle
|
|
|
16
16
|
className?: ClassNameType;
|
|
17
17
|
style?: React.ComponentProps<TTag>['style'];
|
|
18
18
|
}
|
|
19
|
-
declare function BoxComponent<TTag extends keyof React.JSX.IntrinsicElements = 'div'>(props: Props<TTag>, ref: Ref<ExtractElementFromTag<TTag>>): React.ReactElement<React.ComponentProps<TTag>, string | React.JSXElementConstructor<any>>;
|
|
20
19
|
interface BoxType {
|
|
21
|
-
<TTag extends keyof React.JSX.IntrinsicElements = 'div'>(props: Props<TTag> & RefAttributes<ExtractElementFromTag<TTag>>): React.ReactNode;
|
|
20
|
+
<TTag extends keyof React.JSX.IntrinsicElements = 'div', TKey extends keyof ComponentsAndVariants = never>(props: Props<TTag, TKey> & RefAttributes<ExtractElementFromTag<TTag>>): React.ReactNode;
|
|
22
21
|
extend: typeof BoxExtends.extend;
|
|
23
|
-
|
|
22
|
+
components: typeof BoxExtends.components;
|
|
24
23
|
Theme: typeof Theme;
|
|
25
24
|
useTheme: typeof Theme.useTheme;
|
|
26
25
|
getVariableValue: typeof Variables.getVariableValue;
|
|
27
26
|
}
|
|
28
27
|
declare const Box: BoxType;
|
|
29
28
|
export default Box;
|
|
30
|
-
export type BoxProps<TTag extends keyof React.JSX.IntrinsicElements = 'div'> = React.ComponentProps<typeof
|
|
31
|
-
export type BoxTagProps<TTag extends keyof React.JSX.IntrinsicElements = 'div'> = Required<BoxProps<TTag>>['props'];
|
|
29
|
+
export type BoxProps<TTag extends keyof React.JSX.IntrinsicElements = 'div', TKey extends keyof ComponentsAndVariants = never> = React.ComponentProps<typeof Box<TTag, TKey>>;
|
|
30
|
+
export type BoxTagProps<TTag extends keyof React.JSX.IntrinsicElements = 'div', TKey extends keyof ComponentsAndVariants = never> = Required<BoxProps<TTag, TKey>>['props'];
|
package/box.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { B as
|
|
3
|
-
function
|
|
4
|
-
const { tag:
|
|
5
|
-
const
|
|
6
|
-
...
|
|
7
|
-
className:
|
|
1
|
+
import V, { memo as b, forwardRef as y, useMemo as N, useState as C } from "react";
|
|
2
|
+
import { B as u, T as d, V as E, u as H, c as M, a as o } from "./core.mjs";
|
|
3
|
+
function S(a, r) {
|
|
4
|
+
const { tag: l = "div", children: t, props: p, className: f, style: c, disabled: g, required: B, checked: x, selected: h } = a, v = H(a, l === "svg"), n = N(() => {
|
|
5
|
+
const T = M(v, f).join(" "), e = {
|
|
6
|
+
...p,
|
|
7
|
+
className: T
|
|
8
8
|
};
|
|
9
|
-
return
|
|
10
|
-
}, [
|
|
11
|
-
return
|
|
9
|
+
return o.assignBooleanProp(g, "disabled", e), o.assignBooleanProp(B, "required", e), o.assignBooleanProp(x, "checked", e), o.assignBooleanProp(h, "selected", e), c && (e.style = c), r && (e.ref = r), e;
|
|
10
|
+
}, [a]), [P, i] = C(!1), m = typeof t == "function";
|
|
11
|
+
return m && (n.onMouseEnter = () => i(!0), n.onMouseLeave = () => i(!1)), V.createElement(l, n, m ? t({ isHover: P }) : t);
|
|
12
12
|
}
|
|
13
|
-
const s =
|
|
14
|
-
s.extend =
|
|
15
|
-
s.
|
|
16
|
-
s.Theme =
|
|
17
|
-
s.useTheme =
|
|
18
|
-
s.getVariableValue =
|
|
13
|
+
const s = b(y(S));
|
|
14
|
+
s.extend = u.extend;
|
|
15
|
+
s.components = u.components;
|
|
16
|
+
s.Theme = d;
|
|
17
|
+
s.useTheme = d.useTheme;
|
|
18
|
+
s.getVariableValue = E.getVariableValue;
|
|
19
19
|
export {
|
|
20
20
|
s as default
|
|
21
21
|
};
|
package/components/button.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { RefAttributes } from 'react';
|
|
2
|
+
import { BoxProps, BoxTagProps } from '../box';
|
|
3
|
+
import { ComponentsAndVariants } from '../types';
|
|
4
4
|
declare const tagProps: readonly ["type", "onClick"];
|
|
5
5
|
type TagPropsType = (typeof tagProps)[number];
|
|
6
|
-
type
|
|
6
|
+
type ButtonProps<TKey extends keyof ComponentsAndVariants> = Omit<BoxProps<'button', TKey>, 'tag' | 'props'>;
|
|
7
|
+
type ButtonTagProps = Omit<BoxTagProps<'button'>, TagPropsType>;
|
|
7
8
|
type ButtonType = Required<React.ComponentProps<'button'>>['type'];
|
|
8
|
-
interface Props extends
|
|
9
|
+
interface Props<TKey extends keyof ComponentsAndVariants> extends ButtonProps<TKey> {
|
|
9
10
|
props?: ButtonTagProps;
|
|
10
11
|
type?: ButtonType;
|
|
11
12
|
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
12
13
|
}
|
|
13
|
-
declare const _default:
|
|
14
|
+
declare const _default: <TKey extends keyof ComponentsAndVariants = "button">(props: Props<TKey> & RefAttributes<HTMLButtonElement>) => React.ReactNode;
|
|
14
15
|
export default _default;
|
package/components/checkbox.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { RefAttributes } from 'react';
|
|
1
2
|
import { BoxTagProps, BoxProps } from '../box';
|
|
3
|
+
import { ComponentsAndVariants } from '../types';
|
|
2
4
|
declare const tagProps: readonly ["name", "onInput", "onChange", "autoFocus", "readOnly", "value", "defaultChecked"];
|
|
3
5
|
type TagPropsType = (typeof tagProps)[number];
|
|
4
|
-
type CheckboxProps = Omit<BoxProps<'input'>, 'tag' | 'props'>;
|
|
6
|
+
type CheckboxProps<TKey extends keyof ComponentsAndVariants> = Omit<BoxProps<'input', TKey>, 'tag' | 'props'>;
|
|
5
7
|
type CheckboxTagProps = Omit<BoxTagProps<'input'>, TagPropsType | 'type'>;
|
|
6
|
-
interface Props extends CheckboxProps {
|
|
8
|
+
interface Props<TKey extends keyof ComponentsAndVariants> extends CheckboxProps<TKey> {
|
|
7
9
|
name?: string;
|
|
8
10
|
props?: CheckboxTagProps;
|
|
9
11
|
onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -13,5 +15,5 @@ interface Props extends CheckboxProps {
|
|
|
13
15
|
readOnly?: boolean;
|
|
14
16
|
defaultChecked?: boolean;
|
|
15
17
|
}
|
|
16
|
-
declare const _default:
|
|
18
|
+
declare const _default: <TKey extends keyof ComponentsAndVariants = "checkbox">(props: Props<TKey> & RefAttributes<HTMLInputElement>) => React.ReactNode;
|
|
17
19
|
export default _default;
|
package/components/dataGrid.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime");require("react");const o=require("../box.cjs"),c=require("./grid.cjs");function g(u){const{data:e,def:d}=u,{rowKey:r,columns:i}=d;return i.length===0?(console.error("Cannot render grid without column definitions"),null):n.jsx(o,{component:"
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime");require("react");const o=require("../box.cjs"),c=require("./grid.cjs");function g(u){const{data:e,def:d}=u,{rowKey:r,columns:i}=d;return i.length===0?(console.error("Cannot render grid without column definitions"),null):n.jsx(o,{component:"datagrid",children:n.jsxs(c,{b:1,borderRadius:1,children:[i.map((t,s)=>n.jsx(o,{style:{gridColumn:s+1},children:t.key.toString()},s)),((e==null?void 0:e.length)??0)===0&&n.jsx(o,{children:"Empty table"}),((e==null?void 0:e.length)??0)>0&&n.jsx(n.Fragment,{children:e==null?void 0:e.map((t,s)=>{const m=r?typeof r=="function"?r(t):t[r]:s;return n.jsx(c,{style:{gridTemplateRows:"subgrid"},children:i.map((h,l)=>n.jsxs(o,{style:{gridColumn:l+1},children:["tes ",l]},l))},m)})})]})})}module.exports=g;
|
package/components/dataGrid.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as n, jsxs as c, Fragment as
|
|
1
|
+
import { jsx as n, jsxs as c, Fragment as g } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import i from "../box.mjs";
|
|
4
4
|
import s from "./grid.mjs";
|
|
5
5
|
function x(d) {
|
|
6
6
|
const { data: r, def: u } = d, { rowKey: e, columns: l } = u;
|
|
7
|
-
return l.length === 0 ? (console.error("Cannot render grid without column definitions"), null) : /* @__PURE__ */ n(i, { component: "
|
|
7
|
+
return l.length === 0 ? (console.error("Cannot render grid without column definitions"), null) : /* @__PURE__ */ n(i, { component: "datagrid", children: /* @__PURE__ */ c(s, { b: 1, borderRadius: 1, children: [
|
|
8
8
|
l.map((o, t) => /* @__PURE__ */ n(i, { style: { gridColumn: t + 1 }, children: o.key.toString() }, t)),
|
|
9
9
|
((r == null ? void 0 : r.length) ?? 0) === 0 && /* @__PURE__ */ n(i, { children: "Empty table" }),
|
|
10
|
-
((r == null ? void 0 : r.length) ?? 0) > 0 && /* @__PURE__ */ n(
|
|
10
|
+
((r == null ? void 0 : r.length) ?? 0) > 0 && /* @__PURE__ */ n(g, { children: r == null ? void 0 : r.map((o, t) => {
|
|
11
11
|
const p = e ? typeof e == "function" ? e(o) : o[e] : t;
|
|
12
|
-
return /* @__PURE__ */ n(s, { style: { gridTemplateRows: "subgrid" }, children: l.map((
|
|
12
|
+
return /* @__PURE__ */ n(s, { style: { gridTemplateRows: "subgrid" }, children: l.map((h, m) => /* @__PURE__ */ c(i, { style: { gridColumn: m + 1 }, children: [
|
|
13
13
|
"tes ",
|
|
14
14
|
m
|
|
15
15
|
] }, m)) }, p);
|
package/components/dropdown.cjs
CHANGED
|
@@ -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]),
|
|
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]),v=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:v==null?void 0:v.props.children)},[u,f,c,v,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=v&&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,...v.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",variant:u?"multiple":void 0,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 x=n.forwardRef(ee);x.Item=S("DropdownItem");x.Unselect=S("DropdownUnselect");x.SelectAll=S("DropdownSelectAll");x.EmptyItem=S("DropdownEmptyItem");x.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=x;
|
package/components/dropdown.mjs
CHANGED
package/components/flex.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
2
|
import { BoxProps } from '../box';
|
|
3
3
|
import { ExtractElementFromTag } from '../core/coreTypes';
|
|
4
|
-
|
|
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;
|
package/components/form.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const m=require("react/jsx-runtime"),
|
|
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;
|
package/components/form.mjs
CHANGED
|
@@ -3,11 +3,14 @@ import { useRef as a, useCallback as i } from "react";
|
|
|
3
3
|
import p from "../box.mjs";
|
|
4
4
|
import { F as c } from "../core.mjs";
|
|
5
5
|
function x(o) {
|
|
6
|
-
const { onSubmit:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const { onSubmit: r, props: n } = o, t = a(null), e = i(
|
|
7
|
+
(m) => {
|
|
8
|
+
m.preventDefault();
|
|
9
|
+
const f = c.getFormEntries(t.current);
|
|
10
|
+
r(f, m);
|
|
11
|
+
},
|
|
12
|
+
[r]
|
|
13
|
+
), s = { ...n, onSubmit: e, ref: t };
|
|
11
14
|
return /* @__PURE__ */ u(p, { tag: "form", ...o, props: s });
|
|
12
15
|
}
|
|
13
16
|
export {
|
package/components/grid.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
2
|
import { BoxProps } from '../box';
|
|
3
3
|
import { ExtractElementFromTag } from '../core/coreTypes';
|
|
4
|
-
|
|
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
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
7
|
-
|
|
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:
|
|
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
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { O as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */
|
|
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 =
|
|
10
|
+
const c = n(i);
|
|
11
11
|
export {
|
|
12
12
|
c as default
|
|
13
13
|
};
|
package/components/semantics.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),s=require("react"),
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
28
|
-
export declare const
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
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">;
|
|
29
31
|
export {};
|
package/components/semantics.mjs
CHANGED
|
@@ -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
|
|
5
|
-
return i((c, e) => /* @__PURE__ */ s(r, { tag:
|
|
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 =
|
|
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
|
-
|
|
10
|
-
|
|
9
|
+
S as Article,
|
|
10
|
+
l as Aside,
|
|
11
11
|
h as Details,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
v as
|
|
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
|
};
|
package/components/textarea.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
7
|
-
|
|
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:
|
|
24
|
+
declare const _default: <TKey extends keyof ComponentsAndVariants = "textarea">(props: Props<TKey> & RefAttributes<HTMLTextAreaElement>) => React.ReactNode;
|
|
24
25
|
export default _default;
|
package/components/textbox.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
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
|
|
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:
|
|
23
|
+
declare const _default: <TKey extends keyof ComponentsAndVariants = "textbox">(props: Props<TKey> & RefAttributes<HTMLInputElement>) => React.ReactNode;
|
|
23
24
|
export default _default;
|
package/components/tooltip.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ interface Props extends BoxProps {
|
|
|
5
5
|
left: number;
|
|
6
6
|
}): void;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const _default: import('react').ForwardRefExoticComponent<Omit<Props, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export default _default;
|
package/core/boxStyles.d.ts
CHANGED
|
@@ -747,6 +747,7 @@ export declare const pseudo2: {
|
|
|
747
747
|
selected: string;
|
|
748
748
|
};
|
|
749
749
|
export declare const pseudoClasses: {
|
|
750
|
+
theme: string;
|
|
750
751
|
indeterminate: string;
|
|
751
752
|
checked: string;
|
|
752
753
|
required: string;
|
|
@@ -765,15 +766,16 @@ export declare const pseudoClasses: {
|
|
|
765
766
|
hasRequired: string;
|
|
766
767
|
hasDisabled: string;
|
|
767
768
|
};
|
|
768
|
-
export declare const pseudoClassesWeight: Record<"indeterminate" | "checked" | "required" | "disabled" | "selected" | "hover" | "focus" | "hasFocus" | "active" | "valid" | "hasValid" | "invalid" | "hasInvalid" | "optional" | "hasChecked" | "hasRequired" | "hasDisabled", number>;
|
|
769
|
+
export declare const pseudoClassesWeight: Record<"theme" | "indeterminate" | "checked" | "required" | "disabled" | "selected" | "hover" | "focus" | "hasFocus" | "active" | "valid" | "hasValid" | "invalid" | "hasInvalid" | "optional" | "hasChecked" | "hasRequired" | "hasDisabled", number>;
|
|
769
770
|
export declare const pseudoClassesByWeight: {
|
|
770
|
-
[key: number]: ("indeterminate" | "checked" | "required" | "disabled" | "selected" | "hover" | "focus" | "hasFocus" | "active" | "valid" | "hasValid" | "invalid" | "hasInvalid" | "optional" | "hasChecked" | "hasRequired" | "hasDisabled")[];
|
|
771
|
+
[key: number]: ("theme" | "indeterminate" | "checked" | "required" | "disabled" | "selected" | "hover" | "focus" | "hasFocus" | "active" | "valid" | "hasValid" | "invalid" | "hasInvalid" | "optional" | "hasChecked" | "hasRequired" | "hasDisabled")[];
|
|
771
772
|
};
|
|
772
773
|
export declare const pseudoGroupClasses: {
|
|
773
774
|
hoverGroup: "hover";
|
|
774
775
|
focusGroup: "focus";
|
|
775
776
|
activeGroup: "active";
|
|
776
777
|
disabledGroup: "disabled";
|
|
778
|
+
theme: "theme";
|
|
777
779
|
};
|
|
778
780
|
export declare const breakpoints: {
|
|
779
781
|
/** Styles applied for small screens and larger. >= 640 */
|