gasp-components 1.0.31 → 1.0.33
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 +14 -14
- package/dist/components/modal/index.js +31 -33
- package/dist/components/radio-button/index.d.ts +1 -0
- package/dist/components/radio-button/index.js +14 -12
- package/dist/components/radio-button-group/index.d.ts +2 -0
- package/dist/components/radio-button-group/index.js +42 -30
- package/package.json +80 -80
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# GASP Components
|
|
2
|
-
Standard React components for (General Authority for Statistics) projects
|
|
3
|
-
|
|
4
|
-
## Pre-requesite
|
|
5
|
-
|
|
6
|
-
- NodeJS latest iron version (v20.xx.xx)
|
|
7
|
-
- NPM v10.xx.xx
|
|
8
|
-
|
|
9
|
-
## Development Instructions
|
|
10
|
-
- To start the development: `npm run dev`
|
|
11
|
-
|
|
12
|
-
## References
|
|
13
|
-
## References
|
|
14
|
-
- [Ant Design](https://ant.design/components/overview/) React Components
|
|
1
|
+
# GASP Components
|
|
2
|
+
Standard React components for (General Authority for Statistics) projects
|
|
3
|
+
|
|
4
|
+
## Pre-requesite
|
|
5
|
+
|
|
6
|
+
- NodeJS latest iron version (v20.xx.xx)
|
|
7
|
+
- NPM v10.xx.xx
|
|
8
|
+
|
|
9
|
+
## Development Instructions
|
|
10
|
+
- To start the development: `npm run dev`
|
|
11
|
+
|
|
12
|
+
## References
|
|
13
|
+
## References
|
|
14
|
+
- [Ant Design](https://ant.design/components/overview/) React Components
|
|
15
15
|
- [Tailwindcss](https://tailwindcss.com/docs/utility-first) for styling
|
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Modal as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
children: b,
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as x, Button as u } from "antd";
|
|
3
|
+
import { useIntl as f } from "react-intl";
|
|
4
|
+
import g from "../../icons/close-outlined-icon/index.js";
|
|
5
|
+
import t from "classnames";
|
|
6
|
+
const M = ({
|
|
7
|
+
title: i,
|
|
8
|
+
children: n,
|
|
10
9
|
classNames: o,
|
|
11
|
-
onCancel:
|
|
12
|
-
|
|
10
|
+
onCancel: e,
|
|
11
|
+
open: p,
|
|
12
|
+
...b
|
|
13
13
|
}) => {
|
|
14
|
-
const { locale:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return j(() => {
|
|
18
|
-
d(e.open);
|
|
19
|
-
}, [e.open, d]), /* @__PURE__ */ t(
|
|
20
|
-
h,
|
|
14
|
+
const { locale: d } = f();
|
|
15
|
+
return /* @__PURE__ */ r(
|
|
16
|
+
x,
|
|
21
17
|
{
|
|
22
|
-
...
|
|
23
|
-
open:
|
|
18
|
+
...b,
|
|
19
|
+
open: p,
|
|
24
20
|
closeIcon: null,
|
|
25
|
-
title: /* @__PURE__ */
|
|
21
|
+
title: /* @__PURE__ */ h(
|
|
26
22
|
"div",
|
|
27
23
|
{
|
|
28
24
|
className: "flex justify-between items-center",
|
|
29
|
-
dir:
|
|
25
|
+
dir: d === "ar" ? "rtl" : "ltr",
|
|
30
26
|
children: [
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
27
|
+
i,
|
|
28
|
+
/* @__PURE__ */ r(
|
|
29
|
+
u,
|
|
34
30
|
{
|
|
35
31
|
className: "bg-ghostWhite hover:!bg-ghostWhite ms-auto",
|
|
36
32
|
type: "text",
|
|
37
|
-
onClick:
|
|
38
|
-
|
|
33
|
+
onClick: (l) => {
|
|
34
|
+
e && e(l);
|
|
35
|
+
},
|
|
36
|
+
icon: /* @__PURE__ */ r(g, {})
|
|
39
37
|
}
|
|
40
38
|
)
|
|
41
39
|
]
|
|
@@ -43,21 +41,21 @@ const k = ({
|
|
|
43
41
|
),
|
|
44
42
|
classNames: {
|
|
45
43
|
...o,
|
|
46
|
-
header:
|
|
44
|
+
header: t(
|
|
47
45
|
o == null ? void 0 : o.header,
|
|
48
46
|
"!px-6 !pt-[18px] !pb-[15px] !m-0 !border-b !border-solid !border-0 !border-aliceBlue"
|
|
49
47
|
),
|
|
50
|
-
content:
|
|
51
|
-
body:
|
|
52
|
-
footer:
|
|
48
|
+
content: t(o == null ? void 0 : o.content, "!p-0 !rounded-xl"),
|
|
49
|
+
body: t(o == null ? void 0 : o.body, "!px-6 !pt-4 !pb-8"),
|
|
50
|
+
footer: t(
|
|
53
51
|
o == null ? void 0 : o.footer,
|
|
54
52
|
"!px-6 !pt-6 !pb-7 !border-t !border-solid !border-0 !border-aliceBlue"
|
|
55
53
|
)
|
|
56
54
|
},
|
|
57
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ r("div", { dir: d === "ar" ? "rtl" : "ltr", children: n })
|
|
58
56
|
}
|
|
59
57
|
);
|
|
60
58
|
};
|
|
61
59
|
export {
|
|
62
|
-
|
|
60
|
+
M as Modal
|
|
63
61
|
};
|
|
@@ -3,6 +3,7 @@ interface RadioButtonProps {
|
|
|
3
3
|
value: string | number | null;
|
|
4
4
|
onChange?: (value: string | number | null) => void;
|
|
5
5
|
children: React.ReactNode | string | number | null;
|
|
6
|
+
className?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare const RadioButton: React.FC<RadioButtonProps>;
|
|
8
9
|
export {};
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Typography as
|
|
3
|
-
import
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { radioButtonGroupContext as
|
|
6
|
-
const
|
|
2
|
+
import { Typography as i } from "antd";
|
|
3
|
+
import p from "classnames";
|
|
4
|
+
import { useContext as a } from "react";
|
|
5
|
+
import { radioButtonGroupContext as c } from "../radio-button-group/context.js";
|
|
6
|
+
const f = ({
|
|
7
7
|
value: t,
|
|
8
8
|
onChange: o,
|
|
9
|
-
children: m
|
|
9
|
+
children: m,
|
|
10
|
+
className: s
|
|
10
11
|
}) => {
|
|
11
|
-
const r =
|
|
12
|
+
const r = a(c), n = () => {
|
|
12
13
|
o && o(t);
|
|
13
14
|
};
|
|
14
15
|
return /* @__PURE__ */ e(
|
|
15
16
|
"div",
|
|
16
17
|
{
|
|
17
|
-
className:
|
|
18
|
+
className: p([
|
|
19
|
+
s,
|
|
18
20
|
"min-w-[94px] text-center rounded-lg px-4 py-2 hover:cursor-pointer",
|
|
19
21
|
{
|
|
20
22
|
"bg-ghostWhite": r !== t,
|
|
21
23
|
"bg-lightBlue": r === t
|
|
22
24
|
}
|
|
23
|
-
),
|
|
24
|
-
onClick:
|
|
25
|
-
children: /* @__PURE__ */ e(
|
|
25
|
+
]),
|
|
26
|
+
onClick: n,
|
|
27
|
+
children: /* @__PURE__ */ e(i.Text, { className: "text-sm text-slateGray font-medium", children: m })
|
|
26
28
|
}
|
|
27
29
|
);
|
|
28
30
|
};
|
|
29
31
|
export {
|
|
30
|
-
|
|
32
|
+
f as RadioButton
|
|
31
33
|
};
|
|
@@ -2,12 +2,14 @@ import React from "react";
|
|
|
2
2
|
type Option = {
|
|
3
3
|
label: React.ReactNode | string;
|
|
4
4
|
value: string | number | null;
|
|
5
|
+
className?: string;
|
|
5
6
|
};
|
|
6
7
|
interface RadioButtonGroupProps {
|
|
7
8
|
value?: string | number | null;
|
|
8
9
|
onChange?: (value: string | number | null) => void;
|
|
9
10
|
defaultValue?: string | number | null;
|
|
10
11
|
options: Option[];
|
|
12
|
+
containerClassName?: string;
|
|
11
13
|
renderOption?: (params: {
|
|
12
14
|
state: string | number | null;
|
|
13
15
|
option: Option;
|
|
@@ -1,36 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { RadioButton as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useEffect as d } from "react";
|
|
3
|
+
import { RadioButton as x } from "../radio-button/index.js";
|
|
4
4
|
import { radioButtonGroupContext as n } from "./context.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import p from "classnames";
|
|
6
|
+
const y = ({
|
|
7
|
+
options: o,
|
|
8
|
+
defaultValue: t,
|
|
9
|
+
value: i,
|
|
10
|
+
onChange: e,
|
|
11
|
+
containerClassName: u,
|
|
12
|
+
renderOption: a
|
|
11
13
|
}) => {
|
|
12
|
-
const [m,
|
|
13
|
-
|
|
14
|
+
const [m, f] = v(i || t || null), c = (r) => {
|
|
15
|
+
f(r), e && e(r);
|
|
14
16
|
};
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
}, [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
return d(() => {
|
|
18
|
+
t && e && e(t);
|
|
19
|
+
}, [t, e]), /* @__PURE__ */ s(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: p([
|
|
23
|
+
u,
|
|
24
|
+
"flex justify-center gap-x-8"
|
|
25
|
+
]),
|
|
26
|
+
children: /* @__PURE__ */ s(n.Provider, { value: m, children: o.map(
|
|
27
|
+
(r, l) => a ? a({
|
|
28
|
+
state: m,
|
|
29
|
+
option: r,
|
|
30
|
+
key: `${r.value}_${l}`,
|
|
31
|
+
onChange: c
|
|
32
|
+
}) : /* @__PURE__ */ s(
|
|
33
|
+
x,
|
|
34
|
+
{
|
|
35
|
+
value: r.value,
|
|
36
|
+
onChange: c,
|
|
37
|
+
className: r.className,
|
|
38
|
+
children: r.label
|
|
39
|
+
},
|
|
40
|
+
`${r.value}_${l}`
|
|
41
|
+
)
|
|
42
|
+
) })
|
|
43
|
+
}
|
|
44
|
+
);
|
|
33
45
|
};
|
|
34
46
|
export {
|
|
35
|
-
|
|
47
|
+
y as RadioButtonGroup
|
|
36
48
|
};
|
package/package.json
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "gasp-components",
|
|
3
|
-
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "npm run storybook",
|
|
8
|
-
"build": "tsc --p ./tsconfig.build.json && vite build",
|
|
9
|
-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
10
|
-
"prepublishOnly": "npm run build",
|
|
11
|
-
"storybook": "storybook dev -p 6006",
|
|
12
|
-
"build-storybook": "storybook build"
|
|
13
|
-
},
|
|
14
|
-
"peerDependencies": {
|
|
15
|
-
"@ag-grid-enterprise/excel-export": "^31.0.2",
|
|
16
|
-
"@ag-grid-enterprise/server-side-row-model": "^31.0.2",
|
|
17
|
-
"@ag-grid-enterprise/set-filter": "^31.0.2",
|
|
18
|
-
"ag-grid-community": "^31.0.2",
|
|
19
|
-
"ag-grid-react": "^31.0.2",
|
|
20
|
-
"antd": "^5.13.1",
|
|
21
|
-
"classnames": "^2.5.1",
|
|
22
|
-
"react": "^18.2.0",
|
|
23
|
-
"react-dom": "^18.2.0",
|
|
24
|
-
"react-intl": "^6.6.1",
|
|
25
|
-
"sass": "^1.69.7",
|
|
26
|
-
"tailwind-scrollbar-hide": "^1.1.7"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@ag-grid-enterprise/excel-export": "^31.0.2",
|
|
30
|
-
"@ag-grid-enterprise/server-side-row-model": "^31.0.2",
|
|
31
|
-
"@ag-grid-enterprise/set-filter": "^31.0.2",
|
|
32
|
-
"@storybook/addon-essentials": "^7.6.8",
|
|
33
|
-
"@storybook/addon-interactions": "^7.6.8",
|
|
34
|
-
"@storybook/addon-links": "^7.6.8",
|
|
35
|
-
"@storybook/addon-onboarding": "^1.0.10",
|
|
36
|
-
"@storybook/blocks": "^7.6.8",
|
|
37
|
-
"@storybook/builder-vite": "^7.6.9",
|
|
38
|
-
"@storybook/preview-api": "^7.6.8",
|
|
39
|
-
"@storybook/react": "^7.6.8",
|
|
40
|
-
"@storybook/react-vite": "^7.6.8",
|
|
41
|
-
"@storybook/test": "^7.6.8",
|
|
42
|
-
"@storybook/types": "^7.6.8",
|
|
43
|
-
"@types/node": "^20.11.4",
|
|
44
|
-
"@types/react": "^18.2.43",
|
|
45
|
-
"@types/react-dom": "^18.2.17",
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
47
|
-
"@typescript-eslint/parser": "^6.14.0",
|
|
48
|
-
"@vitejs/plugin-react": "^4.2.1",
|
|
49
|
-
"ag-grid-community": "^31.0.2",
|
|
50
|
-
"ag-grid-react": "^31.0.2",
|
|
51
|
-
"antd": "^5.13.1",
|
|
52
|
-
"autoprefixer": "^10.4.16",
|
|
53
|
-
"classnames": "^2.5.1",
|
|
54
|
-
"eslint": "^8.55.0",
|
|
55
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
56
|
-
"eslint-plugin-react-refresh": "^0.4.5",
|
|
57
|
-
"eslint-plugin-storybook": "^0.6.15",
|
|
58
|
-
"glob": "^10.3.10",
|
|
59
|
-
"postcss": "^8.4.33",
|
|
60
|
-
"react": "^18.2.0",
|
|
61
|
-
"react-dom": "^18.2.0",
|
|
62
|
-
"react-intl": "^6.6.1",
|
|
63
|
-
"sass": "^1.69.7",
|
|
64
|
-
"storybook": "^7.6.8",
|
|
65
|
-
"tailwindcss": "^3.4.1",
|
|
66
|
-
"typescript": "^5.2.2",
|
|
67
|
-
"vite": "^5.0.8",
|
|
68
|
-
"vite-plugin-dts": "^3.7.1",
|
|
69
|
-
"vite-plugin-lib-inject-css": "^1.3.0",
|
|
70
|
-
"tailwind-scrollbar-hide": "^1.1.7"
|
|
71
|
-
},
|
|
72
|
-
"main": "dist/main.js",
|
|
73
|
-
"types": "dist/main.d.ts",
|
|
74
|
-
"files": [
|
|
75
|
-
"dist"
|
|
76
|
-
],
|
|
77
|
-
"sideEffects": [
|
|
78
|
-
"**/*.css"
|
|
79
|
-
]
|
|
80
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "gasp-components",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "1.0.33",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "npm run storybook",
|
|
8
|
+
"build": "tsc --p ./tsconfig.build.json && vite build",
|
|
9
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
10
|
+
"prepublishOnly": "npm run build",
|
|
11
|
+
"storybook": "storybook dev -p 6006",
|
|
12
|
+
"build-storybook": "storybook build"
|
|
13
|
+
},
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"@ag-grid-enterprise/excel-export": "^31.0.2",
|
|
16
|
+
"@ag-grid-enterprise/server-side-row-model": "^31.0.2",
|
|
17
|
+
"@ag-grid-enterprise/set-filter": "^31.0.2",
|
|
18
|
+
"ag-grid-community": "^31.0.2",
|
|
19
|
+
"ag-grid-react": "^31.0.2",
|
|
20
|
+
"antd": "^5.13.1",
|
|
21
|
+
"classnames": "^2.5.1",
|
|
22
|
+
"react": "^18.2.0",
|
|
23
|
+
"react-dom": "^18.2.0",
|
|
24
|
+
"react-intl": "^6.6.1",
|
|
25
|
+
"sass": "^1.69.7",
|
|
26
|
+
"tailwind-scrollbar-hide": "^1.1.7"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@ag-grid-enterprise/excel-export": "^31.0.2",
|
|
30
|
+
"@ag-grid-enterprise/server-side-row-model": "^31.0.2",
|
|
31
|
+
"@ag-grid-enterprise/set-filter": "^31.0.2",
|
|
32
|
+
"@storybook/addon-essentials": "^7.6.8",
|
|
33
|
+
"@storybook/addon-interactions": "^7.6.8",
|
|
34
|
+
"@storybook/addon-links": "^7.6.8",
|
|
35
|
+
"@storybook/addon-onboarding": "^1.0.10",
|
|
36
|
+
"@storybook/blocks": "^7.6.8",
|
|
37
|
+
"@storybook/builder-vite": "^7.6.9",
|
|
38
|
+
"@storybook/preview-api": "^7.6.8",
|
|
39
|
+
"@storybook/react": "^7.6.8",
|
|
40
|
+
"@storybook/react-vite": "^7.6.8",
|
|
41
|
+
"@storybook/test": "^7.6.8",
|
|
42
|
+
"@storybook/types": "^7.6.8",
|
|
43
|
+
"@types/node": "^20.11.4",
|
|
44
|
+
"@types/react": "^18.2.43",
|
|
45
|
+
"@types/react-dom": "^18.2.17",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
47
|
+
"@typescript-eslint/parser": "^6.14.0",
|
|
48
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
49
|
+
"ag-grid-community": "^31.0.2",
|
|
50
|
+
"ag-grid-react": "^31.0.2",
|
|
51
|
+
"antd": "^5.13.1",
|
|
52
|
+
"autoprefixer": "^10.4.16",
|
|
53
|
+
"classnames": "^2.5.1",
|
|
54
|
+
"eslint": "^8.55.0",
|
|
55
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
56
|
+
"eslint-plugin-react-refresh": "^0.4.5",
|
|
57
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
58
|
+
"glob": "^10.3.10",
|
|
59
|
+
"postcss": "^8.4.33",
|
|
60
|
+
"react": "^18.2.0",
|
|
61
|
+
"react-dom": "^18.2.0",
|
|
62
|
+
"react-intl": "^6.6.1",
|
|
63
|
+
"sass": "^1.69.7",
|
|
64
|
+
"storybook": "^7.6.8",
|
|
65
|
+
"tailwindcss": "^3.4.1",
|
|
66
|
+
"typescript": "^5.2.2",
|
|
67
|
+
"vite": "^5.0.8",
|
|
68
|
+
"vite-plugin-dts": "^3.7.1",
|
|
69
|
+
"vite-plugin-lib-inject-css": "^1.3.0",
|
|
70
|
+
"tailwind-scrollbar-hide": "^1.1.7"
|
|
71
|
+
},
|
|
72
|
+
"main": "dist/main.js",
|
|
73
|
+
"types": "dist/main.d.ts",
|
|
74
|
+
"files": [
|
|
75
|
+
"dist"
|
|
76
|
+
],
|
|
77
|
+
"sideEffects": [
|
|
78
|
+
"**/*.css"
|
|
79
|
+
]
|
|
80
|
+
}
|