@manamerge/mana-atomic-ui 0.0.89 → 0.0.91

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.d.ts CHANGED
@@ -186,4 +186,16 @@ interface CardBannerTypes {
186
186
  }
187
187
  declare const CardBanner: React.FC<CardBannerTypes>;
188
188
 
189
- export { BreakerTape, Button, CardBanner, CardSimpleRender, CardTeaser, Divider, Footer, Gradient, Header, Heading, Icon, Link, Navigation, Text };
189
+ interface ContentTypes {
190
+ title?: string;
191
+ description?: string;
192
+ }
193
+ interface AccordionTypes {
194
+ variant?: string;
195
+ iconPlus: FunctionComponent<SVGProps<SVGSVGElement>>;
196
+ iconMinus: FunctionComponent<SVGProps<SVGSVGElement>>;
197
+ content?: ContentTypes[];
198
+ }
199
+ declare const Accordion: React.FC<AccordionTypes>;
200
+
201
+ export { Accordion, BreakerTape, Button, CardBanner, CardSimpleRender, CardTeaser, Divider, Footer, Gradient, Header, Heading, Icon, Link, Navigation, Text };
package/dist/index.js CHANGED
@@ -357,7 +357,7 @@ const DividerStyle = styled.hr `
357
357
 
358
358
  ${(_a) => {
359
359
  var _b;
360
- var { theme, variant = "" } = _a, props = __rest(_a, ["theme", "variant"]);
360
+ var { theme, variant = "primary" } = _a, props = __rest(_a, ["theme", "variant"]);
361
361
  const dividerStyle = ((_b = theme === null || theme === void 0 ? void 0 : theme.divider) === null || _b === void 0 ? void 0 : _b[variant]) || {};
362
362
  return css `
363
363
  width: ${props.width || dividerStyle.width || "100%"};
@@ -403,6 +403,17 @@ const WrapperBackground = styled.div `
403
403
  `;
404
404
  }}
405
405
  animation: glow 3s infinite alternate ease-in-out;
406
+
407
+ @keyframes glow {
408
+ 0% {
409
+ transform: scale(1);
410
+ opacity: 0.5;
411
+ }
412
+ 100% {
413
+ transform: scale(1.5);
414
+ opacity: 1;
415
+ }
416
+ }
406
417
  }
407
418
  `;
408
419
  const WrapperHeader = styled.div `
@@ -469,7 +480,7 @@ const AtomIconDot = styled(Icon).attrs(({ theme }) => {
469
480
  `;
470
481
  }}
471
482
  `;
472
- const AtomHeading$2 = styled(Heading).attrs(({ theme }) => {
483
+ const AtomHeading$3 = styled(Heading).attrs(({ theme }) => {
473
484
  var _a, _b;
474
485
  return ({
475
486
  variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomHeading) === null || _b === void 0 ? void 0 : _b.variant) || "h1"
@@ -533,7 +544,7 @@ const Header = ({ iconTop, iconDot, iconLeft, iconRight, textBanner, headingTitl
533
544
  React.createElement(WrapperLineTop, null,
534
545
  iconDot && React.createElement(AtomIconDot, { svg: iconDot }),
535
546
  React.createElement(AtomTextTitle, null, textBanner))),
536
- React.createElement(AtomHeading$2, null, headingTitle),
547
+ React.createElement(AtomHeading$3, null, headingTitle),
537
548
  React.createElement("div", null, textTitle === null || textTitle === void 0 ? void 0 : textTitle.map((text, i) => (React.createElement(AtomTextTitle, { key: i }, text)))),
538
549
  React.createElement(WrapperLineBottom, null,
539
550
  React.createElement(AtomButtonLeft, { onClick: buttonLeftClick },
@@ -628,6 +639,12 @@ const StyledLink$1 = styled(Link).attrs(({ theme }) => {
628
639
  `;
629
640
  }};
630
641
  `;
642
+ const AtomButton$1 = styled(Button).attrs(({ theme }) => {
643
+ var _a, _b;
644
+ return ({
645
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.navigation) === null || _a === void 0 ? void 0 : _a.atomButton) === null || _b === void 0 ? void 0 : _b.variant) || "icon"
646
+ });
647
+ }) ``;
631
648
 
632
649
  const Navigation = ({ iconBurger, tabs, onTabClick }) => {
633
650
  const location = useLocation();
@@ -636,14 +653,10 @@ const Navigation = ({ iconBurger, tabs, onTabClick }) => {
636
653
  const handleToggle = () => {
637
654
  setIsOpen(!isOpen);
638
655
  };
639
- const handleKeyDown = (event) => {
640
- if (event.key === "Enter" || event.key === " ") {
641
- handleToggle();
642
- }
643
- };
644
656
  return (React.createElement(NavBar, null,
645
657
  React.createElement(BurgerWrapper, null,
646
- React.createElement(BurgerIcon, { onClick: handleToggle, onKeyDown: handleKeyDown, tabIndex: 0, role: "button", "aria-pressed": isOpen, svg: iconBurger })),
658
+ React.createElement(AtomButton$1, { onClick: handleToggle, "aria-pressed": isOpen },
659
+ React.createElement(BurgerIcon, { svg: iconBurger }))),
647
660
  React.createElement(NavLinks, { isOpen: isOpen }, tabs.length > 0
648
661
  ? tabs.map((tab) => (React.createElement(StyledLink$1, { key: tab.label, to: tab.to, currentPath: tab.label === currentPath, onClick: () => {
649
662
  onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(tab.label);
@@ -1104,6 +1117,8 @@ const Card$1 = styled.div `
1104
1117
  var { theme } = _a, props = __rest(_a, ["theme"]);
1105
1118
  const thisTheme = (theme === null || theme === void 0 ? void 0 : theme.cardSimpleRender) || {};
1106
1119
  return css `
1120
+ all: unset;
1121
+ width: 100%;
1107
1122
  display: flex;
1108
1123
  flex-direction: ${(props === null || props === void 0 ? void 0 : props.flexDirection) ||
1109
1124
  (thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.flexDirection) ||
@@ -1155,7 +1170,7 @@ const Card$1 = styled.div `
1155
1170
  `;
1156
1171
  }}
1157
1172
  `;
1158
- const WrapperLine = styled.div `
1173
+ const WrapperLine$1 = styled.div `
1159
1174
  display: flex;
1160
1175
  align-items: center;
1161
1176
  justify-content: center;
@@ -1163,19 +1178,19 @@ const WrapperLine = styled.div `
1163
1178
  text-align: center;
1164
1179
  gap: 10px;
1165
1180
  `;
1166
- const AtomIcon$1 = styled(Icon).attrs(({ theme }) => {
1181
+ const AtomIcon$2 = styled(Icon).attrs(({ theme }) => {
1167
1182
  var _a, _b;
1168
1183
  return ({
1169
1184
  variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.cardSimpleRender) === null || _a === void 0 ? void 0 : _a.atomIcon) === null || _b === void 0 ? void 0 : _b.variant) || "medium"
1170
1185
  });
1171
1186
  }) ``;
1172
- const AtomHeading$1 = styled(Heading).attrs(({ theme }) => {
1187
+ const AtomHeading$2 = styled(Heading).attrs(({ theme }) => {
1173
1188
  var _a, _b;
1174
1189
  return ({
1175
1190
  variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.cardSimpleRender) === null || _a === void 0 ? void 0 : _a.atomHeading) === null || _b === void 0 ? void 0 : _b.variant) || "h3"
1176
1191
  });
1177
1192
  }) ``;
1178
- const AtomText$1 = styled(Text).attrs(({ theme }) => {
1193
+ const AtomText$2 = styled(Text).attrs(({ theme }) => {
1179
1194
  var _a, _b;
1180
1195
  return ({
1181
1196
  variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.cardSimpleRender) === null || _a === void 0 ? void 0 : _a.atomText) === null || _b === void 0 ? void 0 : _b.variant) || "regular"
@@ -1183,19 +1198,12 @@ const AtomText$1 = styled(Text).attrs(({ theme }) => {
1183
1198
  }) ``;
1184
1199
 
1185
1200
  const CardSimpleRender = ({ icon, title, description, children, cardClick }) => {
1186
- const handleKeyDown = (event) => {
1187
- if (cardClick) {
1188
- if (event.key === "Enter" || event.key === " ") {
1189
- cardClick(event);
1190
- }
1191
- }
1192
- };
1193
- return (React.createElement(Card$1, { onClick: cardClick, onKeyDown: handleKeyDown, tabIndex: cardClick ? 0 : undefined, cardHover: !!cardClick },
1201
+ return (React.createElement(Card$1, { as: cardClick ? "button" : "div", onClick: cardClick, cardHover: !!cardClick },
1194
1202
  React.createElement("div", null,
1195
- React.createElement(WrapperLine, null,
1196
- icon && React.createElement(AtomIcon$1, { svg: icon }),
1197
- React.createElement(AtomHeading$1, null, title)),
1198
- React.createElement(AtomText$1, null, description)),
1203
+ React.createElement(WrapperLine$1, null,
1204
+ icon && React.createElement(AtomIcon$2, { svg: icon }),
1205
+ React.createElement(AtomHeading$2, null, title)),
1206
+ React.createElement(AtomText$2, null, description)),
1199
1207
  children));
1200
1208
  };
1201
1209
 
@@ -1225,13 +1233,13 @@ const Card = styled.div `
1225
1233
  `;
1226
1234
  }}
1227
1235
  `;
1228
- const AtomHeading = styled(Heading).attrs(({ theme }) => {
1236
+ const AtomHeading$1 = styled(Heading).attrs(({ theme }) => {
1229
1237
  var _a, _b;
1230
1238
  return ({
1231
1239
  variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.cardBanner) === null || _a === void 0 ? void 0 : _a.atomHeading) === null || _b === void 0 ? void 0 : _b.variant) || "h3"
1232
1240
  });
1233
1241
  }) ``;
1234
- const AtomText = styled(Text).attrs(({ theme }) => {
1242
+ const AtomText$1 = styled(Text).attrs(({ theme }) => {
1235
1243
  var _a, _b;
1236
1244
  return ({
1237
1245
  variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.cardBanner) === null || _a === void 0 ? void 0 : _a.atomText) === null || _b === void 0 ? void 0 : _b.variant) || "regular"
@@ -1249,7 +1257,7 @@ const AtomTextButton = styled(Text).attrs(({ theme }) => {
1249
1257
  variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.cardBanner) === null || _a === void 0 ? void 0 : _a.atomTextButton) === null || _b === void 0 ? void 0 : _b.variant) || "primary"
1250
1258
  });
1251
1259
  }) ``;
1252
- const AtomIcon = styled(Icon).attrs(({ theme }) => {
1260
+ const AtomIcon$1 = styled(Icon).attrs(({ theme }) => {
1253
1261
  var _a, _b;
1254
1262
  return ({
1255
1263
  variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.cardBanner) === null || _a === void 0 ? void 0 : _a.atomIcon) === null || _b === void 0 ? void 0 : _b.variant) || "medium"
@@ -1259,12 +1267,93 @@ const AtomIcon = styled(Icon).attrs(({ theme }) => {
1259
1267
  const CardBanner = ({ icon, title, description, buttonText, buttonClick }) => {
1260
1268
  return (React.createElement(Card, null,
1261
1269
  React.createElement("div", null,
1262
- React.createElement(AtomHeading, null, title),
1263
- React.createElement(AtomText, null, description)),
1270
+ React.createElement(AtomHeading$1, null, title),
1271
+ React.createElement(AtomText$1, null, description)),
1264
1272
  buttonClick && (React.createElement(AtomButton, { onClick: buttonClick },
1265
1273
  React.createElement(AtomTextButton, null, buttonText),
1266
- icon && React.createElement(AtomIcon, { svg: icon })))));
1274
+ icon && React.createElement(AtomIcon$1, { svg: icon })))));
1275
+ };
1276
+
1277
+ const AccordionContainer = styled.div `
1278
+ width: 100%;
1279
+ background-color: #1e1e1e;
1280
+ color: white;
1281
+ border-radius: 8px;
1282
+ overflow: hidden;
1283
+ font-family: Arial, sans-serif;
1284
+ `;
1285
+ const AccordionItem = styled.div `
1286
+ border-bottom: 1px solid #333;
1287
+ `;
1288
+ const WrapperLine = styled.div `
1289
+ display: flex;
1290
+ align-items: center;
1291
+ justify-content: space-between;
1292
+ text-align: center;
1293
+ gap: 10px;
1294
+ cursor: pointer;
1295
+ background: #2a2a2a;
1296
+ &:hover {
1297
+ background: #3a3a3a;
1298
+ }
1299
+ `;
1300
+ const AccordionTitle = styled.div `
1301
+ width: 80%;
1302
+ padding: 16px;
1303
+ font-size: 16px;
1304
+ font-weight: bold;
1305
+ display: flex;
1306
+ justify-content: space-between;
1307
+ align-items: center;
1308
+ text-align: left;
1309
+ `;
1310
+ const AccordionDescription = styled.div `
1311
+ padding: 16px;
1312
+ background: #252525;
1313
+ font-size: 14px;
1314
+ display: ${({ isOpen }) => (isOpen ? "block" : "none")};
1315
+ `;
1316
+ const AtomHeading = styled(Heading).attrs((_a) => {
1317
+ var _b, _c, _d;
1318
+ var { theme } = _a, props = __rest(_a, ["theme"]);
1319
+ return ({
1320
+ variant: ((_d = (_c = (_b = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _b === void 0 ? void 0 : _b[(props === null || props === void 0 ? void 0 : props.variant) || "Accordion-primary"]) === null || _c === void 0 ? void 0 : _c.atomHeading) === null || _d === void 0 ? void 0 : _d.variant) || "h5"
1321
+ });
1322
+ }) ``;
1323
+ const AtomText = styled(Text).attrs((_a) => {
1324
+ var _b, _c, _d;
1325
+ var { theme } = _a, props = __rest(_a, ["theme"]);
1326
+ return ({
1327
+ variant: ((_d = (_c = (_b = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _b === void 0 ? void 0 : _b[(props === null || props === void 0 ? void 0 : props.variant) || "Accordion-primary"]) === null || _c === void 0 ? void 0 : _c.atomText) === null || _d === void 0 ? void 0 : _d.variant) || "regular"
1328
+ });
1329
+ }) ``;
1330
+ const AtomIcon = styled(Icon).attrs((_a) => {
1331
+ var _b, _c, _d;
1332
+ var { theme } = _a, props = __rest(_a, ["theme"]);
1333
+ return ({
1334
+ variant: ((_d = (_c = (_b = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _b === void 0 ? void 0 : _b[(props === null || props === void 0 ? void 0 : props.variant) || "Accordion-primary"]) === null || _c === void 0 ? void 0 : _c.atomIcon) === null || _d === void 0 ? void 0 : _d.variant) || "small"
1335
+ });
1336
+ }) `
1337
+ padding: 16px;
1338
+ `;
1339
+
1340
+ const Accordion = ({ variant = "primary", iconPlus, iconMinus, content = [] }) => {
1341
+ const [openIndices, setOpenIndices] = useState([]);
1342
+ const toggleAccordion = (index) => {
1343
+ setOpenIndices((prev) => {
1344
+ const newOpenIndices = [...prev];
1345
+ newOpenIndices[index] = !newOpenIndices[index];
1346
+ return newOpenIndices;
1347
+ });
1348
+ };
1349
+ return (React.createElement(AccordionContainer, { className: classNames("Accordion", variant), variant: "Accordion-" + variant }, content === null || content === void 0 ? void 0 : content.map((item, index) => (React.createElement(AccordionItem, { key: index },
1350
+ React.createElement(WrapperLine, { onClick: () => toggleAccordion(index) },
1351
+ React.createElement(AccordionTitle, null,
1352
+ React.createElement(AtomHeading, { variant: "Accordion-" + variant }, item.title)),
1353
+ React.createElement(AtomIcon, { svg: openIndices[index] ? iconMinus : iconPlus })),
1354
+ React.createElement(AccordionDescription, { isOpen: openIndices[index] },
1355
+ React.createElement(AtomText, { variant: "Accordion-" + variant }, item.description)))))));
1267
1356
  };
1268
1357
 
1269
- export { BreakerTape, Button, CardBanner, CardSimpleRender, CardTeaser, Divider, Footer, Gradient, Header, Heading, Icon, Link, Navigation, Text };
1358
+ export { Accordion, BreakerTape, Button, CardBanner, CardSimpleRender, CardTeaser, Divider, Footer, Gradient, Header, Heading, Icon, Link, Navigation, Text };
1270
1359
  //# sourceMappingURL=index.js.map