@situaction/traq-ui-ste 1.0.5 → 1.0.7
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/README.md +8 -0
- package/dist/components/button/Button.d.ts +16 -0
- package/dist/components/button/Button.js +52 -0
- package/dist/components/input/Input.d.ts +2 -0
- package/dist/components/input/Input.js +11 -0
- package/dist/components/theme/ThemeContext.d.ts +12 -0
- package/dist/components/theme/ThemeContext.js +17 -0
- package/dist/components/theme/createTheme.d.ts +7 -0
- package/dist/components/theme/createTheme.js +1 -0
- package/dist/main.d.ts +4 -0
- package/dist/main.js +9 -0
- package/dist/styles/Button.css +1 -0
- package/dist/styles/Input.css +1 -0
- package/dist/styles/main.css +1 -0
- package/package.json +56 -38
- package/dist/esm/index.js +0 -4209
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/style/style.css +0 -3
- package/dist/esm/style/style.css.map +0 -1
- package/dist/esm/types/components/Button/Button.d.ts +0 -10
- package/dist/esm/types/components/Button/index.d.ts +0 -1
- package/dist/esm/types/components/index.d.ts +0 -1
- package/dist/esm/types/index.d.ts +0 -2
- package/dist/index.d.ts +0 -12
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
# Traq[UI]ste
|
|
2
2
|
Tra[UI]ste est une librairie de composant crée par Situaction.
|
|
3
3
|
|
|
4
|
+
# React + TypeScript + Vite
|
|
5
|
+
|
|
6
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
7
|
+
|
|
8
|
+
Currently, two official plugins are available:
|
|
9
|
+
|
|
10
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
11
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ButtonProps {
|
|
4
|
+
mode?: string; /** Is this the principal call to action on the page? */
|
|
5
|
+
color?: string; /** What background color to use (blue, red, ...)*/
|
|
6
|
+
size?: 's' | 'm' | 'l' | 'xl'; /** How large should the button be? */
|
|
7
|
+
label: string; /** button contents */
|
|
8
|
+
children?: ReactNode; /** Additional content inside the button */
|
|
9
|
+
childrenPosition?: 'left' | 'right' | 'both'; /** Position of the children relative to the label */
|
|
10
|
+
onClick?: () => void; /** Optional click handler */
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Primary UI component for user interaction
|
|
14
|
+
*/
|
|
15
|
+
export declare const Button: ({ mode, size, color, label, children, childrenPosition, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs as m, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import '../../styles/Button.css';const l = "_button_hzvpr_28", n = {
|
|
3
|
+
button: l,
|
|
4
|
+
"button-primary": "_button-primary_hzvpr_44",
|
|
5
|
+
"button-secondary": "_button-secondary_hzvpr_58",
|
|
6
|
+
"button-size-xl": "_button-size-xl_hzvpr_62",
|
|
7
|
+
"button-size-l": "_button-size-l_hzvpr_67",
|
|
8
|
+
"button-size-m": "_button-size-m_hzvpr_72",
|
|
9
|
+
"button-size-s": "_button-size-s_hzvpr_77",
|
|
10
|
+
"button-gap-xl": "_button-gap-xl_hzvpr_82",
|
|
11
|
+
"button-gap-l": "_button-gap-l_hzvpr_85",
|
|
12
|
+
"button-gap-m": "_button-gap-m_hzvpr_88",
|
|
13
|
+
"button-gap-s": "_button-gap-s_hzvpr_88"
|
|
14
|
+
}, v = ({
|
|
15
|
+
mode: b = "primary",
|
|
16
|
+
size: a = "m",
|
|
17
|
+
color: t = "blue",
|
|
18
|
+
label: p,
|
|
19
|
+
children: o,
|
|
20
|
+
childrenPosition: r,
|
|
21
|
+
...u
|
|
22
|
+
}) => {
|
|
23
|
+
const _ = [
|
|
24
|
+
n.button,
|
|
25
|
+
n[`button-${b}`],
|
|
26
|
+
n[`button-size-${a}`],
|
|
27
|
+
n[`button-gap-${a}`],
|
|
28
|
+
"flexHorizontalCenter"
|
|
29
|
+
].join(" "), e = {
|
|
30
|
+
"--dynamic-color": `var(--primary-color-${t})`,
|
|
31
|
+
"--dynamic-hover-color": `var(--primary-color-hover-${t})`,
|
|
32
|
+
"--dynamic-pressed-color": `var(--primary-color-pressed-${t})`,
|
|
33
|
+
"--dynamic-disabled-color": `var(--primary-color-disabled-${t})`
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ m(
|
|
36
|
+
"button",
|
|
37
|
+
{
|
|
38
|
+
type: "button",
|
|
39
|
+
className: _,
|
|
40
|
+
style: e,
|
|
41
|
+
...u,
|
|
42
|
+
children: [
|
|
43
|
+
(r === "left" || r === "both") && o && /* @__PURE__ */ s("span", { children: o }),
|
|
44
|
+
/* @__PURE__ */ s("span", { children: p }),
|
|
45
|
+
(r === "right" || r === "both") && o && /* @__PURE__ */ s("span", { children: o })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
v as Button
|
|
52
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import '../../styles/Input.css';const u = "_input_rpqtu_1", o = {
|
|
3
|
+
input: u
|
|
4
|
+
};
|
|
5
|
+
function i(t) {
|
|
6
|
+
const { className: n, ...s } = t;
|
|
7
|
+
return /* @__PURE__ */ p("input", { className: `${n} ${o.input}`, ...s });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
i as Input
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type Theme = 'light' | 'dark';
|
|
4
|
+
interface ThemeContextType {
|
|
5
|
+
theme: Theme;
|
|
6
|
+
toggleTheme: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const ThemeProvider: ({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const useTheme: () => ThemeContextType;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as m, useState as s, useContext as d } from "react";
|
|
3
|
+
const r = m(void 0), a = ({ children: e }) => {
|
|
4
|
+
const [t, h] = s("light"), i = () => {
|
|
5
|
+
h((n) => n === "light" ? "dark" : "light");
|
|
6
|
+
};
|
|
7
|
+
return /* @__PURE__ */ o(r.Provider, { value: { theme: t, toggleTheme: i }, children: /* @__PURE__ */ o("div", { "data-theme": t, children: e }) });
|
|
8
|
+
}, v = () => {
|
|
9
|
+
const e = d(r);
|
|
10
|
+
if (e === void 0)
|
|
11
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
12
|
+
return e;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
a as ThemeProvider,
|
|
16
|
+
v as useTheme
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/main.d.ts
ADDED
package/dist/main.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Button as r } from "./components/button/Button.js";
|
|
2
|
+
import { Input as m } from "./components/input/Input.js";
|
|
3
|
+
import { ThemeProvider as f, useTheme as u } from "./components/theme/ThemeContext.js";
|
|
4
|
+
import './styles/main.css';export {
|
|
5
|
+
r as Button,
|
|
6
|
+
m as Input,
|
|
7
|
+
f as ThemeProvider,
|
|
8
|
+
u as useTheme
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-theme=light]{--primary-color-blue: #1D3557;--primary-color-hover-blue: #1F416D;--primary-color-pressed-blue: #214B83;--primary-color-disabled-blue: #E5E7EA;--primary-color-text: #FFF;--primary-color-red: #dc3545;--primary-color-hover-red: #c82333;--primary-color-pressed-red: #bd2130;--primary-color-disabled-red: #c0c0c0}[data-theme=dark]{--primary-color-blue: #C3E9FD;--primary-color-hover-blue: #DFF1FF;--primary-color-pressed-blue: #EFF8FF;--primary-color-disabled-blue: #383F45;--primary-color-text: #1D3557;--primary-color-red: #bd7c88;--primary-color-hover-red: #80464c;--primary-color-pressed-red: #503135;--primary-color-disabled-red: #c0c0c0}._button_hzvpr_28{font-family:Urbanist,sans-serif;font-weight:500;border:0;border-radius:8px;cursor:pointer;display:inline-block;line-height:1;box-shadow:0 4px 10px #00000008;width:fit-content}._button_hzvpr_28:focus{outline:2px solid var(--dynamic-color);outline-offset:2px}._button-primary_hzvpr_44{color:var(--primary-color-text);background-color:var(--dynamic-color)}._button-primary_hzvpr_44:hover{background-color:var(--dynamic-hover-color)}._button-primary_hzvpr_44:active{background-color:var(--dynamic-pressed-color)}._button-primary_hzvpr_44:disabled{background-color:var(--dynamic-disabled-color);cursor:initial}._button-secondary_hzvpr_58{color:#333;background-color:transparent}._button-size-xl_hzvpr_62{padding:16px 32px;font-size:1.125em;line-height:28px}._button-size-l_hzvpr_67{padding:12px 24px;font-size:1em;line-height:24px}._button-size-m_hzvpr_72{padding:8px 16px;font-size:.875em;line-height:22px}._button-size-s_hzvpr_77{padding:6px 12px;font-size:.75em;line-height:16px}._button-gap-xl_hzvpr_82{gap:12px}._button-gap-l_hzvpr_85{gap:8px}._button-gap-m_hzvpr_88,._button-gap-s_hzvpr_88{gap:4px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._input_rpqtu_1{padding:1rem;border-radius:4px;border:1px solid #1ea7fd}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Urbanist-Thin;src:url(./public/static/Urbanist-Thin.ttf) format("truetype");font-weight:100;font-style:normal}@font-face{font-family:Urbanist-Extra-Light;src:url(./public/static/Urbanist-ExtraLight.ttf) format("truetype");font-weight:200;font-style:normal}@font-face{font-family:Urbanist-Light;src:url(./public/static/Urbanist-Light.ttf) format("truetype");font-weight:300;font-style:normal}@font-face{font-family:Urbanist-Regular;src:url(./public/static/Urbanist-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:Urbanist;src:url(./public/static/Urbanist-Medium.ttf) format("truetype");font-weight:500;font-style:normal}@font-face{font-family:Urbanist-Back;src:url(./public/static/Urbanist-Back.ttf) format("truetype");font-weight:600;font-style:normal}@font-face{font-family:Urbanist-Semi-Bold;src:url(./public/static/Urbanist-SemiBold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:Urbanist-Bold;src:url(./public/static/Urbanist-Bold.ttf) format("truetype");font-weight:800;font-style:normal}@font-face{font-family:Urbanist-Extra-Bold;src:url(./public/static/Urbanist-ExtraBold.ttf) format("truetype");font-weight:900;font-style:normal}:root,body{font-family:Urbanist,sans-serif}.fontUrbanist{font-family:Urbanist,sans-serif}.flexHorizontal{display:flex;justify-content:flex-start;align-items:center;flex-direction:row}.flexHorizontalCenter{display:flex;justify-content:center;align-items:center;flex-direction:row}.flexVertical{display:flex;justify-content:flex-start;align-items:center;flex-direction:column}.flexVerticalCenter{display:flex;justify-content:center;align-items:center;flex-direction:row}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}html{overflow-x:hidden}body{line-height:1;width:100vw;height:100vh}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}button{border:none;padding:0;cursor:pointer}[data-theme=light]{--primary-color-blue: #1D3557;--primary-color-hover-blue: #1F416D;--primary-color-pressed-blue: #214B83;--primary-color-disabled-blue: #E5E7EA;--primary-color-text: #FFF;--primary-color-red: #dc3545;--primary-color-hover-red: #c82333;--primary-color-pressed-red: #bd2130;--primary-color-disabled-red: #c0c0c0}[data-theme=dark]{--primary-color-blue: #C3E9FD;--primary-color-hover-blue: #DFF1FF;--primary-color-pressed-blue: #EFF8FF;--primary-color-disabled-blue: #383F45;--primary-color-text: #1D3557;--primary-color-red: #bd7c88;--primary-color-hover-red: #80464c;--primary-color-pressed-red: #503135;--primary-color-disabled-red: #c0c0c0}
|
package/package.json
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@situaction/traq-ui-ste",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "library react component Situaction",
|
|
5
|
-
"main": "dist/
|
|
5
|
+
"main": "dist/main.js",
|
|
6
|
+
"types": "dist/main.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
6
10
|
"scripts": {
|
|
7
|
-
"
|
|
11
|
+
"dev": "vite",
|
|
12
|
+
"test": "jest",
|
|
13
|
+
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
8
14
|
"prepublish": "npm run build",
|
|
9
15
|
"publish": "npm publish --access public",
|
|
10
|
-
"
|
|
16
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
17
|
+
"preview": "vite preview",
|
|
11
18
|
"storybook": "storybook dev -p 6006",
|
|
12
19
|
"build-storybook": "storybook build"
|
|
13
20
|
},
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"**/*.css"
|
|
23
|
+
],
|
|
14
24
|
"keywords": [
|
|
15
25
|
"React",
|
|
16
26
|
"components",
|
|
@@ -18,46 +28,54 @@
|
|
|
18
28
|
"TypeScript",
|
|
19
29
|
"sass"
|
|
20
30
|
],
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react": "^18.2.0",
|
|
33
|
+
"react-dom": "^18.2.0"
|
|
34
|
+
},
|
|
21
35
|
"author": "Situaction",
|
|
22
36
|
"license": "ISC",
|
|
23
37
|
"devDependencies": {
|
|
24
|
-
"@chromatic-com/storybook": "^1.
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@storybook/addon-
|
|
29
|
-
"@storybook/
|
|
30
|
-
"@storybook/
|
|
31
|
-
"@storybook/
|
|
32
|
-
"@storybook/
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@types/react": "^18.2.
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
38
|
+
"@chromatic-com/storybook": "^1.5.0",
|
|
39
|
+
"@storybook/addon-essentials": "^8.1.9",
|
|
40
|
+
"@storybook/addon-interactions": "^8.1.9",
|
|
41
|
+
"@storybook/addon-links": "^8.1.9",
|
|
42
|
+
"@storybook/addon-onboarding": "^8.1.9",
|
|
43
|
+
"@storybook/blocks": "^8.1.9",
|
|
44
|
+
"@storybook/react": "^8.1.9",
|
|
45
|
+
"@storybook/react-vite": "^8.1.9",
|
|
46
|
+
"@storybook/test": "^8.1.9",
|
|
47
|
+
"@testing-library/jest-dom": "^6.4.6",
|
|
48
|
+
"@testing-library/react": "^16.0.0",
|
|
49
|
+
"@testing-library/user-event": "^14.5.2",
|
|
50
|
+
"@types/jest": "^29.5.12",
|
|
51
|
+
"@types/node": "^20.14.2",
|
|
52
|
+
"@types/react": "^18.2.66",
|
|
53
|
+
"@types/react-dom": "^18.2.22",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
55
|
+
"@typescript-eslint/parser": "^7.2.0",
|
|
56
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
57
|
+
"css-loader": "^7.1.2",
|
|
58
|
+
"eslint": "^8.57.0",
|
|
59
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
60
|
+
"eslint-plugin-react-refresh": "^0.4.6",
|
|
61
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
62
|
+
"glob": "^10.4.1",
|
|
63
|
+
"identity-obj-proxy": "^3.0.0",
|
|
64
|
+
"jest": "^29.7.0",
|
|
65
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
66
|
+
"sass": "^1.77.5",
|
|
46
67
|
"sass-loader": "^14.2.0",
|
|
47
|
-
"storybook": "^8.
|
|
68
|
+
"storybook": "^8.1.9",
|
|
48
69
|
"style-loader": "^4.0.0",
|
|
49
|
-
"
|
|
50
|
-
"
|
|
70
|
+
"ts-jest": "^29.1.5",
|
|
71
|
+
"ts-node": "^10.9.2",
|
|
72
|
+
"typescript": "^5.2.2",
|
|
73
|
+
"vite": "^5.2.0",
|
|
74
|
+
"vite-plugin-dts": "^3.9.1",
|
|
75
|
+
"vite-plugin-lib-inject-css": "^2.1.1"
|
|
51
76
|
},
|
|
52
|
-
"module": "dist/esm/index.js",
|
|
53
|
-
"files": [
|
|
54
|
-
"dist"
|
|
55
|
-
],
|
|
56
|
-
"types": "dist/index.d.ts",
|
|
57
77
|
"dependencies": {
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
61
|
-
"rollup-plugin-scss": "^4.0.0"
|
|
78
|
+
"storybook-figma": "^0.1.2",
|
|
79
|
+
"storybook-react-context": "^0.6.0"
|
|
62
80
|
}
|
|
63
81
|
}
|