maru_design2 0.0.1
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/.babelrc.json +18 -0
- package/.eslintrc.json +110 -0
- package/.github/workflows/chromatic.yml +19 -0
- package/.prettierrc +8 -0
- package/build-storybook.log +29 -0
- package/dist/components/atoms/button/Button.d.ts +10 -0
- package/dist/components/atoms/button/index.d.ts +1 -0
- package/dist/hooks/useCombineRef.d.ts +11 -0
- package/dist/hooks/useCreatePortal.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +50 -0
- package/dist/utils/format.d.ts +2 -0
- package/dist/utils/highlight.d.ts +3 -0
- package/package.json +66 -0
package/.babelrc.json
ADDED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"airbnb",
|
|
4
|
+
"plugin:react/recommended",
|
|
5
|
+
"plugin:@typescript-eslint/recommended"
|
|
6
|
+
],
|
|
7
|
+
"plugins": ["react", "@typescript-eslint", "prettier", "simple-import-sort"],
|
|
8
|
+
"rules": {
|
|
9
|
+
"no-tabs": [
|
|
10
|
+
"error",
|
|
11
|
+
{
|
|
12
|
+
"allowIndentationTabs": true
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"no-mixed-spaces-and-tabs": 0,
|
|
16
|
+
"simple-import-sort/imports": [
|
|
17
|
+
"warn",
|
|
18
|
+
{
|
|
19
|
+
"groups": [
|
|
20
|
+
["^react", "^(?!src)(?=@?\\w)"],
|
|
21
|
+
[
|
|
22
|
+
"constants",
|
|
23
|
+
"hooks",
|
|
24
|
+
"reducers",
|
|
25
|
+
"routes",
|
|
26
|
+
"store",
|
|
27
|
+
"types",
|
|
28
|
+
"utils"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"views",
|
|
32
|
+
"^\\.\\.(?!/?$)",
|
|
33
|
+
"^\\.\\./?$",
|
|
34
|
+
"^\\./(?=.*/)(?!/?$)",
|
|
35
|
+
"^\\.(?!/?$)",
|
|
36
|
+
"^\\./?$",
|
|
37
|
+
"components"
|
|
38
|
+
],
|
|
39
|
+
["assets", "^.+\\.s?css$"]
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"import/order": "off",
|
|
44
|
+
"import/extensions": [
|
|
45
|
+
"off",
|
|
46
|
+
{
|
|
47
|
+
"ts": "always",
|
|
48
|
+
"tsx": "always",
|
|
49
|
+
"js": "always",
|
|
50
|
+
"jsx": "always"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"import/no-unresolved": "off",
|
|
54
|
+
"react/jsx-filename-extension": [
|
|
55
|
+
"warn",
|
|
56
|
+
{
|
|
57
|
+
"extensions": [".ts", ".tsx"]
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"react/destructuring-assignment": 0,
|
|
61
|
+
"no-use-before-define": "off",
|
|
62
|
+
"@typescript-eslint/no-use-before-define": ["error"],
|
|
63
|
+
"import/no-extraneous-dependencies": [
|
|
64
|
+
"error",
|
|
65
|
+
{
|
|
66
|
+
"devDependencies": true,
|
|
67
|
+
"optionalDependencies": true,
|
|
68
|
+
"peerDependencies": true
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"linebreak-style": "off",
|
|
72
|
+
"object-curly-newline": "off",
|
|
73
|
+
"comma-dangle": "off",
|
|
74
|
+
"react/prop-types": "off",
|
|
75
|
+
"operator-linebreak": "off",
|
|
76
|
+
"import/prefer-default-export": "warn",
|
|
77
|
+
"no-console": "off",
|
|
78
|
+
"implicit-arrow-linebreak": "off",
|
|
79
|
+
"react/jsx-curly-newline": "off",
|
|
80
|
+
"no-param-reassign": [
|
|
81
|
+
"error",
|
|
82
|
+
{
|
|
83
|
+
"props": false
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"@typescript-eslint/ban-types": "warn",
|
|
87
|
+
"no-nested-ternary": "off",
|
|
88
|
+
"indent": "off",
|
|
89
|
+
"camelcase": "off",
|
|
90
|
+
"no-confusing-arrow": "off",
|
|
91
|
+
"function-paren-newline": "off",
|
|
92
|
+
"@typescript-eslint/no-empty-function": "warn",
|
|
93
|
+
"no-plusplus": "warn",
|
|
94
|
+
"react/jsx-wrap-multilines": "off",
|
|
95
|
+
"no-restricted-syntax": "off",
|
|
96
|
+
"no-await-in-loop": "off",
|
|
97
|
+
"react/require-default-props": [
|
|
98
|
+
1,
|
|
99
|
+
{
|
|
100
|
+
"functions": "ignore"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"jsx-a11y/label-has-associated-control": [
|
|
104
|
+
2,
|
|
105
|
+
{
|
|
106
|
+
"labelAttributes": ["htmlFor"]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: "Chromatic"
|
|
2
|
+
|
|
3
|
+
on: push
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
chromatic-release:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v2
|
|
10
|
+
with:
|
|
11
|
+
fetch-depth: 0
|
|
12
|
+
- uses: actions/setup-node@v3
|
|
13
|
+
with:
|
|
14
|
+
node-version: 18
|
|
15
|
+
- run: yarn
|
|
16
|
+
- uses: chromaui/action@latest
|
|
17
|
+
with:
|
|
18
|
+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
|
19
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
yarn run v1.22.22
|
|
2
|
+
$ storybook build --output-dir /var/folders/px/wfswfhnj2_96379m3pn48snm0000gn/T/chromatic--60662-3uZghrajfe3J
|
|
3
|
+
@storybook/cli v8.0.6
|
|
4
|
+
|
|
5
|
+
info => Cleaning outputDir: ../../../../../var/folders/px/wfswfhnj2_96379m3pn48snm0000gn/T/chromatic--60662-3uZghrajfe3J
|
|
6
|
+
info => Loading presets
|
|
7
|
+
info => Building manager..
|
|
8
|
+
info => Manager built (106 ms)
|
|
9
|
+
info => Building preview..
|
|
10
|
+
WARN No story files found for the specified pattern: src/**/*.mdx
|
|
11
|
+
info Addon-docs: using MDX3
|
|
12
|
+
info => Using implicit CSS loaders
|
|
13
|
+
info => Using default Webpack5 setup
|
|
14
|
+
info Using tsconfig paths for react-docgen
|
|
15
|
+
WARN asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
|
|
16
|
+
WARN This can impact web performance.
|
|
17
|
+
WARN Assets:
|
|
18
|
+
WARN 841.8b90d07c.iframe.bundle.js (1.51 MiB)
|
|
19
|
+
WARN 589.80a80dfc.iframe.bundle.js (628 KiB)
|
|
20
|
+
WARN entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
|
|
21
|
+
WARN Entrypoints:
|
|
22
|
+
WARN main (1.53 MiB)
|
|
23
|
+
WARN runtime~main.fb7a63fd.iframe.bundle.js
|
|
24
|
+
WARN 841.8b90d07c.iframe.bundle.js
|
|
25
|
+
WARN main.26a48fe5.iframe.bundle.js
|
|
26
|
+
WARN
|
|
27
|
+
info => Preview built (5.97 s)
|
|
28
|
+
info => Output directory: /var/folders/px/wfswfhnj2_96379m3pn48snm0000gn/T/chromatic--60662-3uZghrajfe3J
|
|
29
|
+
Done in 8.54s.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* this is color
|
|
6
|
+
*/
|
|
7
|
+
color?: 'primary' | 'danger';
|
|
8
|
+
}
|
|
9
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Button";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Ref } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* 파라미터로 들어온 ref들을 generic type을 가진 ref로 바꾸는 hook
|
|
4
|
+
* ex. refs(주로 부모 refs)가 HTMLInputElement인 RefObject일 때,
|
|
5
|
+
* combineRef를 선언한 컴포넌트의 ref<T>로 바꿀때 사용.
|
|
6
|
+
* 참고 : RefObejct는 default로 null을 가지고, MutableRefObject는 그 외 다른 값을 가짐
|
|
7
|
+
* @param refs RefObject or function
|
|
8
|
+
* @returns RefObject
|
|
9
|
+
*/
|
|
10
|
+
declare const useCombineRef: <T>(...refs: (Ref<T> | undefined)[]) => import("react").RefObject<T>;
|
|
11
|
+
export default useCombineRef;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components/atoms/button";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
/******************************************************************************
|
|
5
|
+
Copyright (c) Microsoft Corporation.
|
|
6
|
+
|
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
+
purpose with or without fee is hereby granted.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
11
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
12
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
13
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
14
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
16
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
17
|
+
***************************************************************************** */
|
|
18
|
+
|
|
19
|
+
var __assign = function() {
|
|
20
|
+
__assign = Object.assign || function __assign(t) {
|
|
21
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
22
|
+
s = arguments[i];
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
return __assign.apply(this, arguments);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
31
|
+
var e = new Error(message);
|
|
32
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var Button = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
36
|
+
var children = _a.children,
|
|
37
|
+
_b = _a.color,
|
|
38
|
+
color = _b === void 0 ? 'primary' : _b;
|
|
39
|
+
return jsx("button", __assign({
|
|
40
|
+
ref: ref,
|
|
41
|
+
type: "button",
|
|
42
|
+
style: {
|
|
43
|
+
backgroundColor: color === 'primary' ? 'skyblue' : 'pink'
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
children: children
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { Button };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const setHighlightTextOnData: <T>(cb: (func: unknown) => void, data: T[], targetKey: string, compareText: string) => void;
|
|
2
|
+
declare const setHighlightTextOnDataExceptSpace: <T>(data: T[], targetKey: string, compareText: string, autoExcept?: boolean) => typeof data;
|
|
3
|
+
export { setHighlightTextOnData, setHighlightTextOnDataExceptSpace };
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "maru_design2",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"author": "zena-42maru",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"react": "^17.0.2",
|
|
9
|
+
"react-dom": "^17.0.2"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@babel/core": "^7.18.10",
|
|
13
|
+
"@babel/preset-env": "^7.24.4",
|
|
14
|
+
"@babel/preset-react": "^7.24.1",
|
|
15
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
16
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
17
|
+
"@rollup/plugin-commonjs": "^22.0.2",
|
|
18
|
+
"@rollup/plugin-image": "^2.1.1",
|
|
19
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
20
|
+
"@rollup/plugin-typescript": "^8.3.4",
|
|
21
|
+
"@storybook/addon-actions": "^8.0.6",
|
|
22
|
+
"@storybook/addon-essentials": "^8.0.6",
|
|
23
|
+
"@storybook/addon-interactions": "^8.0.6",
|
|
24
|
+
"@storybook/addon-links": "^8.0.6",
|
|
25
|
+
"@storybook/addon-webpack5-compiler-swc": "^1.0.2",
|
|
26
|
+
"@storybook/preset-scss": "^1.0.3",
|
|
27
|
+
"@storybook/react": "^8.0.6",
|
|
28
|
+
"@storybook/react-webpack5": "^8.0.6",
|
|
29
|
+
"@storybook/test": "^8.0.6",
|
|
30
|
+
"@types/react": "^17.0.11",
|
|
31
|
+
"@types/react-dom": "^17.0.8",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
33
|
+
"@typescript-eslint/parser": "^7.6.0",
|
|
34
|
+
"chromatic": "^11.3.0",
|
|
35
|
+
"css-loader": "^6.7.1",
|
|
36
|
+
"eslint": "^9.0.0",
|
|
37
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
38
|
+
"eslint-config-prettier": "^9.1.0",
|
|
39
|
+
"eslint-plugin-import": "^2.29.1",
|
|
40
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
41
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
42
|
+
"eslint-plugin-react": "^7.34.1",
|
|
43
|
+
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
44
|
+
"postcss": "^8.4.16",
|
|
45
|
+
"postcss-url": "^10.1.3",
|
|
46
|
+
"prettier": "^3.2.5",
|
|
47
|
+
"rollup": "^2.77.3",
|
|
48
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
49
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
50
|
+
"sass": "^1.54.4",
|
|
51
|
+
"sass-loader": "^13.0.2",
|
|
52
|
+
"storybook": "^8.0.6",
|
|
53
|
+
"style-loader": "^3.3.1",
|
|
54
|
+
"typescript": "^4.7.4"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"react": "^17.0.2",
|
|
58
|
+
"react-dom": "^17.0.2"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"storybook": "storybook dev -p 6006",
|
|
62
|
+
"build-storybook": "storybook build",
|
|
63
|
+
"build": "rollup -c",
|
|
64
|
+
"release": "rm -rf dist && yarn build && mv README.md temp.md && yarn publish && mv temp.md README.md"
|
|
65
|
+
}
|
|
66
|
+
}
|