@vnejs/uis.react.button-controls 0.1.7 → 0.1.9
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/ButtonControls.d.ts.map +1 -1
- package/dist/ButtonControls.js +2 -1
- package/dist/ButtonControls.js.map +1 -1
- package/dist/ButtonControls.types.d.ts +14 -13
- package/dist/ButtonControls.types.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/ButtonControls.stories.tsx +2 -2
- package/src/ButtonControls.tsx +3 -1
- package/src/ButtonControls.types.tsx +15 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonControls.d.ts","sourceRoot":"","sources":["../src/ButtonControls.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ButtonControls.d.ts","sourceRoot":"","sources":["../src/ButtonControls.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,eAAO,MAAM,cAAc,GAAI,gJAU5B,mBAAmB,4CAoBrB,CAAC"}
|
package/dist/ButtonControls.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button
|
|
2
|
+
import { Button } from "@vnejs/uis.react.button";
|
|
3
|
+
import { Flex } from "@vnejs/uis.react.flex";
|
|
3
4
|
export const ButtonControls = ({ buttons = [], activeIndex = -1, buttonIsRounded = true, buttonBorderWidth = 6, buttonPaddingVertical = 12, buttonPaddingHorizontal = 60, flexGap = 24, flexProps = {}, buttonProps = {}, }) => {
|
|
4
5
|
return (_jsx(Flex, { gap: flexGap, ...flexProps, children: buttons.map((buttonInfo, i) => (_jsx(Button, { isRounded: buttonIsRounded, borderWidth: buttonBorderWidth, paddingVertical: buttonPaddingVertical, paddingHorizontal: buttonPaddingHorizontal, ...buttonInfo, ...buttonProps, isActive: activeIndex === i }, i))) }));
|
|
5
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonControls.js","sourceRoot":"","sources":["../src/ButtonControls.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ButtonControls.js","sourceRoot":"","sources":["../src/ButtonControls.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAI7C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,OAAO,GAAG,EAAE,EACZ,WAAW,GAAG,CAAC,CAAC,EAChB,eAAe,GAAG,IAAI,EACtB,iBAAiB,GAAG,CAAC,EACrB,qBAAqB,GAAG,EAAE,EAC1B,uBAAuB,GAAG,EAAE,EAC5B,OAAO,GAAG,EAAE,EACZ,SAAS,GAAG,EAAE,EACd,WAAW,GAAG,EAAE,GACI,EAAE,EAAE;IACxB,OAAO,CACL,KAAC,IAAI,IACH,GAAG,EAAE,OAAO,KACR,SAAS,YAEZ,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC,CAC9B,KAAC,MAAM,IAEL,SAAS,EAAE,eAAe,EAC1B,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,qBAAqB,EACtC,iBAAiB,EAAE,uBAAuB,KACtC,UAAU,KACV,WAAW,EACf,QAAQ,EAAE,WAAW,KAAK,CAAC,IAPtB,CAAC,CAQN,CACH,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import type { CssInsertInnerText, CssInsertValueLength, CssInsertValueNumber, CssInsertValueString } from "@vnejs/uis.utils";
|
|
1
2
|
export type ButtonControlItem = {
|
|
2
|
-
text?:
|
|
3
|
+
text?: CssInsertInnerText;
|
|
3
4
|
onClick?: () => void;
|
|
4
5
|
isRounded?: boolean;
|
|
5
6
|
isActive?: boolean;
|
|
6
7
|
isSelected?: boolean;
|
|
7
|
-
padding?:
|
|
8
|
-
paddingHorizontal?:
|
|
9
|
-
paddingVertical?:
|
|
10
|
-
opacity?:
|
|
11
|
-
borderWidth?:
|
|
12
|
-
width?:
|
|
13
|
-
textSize?:
|
|
14
|
-
font?:
|
|
8
|
+
padding?: CssInsertValueLength;
|
|
9
|
+
paddingHorizontal?: CssInsertValueLength | null;
|
|
10
|
+
paddingVertical?: CssInsertValueLength | null;
|
|
11
|
+
opacity?: CssInsertValueNumber;
|
|
12
|
+
borderWidth?: CssInsertValueLength;
|
|
13
|
+
width?: CssInsertValueLength;
|
|
14
|
+
textSize?: CssInsertValueLength;
|
|
15
|
+
font?: CssInsertValueString;
|
|
15
16
|
wrapView?: string;
|
|
16
17
|
textView?: string;
|
|
17
18
|
} & Record<string, unknown>;
|
|
@@ -19,10 +20,10 @@ export type ButtonControlsProps = {
|
|
|
19
20
|
buttons?: ButtonControlItem[];
|
|
20
21
|
activeIndex?: number;
|
|
21
22
|
buttonIsRounded?: boolean;
|
|
22
|
-
buttonBorderWidth?:
|
|
23
|
-
buttonPaddingVertical?:
|
|
24
|
-
buttonPaddingHorizontal?:
|
|
25
|
-
flexGap?:
|
|
23
|
+
buttonBorderWidth?: CssInsertValueLength;
|
|
24
|
+
buttonPaddingVertical?: CssInsertValueLength;
|
|
25
|
+
buttonPaddingHorizontal?: CssInsertValueLength;
|
|
26
|
+
flexGap?: CssInsertValueLength;
|
|
26
27
|
flexProps?: Record<string, unknown>;
|
|
27
28
|
buttonProps?: Partial<ButtonControlItem>;
|
|
28
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonControls.types.d.ts","sourceRoot":"","sources":["../src/ButtonControls.types.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"ButtonControls.types.d.ts","sourceRoot":"","sources":["../src/ButtonControls.types.tsx"],"names":[],"mappings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AC,CAAC;CAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/uis.react.button-controls",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@vnejs/uis.utils": "~0.1.0"
|
|
17
17
|
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@vnejs/uis.react": "~0.1.0"
|
|
20
|
-
},
|
|
21
18
|
"files": [
|
|
22
19
|
"dist",
|
|
23
20
|
"src",
|
|
24
21
|
"tsconfig.json"
|
|
25
|
-
]
|
|
22
|
+
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@vnejs/uis.react.button": "~0.1.0",
|
|
25
|
+
"@vnejs/uis.react.flex": "~0.1.0"
|
|
26
|
+
}
|
|
26
27
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
|
|
3
|
-
import { VneWrap } from "@vnejs/uis.react";
|
|
3
|
+
import { VneWrap } from "@vnejs/uis.react.vne-wrap";
|
|
4
4
|
|
|
5
|
-
import { Flex } from "@vnejs/uis.react";
|
|
5
|
+
import { Flex } from "@vnejs/uis.react.flex";
|
|
6
6
|
|
|
7
7
|
import { ButtonControls } from "./ButtonControls";
|
|
8
8
|
|
package/src/ButtonControls.tsx
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import type { CssInsertInnerText, CssInsertValueLength, CssInsertValueNumber, CssInsertValueString } from "@vnejs/uis.utils";
|
|
2
|
+
|
|
1
3
|
export type ButtonControlItem = {
|
|
2
|
-
text?:
|
|
4
|
+
text?: CssInsertInnerText;
|
|
3
5
|
onClick?: () => void;
|
|
4
6
|
isRounded?: boolean;
|
|
5
7
|
isActive?: boolean;
|
|
6
8
|
isSelected?: boolean;
|
|
7
|
-
padding?:
|
|
8
|
-
paddingHorizontal?:
|
|
9
|
-
paddingVertical?:
|
|
10
|
-
opacity?:
|
|
11
|
-
borderWidth?:
|
|
12
|
-
width?:
|
|
13
|
-
textSize?:
|
|
14
|
-
font?:
|
|
9
|
+
padding?: CssInsertValueLength;
|
|
10
|
+
paddingHorizontal?: CssInsertValueLength | null;
|
|
11
|
+
paddingVertical?: CssInsertValueLength | null;
|
|
12
|
+
opacity?: CssInsertValueNumber;
|
|
13
|
+
borderWidth?: CssInsertValueLength;
|
|
14
|
+
width?: CssInsertValueLength;
|
|
15
|
+
textSize?: CssInsertValueLength;
|
|
16
|
+
font?: CssInsertValueString;
|
|
15
17
|
wrapView?: string;
|
|
16
18
|
textView?: string;
|
|
17
19
|
} & Record<string, unknown>;
|
|
@@ -20,10 +22,10 @@ export type ButtonControlsProps = {
|
|
|
20
22
|
buttons?: ButtonControlItem[];
|
|
21
23
|
activeIndex?: number;
|
|
22
24
|
buttonIsRounded?: boolean;
|
|
23
|
-
buttonBorderWidth?:
|
|
24
|
-
buttonPaddingVertical?:
|
|
25
|
-
buttonPaddingHorizontal?:
|
|
26
|
-
flexGap?:
|
|
25
|
+
buttonBorderWidth?: CssInsertValueLength;
|
|
26
|
+
buttonPaddingVertical?: CssInsertValueLength;
|
|
27
|
+
buttonPaddingHorizontal?: CssInsertValueLength;
|
|
28
|
+
flexGap?: CssInsertValueLength;
|
|
27
29
|
flexProps?: Record<string, unknown>;
|
|
28
30
|
buttonProps?: Partial<ButtonControlItem>;
|
|
29
31
|
};
|