@windstream/react-shared-components 0.1.17 → 0.1.18

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/core.d.ts CHANGED
@@ -59,7 +59,7 @@ type InputFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
59
59
 
60
60
  declare const InputField: ForwardRefRenderFunction<HTMLInputElement, InputFieldProps>;
61
61
  declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
62
- state?: "error" | "default" | "filled" | "active" | "focus" | "hover" | undefined;
62
+ state?: "default" | "error" | "filled" | "active" | "focus" | "hover" | undefined;
63
63
  size?: "medium" | "large" | "slim" | undefined;
64
64
  label?: string | undefined;
65
65
  errorText?: string | undefined;
@@ -345,7 +345,7 @@ type ButtonAsAnchor = ButtonCustomProps & Omit<AnchorHTMLAttributes<HTMLAnchorEl
345
345
  };
346
346
  type ButtonProps = ButtonAsButton | ButtonAsAnchor;
347
347
 
348
- declare const BrandButton: React__default.ForwardRefExoticComponent<ButtonProps$2 & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
348
+ declare const BrandButton: React__default.ForwardRefExoticComponent<ButtonProps$2 & React__default.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
349
349
 
350
350
  declare const Checklist: React__default.FC<ChecklistProps>;
351
351
 
package/dist/index.d.ts CHANGED
@@ -63,7 +63,7 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
63
63
  size?: "slim" | "medium" | "large" | undefined;
64
64
  label?: string | undefined;
65
65
  errorText?: string | undefined;
66
- prefixIconName?: "search" | "location_on" | undefined;
66
+ prefixIconName?: "location_on" | "search" | undefined;
67
67
  prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
68
68
  prefixIconFill?: boolean | undefined;
69
69
  suffixIconFill?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windstream/react-shared-components",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "description": "Shared React components for Kinetic applications",
6
6
  "main": "dist/index.js",
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import BlogCard from "../cards/blog-card";
2
3
  import SimpleCard from "../cards/simple-card";
3
4
  import { CalloutProps } from "./types";
4
5
 
@@ -12,6 +13,7 @@ export const Callout: React.FC<CalloutProps> = ({
12
13
  color = "dark",
13
14
  maxWidth = true,
14
15
  maxCardsPerRow,
16
+ cardType = "simple",
15
17
  }) => {
16
18
  const lgWidth =
17
19
  {
@@ -23,6 +25,31 @@ export const Callout: React.FC<CalloutProps> = ({
23
25
 
24
26
  const mdWidth = items.length === 1 ? " md:w-full" : " md:w-[calc(50%-1rem)]";
25
27
 
28
+ const renderCard = (item: CalloutProps["items"][number], index: number) => {
29
+ if (cardType === "blog") {
30
+ const blogItem = item as any;
31
+ return (
32
+ <BlogCard
33
+ title={blogItem.title}
34
+ href={blogItem.slug}
35
+ description={blogItem.shortDescription}
36
+ date={blogItem.blogCreationDate}
37
+ category={blogItem.category}
38
+ image={blogItem.cover}
39
+ asGrid={false}
40
+ />
41
+ );
42
+ }
43
+ return (
44
+ <SimpleCard
45
+ key={index}
46
+ card={item as any}
47
+ lgWidth={lgWidth}
48
+ mdWidth={mdWidth}
49
+ />
50
+ );
51
+ };
52
+
26
53
  return (
27
54
  <div className="component-container">
28
55
  <div
@@ -48,14 +75,7 @@ export const Callout: React.FC<CalloutProps> = ({
48
75
  )}
49
76
  </div>
50
77
  <div className="card-holder flex flex-wrap items-stretch justify-center gap-8 self-stretch lg:gap-6">
51
- {items.map((item, index: number) => (
52
- <SimpleCard
53
- key={index}
54
- card={item}
55
- lgWidth={lgWidth}
56
- mdWidth={mdWidth}
57
- />
58
- ))}
78
+ {items.map((item, index: number) => renderCard(item, index))}
59
79
  </div>
60
80
  </div>
61
81
  </div>
@@ -1,14 +1,15 @@
1
- export type CalloutProps = {
2
- title?: string;
3
- enableHeading?: boolean;
4
- subtitle?: string;
5
- applyBoxShadow?: boolean;
6
- cardStackingMobile?: boolean;
7
- bottomText?: string;
8
- color?: "dark" | "light";
9
- cardsWidth?: string;
10
- maxCardsPerRow?: number;
11
- noGutter?: boolean;
12
- items: any[];
13
- maxWidth?: boolean;
14
- };
1
+ export type CalloutProps = {
2
+ title?: string;
3
+ enableHeading?: boolean;
4
+ subtitle?: string;
5
+ applyBoxShadow?: boolean;
6
+ cardStackingMobile?: boolean;
7
+ bottomText?: string;
8
+ color?: "dark" | "light";
9
+ cardsWidth?: string;
10
+ maxCardsPerRow?: number;
11
+ noGutter?: boolean;
12
+ items: any[];
13
+ maxWidth?: boolean;
14
+ cardType?: "simple" | "blog";
15
+ };
@@ -15,9 +15,14 @@ export const BlogCard: React.FC<BlogCardProps> = ({
15
15
  category,
16
16
  image,
17
17
  readMoreText = "Read more",
18
+ asGrid = true,
18
19
  }: BlogCardProps) => {
20
+ const parentClassName = asGrid
21
+ ? "flex h-full flex-col overflow-hidden rounded-xl bg-white shadow-[0_1px_4px_rgba(0,0,0,0.08),0_4px_16px_rgba(0,0,0,0.06)] transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_4px_12px_rgba(0,0,0,0.12),0_8px_24px_rgba(0,0,0,0.10)]"
22
+ : "callout-card lg:w-[calc(33.3333%-1rem)] md:w-[calc(50%-1rem)] w-full overflow-hidden rounded-xl bg-white shadow-[0_1px_4px_rgba(0,0,0,0.08),0_4px_16px_rgba(0,0,0,0.06)] transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_4px_12px_rgba(0,0,0,0.12),0_8px_24px_rgba(0,0,0,0.10)]";
23
+
19
24
  return (
20
- <article className="flex flex-col overflow-hidden rounded-xl bg-white shadow-[0_1px_4px_rgba(0,0,0,0.08),0_4px_16px_rgba(0,0,0,0.06)] transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_4px_12px_rgba(0,0,0,0.12),0_8px_24px_rgba(0,0,0,0.10)]">
25
+ <article className={parentClassName}>
21
26
  {/* Image */}
22
27
  <Link href={href} tabIndex={-1} aria-hidden="true" className="block">
23
28
  <div className="aspect-video w-full flex-shrink-0 overflow-hidden bg-gray-100">
@@ -11,4 +11,5 @@ export interface BlogCardProps {
11
11
  height: number;
12
12
  };
13
13
  readMoreText?: string;
14
+ asGrid?: boolean;
14
15
  }