ml-ui-lib 1.0.8 → 1.0.9

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,27 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
2
+
3
+ /* Common global styles for all ml-ui-lib components */
4
+ :root {
5
+ --ml-font-family: 'Poppins', sans-serif;
6
+ --ml-color-primary: #0070f3;
7
+ --ml-color-secondary: #eaeaea;
8
+ --ml-radius: 6px;
9
+ }
10
+
11
+ * {
12
+ box-sizing: border-box;
13
+ }
14
+
15
+ body {
16
+ font-family: var(--ml-font-family);
17
+ margin: 0;
18
+ padding: 0;
19
+ background-color: #fff;
20
+ color: #111;
21
+ }
22
+
23
+ button {
24
+ font-family: inherit;
25
+ border-radius: var(--ml-radius);
26
+ transition: all 0.2s ease;
27
+ }
@@ -0,0 +1,24 @@
1
+ .btn {
2
+ border: none;
3
+ border-radius: 6px;
4
+ padding: 10px 16px;
5
+ cursor: pointer;
6
+ font-size: 16px;
7
+ /* margin: 10px; */
8
+ }
9
+
10
+ .btn-default {
11
+ background: #ffffff;
12
+ color: #5d5d5d;
13
+ border: solid 0.5px #5d5d5d;
14
+ }
15
+
16
+ .btn-red {
17
+ background: #ff0000;
18
+ color: #ffffff;
19
+ }
20
+
21
+ .btn-black {
22
+ background: #333333;
23
+ color: #ffffff;
24
+ }
@@ -0,0 +1,103 @@
1
+ .datepicker-wrapper {
2
+ position: relative;
3
+ font-family: "Poppins", sans-serif;
4
+ width: 250px;
5
+ }
6
+
7
+ .datepicker-input-wrapper {
8
+ display: flex;
9
+ align-items: center;
10
+ position: relative;
11
+ cursor: pointer;
12
+ }
13
+
14
+ .datepicker-input {
15
+ width: 100%;
16
+ padding: 10px 36px 10px 12px;
17
+ border: 1px solid #ddd;
18
+ border-radius: 6px;
19
+ font-size: 15px;
20
+ cursor: pointer;
21
+ }
22
+
23
+ .datepicker-icon {
24
+ position: absolute;
25
+ right: 10px;
26
+ pointer-events: none;
27
+ color: #666;
28
+ }
29
+
30
+ .datepicker-calendar {
31
+ position: absolute;
32
+ top: 45px;
33
+ width: 100%;
34
+ background: #fff;
35
+ border: 1px solid #ddd;
36
+ border-radius: 6px;
37
+ box-shadow: 0 4px 12px rgba(0,0,0,0.1);
38
+ z-index: 10;
39
+ padding: 8px;
40
+ }
41
+
42
+ .datepicker-header {
43
+ display: flex;
44
+ justify-content: space-between;
45
+ align-items: center;
46
+ margin-bottom: 8px;
47
+ font-weight: 500;
48
+ }
49
+
50
+ .datepicker-weekdays {
51
+ display: grid;
52
+ grid-template-columns: repeat(7, 1fr);
53
+ text-align: center;
54
+ font-weight: 500;
55
+ margin-bottom: 4px;
56
+ }
57
+
58
+ .datepicker-weekday {
59
+ font-size: 12px;
60
+ }
61
+
62
+ .datepicker-days-grid {
63
+ display: grid;
64
+ grid-template-columns: repeat(7, 1fr);
65
+ gap: 4px;
66
+ }
67
+
68
+ .datepicker-day {
69
+ text-align: center;
70
+ padding: 6px 0;
71
+ cursor: pointer;
72
+ border-radius: 4px;
73
+ }
74
+
75
+ .datepicker-day:hover {
76
+ background: #f0f0f0;
77
+ }
78
+
79
+ .datepicker-day.selected {
80
+ background: #ff4d4d;
81
+ color: #fff;
82
+ font-weight: 500;
83
+ }
84
+
85
+ .datepicker-day.today {
86
+ border: 1px solid #ff4d4d;
87
+ border-radius: 50%;
88
+ }
89
+
90
+ .datepicker-day.empty {
91
+ pointer-events: none;
92
+ }
93
+
94
+ .has-error .datepicker-input {
95
+ border-color: #ff4d4d;
96
+ }
97
+
98
+ .datepicker-error {
99
+ color: #ff4d4d;
100
+ font-size: 13px;
101
+ margin-top: 4px;
102
+ display: block;
103
+ }
@@ -0,0 +1,113 @@
1
+ .date-picker-wrapper {
2
+ display: flex;
3
+ gap: 8px;
4
+ font-family: "Poppins", sans-serif;
5
+ flex-wrap: wrap;
6
+ }
7
+
8
+ .full-width {
9
+ flex: 1 1 100px;
10
+ /* position: relative; */
11
+ }
12
+
13
+ .date-picker-dropdown {
14
+ cursor: pointer;
15
+ background: #fff;
16
+ border: 1px solid #ddd;
17
+ border-radius: 6px;
18
+ align-items: center;
19
+ padding: 0.4rem 0.6rem;
20
+ display: flex;
21
+ justify-content: space-between;
22
+ width: 100%;
23
+ }
24
+
25
+ .date-picker-dropdown-carret {
26
+ font-size: 12px;
27
+ color: #666;
28
+ }
29
+
30
+ .date-picker-grid-wrapper {
31
+ width: 30%;
32
+ position: absolute;
33
+ /* left: 0px; */
34
+ /* top: 40px;
35
+ background: #fff;
36
+ border: 1px solid #ddd;
37
+ border-radius: 6px;
38
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
39
+ z-index: 10; */
40
+ }
41
+
42
+ .date-picker-header {
43
+ display: flex;
44
+ justify-content: space-between;
45
+ flex-direction: row;
46
+ position: absolute;
47
+ z-index: 100;
48
+ left: 0px;
49
+ padding: 10px;
50
+ width: 100%;
51
+ background-color: #f5f5f5;
52
+ margin-top: 5px;
53
+ border-top-left-radius: 8px;
54
+ border-top-right-radius: 8px;
55
+ }
56
+
57
+ .date-picker-header button {
58
+ background-color: #ffffff;
59
+ color: #5f5f5f;
60
+ border-radius: 15px;
61
+ border: 0.5px solid #5f5f5f;
62
+ }
63
+
64
+ .date-picker-grid {
65
+ display: grid;
66
+ grid-template-columns: repeat(3, 1fr);
67
+ gap: 8px;
68
+ padding: 10px;
69
+ background-color: white;
70
+ border-radius: 8px;
71
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
72
+ max-height: 250px;
73
+ overflow-y: auto;
74
+ position: absolute;
75
+ z-index: 30;
76
+ width: 100%;
77
+ margin-top: 45px;
78
+ left: 0px;
79
+ }
80
+
81
+ .date-picker-dropdown-option {
82
+ text-align: center;
83
+ padding: 10px;
84
+ border-radius: 6px;
85
+ cursor: pointer;
86
+ /* font-size: 14px;
87
+ font-weight: 500; */
88
+ transition: background-color 0.2s ease, color 0.2s ease;
89
+ user-select: none;
90
+ }
91
+
92
+ .date-picker-dropdown-option:hover {
93
+ background-color: #f0f0f0;
94
+ }
95
+
96
+ .date-picker-dropdown-option.selected {
97
+ background-color: #333;
98
+ color: #fff;
99
+ }
100
+
101
+ .date-picker-empty {
102
+ gap: 8px;
103
+ padding: 10px;
104
+ background-color: white;
105
+ border-radius: 8px;
106
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
107
+ overflow-y: auto;
108
+ position: absolute;
109
+ z-index: 30;
110
+ /* width: 100%; */
111
+ margin-top: 10px;
112
+ left: 0px;
113
+ }
@@ -0,0 +1,84 @@
1
+ .dropdown-wrapper {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ font-family: "Poppins", sans-serif;
6
+ gap: 4px;
7
+ }
8
+
9
+ .dropdown-label {
10
+ font-size: 14px;
11
+ font-weight: 500;
12
+ color: #333;
13
+ }
14
+
15
+ .dropdown-trigger {
16
+ display: flex;
17
+ justify-content: space-between;
18
+ align-items: center;
19
+ padding: 10px 12px;
20
+ border: 1px solid #ddd;
21
+ border-radius: 6px;
22
+ background: #fff;
23
+ cursor: pointer;
24
+ transition: border-color 0.2s;
25
+ }
26
+
27
+ .dropdown-trigger:hover {
28
+ border-color: #888;
29
+ }
30
+
31
+ .dropdown-value {
32
+ font-size: 15px;
33
+ color: #333;
34
+ }
35
+
36
+ .dropdown-caret {
37
+ font-size: 12px;
38
+ color: #666;
39
+ }
40
+
41
+ .dropdown-list {
42
+ position: absolute;
43
+ top: 100%;
44
+ left: 0;
45
+ width: 100%;
46
+ background: #fff;
47
+ border: 1px solid #ddd;
48
+ border-radius: 6px;
49
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
50
+ z-index: 10;
51
+ max-height: 200px;
52
+ overflow-y: auto;
53
+ margin-top: 4px;
54
+ }
55
+
56
+ .dropdown-option {
57
+ padding: 8px 12px;
58
+ cursor: pointer;
59
+ transition: background 0.2s;
60
+ }
61
+
62
+ .dropdown-option:hover {
63
+ background: #f5f5f5;
64
+ }
65
+
66
+ .dropdown-option.selected {
67
+ background: #ff4d4d10;
68
+ font-weight: 500;
69
+ }
70
+
71
+ .dropdown-empty {
72
+ padding: 8px 12px;
73
+ color: #999;
74
+ }
75
+
76
+ .dropdown-error {
77
+ margin-top: 4px;
78
+ color: #ff4d4d;
79
+ font-size: 13px;
80
+ }
81
+
82
+ .has-error .dropdown-trigger {
83
+ border-color: #ff4d4d;
84
+ }
@@ -0,0 +1,36 @@
1
+ .input-wrapper {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 6px;
5
+ width: 100%;
6
+ }
7
+
8
+ .input-label {
9
+ font-size: 14px;
10
+ font-weight: 500;
11
+ color: #333;
12
+ }
13
+
14
+ .input {
15
+ font-family: 'Poppins', sans-serif;
16
+ font-size: 15px;
17
+ padding: 10px 12px;
18
+ border: 1px solid #ccc;
19
+ border-radius: 6px;
20
+ outline: none;
21
+ transition: all 0.2s ease;
22
+ }
23
+
24
+ .input:focus {
25
+ border-color: #0070f3;
26
+ box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.2);
27
+ }
28
+
29
+ .input-error {
30
+ border-color: #ff4d4f;
31
+ }
32
+
33
+ .input-error-text {
34
+ color: #ff4d4f;
35
+ font-size: 12px;
36
+ }
@@ -0,0 +1,81 @@
1
+ .modal-overlay {
2
+ position: fixed;
3
+ inset: 0;
4
+ background: rgba(0, 0, 0, 0.4);
5
+ display: flex;
6
+ justify-content: center;
7
+ align-items: center;
8
+ backdrop-filter: blur(4px);
9
+ animation: fadeIn 0.25s ease;
10
+ }
11
+
12
+ .modal {
13
+ background: #fff;
14
+ border-radius: 10px;
15
+ padding: 24px;
16
+ max-width: 420px;
17
+ width: 90%;
18
+ box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
19
+ font-family: "Poppins", sans-serif;
20
+ animation: modalFadeIn 0.25s ease;
21
+ border-top: 5px solid transparent;
22
+ }
23
+
24
+ .modal-header {
25
+ display: flex;
26
+ align-items: center;
27
+ gap: 10px;
28
+ margin-bottom: 16px;
29
+ }
30
+
31
+ .modal-icon {
32
+ width: 26px;
33
+ height: 26px;
34
+ object-fit: contain;
35
+ }
36
+
37
+ .modal-title {
38
+ font-size: 20px;
39
+ font-weight: 600;
40
+ }
41
+
42
+ /* Variants */
43
+ .modal-default {
44
+ border-color: #ccc;
45
+ }
46
+
47
+ .modal-info {
48
+ border-color: #3b82f6;
49
+ }
50
+
51
+ .modal-success {
52
+ border-color: #22c55e;
53
+ }
54
+
55
+ .modal-warning {
56
+ border-color: #f59e0b;
57
+ }
58
+
59
+ .modal-error {
60
+ border-color: #ef4444;
61
+ }
62
+
63
+ @keyframes modalFadeIn {
64
+ from {
65
+ opacity: 0;
66
+ transform: translateY(-10px);
67
+ }
68
+ to {
69
+ opacity: 1;
70
+ transform: translateY(0);
71
+ }
72
+ }
73
+
74
+ @keyframes fadeIn {
75
+ from {
76
+ opacity: 0;
77
+ }
78
+ to {
79
+ opacity: 1;
80
+ }
81
+ }
@@ -0,0 +1,78 @@
1
+ .phone-input-wrapper {
2
+ position: relative;
3
+ display: flex;
4
+ align-items: center;
5
+ gap: 8px;
6
+ width: 100%;
7
+ font-family: "Poppins", sans-serif;
8
+ }
9
+
10
+ .country-dropdown {
11
+ display: flex;
12
+ align-items: center;
13
+ gap: 6px;
14
+ padding: 10.5px 10px;
15
+ border: 1px solid #ddd;
16
+ border-radius: 6px;
17
+ background: #fff;
18
+ cursor: pointer;
19
+ }
20
+
21
+ .country-flag {
22
+ width: 20px;
23
+ height: 14px;
24
+ border-radius: 2px;
25
+ }
26
+
27
+ .country-code {
28
+ font-size: 15px;
29
+ color: #333;
30
+ }
31
+
32
+ .country-dropdown-menu {
33
+ position: absolute;
34
+ top: 50px;
35
+ left: 0;
36
+ width: 180px;
37
+ background: #fff;
38
+ border: 1px solid #ddd;
39
+ border-radius: 8px;
40
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
41
+ z-index: 10;
42
+ max-height: 200px;
43
+ overflow-y: auto;
44
+ }
45
+
46
+ .country-dropdown-item {
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: space-between;
50
+ padding: 8px 10px;
51
+ cursor: pointer;
52
+ transition: background 0.2s;
53
+ }
54
+
55
+ .country-dropdown-item:hover {
56
+ background: #f5f5f5;
57
+ }
58
+
59
+ .country-code-text {
60
+ font-size: 13px;
61
+ color: #777;
62
+ }
63
+
64
+ .phone-input {
65
+ flex: 1;
66
+ padding: 10px 14px;
67
+ border: 1px solid #ddd;
68
+ border-radius: 6px;
69
+ font-size: 15px;
70
+ font-family: inherit;
71
+ outline: none;
72
+ transition: border-color 0.2s, box-shadow 0.2s;
73
+ }
74
+
75
+ .phone-input:focus {
76
+ border-color: #ff4d4d;
77
+ box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.1);
78
+ }
package/package.json CHANGED
@@ -1,41 +1,29 @@
1
1
  {
2
2
  "name": "ml-ui-lib",
3
- "version": "1.0.8",
4
- "author": "Kenneth James B. Simbulan",
5
- "license": "MIT",
3
+ "version": "1.0.9",
6
4
  "main": "dist/index.js",
7
5
  "module": "dist/index.esm.js",
8
6
  "types": "dist/index.d.ts",
7
+ "author": "Kenneth James B. Simbulan",
9
8
  "files": [
10
9
  "dist"
11
10
  ],
12
11
  "scripts": {
13
- "build": "tsc && npm run copy-css",
14
- "copy-css": "npm exec copyfiles -- 'src/**/*.css' dist",
12
+ "clean": "rimraf dist",
13
+ "build": "npm run clean && tsc && npm run copy-assets",
14
+ "copy-assets": "copyfiles -u 1 \"src/**/*.css\" \"src/**/*.png\" dist/",
15
15
  "watch": "tsc --watch",
16
- "dev": "npm run build -- --watch",
17
- "prepare": "npm run build",
18
- "clean": "rimraf dist"
16
+ "dev": "npm run build -- --watch"
19
17
  },
20
18
  "peerDependencies": {
21
19
  "react": ">=17",
22
20
  "react-dom": ">=17"
23
21
  },
24
22
  "devDependencies": {
25
- "@types/react": "^18.3.10",
26
- "@types/react-dom": "^18.3.10",
23
+ "@types/react": "^18.0.0",
24
+ "@types/react-dom": "^18.0.0",
27
25
  "copyfiles": "^2.4.1",
28
- "typescript": "^5.6.3",
29
- "rimraf": "^6.0.1"
30
- },
31
- "keywords": [
32
- "react",
33
- "ui-library",
34
- "components",
35
- "typescript",
36
- "ml",
37
- "ml-ui-lib",
38
- "kenneth-simbulan"
39
- ],
40
- "homepage": "https://www.npmjs.com/package/ml-ui-lib"
26
+ "rimraf": "^5.0.10",
27
+ "typescript": "^5.9.3"
28
+ }
41
29
  }
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import "./Alert.css";
3
- export type AlertVariant = "info" | "error" | "warning" | "success";
4
- export interface AlertProps {
5
- variant?: AlertVariant;
6
- title?: string;
7
- message: string;
8
- }
9
- export declare const Alert: React.FC<AlertProps>;
10
- export default Alert;
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./Alert.css";
3
- export const Alert = ({ variant = "info", title, message, }) => {
4
- return (_jsx("div", { className: `alert alert-${variant}`, children: _jsxs("div", { className: "alert-content", children: [title && _jsx("strong", { className: "alert-title", children: title }), _jsx("p", { className: "alert-message", children: message })] }) }));
5
- };
6
- export default Alert;
@@ -1 +0,0 @@
1
- {"root":["../src/declarations.d.ts","../src/index.ts","../src/components/alert/alert.tsx","../src/components/button/button.tsx","../src/components/datepicker/datepicker.tsx","../src/components/datepicker2/datepicker2.tsx","../src/components/dropdown/dropdown.tsx","../src/components/input/input.tsx","../src/components/modal/modal.tsx","../src/components/phoneinput/phoneinput.tsx"],"version":"5.9.3"}