@nithish_atum/atum 1.0.3 → 1.0.5

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/index.mjs CHANGED
@@ -1232,26 +1232,631 @@ var Textarea = ({
1232
1232
  return /* @__PURE__ */ jsx20(StyledTextarea, { $size: size, $state: state, ...rest });
1233
1233
  };
1234
1234
  var Textarea_default = Textarea;
1235
+
1236
+ // src/components/Menus/CenterMenu.tsx
1237
+ import styled21, { css as css16 } from "styled-components";
1238
+ import { jsx as jsx21, jsxs as jsxs9 } from "react/jsx-runtime";
1239
+ var baseStyle9 = css16`
1240
+ padding: 0.2em 0em 0.2em 0em;
1241
+ cursor: pointer;
1242
+ font-weight: 600;
1243
+ transistion: all 900ms;
1244
+ display: flex;
1245
+ width: 100%;
1246
+ justify-content: center;
1247
+ align-items: center;
1248
+ gap: 3%;
1249
+ background-color: rgb(71, 91, 248);
1250
+ `;
1251
+ var StyledMenu = styled21.div`
1252
+ ${baseStyle9}
1253
+ `;
1254
+ var CenterMenu = ({
1255
+ menuItems = ["SampleMenu_1", "SampleMenu_2", "SampleMenu_3"],
1256
+ logo,
1257
+ alt = "logo",
1258
+ href = "#",
1259
+ children,
1260
+ ...rest
1261
+ }) => {
1262
+ return /* @__PURE__ */ jsxs9(StyledMenu, { ...rest, children: [
1263
+ /* @__PURE__ */ jsx21("a", { href, children: /* @__PURE__ */ jsx21(
1264
+ "img",
1265
+ {
1266
+ src: logo,
1267
+ alt,
1268
+ width: "48px",
1269
+ height: "48px",
1270
+ style: {
1271
+ mixBlendMode: "multiply",
1272
+ objectFit: "contain"
1273
+ }
1274
+ }
1275
+ ) }),
1276
+ menuItems.map((x, i) => {
1277
+ return /* @__PURE__ */ jsx21("div", { children: x }, i);
1278
+ })
1279
+ ] });
1280
+ };
1281
+ var CenterMenu_default = CenterMenu;
1282
+
1283
+ // src/components/Layouts/Row.tsx
1284
+ import styled22, { css as css17 } from "styled-components";
1285
+ import { jsx as jsx22 } from "react/jsx-runtime";
1286
+ var baseStyle10 = css17`
1287
+ display: flex;
1288
+ flex-direction: row;
1289
+ `;
1290
+ var justifyStyles3 = {
1291
+ center: css17`
1292
+ height: inherit;
1293
+ width: inherit;
1294
+ justify-content: center;
1295
+ `,
1296
+ start: css17`
1297
+ height: inherit;
1298
+ width: inherit;
1299
+ justify-content: start;
1300
+ `,
1301
+ end: css17`
1302
+ height: inherit;
1303
+ width: inherit;
1304
+ justify-content: end;
1305
+ `,
1306
+ FStart: css17`
1307
+ height: inherit;
1308
+ width: inherit;
1309
+ justify-content: flex-start;
1310
+ `,
1311
+ FEnd: css17`
1312
+ height: inherit;
1313
+ width: inherit;
1314
+ justify-content: flex-end;
1315
+ `,
1316
+ left: css17`
1317
+ height: inherit;
1318
+ width: inherit;
1319
+ justify-content: left;
1320
+ `,
1321
+ right: css17`
1322
+ height: inherit;
1323
+ width: inherit;
1324
+ justify-content: right;
1325
+ `,
1326
+ between: css17`
1327
+ height: inherit;
1328
+ width: inherit;
1329
+ justify-content: space-between;
1330
+ `,
1331
+ around: css17`
1332
+ height: inherit;
1333
+ width: inherit;
1334
+ justify-content: space-around;
1335
+ `,
1336
+ even: css17`
1337
+ height: inherit;
1338
+ width: inherit;
1339
+ justify-content: space-evenly;
1340
+ `
1341
+ };
1342
+ var gapStyles4 = {
1343
+ xs: css17`
1344
+ gap: 1em;
1345
+ `,
1346
+ sm: css17`
1347
+ gap: 3em;
1348
+ `,
1349
+ md: css17`
1350
+ gap: 5em;
1351
+ `,
1352
+ lg: css17`
1353
+ gap: 7em;
1354
+ `
1355
+ };
1356
+ var CustomDiv3 = styled22.div`
1357
+ ${baseStyle10}
1358
+ ${({ $justify, $gap }) => css17`
1359
+ ${justifyStyles3[$justify]}
1360
+ ${gapStyles4[$gap]}
1361
+ `}
1362
+ `;
1363
+ var Row = ({
1364
+ justify = "center",
1365
+ gap = "xs",
1366
+ children,
1367
+ ...rest
1368
+ }) => {
1369
+ return /* @__PURE__ */ jsx22(CustomDiv3, { $justify: justify, $gap: gap, ...rest, children });
1370
+ };
1371
+ var Row_default = Row;
1372
+
1373
+ // src/components/Menus/HorizantalMenu.tsx
1374
+ import styled23, { css as css18 } from "styled-components";
1375
+ import { jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
1376
+ var baseStyle11 = css18`
1377
+ padding: 1em 0em 1em 0em;
1378
+ cursor: pointer;
1379
+ font-weight: 600;
1380
+ transistion: all 900ms;
1381
+ display: flex;
1382
+ width: 100%;
1383
+ justify-content: space-between;
1384
+ background-color:rgb(71, 91, 248);
1385
+ `;
1386
+ var StyledMenu2 = styled23.div`
1387
+ ${baseStyle11}
1388
+ `;
1389
+ var HorizantalMenu = ({
1390
+ menuItems = ["SampleMenu_1", "SampleMenu_2", "SampleMenu_3"],
1391
+ logo,
1392
+ alt = "logo",
1393
+ href = "#",
1394
+ children,
1395
+ ...rest
1396
+ }) => {
1397
+ return /* @__PURE__ */ jsxs10(StyledMenu2, { ...rest, children: [
1398
+ /* @__PURE__ */ jsx23("a", { href, children: /* @__PURE__ */ jsx23(
1399
+ "img",
1400
+ {
1401
+ src: logo,
1402
+ alt,
1403
+ width: "36px",
1404
+ height: "36px",
1405
+ style: {
1406
+ mixBlendMode: "multiply",
1407
+ objectFit: "contain"
1408
+ }
1409
+ }
1410
+ ) }),
1411
+ /* @__PURE__ */ jsx23(Row_default, { justify: "FEnd", children: menuItems.map((x, i) => {
1412
+ return /* @__PURE__ */ jsx23("div", { children: x }, i);
1413
+ }) })
1414
+ ] });
1415
+ };
1416
+ var HorizantalMenu_default = HorizantalMenu;
1417
+
1418
+ // src/components/Layouts/Center.tsx
1419
+ import styled24, { css as css19 } from "styled-components";
1420
+ import { jsx as jsx24 } from "react/jsx-runtime";
1421
+ var baseStyle12 = css19`
1422
+ display: flex;
1423
+ height: inherit;
1424
+ width: inherit;
1425
+ justify-content: center;
1426
+ align-items: center;
1427
+ `;
1428
+ var CustomDiv4 = styled24.div`
1429
+ ${baseStyle12}
1430
+ `;
1431
+ var Center = ({
1432
+ children,
1433
+ ...rest
1434
+ }) => {
1435
+ return /* @__PURE__ */ jsx24(CustomDiv4, { ...rest, children });
1436
+ };
1437
+ var Center_default = Center;
1438
+
1439
+ // src/components/Layouts/Col.tsx
1440
+ import styled25, { css as css20 } from "styled-components";
1441
+ import { jsx as jsx25 } from "react/jsx-runtime";
1442
+ var baseStyle13 = css20`
1443
+ display: flex;
1444
+ flex-direction: column;
1445
+ `;
1446
+ var justifyStyles4 = {
1447
+ center: css20`
1448
+ height: inherit;
1449
+ width: inherit;
1450
+ justify-content: center;
1451
+ `,
1452
+ start: css20`
1453
+ height: inherit;
1454
+ width: inherit;
1455
+ justify-content: start;
1456
+ `,
1457
+ end: css20`
1458
+ height: inherit;
1459
+ width: inherit;
1460
+ justify-content: end;
1461
+ `,
1462
+ FStart: css20`
1463
+ height: inherit;
1464
+ width: inherit;
1465
+ justify-content: flex-start;
1466
+ `,
1467
+ FEnd: css20`
1468
+ height: inherit;
1469
+ width: inherit;
1470
+ justify-content: flex-end;
1471
+ `,
1472
+ left: css20`
1473
+ height: inherit;
1474
+ width: inherit;
1475
+ justify-content: left;
1476
+ `,
1477
+ right: css20`
1478
+ height: inherit;
1479
+ width: inherit;
1480
+ justify-content: right;
1481
+ `,
1482
+ between: css20`
1483
+ height: inherit;
1484
+ width: inherit;
1485
+ justify-content: space-between;
1486
+ `,
1487
+ around: css20`
1488
+ height: inherit;
1489
+ width: inherit;
1490
+ justify-content: space-around;
1491
+ `,
1492
+ even: css20`
1493
+ height: inherit;
1494
+ width: inherit;
1495
+ justify-content: space-evenly;
1496
+ `
1497
+ };
1498
+ var gapStyles5 = {
1499
+ xs: css20`
1500
+ gap: 1em;
1501
+ `,
1502
+ sm: css20`
1503
+ gap: 3em;
1504
+ `,
1505
+ md: css20`
1506
+ gap: 5em;
1507
+ `,
1508
+ lg: css20`
1509
+ gap: 7em;
1510
+ `
1511
+ };
1512
+ var CustomDiv5 = styled25.div`
1513
+ ${baseStyle13}
1514
+ ${({ $justify, $gap }) => css20`
1515
+ ${justifyStyles4[$justify]}
1516
+ ${gapStyles5[$gap]}
1517
+ `}
1518
+ `;
1519
+ var Col = ({
1520
+ justify = "center",
1521
+ gap = "xs",
1522
+ children,
1523
+ ...rest
1524
+ }) => {
1525
+ return /* @__PURE__ */ jsx25(CustomDiv5, { $justify: justify, $gap: gap, ...rest, children });
1526
+ };
1527
+ var Col_default = Col;
1528
+
1529
+ // src/components/Layouts/Container.tsx
1530
+ import styled26, { css as css21 } from "styled-components";
1531
+ import { jsx as jsx26 } from "react/jsx-runtime";
1532
+ var baseStyle14 = css21`
1533
+ padding: 1em;
1534
+ `;
1535
+ var sizeStyles4 = {
1536
+ xs: css21`
1537
+ max-width: 576px;
1538
+ width: 100%;
1539
+ display: flex;
1540
+ margin-left: auto;
1541
+ margin-right: auto;
1542
+ align-items: center;
1543
+ justify-content: center;
1544
+ height: 100vh;
1545
+ `,
1546
+ sm: css21`
1547
+ max-width: 688px;
1548
+ width: 100%;
1549
+ display: flex;
1550
+ margin-left: auto;
1551
+ margin-right: auto;
1552
+ align-items: center;
1553
+ justify-content: center;
1554
+ height: 100vh;
1555
+ `,
1556
+ md: css21`
1557
+ max-width: 768px;
1558
+ width: 100%;
1559
+ display: flex;
1560
+ margin-left: auto;
1561
+ margin-right: auto;
1562
+ align-items: center;
1563
+ justify-content: center;
1564
+ height: 100vh;
1565
+ `,
1566
+ lg: css21`
1567
+ max-width: 100%;
1568
+ width: 100%;
1569
+ display: flex;
1570
+ padding: 0px;
1571
+ margin-left: auto;
1572
+ margin-right: auto;
1573
+ align-items: center;
1574
+ justify-content: center;
1575
+ height: 100vh;
1576
+ `
1577
+ };
1578
+ var flexStyles = {
1579
+ row: css21`
1580
+ width: inherit;
1581
+ display: flex;
1582
+ flex-direction: row;
1583
+ `,
1584
+ col: css21`
1585
+ width: inherit;
1586
+ display: flex;
1587
+ flex-direction: column;
1588
+ `
1589
+ };
1590
+ var gapStyles6 = {
1591
+ xs: css21`
1592
+ gap: 1em;
1593
+ `,
1594
+ sm: css21`
1595
+ gap: 3em;
1596
+ `,
1597
+ md: css21`
1598
+ gap: 5em;
1599
+ `,
1600
+ lg: css21`
1601
+ gap: 7em;
1602
+ `
1603
+ };
1604
+ var CustomDiv6 = styled26.div`
1605
+ ${baseStyle14}
1606
+ ${({ $size, $flex, $gap }) => css21`
1607
+ ${sizeStyles4[$size]}
1608
+ ${flexStyles[$flex]}
1609
+ ${gapStyles6[$gap]}
1610
+ `}
1611
+ `;
1612
+ var Container = ({
1613
+ size = "lg",
1614
+ flex = "row",
1615
+ gap = "xs",
1616
+ children,
1617
+ ...rest
1618
+ }) => {
1619
+ return /* @__PURE__ */ jsx26(CustomDiv6, { $size: size, $flex: flex, $gap: gap, ...rest, children });
1620
+ };
1621
+ var Container_default = Container;
1622
+
1623
+ // src/components/Layouts/Grid.tsx
1624
+ import styled27, { css as css22 } from "styled-components";
1625
+ import { jsx as jsx27 } from "react/jsx-runtime";
1626
+ var baseStyle15 = css22`
1627
+ display: grid;
1628
+ width: 100%;
1629
+ `;
1630
+ var gapStyles7 = {
1631
+ xs: css22`
1632
+ gap: 0.5rem;
1633
+ `,
1634
+ sm: css22`
1635
+ gap: 1rem;
1636
+ `,
1637
+ md: css22`
1638
+ gap: 2rem;
1639
+ `,
1640
+ lg: css22`
1641
+ gap: 3rem;
1642
+ `
1643
+ };
1644
+ var StyledGrid = styled27.div`
1645
+ ${baseStyle15}
1646
+
1647
+ ${({ $columns }) => css22`
1648
+ grid-template-columns: repeat(${$columns}, minmax(0, 1fr));
1649
+ `}
1650
+
1651
+ ${({ $rows }) => $rows && css22`
1652
+ grid-template-rows: repeat(${$rows}, 1fr);
1653
+ `}
1654
+
1655
+ ${({ $gap }) => gapStyles7[$gap]}
1656
+ `;
1657
+ var Grid2 = ({
1658
+ columns = 12,
1659
+ rows,
1660
+ gap = "sm",
1661
+ children,
1662
+ ...rest
1663
+ }) => {
1664
+ return /* @__PURE__ */ jsx27(
1665
+ StyledGrid,
1666
+ {
1667
+ $columns: columns,
1668
+ $rows: rows,
1669
+ $gap: gap,
1670
+ ...rest,
1671
+ children
1672
+ }
1673
+ );
1674
+ };
1675
+ var Grid_default = Grid2;
1676
+
1677
+ // src/components/Layouts/Stack.tsx
1678
+ import styled28, { css as css23 } from "styled-components";
1679
+ import { jsx as jsx28 } from "react/jsx-runtime";
1680
+ var baseStyle16 = css23`
1681
+ display: flex;
1682
+ width: 100%;
1683
+ `;
1684
+ var directionStyles = {
1685
+ vertical: css23`
1686
+ flex-direction: column;
1687
+ `,
1688
+ horizontal: css23`
1689
+ flex-direction: row;
1690
+ `
1691
+ };
1692
+ var gapStyles8 = {
1693
+ xs: css23`
1694
+ gap: 0.5rem;
1695
+ `,
1696
+ sm: css23`
1697
+ gap: 1rem;
1698
+ `,
1699
+ md: css23`
1700
+ gap: 2rem;
1701
+ `,
1702
+ lg: css23`
1703
+ gap: 3rem;
1704
+ `
1705
+ };
1706
+ var StyledStack = styled28.div`
1707
+ ${baseStyle16}
1708
+ ${({ $direction }) => directionStyles[$direction]}
1709
+ ${({ $gap }) => gapStyles8[$gap]}
1710
+ `;
1711
+ var Stack = ({
1712
+ direction = "vertical",
1713
+ gap = "sm",
1714
+ children,
1715
+ ...rest
1716
+ }) => {
1717
+ return /* @__PURE__ */ jsx28(StyledStack, { $direction: direction, $gap: gap, ...rest, children });
1718
+ };
1719
+ var Stack_default = Stack;
1720
+
1721
+ // src/components/Notification/NotificationProvider.tsx
1722
+ import {
1723
+ createContext,
1724
+ useContext,
1725
+ useState as useState3,
1726
+ useEffect as useEffect6
1727
+ } from "react";
1728
+ import { createPortal as createPortal5 } from "react-dom";
1729
+ import styled29 from "styled-components";
1730
+
1731
+ // src/components/Notification/toast.ts
1732
+ var notifyRef = null;
1733
+ var registerToast = (fn) => {
1734
+ notifyRef = fn;
1735
+ };
1736
+ var toast = {
1737
+ success(message, duration) {
1738
+ notifyRef?.({ type: "success", message, duration });
1739
+ },
1740
+ error(message, duration) {
1741
+ notifyRef?.({ type: "error", message, duration });
1742
+ },
1743
+ info(message, duration) {
1744
+ notifyRef?.({ type: "info", message, duration });
1745
+ },
1746
+ warning(message, duration) {
1747
+ notifyRef?.({ type: "warning", message, duration });
1748
+ }
1749
+ };
1750
+
1751
+ // src/components/Notification/NotificationProvider.tsx
1752
+ import { jsx as jsx29, jsxs as jsxs11 } from "react/jsx-runtime";
1753
+ var NotificationContext = createContext(null);
1754
+ var useNotification = () => {
1755
+ const ctx = useContext(NotificationContext);
1756
+ if (!ctx) {
1757
+ throw new Error("useNotification must be used inside NotificationProvider");
1758
+ }
1759
+ return ctx;
1760
+ };
1761
+ var Container2 = styled29.div`
1762
+ position: fixed;
1763
+ top: 1rem;
1764
+ right: 1rem;
1765
+ display: flex;
1766
+ flex-direction: column;
1767
+ gap: 0.75rem;
1768
+ z-index: 2000;
1769
+ `;
1770
+ var Item2 = styled29.div`
1771
+ min-width: 280px;
1772
+ padding: 0.75rem 1rem;
1773
+ border-radius: 8px;
1774
+ background: #fff;
1775
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
1776
+ border-left: 4px solid
1777
+ ${({ $type }) => ({
1778
+ success: "#2e7d32",
1779
+ error: "#d32f2f",
1780
+ info: "#0288d1",
1781
+ warning: "#ed6c02"
1782
+ })[$type]};
1783
+ `;
1784
+ var Title = styled29.div`
1785
+ font-weight: 600;
1786
+ margin-bottom: 0.25rem;
1787
+ `;
1788
+ var Message = styled29.div`
1789
+ font-size: 0.875rem;
1790
+ line-height: 1.4;
1791
+ `;
1792
+ var NotificationProvider = ({ children }) => {
1793
+ const [items, setItems] = useState3([]);
1794
+ const notify = (notice) => {
1795
+ const id = crypto.randomUUID();
1796
+ const item = { ...notice, id };
1797
+ setItems((prev) => [...prev, item]);
1798
+ if (notice.duration !== 0) {
1799
+ setTimeout(() => {
1800
+ setItems((prev) => prev.filter((n) => n.id !== id));
1801
+ }, notice.duration ?? 3e3);
1802
+ }
1803
+ };
1804
+ useEffect6(() => {
1805
+ registerToast(notify);
1806
+ }, []);
1807
+ return /* @__PURE__ */ jsxs11(NotificationContext.Provider, { value: { notify }, children: [
1808
+ children,
1809
+ createPortal5(
1810
+ /* @__PURE__ */ jsx29(Container2, { children: items.map((n) => /* @__PURE__ */ jsxs11(Item2, { $type: n.type, children: [
1811
+ n.title && /* @__PURE__ */ jsx29(Title, { children: n.title }),
1812
+ /* @__PURE__ */ jsx29(Message, { children: n.message })
1813
+ ] }, n.id)) }),
1814
+ document.body
1815
+ )
1816
+ ] });
1817
+ };
1818
+
1819
+ // src/components/Notification/useToast.ts
1820
+ var useToast = () => {
1821
+ const { notify } = useNotification();
1822
+ return {
1823
+ success: (message, duration) => notify({ type: "success", message, duration }),
1824
+ error: (message, duration) => notify({ type: "error", message, duration }),
1825
+ info: (message, duration) => notify({ type: "info", message, duration }),
1826
+ warning: (message, duration) => notify({ type: "warning", message, duration })
1827
+ };
1828
+ };
1235
1829
  export {
1236
1830
  Box_default as Box,
1237
1831
  Button_default as Button,
1238
1832
  Card_default as Card,
1833
+ Center_default as Center,
1834
+ CenterMenu_default as CenterMenu,
1239
1835
  Checkbox_default as Checkbox,
1836
+ Col_default as Col,
1837
+ Container_default as Container,
1240
1838
  DatePicker_default as DatePicker,
1241
1839
  Divider_default as Divider,
1242
1840
  Drawer_default as Drawer,
1243
1841
  Flex_default as Flex,
1244
1842
  Form_default as Form,
1245
1843
  FormControl_default as FormControl,
1844
+ Grid_default as Grid,
1246
1845
  Heading_default as Heading,
1846
+ HorizantalMenu_default as HorizantalMenu,
1247
1847
  Input_default as Input,
1248
1848
  Link_default as Link,
1249
1849
  Modal_default as Modal,
1850
+ NotificationProvider,
1250
1851
  Paragraph_default as Paragraph,
1251
1852
  Radio_default as Radio,
1853
+ Row_default as Row,
1252
1854
  Select_default as Select,
1855
+ Stack_default as Stack,
1253
1856
  Switch_default as Switch,
1254
1857
  Text_default as Text,
1255
- Textarea_default as Textarea
1858
+ Textarea_default as Textarea,
1859
+ toast,
1860
+ useToast
1256
1861
  };
1257
1862
  //# sourceMappingURL=index.mjs.map