@egov3/system-design 1.0.14 → 1.0.16

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.
@@ -27,6 +27,9 @@ jobs:
27
27
  - name: Install dependencies
28
28
  run: yarn install
29
29
 
30
+ - name: Build project
31
+ run: yarn build
32
+
30
33
  - name: Increment version
31
34
  run: yarn version --patch --no-git-tag-version
32
35
 
@@ -40,7 +43,7 @@ jobs:
40
43
  run: |
41
44
  git ls-remote https://Zhassulan-Baigozha:${{ secrets.PERSONAL_TOKEN }}@github.com/Zhassulan-Baigozha/egov3-design.git
42
45
  env:
43
- PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} # Use GITHUB_TOKEN for repo access
46
+ PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
44
47
 
45
48
  - name: Commit updated package.json
46
49
  run: |
@@ -0,0 +1,5 @@
1
+ // scss-modules.d.ts
2
+ declare module '*.module.scss' {
3
+ const classes: { [key: string]: string };
4
+ export default classes;
5
+ }
@@ -2,12 +2,12 @@ import React from "react";
2
2
  import { render, fireEvent } from "@testing-library/react";
3
3
  import "@testing-library/jest-dom";
4
4
 
5
- import { InputField } from "~baseComponents";
5
+ import { Components } from "~components";
6
6
 
7
7
  describe("InputField", () => {
8
8
  it("(1) Should render without crashing", () => {
9
9
  const { getByPlaceholderText } = render(
10
- <InputField
10
+ <Components.InputField
11
11
  id={"testRenderId"}
12
12
  labelText={""}
13
13
  ariaLabel={"test ariaLabel"}
@@ -19,7 +19,7 @@ describe("InputField", () => {
19
19
  it("(2) Should render with the correct placeholder", () => {
20
20
  const placeholder = "Enter text";
21
21
  const { getByPlaceholderText } = render(
22
- <InputField
22
+ <Components.InputField
23
23
  id={"testPlaceholderId"}
24
24
  labelText={""}
25
25
  ariaLabel={"test ariaLabel"}
@@ -33,7 +33,7 @@ describe("InputField", () => {
33
33
  const onFocus = jest.fn();
34
34
  const onBlur = jest.fn();
35
35
  const { getByPlaceholderText } = render(
36
- <InputField
36
+ <Components.InputField
37
37
  id={"testOnBlurId"}
38
38
  labelText={""}
39
39
  ariaLabel={"test ariaLabel"}
@@ -52,7 +52,7 @@ describe("InputField", () => {
52
52
  it("(4) Should render inputLeftIcon if provided", () => {
53
53
  const leftIcon = <span data-testid="left-icon">Icon</span>;
54
54
  const { getByTestId } = render(
55
- <InputField
55
+ <Components.InputField
56
56
  id={"testLeftId"}
57
57
  labelText={""}
58
58
  ariaLabel={"test ariaLabel"}
@@ -66,7 +66,7 @@ describe("InputField", () => {
66
66
  const onChange = jest.fn();
67
67
  const value = "test value";
68
68
  const { getByPlaceholderText, getByTestId } = render(
69
- <InputField
69
+ <Components.InputField
70
70
  id={"testId"}
71
71
  labelText={""}
72
72
  ariaLabel={"test ariaLabel"}
@@ -87,7 +87,7 @@ describe("InputField", () => {
87
87
 
88
88
  it("(6) Should apply focused class on focus", () => {
89
89
  const { getByPlaceholderText, container } = render(
90
- <InputField
90
+ <Components.InputField
91
91
  id={"testFocusedId"}
92
92
  labelText={""}
93
93
  ariaLabel={"test ariaLabel"}
package/index.tsx CHANGED
@@ -1,3 +1,3 @@
1
- import { InputField } from "src/baseComponents/InputField";
1
+ import { Components } from "./src/components";
2
2
 
3
- export { InputField };
3
+ export { Components };
package/jest.config.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import nextJest from 'next/jest';
2
+ import type { Config } from '@jest/types';
2
3
 
3
4
  const createJestConfig = nextJest({
4
5
  dir: './'
5
6
  });
6
7
 
7
- const customJestConfig = {
8
+ const customJestConfig: Config.InitialOptions = {
8
9
  collectCoverage: true,
9
10
  collectCoverageFrom: [
10
11
  'src/**/*.tsx'
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@egov3/system-design",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "type": "module",
5
- "main": "index.tsx",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
6
7
  "private": false,
7
8
  "publishConfig": {
8
9
  "access": "public"
@@ -12,12 +13,13 @@
12
13
  "url": "https://github.com/Zhassulan-Baigozha/egov3-design.git"
13
14
  },
14
15
  "scripts": {
16
+ "build": "tsc --project tsconfig.json",
15
17
  "lint": "next lint",
16
18
  "test": "jest",
17
19
  "test:unit:update": "jest -u",
18
20
  "test:unit:coverage": "jest --coverage",
19
21
  "lint-staged": "lint-staged",
20
- "type-check": "tsc --project tsconfig.json --pretty --noEmit && echo ",
22
+ "type-check": "tsc --project tsconfig.json --pretty --noEmit && echo",
21
23
  "prepare": "cross-env NODE_ENV=development yarn prepare:dev",
22
24
  "prepare:dev": "husky install",
23
25
  "storybook": "storybook dev -p 6006",
@@ -58,8 +60,8 @@
58
60
  "@testing-library/react": "^14.3.1",
59
61
  "@types/jest": "^29.5.14",
60
62
  "@types/node": "^20.11.19",
61
- "@types/react": "^18.3.3",
62
- "@types/react-dom": "^18.3.0",
63
+ "@types/react": "^18.3.12",
64
+ "@types/react-dom": "^18.3.1",
63
65
  "@types/react-test-renderer": "^18.0.7",
64
66
  "@typescript-eslint/eslint-plugin": "^6.21.0",
65
67
  "@typescript-eslint/parser": "^6.21.0",
@@ -79,7 +81,8 @@
79
81
  "npm-check-updates": "^16.14.18",
80
82
  "prettier": "^3.2.5",
81
83
  "react-test-renderer": "^18.2.0",
82
- "sass": "^1.75.0",
84
+ "sass": "^1.80.5",
85
+ "sass-loader": "^16.0.2",
83
86
  "storybook": "^8.0.8",
84
87
  "ts-node": "^10.9.2",
85
88
  "typescript": "^5.4.0"
@@ -9,7 +9,7 @@ import { ClearIcon } from "~svg";
9
9
 
10
10
  export type TOtpType = "OTP" | "TEXT";
11
11
 
12
- interface IInputFieldProps {
12
+ export interface IInputFieldProps {
13
13
  onFocus?: () => void;
14
14
  onBlur?: () => void;
15
15
  onEnterPress?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
@@ -1,3 +1,3 @@
1
1
  import { InputField } from "./InputField";
2
2
 
3
- export { InputField };
3
+ export const Components = { InputField };
@@ -1,11 +1,11 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { fn } from "@storybook/test";
3
3
 
4
- import { Button } from "~baseComponents";
4
+ import { Components } from "~components";
5
5
 
6
6
  const meta = {
7
- title: "baseComponents/Button",
8
- component: Button,
7
+ title: "Components/Button",
8
+ component: Components.Button,
9
9
  parameters: {
10
10
  layout: "centered",
11
11
  },
@@ -14,7 +14,7 @@ const meta = {
14
14
  args: {
15
15
  onClick: fn(),
16
16
  },
17
- } satisfies Meta<typeof Button>;
17
+ } satisfies Meta<typeof Components.Button>;
18
18
 
19
19
  export default meta;
20
20
  type Story = StoryObj<typeof meta>;
package/tsconfig.json CHANGED
@@ -1,38 +1,38 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "types": ["@types/react", "@types/react-dom"],
3
+ "target": "es6",
4
+ "module": "commonjs",
5
+ "jsx": "react-jsx",
6
+ "outDir": "./dist",
4
7
  "baseUrl": "./",
5
- "target": "ESNext",
8
+ "paths": {
9
+ "~utils/*": ["./src/utils/*"],
10
+ "~components": ["./src/components/index"],
11
+ "~svg": ["./src/svg/index"]
12
+ },
6
13
  "lib": ["dom", "dom.iterable", "esnext"],
14
+ "types": ["@types/react", "@types/react-dom"],
7
15
  "allowJs": true,
8
16
  "skipLibCheck": true,
9
17
  "strict": true,
10
- "noEmit": true,
18
+ "noEmit": false,
19
+ "declaration": true,
11
20
  "esModuleInterop": true,
12
- "module": "ESNext",
13
21
  "allowSyntheticDefaultImports": true,
14
22
  "moduleResolution": "node",
15
23
  "resolveJsonModule": true,
16
24
  "isolatedModules": true,
17
- "jsx": "preserve",
18
25
  "incremental": true,
19
- "plugins": [
20
- {
21
- "name": "next"
22
- }
23
- ],
24
- "paths": {
25
- "~utils/*": ["./src/utils/*"],
26
- "~baseComponents": ["./src/baseComponents/index"],
27
- "~svg": ["./src/svg/index"]
28
- }
26
+ "plugins": [{ "name": "next" }]
29
27
  },
30
28
  "include": [
29
+ "src",
31
30
  "next-env.d.ts",
32
31
  "**/*.ts",
33
32
  "**/*.tsx",
34
33
  "**/*.css",
35
- ".next/types/**/*.ts"
34
+ ".next/types/**/*.ts",
35
+ "@types"
36
36
  ],
37
- "exclude": ["node_modules"]
37
+ "exclude": ["node_modules", "__tests__", "src/stories", "dist"]
38
38
  }
@@ -1 +0,0 @@
1
- declare module '*.module.scss';