@oaknational/oak-components 2.31.0 → 2.33.0

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/types.d.ts CHANGED
@@ -3065,6 +3065,22 @@ declare const OakKbd: ({ children }: OakKbdProps) => React__default.JSX.Element;
3065
3065
  */
3066
3066
  declare const OakScreenReader: styled_components.StyledComponent<"span", styled_components.DefaultTheme, {}, never>;
3067
3067
 
3068
+ type OakLoadingSpinnerProps = Pick<SizeStyleProps, "$width"> & ColorStyleProps & {
3069
+ loaderColor?: OakUiRoleToken;
3070
+ /**
3071
+ * Delay the appearance of the spinner
3072
+ *
3073
+ * Accepts a number in milliseconds
3074
+ */
3075
+ $delay?: number;
3076
+ };
3077
+ /**
3078
+ *
3079
+ * A loading spinner of variable size.
3080
+ *
3081
+ */
3082
+ declare const OakLoadingSpinner: (props: OakLoadingSpinnerProps) => React__default.JSX.Element;
3083
+
3068
3084
  declare const oakHeadingTagsConst: readonly ["div", "h1", "h2", "h3", "h4", "h5", "h6"];
3069
3085
  type OakHeadingTag = (typeof oakHeadingTagsConst)[number];
3070
3086
  declare const oakHeadingTags: ("div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6")[];
@@ -3117,6 +3133,10 @@ type OakInlineBannerProps = OakFlexProps & {
3117
3133
  * The color filter to apply to the icon
3118
3134
  */
3119
3135
  iconColorFilter?: OakUiRoleToken;
3136
+ /**
3137
+ * If true show a loading spinner instead of an icon
3138
+ */
3139
+ isLoading?: boolean;
3120
3140
  /**
3121
3141
  * The optional call to action to display in the banner
3122
3142
  */
@@ -3150,7 +3170,8 @@ type BannerTypes = {
3150
3170
  declare const bannerTypes: BannerTypes;
3151
3171
  type OakInlineBannerVariantProps = {
3152
3172
  [key in OakInlineBannerVariants]: {
3153
- icon: Partial<OakIconProps>;
3173
+ defaultIconDimensions: Partial<SizeStyleProps>;
3174
+ loadingSpinnerDimensions: Partial<OakLoadingSpinnerProps>;
3154
3175
  heading: Partial<OakHeadingProps>;
3155
3176
  closeButtonWrapper?: Partial<OakBoxProps>;
3156
3177
  ctaWrapper?: Partial<OakBoxProps>;
@@ -3171,6 +3192,7 @@ declare const bannerVariants: OakInlineBannerVariantProps;
3171
3192
  * - **type?** \- Optional type of banner to display (info, neutral, success, alert, error, warning) (default: info)
3172
3193
  * - **icon?** \- Optional icon to display in the banner
3173
3194
  * - **iconColorFilter?** \- Optional color filter to apply to the icon
3195
+ * - **isLoading?** \- If true show a loading spinner instead of an icon
3174
3196
  * - **cta?** \- Optional call to action to display in the banner (ReactNode)
3175
3197
  * - **canDismiss?** \- If true the banner can be dismissed (show close icon) (default: false)
3176
3198
  * - **onDismiss?** \- Function called when the banner is dismissed
@@ -3178,23 +3200,7 @@ declare const bannerVariants: OakInlineBannerVariantProps;
3178
3200
  * - **variant?** \- The variant of the inline banner to display (regular, large) (default: regular)
3179
3201
  * - **...rest** \- Other props to be passed to the wrapper OakFlex component (can be used to override styles of the banner)
3180
3202
  */
3181
- declare const OakInlineBanner: ({ isOpen, title, message, type, cta, canDismiss, onDismiss, icon, iconColorFilter, closeButtonOverrideProps, variant, titleTag, ...props }: OakInlineBannerProps) => React__default.JSX.Element;
3182
-
3183
- type OakLoadingSpinnerProps = Pick<SizeStyleProps, "$width"> & ColorStyleProps & {
3184
- loaderColor?: OakUiRoleToken;
3185
- /**
3186
- * Delay the appearance of the spinner
3187
- *
3188
- * Accepts a number in milliseconds
3189
- */
3190
- $delay?: number;
3191
- };
3192
- /**
3193
- *
3194
- * A loading spinner of variable size.
3195
- *
3196
- */
3197
- declare const OakLoadingSpinner: (props: OakLoadingSpinnerProps) => React__default.JSX.Element;
3203
+ declare const OakInlineBanner: ({ isOpen, title, message, type, icon, iconColorFilter, isLoading, cta, canDismiss, onDismiss, closeButtonOverrideProps, variant, titleTag, ...props }: OakInlineBannerProps) => React__default.JSX.Element;
3198
3204
 
3199
3205
  type OakModalCenterProps = {
3200
3206
  /**
@@ -3445,6 +3451,9 @@ type OakHoverLinkComponent = <C extends React__default.ElementType = "a">(props:
3445
3451
  displayDisabled?: boolean;
3446
3452
  } & PolymorphicPropsWithRef<C> & OakHoverLinkProps) => React__default.ReactNode;
3447
3453
  /**
3454
+ * deprecated - use `<OakLink />` instead
3455
+ * @deprecated
3456
+ *
3448
3457
  * A link with an optional icon where underline is shown on hover.
3449
3458
  *
3450
3459
  * Defaulting to a `HTMLAnchorElement` this component is polymorphic and can be rendered as a button or any other element.
@@ -3453,16 +3462,23 @@ type OakHoverLinkComponent = <C extends React__default.ElementType = "a">(props:
3453
3462
  */
3454
3463
  declare const OakHoverLink: OakHoverLinkComponent;
3455
3464
 
3465
+ type Variant = "primary" | "secondary";
3466
+
3456
3467
  type OakLinkProps = Pick<InternalLinkProps, "iconName" | "isTrailingIcon" | "isLoading"> & {
3457
3468
  iconWidth?: OakAllSpacingToken;
3458
3469
  iconHeight?: OakAllSpacingToken;
3459
- };
3470
+ /**
3471
+ * Style variant of the OakLink component: "primary" | "secondary"
3472
+ *
3473
+ * @default "primary"
3474
+ */
3475
+ variant?: Variant;
3476
+ } & Pick<TypographyStyleProps, "$font">;
3460
3477
  type OakLinkComponent$1 = <C extends React__default.ElementType = "a">(props: PolymorphicPropsWithRef<C> & OakLinkProps) => React__default.ReactNode;
3461
3478
  /**
3462
- * A blue link with an optional icon and loading state.
3479
+ * A link with an optional icon and loading state.
3463
3480
  *
3464
3481
  * Defaulting to a `HTMLAnchorElement` this component is polymorphic and can be rendered as a button or any other element.
3465
- * ą
3466
3482
  */
3467
3483
  declare const OakLink: OakLinkComponent$1;
3468
3484
 
@@ -3511,6 +3527,9 @@ type OakSecondaryLinkProps = {
3511
3527
  } & Pick<InternalLinkProps, "iconName" | "isTrailingIcon" | "isLoading">;
3512
3528
  type OakLinkComponent = <C extends React__default.ElementType = "a">(props: PolymorphicPropsWithRef<C> & OakSecondaryLinkProps) => React__default.ReactNode;
3513
3529
  /**
3530
+ * deprecated - use `<OakLink variant="secondary"/>` instead
3531
+ * @deprecated
3532
+ *
3514
3533
  * A black link with an optional icon and loading state.
3515
3534
  *
3516
3535
  * Defaulting to a `HTMLAnchorElement` this component is polymorphic and can be rendered as a button or any other element.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oaknational/oak-components",
3
- "version": "2.31.0",
3
+ "version": "2.33.0",
4
4
  "licence": "MIT",
5
5
  "description": "Shared components for Oak applications",
6
6
  "main": "dist/cjs/index.js",