tw-react-components 0.0.132 → 0.0.134
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/index.cjs.js +41 -52
- package/index.esm.js +18 -21
- package/package.json +5 -3
- package/src/components/Badge/index.d.ts +1 -2
- package/src/components/Block/index.d.ts +5 -5
- package/src/components/Button/index.d.ts +6 -6
- package/src/components/Card/index.d.ts +5 -6
- package/src/components/Dialog/Dialog.d.ts +1 -1
- package/src/components/DropdownMenu/index.d.ts +4 -4
- package/src/components/Flex/index.d.ts +10 -11
- package/src/components/Form/controls/custom/date-time/index.d.ts +10 -11
- package/src/components/Form/controls/primitive/BasicInput.d.ts +9 -9
- package/src/components/Form/controls/primitive/CheckBoxInput.d.ts +0 -1
- package/src/components/Form/controls/primitive/EmailInput.d.ts +0 -1
- package/src/components/Form/controls/primitive/NumberInput.d.ts +0 -1
- package/src/components/Form/controls/primitive/PasswordInput.d.ts +0 -1
- package/src/components/Form/controls/primitive/TextInput.d.ts +0 -1
- package/src/components/Form/controls/primitive/TextareaInput.d.ts +0 -1
- package/src/components/Form/controls/with-form.d.ts +8 -8
- package/src/components/Hint/index.d.ts +3 -4
- package/src/components/List/index.d.ts +5 -6
- package/src/components/Popover/index.d.ts +1 -2
- package/src/components/Switch/index.d.ts +7 -2
- package/src/components/Tabs/index.d.ts +0 -1
package/index.cjs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
4
|
var react = require('react');
|
|
7
5
|
var clsx = require('clsx');
|
|
@@ -23,12 +21,8 @@ var reactRouterDom = require('react-router-dom');
|
|
|
23
21
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
24
22
|
var SwitchPrimitives = require('@radix-ui/react-switch');
|
|
25
23
|
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
26
|
-
var react$1 = require('@headlessui/react');
|
|
27
|
-
|
|
28
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
29
24
|
|
|
30
|
-
function
|
|
31
|
-
if (e && e.__esModule) return e;
|
|
25
|
+
function _interopNamespaceDefault(e) {
|
|
32
26
|
var n = Object.create(null);
|
|
33
27
|
if (e) {
|
|
34
28
|
Object.keys(e).forEach(function (k) {
|
|
@@ -41,20 +35,17 @@ function _interopNamespace(e) {
|
|
|
41
35
|
}
|
|
42
36
|
});
|
|
43
37
|
}
|
|
44
|
-
n
|
|
38
|
+
n.default = e;
|
|
45
39
|
return Object.freeze(n);
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
56
|
-
var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
|
|
57
|
-
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
42
|
+
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(TooltipPrimitive);
|
|
43
|
+
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(DropdownMenuPrimitive);
|
|
44
|
+
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(DialogPrimitive);
|
|
45
|
+
var Accordion__namespace = /*#__PURE__*/_interopNamespaceDefault(Accordion);
|
|
46
|
+
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(PopoverPrimitive);
|
|
47
|
+
var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespaceDefault(SwitchPrimitives);
|
|
48
|
+
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(TabsPrimitive);
|
|
58
49
|
|
|
59
50
|
/******************************************************************************
|
|
60
51
|
Copyright (c) Microsoft Corporation.
|
|
@@ -70,6 +61,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
70
61
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
71
62
|
PERFORMANCE OF THIS SOFTWARE.
|
|
72
63
|
***************************************************************************** */
|
|
64
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
65
|
+
|
|
73
66
|
|
|
74
67
|
function __rest(s, e) {
|
|
75
68
|
var t = {};
|
|
@@ -104,8 +97,8 @@ function cn(...inputs) {
|
|
|
104
97
|
|
|
105
98
|
function compareDates(date1, date2, startOf) {
|
|
106
99
|
if (startOf) {
|
|
107
|
-
date1 =
|
|
108
|
-
date2 =
|
|
100
|
+
date1 = dayjs(date1).startOf(startOf).toDate();
|
|
101
|
+
date2 = dayjs(date2).startOf(startOf).toDate();
|
|
109
102
|
}
|
|
110
103
|
return date1.getTime() - date2.getTime();
|
|
111
104
|
}
|
|
@@ -123,9 +116,9 @@ function generalComparator(a, b) {
|
|
|
123
116
|
return 0;
|
|
124
117
|
}
|
|
125
118
|
|
|
126
|
-
|
|
119
|
+
dayjs.extend(advancedFormat);
|
|
127
120
|
function getDisplayDate(date, format, locale) {
|
|
128
|
-
return (locale ?
|
|
121
|
+
return (locale ? dayjs(date).locale(locale) : dayjs(date)).format(format);
|
|
129
122
|
}
|
|
130
123
|
|
|
131
124
|
function isEmpty(s) {
|
|
@@ -640,12 +633,12 @@ const Flex = react.forwardRef((_a, ref) => {
|
|
|
640
633
|
return (jsxRuntime.jsx(Block, Object.assign({ className: cn('flex gap-3', wrap && 'flex-wrap', directionClasses[direction][reverse ? 'reverse' : 'normal'], alignClasses[align], justifyClasses[justify], className) }, blockProps, { ref: ref, children: children })));
|
|
641
634
|
});
|
|
642
635
|
|
|
643
|
-
|
|
636
|
+
dayjs.extend(localeData);
|
|
644
637
|
function useDays(locale = 'en') {
|
|
645
638
|
return react.useMemo(() => {
|
|
646
|
-
|
|
647
|
-
const names =
|
|
648
|
-
const shortNames =
|
|
639
|
+
dayjs.extend(localeData).locale(locale);
|
|
640
|
+
const names = dayjs.weekdays();
|
|
641
|
+
const shortNames = dayjs.weekdaysShort();
|
|
649
642
|
return names.map((name, index) => ({ name, shortName: shortNames[index], index }));
|
|
650
643
|
}, [locale]);
|
|
651
644
|
}
|
|
@@ -673,12 +666,12 @@ function useLongPress(callback, ms = 100) {
|
|
|
673
666
|
};
|
|
674
667
|
}
|
|
675
668
|
|
|
676
|
-
|
|
669
|
+
dayjs.extend(localeData);
|
|
677
670
|
function useMonths(locale = 'en') {
|
|
678
671
|
return react.useMemo(() => {
|
|
679
|
-
|
|
680
|
-
const names =
|
|
681
|
-
const shortNames =
|
|
672
|
+
dayjs.extend(localeData).locale(locale);
|
|
673
|
+
const names = dayjs.months();
|
|
674
|
+
const shortNames = dayjs.monthsShort();
|
|
682
675
|
return names.map((name, index) => ({ name, shortName: shortNames[index], index }));
|
|
683
676
|
}, [locale]);
|
|
684
677
|
}
|
|
@@ -1058,7 +1051,7 @@ const DateSelector = ({ date, value, minDate, maxDate, locale, calendarView, set
|
|
|
1058
1051
|
|
|
1059
1052
|
const TimeSelector = ({ date, step = 1, minDate, maxDate, setNewDate, }) => {
|
|
1060
1053
|
const editDateField = (field, diff) => () => {
|
|
1061
|
-
const newDate =
|
|
1054
|
+
const newDate = dayjs(date).add(diff, field).toDate();
|
|
1062
1055
|
if (minDate && compareDates(newDate, new Date(minDate), 'minute') < 0)
|
|
1063
1056
|
return;
|
|
1064
1057
|
if (maxDate && compareDates(newDate, new Date(maxDate), 'minute') > 0)
|
|
@@ -1094,7 +1087,7 @@ const DateTimeInput = react.forwardRef((_a, ref) => {
|
|
|
1094
1087
|
}, [isOpen]);
|
|
1095
1088
|
const setNewDate = (newDate) => {
|
|
1096
1089
|
if (type === 'date') {
|
|
1097
|
-
newDate =
|
|
1090
|
+
newDate = dayjs(newDate).startOf('day').toDate();
|
|
1098
1091
|
}
|
|
1099
1092
|
onChange === null || onChange === void 0 ? void 0 : onChange(newDate);
|
|
1100
1093
|
if (type === 'date') {
|
|
@@ -1314,20 +1307,20 @@ const SelectInput = react.forwardRef((_a, ref) => {
|
|
|
1314
1307
|
const FormGroup = ({ className, label, children }) => (jsxRuntime.jsxs(Flex, { className: cn('relative !gap-4 rounded-lg border p-4 dark:border-slate-300', className), direction: "column", fullWidth: true, children: [jsxRuntime.jsx("div", { className: "absolute right-0 top-0 rounded-bl-lg rounded-tr-lg bg-slate-500 px-2 py-1 font-medium text-white dark:bg-slate-900 dark:text-white", children: label }), children] }));
|
|
1315
1308
|
|
|
1316
1309
|
function withForm(Component) {
|
|
1317
|
-
return react.forwardRef((
|
|
1318
|
-
|
|
1310
|
+
return react.forwardRef((props, ref) => {
|
|
1311
|
+
const _a = props, { name, pattern, validate } = _a, restProps = __rest(_a, ["name", "pattern", "validate"]);
|
|
1319
1312
|
const { control } = reactHookForm.useFormContext();
|
|
1320
1313
|
return (jsxRuntime.jsx(reactHookForm.Controller, { name: name, control: control, rules: {
|
|
1321
|
-
required:
|
|
1322
|
-
min:
|
|
1323
|
-
max:
|
|
1324
|
-
minLength:
|
|
1325
|
-
maxLength:
|
|
1314
|
+
required: restProps.required,
|
|
1315
|
+
min: restProps.min,
|
|
1316
|
+
max: restProps.max,
|
|
1317
|
+
minLength: restProps.minLength,
|
|
1318
|
+
maxLength: restProps.maxLength,
|
|
1326
1319
|
pattern,
|
|
1327
1320
|
validate,
|
|
1328
1321
|
}, render: ({ field, fieldState }) => {
|
|
1329
1322
|
var _a, _b;
|
|
1330
|
-
return (jsxRuntime.jsx(Component, Object.assign({},
|
|
1323
|
+
return (jsxRuntime.jsx(Component, Object.assign({}, restProps, field, { value: (_a = field.value) !== null && _a !== void 0 ? _a : '', disabled: (_b = field.disabled) !== null && _b !== void 0 ? _b : restProps.disabled, hasErrors: fieldState.error, ref: mergeRefs([ref, field.ref]) })));
|
|
1331
1324
|
} }));
|
|
1332
1325
|
});
|
|
1333
1326
|
}
|
|
@@ -1384,12 +1377,12 @@ const colorClassNames = {
|
|
|
1384
1377
|
pink: 'bg-pink-500 dark:bg-pink-600',
|
|
1385
1378
|
rose: 'bg-rose-500 dark:bg-rose-600',
|
|
1386
1379
|
};
|
|
1387
|
-
const HintDot = react.forwardRef(({ size = 'medium', placement = 'top-right', color = 'green', ping }, ref) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Block, { className: cn('absolute rounded-full
|
|
1380
|
+
const HintDot = react.forwardRef(({ size = 'medium', placement = 'top-right', color = 'green', ping }, ref) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Block, { className: cn('absolute rounded-full', colorClassNames[color], dotSizeClassNames[size].base, {
|
|
1388
1381
|
[`${dotSizeClassNames[size].top} ${dotSizeClassNames[size].left}`]: placement === 'top-left',
|
|
1389
1382
|
[`${dotSizeClassNames[size].top} ${dotSizeClassNames[size].right}`]: placement === 'top-right',
|
|
1390
1383
|
[`${dotSizeClassNames[size].bottom} ${dotSizeClassNames[size].right}`]: placement === 'bottom-right',
|
|
1391
1384
|
[`${dotSizeClassNames[size].bottom} ${dotSizeClassNames[size].left}`]: placement === 'bottom-left',
|
|
1392
|
-
}), ref: ref }), ping && (jsxRuntime.jsx(Block, { className: cn('absolute animate-ping rounded-full
|
|
1385
|
+
}), ref: ref }), ping && (jsxRuntime.jsx(Block, { className: cn('absolute animate-ping rounded-full', colorClassNames[color], dotSizeClassNames[size].base, {
|
|
1393
1386
|
[`${dotSizeClassNames[size].top} ${dotSizeClassNames[size].left}`]: placement === 'top-left',
|
|
1394
1387
|
[`${dotSizeClassNames[size].top} ${dotSizeClassNames[size].right}`]: placement === 'top-right',
|
|
1395
1388
|
[`${dotSizeClassNames[size].bottom} ${dotSizeClassNames[size].right}`]: placement === 'bottom-right',
|
|
@@ -1774,7 +1767,7 @@ const $Popover = PopoverPrimitive__namespace.Root;
|
|
|
1774
1767
|
const PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
1775
1768
|
const PopoverContent = react.forwardRef((_a, ref) => {
|
|
1776
1769
|
var { className, align = 'center', sideOffset = 4, container } = _a, props = __rest(_a, ["className", "align", "sideOffset", "container"]);
|
|
1777
|
-
return (jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { container: container, children: jsxRuntime.jsx(PopoverPrimitive__namespace.Content, Object.assign({ ref: ref, align: align, sideOffset: sideOffset, className: cn('
|
|
1770
|
+
return (jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { container: container, children: jsxRuntime.jsx(PopoverPrimitive__namespace.Content, Object.assign({ ref: ref, align: align, sideOffset: sideOffset, className: cn('z-50 rounded-md border bg-white p-1 shadow-md outline-none dark:border-slate-700 dark:bg-slate-900 dark:text-white', 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95', 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95', 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className) }, props)) }));
|
|
1778
1771
|
});
|
|
1779
1772
|
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
1780
1773
|
const Popover = Object.assign($Popover, {
|
|
@@ -1783,8 +1776,8 @@ const Popover = Object.assign($Popover, {
|
|
|
1783
1776
|
});
|
|
1784
1777
|
|
|
1785
1778
|
const Switch = react.forwardRef((_a, ref) => {
|
|
1786
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
1787
|
-
return (jsxRuntime.jsx(SwitchPrimitives__namespace.Root, Object.assign({ className: cn('peer inline-flex h-[calc(1.5rem+6px)] w-[calc(3rem+6px)] shrink-0 cursor-pointer items-center rounded-full border-[3px] border-transparent', 'transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-600 focus-visible:ring-offset-2', 'focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=unchecked]:bg-slate-300', 'dark:focus-visible:ring-slate-200 dark:focus-visible:ring-offset-slate-800 dark:data-[state=checked]:bg-blue-700 dark:data-[state=unchecked]:bg-slate-700', className) }, props, { ref: ref, children: jsxRuntime.jsx(SwitchPrimitives__namespace.Thumb, { className: cn('pointer-events-none block h-6 w-6 rounded-full bg-white shadow-lg ring-0 transition-transform', 'data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0 dark:bg-slate-900') }) })));
|
|
1779
|
+
var { className } = _a, _b = _a.thumbProps, _c = _b === void 0 ? {} : _b, { className: thumbClassName } = _c, thumbProps = __rest(_c, ["className"]), props = __rest(_a, ["className", "thumbProps"]);
|
|
1780
|
+
return (jsxRuntime.jsx(SwitchPrimitives__namespace.Root, Object.assign({ className: cn('peer inline-flex h-[calc(1.5rem+6px)] w-[calc(3rem+6px)] shrink-0 cursor-pointer items-center rounded-full border-[3px] border-transparent', 'transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-600 focus-visible:ring-offset-2', 'focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=unchecked]:bg-slate-300', 'dark:focus-visible:ring-slate-200 dark:focus-visible:ring-offset-slate-800 dark:data-[state=checked]:bg-blue-700 dark:data-[state=unchecked]:bg-slate-700', className) }, props, { ref: ref, children: jsxRuntime.jsx(SwitchPrimitives__namespace.Thumb, Object.assign({ className: cn('pointer-events-none block h-6 w-6 rounded-full bg-white shadow-lg ring-0 transition-transform', 'data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0 dark:bg-slate-900', thumbClassName) }, thumbProps)) })));
|
|
1788
1781
|
});
|
|
1789
1782
|
Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
|
|
1790
1783
|
|
|
@@ -1813,13 +1806,9 @@ const Tabs = Object.assign($Tabs, {
|
|
|
1813
1806
|
const ThemeSwitcher = ({ className }) => {
|
|
1814
1807
|
const { theme, toggleTheme } = useLayoutContext();
|
|
1815
1808
|
const darkMode = theme === 'dark';
|
|
1816
|
-
return (jsxRuntime.jsx(
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
}, className), children: jsxRuntime.jsx("div", { className: cn('flex transform transition duration-200 ease-in-out', {
|
|
1820
|
-
'translate-x-6': darkMode,
|
|
1821
|
-
'translate-x-0': !darkMode,
|
|
1822
|
-
}), children: darkMode ? (jsxRuntime.jsx(lucideReact.MoonIcon, { className: "h-6 w-6 rounded-full bg-slate-800 p-1 text-white" })) : (jsxRuntime.jsx(lucideReact.SunIcon, { className: "h-6 w-6 rounded-full bg-slate-200 p-1 text-black" })) }) }));
|
|
1809
|
+
return (jsxRuntime.jsx(Switch, { className: className, checked: darkMode, onCheckedChange: toggleTheme, thumbProps: {
|
|
1810
|
+
children: darkMode ? (jsxRuntime.jsx(lucideReact.MoonIcon, { className: "h-6 w-6 rounded-full bg-slate-900 p-1 text-white" })) : (jsxRuntime.jsx(lucideReact.SunIcon, { className: "h-6 w-6 rounded-full bg-white p-1 text-black" })),
|
|
1811
|
+
} }));
|
|
1823
1812
|
};
|
|
1824
1813
|
|
|
1825
1814
|
exports.Badge = Badge;
|
package/index.esm.js
CHANGED
|
@@ -19,7 +19,6 @@ import { Link, useLocation } from 'react-router-dom';
|
|
|
19
19
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
20
20
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
21
21
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
22
|
-
import { Switch as Switch$1 } from '@headlessui/react';
|
|
23
22
|
|
|
24
23
|
/******************************************************************************
|
|
25
24
|
Copyright (c) Microsoft Corporation.
|
|
@@ -35,6 +34,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
35
34
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
36
35
|
PERFORMANCE OF THIS SOFTWARE.
|
|
37
36
|
***************************************************************************** */
|
|
37
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
38
|
+
|
|
38
39
|
|
|
39
40
|
function __rest(s, e) {
|
|
40
41
|
var t = {};
|
|
@@ -1279,20 +1280,20 @@ const SelectInput = forwardRef((_a, ref) => {
|
|
|
1279
1280
|
const FormGroup = ({ className, label, children }) => (jsxs(Flex, { className: cn('relative !gap-4 rounded-lg border p-4 dark:border-slate-300', className), direction: "column", fullWidth: true, children: [jsx("div", { className: "absolute right-0 top-0 rounded-bl-lg rounded-tr-lg bg-slate-500 px-2 py-1 font-medium text-white dark:bg-slate-900 dark:text-white", children: label }), children] }));
|
|
1280
1281
|
|
|
1281
1282
|
function withForm(Component) {
|
|
1282
|
-
return forwardRef((
|
|
1283
|
-
|
|
1283
|
+
return forwardRef((props, ref) => {
|
|
1284
|
+
const _a = props, { name, pattern, validate } = _a, restProps = __rest(_a, ["name", "pattern", "validate"]);
|
|
1284
1285
|
const { control } = useFormContext();
|
|
1285
1286
|
return (jsx(Controller, { name: name, control: control, rules: {
|
|
1286
|
-
required:
|
|
1287
|
-
min:
|
|
1288
|
-
max:
|
|
1289
|
-
minLength:
|
|
1290
|
-
maxLength:
|
|
1287
|
+
required: restProps.required,
|
|
1288
|
+
min: restProps.min,
|
|
1289
|
+
max: restProps.max,
|
|
1290
|
+
minLength: restProps.minLength,
|
|
1291
|
+
maxLength: restProps.maxLength,
|
|
1291
1292
|
pattern,
|
|
1292
1293
|
validate,
|
|
1293
1294
|
}, render: ({ field, fieldState }) => {
|
|
1294
1295
|
var _a, _b;
|
|
1295
|
-
return (jsx(Component, Object.assign({},
|
|
1296
|
+
return (jsx(Component, Object.assign({}, restProps, field, { value: (_a = field.value) !== null && _a !== void 0 ? _a : '', disabled: (_b = field.disabled) !== null && _b !== void 0 ? _b : restProps.disabled, hasErrors: fieldState.error, ref: mergeRefs([ref, field.ref]) })));
|
|
1296
1297
|
} }));
|
|
1297
1298
|
});
|
|
1298
1299
|
}
|
|
@@ -1349,12 +1350,12 @@ const colorClassNames = {
|
|
|
1349
1350
|
pink: 'bg-pink-500 dark:bg-pink-600',
|
|
1350
1351
|
rose: 'bg-rose-500 dark:bg-rose-600',
|
|
1351
1352
|
};
|
|
1352
|
-
const HintDot = forwardRef(({ size = 'medium', placement = 'top-right', color = 'green', ping }, ref) => (jsxs(Fragment, { children: [jsx(Block, { className: cn('absolute rounded-full
|
|
1353
|
+
const HintDot = forwardRef(({ size = 'medium', placement = 'top-right', color = 'green', ping }, ref) => (jsxs(Fragment, { children: [jsx(Block, { className: cn('absolute rounded-full', colorClassNames[color], dotSizeClassNames[size].base, {
|
|
1353
1354
|
[`${dotSizeClassNames[size].top} ${dotSizeClassNames[size].left}`]: placement === 'top-left',
|
|
1354
1355
|
[`${dotSizeClassNames[size].top} ${dotSizeClassNames[size].right}`]: placement === 'top-right',
|
|
1355
1356
|
[`${dotSizeClassNames[size].bottom} ${dotSizeClassNames[size].right}`]: placement === 'bottom-right',
|
|
1356
1357
|
[`${dotSizeClassNames[size].bottom} ${dotSizeClassNames[size].left}`]: placement === 'bottom-left',
|
|
1357
|
-
}), ref: ref }), ping && (jsx(Block, { className: cn('absolute animate-ping rounded-full
|
|
1358
|
+
}), ref: ref }), ping && (jsx(Block, { className: cn('absolute animate-ping rounded-full', colorClassNames[color], dotSizeClassNames[size].base, {
|
|
1358
1359
|
[`${dotSizeClassNames[size].top} ${dotSizeClassNames[size].left}`]: placement === 'top-left',
|
|
1359
1360
|
[`${dotSizeClassNames[size].top} ${dotSizeClassNames[size].right}`]: placement === 'top-right',
|
|
1360
1361
|
[`${dotSizeClassNames[size].bottom} ${dotSizeClassNames[size].right}`]: placement === 'bottom-right',
|
|
@@ -1739,7 +1740,7 @@ const $Popover = PopoverPrimitive.Root;
|
|
|
1739
1740
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1740
1741
|
const PopoverContent = forwardRef((_a, ref) => {
|
|
1741
1742
|
var { className, align = 'center', sideOffset = 4, container } = _a, props = __rest(_a, ["className", "align", "sideOffset", "container"]);
|
|
1742
|
-
return (jsx(PopoverPrimitive.Portal, { container: container, children: jsx(PopoverPrimitive.Content, Object.assign({ ref: ref, align: align, sideOffset: sideOffset, className: cn('
|
|
1743
|
+
return (jsx(PopoverPrimitive.Portal, { container: container, children: jsx(PopoverPrimitive.Content, Object.assign({ ref: ref, align: align, sideOffset: sideOffset, className: cn('z-50 rounded-md border bg-white p-1 shadow-md outline-none dark:border-slate-700 dark:bg-slate-900 dark:text-white', 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95', 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95', 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className) }, props)) }));
|
|
1743
1744
|
});
|
|
1744
1745
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1745
1746
|
const Popover = Object.assign($Popover, {
|
|
@@ -1748,8 +1749,8 @@ const Popover = Object.assign($Popover, {
|
|
|
1748
1749
|
});
|
|
1749
1750
|
|
|
1750
1751
|
const Switch = forwardRef((_a, ref) => {
|
|
1751
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
1752
|
-
return (jsx(SwitchPrimitives.Root, Object.assign({ className: cn('peer inline-flex h-[calc(1.5rem+6px)] w-[calc(3rem+6px)] shrink-0 cursor-pointer items-center rounded-full border-[3px] border-transparent', 'transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-600 focus-visible:ring-offset-2', 'focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=unchecked]:bg-slate-300', 'dark:focus-visible:ring-slate-200 dark:focus-visible:ring-offset-slate-800 dark:data-[state=checked]:bg-blue-700 dark:data-[state=unchecked]:bg-slate-700', className) }, props, { ref: ref, children: jsx(SwitchPrimitives.Thumb, { className: cn('pointer-events-none block h-6 w-6 rounded-full bg-white shadow-lg ring-0 transition-transform', 'data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0 dark:bg-slate-900') }) })));
|
|
1752
|
+
var { className } = _a, _b = _a.thumbProps, _c = _b === void 0 ? {} : _b, { className: thumbClassName } = _c, thumbProps = __rest(_c, ["className"]), props = __rest(_a, ["className", "thumbProps"]);
|
|
1753
|
+
return (jsx(SwitchPrimitives.Root, Object.assign({ className: cn('peer inline-flex h-[calc(1.5rem+6px)] w-[calc(3rem+6px)] shrink-0 cursor-pointer items-center rounded-full border-[3px] border-transparent', 'transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-600 focus-visible:ring-offset-2', 'focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=unchecked]:bg-slate-300', 'dark:focus-visible:ring-slate-200 dark:focus-visible:ring-offset-slate-800 dark:data-[state=checked]:bg-blue-700 dark:data-[state=unchecked]:bg-slate-700', className) }, props, { ref: ref, children: jsx(SwitchPrimitives.Thumb, Object.assign({ className: cn('pointer-events-none block h-6 w-6 rounded-full bg-white shadow-lg ring-0 transition-transform', 'data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0 dark:bg-slate-900', thumbClassName) }, thumbProps)) })));
|
|
1753
1754
|
});
|
|
1754
1755
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
1755
1756
|
|
|
@@ -1778,13 +1779,9 @@ const Tabs = Object.assign($Tabs, {
|
|
|
1778
1779
|
const ThemeSwitcher = ({ className }) => {
|
|
1779
1780
|
const { theme, toggleTheme } = useLayoutContext();
|
|
1780
1781
|
const darkMode = theme === 'dark';
|
|
1781
|
-
return (jsx(Switch
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
}, className), children: jsx("div", { className: cn('flex transform transition duration-200 ease-in-out', {
|
|
1785
|
-
'translate-x-6': darkMode,
|
|
1786
|
-
'translate-x-0': !darkMode,
|
|
1787
|
-
}), children: darkMode ? (jsx(MoonIcon, { className: "h-6 w-6 rounded-full bg-slate-800 p-1 text-white" })) : (jsx(SunIcon, { className: "h-6 w-6 rounded-full bg-slate-200 p-1 text-black" })) }) }));
|
|
1782
|
+
return (jsx(Switch, { className: className, checked: darkMode, onCheckedChange: toggleTheme, thumbProps: {
|
|
1783
|
+
children: darkMode ? (jsx(MoonIcon, { className: "h-6 w-6 rounded-full bg-slate-900 p-1 text-white" })) : (jsx(SunIcon, { className: "h-6 w-6 rounded-full bg-white p-1 text-black" })),
|
|
1784
|
+
} }));
|
|
1788
1785
|
};
|
|
1789
1786
|
|
|
1790
1787
|
export { Badge, BasicInput, BasicInputExtension, Block, Button, Card, CheckboxInput, ConfirmDialog, DataTable, DateTimeInput, Dialog, DropdownMenu, EmailInput, Flex, FormDialog, FormGroup, FormInputs, Hint, Label, Layout, LayoutContext, LayoutContextProvider, List, ListSorter, ListSorterDialog, Navbar, NumberInput, Pagination, PasswordInput, PdfViewerDialog, Popover, SIDEBAR_KEY, SelectInput, Sidebar, Spinner, Switch, THEME_KEY, Table, Tabs, TextInput, TextareaInput, ThemeSwitcher, Tooltip, cn, compareDates, generalComparator, getDisplayDate, isEmpty, mergeRefs, resolveTargetObject, useDays, useLayoutContext, useLongPress, useMonths, useOnSwipe, useOutsideClick, usePagination };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tw-react-components",
|
|
3
3
|
"description": "A set of React components build with TailwindCSS to make a nice dashboard.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.134",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://bacali95.github.io/tw-react-components",
|
|
7
7
|
"author": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
21
|
"module": "./index.esm.js",
|
|
22
|
+
"types": "./index.esm.d.ts",
|
|
22
23
|
"import": "./index.cjs.mjs",
|
|
23
24
|
"default": "./index.cjs.js"
|
|
24
25
|
},
|
|
@@ -28,5 +29,6 @@
|
|
|
28
29
|
"./package.json": "./package.json"
|
|
29
30
|
},
|
|
30
31
|
"module": "./index.esm.js",
|
|
31
|
-
"main": "./index.cjs.js"
|
|
32
|
-
|
|
32
|
+
"main": "./index.cjs.js",
|
|
33
|
+
"types": "./index.esm.d.ts"
|
|
34
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonProps, ButtonVariant } from '../Button';
|
|
3
2
|
export type BadgeVariant = Exclude<ButtonVariant, 'text'>;
|
|
4
3
|
export type BadgeProps = Omit<ButtonProps, 'variant'> & {
|
|
5
4
|
variant?: BadgeVariant;
|
|
6
5
|
};
|
|
7
6
|
export declare const Badge: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "variant"> & {
|
|
8
|
-
variant?: BadgeVariant
|
|
7
|
+
variant?: BadgeVariant;
|
|
9
8
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -7,9 +7,9 @@ export type BlockProps = PropsWithoutRef<ComponentProps<'div'> & {
|
|
|
7
7
|
fullHeight?: boolean;
|
|
8
8
|
}>;
|
|
9
9
|
export declare const Block: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
10
|
-
className?: string
|
|
11
|
-
centered?: boolean
|
|
12
|
-
container?: boolean
|
|
13
|
-
fullWidth?: boolean
|
|
14
|
-
fullHeight?: boolean
|
|
10
|
+
className?: string;
|
|
11
|
+
centered?: boolean;
|
|
12
|
+
container?: boolean;
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
fullHeight?: boolean;
|
|
15
15
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -11,10 +11,10 @@ export type ButtonProps = PropsWithoutRef<ComponentProps<'button'>> & {
|
|
|
11
11
|
suffixIcon?: LucideIcon;
|
|
12
12
|
};
|
|
13
13
|
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
14
|
-
size?: Size
|
|
15
|
-
color?: Color
|
|
16
|
-
variant?: ButtonVariant
|
|
17
|
-
rounded?: boolean
|
|
18
|
-
prefixIcon?: LucideIcon
|
|
19
|
-
suffixIcon?: LucideIcon
|
|
14
|
+
size?: Size;
|
|
15
|
+
color?: Color;
|
|
16
|
+
variant?: ButtonVariant;
|
|
17
|
+
rounded?: boolean;
|
|
18
|
+
prefixIcon?: LucideIcon;
|
|
19
|
+
suffixIcon?: LucideIcon;
|
|
20
20
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const Card: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
3
|
-
className?: string
|
|
4
|
-
centered?: boolean
|
|
5
|
-
container?: boolean
|
|
6
|
-
fullWidth?: boolean
|
|
7
|
-
fullHeight?: boolean
|
|
2
|
+
className?: string;
|
|
3
|
+
centered?: boolean;
|
|
4
|
+
container?: boolean;
|
|
5
|
+
fullWidth?: boolean;
|
|
6
|
+
fullHeight?: boolean;
|
|
8
7
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -6,7 +6,7 @@ export declare const Dialog: import("react").FC<DialogPrimitive.DialogProps> & {
|
|
|
6
6
|
Close: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
Trigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
Content: import("react").ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
|
-
fullScreen?: boolean
|
|
9
|
+
fullScreen?: boolean;
|
|
10
10
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
11
|
Header: {
|
|
12
12
|
({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,16 +4,16 @@ export declare const DropdownMenu: import("react").FC<DropdownMenuPrimitive.Drop
|
|
|
4
4
|
Trigger: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
Content: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
6
|
Item: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
7
|
-
inset?: boolean
|
|
7
|
+
inset?: boolean;
|
|
8
8
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
9
|
CheckboxItem: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
10
|
RadioItem: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
11
|
Label: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
12
|
-
inset?: boolean
|
|
12
|
+
inset?: boolean;
|
|
13
13
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
14
|
Separator: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
15
|
Icon: import("react").ForwardRefExoticComponent<{
|
|
16
|
-
className?: string
|
|
16
|
+
className?: string;
|
|
17
17
|
icon: import("lucide-react").LucideIcon;
|
|
18
18
|
} & import("react").RefAttributes<SVGSVGElement>>;
|
|
19
19
|
Shortcut: {
|
|
@@ -25,7 +25,7 @@ export declare const DropdownMenu: import("react").FC<DropdownMenuPrimitive.Drop
|
|
|
25
25
|
Sub: import("react").FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
26
26
|
SubContent: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
27
|
SubTrigger: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
28
|
-
inset?: boolean
|
|
28
|
+
inset?: boolean;
|
|
29
29
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
30
|
RadioGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
31
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BlockProps } from '../Block';
|
|
3
2
|
type Direction = 'row' | 'column';
|
|
4
3
|
type Position = 'start' | 'center' | 'end';
|
|
@@ -10,16 +9,16 @@ export type FlexProps = BlockProps & {
|
|
|
10
9
|
justify?: Position | 'between';
|
|
11
10
|
};
|
|
12
11
|
export declare const Flex: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
13
|
-
className?: string
|
|
14
|
-
centered?: boolean
|
|
15
|
-
container?: boolean
|
|
16
|
-
fullWidth?: boolean
|
|
17
|
-
fullHeight?: boolean
|
|
12
|
+
className?: string;
|
|
13
|
+
centered?: boolean;
|
|
14
|
+
container?: boolean;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
fullHeight?: boolean;
|
|
18
17
|
}, "ref"> & {
|
|
19
|
-
reverse?: boolean
|
|
20
|
-
wrap?: boolean
|
|
21
|
-
direction?: Direction
|
|
22
|
-
align?: Position
|
|
23
|
-
justify?: Position | "between"
|
|
18
|
+
reverse?: boolean;
|
|
19
|
+
wrap?: boolean;
|
|
20
|
+
direction?: Direction;
|
|
21
|
+
align?: Position;
|
|
22
|
+
justify?: Position | "between";
|
|
24
23
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
24
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BasicInputProps } from '../../primitive';
|
|
3
2
|
export type DateTimeInputType = 'date' | 'time' | 'datetime-local';
|
|
4
3
|
export type DateTimeInputProps = {
|
|
@@ -14,14 +13,14 @@ export type DateTimeInputProps = {
|
|
|
14
13
|
onChange?: (date?: Date | null) => void;
|
|
15
14
|
} & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'label' | 'name' | 'description' | 'placeholder' | 'required' | 'disabled' | 'onBlur' | 'size' | 'readOnly'>;
|
|
16
15
|
export declare const DateTimeInput: import("react").ForwardRefExoticComponent<{
|
|
17
|
-
value?: string | Date | null
|
|
18
|
-
type?: DateTimeInputType
|
|
19
|
-
hasErrors?: boolean
|
|
20
|
-
clearable?: boolean
|
|
21
|
-
step?: number
|
|
22
|
-
minDate?: Date
|
|
23
|
-
maxDate?: Date
|
|
24
|
-
displayFormat?: string
|
|
25
|
-
displayLocale?: string
|
|
26
|
-
onChange?: (
|
|
16
|
+
value?: string | Date | null;
|
|
17
|
+
type?: DateTimeInputType;
|
|
18
|
+
hasErrors?: boolean;
|
|
19
|
+
clearable?: boolean;
|
|
20
|
+
step?: number;
|
|
21
|
+
minDate?: Date;
|
|
22
|
+
maxDate?: Date;
|
|
23
|
+
displayFormat?: string;
|
|
24
|
+
displayLocale?: string;
|
|
25
|
+
onChange?: (date?: Date | null) => void;
|
|
27
26
|
} & Pick<BasicInputProps<"text">, "size" | "label" | "disabled" | "name" | "placeholder" | "readOnly" | "required" | "className" | "onBlur" | "inputClassName" | "extensionClassName" | "description"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -16,17 +16,17 @@ export type BasicInputProps<Type extends InputType> = {
|
|
|
16
16
|
onSuffixIconClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
17
17
|
} & Omit<Type extends 'textarea' ? ComponentProps<'textarea'> : ComponentProps<'input'>, 'id' | 'ref' | 'size'>;
|
|
18
18
|
export declare const BasicInput: import("react").ForwardRefExoticComponent<{
|
|
19
|
-
inputClassName?: string
|
|
20
|
-
extensionClassName?: string
|
|
19
|
+
inputClassName?: string;
|
|
20
|
+
extensionClassName?: string;
|
|
21
21
|
type?: InputType;
|
|
22
|
-
label?: string
|
|
22
|
+
label?: string;
|
|
23
23
|
description?: ReactNode;
|
|
24
|
-
size?: Size
|
|
25
|
-
hasErrors?: boolean
|
|
26
|
-
clearable?: boolean
|
|
27
|
-
suffixIcon?: LucideIcon
|
|
28
|
-
onClear?: (
|
|
29
|
-
onSuffixIconClick?: (
|
|
24
|
+
size?: Size;
|
|
25
|
+
hasErrors?: boolean;
|
|
26
|
+
clearable?: boolean;
|
|
27
|
+
suffixIcon?: LucideIcon;
|
|
28
|
+
onClear?: () => void;
|
|
29
|
+
onSuffixIconClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
30
30
|
} & Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> | import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "id" | "ref" | "size"> & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
31
31
|
export declare const BasicInputExtension: FC<PropsWithChildren<{
|
|
32
32
|
className?: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BasicInputProps } from './BasicInput';
|
|
3
2
|
export type CheckboxInputProps = Omit<BasicInputProps<'checkbox'>, 'type'>;
|
|
4
3
|
export declare const CheckboxInput: import("react").ForwardRefExoticComponent<CheckboxInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BasicInputProps } from './BasicInput';
|
|
3
2
|
export type EmailInputProps = Omit<BasicInputProps<'email'>, 'type'>;
|
|
4
3
|
export declare const EmailInput: import("react").ForwardRefExoticComponent<EmailInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BasicInputProps } from './BasicInput';
|
|
3
2
|
export type NumberInputProps = Omit<BasicInputProps<'number'>, 'type'>;
|
|
4
3
|
export declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BasicInputProps } from './BasicInput';
|
|
3
2
|
export type PasswordInputProps = Omit<BasicInputProps<'number'>, 'type'>;
|
|
4
3
|
export declare const PasswordInput: import("react").ForwardRefExoticComponent<PasswordInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BasicInputProps } from './BasicInput';
|
|
3
2
|
export type TextInputProps = Omit<BasicInputProps<'text'>, 'type'>;
|
|
4
3
|
export declare const TextInput: import("react").ForwardRefExoticComponent<TextInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BasicInputProps } from './BasicInput';
|
|
3
2
|
export type TextareaInputProps = Omit<BasicInputProps<'textarea'>, 'type'>;
|
|
4
3
|
export declare const TextareaInput: import("react").ForwardRefExoticComponent<TextareaInputProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -10,42 +10,42 @@ export type WithFormProps<Type extends InputType | SelectInputType, Props = Type
|
|
|
10
10
|
export declare const FormInputs: {
|
|
11
11
|
Text: ForwardRefExoticComponent<{
|
|
12
12
|
name: string;
|
|
13
|
-
pattern?: RegExp
|
|
13
|
+
pattern?: RegExp;
|
|
14
14
|
validate?: Validate<string, any> | undefined;
|
|
15
15
|
} & Omit<TextInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
16
16
|
Email: ForwardRefExoticComponent<{
|
|
17
17
|
name: string;
|
|
18
|
-
pattern?: RegExp
|
|
18
|
+
pattern?: RegExp;
|
|
19
19
|
validate?: Validate<string, any> | undefined;
|
|
20
20
|
} & Omit<EmailInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
21
21
|
Password: ForwardRefExoticComponent<{
|
|
22
22
|
name: string;
|
|
23
|
-
pattern?: RegExp
|
|
23
|
+
pattern?: RegExp;
|
|
24
24
|
validate?: Validate<string, any> | undefined;
|
|
25
25
|
} & Omit<PasswordInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
26
26
|
Textarea: ForwardRefExoticComponent<{
|
|
27
27
|
name: string;
|
|
28
|
-
pattern?: RegExp
|
|
28
|
+
pattern?: RegExp;
|
|
29
29
|
validate?: Validate<string, any> | undefined;
|
|
30
30
|
} & Omit<TextareaInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
31
31
|
Number: ForwardRefExoticComponent<{
|
|
32
32
|
name: string;
|
|
33
|
-
pattern?: RegExp
|
|
33
|
+
pattern?: RegExp;
|
|
34
34
|
validate?: Validate<number, any> | undefined;
|
|
35
35
|
} & Omit<NumberInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
36
36
|
Checkbox: ForwardRefExoticComponent<{
|
|
37
37
|
name: string;
|
|
38
|
-
pattern?: RegExp
|
|
38
|
+
pattern?: RegExp;
|
|
39
39
|
validate?: Validate<string, any> | undefined;
|
|
40
40
|
} & Omit<CheckboxInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
41
41
|
DateTime: ForwardRefExoticComponent<{
|
|
42
42
|
name: string;
|
|
43
|
-
pattern?: RegExp
|
|
43
|
+
pattern?: RegExp;
|
|
44
44
|
validate?: Validate<Date, any> | undefined;
|
|
45
45
|
} & Omit<DateTimeInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
46
|
Select: ForwardRefExoticComponent<{
|
|
47
47
|
name: string;
|
|
48
|
-
pattern?: RegExp
|
|
48
|
+
pattern?: RegExp;
|
|
49
49
|
validate?: Validate<any, any> | undefined;
|
|
50
50
|
} & Omit<SelectInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
51
51
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BadgeProps, BadgeVariant } from '../Badge';
|
|
3
2
|
import { Color, Size } from '../types';
|
|
4
3
|
export type HintPlacement = 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
|
|
@@ -13,12 +12,12 @@ export type HintBadgeProps = BadgeProps & {
|
|
|
13
12
|
placement?: HintPlacement;
|
|
14
13
|
};
|
|
15
14
|
export declare const Hint: import("react").ForwardRefExoticComponent<{
|
|
16
|
-
children?: import("react").ReactNode;
|
|
15
|
+
children?: import("react").ReactNode | undefined;
|
|
17
16
|
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
18
17
|
Dot: import("react").ForwardRefExoticComponent<HintDotProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
18
|
Badge: import("react").ForwardRefExoticComponent<Omit<import("..").ButtonProps, "variant"> & {
|
|
20
|
-
variant?: BadgeVariant
|
|
19
|
+
variant?: BadgeVariant;
|
|
21
20
|
} & {
|
|
22
|
-
placement?: HintPlacement
|
|
21
|
+
placement?: HintPlacement;
|
|
23
22
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
24
23
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { LucideIcon } from 'lucide-react';
|
|
3
2
|
import { Size } from '../types';
|
|
4
3
|
export declare const List: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
5
4
|
Item: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
-
size?: Size
|
|
7
|
-
inset?: boolean
|
|
5
|
+
size?: Size;
|
|
6
|
+
inset?: boolean;
|
|
8
7
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
8
|
Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
-
size?: Size
|
|
11
|
-
inset?: boolean
|
|
9
|
+
size?: Size;
|
|
10
|
+
inset?: boolean;
|
|
12
11
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
12
|
Indicator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
13
|
icon: LucideIcon;
|
|
15
14
|
iconClassName: string;
|
|
16
15
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
16
|
Icon: import("react").ForwardRefExoticComponent<{
|
|
18
|
-
className?: string
|
|
17
|
+
className?: string;
|
|
19
18
|
icon: LucideIcon;
|
|
20
19
|
} & import("react").RefAttributes<SVGSVGElement>>;
|
|
21
20
|
Separator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
2
|
export declare const Popover: import("react").FC<PopoverPrimitive.PopoverProps> & {
|
|
4
3
|
Trigger: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
4
|
Content: import("react").ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
6
|
-
container?: HTMLElement | null
|
|
5
|
+
container?: HTMLElement | null;
|
|
7
6
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
7
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
|
-
|
|
2
|
+
import { ComponentProps, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
export type SwitchProps = ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & {
|
|
4
|
+
thumbProps?: ComponentProps<typeof SwitchPrimitives.Thumb>;
|
|
5
|
+
};
|
|
6
|
+
declare const Switch: import("react").ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
7
|
+
thumbProps?: ComponentProps<typeof SwitchPrimitives.Thumb>;
|
|
8
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
9
|
export { Switch };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
2
|
export declare const Tabs: import("react").ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
3
|
List: import("react").ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|