@pnx-mixtape/ids-shape 0.0.23 → 0.0.24
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/index.ts +54 -35
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -26,6 +26,21 @@ import {
|
|
|
26
26
|
TagTypes
|
|
27
27
|
} from "./enums"
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Flag certain slots as accepting a collection of items, which should generally be ignored by the type system,
|
|
31
|
+
* as they are often passed as a string of HTML or HTMLElements.
|
|
32
|
+
*
|
|
33
|
+
* This is not ideal, but it is a pragmatic solution to allow for flexibility in content management without requiring
|
|
34
|
+
* strict typing on every piece of content.
|
|
35
|
+
*/
|
|
36
|
+
export type Collection = string | HTMLElement
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Flag certain slots as accepting WYSIWYG content, which is the same as Collection, but semantically indicates that
|
|
40
|
+
* the content is expected to be rich text, which may include HTML elements, rather than plain text or a simple string.
|
|
41
|
+
*/
|
|
42
|
+
export type WysiwygText = Collection
|
|
43
|
+
|
|
29
44
|
/**
|
|
30
45
|
* Base.
|
|
31
46
|
*/
|
|
@@ -73,11 +88,11 @@ export type Heading = {
|
|
|
73
88
|
|
|
74
89
|
export type DefinitionListItem = {
|
|
75
90
|
title: string
|
|
76
|
-
content:
|
|
91
|
+
content: WysiwygText
|
|
77
92
|
}
|
|
78
93
|
|
|
79
94
|
export type DefinitionList = {
|
|
80
|
-
items: DefinitionListItem[]
|
|
95
|
+
items: DefinitionListItem[] | Collection
|
|
81
96
|
title?: Heading
|
|
82
97
|
}
|
|
83
98
|
|
|
@@ -127,8 +142,6 @@ export type LinkedImage = {
|
|
|
127
142
|
|
|
128
143
|
export type Logo = InlineSvg | Image
|
|
129
144
|
|
|
130
|
-
export type WysiwygText = string[] | HTMLElement[] // just an example.
|
|
131
|
-
|
|
132
145
|
/**
|
|
133
146
|
* Forms
|
|
134
147
|
*/
|
|
@@ -209,7 +222,7 @@ export type FormItem = {
|
|
|
209
222
|
|
|
210
223
|
export type Form = {
|
|
211
224
|
action: string
|
|
212
|
-
items: FormItem[]
|
|
225
|
+
items: FormItem[] | Collection
|
|
213
226
|
actions?: Button[]
|
|
214
227
|
title?: string
|
|
215
228
|
id?: string
|
|
@@ -227,7 +240,7 @@ export type SearchForm = {
|
|
|
227
240
|
|
|
228
241
|
export type WayfindingBlock = {
|
|
229
242
|
title?: Heading
|
|
230
|
-
content?:
|
|
243
|
+
content?: WysiwygText
|
|
231
244
|
link?: Link | Button
|
|
232
245
|
}
|
|
233
246
|
|
|
@@ -236,13 +249,13 @@ export type WayfindingBlock = {
|
|
|
236
249
|
*/
|
|
237
250
|
|
|
238
251
|
export type Breadcrumbs = {
|
|
239
|
-
items: Link[] |
|
|
252
|
+
items: Link[] | Collection
|
|
240
253
|
}
|
|
241
254
|
|
|
242
255
|
export type InPageNavigation = {
|
|
243
|
-
title?: Heading
|
|
256
|
+
title?: string | Heading
|
|
244
257
|
levels?: HeadingTypes[]
|
|
245
|
-
items?: Link[]
|
|
258
|
+
items?: Link[] | Collection
|
|
246
259
|
}
|
|
247
260
|
|
|
248
261
|
export type PaginationItem = {
|
|
@@ -276,14 +289,14 @@ export type SideNavigation = Navigation & {
|
|
|
276
289
|
*/
|
|
277
290
|
|
|
278
291
|
export type GridItem = {
|
|
279
|
-
item:
|
|
292
|
+
item: Collection
|
|
280
293
|
container?: boolean
|
|
281
294
|
modifiers?: GridModifiers[]
|
|
282
295
|
as?: AsTypes
|
|
283
296
|
}
|
|
284
297
|
|
|
285
298
|
export type Grid = {
|
|
286
|
-
items: GridItem[]
|
|
299
|
+
items: GridItem[] | Collection
|
|
287
300
|
modifiers?: GridModifiers[]
|
|
288
301
|
as?: SectionTypes
|
|
289
302
|
}
|
|
@@ -293,11 +306,12 @@ export type Section = WayfindingBlock & {
|
|
|
293
306
|
container?: boolean
|
|
294
307
|
as?: SectionTypes
|
|
295
308
|
modifiers?: SectionModifiers[]
|
|
309
|
+
linkBefore?: boolean
|
|
296
310
|
}
|
|
297
311
|
|
|
298
312
|
export type Masthead = {
|
|
299
|
-
content?:
|
|
300
|
-
links?: Link[]
|
|
313
|
+
content?: Collection
|
|
314
|
+
links?: Link[] | Collection
|
|
301
315
|
skipLinks?: Link[]
|
|
302
316
|
background?: MastheadModifier
|
|
303
317
|
}
|
|
@@ -313,7 +327,7 @@ export type Header = {
|
|
|
313
327
|
|
|
314
328
|
export type Footer = {
|
|
315
329
|
navigation?: Navigation
|
|
316
|
-
aoc?:
|
|
330
|
+
aoc?: WysiwygText
|
|
317
331
|
links?: Link[]
|
|
318
332
|
socials?: SocialLinks
|
|
319
333
|
background?: FooterModifier
|
|
@@ -327,38 +341,38 @@ export type Footer = {
|
|
|
327
341
|
|
|
328
342
|
export type LinkList = {
|
|
329
343
|
title?: Heading
|
|
330
|
-
items: Link[]
|
|
344
|
+
items: Link[] | Collection
|
|
331
345
|
}
|
|
332
346
|
|
|
333
347
|
export type AccordionItem = {
|
|
334
348
|
title: string
|
|
335
|
-
content:
|
|
349
|
+
content: WysiwygText
|
|
336
350
|
open?: boolean
|
|
337
351
|
id?: string
|
|
338
352
|
}
|
|
339
353
|
|
|
340
354
|
export type Accordion = {
|
|
341
|
-
items: AccordionItem[]
|
|
355
|
+
items: AccordionItem[] | Collection
|
|
342
356
|
title?: Heading
|
|
343
357
|
toggleAll?: boolean
|
|
344
358
|
}
|
|
345
359
|
|
|
346
360
|
export type Callout = {
|
|
347
|
-
title
|
|
348
|
-
content:
|
|
361
|
+
title?: Heading
|
|
362
|
+
content: WysiwygText
|
|
349
363
|
}
|
|
350
364
|
|
|
351
365
|
export type Card = WayfindingBlock & {
|
|
352
366
|
image?: Image
|
|
353
367
|
icon?: Icon
|
|
354
|
-
tags?: Tags
|
|
368
|
+
tags?: Tags | string
|
|
355
369
|
date?: string
|
|
356
370
|
linkList?: LinkList
|
|
357
371
|
modifiers?: CardModifier[]
|
|
358
372
|
}
|
|
359
373
|
|
|
360
374
|
export type Carousel = {
|
|
361
|
-
items: GridItem[]
|
|
375
|
+
items: GridItem[] | Collection
|
|
362
376
|
loop?: boolean
|
|
363
377
|
pagination: boolean
|
|
364
378
|
counter: boolean
|
|
@@ -390,7 +404,7 @@ export type GlobalAlert = {
|
|
|
390
404
|
type: GlobalAlertTypes
|
|
391
405
|
dismissible: boolean
|
|
392
406
|
title: Heading
|
|
393
|
-
content:
|
|
407
|
+
content: WysiwygText
|
|
394
408
|
link?: Link
|
|
395
409
|
}
|
|
396
410
|
|
|
@@ -409,13 +423,13 @@ export type HeroSearch = HeroBanner & {
|
|
|
409
423
|
export type InPageAlert = {
|
|
410
424
|
type: InPageAlertTypes
|
|
411
425
|
title: Heading
|
|
412
|
-
content:
|
|
426
|
+
content: WysiwygText
|
|
413
427
|
link?: Link
|
|
414
428
|
}
|
|
415
429
|
|
|
416
430
|
export type ListItem = {
|
|
417
431
|
link: Link
|
|
418
|
-
content:
|
|
432
|
+
content: WysiwygText
|
|
419
433
|
tags?: Tags
|
|
420
434
|
label?: string
|
|
421
435
|
info?: string
|
|
@@ -440,27 +454,27 @@ export type ResultsBar = {
|
|
|
440
454
|
}
|
|
441
455
|
|
|
442
456
|
export type StepItem = {
|
|
443
|
-
content:
|
|
457
|
+
content: WysiwygText
|
|
444
458
|
status?: boolean
|
|
445
459
|
}
|
|
446
460
|
|
|
447
461
|
export type Steps = {
|
|
448
|
-
items: StepItem[],
|
|
462
|
+
items: StepItem[] | Collection,
|
|
449
463
|
modifiers?: StepsModifier[]
|
|
450
464
|
fill?: boolean
|
|
451
465
|
counters?: boolean
|
|
452
466
|
}
|
|
453
467
|
|
|
454
468
|
export type SupportList = {
|
|
455
|
-
logos: LinkedImage[]
|
|
469
|
+
logos: LinkedImage[] | Collection
|
|
456
470
|
title?: Heading
|
|
457
|
-
links?: Link[]
|
|
471
|
+
links?: Link[] | Collection
|
|
458
472
|
showBrand?: boolean
|
|
459
473
|
}
|
|
460
474
|
|
|
461
475
|
export type TabItem = {
|
|
462
476
|
id: string
|
|
463
|
-
content:
|
|
477
|
+
content: WysiwygText
|
|
464
478
|
title?: string
|
|
465
479
|
}
|
|
466
480
|
|
|
@@ -471,20 +485,20 @@ export type TabListItem = {
|
|
|
471
485
|
}
|
|
472
486
|
|
|
473
487
|
export type Tabs = {
|
|
474
|
-
items: TabItem[]
|
|
475
|
-
listItems?: TabListItem[]
|
|
488
|
+
items: TabItem[] | Collection
|
|
489
|
+
listItems?: TabListItem[] | Collection
|
|
476
490
|
id?: string
|
|
477
491
|
title?: Heading
|
|
478
492
|
}
|
|
479
493
|
|
|
480
494
|
export type Tags = {
|
|
481
|
-
items: Link[] | string[] | FormControl[]
|
|
495
|
+
items: Link[] | string[] | FormControl[] | Collection
|
|
482
496
|
type: TagTypes
|
|
483
497
|
}
|
|
484
498
|
|
|
485
499
|
export type SocialLinks = {
|
|
486
500
|
title?: Heading
|
|
487
|
-
items: Link[] | LinkedImage[]
|
|
501
|
+
items: Link[] | LinkedImage[] | Collection
|
|
488
502
|
}
|
|
489
503
|
|
|
490
504
|
export type SocialShare = {
|
|
@@ -517,8 +531,8 @@ export type FilterItem = FormItem & {
|
|
|
517
531
|
export type Filters = {
|
|
518
532
|
action: string
|
|
519
533
|
title: string
|
|
520
|
-
items: FilterItem[]
|
|
521
|
-
actions?: Button[]
|
|
534
|
+
items: FilterItem[] | Collection
|
|
535
|
+
actions?: Button[] | Collection
|
|
522
536
|
direction: "right" | "down"
|
|
523
537
|
instant?: boolean
|
|
524
538
|
collapsible?: boolean // down in nswds - but that name is too vague, when true it's open on desktop and closed on mobile.
|
|
@@ -526,6 +540,11 @@ export type Filters = {
|
|
|
526
540
|
counter?: boolean
|
|
527
541
|
}
|
|
528
542
|
|
|
543
|
+
export type Tooltip = {
|
|
544
|
+
text: string
|
|
545
|
+
content: string
|
|
546
|
+
}
|
|
547
|
+
|
|
529
548
|
export {
|
|
530
549
|
AlignmentTypes,
|
|
531
550
|
AsTypes,
|