@windstream/react-shared-components 0.2.79 → 0.2.80

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
@@ -71,7 +71,7 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
71
71
  size?: "slim" | "medium" | "large" | undefined;
72
72
  label?: string | undefined;
73
73
  errorText?: string | undefined;
74
- prefixIconName?: "search" | "location_on" | undefined;
74
+ prefixIconName?: "location_on" | "search" | undefined;
75
75
  prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
76
76
  prefixIconFill?: boolean | undefined;
77
77
  suffixIconFill?: boolean | undefined;
package/dist/index.d.ts CHANGED
@@ -67,8 +67,8 @@ type InputFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
67
67
 
68
68
  declare const InputField: ForwardRefRenderFunction<HTMLInputElement, InputFieldProps>;
69
69
  declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
70
- state?: "default" | "focus" | "active" | "hover" | "filled" | "error" | undefined;
71
- size?: "slim" | "medium" | "large" | undefined;
70
+ state?: "error" | "default" | "focus" | "active" | "hover" | "filled" | undefined;
71
+ size?: "medium" | "slim" | "large" | undefined;
72
72
  label?: string | undefined;
73
73
  errorText?: string | undefined;
74
74
  prefixIconName?: "search" | "location_on" | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windstream/react-shared-components",
3
- "version": "0.2.79",
3
+ "version": "0.2.80",
4
4
  "type": "module",
5
5
  "description": "Shared React components for Kinetic applications",
6
6
  "main": "dist/index.js",
@@ -56,6 +56,7 @@ export const ProductCard: React.FC<ProductCardProps> = ({
56
56
  hasAnyGift = false,
57
57
  twoColumn = false,
58
58
  enableBusinessSettings = false,
59
+ fieldProps,
59
60
  }) => {
60
61
  const [internalExpanded, setInternalExpanded] = useState(false);
61
62
  // Use parent state if provided, otherwise use internal state
@@ -86,7 +87,10 @@ export const ProductCard: React.FC<ProductCardProps> = ({
86
87
  {/* Best Value Banner. Non-best cards render an invisible banner of the
87
88
  same height when a sibling has one, so content stays aligned. */}
88
89
  {bestValue ? (
89
- <div className="label3 rounded-t-[20px] bg-bg-fill-brand-accent px-6 py-2 text-center text-text">
90
+ <div
91
+ {...fieldProps?.bestValueText}
92
+ className="label3 rounded-t-[20px] bg-bg-fill-brand-accent px-6 py-2 text-center text-text"
93
+ >
90
94
  {bestValueText}
91
95
  </div>
92
96
  ) : hasAnyBadge ? (
@@ -116,6 +120,7 @@ export const ProductCard: React.FC<ProductCardProps> = ({
116
120
  <div className="flex w-full flex-col md:w-auto">
117
121
  <Text
118
122
  as="h3"
123
+ {...fieldProps?.planName}
119
124
  className={cx(
120
125
  planNameClass,
121
126
  "whitespace-normal",
@@ -127,13 +132,13 @@ export const ProductCard: React.FC<ProductCardProps> = ({
127
132
  {planSubtext ? (
128
133
  <>
129
134
  <br />
130
- {planSubtext}
135
+ <span {...fieldProps?.planSubtext}>{planSubtext}</span>
131
136
  </>
132
137
  ) : null}
133
138
  </Text>
134
139
  </div>
135
140
  <div className="flex flex-col items-start md:items-end">
136
- <div className="flex items-start">
141
+ <div className="flex items-start" {...fieldProps?.price}>
137
142
  <Text
138
143
  as="span"
139
144
  className={cx(
@@ -167,6 +172,7 @@ export const ProductCard: React.FC<ProductCardProps> = ({
167
172
  {priceSuffixBottom ? (
168
173
  <Text
169
174
  as="span"
175
+ {...fieldProps?.priceSuffixBottom}
170
176
  className={cx(
171
177
  "micro text-nowrap",
172
178
  isDark ? "text-text-inverse" : "text-text"
@@ -181,6 +187,7 @@ export const ProductCard: React.FC<ProductCardProps> = ({
181
187
  {/* Description */}
182
188
  <section data-pc-description={true}>
183
189
  <Text
190
+ {...fieldProps?.description}
184
191
  className={cx(
185
192
  twoColumn ? "footnote md:body2" : "body2",
186
193
  "md:h-[56px]",
@@ -268,6 +275,7 @@ export const ProductCard: React.FC<ProductCardProps> = ({
268
275
  >
269
276
  <Text
270
277
  as="h4"
278
+ {...fieldProps?.featuresTitle}
271
279
  className={cx(
272
280
  "label3",
273
281
  isDark ? "text-text-inverse" : "text-text"
@@ -2,6 +2,7 @@ import React, { ReactNode } from "react";
2
2
 
3
3
  import { ButtonProps } from "@shared/contentful/blocks/button/types";
4
4
  import { CheckPlansProps } from "@shared/types/micro-components";
5
+ import type { FieldProps } from "@shared/types/field-props";
5
6
 
6
7
  export interface ProductCardProps {
7
8
  planName: string;
@@ -37,4 +38,14 @@ export interface ProductCardProps {
37
38
  * sizes at every breakpoint. */
38
39
  twoColumn?: boolean;
39
40
  enableBusinessSettings?: boolean;
41
+ /** Extra DOM attribute props, spread onto the respective rendered elements. */
42
+ fieldProps?: FieldProps<
43
+ | "planName"
44
+ | "planSubtext"
45
+ | "price"
46
+ | "priceSuffixBottom"
47
+ | "description"
48
+ | "bestValueText"
49
+ | "featuresTitle"
50
+ >;
40
51
  }
@@ -438,6 +438,7 @@ function ProductCardPanel({
438
438
  theme={item?.highlighted ? "dark" : "light"}
439
439
  bestValue={bestValue}
440
440
  bestValueText={item?.topBadgeText || "best value"}
441
+ fieldProps={item?.fieldProps}
441
442
  featuresTitle={item?.benefitsTitle}
442
443
  features={features}
443
444
  isExpanded={isExpanded}
@@ -25,6 +25,7 @@ export const Carousel: React.FC<CarouselProps> = ({
25
25
  productCardsRef,
26
26
  onProductCardCtaClick,
27
27
  enableBusinessSettings = false,
28
+ fieldProps,
28
29
  }) => {
29
30
  const baseClass = hasProductCards
30
31
  ? "px-3 py-9 md:py-20"
@@ -38,11 +39,16 @@ export const Carousel: React.FC<CarouselProps> = ({
38
39
  <Text
39
40
  as="h2"
40
41
  className="heading2 text-text md:heading1 md:text-center"
42
+ {...fieldProps?.title}
41
43
  >
42
44
  {fields?.title}
43
45
  </Text>
44
46
  {fields?.subTitle && (
45
- <Text as="h3" className="body1 px-4 pt-4 md:text-center">
47
+ <Text
48
+ as="h3"
49
+ className="body1 px-4 pt-4 md:text-center"
50
+ {...fieldProps?.subTitle}
51
+ >
46
52
  {fields?.subTitle}
47
53
  </Text>
48
54
  )}
@@ -85,6 +91,7 @@ export const Carousel: React.FC<CarouselProps> = ({
85
91
  <Text
86
92
  as="div"
87
93
  className="body3 mt-8 px-4 text-center text-text-secondary"
94
+ {...fieldProps?.disclaimerText}
88
95
  >
89
96
  {disclaimerText}
90
97
  </Text>
@@ -1,6 +1,7 @@
1
1
  import React, { ReactNode } from "react";
2
2
 
3
3
  import { CheckPlansProps } from "@shared/types/micro-components";
4
+ import type { FieldProps } from "@shared/types/field-props";
4
5
 
5
6
  export interface carouselFieldsInterface {
6
7
  __typename: "ComponentCarousel";
@@ -85,6 +86,18 @@ export interface ProductCardFields {
85
86
  url: string;
86
87
  [key: string]: any;
87
88
  };
89
+ /** Pre-computed per-field Inspector Mode / Live Preview DOM attributes for
90
+ * this item, supplied by the consumer and passed through to the rendered
91
+ * ProductCard unchanged. The library itself stays CMS-agnostic. */
92
+ fieldProps?: FieldProps<
93
+ | "planName"
94
+ | "planSubtext"
95
+ | "price"
96
+ | "priceSuffixBottom"
97
+ | "description"
98
+ | "bestValueText"
99
+ | "featuresTitle"
100
+ >;
88
101
  }
89
102
 
90
103
  export interface CardFields {
@@ -148,6 +161,8 @@ export type CarouselProps = {
148
161
  event: React.MouseEvent<HTMLElement>
149
162
  ) => void;
150
163
  enableBusinessSettings?: boolean;
164
+ /** Extra DOM attribute props, spread onto the respective rendered elements. */
165
+ fieldProps?: FieldProps<"title" | "subTitle" | "disclaimerText">;
151
166
  };
152
167
 
153
168
  export interface TabSwitchProps {