@tui/design-system 0.1.1-MR-211.12 → 0.2.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/CHANGELOG.md +164 -118
- package/README.md +1 -1
- package/dist/themes/crystalski/index.css +5 -0
- package/dist/themes/crystalski/index.css.map +1 -1
- package/dist/themes/firstchoice/index.css +5 -0
- package/dist/themes/firstchoice/index.css.map +1 -1
- package/dist/themes/tui/index.css +5 -0
- package/dist/themes/tui/index.css.map +1 -1
- package/package.json +4 -3
- package/scss/lib/cards/article/_index.scss +3 -0
- package/scss/lib/cards/article/_mixins.scss +147 -0
- package/scss/lib/cards/article/_variables.scss +6 -0
- package/scss/lib/cards/card/_mixins.scss +15 -4
- package/scss/lib/cards/icon/_index.scss +3 -0
- package/scss/lib/cards/icon/_mixins.scss +113 -0
- package/scss/lib/cards/icon/_variables.scss +7 -0
- package/scss/lib/cards/search/_mixins.scss +0 -4
- package/scss/lib/image/_mixins.scss +4 -0
- package/scss/mixins.scss +3 -1
- package/scss/themes/crystalski/_overrides.scss +16 -0
- package/scss/themes/crystalski/index.scss +6 -0
- package/scss/themes/firstchoice/_overrides.scss +19 -0
- package/scss/themes/firstchoice/index.scss +6 -0
- package/scss/themes/firstchoice/theme.json +17 -0
- package/scss/themes/tui/index.scss +6 -0
- package/scss/variables/base-theme.json +39 -0
- package/scss/variables.scss +3 -1
- package/types/components.ts +274 -11
package/types/components.ts
CHANGED
|
@@ -7,6 +7,18 @@ export type IconPosition = 'none' | 'leading' | 'trailing';
|
|
|
7
7
|
export type ButtonVariantBase = 'primary' | 'secondary' | 'promotion' | 'search';
|
|
8
8
|
export type HeadingLevel = '2' | '3' | '4' | '5' | '6';
|
|
9
9
|
|
|
10
|
+
// ─── Form Row ────────────────────────────────────────────
|
|
11
|
+
export interface FormRowProps {
|
|
12
|
+
labelText?: string;
|
|
13
|
+
reduced?: boolean;
|
|
14
|
+
hint?: boolean;
|
|
15
|
+
hintText?: string;
|
|
16
|
+
error?: boolean;
|
|
17
|
+
errorText?: string;
|
|
18
|
+
group?: boolean;
|
|
19
|
+
theme?: Theme;
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
// ─── Icon ────────────────────────────────────────────────
|
|
11
23
|
export interface IconProps {
|
|
12
24
|
type?: 'standard' | 'color' | 'bullet';
|
|
@@ -229,13 +241,8 @@ export interface InputSwitchProps {
|
|
|
229
241
|
|
|
230
242
|
// ─── Input Select ──────────────────────────────────────
|
|
231
243
|
export interface InputSelectProps {
|
|
232
|
-
labelText?: string;
|
|
233
244
|
inputText?: string;
|
|
234
245
|
icon?: string;
|
|
235
|
-
error?: boolean;
|
|
236
|
-
errorText?: string;
|
|
237
|
-
hint?: boolean;
|
|
238
|
-
hintText?: string;
|
|
239
246
|
disabled?: boolean;
|
|
240
247
|
theme?: Theme;
|
|
241
248
|
}
|
|
@@ -246,7 +253,6 @@ export interface InputTextProps {
|
|
|
246
253
|
icon?: string;
|
|
247
254
|
disabled?: boolean;
|
|
248
255
|
valid?: boolean;
|
|
249
|
-
error?: boolean;
|
|
250
256
|
theme?: Theme;
|
|
251
257
|
}
|
|
252
258
|
|
|
@@ -261,14 +267,9 @@ export interface PaginationProps {
|
|
|
261
267
|
|
|
262
268
|
// ─── Textarea ──────────────────────────────────────────
|
|
263
269
|
export interface TextareaProps {
|
|
264
|
-
textareaLabelText?: string;
|
|
265
|
-
hint?: boolean;
|
|
266
|
-
hintText?: string;
|
|
267
270
|
textareaValue?: string;
|
|
268
271
|
charCount?: number;
|
|
269
272
|
disabled?: boolean;
|
|
270
|
-
error?: boolean;
|
|
271
|
-
errorText?: string;
|
|
272
273
|
theme?: Theme;
|
|
273
274
|
}
|
|
274
275
|
|
|
@@ -355,3 +356,265 @@ export interface RangeIconsGroupProps {
|
|
|
355
356
|
items?: RangeIconsGroupItem[];
|
|
356
357
|
theme?: Theme;
|
|
357
358
|
}
|
|
359
|
+
|
|
360
|
+
// ─── Accordion ─────────────────────────────────────────
|
|
361
|
+
export interface AccordionProps {
|
|
362
|
+
hasImage?: 'none' | 'logo' | 'icon';
|
|
363
|
+
logoUrl?: string;
|
|
364
|
+
icon?: string;
|
|
365
|
+
headingLevel?: number;
|
|
366
|
+
headingText: string;
|
|
367
|
+
subTitle?: string;
|
|
368
|
+
content: string;
|
|
369
|
+
openState?: boolean;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export interface AccordionGroupProps extends AccordionProps {
|
|
373
|
+
group?: 'none' | 'default' | 'divider';
|
|
374
|
+
groupLength?: number;
|
|
375
|
+
intro?: string;
|
|
376
|
+
toggleOpen?: string;
|
|
377
|
+
toggleClose?: string;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// ─── Breadcrumb ────────────────────────────────────────
|
|
381
|
+
export interface BreadcrumbItem {
|
|
382
|
+
label: string;
|
|
383
|
+
href: string;
|
|
384
|
+
isCurrent?: boolean;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export interface BreadcrumbProps {
|
|
388
|
+
breadcrumbItems: BreadcrumbItem[];
|
|
389
|
+
ariaLabel?: string;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// ─── Image ─────────────────────────────────────────────
|
|
393
|
+
export interface ImageSrcItem {
|
|
394
|
+
url: string;
|
|
395
|
+
size: string;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export type ImageFocalPoint =
|
|
399
|
+
| 'top-left'
|
|
400
|
+
| 'top-center'
|
|
401
|
+
| 'top-right'
|
|
402
|
+
| 'center-left'
|
|
403
|
+
| 'center'
|
|
404
|
+
| 'center-right'
|
|
405
|
+
| 'bottom-left'
|
|
406
|
+
| 'bottom-center'
|
|
407
|
+
| 'bottom-right';
|
|
408
|
+
|
|
409
|
+
export interface ImageProps {
|
|
410
|
+
altText: string;
|
|
411
|
+
imageUrl: string;
|
|
412
|
+
srcset?: ImageSrcItem[];
|
|
413
|
+
ratio?: 'landscape' | 'panoramic' | 'portrait' | 'square' | 'wide';
|
|
414
|
+
shape?: 'rectangle' | 'rounded';
|
|
415
|
+
focalPoint?: ImageFocalPoint;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// ─── Rich Text ─────────────────────────────────────────
|
|
419
|
+
export interface RichTextProps {
|
|
420
|
+
content?: string;
|
|
421
|
+
isComponent?: boolean;
|
|
422
|
+
isInverse?: boolean;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// ─── Media Button ──────────────────────────────────────
|
|
426
|
+
export interface MediaButtonProps {
|
|
427
|
+
element?: 'a' | 'button';
|
|
428
|
+
label?: string;
|
|
429
|
+
accessibleLabel?: string;
|
|
430
|
+
icon?: IconPosition;
|
|
431
|
+
iconAsset?: string;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// ─── Price ─────────────────────────────────────────────
|
|
435
|
+
export interface PriceProps {
|
|
436
|
+
size?: 'small' | 'medium' | 'large';
|
|
437
|
+
currency?: 'GBP' | 'EUR' | 'USD' | 'SEK' | 'NOK' | 'DKK';
|
|
438
|
+
mainUnit?: string;
|
|
439
|
+
subUnit?: string;
|
|
440
|
+
suffix?: string;
|
|
441
|
+
prefix?: boolean;
|
|
442
|
+
totalPrice?: boolean;
|
|
443
|
+
totalPriceValue?: string;
|
|
444
|
+
promo?: boolean;
|
|
445
|
+
originalPrice?: string;
|
|
446
|
+
discount?: string;
|
|
447
|
+
showDecimal?: boolean;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// ─── Input Checkbox ────────────────────────────────────
|
|
451
|
+
export interface InputCheckboxProps {
|
|
452
|
+
isIndividual?: boolean;
|
|
453
|
+
variant?: 'default' | 'strong' | 'title';
|
|
454
|
+
state?: 'unchecked' | 'checked' | 'indeterminate';
|
|
455
|
+
disabled?: boolean;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// ─── Input Radio ───────────────────────────────────────
|
|
459
|
+
export interface InputRadioProps {
|
|
460
|
+
variant?: 'default' | 'strong' | 'title';
|
|
461
|
+
disabled?: boolean;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// ─── Input Slider ──────────────────────────────────────
|
|
465
|
+
export interface InputSliderProps {
|
|
466
|
+
min?: number;
|
|
467
|
+
max?: number;
|
|
468
|
+
step?: number;
|
|
469
|
+
value?: number | null;
|
|
470
|
+
minLabel?: string;
|
|
471
|
+
maxLabel?: string;
|
|
472
|
+
disabled?: boolean;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// ─── Input Stepper ─────────────────────────────────────
|
|
476
|
+
export interface InputStepperProps {
|
|
477
|
+
value?: number;
|
|
478
|
+
min?: number;
|
|
479
|
+
max?: number;
|
|
480
|
+
step?: number;
|
|
481
|
+
incLabel?: string;
|
|
482
|
+
decLabel?: string;
|
|
483
|
+
disabled?: boolean;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// ─── Datepicker ────────────────────────────────────────
|
|
487
|
+
export interface DatepickerProps {
|
|
488
|
+
rangeSelection?: boolean;
|
|
489
|
+
dualView?: boolean;
|
|
490
|
+
scrollableMobile?: boolean;
|
|
491
|
+
weekNumbers?: boolean;
|
|
492
|
+
weekLabel?: string;
|
|
493
|
+
weekLabelFull?: string;
|
|
494
|
+
hideInput?: boolean;
|
|
495
|
+
separateCal?: boolean;
|
|
496
|
+
value?: string;
|
|
497
|
+
minDate?: string;
|
|
498
|
+
maxDate?: string;
|
|
499
|
+
previousLabel?: string;
|
|
500
|
+
nextLabel?: string;
|
|
501
|
+
locale?: string;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// ─── Modal ─────────────────────────────────────────────
|
|
505
|
+
export interface ModalProps {
|
|
506
|
+
header?: string;
|
|
507
|
+
size?: 'small' | 'medium' | 'large';
|
|
508
|
+
primaryButtonLabel?: string;
|
|
509
|
+
secondaryButtonLabel?: string;
|
|
510
|
+
closeButtonLabel?: string;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// ─── Hero ──────────────────────────────────────────────
|
|
514
|
+
export interface HeroProps {
|
|
515
|
+
alignment?: 'left' | 'right' | 'center';
|
|
516
|
+
reduced?: boolean;
|
|
517
|
+
variant?: 'default' | 'default slim' | 'flagship' | 'flagship slim' | 'illustration';
|
|
518
|
+
heading?: string;
|
|
519
|
+
content?: string;
|
|
520
|
+
hideButton?: boolean;
|
|
521
|
+
buttonLabel?: string;
|
|
522
|
+
caveat?: string;
|
|
523
|
+
imageUrl?: string;
|
|
524
|
+
altText?: string;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// ─── Scroller ──────────────────────────────────────────
|
|
528
|
+
export interface ScrollerProps {
|
|
529
|
+
isHorizontal?: boolean;
|
|
530
|
+
hasFade?: boolean;
|
|
531
|
+
isInverse?: boolean;
|
|
532
|
+
label?: string;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// ─── Flyout Dropdown ───────────────────────────────────
|
|
536
|
+
export interface FlyoutDropdownProps {
|
|
537
|
+
variant?: 'variable-height' | 'menu-flyout';
|
|
538
|
+
arrowPosition?: 'centre' | 'left' | 'right';
|
|
539
|
+
hasHeader?: boolean;
|
|
540
|
+
hasHeaderDivider?: boolean;
|
|
541
|
+
hasFooter?: boolean;
|
|
542
|
+
label?: string;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// ─── Card Article ──────────────────────────────────────
|
|
546
|
+
export interface CardArticleProps {
|
|
547
|
+
type?: 'static' | 'link' | 'multi-link';
|
|
548
|
+
elementType?: 'anchor' | 'button';
|
|
549
|
+
content?: 'short' | 'medium' | 'long' | 'rich';
|
|
550
|
+
headingText?: string;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// ─── Card Icon ─────────────────────────────────────────
|
|
554
|
+
export interface CardIconProps {
|
|
555
|
+
type?: 'static' | 'link';
|
|
556
|
+
size?: 'small' | 'large';
|
|
557
|
+
elementType?: 'anchor' | 'button';
|
|
558
|
+
hasLabel?: boolean;
|
|
559
|
+
labelText?: string;
|
|
560
|
+
cardText?: string;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// ─── Card Selectable ───────────────────────────────────
|
|
564
|
+
export interface CardSelectableProps {
|
|
565
|
+
disabled?: boolean;
|
|
566
|
+
dashed?: boolean;
|
|
567
|
+
cardType?: 'card' | 'radio' | 'checkbox';
|
|
568
|
+
cardCount?: number;
|
|
569
|
+
showVisibleInput?: boolean;
|
|
570
|
+
visibleInputLocation?: 'top' | 'bottom';
|
|
571
|
+
cardLabelText?: string;
|
|
572
|
+
cardContentText?: string;
|
|
573
|
+
contentLayout?: 'content only' | 'title only' | 'title and content';
|
|
574
|
+
selectedIndex?: number;
|
|
575
|
+
clickableArea?: 'input' | 'card';
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// ─── Search Card ───────────────────────────────────────
|
|
579
|
+
export interface SearchCardProps {
|
|
580
|
+
flagship?: boolean;
|
|
581
|
+
productLabel?: boolean;
|
|
582
|
+
gallery?: boolean;
|
|
583
|
+
quickview?: boolean;
|
|
584
|
+
promoArea?: boolean;
|
|
585
|
+
highlightsArea?: boolean;
|
|
586
|
+
toggleOpen?: string;
|
|
587
|
+
toggleClose?: string;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// ─── In-Page Tabs ──────────────────────────────────────
|
|
591
|
+
export interface InPageTab {
|
|
592
|
+
label: string;
|
|
593
|
+
content?: string;
|
|
594
|
+
icon?: string;
|
|
595
|
+
disabled?: boolean;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export interface InPageTabsProps {
|
|
599
|
+
variant?: 'left-aligned' | 'full-width';
|
|
600
|
+
icon?: string;
|
|
601
|
+
active?: string;
|
|
602
|
+
ariaLabelledby?: string;
|
|
603
|
+
tabs?: InPageTab[];
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// ─── Anchor Tabs ───────────────────────────────────────
|
|
607
|
+
export interface AnchorTab {
|
|
608
|
+
label: string;
|
|
609
|
+
href: string;
|
|
610
|
+
icon?: string;
|
|
611
|
+
disabled?: boolean;
|
|
612
|
+
sectionContent?: string;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export interface AnchorTabsProps {
|
|
616
|
+
icon?: string;
|
|
617
|
+
ariaLabelledby?: string;
|
|
618
|
+
tabs?: AnchorTab[];
|
|
619
|
+
sticky?: boolean;
|
|
620
|
+
}
|