@oaknational/oak-components 2.19.2 → 2.21.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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/types.d.ts +23 -5
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -3499,6 +3499,10 @@ type OakCardProps = {
|
|
|
3499
3499
|
* The heading text of the card.
|
|
3500
3500
|
*/
|
|
3501
3501
|
heading: string;
|
|
3502
|
+
/**
|
|
3503
|
+
* The heading level of the card.
|
|
3504
|
+
*/
|
|
3505
|
+
headingLevel?: OakHeadingTag;
|
|
3502
3506
|
/**
|
|
3503
3507
|
* The URL that the card links to.
|
|
3504
3508
|
*/
|
|
@@ -3552,7 +3556,7 @@ type OakCardProps = {
|
|
|
3552
3556
|
* The card can be oriented in a row or column layout and its width can be adjusted using spacing tokens.
|
|
3553
3557
|
* The image aspect ratio can be set to either 1:1 or 4:3.
|
|
3554
3558
|
*/
|
|
3555
|
-
declare const OakCard: ({ heading, href, cardOrientation, cardWidth, imageSrc, imageAlt, aspectRatio, subCopy, tagName, tagBackground, linkText, linkIconName, }: OakCardProps) => React__default.JSX.Element;
|
|
3559
|
+
declare const OakCard: ({ heading, headingLevel, href, cardOrientation, cardWidth, imageSrc, imageAlt, aspectRatio, subCopy, tagName, tagBackground, linkText, linkIconName, }: OakCardProps) => React__default.JSX.Element;
|
|
3556
3560
|
|
|
3557
3561
|
type OakBreadcrumb = {
|
|
3558
3562
|
text: string;
|
|
@@ -5291,11 +5295,9 @@ type OakULProps = OakBoxProps & OakFlexProps & {
|
|
|
5291
5295
|
* */
|
|
5292
5296
|
declare const OakUL: styled_components.StyledComponent<"ul", styled_components.DefaultTheme, OakULProps, never>;
|
|
5293
5297
|
|
|
5294
|
-
type
|
|
5298
|
+
type UnstyledChevronAccordionCommonProps = {
|
|
5295
5299
|
/** The header of the accordion. */
|
|
5296
5300
|
header: ReactNode;
|
|
5297
|
-
/** Whether the accordion should be open initially. */
|
|
5298
|
-
isInitiallyOpen?: boolean;
|
|
5299
5301
|
/** The content of the accordion. */
|
|
5300
5302
|
content: ReactNode;
|
|
5301
5303
|
/** Optional subheader to display above the fold. */
|
|
@@ -5307,13 +5309,29 @@ type UnstyledChevronAccordionProps = {
|
|
|
5307
5309
|
/** Aria label for the button when the accordion is closed. */
|
|
5308
5310
|
ariaLabelClose?: string;
|
|
5309
5311
|
} & FlexStyleProps & OakBoxProps & ColorStyleProps;
|
|
5312
|
+
type UnstyledChevronAccordionUncontrolledProps = {
|
|
5313
|
+
/** Whether the accordion should be open initially. Uncontrolled usage only. */
|
|
5314
|
+
isInitiallyOpen?: boolean;
|
|
5315
|
+
isOpen?: never;
|
|
5316
|
+
onOpenChange?: never;
|
|
5317
|
+
};
|
|
5318
|
+
type UnstyledChevronAccordionControlledProps = {
|
|
5319
|
+
isInitiallyOpen?: never;
|
|
5320
|
+
/** Controlled open state. Must be paired with `onOpenChange`. */
|
|
5321
|
+
isOpen: boolean;
|
|
5322
|
+
/** Called when the user toggles the accordion. Required when `isOpen` is provided. */
|
|
5323
|
+
onOpenChange: (open: boolean) => void;
|
|
5324
|
+
};
|
|
5325
|
+
type UnstyledChevronAccordionProps = UnstyledChevronAccordionCommonProps & (UnstyledChevronAccordionUncontrolledProps | UnstyledChevronAccordionControlledProps);
|
|
5310
5326
|
/**
|
|
5311
5327
|
* - UnstyledChevronAccordion has a chevron icon that rotates when the accordion is open.
|
|
5312
5328
|
* - Unlike InternalChevronAccordion, it has no border effects for hover or focus states.
|
|
5313
5329
|
* - Only the chevron is interactive so as to allow interactive elements to be placed in the header.
|
|
5314
5330
|
* - The intention is for these to be added by consuming components as needed.
|
|
5331
|
+
* - Can be used as an uncontrolled component (via `isInitiallyOpen`) or as a
|
|
5332
|
+
* controlled component (via `isOpen` + `onOpenChange`).
|
|
5315
5333
|
*/
|
|
5316
|
-
declare const UnstyledChevronAccordion: (
|
|
5334
|
+
declare const UnstyledChevronAccordion: (props: UnstyledChevronAccordionProps) => React__default.JSX.Element;
|
|
5317
5335
|
|
|
5318
5336
|
/**
|
|
5319
5337
|
*
|