ml-ui-lib 1.0.13 → 1.0.15

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.
@@ -16,12 +16,14 @@ export const Accordion = ({ items }) => {
16
16
  }
17
17
  });
18
18
  }, [openIndexes]);
19
- return (_jsx("div", { className: "accordion", children: items.map((group, groupIndex) => (_jsxs("div", { className: "accordion-group", children: [group.title && _jsx("h3", { className: "accordion-group-title", children: group.title }), group.items.map((item, itemIndex) => {
19
+ return (_jsx("div", { className: "accordion", children: items.map((group, groupIndex) => (_jsxs("div", { className: "accordion-group", children: [group.title && (_jsx("h3", { className: "accordion-group-title", children: group.title })), group.items.map((item, itemIndex) => {
20
20
  const index = groupIndex * 1000 + itemIndex;
21
21
  const isOpen = openIndexes.includes(index);
22
- return (_jsxs("div", { className: `accordion-item ${isOpen ? "open" : ""}`, children: [_jsxs("button", { className: "accordion-header", onClick: () => toggleItem(index), children: [_jsx("span", { className: "accordion-title", children: item.title }), _jsx("span", { className: `accordion-icon ${isOpen ? "open" : ""}`, children: "\u25BC" })] }), _jsx("div", { ref: (el) => (contentRefs.current[index] = el), className: "accordion-content-wrapper", style: {
22
+ return (_jsxs("div", { className: `accordion-item ${isOpen ? "open" : ""}`, children: [_jsxs("button", { className: "accordion-header", onClick: () => toggleItem(index), children: [_jsx("span", { className: "accordion-title", children: item.title }), _jsx("span", { className: `accordion-icon ${isOpen ? "open" : ""}`, children: "\u25BC" })] }), _jsx("div", { ref: (el) => {
23
+ contentRefs.current[index] = el;
24
+ }, className: "accordion-content-wrapper", style: {
23
25
  maxHeight: isOpen
24
- ? `${contentRefs.current[index]?.scrollHeight}px`
26
+ ? `${contentRefs.current[index]?.scrollHeight || 0}px`
25
27
  : "0px",
26
28
  }, children: _jsx("div", { className: "accordion-content", children: item.content }) })] }, index));
27
29
  })] }, groupIndex))) }));
@@ -11,7 +11,7 @@ export interface CarouselItem {
11
11
  title: string;
12
12
  description?: string;
13
13
  image?: string;
14
- buttons?: CarouselButton[];
14
+ buttons?: React.ReactNode[];
15
15
  }
16
16
  export interface CarouselProps {
17
17
  items: CarouselItem[];
@@ -1,8 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useState, useEffect } from 'react';
3
+ import React, { useState, useEffect } from 'react';
4
4
  import './Carousel.css';
5
- import { Button } from '../Button/Button';
6
5
  export const Carousel = ({ items, autoSlide = true, interval = 5000, color }) => {
7
6
  const [current, setCurrent] = useState(0);
8
7
  // Auto-slide
@@ -19,5 +18,5 @@ export const Carousel = ({ items, autoSlide = true, interval = 5000, color }) =>
19
18
  }, [autoSlide, interval, items.length]);
20
19
  const nextSlide = () => setCurrent((prev) => (prev + 1) % items.length);
21
20
  const prevSlide = () => setCurrent((prev) => (prev - 1 + items.length) % items.length);
22
- return (_jsxs("div", { className: "carousel", children: [_jsx("div", { className: "carousel-track", children: items.map((item, index) => (_jsxs("div", { className: `carousel-slide fade ${index === current ? 'active' : ''}`, children: [_jsxs("div", { className: "carousel-text", children: [_jsx("h2", { style: { color }, children: item.title }), item.description && _jsx("p", { style: { color }, children: item.description }), item.buttons && item.buttons.length > 0 && (_jsx("div", { className: "carousel-buttons", children: item.buttons.slice(0, 2).map((btn, idx) => btn.link ? (_jsx("a", { href: btn.link, target: btn.target || '_self', rel: btn.target === '_blank' ? 'noopener noreferrer' : undefined, children: _jsx(Button, { label: btn.label, variant: btn.variant || 'default' }) }, idx)) : (_jsx(Button, { label: btn.label, variant: btn.variant || 'default', onClick: btn.onClick }, idx))) }))] }), item.image && (_jsxs("div", { className: "carousel-image", children: [_jsx("img", { src: item.image, alt: item.title }), _jsx("span", { className: "tranparentClass" })] }))] }, index))) }), _jsx("button", { className: "carousel-control prev", onClick: prevSlide, children: "\u276E" }), _jsx("button", { className: "carousel-control next", onClick: nextSlide, children: "\u276F" })] }));
21
+ return (_jsxs("div", { className: "carousel", children: [_jsx("div", { className: "carousel-track", children: items.map((item, index) => (_jsxs("div", { className: `carousel-slide fade ${index === current ? 'active' : ''}`, children: [_jsxs("div", { className: "carousel-text", children: [_jsx("h2", { style: { color }, children: item.title }), item.description && _jsx("p", { style: { color }, children: item.description }), item.buttons && item.buttons.length > 0 && (_jsx("div", { className: "carousel-buttons", children: item.buttons.map((btn, idx) => (_jsx(React.Fragment, { children: btn }, idx))) }))] }), item.image && (_jsxs("div", { className: "carousel-image", children: [_jsx("img", { src: item.image, alt: item.title }), _jsx("span", { className: "tranparentClass" })] }))] }, index))) }), _jsx("button", { className: "carousel-control prev", onClick: prevSlide, children: "\u276E" }), _jsx("button", { className: "carousel-control next", onClick: nextSlide, children: "\u276F" })] }));
23
22
  };
@@ -11,9 +11,9 @@ export const Footer = ({ footerItems, logoSrc = '', logoAlt = 'M Lhuillier Logo'
11
11
  { url: '/images/TPI.svg', name: 'TPI' },
12
12
  ];
13
13
  const appLinksArr = [
14
- { url: '/images/app-store.svg', link: '' },
15
- { url: '/images/google-play.svg', link: '' },
16
- { url: '/images/app-gallery.svg', link: '' },
14
+ { url: '/images/app-store.svg', link: 'https://apps.apple.com/ph/app/mcash-wallet/id962204987' },
15
+ { url: '/images/google-play.svg', link: 'https://play.google.com/store/apps/details?id=com.mlhuillier.mlwallet&pli=1' },
16
+ { url: '/images/app-gallery.svg', link: 'https://appgallery.huawei.com/app/C102221791?source=qrCodeShare&referrer=PCWebAG&callType=SHARE&shareTo=qrcode&shareFrom=appmarket&reportEventLabel=appdetailpage' },
17
17
  ];
18
18
  return (_jsxs("footer", { className: `footer ${className}`, style: { backgroundColor, color: textColor }, children: [_jsx("div", { className: "footer-container", children: _jsxs("div", { className: "footer-columns", children: [footerItems.map((group, i) => {
19
19
  // Format the display name
@@ -22,6 +22,11 @@ export const Footer = ({ footerItems, logoSrc = '', logoAlt = 'M Lhuillier Logo'
22
22
  .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
23
23
  .join(' & ');
24
24
  return (_jsxs("div", { className: `footer-column footer-column-${i + 1}`, children: [_jsx("h4", { className: "footer-title", children: displayName }), _jsx("ul", { className: "footer-links", children: group.items.map((item, idx) => (_jsx("li", { children: _jsx("a", { href: item.link, target: item.target || '_self', rel: item.target === '_blank' ? 'noopener noreferrer' : undefined, children: item.name }) }, idx))) })] }, i));
25
- }), _jsxs("div", { className: "footer-column socials-and-apps", children: [_jsxs("div", { className: "socials", children: [_jsx("h4", { children: "Social Media" }), _jsx("div", { className: "socials-items", children: ['fb', 'ig', 'x', 'yt'].map((icon) => (_jsx("img", { src: `/icons/${icon}.svg`, alt: icon }, icon))) })] }), _jsxs("div", { className: "apps", children: [_jsx("h4", { children: "Get the MCash App" }), _jsx("div", { className: "app-items", children: appLinksArr.map((item, index) => (_jsx("img", { src: item.url, alt: "App download" }, index))) })] })] })] }) }), _jsxs("div", { className: 'others', children: [_jsxs("div", { className: "footer-logo", children: [_jsx("a", { href: "/", children: _jsx("img", { src: logoSrc, alt: logoAlt, width: logoWidth, height: logoHeight, style: { display: 'block' } }) }), _jsx("span", { children: "FINANCIAL SERVICES, INC." }), _jsx("br", {}), _jsx("span", { children: "M.Lhuillier Financial Services, Inc. is regulated by the Bangko Sentral ng Pilipinas (BSP). For inquiries or assistance, you may reach us via:" }), _jsx("span", { children: _jsxs("ul", { children: [_jsx("li", { children: "Email: customercare@mlhuillier.com" }), _jsx("li", { children: "Or through our official Social media channels: consumeraaffairs@bsp.gov.ph" })] }) })] }), _jsx("div", { className: 'emblems', children: empblemArr.map((item, index) => (_jsxs("div", { className: "emblem-item", children: [_jsx("img", { src: item.url, alt: item.name }), _jsx("span", { children: item.name })] }, index))) })] }), _jsxs("div", { className: "footer-bottom", children: [_jsxs("p", { children: ["Copyright \u00A9 ", new Date().getFullYear(), " M.Lhuillier Financial Services, Inc."] }), " ", _jsx("p", { children: "All rights reserved." })] })] }));
25
+ }), _jsxs("div", { className: "footer-column socials-and-apps", children: [_jsxs("div", { className: "socials", children: [_jsx("h4", { children: "Social Media" }), _jsx("div", { className: "socials-items", children: [
26
+ { name: 'fb', link: 'https://www.facebook.com/mlhuillier.official/' },
27
+ { name: 'ig', link: 'https://www.instagram.com/mlhuillier_official/' },
28
+ { name: 'x', link: 'https://x.com/KaMLhuillier' },
29
+ { name: 'yt', link: 'https://www.youtube.com/user/MLhuillierInc' },
30
+ ].map((icon) => (_jsx("a", { href: icon.link, target: "_blank", rel: "noopener noreferrer", children: _jsx("img", { src: `/icons/${icon.name}.svg`, alt: icon.name }) }, icon.name))) })] }), _jsxs("div", { className: "apps", children: [_jsx("h4", { children: "Get the MCash App" }), _jsx("div", { className: "app-items", children: appLinksArr.map((item, index) => (_jsx("a", { href: item.link, children: _jsx("img", { src: item.url, alt: "App download" }) }, index))) })] })] })] }) }), _jsxs("div", { className: 'others', children: [_jsxs("div", { className: "footer-logo", children: [_jsx("a", { href: "/", children: _jsx("img", { src: logoSrc, alt: logoAlt, width: logoWidth, height: logoHeight, style: { display: 'block' } }) }), _jsx("span", { children: "FINANCIAL SERVICES, INC." }), _jsx("br", {}), _jsx("span", { children: "M.Lhuillier Financial Services, Inc. is regulated by the Bangko Sentral ng Pilipinas (BSP). For inquiries or assistance, you may reach us via:" }), _jsx("span", { children: _jsxs("ul", { children: [_jsx("li", { children: "Email: customercare@mlhuillier.com" }), _jsx("li", { children: "Or through our official Social media channels: consumeraaffairs@bsp.gov.ph" })] }) })] }), _jsx("div", { className: 'emblems', children: empblemArr.map((item, index) => (_jsxs("div", { className: "emblem-item", children: [_jsx("img", { src: item.url, alt: item.name }), _jsx("span", { children: item.name })] }, index))) })] }), _jsxs("div", { className: "footer-bottom", children: [_jsxs("p", { children: ["Copyright \u00A9 ", new Date().getFullYear(), " M.Lhuillier Financial Services, Inc."] }), " ", _jsx("p", { children: "All rights reserved." })] })] }));
26
31
  };
27
32
  export default Footer;
@@ -34,3 +34,39 @@
34
34
  color: #ff4d4f;
35
35
  font-size: 12px;
36
36
  }
37
+
38
+ .input-container {
39
+ position: relative;
40
+ width: 100%;
41
+ }
42
+
43
+ .has-search-icon .search-icon {
44
+ position: absolute;
45
+ left: 12px;
46
+ top: 50%;
47
+ transform: translateY(-50%);
48
+ width: 14px;
49
+ height: 14px;
50
+ border: 2px solid #888;
51
+ border-radius: 50%;
52
+ }
53
+
54
+ .has-search-icon .search-icon::after {
55
+ content: "";
56
+ position: absolute;
57
+ right: -4px;
58
+ bottom: -2px;
59
+ width: 7px;
60
+ height: 2px;
61
+ background: #888;
62
+ transform: rotate(45deg);
63
+ border-radius: 1px;
64
+ }
65
+
66
+ .input-with-icon {
67
+ padding-left: 36px; /* space for search icon */
68
+ }
69
+
70
+ input {
71
+ width: 100%;
72
+ }
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import "./Input.css";
3
- export const Input = ({ label, error, ...props }) => {
4
- return (_jsxs("div", { className: "input-wrapper", children: [label && _jsx("label", { className: "input-label", children: label }), _jsx("input", { className: `input ${error ? "input-error" : ""}`, ...props, autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: false }), error && _jsx("span", { className: "input-error-text", children: error })] }));
3
+ export const Input = ({ label, error, type, ...props }) => {
4
+ const isSearch = type === "search";
5
+ return (_jsxs("div", { className: "input-wrapper", children: [label && _jsx("label", { className: "input-label", children: label }), _jsxs("div", { className: `input-container ${isSearch ? "has-search-icon" : ""}`, children: [isSearch && _jsx("span", { className: "search-icon" }), _jsx("input", { type: type, className: `input ${error ? "input-error" : ""} ${isSearch ? "input-with-icon" : ""}`, ...props, autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: false })] }), error && _jsx("span", { className: "input-error-text", children: error })] }));
5
6
  };
@@ -1,58 +1,90 @@
1
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;
2
+ position: fixed;
3
+ inset: 0;
4
+ background: rgba(0, 0, 0, 0.4);
5
+ display: flex;
6
+ justify-content: center;
7
+ align-items: flex-start;
8
+ backdrop-filter: blur(4px);
9
+ animation: fadeIn 0.25s ease;
10
+ overflow-y: auto;
11
+ padding: 40px 0;
12
+ z-index: 9999;
10
13
  }
11
14
 
12
15
  .modal {
13
- background: #fff;
14
- border-radius: 10px;
15
- padding: 24px;
16
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
17
- animation: modalFadeIn 0.25s ease;
18
- border-top: 5px solid transparent;
19
- box-sizing: border-box;
16
+ background: #fff;
17
+ border-radius: 10px;
18
+ padding: 24px;
19
+ box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
20
+ animation: modalFadeIn 0.25s ease;
21
+ border-top: 5px solid transparent;
22
+ box-sizing: border-box;
23
+ max-width: 600px;
24
+ margin-top: 70px;
25
+ width: 100%;
20
26
  }
21
27
 
22
28
  /* Variants */
23
- .modal-default { border-color: #ccc; }
24
- .modal-info { border-color: #3b82f6; }
25
- .modal-success { border-color: #22c55e; }
26
- .modal-warning { border-color: #f59e0b; }
27
- .modal-error { border-color: #ef4444; }
29
+ .modal-default {
30
+ border-color: #ccc;
31
+ }
32
+
33
+ .modal-info {
34
+ border-color: #3b82f6;
35
+ }
36
+
37
+ .modal-success {
38
+ border-color: #22c55e;
39
+ }
40
+
41
+ .modal-warning {
42
+ border-color: #f59e0b;
43
+ }
44
+
45
+ .modal-error {
46
+ border-color: #ef4444;
47
+ }
28
48
 
29
49
  .modal-header {
30
- display: flex;
31
- align-items: center;
32
- gap: 10px;
33
- margin-bottom: 16px;
50
+ display: flex;
51
+ align-items: center;
52
+ gap: 10px;
53
+ margin-bottom: 16px;
34
54
  }
35
55
 
36
56
  .modal-title {
37
- font-size: 20px;
38
- font-weight: 600;
57
+ font-size: 20px;
58
+ font-weight: 600;
39
59
  }
40
60
 
41
61
  /* Animations */
42
62
  @keyframes modalFadeIn {
43
- from { opacity: 0; transform: translateY(-10px); }
44
- to { opacity: 1; transform: translateY(0); }
63
+ from {
64
+ opacity: 0;
65
+ transform: translateY(-10px);
66
+ }
67
+
68
+ to {
69
+ opacity: 1;
70
+ transform: translateY(0);
71
+ }
45
72
  }
46
73
 
47
74
  @keyframes fadeIn {
48
- from { opacity: 0; }
49
- to { opacity: 1; }
75
+ from {
76
+ opacity: 0;
77
+ }
78
+
79
+ to {
80
+ opacity: 1;
81
+ }
50
82
  }
51
83
 
52
- /* Responsive */
84
+ /* Responsive */
53
85
  @media (max-width: 515px) {
54
- .modal {
55
- width: 100% !important;
56
- margin: 0 10px;
57
- }
58
- }
86
+ .modal {
87
+ width: 100% !important;
88
+ margin: 20px 10px;
89
+ }
90
+ }
@@ -0,0 +1,30 @@
1
+ .text-area {
2
+ width: 100%;
3
+ min-height: 4.5em; /* roughly 3 rows */
4
+ padding: 0.6rem 0.8rem;
5
+ border-radius: 8px;
6
+ border: 1px solid #d1d5db;
7
+ font-family: inherit;
8
+ font-size: 0.95rem;
9
+ line-height: 1.4;
10
+ color: #111827;
11
+ resize: vertical;
12
+ background-color: #fff;
13
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
14
+ }
15
+
16
+ .text-area::placeholder {
17
+ color: #9ca3af;
18
+ }
19
+
20
+ .text-area:focus {
21
+ outline: none;
22
+ border-color: #2563eb;
23
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
24
+ }
25
+
26
+ .text-area[readonly] {
27
+ background-color: #f9fafb;
28
+ color: #6b7280;
29
+ cursor: not-allowed;
30
+ }
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import "./TextArea.css";
3
+ export interface TextAreaProps {
4
+ placeholder?: string;
5
+ rows?: number;
6
+ value?: string;
7
+ data?: any;
8
+ readOnly?: boolean;
9
+ className?: string;
10
+ style?: React.CSSProperties;
11
+ onChange?: (value: string) => void;
12
+ id?: string;
13
+ name?: string;
14
+ ariaLabel?: string;
15
+ }
16
+ export declare const TextArea: React.FC<TextAreaProps>;
17
+ export default TextArea;
@@ -0,0 +1,35 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import "./TextArea.css";
5
+ export const TextArea = ({ placeholder, rows = 3, value, data, readOnly = false, className = "", style, onChange, id, name, ariaLabel, }) => {
6
+ const effectiveRows = Math.max(3, Math.floor(rows));
7
+ const [internalValue, setInternalValue] = useState(() => {
8
+ if (typeof value === "string")
9
+ return value;
10
+ if (data !== undefined) {
11
+ return typeof data === "string" ? data : JSON.stringify(data, null, 2);
12
+ }
13
+ return "";
14
+ });
15
+ useEffect(() => {
16
+ if (typeof value === "string") {
17
+ setInternalValue(value);
18
+ }
19
+ else if (data !== undefined && value === undefined) {
20
+ setInternalValue(typeof data === "string" ? data : JSON.stringify(data, null, 2));
21
+ }
22
+ }, [value, data]);
23
+ const handleChange = (e) => {
24
+ const v = e.target.value;
25
+ if (value !== undefined) {
26
+ onChange?.(v);
27
+ }
28
+ else {
29
+ setInternalValue(v);
30
+ onChange?.(v);
31
+ }
32
+ };
33
+ return (_jsx("textarea", { id: id, name: name, "aria-label": ariaLabel ?? placeholder ?? "text-area", placeholder: placeholder, rows: effectiveRows, className: `text-area ${className}`, style: style, readOnly: readOnly, value: internalValue, onChange: handleChange }));
34
+ };
35
+ export default TextArea;
package/dist/index.d.ts CHANGED
@@ -35,3 +35,5 @@ export { PageBanner } from "./components/PageBanner/PageBanner";
35
35
  export type { PageBannerProps } from "./components/PageBanner/PageBanner";
36
36
  export { Carousel } from "./components/Carousel/Carousel";
37
37
  export type { CarouselProps } from "./components/Carousel/Carousel";
38
+ export { TextArea } from "./components/TextArea/TextArea";
39
+ export type { TextAreaProps } from "./components/TextArea/TextArea";
package/dist/index.js CHANGED
@@ -17,3 +17,4 @@ export { Navbar } from "./components/Navbar/Navbar";
17
17
  export { Footer } from "./components/Footer/Footer";
18
18
  export { PageBanner } from "./components/PageBanner/PageBanner";
19
19
  export { Carousel } from "./components/Carousel/Carousel";
20
+ export { TextArea } from "./components/TextArea/TextArea";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ml-ui-lib",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",