@vnejs/uis.react.button 0.1.3 → 0.1.4

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/package.json CHANGED
@@ -1,32 +1,26 @@
1
1
  {
2
2
  "name": "@vnejs/uis.react.button",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
7
- "build": "node ../../../scripts/build-package.mjs",
8
- "publish:major:plugin": "npm run publish:major",
9
- "publish:minor:plugin": "npm run publish:minor",
10
- "publish:patch:plugin": "npm run publish:patch",
11
- "publish:major": "npm run build && npm version major && npm publish --access public",
12
- "publish:minor": "npm run build && npm version minor && npm publish --access public",
13
- "publish:patch": "npm run build && npm version patch && npm publish --access public"
7
+ "build": "npx @vnejs/monorepo package",
8
+ "publish:major:uis:react": "npm run publish:major",
9
+ "publish:minor:uis:react": "npm run publish:minor",
10
+ "publish:patch:uis:react": "npm run publish:patch",
11
+ "publish:major": "npx @vnejs/monorepo publish major --access public",
12
+ "publish:minor": "npx @vnejs/monorepo publish minor --access public",
13
+ "publish:patch": "npx @vnejs/monorepo publish patch --access public"
14
14
  },
15
15
  "peerDependencies": {
16
- "@bem-react/classname": "1.5.12",
17
- "@vnejs/uis.utils": "~0.1.0",
18
- "react": "19.2.4",
19
- "react-dom": "19.2.4",
20
- "@vnejs/uis.react": "~0.1.0"
16
+ "@vnejs/uis.utils": "~0.1.0"
21
17
  },
22
18
  "devDependencies": {
23
- "@vnejs/uis.react": "~0.1.0",
24
- "typescript": "^6.0.3",
25
- "@types/react": "^19.0.10",
26
- "@types/react-dom": "^19.0.4"
19
+ "@vnejs/uis.react": "~0.1.0"
27
20
  },
28
21
  "files": [
29
22
  "dist",
30
- "package.json"
23
+ "src",
24
+ "tsconfig.json"
31
25
  ]
32
26
  }
@@ -0,0 +1,34 @@
1
+ import { VneWrap } from "@vnejs/uis.react";
2
+
3
+ import { Button } from "@vnejs/uis.react";
4
+
5
+ export const Common = {
6
+ args: {
7
+ text: "Some Text",
8
+ vneHeight: 720,
9
+ borderWidth: 3,
10
+ padding: 12,
11
+ size: 48,
12
+ isRounded: false,
13
+ isActive: false,
14
+ },
15
+ };
16
+
17
+ export default {
18
+ title: "Primitives/Button",
19
+ render: ({ vneHeight, size, ...args }) => (
20
+ <VneWrap height={vneHeight}>
21
+ <Button
22
+ {...args}
23
+ textSize={size}
24
+ />
25
+ </VneWrap>
26
+ ),
27
+ argTypes: {
28
+ vneHeight: { control: { type: "number", min: 180, max: 2160, step: 45 } },
29
+
30
+ padding: { control: { type: "number", min: 6, max: 48, step: 6 } },
31
+ borderWidth: { control: { type: "number", min: 3, max: 12, step: 1 } },
32
+ size: { control: { type: "number", min: 24, max: 180, step: 6 } },
33
+ },
34
+ };
package/src/Button.tsx ADDED
@@ -0,0 +1,48 @@
1
+ import { Wrap, Text } from "@vnejs/uis.react";
2
+
3
+ export const Button = ({
4
+ onClick,
5
+ isRounded = false,
6
+ isActive = false,
7
+ isSelected = false,
8
+ padding = 0,
9
+ paddingHorizontal = null,
10
+ paddingVertical = null,
11
+ opacity = null,
12
+ borderWidth = 0,
13
+ width = 0,
14
+ textSize = 0,
15
+ text = "",
16
+ font = "",
17
+ wrapView = "default",
18
+ textView = "default",
19
+ }) => {
20
+ return (
21
+ <Wrap
22
+ className="TextHoverParent"
23
+ withHover={true}
24
+ onClick={onClick}
25
+ isRounded={isRounded}
26
+ isSelected={isSelected}
27
+ isActive={isActive}
28
+ padding={padding}
29
+ paddingVertical={paddingVertical}
30
+ paddingHorizontal={paddingHorizontal}
31
+ borderWidth={borderWidth}
32
+ view={wrapView}
33
+ width={width}
34
+ opacity={opacity}
35
+ >
36
+ <Text
37
+ isHoverable={true}
38
+ font={font}
39
+ text={text}
40
+ size={textSize}
41
+ view={textView}
42
+ isActive={isActive}
43
+ isSelected={isSelected}
44
+ align={Text.ALIGNS.CENTER}
45
+ />
46
+ </Wrap>
47
+ );
48
+ };
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./Button";
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "../../../tsconfig.react.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "rootDir": "src"
6
+ },
7
+ "include": [
8
+ "src/**/*.ts",
9
+ "src/**/*.tsx",
10
+ "../../../globals.d.ts",
11
+ "../../../peer-modules.d.ts"
12
+ ],
13
+ "exclude": [
14
+ "dist",
15
+ "node_modules",
16
+ "src/**/*.stories.tsx"
17
+ ]
18
+ }