@manamerge/mana-atomic-ui 0.0.90 → 0.0.92

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.
Files changed (27) hide show
  1. package/dist/index.d.ts +17 -13
  2. package/dist/index.js +91 -114
  3. package/dist/index.js.map +1 -1
  4. package/dist/themes/themes/Manamerge.ts +5 -3
  5. package/dist/themes/themes/manamerge/atoms/button.ts +6 -0
  6. package/dist/themes/themes/manamerge/atoms/divider.ts +25 -0
  7. package/dist/themes/themes/manamerge/atoms/gradient.ts +19 -0
  8. package/dist/themes/themes/manamerge/molecules/navigation.ts +3 -0
  9. package/dist/types/components/Atoms/Divider/Divider.css.d.ts +3 -0
  10. package/dist/types/components/Atoms/Divider/Divider.d.ts +10 -0
  11. package/dist/types/components/Atoms/Divider/Divider.stories.d.ts +9 -0
  12. package/dist/types/components/Atoms/Gradient/Gradient.css.d.ts +3 -0
  13. package/dist/types/components/Atoms/Gradient/Gradient.d.ts +6 -0
  14. package/dist/types/components/Atoms/Gradient/Gradient.stories.d.ts +7 -0
  15. package/dist/types/components/Molecules/Navigation/Navigation.css.d.ts +1 -0
  16. package/dist/types/components/index.d.ts +2 -1
  17. package/dist/types/themes/Manamerge.d.ts +50 -24
  18. package/dist/types/themes/manamerge/atoms/button.d.ts +6 -0
  19. package/dist/types/themes/manamerge/atoms/divider.d.ts +24 -0
  20. package/dist/types/themes/manamerge/atoms/gradient.d.ts +18 -0
  21. package/dist/types/themes/manamerge/molecules/navigation.d.ts +3 -0
  22. package/package.json +1 -1
  23. package/dist/themes/themes/manamerge/molecules/accordion.ts +0 -35
  24. package/dist/types/components/Molecules/Accordion/Accordion.css.d.ts +0 -13
  25. package/dist/types/components/Molecules/Accordion/Accordion.d.ts +0 -12
  26. package/dist/types/components/Molecules/Accordion/Accordion.stories.d.ts +0 -6
  27. package/dist/types/themes/manamerge/molecules/accordion.d.ts +0 -24
package/dist/index.d.ts CHANGED
@@ -93,6 +93,22 @@ interface LinkTypes extends AnchorHTMLAttributes<HTMLAnchorElement> {
93
93
  }
94
94
  declare const Link: React.FC<LinkTypes>;
95
95
 
96
+ interface GradientTypes {
97
+ variant?: string;
98
+ children: React.ReactNode;
99
+ }
100
+ declare const Gradient: React.FC<GradientTypes>;
101
+
102
+ interface DividerTypes {
103
+ variant?: string;
104
+ width?: string;
105
+ height?: string;
106
+ color?: string;
107
+ borderRadius?: string;
108
+ margin?: string;
109
+ }
110
+ declare const Divider: React.FC<DividerTypes>;
111
+
96
112
  interface HeaderTypes {
97
113
  iconTop?: FunctionComponent<SVGProps<SVGSVGElement>>;
98
114
  iconDot?: FunctionComponent<SVGProps<SVGSVGElement>>;
@@ -170,16 +186,4 @@ interface CardBannerTypes {
170
186
  }
171
187
  declare const CardBanner: React.FC<CardBannerTypes>;
172
188
 
173
- interface ContentTypes {
174
- title?: string;
175
- description?: string;
176
- }
177
- interface AccordionTypes {
178
- variant?: string;
179
- iconPlus: FunctionComponent<SVGProps<SVGSVGElement>>;
180
- iconMinus: FunctionComponent<SVGProps<SVGSVGElement>>;
181
- content?: ContentTypes[];
182
- }
183
- declare const Accordion: React.FC<AccordionTypes>;
184
-
185
- export { Accordion, BreakerTape, Button, CardBanner, CardSimpleRender, CardTeaser, Footer, Header, Heading, Icon, Link, Navigation, Text };
189
+ export { BreakerTape, Button, CardBanner, CardSimpleRender, CardTeaser, Divider, Footer, Gradient, Header, Heading, Icon, Link, Navigation, Text };
package/dist/index.js CHANGED
@@ -168,7 +168,7 @@ const TextContainer = styled.p `
168
168
  ${(_a) => {
169
169
  var _b;
170
170
  var { variant = "regular", theme } = _a, props = __rest(_a, ["variant", "theme"]);
171
- const textStyles = ((_b = theme === null || theme === void 0 ? void 0 : theme.textStyles) === null || _b === void 0 ? void 0 : _b[variant]) || {};
171
+ const textStyles = ((_b = theme === null || theme === void 0 ? void 0 : theme.text) === null || _b === void 0 ? void 0 : _b[variant]) || {};
172
172
  return css `
173
173
  margin: ${props.margin || textStyles.margin};
174
174
  font-size: ${props.fontSize || textStyles.fontSize};
@@ -184,7 +184,7 @@ const TextContainerLabel = styled.label `
184
184
  ${(_a) => {
185
185
  var _b;
186
186
  var { variant = "regular", theme } = _a, props = __rest(_a, ["variant", "theme"]);
187
- const textStyles = ((_b = theme === null || theme === void 0 ? void 0 : theme.textStyles) === null || _b === void 0 ? void 0 : _b[variant]) || {};
187
+ const textStyles = ((_b = theme === null || theme === void 0 ? void 0 : theme.text) === null || _b === void 0 ? void 0 : _b[variant]) || {};
188
188
  return css `
189
189
  margin: ${props.margin || textStyles.margin};
190
190
  font-size: ${props.fontSize || textStyles.fontSize};
@@ -326,6 +326,56 @@ const Link = (_a) => {
326
326
  return (React.createElement(StyledLink$2, Object.assign({ className: classNames("Link-" + variant), variant: "Link-" + variant, as: Component, fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight }, componentProps, props), children));
327
327
  };
328
328
 
329
+ const GradientContainer = styled.div `
330
+ ${({ variant = "primary", theme }) => {
331
+ var _a;
332
+ const gradientStyles = ((_a = theme === null || theme === void 0 ? void 0 : theme.gradient) === null || _a === void 0 ? void 0 : _a[variant]) || {};
333
+ return css `
334
+ width: fit-content;
335
+ //gradient capability
336
+ background: radial-gradient(
337
+ ${gradientStyles.orientation},
338
+ ${gradientStyles.primaryColor},
339
+ ${gradientStyles.secondaryColor}
340
+ );
341
+
342
+ -webkit-background-clip: text;
343
+ -webkit-text-fill-color: transparent;
344
+ `;
345
+ }};
346
+ `;
347
+
348
+ const Gradient = (_a) => {
349
+ var { variant, children } = _a, props = __rest(_a, ["variant", "children"]);
350
+ return (React.createElement(GradientContainer, Object.assign({ className: classNames("Gradient-", variant), variant: "Gradient-" + variant }, props), children));
351
+ };
352
+
353
+ const DividerStyle = styled.hr `
354
+ border: none;
355
+ border-top: 1px solid;
356
+ border: 0 none;
357
+
358
+ ${(_a) => {
359
+ var _b;
360
+ var { theme, variant = "primary" } = _a, props = __rest(_a, ["theme", "variant"]);
361
+ const dividerStyle = ((_b = theme === null || theme === void 0 ? void 0 : theme.divider) === null || _b === void 0 ? void 0 : _b[variant]) || {};
362
+ return css `
363
+ width: ${props.width || dividerStyle.width || "100%"};
364
+ background-color: ${props.color || dividerStyle.color || "#000"};
365
+ height: ${props.height || dividerStyle.height || "2px"};
366
+ border-radius: ${props.borderRadius ||
367
+ dividerStyle.borderRadius ||
368
+ "10px"};
369
+ margin: ${props.margin || dividerStyle.margin || "0"};
370
+ `;
371
+ }}
372
+ `;
373
+
374
+ const Divider = (_a) => {
375
+ var { variant } = _a, props = __rest(_a, ["variant"]);
376
+ return (React.createElement(DividerStyle, Object.assign({ className: classNames("Divider-", variant), variant: "Divider-" + variant }, props)));
377
+ };
378
+
329
379
  const WrapperBackground = styled.div `
330
380
  position: relative;
331
381
  display: flex;
@@ -353,6 +403,17 @@ const WrapperBackground = styled.div `
353
403
  `;
354
404
  }}
355
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
+ }
356
417
  }
357
418
  `;
358
419
  const WrapperHeader = styled.div `
@@ -419,7 +480,7 @@ const AtomIconDot = styled(Icon).attrs(({ theme }) => {
419
480
  `;
420
481
  }}
421
482
  `;
422
- const AtomHeading$3 = styled(Heading).attrs(({ theme }) => {
483
+ const AtomHeading$2 = styled(Heading).attrs(({ theme }) => {
423
484
  var _a, _b;
424
485
  return ({
425
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"
@@ -483,7 +544,7 @@ const Header = ({ iconTop, iconDot, iconLeft, iconRight, textBanner, headingTitl
483
544
  React.createElement(WrapperLineTop, null,
484
545
  iconDot && React.createElement(AtomIconDot, { svg: iconDot }),
485
546
  React.createElement(AtomTextTitle, null, textBanner))),
486
- React.createElement(AtomHeading$3, null, headingTitle),
547
+ React.createElement(AtomHeading$2, null, headingTitle),
487
548
  React.createElement("div", null, textTitle === null || textTitle === void 0 ? void 0 : textTitle.map((text, i) => (React.createElement(AtomTextTitle, { key: i }, text)))),
488
549
  React.createElement(WrapperLineBottom, null,
489
550
  React.createElement(AtomButtonLeft, { onClick: buttonLeftClick },
@@ -578,6 +639,12 @@ const StyledLink$1 = styled(Link).attrs(({ theme }) => {
578
639
  `;
579
640
  }};
580
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
+ }) ``;
581
648
 
582
649
  const Navigation = ({ iconBurger, tabs, onTabClick }) => {
583
650
  const location = useLocation();
@@ -586,14 +653,10 @@ const Navigation = ({ iconBurger, tabs, onTabClick }) => {
586
653
  const handleToggle = () => {
587
654
  setIsOpen(!isOpen);
588
655
  };
589
- const handleKeyDown = (event) => {
590
- if (event.key === "Enter" || event.key === " ") {
591
- handleToggle();
592
- }
593
- };
594
656
  return (React.createElement(NavBar, null,
595
657
  React.createElement(BurgerWrapper, null,
596
- 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 }))),
597
660
  React.createElement(NavLinks, { isOpen: isOpen }, tabs.length > 0
598
661
  ? tabs.map((tab) => (React.createElement(StyledLink$1, { key: tab.label, to: tab.to, currentPath: tab.label === currentPath, onClick: () => {
599
662
  onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(tab.label);
@@ -1054,6 +1117,8 @@ const Card$1 = styled.div `
1054
1117
  var { theme } = _a, props = __rest(_a, ["theme"]);
1055
1118
  const thisTheme = (theme === null || theme === void 0 ? void 0 : theme.cardSimpleRender) || {};
1056
1119
  return css `
1120
+ all: unset;
1121
+ width: 100%;
1057
1122
  display: flex;
1058
1123
  flex-direction: ${(props === null || props === void 0 ? void 0 : props.flexDirection) ||
1059
1124
  (thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.flexDirection) ||
@@ -1105,7 +1170,7 @@ const Card$1 = styled.div `
1105
1170
  `;
1106
1171
  }}
1107
1172
  `;
1108
- const WrapperLine$1 = styled.div `
1173
+ const WrapperLine = styled.div `
1109
1174
  display: flex;
1110
1175
  align-items: center;
1111
1176
  justify-content: center;
@@ -1113,19 +1178,19 @@ const WrapperLine$1 = styled.div `
1113
1178
  text-align: center;
1114
1179
  gap: 10px;
1115
1180
  `;
1116
- const AtomIcon$2 = styled(Icon).attrs(({ theme }) => {
1181
+ const AtomIcon$1 = styled(Icon).attrs(({ theme }) => {
1117
1182
  var _a, _b;
1118
1183
  return ({
1119
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"
1120
1185
  });
1121
1186
  }) ``;
1122
- const AtomHeading$2 = styled(Heading).attrs(({ theme }) => {
1187
+ const AtomHeading$1 = styled(Heading).attrs(({ theme }) => {
1123
1188
  var _a, _b;
1124
1189
  return ({
1125
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"
1126
1191
  });
1127
1192
  }) ``;
1128
- const AtomText$2 = styled(Text).attrs(({ theme }) => {
1193
+ const AtomText$1 = styled(Text).attrs(({ theme }) => {
1129
1194
  var _a, _b;
1130
1195
  return ({
1131
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"
@@ -1133,19 +1198,12 @@ const AtomText$2 = styled(Text).attrs(({ theme }) => {
1133
1198
  }) ``;
1134
1199
 
1135
1200
  const CardSimpleRender = ({ icon, title, description, children, cardClick }) => {
1136
- const handleKeyDown = (event) => {
1137
- if (cardClick) {
1138
- if (event.key === "Enter" || event.key === " ") {
1139
- cardClick(event);
1140
- }
1141
- }
1142
- };
1143
- 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 },
1144
1202
  React.createElement("div", null,
1145
- React.createElement(WrapperLine$1, null,
1146
- icon && React.createElement(AtomIcon$2, { svg: icon }),
1147
- React.createElement(AtomHeading$2, null, title)),
1148
- React.createElement(AtomText$2, null, description)),
1203
+ React.createElement(WrapperLine, null,
1204
+ icon && React.createElement(AtomIcon$1, { svg: icon }),
1205
+ React.createElement(AtomHeading$1, null, title)),
1206
+ React.createElement(AtomText$1, null, description)),
1149
1207
  children));
1150
1208
  };
1151
1209
 
@@ -1175,13 +1233,13 @@ const Card = styled.div `
1175
1233
  `;
1176
1234
  }}
1177
1235
  `;
1178
- const AtomHeading$1 = styled(Heading).attrs(({ theme }) => {
1236
+ const AtomHeading = styled(Heading).attrs(({ theme }) => {
1179
1237
  var _a, _b;
1180
1238
  return ({
1181
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"
1182
1240
  });
1183
1241
  }) ``;
1184
- const AtomText$1 = styled(Text).attrs(({ theme }) => {
1242
+ const AtomText = styled(Text).attrs(({ theme }) => {
1185
1243
  var _a, _b;
1186
1244
  return ({
1187
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"
@@ -1199,7 +1257,7 @@ const AtomTextButton = styled(Text).attrs(({ theme }) => {
1199
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"
1200
1258
  });
1201
1259
  }) ``;
1202
- const AtomIcon$1 = styled(Icon).attrs(({ theme }) => {
1260
+ const AtomIcon = styled(Icon).attrs(({ theme }) => {
1203
1261
  var _a, _b;
1204
1262
  return ({
1205
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"
@@ -1209,93 +1267,12 @@ const AtomIcon$1 = styled(Icon).attrs(({ theme }) => {
1209
1267
  const CardBanner = ({ icon, title, description, buttonText, buttonClick }) => {
1210
1268
  return (React.createElement(Card, null,
1211
1269
  React.createElement("div", null,
1212
- React.createElement(AtomHeading$1, null, title),
1213
- React.createElement(AtomText$1, null, description)),
1270
+ React.createElement(AtomHeading, null, title),
1271
+ React.createElement(AtomText, null, description)),
1214
1272
  buttonClick && (React.createElement(AtomButton, { onClick: buttonClick },
1215
1273
  React.createElement(AtomTextButton, null, buttonText),
1216
- icon && React.createElement(AtomIcon$1, { svg: icon })))));
1217
- };
1218
-
1219
- const AccordionContainer = styled.div `
1220
- width: 100%;
1221
- background-color: #1e1e1e;
1222
- color: white;
1223
- border-radius: 8px;
1224
- overflow: hidden;
1225
- font-family: Arial, sans-serif;
1226
- `;
1227
- const AccordionItem = styled.div `
1228
- border-bottom: 1px solid #333;
1229
- `;
1230
- const WrapperLine = styled.div `
1231
- display: flex;
1232
- align-items: center;
1233
- justify-content: space-between;
1234
- text-align: center;
1235
- gap: 10px;
1236
- cursor: pointer;
1237
- background: #2a2a2a;
1238
- &:hover {
1239
- background: #3a3a3a;
1240
- }
1241
- `;
1242
- const AccordionTitle = styled.div `
1243
- width: 80%;
1244
- padding: 16px;
1245
- font-size: 16px;
1246
- font-weight: bold;
1247
- display: flex;
1248
- justify-content: space-between;
1249
- align-items: center;
1250
- text-align: left;
1251
- `;
1252
- const AccordionDescription = styled.div `
1253
- padding: 16px;
1254
- background: #252525;
1255
- font-size: 14px;
1256
- display: ${({ isOpen }) => (isOpen ? "block" : "none")};
1257
- `;
1258
- const AtomHeading = styled(Heading).attrs((_a) => {
1259
- var _b, _c, _d;
1260
- var { theme } = _a, props = __rest(_a, ["theme"]);
1261
- return ({
1262
- 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"
1263
- });
1264
- }) ``;
1265
- const AtomText = styled(Text).attrs((_a) => {
1266
- var _b, _c, _d;
1267
- var { theme } = _a, props = __rest(_a, ["theme"]);
1268
- return ({
1269
- 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"
1270
- });
1271
- }) ``;
1272
- const AtomIcon = styled(Icon).attrs((_a) => {
1273
- var _b, _c, _d;
1274
- var { theme } = _a, props = __rest(_a, ["theme"]);
1275
- return ({
1276
- 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"
1277
- });
1278
- }) `
1279
- padding: 16px;
1280
- `;
1281
-
1282
- const Accordion = ({ variant = "primary", iconPlus, iconMinus, content = [] }) => {
1283
- const [openIndices, setOpenIndices] = useState([]);
1284
- const toggleAccordion = (index) => {
1285
- setOpenIndices((prev) => {
1286
- const newOpenIndices = [...prev];
1287
- newOpenIndices[index] = !newOpenIndices[index];
1288
- return newOpenIndices;
1289
- });
1290
- };
1291
- 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 },
1292
- React.createElement(WrapperLine, { onClick: () => toggleAccordion(index) },
1293
- React.createElement(AccordionTitle, null,
1294
- React.createElement(AtomHeading, { variant: "Accordion-" + variant }, item.title)),
1295
- React.createElement(AtomIcon, { svg: openIndices[index] ? iconMinus : iconPlus })),
1296
- React.createElement(AccordionDescription, { isOpen: openIndices[index] },
1297
- React.createElement(AtomText, { variant: "Accordion-" + variant }, item.description)))))));
1274
+ icon && React.createElement(AtomIcon, { svg: icon })))));
1298
1275
  };
1299
1276
 
1300
- export { Accordion, BreakerTape, Button, CardBanner, CardSimpleRender, CardTeaser, Footer, Header, Heading, Icon, Link, Navigation, Text };
1277
+ export { BreakerTape, Button, CardBanner, CardSimpleRender, CardTeaser, Divider, Footer, Gradient, Header, Heading, Icon, Link, Navigation, Text };
1301
1278
  //# sourceMappingURL=index.js.map