@joza/joza-ui-kit 0.1.0 → 0.1.2
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/dist/joza-ui-kit.es.css +2177 -0
- package/dist/joza-ui-kit.es.js +2 -333
- package/dist/joza-ui-kit.es.js.map +1 -1
- package/dist/joza-ui-kit.umd.css +2177 -0
- package/dist/joza-ui-kit.umd.js +5 -339
- package/dist/joza-ui-kit.umd.js.map +1 -1
- package/dist/types/App.d.ts +2 -0
- package/dist/types/component/basic/alert/Alert.d.ts +16 -0
- package/dist/types/component/basic/alert/Alert.stories.d.ts +13 -0
- package/dist/types/component/basic/alert/index.d.ts +2 -0
- package/dist/types/component/basic/animated-stat/animated-stat.d.ts +7 -0
- package/dist/types/component/basic/button/Button.d.ts +11 -0
- package/dist/types/component/basic/button/Button.stories.d.ts +19 -0
- package/dist/types/component/basic/button/index.d.ts +2 -0
- package/dist/types/component/basic/button2/button2.d.ts +13 -0
- package/dist/types/component/basic/carousel/carousel.d.ts +6 -0
- package/dist/types/component/basic/form/form-input.d.ts +12 -0
- package/dist/types/component/basic/form/form-row.d.ts +6 -0
- package/dist/types/component/basic/form/form.d.ts +11 -0
- package/dist/types/component/basic/hamburger-menu/HamburgerMenu.d.ts +12 -0
- package/dist/types/component/basic/hamburger-menu/HamburgerMenu.stories.d.ts +15 -0
- package/dist/types/component/basic/hamburger-menu/index.d.ts +2 -0
- package/dist/types/component/basic/horizontal-menu/horizontal-menu.d.ts +8 -0
- package/dist/types/component/basic/horizontal-points/horizontal-points.d.ts +5 -0
- package/dist/types/component/basic/section-header/section-header.d.ts +9 -0
- package/dist/types/component/basic/vertical-points/vertical-points.d.ts +5 -0
- package/dist/types/component/container/card/Card.d.ts +12 -0
- package/dist/types/component/container/card/Card.stories.d.ts +17 -0
- package/dist/types/component/container/card/index.d.ts +2 -0
- package/dist/types/component/container/pop-in/PopIn.d.ts +11 -0
- package/dist/types/component/container/pop-in/PopIn.stories.d.ts +20 -0
- package/dist/types/component/container/pop-in/index.d.ts +2 -0
- package/dist/types/component/domain/domain.d.ts +12 -0
- package/dist/types/component/layout/footer/footer.d.ts +6 -0
- package/dist/types/component/layout/glowing-back/glowing-back.d.ts +6 -0
- package/dist/types/component/layout/info-card/info-card-group.d.ts +8 -0
- package/dist/types/component/layout/info-card/info-card.d.ts +15 -0
- package/dist/types/component/layout/landing-page/landing-page.d.ts +2 -0
- package/dist/types/component/layout/responsive-grid/responsive-grid.d.ts +8 -0
- package/dist/types/component/layout/section/section.d.ts +9 -0
- package/dist/types/component/layout/two-columns/two-columns.d.ts +9 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/page/alert-page.d.ts +2 -0
- package/dist/types/page/button-page.d.ts +2 -0
- package/dist/types/page/card-page.d.ts +2 -0
- package/dist/types/page/hamburger-menu-page.d.ts +2 -0
- package/dist/types/page/home-page.d.ts +2 -0
- package/dist/types/page/landing-page-layout-page.d.ts +2 -0
- package/dist/types/page/pop-in-page.d.ts +2 -0
- package/dist/types/router/router.d.ts +2 -0
- package/dist/types/util/sx.d.ts +5 -0
- package/package.json +12 -3
- package/dist/index.d.ts +0 -61
package/dist/joza-ui-kit.es.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import require$$0
|
|
2
|
-
import styled, { css } from 'styled-components';
|
|
1
|
+
import require$$0 from 'react';
|
|
3
2
|
|
|
4
3
|
var jsxRuntime = {exports: {}};
|
|
5
4
|
|
|
@@ -1362,335 +1361,5 @@ function requireJsxRuntime () {
|
|
|
1362
1361
|
return jsxRuntime.exports;
|
|
1363
1362
|
}
|
|
1364
1363
|
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
const applySx = (props) => {
|
|
1368
|
-
if (!props.sx)
|
|
1369
|
-
return '';
|
|
1370
|
-
return Object.entries(props.sx).map(([property, value]) => {
|
|
1371
|
-
return `${property}: ${value};`;
|
|
1372
|
-
}).join('\n');
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
const StyledButton = styled.button `
|
|
1376
|
-
border: none;
|
|
1377
|
-
border-radius: 12px;
|
|
1378
|
-
cursor: pointer;
|
|
1379
|
-
font-weight: bold;
|
|
1380
|
-
transition: background-color 0.3s, box-shadow 0.3s;
|
|
1381
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1382
|
-
font-family: ${props => props.fontFamily || 'Arial, sans-serif'};
|
|
1383
|
-
|
|
1384
|
-
${props => props.size === 's' && css `
|
|
1385
|
-
padding: 6px 12px;
|
|
1386
|
-
font-size: 12px;
|
|
1387
|
-
`}
|
|
1388
|
-
|
|
1389
|
-
${props => props.size === 'm' && css `
|
|
1390
|
-
padding: 10px 20px;
|
|
1391
|
-
font-size: 14px;
|
|
1392
|
-
`}
|
|
1393
|
-
|
|
1394
|
-
${props => props.size === 'l' && css `
|
|
1395
|
-
padding: 14px 28px;
|
|
1396
|
-
font-size: 16px;
|
|
1397
|
-
`}
|
|
1398
|
-
|
|
1399
|
-
${props => props.variant === 'primary' && css `
|
|
1400
|
-
background-color: #007bff;
|
|
1401
|
-
color: #ffffff;
|
|
1402
|
-
&:hover {
|
|
1403
|
-
background-color: #0056b3;
|
|
1404
|
-
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
|
|
1405
|
-
}
|
|
1406
|
-
`}
|
|
1407
|
-
|
|
1408
|
-
${props => props.variant === 'secondary' && css `
|
|
1409
|
-
background-color: #28a745;
|
|
1410
|
-
color: #ffffff;
|
|
1411
|
-
&:hover {
|
|
1412
|
-
background-color: #1e7e34;
|
|
1413
|
-
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
|
|
1414
|
-
}
|
|
1415
|
-
`}
|
|
1416
|
-
|
|
1417
|
-
${props => props.variant === 'tertiary' && css `
|
|
1418
|
-
background-color: #dc3545;
|
|
1419
|
-
color: #ffffff;
|
|
1420
|
-
&:hover {
|
|
1421
|
-
background-color: #bd2130;
|
|
1422
|
-
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
|
|
1423
|
-
}
|
|
1424
|
-
`}
|
|
1425
|
-
|
|
1426
|
-
${applySx}
|
|
1427
|
-
`;
|
|
1428
|
-
const Button = ({ size = 'm', variant = 'primary', fontFamily = 'Arial, sans-serif', children, onClick, disabled = false, sx }) => {
|
|
1429
|
-
if (disabled) {
|
|
1430
|
-
return null;
|
|
1431
|
-
}
|
|
1432
|
-
return (jsxRuntimeExports.jsx(StyledButton, { size: size, variant: variant, fontFamily: fontFamily, onClick: onClick, sx: sx, children: children }));
|
|
1433
|
-
};
|
|
1434
|
-
|
|
1435
|
-
const StyledAlertContainer = styled.div `
|
|
1436
|
-
background: #fff;
|
|
1437
|
-
border-radius: 8px;
|
|
1438
|
-
padding: 24px 32px 24px 24px;
|
|
1439
|
-
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
|
1440
|
-
position: fixed;
|
|
1441
|
-
z-index: 1000;
|
|
1442
|
-
margin: 1rem;
|
|
1443
|
-
|
|
1444
|
-
${props => props.size === 's' && css `
|
|
1445
|
-
min-width: 180px;
|
|
1446
|
-
max-width: 60vw;
|
|
1447
|
-
font-size: 0.9rem;
|
|
1448
|
-
`}
|
|
1449
|
-
|
|
1450
|
-
${props => props.size === 'm' && css `
|
|
1451
|
-
min-width: 280px;
|
|
1452
|
-
max-width: 90vw;
|
|
1453
|
-
font-size: 1rem;
|
|
1454
|
-
`}
|
|
1455
|
-
|
|
1456
|
-
${props => props.size === 'l' && css `
|
|
1457
|
-
min-width: 380px;
|
|
1458
|
-
max-width: 100vw;
|
|
1459
|
-
font-size: 1.15rem;
|
|
1460
|
-
`}
|
|
1461
|
-
|
|
1462
|
-
${props => props.position === 'top-left' && css `top: 0; left: 0;`}
|
|
1463
|
-
${props => props.position === 'top-center' && css `top: 0; left: 50%; transform: translateX(-50%);`}
|
|
1464
|
-
${props => props.position === 'top-right' && css `top: 0; right: 0;`}
|
|
1465
|
-
${props => props.position === 'bottom-left' && css `bottom: 0; left: 0;`}
|
|
1466
|
-
${props => props.position === 'bottom-center' && css `bottom: 0; left: 50%; transform: translateX(-50%);`}
|
|
1467
|
-
${props => props.position === 'bottom-right' && css `bottom: 0; right: 0;`}
|
|
1468
|
-
|
|
1469
|
-
${props => props.type === 'info' && css `
|
|
1470
|
-
background: #e3f2fd;
|
|
1471
|
-
border-left: 6px solid #2196f3;
|
|
1472
|
-
color: #0d47a1;
|
|
1473
|
-
`}
|
|
1474
|
-
|
|
1475
|
-
${props => props.type === 'success' && css `
|
|
1476
|
-
background: #e8f5e9;
|
|
1477
|
-
border-left: 6px solid #4caf50;
|
|
1478
|
-
color: #1b5e20;
|
|
1479
|
-
`}
|
|
1480
|
-
|
|
1481
|
-
${props => props.type === 'warning' && css `
|
|
1482
|
-
background: #fff3e0;
|
|
1483
|
-
border-left: 6px solid #ff9800;
|
|
1484
|
-
color: #e65100;
|
|
1485
|
-
`}
|
|
1486
|
-
|
|
1487
|
-
${props => props.type === 'error' && css `
|
|
1488
|
-
background: #ffebee;
|
|
1489
|
-
border-left: 6px solid #f44336;
|
|
1490
|
-
color: #b71c1c;
|
|
1491
|
-
`}
|
|
1492
|
-
|
|
1493
|
-
${applySx}
|
|
1494
|
-
`;
|
|
1495
|
-
const AlertContent = styled.div `
|
|
1496
|
-
margin-top: 10px;
|
|
1497
|
-
word-break: break-word;
|
|
1498
|
-
`;
|
|
1499
|
-
const Alert = ({ isOpen, type = 'info', size = 'm', timeout, onClose, position = 'bottom-right', children, disabled = false, sx }) => {
|
|
1500
|
-
useEffect(() => {
|
|
1501
|
-
if (isOpen && timeout && onClose) {
|
|
1502
|
-
const timer = setTimeout(onClose, timeout);
|
|
1503
|
-
return () => clearTimeout(timer);
|
|
1504
|
-
}
|
|
1505
|
-
}, [isOpen, timeout, onClose]);
|
|
1506
|
-
if (!isOpen || disabled)
|
|
1507
|
-
return null;
|
|
1508
|
-
return (jsxRuntimeExports.jsx(StyledAlertContainer, { isOpen: isOpen, type: type, size: size, position: position, role: "alert", sx: sx, children: jsxRuntimeExports.jsx(AlertContent, { children: children }) }));
|
|
1509
|
-
};
|
|
1510
|
-
|
|
1511
|
-
const StyledCard = styled.div `
|
|
1512
|
-
background: #fff;
|
|
1513
|
-
border-radius: 12px;
|
|
1514
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1515
|
-
padding: 20px;
|
|
1516
|
-
margin: 20px auto;
|
|
1517
|
-
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
|
1518
|
-
overflow: hidden;
|
|
1519
|
-
max-width: 100%;
|
|
1520
|
-
|
|
1521
|
-
${props => props.size === 's' && css `
|
|
1522
|
-
width: 200px;
|
|
1523
|
-
font-size: 0.875rem;
|
|
1524
|
-
`}
|
|
1525
|
-
|
|
1526
|
-
${props => props.size === 'm' && css `
|
|
1527
|
-
width: 300px;
|
|
1528
|
-
font-size: 1rem;
|
|
1529
|
-
`}
|
|
1530
|
-
|
|
1531
|
-
${props => props.size === 'l' && css `
|
|
1532
|
-
width: 400px;
|
|
1533
|
-
font-size: 1.25rem;
|
|
1534
|
-
`}
|
|
1535
|
-
|
|
1536
|
-
${props => props.hover && css `
|
|
1537
|
-
&:hover {
|
|
1538
|
-
transform: translateY(-5px);
|
|
1539
|
-
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
|
|
1540
|
-
}
|
|
1541
|
-
`}
|
|
1542
|
-
|
|
1543
|
-
${applySx}
|
|
1544
|
-
`;
|
|
1545
|
-
const CardContainer = styled.div `
|
|
1546
|
-
display: flex;
|
|
1547
|
-
flex-direction: column;
|
|
1548
|
-
align-items: center;
|
|
1549
|
-
width: 100%;
|
|
1550
|
-
min-width: 0;
|
|
1551
|
-
`;
|
|
1552
|
-
const CardContent = styled.div `
|
|
1553
|
-
color: #333;
|
|
1554
|
-
width: 100%;
|
|
1555
|
-
overflow-wrap: break-word;
|
|
1556
|
-
word-break: break-word;
|
|
1557
|
-
|
|
1558
|
-
img {
|
|
1559
|
-
width: 100%;
|
|
1560
|
-
height: auto;
|
|
1561
|
-
object-fit: fill;
|
|
1562
|
-
border-radius: 4px;
|
|
1563
|
-
}
|
|
1564
|
-
`;
|
|
1565
|
-
const Card = ({ children, size = 'm', hover = false, onClick, disabled = false, sx }) => {
|
|
1566
|
-
if (disabled) {
|
|
1567
|
-
return null;
|
|
1568
|
-
}
|
|
1569
|
-
return (jsxRuntimeExports.jsx(StyledCard, { size: size, hover: hover, onClick: onClick, sx: sx, children: jsxRuntimeExports.jsx(CardContainer, { children: jsxRuntimeExports.jsx(CardContent, { children: children }) }) }));
|
|
1570
|
-
};
|
|
1571
|
-
|
|
1572
|
-
const MenuOverlay = styled.div `
|
|
1573
|
-
position: fixed;
|
|
1574
|
-
top: 0;
|
|
1575
|
-
left: 0;
|
|
1576
|
-
width: 100%;
|
|
1577
|
-
height: 100%;
|
|
1578
|
-
background: rgba(0, 0, 0, 0.5);
|
|
1579
|
-
z-index: 1000;
|
|
1580
|
-
`;
|
|
1581
|
-
const MenuContainer = styled.div `
|
|
1582
|
-
position: fixed;
|
|
1583
|
-
top: 0;
|
|
1584
|
-
background: #fff;
|
|
1585
|
-
border-radius: 8px;
|
|
1586
|
-
padding: 20px;
|
|
1587
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1588
|
-
display: flex;
|
|
1589
|
-
flex-direction: column;
|
|
1590
|
-
z-index: 1001;
|
|
1591
|
-
width: ${props => props.width};
|
|
1592
|
-
height: ${props => props.height};
|
|
1593
|
-
${props => props.position === 'right' ? 'right: 0; left: auto;' : 'left: 0; right: auto;'}
|
|
1594
|
-
|
|
1595
|
-
${applySx}
|
|
1596
|
-
`;
|
|
1597
|
-
const CloseButton$1 = styled.button `
|
|
1598
|
-
position: absolute;
|
|
1599
|
-
top: 10px;
|
|
1600
|
-
right: 10px;
|
|
1601
|
-
background: none;
|
|
1602
|
-
border: none;
|
|
1603
|
-
font-size: 1.5rem;
|
|
1604
|
-
cursor: pointer;
|
|
1605
|
-
`;
|
|
1606
|
-
const MenuContent = styled.div `
|
|
1607
|
-
margin-top: 10px;
|
|
1608
|
-
display: flex;
|
|
1609
|
-
flex-direction: column;
|
|
1610
|
-
gap: 10px;
|
|
1611
|
-
`;
|
|
1612
|
-
const HamburgerButton = styled.button `
|
|
1613
|
-
background: none;
|
|
1614
|
-
border: none;
|
|
1615
|
-
cursor: pointer;
|
|
1616
|
-
display: flex;
|
|
1617
|
-
flex-direction: column;
|
|
1618
|
-
gap: 5px;
|
|
1619
|
-
padding: 10px;
|
|
1620
|
-
z-index: 1001;
|
|
1621
|
-
align-items: center;
|
|
1622
|
-
`;
|
|
1623
|
-
const Line = styled.span `
|
|
1624
|
-
width: 25px;
|
|
1625
|
-
height: 3px;
|
|
1626
|
-
background-color: black;
|
|
1627
|
-
border-radius: 2px;
|
|
1628
|
-
`;
|
|
1629
|
-
const HamburgerMenu = ({ children, position = 'left', width = '30vw', height = '100vh', disabled = false, sx }) => {
|
|
1630
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
1631
|
-
const toggleMenu = () => setIsOpen(prev => !prev);
|
|
1632
|
-
const closeMenu = () => setIsOpen(false);
|
|
1633
|
-
if (disabled) {
|
|
1634
|
-
return null;
|
|
1635
|
-
}
|
|
1636
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(HamburgerButton, { onClick: toggleMenu, children: [jsxRuntimeExports.jsx(Line, {}), jsxRuntimeExports.jsx(Line, {}), jsxRuntimeExports.jsx(Line, {})] }), isOpen && (jsxRuntimeExports.jsx(MenuOverlay, { onClick: closeMenu, children: jsxRuntimeExports.jsxs(MenuContainer, { position: position, width: width, height: height, sx: sx, onClick: e => e.stopPropagation(), children: [jsxRuntimeExports.jsx(CloseButton$1, { onClick: closeMenu, children: "\u00D7" }), jsxRuntimeExports.jsx(MenuContent, { children: children })] }) }))] }));
|
|
1637
|
-
};
|
|
1638
|
-
|
|
1639
|
-
const PopinOverlay = styled.div `
|
|
1640
|
-
position: fixed;
|
|
1641
|
-
top: 0;
|
|
1642
|
-
left: 0;
|
|
1643
|
-
width: 100%;
|
|
1644
|
-
height: 100%;
|
|
1645
|
-
background: rgba(0, 0, 0, 0.5);
|
|
1646
|
-
display: flex;
|
|
1647
|
-
justify-content: center;
|
|
1648
|
-
align-items: center;
|
|
1649
|
-
z-index: 1000;
|
|
1650
|
-
opacity: ${props => props.$isOpen ? 1 : 0};
|
|
1651
|
-
pointer-events: ${props => props.$isOpen ? 'auto' : 'none'};
|
|
1652
|
-
transition: opacity 0.3s;
|
|
1653
|
-
`;
|
|
1654
|
-
const PopinContainer = styled.div `
|
|
1655
|
-
background: #fff;
|
|
1656
|
-
border-radius: 8px;
|
|
1657
|
-
padding: 20px;
|
|
1658
|
-
width: 90%;
|
|
1659
|
-
max-width: 500px;
|
|
1660
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1661
|
-
position: relative;
|
|
1662
|
-
opacity: ${props => props.$isOpen ? 1 : 0};
|
|
1663
|
-
pointer-events: ${props => props.$isOpen ? 'auto' : 'none'};
|
|
1664
|
-
transition: opacity 0.3s;
|
|
1665
|
-
|
|
1666
|
-
${applySx}
|
|
1667
|
-
`;
|
|
1668
|
-
const CloseButton = styled.button `
|
|
1669
|
-
position: absolute;
|
|
1670
|
-
top: 10px;
|
|
1671
|
-
right: 10px;
|
|
1672
|
-
background: none;
|
|
1673
|
-
border: none;
|
|
1674
|
-
font-size: 1.5rem;
|
|
1675
|
-
cursor: pointer;
|
|
1676
|
-
`;
|
|
1677
|
-
const Content = styled.div `
|
|
1678
|
-
margin-top: 10px;
|
|
1679
|
-
`;
|
|
1680
|
-
const Popin = ({ isOpen, onClose, children, disabled = false, sx }) => {
|
|
1681
|
-
const [show, setShow] = useState(isOpen);
|
|
1682
|
-
useEffect(() => {
|
|
1683
|
-
if (isOpen)
|
|
1684
|
-
setShow(true);
|
|
1685
|
-
else {
|
|
1686
|
-
const timeout = setTimeout(() => setShow(false), 300);
|
|
1687
|
-
return () => clearTimeout(timeout);
|
|
1688
|
-
}
|
|
1689
|
-
}, [isOpen]);
|
|
1690
|
-
if (!show || disabled)
|
|
1691
|
-
return null;
|
|
1692
|
-
return (jsxRuntimeExports.jsx(PopinOverlay, { "$isOpen": isOpen, onClick: onClose, children: jsxRuntimeExports.jsxs(PopinContainer, { "$isOpen": isOpen, sx: sx, onClick: e => e.stopPropagation(), children: [jsxRuntimeExports.jsx(CloseButton, { onClick: onClose, children: "\u00D7" }), jsxRuntimeExports.jsx(Content, { children: children })] }) }));
|
|
1693
|
-
};
|
|
1694
|
-
|
|
1695
|
-
export { Alert, Button, Card, HamburgerMenu, Popin };
|
|
1364
|
+
requireJsxRuntime();
|
|
1696
1365
|
//# sourceMappingURL=joza-ui-kit.es.js.map
|