@companix/uikit 0.0.17 → 0.0.19
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/dist/Input/Input.d.ts +1 -1
- package/dist/Input/InputElement.d.ts +3 -1
- package/dist/NumberInput/index.d.ts +22 -5
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/bundle.es.js +41 -40
- package/dist/bundle.es11.js +55 -30
- package/dist/bundle.es16.js +37 -13
- package/dist/bundle.es37.js +1 -1
- package/dist/index.d.ts +4 -2
- package/package.json +3 -2
- package/dist/Stepper/StepperInput.scss +0 -35
- package/dist/Stepper/index.d.ts +0 -8
- package/dist/__hooks/use-stepper-input.d.ts +0 -13
package/dist/Input/Input.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputContainerProps } from './InputContainer';
|
|
2
2
|
export interface InputProps extends Omit<InputContainerProps, 'inputRef' | 'children'> {
|
|
3
3
|
placeholder?: string;
|
|
4
|
-
value?: string
|
|
4
|
+
value?: string;
|
|
5
5
|
readOnly?: boolean;
|
|
6
6
|
onValueChange?: (value: string, targetElement: HTMLInputElement) => void;
|
|
7
7
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children'> {
|
|
1
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children' | 'value' | 'defaultValue'> {
|
|
2
|
+
defaultValue?: string;
|
|
3
|
+
value?: string;
|
|
2
4
|
mask?: string;
|
|
3
5
|
maskChar?: string;
|
|
4
6
|
onValueChange?: (value: string, targetElement: HTMLInputElement) => void;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { InputContainerProps } from '../Input/InputContainer';
|
|
2
|
+
export interface ReactNumberFormatParams {
|
|
3
|
+
thousandSeparator?: boolean | string;
|
|
4
|
+
decimalSeparator?: string;
|
|
5
|
+
allowedDecimalSeparators?: Array<string>;
|
|
6
|
+
thousandsGroupStyle?: 'thousand' | 'lakh' | 'wan' | 'none';
|
|
7
|
+
decimalScale?: number;
|
|
8
|
+
fixedDecimalScale?: boolean;
|
|
9
|
+
allowNegative?: boolean;
|
|
10
|
+
allowLeadingZeros?: boolean;
|
|
11
|
+
suffix?: string;
|
|
12
|
+
prefix?: string;
|
|
5
13
|
}
|
|
6
|
-
export
|
|
14
|
+
export interface NumberInputProps extends Omit<InputContainerProps, 'inputRef' | 'children'>, ReactNumberFormatParams {
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
value?: number | null;
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
onValueChange?: (value: number | null) => void;
|
|
19
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
20
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
21
|
+
inputClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const NumberInput: import('react').ForwardRefExoticComponent<NumberInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
package/dist/Radio/index.d.ts
CHANGED
package/dist/Select/index.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ type SelectProps<T> = Omit<SelectFormProps, 'value' | 'onChange' | 'closeButton'
|
|
|
20
20
|
scrollTo: (index: number) => void;
|
|
21
21
|
}>;
|
|
22
22
|
};
|
|
23
|
-
export declare const Select: <T
|
|
23
|
+
export declare const Select: <T>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export {};
|
package/dist/bundle.es.js
CHANGED
|
@@ -2,63 +2,64 @@ import { Button as e } from "./bundle.es2.js";
|
|
|
2
2
|
import { Spinner as p } from "./bundle.es3.js";
|
|
3
3
|
import { Scrollable as x } from "./bundle.es4.js";
|
|
4
4
|
import { ImitateScroll as a } from "./bundle.es5.js";
|
|
5
|
-
import { Popover as
|
|
6
|
-
import { Tooltip as
|
|
5
|
+
import { Popover as l } from "./bundle.es6.js";
|
|
6
|
+
import { Tooltip as u } from "./bundle.es7.js";
|
|
7
7
|
import { Select as S } from "./bundle.es8.js";
|
|
8
8
|
import { Input as T } from "./bundle.es9.js";
|
|
9
9
|
import { OptionItem as D } from "./bundle.es10.js";
|
|
10
10
|
import { NumberInput as b } from "./bundle.es11.js";
|
|
11
|
-
import { OptionsList as
|
|
11
|
+
import { OptionsList as A } from "./bundle.es12.js";
|
|
12
12
|
import { ButtonGroup as w } from "./bundle.es13.js";
|
|
13
|
-
import { Checkbox as
|
|
14
|
-
import { Switch as
|
|
15
|
-
import { Radio as v } from "./bundle.es16.js";
|
|
13
|
+
import { Checkbox as G } from "./bundle.es14.js";
|
|
14
|
+
import { Switch as O } from "./bundle.es15.js";
|
|
15
|
+
import { Radio as h, RadioGroup as v } from "./bundle.es16.js";
|
|
16
16
|
import { Drawer as F } from "./bundle.es17.js";
|
|
17
17
|
import { Dialog as y } from "./bundle.es18.js";
|
|
18
|
-
import { AlertDialog as
|
|
19
|
-
import { LoadButton as
|
|
20
|
-
import { Tabs as
|
|
21
|
-
import { Countdown as
|
|
22
|
-
import { TextArea as
|
|
23
|
-
import { SelectTags as
|
|
24
|
-
import { DatePicker as
|
|
25
|
-
import { DateInput as
|
|
26
|
-
import { FileOverlay as
|
|
27
|
-
import { FormGroup as
|
|
28
|
-
import { TimePicker as
|
|
29
|
-
import { useLocalStorage as
|
|
30
|
-
import { createAlertAgent as
|
|
31
|
-
import { createToaster as
|
|
18
|
+
import { AlertDialog as j } from "./bundle.es19.js";
|
|
19
|
+
import { LoadButton as z } from "./bundle.es20.js";
|
|
20
|
+
import { Tabs as H } from "./bundle.es21.js";
|
|
21
|
+
import { Countdown as K } from "./bundle.es22.js";
|
|
22
|
+
import { TextArea as Q } from "./bundle.es23.js";
|
|
23
|
+
import { SelectTags as V } from "./bundle.es24.js";
|
|
24
|
+
import { DatePicker as X } from "./bundle.es25.js";
|
|
25
|
+
import { DateInput as Z } from "./bundle.es26.js";
|
|
26
|
+
import { FileOverlay as $ } from "./bundle.es27.js";
|
|
27
|
+
import { FormGroup as ro } from "./bundle.es28.js";
|
|
28
|
+
import { TimePicker as to } from "./bundle.es29.js";
|
|
29
|
+
import { useLocalStorage as mo } from "./bundle.es30.js";
|
|
30
|
+
import { createAlertAgent as fo } from "./bundle.es31.js";
|
|
31
|
+
import { createToaster as io } from "./bundle.es32.js";
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
j as AlertDialog,
|
|
34
34
|
e as Button,
|
|
35
35
|
w as ButtonGroup,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
G as Checkbox,
|
|
37
|
+
K as Countdown,
|
|
38
|
+
Z as DateInput,
|
|
39
|
+
X as DatePicker,
|
|
40
40
|
y as Dialog,
|
|
41
41
|
F as Drawer,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
$ as FileOverlay,
|
|
43
|
+
ro as FormGroup,
|
|
44
44
|
a as ImitateScroll,
|
|
45
45
|
T as Input,
|
|
46
|
-
|
|
46
|
+
z as LoadButton,
|
|
47
47
|
b as NumberInput,
|
|
48
48
|
D as OptionItem,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
A as OptionsList,
|
|
50
|
+
l as Popover,
|
|
51
|
+
h as Radio,
|
|
52
|
+
v as RadioGroup,
|
|
52
53
|
x as Scrollable,
|
|
53
54
|
S as Select,
|
|
54
|
-
|
|
55
|
+
V as SelectTags,
|
|
55
56
|
p as Spinner,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
O as Switch,
|
|
58
|
+
H as Tabs,
|
|
59
|
+
Q as TextArea,
|
|
60
|
+
to as TimePicker,
|
|
61
|
+
u as Tooltip,
|
|
62
|
+
fo as createAlertAgent,
|
|
63
|
+
io as createToaster,
|
|
64
|
+
mo as useLocalStorage
|
|
64
65
|
};
|
package/dist/bundle.es11.js
CHANGED
|
@@ -1,33 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import C from "classnames";
|
|
3
|
+
import { forwardRef as j, useRef as w } from "react";
|
|
4
|
+
import { mergeRefs as y } from "react-merge-refs";
|
|
5
|
+
import { InputContainer as F } from "./bundle.es38.js";
|
|
6
|
+
import { NumericFormat as V } from "react-number-format";
|
|
7
|
+
const D = j(
|
|
8
|
+
({
|
|
9
|
+
onChange: m,
|
|
10
|
+
onValueChange: o,
|
|
11
|
+
readOnly: i,
|
|
12
|
+
inputClassName: f,
|
|
13
|
+
value: n,
|
|
14
|
+
placeholder: u,
|
|
15
|
+
thousandSeparator: p,
|
|
16
|
+
decimalSeparator: a,
|
|
17
|
+
allowedDecimalSeparators: l,
|
|
18
|
+
thousandsGroupStyle: d,
|
|
19
|
+
decimalScale: s,
|
|
20
|
+
fixedDecimalScale: b,
|
|
21
|
+
allowNegative: R,
|
|
22
|
+
allowLeadingZeros: c,
|
|
23
|
+
suffix: g,
|
|
24
|
+
prefix: x,
|
|
25
|
+
inputRef: I,
|
|
26
|
+
...e
|
|
27
|
+
}, N) => {
|
|
28
|
+
const r = w(null);
|
|
29
|
+
return /* @__PURE__ */ t(F, { ref: N, inputRef: r, ...e, children: /* @__PURE__ */ t(
|
|
30
|
+
V,
|
|
31
|
+
{
|
|
32
|
+
type: "text",
|
|
33
|
+
getInputRef: y([r, I]),
|
|
34
|
+
className: C("form-input form-input-base", f),
|
|
35
|
+
"aria-disabled": e.disabled,
|
|
36
|
+
onChange: m,
|
|
37
|
+
onValueChange: ({ floatValue: h }) => o?.(h ?? null),
|
|
38
|
+
value: n,
|
|
39
|
+
placeholder: u,
|
|
40
|
+
disabled: e.disabled,
|
|
41
|
+
readOnly: i,
|
|
42
|
+
thousandSeparator: p,
|
|
43
|
+
decimalSeparator: a,
|
|
44
|
+
allowedDecimalSeparators: l,
|
|
45
|
+
thousandsGroupStyle: d,
|
|
46
|
+
decimalScale: s,
|
|
47
|
+
fixedDecimalScale: b,
|
|
48
|
+
allowNegative: R,
|
|
49
|
+
allowLeadingZeros: c,
|
|
50
|
+
suffix: g,
|
|
51
|
+
prefix: x
|
|
20
52
|
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const u = [...r], e = [...r];
|
|
25
|
-
if (e.every((t) => t === "0"))
|
|
26
|
-
return "0";
|
|
27
|
-
for (let t = 0; t < e.length && e[t] === "0"; t++)
|
|
28
|
-
e[t] === "0" && e[t + 1] !== "." && u.shift();
|
|
29
|
-
return u.join("");
|
|
30
|
-
};
|
|
53
|
+
) });
|
|
54
|
+
}
|
|
55
|
+
);
|
|
31
56
|
export {
|
|
32
|
-
|
|
57
|
+
D as NumberInput
|
|
33
58
|
};
|
package/dist/bundle.es16.js
CHANGED
|
@@ -1,23 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import * as
|
|
4
|
-
import { attr as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useId as p } from "react";
|
|
3
|
+
import * as l from "@radix-ui/react-radio-group";
|
|
4
|
+
import { attr as s } from "@companix/utils-browser";
|
|
5
|
+
const q = (t) => {
|
|
6
|
+
const { options: m, value: a, onChange: r, disabled: d, required: e, size: n } = t;
|
|
7
|
+
return /* @__PURE__ */ o(
|
|
8
|
+
l.Root,
|
|
9
|
+
{
|
|
10
|
+
className: "radio-group",
|
|
11
|
+
disabled: d,
|
|
12
|
+
"data-required": s(e && !a),
|
|
13
|
+
"data-v": a,
|
|
14
|
+
value: a,
|
|
15
|
+
onValueChange: (i) => r(i),
|
|
16
|
+
children: m.map((i, c) => /* @__PURE__ */ o(
|
|
17
|
+
h,
|
|
18
|
+
{
|
|
19
|
+
...i,
|
|
20
|
+
size: n,
|
|
21
|
+
disabled: d,
|
|
22
|
+
required: e && !a
|
|
23
|
+
},
|
|
24
|
+
`radio-${i.value}-${c}`
|
|
25
|
+
))
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}, h = ({ value: t, label: m, size: a = "md", disabled: r, required: d }) => {
|
|
29
|
+
const e = p();
|
|
30
|
+
return /* @__PURE__ */ u(
|
|
8
31
|
"span",
|
|
9
32
|
{
|
|
10
33
|
className: "radio",
|
|
11
|
-
"data-disabled":
|
|
12
|
-
"data-size":
|
|
13
|
-
"data-required":
|
|
34
|
+
"data-disabled": s(r),
|
|
35
|
+
"data-size": a,
|
|
36
|
+
"data-required": s(d),
|
|
14
37
|
children: [
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ o(l.Item, { className: "radio-box", value: t, disabled: r, id: e, children: /* @__PURE__ */ o(l.Indicator, { className: "radio-mark" }) }),
|
|
39
|
+
/* @__PURE__ */ o("label", { className: "radio-label", htmlFor: e, "data-disabled": s(r), children: m })
|
|
17
40
|
]
|
|
18
41
|
}
|
|
19
42
|
);
|
|
20
43
|
};
|
|
21
44
|
export {
|
|
22
|
-
h as Radio
|
|
45
|
+
h as Radio,
|
|
46
|
+
q as RadioGroup
|
|
23
47
|
};
|
package/dist/bundle.es37.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as m, useCallback as i } from "react";
|
|
3
3
|
import c from "react-input-mask";
|
|
4
4
|
const I = m(
|
|
5
|
-
({ mask: r, maskChar: f, onChange: n, onValueChange: o, ...a }, e) => {
|
|
5
|
+
({ mask: r, maskChar: f = "_", onChange: n, onValueChange: o, ...a }, e) => {
|
|
6
6
|
const p = i(
|
|
7
7
|
(t) => {
|
|
8
8
|
n?.(t), o?.(t.target.value, t.target);
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { OptionsList } from './OptionItem/OptionsList';
|
|
|
12
12
|
export { ButtonGroup } from './ButtonGroup';
|
|
13
13
|
export { Checkbox } from './Checkbox';
|
|
14
14
|
export { Switch } from './Switch';
|
|
15
|
-
export { Radio } from './Radio';
|
|
15
|
+
export { Radio, RadioGroup } from './Radio';
|
|
16
16
|
export { Drawer } from './Drawer';
|
|
17
17
|
export { Dialog } from './Dialog';
|
|
18
18
|
export { AlertDialog } from './DialogAlert/Alert';
|
|
@@ -26,8 +26,10 @@ export { DateInput } from './DateInput';
|
|
|
26
26
|
export { FileOverlay } from './File';
|
|
27
27
|
export { FormGroup } from './FormGroup';
|
|
28
28
|
export { TimePicker } from './TimePicker';
|
|
29
|
-
export
|
|
29
|
+
export { useLocalStorage } from './__hooks/use-local-storage';
|
|
30
30
|
export { createAlertAgent } from './DialogAlert';
|
|
31
31
|
export { createToaster } from './Toaster';
|
|
32
32
|
export * from './types';
|
|
33
33
|
export type { Appearance } from './Button';
|
|
34
|
+
export type { RadioOption } from './Radio';
|
|
35
|
+
export type { NumberInputProps, ReactNumberFormatParams } from './NumberInput';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companix/uikit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"module": "./dist/bundle.es.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
38
38
|
"classnames": "^2.5.1",
|
|
39
39
|
"react-input-mask": "^2.0.4",
|
|
40
|
-
"react-merge-refs": "^3.0.2"
|
|
40
|
+
"react-merge-refs": "^3.0.2",
|
|
41
|
+
"react-number-format": "^5.4.4"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@blueprintjs/core": "^6.2.1",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
.number-input-container {
|
|
2
|
-
display: flex;
|
|
3
|
-
gap: 4px;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.number-stepper {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
height: 30px;
|
|
10
|
-
min-height: 30px;
|
|
11
|
-
line-height: 30px;
|
|
12
|
-
border: 1px solid var(--border-color);
|
|
13
|
-
box-shadow: 0 1px 2px rgb(0 0 0 / 47%);
|
|
14
|
-
border-radius: 4px;
|
|
15
|
-
|
|
16
|
-
&-splitter {
|
|
17
|
-
height: 1px;
|
|
18
|
-
background-color: var(--border-color);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&-slot {
|
|
22
|
-
border-radius: 0px;
|
|
23
|
-
height: 13.5px;
|
|
24
|
-
|
|
25
|
-
&[data-slot='decrement'] {
|
|
26
|
-
border-bottom-left-radius: 3px;
|
|
27
|
-
border-bottom-right-radius: 3px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&[data-slot='increment'] {
|
|
31
|
-
border-top-left-radius: 3px;
|
|
32
|
-
border-top-right-radius: 3px;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
package/dist/Stepper/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { StepperInputOptions } from '../__hooks/use-stepper-input';
|
|
2
|
-
interface StepperInputProps extends StepperInputOptions {
|
|
3
|
-
buttons?: boolean;
|
|
4
|
-
placeholder?: string;
|
|
5
|
-
inputStyle?: React.CSSProperties;
|
|
6
|
-
}
|
|
7
|
-
export declare const StepperInput: ({ inputStyle, placeholder, buttons, ...options }: StepperInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface StepperInputOptions {
|
|
2
|
-
value: number;
|
|
3
|
-
onChange: (value: number) => void;
|
|
4
|
-
step: number;
|
|
5
|
-
minValue?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const useStepperInput: ({ minValue, value, onChange, step }: StepperInputOptions) => {
|
|
8
|
-
inputRef: import('react').RefObject<HTMLInputElement>;
|
|
9
|
-
value: string;
|
|
10
|
-
increment: () => void;
|
|
11
|
-
decrement: () => void;
|
|
12
|
-
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
-
};
|