quirk-ui 0.1.28 → 0.1.30
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 +18 -0
- package/dist/main.d.ts +29 -38
- package/dist/next.d.ts +12 -37
- package/package.json +1 -1
package/dist/core.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { default as default_2 } from 'react';
|
|
3
3
|
import { FormEvent } from 'react';
|
|
4
|
+
import { ImageAdapter } from './core/types/adapters';
|
|
4
5
|
import { JSX } from 'react/jsx-runtime';
|
|
6
|
+
import { LinkAdapter } from './core/types/adapters';
|
|
5
7
|
import { ReactNode } from 'react';
|
|
8
|
+
import { RenderCallToActionProps } from './core/types/renderers';
|
|
9
|
+
import { RenderImageProps } from './core/types/renderers';
|
|
10
|
+
import { RenderLinkProps } from './core/types/renderers';
|
|
11
|
+
import { RenderRichTextProps } from './core/types/renderers';
|
|
6
12
|
|
|
7
13
|
export declare function Accordion({ items, multiple, className, defaultOpenItems, onItemToggle, }: AccordionProps): JSX.Element;
|
|
8
14
|
|
|
@@ -845,6 +851,8 @@ declare const iconAlignClassMap: {
|
|
|
845
851
|
|
|
846
852
|
declare type IconAlignment = keyof typeof iconAlignClassMap;
|
|
847
853
|
|
|
854
|
+
export { ImageAdapter }
|
|
855
|
+
|
|
848
856
|
export declare function Input({ label, id, className, error, helperText, required, disabled, readOnly, size, variant, fullWidth, leftIcon, rightIcon, style, ...restProps }: InputProps): JSX.Element;
|
|
849
857
|
|
|
850
858
|
declare type InputProps = {
|
|
@@ -903,6 +911,8 @@ declare type LabelProps = {
|
|
|
903
911
|
className?: string;
|
|
904
912
|
} & default_2.LabelHTMLAttributes<HTMLLabelElement>;
|
|
905
913
|
|
|
914
|
+
export { LinkAdapter }
|
|
915
|
+
|
|
906
916
|
export declare function List({ items, ordered, variant, size, hoverable, striped, className, style, onItemClick, ...restProps }: ListProps): JSX.Element;
|
|
907
917
|
|
|
908
918
|
export declare type ListItem = {
|
|
@@ -1219,6 +1229,14 @@ declare type RangeProps = {
|
|
|
1219
1229
|
|
|
1220
1230
|
declare type RangeSize = "sm" | "md" | "lg";
|
|
1221
1231
|
|
|
1232
|
+
export { RenderCallToActionProps }
|
|
1233
|
+
|
|
1234
|
+
export { RenderImageProps }
|
|
1235
|
+
|
|
1236
|
+
export { RenderLinkProps }
|
|
1237
|
+
|
|
1238
|
+
export { RenderRichTextProps }
|
|
1239
|
+
|
|
1222
1240
|
export declare type RichContent = string | {
|
|
1223
1241
|
type: "markdown";
|
|
1224
1242
|
content: string;
|
package/dist/main.d.ts
CHANGED
|
@@ -18,21 +18,30 @@ import { FeaturedDocumentsBlockProps as FeaturedDocumentsBlockProps_2 } from './
|
|
|
18
18
|
import { FormEvent } from 'react';
|
|
19
19
|
import { HeroBlockProps } from './next/blocks/HeroBlock/HeroBlock.types';
|
|
20
20
|
import { HeroBlockProps as HeroBlockProps_2 } from './HeroBlock.types';
|
|
21
|
+
import { ImageAdapter } from './core/types/adapters';
|
|
21
22
|
import { ItemType } from './sanity/types/item';
|
|
22
23
|
import { JSX } from 'react/jsx-runtime';
|
|
23
24
|
import { Link } from './sanity/types/link';
|
|
24
|
-
import {
|
|
25
|
-
import { Link as Link_3 } from '../../sanity/types/link';
|
|
25
|
+
import { LinkAdapter } from './core/types/adapters';
|
|
26
26
|
import { LinkProps } from 'next/link';
|
|
27
27
|
import { MetricType } from './sanity/types/metric';
|
|
28
28
|
import { NavigationData } from './sanity/types/navigation';
|
|
29
29
|
import { PageProps } from './sanity/types/page';
|
|
30
30
|
import { PageSection } from './sanity/types/pageSection';
|
|
31
|
-
import { PortableTextBlock } from '@portabletext/
|
|
32
|
-
import { PortableTextBlock as PortableTextBlock_2 } from '@portabletext/
|
|
31
|
+
import { PortableTextBlock } from '@portabletext/react';
|
|
32
|
+
import { PortableTextBlock as PortableTextBlock_2 } from '@portabletext/types';
|
|
33
33
|
import { QuoteBlockProps } from './next/blocks/QuoteBlock/QuoteBlock.types';
|
|
34
34
|
import { QuoteBlockProps as QuoteBlockProps_2 } from './QuoteBlock.types';
|
|
35
35
|
import { ReactNode } from 'react';
|
|
36
|
+
import { RenderCallToActionProps } from './core/types/renderers';
|
|
37
|
+
import { RenderCallToActionProps as RenderCallToActionProps_2 } from '../../../core/types/renderers';
|
|
38
|
+
import { RenderCallToActionProps as RenderCallToActionProps_3 } from '../../core/types/renderers';
|
|
39
|
+
import { RenderImageProps } from './core/types/renderers';
|
|
40
|
+
import { RenderImageProps as RenderImageProps_2 } from '../../../core/types/renderers';
|
|
41
|
+
import { RenderLinkProps } from './core/types/renderers';
|
|
42
|
+
import { RenderRichTextProps } from './core/types/renderers';
|
|
43
|
+
import { RenderRichTextProps as RenderRichTextProps_2 } from '../../../core/types/renderers';
|
|
44
|
+
import { RenderRichTextProps as RenderRichTextProps_3 } from '../../core/types/renderers';
|
|
36
45
|
import { RichTextBlockProps } from './next/blocks/RichTextBlock/RichTextBlock.types';
|
|
37
46
|
import { RichTextBlockProps as RichTextBlockProps_2 } from './RichTextBlock.types';
|
|
38
47
|
import { SanityCategory } from './sanity/types/category';
|
|
@@ -363,9 +372,9 @@ export declare type ContainerTag = "div" | "section" | "main" | "aside" | "artic
|
|
|
363
372
|
export declare function ContentBlock({ layout, heading, additionalContent, image, video, metrics, callToAction, disclaimer, styleOptions, id, renderImage, renderRichText, renderCallToAction, }: ContentBlockOptimisedProps): JSX.Element;
|
|
364
373
|
|
|
365
374
|
declare type ContentBlockOptimisedProps = ContentBlockProps_2 & {
|
|
366
|
-
renderImage?: (props:
|
|
367
|
-
renderRichText?: (props:
|
|
368
|
-
renderCallToAction?: (props:
|
|
375
|
+
renderImage?: (props: RenderImageProps_2) => default_2.ReactElement | null;
|
|
376
|
+
renderRichText?: (props: RenderRichTextProps_2) => default_2.ReactElement | null;
|
|
377
|
+
renderCallToAction?: (props: RenderCallToActionProps_2) => default_2.ReactElement | null;
|
|
369
378
|
};
|
|
370
379
|
|
|
371
380
|
export { ContentBlockProps }
|
|
@@ -461,7 +470,7 @@ export declare type DrawerSize = keyof typeof sizeClassMap_3;
|
|
|
461
470
|
* Flattens all span children into a single string — suitable for Badge labels,
|
|
462
471
|
* aria attributes, and any context that needs a plain string from rich text.
|
|
463
472
|
*/
|
|
464
|
-
export declare function extractText(blocks:
|
|
473
|
+
export declare function extractText(blocks: PortableTextBlock_2[]): string;
|
|
465
474
|
|
|
466
475
|
declare type FABPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
467
476
|
|
|
@@ -949,6 +958,8 @@ declare const iconAlignClassMap: {
|
|
|
949
958
|
|
|
950
959
|
declare type IconAlignment = keyof typeof iconAlignClassMap;
|
|
951
960
|
|
|
961
|
+
export { ImageAdapter }
|
|
962
|
+
|
|
952
963
|
export declare function Input({ label, id, className, error, helperText, required, disabled, readOnly, size, variant, fullWidth, leftIcon, rightIcon, style, ...restProps }: InputProps): JSX.Element;
|
|
953
964
|
|
|
954
965
|
declare type InputProps = {
|
|
@@ -1011,6 +1022,8 @@ declare type LabelProps = {
|
|
|
1011
1022
|
|
|
1012
1023
|
export { Link }
|
|
1013
1024
|
|
|
1025
|
+
export { LinkAdapter }
|
|
1026
|
+
|
|
1014
1027
|
export declare function List({ items, ordered, variant, size, hoverable, striped, className, style, onItemClick, ...restProps }: ListProps): JSX.Element;
|
|
1015
1028
|
|
|
1016
1029
|
export declare type ListItem = {
|
|
@@ -1366,28 +1379,13 @@ declare type RangeSize = "sm" | "md" | "lg";
|
|
|
1366
1379
|
* <HeroBlock {...section} renderCallToAction={renderCallToAction} />
|
|
1367
1380
|
* <ContentBlock {...section} renderCallToAction={renderCallToAction} />
|
|
1368
1381
|
*/
|
|
1369
|
-
export declare function renderCallToAction({ alignment, items, className, }:
|
|
1382
|
+
export declare function renderCallToAction({ alignment, items, className, }: RenderCallToActionProps_3): default_2.ReactElement | null;
|
|
1370
1383
|
|
|
1371
|
-
|
|
1372
|
-
alignment: "left" | "center" | "right";
|
|
1373
|
-
items: Link_2[];
|
|
1374
|
-
className?: string;
|
|
1375
|
-
};
|
|
1384
|
+
export { RenderCallToActionProps }
|
|
1376
1385
|
|
|
1377
|
-
|
|
1378
|
-
alignment: "left" | "center" | "right";
|
|
1379
|
-
items: Link_3[];
|
|
1380
|
-
className?: string;
|
|
1381
|
-
}
|
|
1386
|
+
export { RenderImageProps }
|
|
1382
1387
|
|
|
1383
|
-
|
|
1384
|
-
src: string;
|
|
1385
|
-
alt: string;
|
|
1386
|
-
width?: number;
|
|
1387
|
-
height?: number;
|
|
1388
|
-
priority?: boolean;
|
|
1389
|
-
style?: default_2.CSSProperties;
|
|
1390
|
-
};
|
|
1388
|
+
export { RenderLinkProps }
|
|
1391
1389
|
|
|
1392
1390
|
/**
|
|
1393
1391
|
* Drop-in `renderRichText` prop for all QuirkUI blocks.
|
|
@@ -1397,16 +1395,9 @@ declare type RenderImageProps = {
|
|
|
1397
1395
|
* <HeroBlock {...section} renderRichText={renderRichText} />
|
|
1398
1396
|
* <CardGridBlock {...section} renderRichText={renderRichText} />
|
|
1399
1397
|
*/
|
|
1400
|
-
export declare function renderRichText({ blocks, className, textOverride, animateText, }:
|
|
1398
|
+
export declare function renderRichText({ blocks, className, textOverride, animateText, }: RenderRichTextProps_3): default_2.ReactElement | null;
|
|
1401
1399
|
|
|
1402
|
-
export
|
|
1403
|
-
blocks: PortableTextBlock[];
|
|
1404
|
-
className?: string;
|
|
1405
|
-
/** Optional plain-text override — replaces rendered block content */
|
|
1406
|
-
textOverride?: string;
|
|
1407
|
-
/** Triggers text entrance animation when true */
|
|
1408
|
-
animateText?: boolean;
|
|
1409
|
-
}
|
|
1400
|
+
export { RenderRichTextProps }
|
|
1410
1401
|
|
|
1411
1402
|
export declare type RichContent = string | {
|
|
1412
1403
|
type: "markdown";
|
|
@@ -1423,7 +1414,7 @@ export declare function RichTextBlock({ text, styleOptions, id, renderRichText,
|
|
|
1423
1414
|
export { RichTextBlockProps }
|
|
1424
1415
|
|
|
1425
1416
|
declare interface RichTextProps {
|
|
1426
|
-
blocks:
|
|
1417
|
+
blocks: PortableTextBlock[] | string;
|
|
1427
1418
|
className?: string;
|
|
1428
1419
|
textOverride?: string;
|
|
1429
1420
|
animateText?: boolean;
|
|
@@ -1631,7 +1622,7 @@ declare interface SpotlightCardProps {
|
|
|
1631
1622
|
priority?: boolean;
|
|
1632
1623
|
}) => default_2.ReactElement | null;
|
|
1633
1624
|
renderRichText?: (props: {
|
|
1634
|
-
blocks:
|
|
1625
|
+
blocks: PortableTextBlock_2[];
|
|
1635
1626
|
className?: string;
|
|
1636
1627
|
}) => default_2.ReactElement | null;
|
|
1637
1628
|
}
|
package/dist/next.d.ts
CHANGED
|
@@ -16,13 +16,16 @@ import { FeaturedDocumentsBlockProps as FeaturedDocumentsBlockProps_2 } from './
|
|
|
16
16
|
import { HeroBlockProps } from './next/blocks/HeroBlock/HeroBlock.types';
|
|
17
17
|
import { HeroBlockProps as HeroBlockProps_2 } from './HeroBlock.types';
|
|
18
18
|
import { JSX } from 'react/jsx-runtime';
|
|
19
|
-
import { Link } from '../../../sanity/types/link';
|
|
20
|
-
import { Link as Link_2 } from '../../sanity/types/link';
|
|
21
19
|
import { LinkProps } from 'next/link';
|
|
22
|
-
import { PortableTextBlock } from '@portabletext/
|
|
23
|
-
import { PortableTextBlock as PortableTextBlock_2 } from '@portabletext/
|
|
20
|
+
import { PortableTextBlock } from '@portabletext/react';
|
|
21
|
+
import { PortableTextBlock as PortableTextBlock_2 } from '@portabletext/types';
|
|
24
22
|
import { QuoteBlockProps } from './next/blocks/QuoteBlock/QuoteBlock.types';
|
|
25
23
|
import { QuoteBlockProps as QuoteBlockProps_2 } from './QuoteBlock.types';
|
|
24
|
+
import { RenderCallToActionProps } from '../../../core/types/renderers';
|
|
25
|
+
import { RenderCallToActionProps as RenderCallToActionProps_2 } from '../../core/types/renderers';
|
|
26
|
+
import { RenderImageProps } from '../../../core/types/renderers';
|
|
27
|
+
import { RenderRichTextProps } from '../../core/types/renderers';
|
|
28
|
+
import { RenderRichTextProps as RenderRichTextProps_2 } from '../../../core/types/renderers';
|
|
26
29
|
import { RichTextBlockProps } from './next/blocks/RichTextBlock/RichTextBlock.types';
|
|
27
30
|
import { RichTextBlockProps as RichTextBlockProps_2 } from './RichTextBlock.types';
|
|
28
31
|
import { SanitySpotlight } from '../../../sanity/types/spotlight';
|
|
@@ -57,7 +60,7 @@ export declare function ContentBlock({ layout, heading, additionalContent, image
|
|
|
57
60
|
|
|
58
61
|
declare type ContentBlockOptimisedProps = ContentBlockProps_2 & {
|
|
59
62
|
renderImage?: (props: RenderImageProps) => default_2.ReactElement | null;
|
|
60
|
-
renderRichText?: (props:
|
|
63
|
+
renderRichText?: (props: RenderRichTextProps_2) => default_2.ReactElement | null;
|
|
61
64
|
renderCallToAction?: (props: RenderCallToActionProps) => default_2.ReactElement | null;
|
|
62
65
|
};
|
|
63
66
|
|
|
@@ -72,7 +75,7 @@ export { DocumentListBlockProps }
|
|
|
72
75
|
* Flattens all span children into a single string — suitable for Badge labels,
|
|
73
76
|
* aria attributes, and any context that needs a plain string from rich text.
|
|
74
77
|
*/
|
|
75
|
-
export declare function extractText(blocks:
|
|
78
|
+
export declare function extractText(blocks: PortableTextBlock_2[]): string;
|
|
76
79
|
|
|
77
80
|
export declare function FeaturedDocumentsBlock({ heading, selectionMode, layout, limit, articles, manualArticles, sortBy, callToAction, styleOptions, id, renderRichText, renderLink, renderCard, }: FeaturedDocumentsBlockProps_2): JSX.Element | null;
|
|
78
81
|
|
|
@@ -124,27 +127,6 @@ export { QuoteBlockProps }
|
|
|
124
127
|
*/
|
|
125
128
|
export declare function renderCallToAction({ alignment, items, className, }: RenderCallToActionProps_2): default_2.ReactElement | null;
|
|
126
129
|
|
|
127
|
-
declare type RenderCallToActionProps = {
|
|
128
|
-
alignment: "left" | "center" | "right";
|
|
129
|
-
items: Link[];
|
|
130
|
-
className?: string;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
declare interface RenderCallToActionProps_2 {
|
|
134
|
-
alignment: "left" | "center" | "right";
|
|
135
|
-
items: Link_2[];
|
|
136
|
-
className?: string;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
declare type RenderImageProps = {
|
|
140
|
-
src: string;
|
|
141
|
-
alt: string;
|
|
142
|
-
width?: number;
|
|
143
|
-
height?: number;
|
|
144
|
-
priority?: boolean;
|
|
145
|
-
style?: default_2.CSSProperties;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
130
|
/**
|
|
149
131
|
* Drop-in `renderRichText` prop for all QuirkUI blocks.
|
|
150
132
|
*
|
|
@@ -155,14 +137,7 @@ declare type RenderImageProps = {
|
|
|
155
137
|
*/
|
|
156
138
|
export declare function renderRichText({ blocks, className, textOverride, animateText, }: RenderRichTextProps): default_2.ReactElement | null;
|
|
157
139
|
|
|
158
|
-
export
|
|
159
|
-
blocks: PortableTextBlock[];
|
|
160
|
-
className?: string;
|
|
161
|
-
/** Optional plain-text override — replaces rendered block content */
|
|
162
|
-
textOverride?: string;
|
|
163
|
-
/** Triggers text entrance animation when true */
|
|
164
|
-
animateText?: boolean;
|
|
165
|
-
}
|
|
140
|
+
export { RenderRichTextProps }
|
|
166
141
|
|
|
167
142
|
export declare const RichText: default_2.FC<RichTextProps>;
|
|
168
143
|
|
|
@@ -171,7 +146,7 @@ export declare function RichTextBlock({ text, styleOptions, id, renderRichText,
|
|
|
171
146
|
export { RichTextBlockProps }
|
|
172
147
|
|
|
173
148
|
declare interface RichTextProps {
|
|
174
|
-
blocks:
|
|
149
|
+
blocks: PortableTextBlock[] | string;
|
|
175
150
|
className?: string;
|
|
176
151
|
textOverride?: string;
|
|
177
152
|
animateText?: boolean;
|
|
@@ -189,7 +164,7 @@ declare interface SpotlightCardProps {
|
|
|
189
164
|
priority?: boolean;
|
|
190
165
|
}) => default_2.ReactElement | null;
|
|
191
166
|
renderRichText?: (props: {
|
|
192
|
-
blocks:
|
|
167
|
+
blocks: PortableTextBlock_2[];
|
|
193
168
|
className?: string;
|
|
194
169
|
}) => default_2.ReactElement | null;
|
|
195
170
|
}
|