quix-ui 1.1.0

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.
@@ -0,0 +1,48 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface ViewProps {
4
+ display?: "block" | "flex" | "inline-block" | "inline-flex";
5
+ isScrollable?: boolean;
6
+ direction?: "row" | "column" | "row-reverse" | "column-reverse";
7
+ alignItems?: "stretch" | "center" | "flex-start";
8
+ justifyContent?: "flex-start" | "center" | "space-between";
9
+ width?: number;
10
+ height?: number;
11
+ backgroundColor?: string;
12
+ paddingX?: number;
13
+ paddingY?: number;
14
+ textColor?: string;
15
+ children?: React.ReactNode | string;
16
+ rounded?: {
17
+ topLeft?: number;
18
+ topRight?: number;
19
+ bottomLeft?: number;
20
+ bottomRight?: number;
21
+ } | number;
22
+ className?: string;
23
+ onClick?: () => void;
24
+ }
25
+
26
+ declare function ViewContainer(props: ViewProps): react_jsx_runtime.JSX.Element;
27
+
28
+ interface ButtonsProps {
29
+ onClick: () => void;
30
+ width?: number;
31
+ height?: number;
32
+ label?: string;
33
+ paddingX?: number;
34
+ paddingY?: number;
35
+ backgroundColor?: string;
36
+ textColor?: string;
37
+ rounded?: {
38
+ topLeft?: number;
39
+ topRight?: number;
40
+ bottomLeft?: number;
41
+ bottomRight?: number;
42
+ } | number;
43
+ className?: string;
44
+ }
45
+
46
+ declare function Buttons(props: ButtonsProps): react_jsx_runtime.JSX.Element;
47
+
48
+ export { Buttons, ViewContainer };
package/dist/index.js ADDED
@@ -0,0 +1,45 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ function ViewContainer(props) {
4
+ const { display, isScrollable, direction, alignItems, justifyContent, width, height, backgroundColor, paddingX, paddingY, textColor, className, rounded } = props;
5
+ return jsx("div", { className: className, style: {
6
+ display: display || 'block',
7
+ overflowY: isScrollable ? 'scroll' : 'hidden',
8
+ flexDirection: direction || 'row',
9
+ alignItems: alignItems || 'stretch',
10
+ justifyContent: justifyContent || 'flex-start',
11
+ width: width ? `${width}px` : 'auto',
12
+ height: height ? `${height}px` : 'auto',
13
+ backgroundColor: backgroundColor || 'transparent',
14
+ paddingInline: paddingX ? `${paddingX}px` : undefined,
15
+ paddingBlock: paddingY ? `${paddingY}px` : undefined,
16
+ color: textColor || 'inherit',
17
+ borderTopLeftRadius: typeof rounded === 'number' ? rounded : rounded?.topLeft ?? 4,
18
+ borderTopRightRadius: typeof rounded === 'number' ? rounded : rounded?.topRight ?? 4,
19
+ borderBottomLeftRadius: typeof rounded === 'number' ? rounded : rounded?.bottomLeft ?? 4,
20
+ borderBottomRightRadius: typeof rounded === 'number' ? rounded : rounded?.bottomRight ?? 4,
21
+ }, children: props.children });
22
+ }
23
+
24
+ function Buttons(props) {
25
+ const { onClick, width, height, label, paddingX, paddingY, backgroundColor, textColor, rounded, className } = props;
26
+ return jsx("button", { className: className, style: {
27
+ width: width ? `${width}px` : 'auto',
28
+ height: height ? `${height}px` : 'auto',
29
+ paddingInline: paddingX ?? 4,
30
+ paddingBlock: paddingY ?? 4,
31
+ backgroundColor: backgroundColor || 'transparent',
32
+ color: textColor || 'inherit',
33
+ borderTopLeftRadius: typeof rounded === 'number' ? rounded : rounded?.topLeft ?? 4,
34
+ borderTopRightRadius: typeof rounded === 'number' ? rounded : rounded?.topRight ?? 4,
35
+ borderBottomLeftRadius: typeof rounded === 'number' ? rounded : rounded?.bottomLeft ?? 4,
36
+ borderBottomRightRadius: typeof rounded === 'number' ? rounded : rounded?.bottomRight ?? 4,
37
+ cursor: 'pointer',
38
+ }, onClick: onClick, children: label });
39
+ }
40
+
41
+ export { Buttons, ViewContainer };
42
+ //# sourceMappingURL=index.js.map
43
+
44
+ exports.ViewContainer = ViewContainer;
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/view/ViewContainer.tsx","../../src/components/Buttons/Buttons.tsx"],"sourcesContent":[null,null],"names":["_jsx"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("@eslint/config-helpers").Config[];
2
+ export default _default;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @fileoverview Types for this package.
3
+ */
4
+ import type { ConfigObject } from "@eslint/core";
5
+ /**
6
+ * Infinite array type.
7
+ */
8
+ export type InfiniteArray<T> = T | InfiniteArray<T>[];
9
+ /**
10
+ * The type of array element in the `extends` property after flattening.
11
+ */
12
+ export type SimpleExtendsElement = string | ConfigObject;
13
+ /**
14
+ * The type of array element in the `extends` property before flattening.
15
+ */
16
+ export type ExtendsElement = SimpleExtendsElement | InfiniteArray<ConfigObject>;
17
+ /**
18
+ * Config with extends. Valid only inside of `defineConfig()`.
19
+ */
20
+ export interface ConfigWithExtends extends ConfigObject {
21
+ extends?: ExtendsElement[];
22
+ }
23
+ export type ConfigWithExtendsArray = InfiniteArray<ConfigWithExtends>[];
@@ -0,0 +1,2 @@
1
+ import { ButtonsProps } from "./types";
2
+ export default function Buttons(props: ButtonsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,56 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ import Buttons from './Buttons';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Buttons;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {
11
+ backgroundColor: {
12
+ control: "color";
13
+ };
14
+ textColor: {
15
+ control: "color";
16
+ };
17
+ width: {
18
+ control: "number";
19
+ };
20
+ height: {
21
+ control: "number";
22
+ };
23
+ paddingX: {
24
+ control: "number";
25
+ };
26
+ paddingY: {
27
+ control: "number";
28
+ };
29
+ label: {
30
+ control: "text";
31
+ };
32
+ rounded: {
33
+ topLeft: {
34
+ control: string;
35
+ };
36
+ topRight: {
37
+ control: string;
38
+ };
39
+ bottomLeft: {
40
+ control: string;
41
+ };
42
+ bottomRight: {
43
+ control: string;
44
+ };
45
+ };
46
+ className: {
47
+ control: "text";
48
+ };
49
+ };
50
+ args: {
51
+ onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
52
+ };
53
+ };
54
+ export default meta;
55
+ type Story = StoryObj<typeof meta>;
56
+ export declare const Button: Story;
@@ -0,0 +1,17 @@
1
+ export interface ButtonsProps {
2
+ onClick: () => void;
3
+ width?: number;
4
+ height?: number;
5
+ label?: string;
6
+ paddingX?: number;
7
+ paddingY?: number;
8
+ backgroundColor?: string;
9
+ textColor?: string;
10
+ rounded?: {
11
+ topLeft?: number;
12
+ topRight?: number;
13
+ bottomLeft?: number;
14
+ bottomRight?: number;
15
+ } | number;
16
+ className?: string;
17
+ }
@@ -0,0 +1,2 @@
1
+ export { default as ViewContainer } from './view/ViewContainer';
2
+ export { default as Buttons } from './components/Buttons/Buttons';
@@ -0,0 +1,7 @@
1
+ interface figmaColorToRgbaProps {
2
+ r: number;
3
+ g: number;
4
+ b: number;
5
+ a: number;
6
+ }
7
+ declare function figmaColorToRgba({ r, g, b, a }: figmaColorToRgbaProps): string;
@@ -0,0 +1,71 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ import ViewContainer from './ViewContainer';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof ViewContainer;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {
11
+ backgroundColor: {
12
+ control: "color";
13
+ };
14
+ textColor: {
15
+ control: "color";
16
+ };
17
+ width: {
18
+ control: "number";
19
+ };
20
+ height: {
21
+ control: "number";
22
+ };
23
+ display: {
24
+ options: string[];
25
+ };
26
+ direction: {
27
+ options: string[];
28
+ };
29
+ isScrollable: {
30
+ control: "boolean";
31
+ };
32
+ alignItems: {
33
+ options: string[];
34
+ };
35
+ justifyContent: {
36
+ options: string[];
37
+ };
38
+ paddingX: {
39
+ control: "number";
40
+ };
41
+ paddingY: {
42
+ control: "number";
43
+ };
44
+ children: {
45
+ control: "text";
46
+ };
47
+ rounded: {
48
+ topLeft: {
49
+ control: string;
50
+ };
51
+ topRight: {
52
+ control: string;
53
+ };
54
+ bottomLeft: {
55
+ control: string;
56
+ };
57
+ bottomRight: {
58
+ control: string;
59
+ };
60
+ };
61
+ className: {
62
+ control: "text";
63
+ };
64
+ };
65
+ args: {
66
+ onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
67
+ };
68
+ };
69
+ export default meta;
70
+ type Story = StoryObj<typeof meta>;
71
+ export declare const View: Story;
@@ -0,0 +1,2 @@
1
+ import { ViewProps } from "./types";
2
+ export default function ViewContainer(props: ViewProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ export interface ViewProps {
2
+ display?: "block" | "flex" | "inline-block" | "inline-flex";
3
+ isScrollable?: boolean;
4
+ direction?: "row" | "column" | "row-reverse" | "column-reverse";
5
+ alignItems?: "stretch" | "center" | "flex-start";
6
+ justifyContent?: "flex-start" | "center" | "space-between";
7
+ width?: number;
8
+ height?: number;
9
+ backgroundColor?: string;
10
+ paddingX?: number;
11
+ paddingY?: number;
12
+ textColor?: string;
13
+ children?: React.ReactNode | string;
14
+ rounded?: {
15
+ topLeft?: number;
16
+ topRight?: number;
17
+ bottomLeft?: number;
18
+ bottomRight?: number;
19
+ } | number;
20
+ className?: string;
21
+ onClick?: () => void;
22
+ }
package/package.json ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "name": "quix-ui",
3
+ "version": "1.1.0",
4
+ "description": "This is a react component library.",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "rollup -c",
13
+ "dev": "rollup -c -w",
14
+ "test": "jest --watchAll --verbose",
15
+ "storybook": "storybook dev -p 6006",
16
+ "build-storybook": "storybook build",
17
+ "prepare": "husky",
18
+ "lint": "eslint ./src/ --ext .ts,.tsx",
19
+ "lint:fix": "eslint ./src --ext .ts,.tsx --fix",
20
+ "release": "standard-version",
21
+ "compile": "rimraf dist/lib && tsc && tsc --build tsconfig.es5.json"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/lizzy-km/figma-component-library.git"
26
+ },
27
+ "author": "Kaung Myat Soe",
28
+ "license": "MIT",
29
+ "bugs": {
30
+ "url": "https://github.com/lizzy-km/figma-component-library/issues"
31
+ },
32
+ "homepage": "https://github.com/lizzy-km/figma-component-library#readme",
33
+ "jest": {
34
+ "testEnvironment": "jsdom"
35
+ },
36
+ "babel": {
37
+ "sourceType": "unambiguous",
38
+ "presets": [
39
+ "@babel/preset-env",
40
+ "@babel/preset-typescript",
41
+ [
42
+ "@babel/preset-react",
43
+ {
44
+ "runtime": "automatic"
45
+ }
46
+ ]
47
+ ]
48
+ },
49
+ "devDependencies": {
50
+ "@babel/preset-env": "^7.28.6",
51
+ "@babel/preset-react": "^7.28.5",
52
+ "@babel/preset-typescript": "^7.28.5",
53
+ "@eslint/js": "^9.39.2",
54
+ "@figma/eslint-plugin-figma-plugins": "^1.0.0",
55
+ "@figma/plugin-typings": "^1.122.0",
56
+ "@rollup/plugin-commonjs": "^29.0.0",
57
+ "@rollup/plugin-node-resolve": "^16.0.3",
58
+ "@rollup/plugin-terser": "^0.4.4",
59
+ "@rollup/plugin-typescript": "^12.3.0",
60
+ "@storybook/addon-docs": "^10.1.11",
61
+ "@storybook/react-vite": "^10.1.11",
62
+ "@testing-library/jest-dom": "^6.9.1",
63
+ "@testing-library/react": "^16.3.1",
64
+ "@types/jest": "^30.0.0",
65
+ "@types/react": "^19.2.8",
66
+ "axios": "^1.13.2",
67
+ "eslint": "^9.39.2",
68
+ "globals": "^17.0.0",
69
+ "husky": "^9.1.7",
70
+ "jest": "^30.2.0",
71
+ "jest-environment-jsdom": "^30.2.0",
72
+ "jiti": "^2.6.1",
73
+ "react": "^18.3.1",
74
+ "react-dom": "^18.3.1",
75
+ "rollup": "^4.55.1",
76
+ "rollup-plugin-dts": "^6.3.0",
77
+ "rollup-plugin-polyfill-node": "^0.13.0",
78
+ "rollup-plugin-postcss": "^4.0.2",
79
+ "storybook": "^10.1.11",
80
+ "styled-components": "^6.3.6",
81
+ "tslib": "^2.8.1",
82
+ "typescript": "^5.9.3",
83
+ "typescript-eslint": "^8.53.0"
84
+ },
85
+ "peerDependencies": {
86
+ "react": ">=16"
87
+ },
88
+ "dependencies": {
89
+ "fs": "^0.0.1-security",
90
+ "rimraf": "^6.1.2"
91
+ }
92
+ }