@ndla/primitives 1.0.13-alpha.0 → 1.0.14-alpha.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/panda.buildinfo.json +32 -9
- package/dist/styles.css +121 -28
- package/es/Button.js +38 -14
- package/es/Checkbox.js +5 -1
- package/es/FileUpload.js +176 -0
- package/es/Hero.js +1 -2
- package/es/ListItem/ListItem.js +1 -2
- package/es/Popover.js +6 -3
- package/es/Tree/Tree.js +209 -0
- package/es/index.js +2 -1
- package/lib/Button.d.ts +36 -5
- package/lib/Button.js +38 -14
- package/lib/Checkbox.d.ts +1 -0
- package/lib/Checkbox.js +5 -1
- package/lib/FileUpload.d.ts +49 -0
- package/lib/FileUpload.js +182 -0
- package/lib/Hero.d.ts +1 -1
- package/lib/Hero.js +1 -2
- package/lib/ListItem/ListItem.d.ts +1 -1
- package/lib/ListItem/ListItem.js +1 -2
- package/lib/Popover.d.ts +3 -1
- package/lib/Popover.js +19 -17
- package/lib/Tree/Tree.d.ts +50 -0
- package/lib/Tree/Tree.js +215 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +80 -1
- package/package.json +5 -5
|
@@ -155,6 +155,11 @@
|
|
|
155
155
|
"marginBlock]___[value:0]___[cond:& svg",
|
|
156
156
|
"width]___[value:medium]___[cond:& svg",
|
|
157
157
|
"height]___[value:medium]___[cond:& svg",
|
|
158
|
+
"height]___[value:large",
|
|
159
|
+
"width]___[value:large",
|
|
160
|
+
"width]___[value:small]___[cond:& svg",
|
|
161
|
+
"height]___[value:small]___[cond:& svg",
|
|
162
|
+
"paddingInline]___[value:xxsmall",
|
|
158
163
|
"userSelect]___[value:none",
|
|
159
164
|
"gap]___[value:xxsmall",
|
|
160
165
|
"color]___[value:text.action]___[cond:_hover",
|
|
@@ -331,6 +336,25 @@
|
|
|
331
336
|
"paddingInlineEnd]___[value:medium",
|
|
332
337
|
"paddingInlineStart]___[value:0",
|
|
333
338
|
"paddingInlineEnd]___[value:0",
|
|
339
|
+
"gap]___[value:small",
|
|
340
|
+
"padding]___[value:4xlarge",
|
|
341
|
+
"transitionProperty]___[value:border, border-color",
|
|
342
|
+
"borderStyle]___[value:dashed]___[cond:_hover",
|
|
343
|
+
"borderStyle]___[value:solid]___[cond:_hover<___>_disabled",
|
|
344
|
+
"borderColor]___[value:stroke.subtle]___[cond:_hover<___>_disabled",
|
|
345
|
+
"display]___[value:grid",
|
|
346
|
+
"gridTemplateAreas]___[value: \"preview name delete\" \"preview size delete\"",
|
|
347
|
+
"gridTemplateColumns]___[value:auto 1fr auto",
|
|
348
|
+
"gridColumnGap]___[value:small",
|
|
349
|
+
"gridArea]___[value:preview",
|
|
350
|
+
"gridArea]___[value:name",
|
|
351
|
+
"whiteSpace]___[value:nowrap",
|
|
352
|
+
"textOverflow]___[value:ellipsis",
|
|
353
|
+
"gridArea]___[value:size",
|
|
354
|
+
"gridArea]___[value:delete",
|
|
355
|
+
"alignSelf]___[value:center",
|
|
356
|
+
"objectFit]___[value:cover",
|
|
357
|
+
"height]___[value:100%",
|
|
334
358
|
"borderRadius]___[value:small",
|
|
335
359
|
"backgroundColor]___[value:surface.default",
|
|
336
360
|
"backgroundColor]___[value:surface.brand.2.subtle",
|
|
@@ -339,7 +363,7 @@
|
|
|
339
363
|
"clipPath]___[value:polygon(0 0, 100% 0, 100% calc(100% - 5vw), 0 100%)",
|
|
340
364
|
"position]___[value:absolute",
|
|
341
365
|
"background]___[value:primary",
|
|
342
|
-
"background]___[value:
|
|
366
|
+
"background]___[value:surface.brand.2.bold",
|
|
343
367
|
"background]___[value:surface.brand.2",
|
|
344
368
|
"background]___[value:surface.brand.1",
|
|
345
369
|
"background]___[value:surface.infoSubtle",
|
|
@@ -391,7 +415,6 @@
|
|
|
391
415
|
"padding]___[value:3xsmall",
|
|
392
416
|
"boxShadow]___[value:small",
|
|
393
417
|
"alignItems]___[value:flex-start",
|
|
394
|
-
"gap]___[value:small",
|
|
395
418
|
"background]___[value:surface.warningSubtle",
|
|
396
419
|
"borderColor]___[value:stroke.warning",
|
|
397
420
|
"background]___[value:surface.successSubtle",
|
|
@@ -400,6 +423,7 @@
|
|
|
400
423
|
"borderColor]___[value:stroke.error",
|
|
401
424
|
"color]___[value:primary",
|
|
402
425
|
"fontVariantNumeric]___[value:tabular-nums",
|
|
426
|
+
"maxHeight]___[value:inherit",
|
|
403
427
|
"zIndex]___[value:popover",
|
|
404
428
|
"maxWidth]___[value:var(--available-width)",
|
|
405
429
|
"animation]___[value:fade-shift-in 0.2s ease-out]___[cond:_open",
|
|
@@ -458,8 +482,6 @@
|
|
|
458
482
|
"borderInlineEndColor]___[value:stroke.default",
|
|
459
483
|
"animationDuration]___[value:2s]___[cond:_motionReduce",
|
|
460
484
|
"borderWidth]___[value:4px",
|
|
461
|
-
"height]___[value:large",
|
|
462
|
-
"width]___[value:large",
|
|
463
485
|
"borderWidth]___[value:8px",
|
|
464
486
|
"background]___[value:surface.disabled.strong",
|
|
465
487
|
"padding]___[value:1",
|
|
@@ -516,7 +538,6 @@
|
|
|
516
538
|
"marginBlockEnd]___[value:-1px]___[cond:_horizontal",
|
|
517
539
|
"marginInlineEnd]___[value:-1px]___[cond:_vertical",
|
|
518
540
|
"transitionProperty]___[value:color, background, border-color",
|
|
519
|
-
"whiteSpace]___[value:nowrap",
|
|
520
541
|
"color]___[value:text.strong]___[cond:_selected",
|
|
521
542
|
"color]___[value:text.subtle]___[cond:_disabled<___>_hover",
|
|
522
543
|
"borderColor]___[value:stroke.default]___[cond:_hover<___>_focusVisible",
|
|
@@ -593,11 +614,9 @@
|
|
|
593
614
|
"paddingInlineEnd]___[value:xxlarge",
|
|
594
615
|
"top]___[value:xxsmall",
|
|
595
616
|
"right]___[value:xxsmall",
|
|
596
|
-
"paddingInline]___[value:xxsmall",
|
|
597
617
|
"--arrow-size]___[value:spacing.xxsmall",
|
|
598
618
|
"--arrow-background]___[value:colors.surface.action",
|
|
599
619
|
"height]___[value:200px",
|
|
600
|
-
"objectFit]___[value:cover",
|
|
601
620
|
"minHeight]___[value:3xlarge",
|
|
602
621
|
"borderBlockWidth]___[value:1px",
|
|
603
622
|
"borderInlineColor]___[value:transparent",
|
|
@@ -622,7 +641,7 @@
|
|
|
622
641
|
"--border-hover]___[value:colors.stroke.hover",
|
|
623
642
|
"--color-current-hover]___[value:colors.text.onAction",
|
|
624
643
|
"--background-hover]___[value:colors.surface.brand.2.moderate",
|
|
625
|
-
"--background-current]___[value:colors.
|
|
644
|
+
"--background-current]___[value:colors.surface.brand.2.bold",
|
|
626
645
|
"--border-hover]___[value:colors.surface.brand.2.strong",
|
|
627
646
|
"borderBlockColor]___[value:stroke.subtle",
|
|
628
647
|
"borderBlockColor]___[value:var(--border-hover)]___[cond:_hover",
|
|
@@ -644,7 +663,11 @@
|
|
|
644
663
|
"minHeight]___[value:40px",
|
|
645
664
|
"maxHeight]___[value:40px",
|
|
646
665
|
"minWidth]___[value:56px",
|
|
647
|
-
"maxWidth]___[value:56px"
|
|
666
|
+
"maxWidth]___[value:56px",
|
|
667
|
+
"paddingInlineStart]___[value:calc((var(--depth) - 1) * token(spacing.medium))",
|
|
668
|
+
"paddingInlineEnd]___[value:xsmall",
|
|
669
|
+
"transform]___[value:rotate(90deg)]___[cond:_open",
|
|
670
|
+
"paddingInlineStart]___[value:calc(((var(--depth) - 1) * token(spacing.medium)) + token(spacing.xxlarge) + token(spacing.3xsmall))"
|
|
648
671
|
],
|
|
649
672
|
"recipes": {}
|
|
650
673
|
}
|
package/dist/styles.css
CHANGED
|
@@ -287,6 +287,18 @@
|
|
|
287
287
|
width: var(--sizes-xxlarge);
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
+
.h_large {
|
|
291
|
+
height: var(--sizes-large);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.w_large {
|
|
295
|
+
width: var(--sizes-large);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.px_xxsmall {
|
|
299
|
+
padding-inline: var(--spacing-xxsmall);
|
|
300
|
+
}
|
|
301
|
+
|
|
290
302
|
.us_none {
|
|
291
303
|
-webkit-user-select: none;
|
|
292
304
|
user-select: none;
|
|
@@ -544,6 +556,50 @@
|
|
|
544
556
|
padding-inline-end: 0;
|
|
545
557
|
}
|
|
546
558
|
|
|
559
|
+
.gap_small {
|
|
560
|
+
gap: var(--spacing-small);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.p_4xlarge {
|
|
564
|
+
padding: var(--spacing-4xlarge);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.d_grid {
|
|
568
|
+
display: grid;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.grid-area_preview {
|
|
572
|
+
grid-area: preview;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.grid-area_name {
|
|
576
|
+
grid-area: name;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.white-space_nowrap {
|
|
580
|
+
white-space: nowrap;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.tov_ellipsis {
|
|
584
|
+
text-overflow: ellipsis;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.grid-area_size {
|
|
588
|
+
grid-area: size;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.grid-area_delete {
|
|
592
|
+
grid-area: delete;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.obj-f_cover {
|
|
596
|
+
object-fit: cover;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.h_100\% {
|
|
600
|
+
height: 100%;
|
|
601
|
+
}
|
|
602
|
+
|
|
547
603
|
.bdr_small {
|
|
548
604
|
border-radius: var(--radii-small);
|
|
549
605
|
}
|
|
@@ -569,8 +625,8 @@
|
|
|
569
625
|
background: var(--colors-primary);
|
|
570
626
|
}
|
|
571
627
|
|
|
572
|
-
.
|
|
573
|
-
background: var(--colors-
|
|
628
|
+
.bg_surface\.brand\.2\.bold {
|
|
629
|
+
background: var(--colors-surface-brand-2-bold);
|
|
574
630
|
}
|
|
575
631
|
|
|
576
632
|
.bg_surface\.brand\.2 {
|
|
@@ -645,10 +701,6 @@
|
|
|
645
701
|
box-shadow: var(--shadows-small);
|
|
646
702
|
}
|
|
647
703
|
|
|
648
|
-
.gap_small {
|
|
649
|
-
gap: var(--spacing-small);
|
|
650
|
-
}
|
|
651
|
-
|
|
652
704
|
.bg_surface\.warningSubtle {
|
|
653
705
|
background: var(--colors-surface-warning-subtle);
|
|
654
706
|
}
|
|
@@ -665,6 +717,10 @@
|
|
|
665
717
|
color: var(--colors-primary);
|
|
666
718
|
}
|
|
667
719
|
|
|
720
|
+
.max-h_inherit {
|
|
721
|
+
max-height: inherit;
|
|
722
|
+
}
|
|
723
|
+
|
|
668
724
|
.z_popover {
|
|
669
725
|
z-index: var(--z-index-popover);
|
|
670
726
|
}
|
|
@@ -737,14 +793,6 @@
|
|
|
737
793
|
border-block-color: var(--colors-background-subtle);
|
|
738
794
|
}
|
|
739
795
|
|
|
740
|
-
.h_large {
|
|
741
|
-
height: var(--sizes-large);
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
.w_large {
|
|
745
|
-
width: var(--sizes-large);
|
|
746
|
-
}
|
|
747
|
-
|
|
748
796
|
.bg_surface\.disabled\.strong {
|
|
749
797
|
background: var(--colors-surface-disabled-strong);
|
|
750
798
|
}
|
|
@@ -777,10 +825,6 @@
|
|
|
777
825
|
table-layout: fixed;
|
|
778
826
|
}
|
|
779
827
|
|
|
780
|
-
.white-space_nowrap {
|
|
781
|
-
white-space: nowrap;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
828
|
.ring_3px_solid {
|
|
785
829
|
outline: 3px solid;
|
|
786
830
|
}
|
|
@@ -857,10 +901,6 @@
|
|
|
857
901
|
padding-inline-end: var(--spacing-xxlarge);
|
|
858
902
|
}
|
|
859
903
|
|
|
860
|
-
.px_xxsmall {
|
|
861
|
-
padding-inline: var(--spacing-xxsmall);
|
|
862
|
-
}
|
|
863
|
-
|
|
864
904
|
.\--arrow-size_spacing\.xxsmall {
|
|
865
905
|
--arrow-size: var(--spacing-xxsmall);
|
|
866
906
|
}
|
|
@@ -873,10 +913,6 @@
|
|
|
873
913
|
height: 200px;
|
|
874
914
|
}
|
|
875
915
|
|
|
876
|
-
.obj-f_cover {
|
|
877
|
-
object-fit: cover;
|
|
878
|
-
}
|
|
879
|
-
|
|
880
916
|
.min-h_3xlarge {
|
|
881
917
|
min-height: var(--sizes-3xlarge);
|
|
882
918
|
}
|
|
@@ -909,8 +945,8 @@
|
|
|
909
945
|
--background-hover: var(--colors-surface-brand-2-moderate);
|
|
910
946
|
}
|
|
911
947
|
|
|
912
|
-
.\--background-current_colors\.
|
|
913
|
-
--background-current: var(--colors-
|
|
948
|
+
.\--background-current_colors\.surface\.brand\.2\.bold {
|
|
949
|
+
--background-current: var(--colors-surface-brand-2-bold);
|
|
914
950
|
}
|
|
915
951
|
|
|
916
952
|
.\--border-hover_colors\.surface\.brand\.2\.strong {
|
|
@@ -941,6 +977,18 @@
|
|
|
941
977
|
max-width: 56px;
|
|
942
978
|
}
|
|
943
979
|
|
|
980
|
+
.ps_calc\(\(var\(--depth\)_-_1\)_\*_token\(spacing\.medium\)\) {
|
|
981
|
+
padding-inline-start: calc((var(--depth) - 1) * var(--spacing-medium));
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.pe_xsmall {
|
|
985
|
+
padding-inline-end: var(--spacing-xsmall);
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
.ps_calc\(\(\(var\(--depth\)_-_1\)_\*_token\(spacing\.medium\)\)_\+_token\(spacing\.xxlarge\)_\+_token\(spacing\.3xsmall\)\) {
|
|
989
|
+
padding-inline-start: calc(((var(--depth) - 1) * var(--spacing-medium)) + var(--spacing-xxlarge) + var(--spacing-3xsmall));
|
|
990
|
+
}
|
|
991
|
+
|
|
944
992
|
.flex-d_column {
|
|
945
993
|
flex-direction: column;
|
|
946
994
|
}
|
|
@@ -1083,6 +1131,27 @@
|
|
|
1083
1131
|
left: auto;
|
|
1084
1132
|
}
|
|
1085
1133
|
|
|
1134
|
+
.trs-prop_border\,_border-color {
|
|
1135
|
+
--transition-prop: border, border-color;
|
|
1136
|
+
transition-property: border, border-color;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
.grid-template-areas_\"preview_name_delete\"_\"preview_size_delete\" {
|
|
1140
|
+
grid-template-areas: "preview name delete" "preview size delete";
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
.grid-tc_auto_1fr_auto {
|
|
1144
|
+
grid-template-columns: auto 1fr auto;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
.grid-cg_small {
|
|
1148
|
+
grid-column-gap: var(--spacing-small);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
.as_center {
|
|
1152
|
+
align-self: center;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1086
1155
|
.bg-c_surface\.default {
|
|
1087
1156
|
background-color: var(--colors-surface-default);
|
|
1088
1157
|
}
|
|
@@ -1352,6 +1421,14 @@
|
|
|
1352
1421
|
height: var(--sizes-medium);
|
|
1353
1422
|
}
|
|
1354
1423
|
|
|
1424
|
+
.\[\&_svg\]\:w_small svg {
|
|
1425
|
+
width: var(--sizes-small);
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
.\[\&_svg\]\:h_small svg {
|
|
1429
|
+
height: var(--sizes-small);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1355
1432
|
.checked\:c_text\.onAction:is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]) {
|
|
1356
1433
|
color: var(--colors-text-on-action);
|
|
1357
1434
|
}
|
|
@@ -1681,6 +1758,10 @@
|
|
|
1681
1758
|
border-block-color: var(--border-hover);
|
|
1682
1759
|
}
|
|
1683
1760
|
|
|
1761
|
+
.open\:trf_rotate\(90deg\):is([open], [data-open], [data-state="open"]) {
|
|
1762
|
+
transform: rotate(90deg);
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1684
1765
|
.closed\:trs-prop_background\,_border-color\,_border\,_border-radius:is([closed], [data-closed], [data-state="closed"]) {
|
|
1685
1766
|
--transition-prop: background, border-color, border, border-radius;
|
|
1686
1767
|
transition-property: background, border-color, border, border-radius;
|
|
@@ -2083,6 +2164,10 @@
|
|
|
2083
2164
|
outline-color: var(--colors-stroke-hover);
|
|
2084
2165
|
}
|
|
2085
2166
|
|
|
2167
|
+
.hover\:border-style_dashed:is(:hover, [data-hover]) {
|
|
2168
|
+
border-style: dashed;
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2086
2171
|
.hover\:bg-c_surface\.actionSubtle\.hover:is(:hover, [data-hover]) {
|
|
2087
2172
|
background-color: var(--colors-surface-action-subtle-hover);
|
|
2088
2173
|
}
|
|
@@ -2433,6 +2518,14 @@
|
|
|
2433
2518
|
background-color: var(--colors-surface-danger-subtle);
|
|
2434
2519
|
}
|
|
2435
2520
|
|
|
2521
|
+
.hover\:disabled\:border-style_solid:is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled='true']) {
|
|
2522
|
+
border-style: solid;
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
.hover\:disabled\:bd-c_stroke\.subtle:is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled='true']) {
|
|
2526
|
+
border-color: var(--colors-stroke-subtle);
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2436
2529
|
.hover\:focusVisible\:bd-c_stroke\.default:is(:hover, [data-hover]):is(:focus-visible, [data-focus-visible]) {
|
|
2437
2530
|
border-color: var(--colors-stroke-default);
|
|
2438
2531
|
}
|
package/es/Button.js
CHANGED
|
@@ -158,11 +158,11 @@ export const buttonBaseRecipe = cva({
|
|
|
158
158
|
});
|
|
159
159
|
export const buttonRecipe = cva({
|
|
160
160
|
defaultVariants: {
|
|
161
|
-
size: "
|
|
161
|
+
size: "medium"
|
|
162
162
|
},
|
|
163
163
|
variants: {
|
|
164
164
|
size: {
|
|
165
|
-
|
|
165
|
+
medium: {
|
|
166
166
|
paddingInline: "xsmall",
|
|
167
167
|
paddingBlock: "xxsmall",
|
|
168
168
|
minHeight: "24"
|
|
@@ -179,17 +179,38 @@ export const buttonRecipe = cva({
|
|
|
179
179
|
export const iconButtonRecipe = cva({
|
|
180
180
|
base: {
|
|
181
181
|
lineHeight: "1",
|
|
182
|
-
minHeight: "unset"
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
182
|
+
minHeight: "unset"
|
|
183
|
+
},
|
|
184
|
+
defaultVariants: {
|
|
185
|
+
size: "medium"
|
|
186
|
+
},
|
|
187
|
+
variants: {
|
|
188
|
+
size: {
|
|
189
|
+
medium: {
|
|
190
|
+
height: "xxlarge",
|
|
191
|
+
width: "xxlarge",
|
|
192
|
+
"& svg": {
|
|
193
|
+
marginInline: "0",
|
|
194
|
+
marginBlock: "0",
|
|
195
|
+
width: "medium",
|
|
196
|
+
height: "medium"
|
|
197
|
+
},
|
|
198
|
+
paddingInline: "xsmall",
|
|
199
|
+
paddingBlock: "xsmall"
|
|
200
|
+
},
|
|
201
|
+
small: {
|
|
202
|
+
height: "large",
|
|
203
|
+
width: "large",
|
|
204
|
+
"& svg": {
|
|
205
|
+
marginInline: "0",
|
|
206
|
+
marginBlock: "0",
|
|
207
|
+
width: "small",
|
|
208
|
+
height: "small"
|
|
209
|
+
},
|
|
210
|
+
paddingInline: "xxsmall",
|
|
211
|
+
paddingBlock: "xxsmall"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
193
214
|
}
|
|
194
215
|
});
|
|
195
216
|
const StyledButton = styled(ark.button, {}, {
|
|
@@ -247,6 +268,7 @@ export const IconButton = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
247
268
|
variant,
|
|
248
269
|
css: cssProp,
|
|
249
270
|
loadingContent,
|
|
271
|
+
size,
|
|
250
272
|
replaceContent = true,
|
|
251
273
|
...props
|
|
252
274
|
} = _ref3;
|
|
@@ -254,7 +276,9 @@ export const IconButton = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
254
276
|
...props,
|
|
255
277
|
css: css.raw(buttonBaseRecipe.raw({
|
|
256
278
|
variant
|
|
257
|
-
}), iconButtonRecipe.raw(
|
|
279
|
+
}), iconButtonRecipe.raw({
|
|
280
|
+
size
|
|
281
|
+
}), cssProp),
|
|
258
282
|
loadingContent: loadingContent ?? /*#__PURE__*/_jsx(Spinner, {
|
|
259
283
|
size: "small"
|
|
260
284
|
}),
|
package/es/Checkbox.js
CHANGED
|
@@ -44,6 +44,9 @@ const checkboxRecipe = sva({
|
|
|
44
44
|
transitionDuration: "normal",
|
|
45
45
|
transitionProperty: "border-color, background, box-shadow, color",
|
|
46
46
|
transitionTimingFunction: "default",
|
|
47
|
+
_disabled: {
|
|
48
|
+
cursor: "not-allowed"
|
|
49
|
+
},
|
|
47
50
|
_motionReduce: {
|
|
48
51
|
transition: "none",
|
|
49
52
|
transitionDuration: "0s"
|
|
@@ -89,7 +92,8 @@ const checkboxRecipe = sva({
|
|
|
89
92
|
boxShadow: "none"
|
|
90
93
|
},
|
|
91
94
|
_checked: {
|
|
92
|
-
background: "surface.disabled"
|
|
95
|
+
background: "surface.disabled",
|
|
96
|
+
borderColor: "stroke.disabled"
|
|
93
97
|
}
|
|
94
98
|
},
|
|
95
99
|
_invalid: {
|
package/es/FileUpload.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
|
+
import { FileUpload, fileUploadAnatomy } from "@ark-ui/react";
|
|
11
|
+
import { sva } from "@ndla/styled-system/css";
|
|
12
|
+
import { createStyleContext } from "./createStyleContext";
|
|
13
|
+
import { Label } from "./Label";
|
|
14
|
+
import { Text } from "./Text";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
const fileUploadRecipe = sva({
|
|
17
|
+
slots: fileUploadAnatomy.keys(),
|
|
18
|
+
base: {
|
|
19
|
+
root: {
|
|
20
|
+
display: "flex",
|
|
21
|
+
flexDirection: "column",
|
|
22
|
+
minHeight: "100%"
|
|
23
|
+
},
|
|
24
|
+
dropzone: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
gap: "small",
|
|
27
|
+
flexDirection: "column",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
padding: "4xlarge",
|
|
31
|
+
borderRadius: "xsmall",
|
|
32
|
+
border: "1px solid",
|
|
33
|
+
borderColor: "stroke.subtle",
|
|
34
|
+
transitionProperty: "border, border-color",
|
|
35
|
+
transitionTimingFunction: "default",
|
|
36
|
+
transitionDuration: "normal",
|
|
37
|
+
_hover: {
|
|
38
|
+
borderStyle: "dashed",
|
|
39
|
+
borderColor: "stroke.hover",
|
|
40
|
+
_disabled: {
|
|
41
|
+
borderStyle: "solid",
|
|
42
|
+
borderColor: "stroke.subtle"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
itemGroup: {
|
|
47
|
+
paddingBlockStart: "medium",
|
|
48
|
+
display: "flex",
|
|
49
|
+
flexDirection: "column",
|
|
50
|
+
gap: "xsmall"
|
|
51
|
+
},
|
|
52
|
+
item: {
|
|
53
|
+
width: "100%",
|
|
54
|
+
display: "grid",
|
|
55
|
+
gridTemplateAreas: `
|
|
56
|
+
"preview name delete"
|
|
57
|
+
"preview size delete"`,
|
|
58
|
+
gridTemplateColumns: "auto 1fr auto",
|
|
59
|
+
gridColumnGap: "small",
|
|
60
|
+
border: "1px solid",
|
|
61
|
+
borderColor: "stroke.subtle",
|
|
62
|
+
borderRadius: "xsmall",
|
|
63
|
+
padding: "xsmall"
|
|
64
|
+
},
|
|
65
|
+
itemPreview: {
|
|
66
|
+
display: "flex",
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
width: "xxlarge",
|
|
70
|
+
height: "xxlarge",
|
|
71
|
+
gridArea: "preview"
|
|
72
|
+
},
|
|
73
|
+
itemName: {
|
|
74
|
+
gridArea: "name",
|
|
75
|
+
whiteSpace: "nowrap",
|
|
76
|
+
overflow: "hidden",
|
|
77
|
+
textOverflow: "ellipsis"
|
|
78
|
+
},
|
|
79
|
+
itemSizeText: {
|
|
80
|
+
gridArea: "size"
|
|
81
|
+
},
|
|
82
|
+
itemDeleteTrigger: {
|
|
83
|
+
gridArea: "delete",
|
|
84
|
+
alignSelf: "center"
|
|
85
|
+
},
|
|
86
|
+
itemPreviewImage: {
|
|
87
|
+
borderRadius: "xsmall",
|
|
88
|
+
objectFit: "cover",
|
|
89
|
+
width: "100%",
|
|
90
|
+
height: "100%"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const {
|
|
95
|
+
withProvider,
|
|
96
|
+
withContext
|
|
97
|
+
} = createStyleContext(fileUploadRecipe);
|
|
98
|
+
export const FileUploadHiddenInput = FileUpload.HiddenInput;
|
|
99
|
+
export const FileUploadContext = FileUpload.Context;
|
|
100
|
+
export const FileUploadRoot = withProvider(FileUpload.Root, "root", {
|
|
101
|
+
baseComponent: true
|
|
102
|
+
});
|
|
103
|
+
export const FileUploadDropzone = withContext(FileUpload.Dropzone, "dropzone", {
|
|
104
|
+
baseComponent: true
|
|
105
|
+
});
|
|
106
|
+
export const FileUploadTrigger = withContext(FileUpload.Trigger, "trigger", {
|
|
107
|
+
baseComponent: true
|
|
108
|
+
});
|
|
109
|
+
export const FileUploadItemGroup = withContext(FileUpload.ItemGroup, "itemGroup", {
|
|
110
|
+
baseComponent: true
|
|
111
|
+
});
|
|
112
|
+
export const FileUploadItemPreview = withContext(FileUpload.ItemPreview, "itemPreview", {
|
|
113
|
+
baseComponent: true
|
|
114
|
+
});
|
|
115
|
+
export const FileUploadItem = withContext(FileUpload.Item, "item", {
|
|
116
|
+
baseComponent: true
|
|
117
|
+
});
|
|
118
|
+
export const FileUploadItemDeleteTrigger = withContext(FileUpload.ItemDeleteTrigger, "itemDeleteTrigger", {
|
|
119
|
+
baseComponent: true
|
|
120
|
+
});
|
|
121
|
+
export const FileUploadItemPreviewImage = withContext(FileUpload.ItemPreviewImage, "itemPreviewImage", {
|
|
122
|
+
baseComponent: true
|
|
123
|
+
});
|
|
124
|
+
const InternalFileUploadItemName = withContext(FileUpload.ItemName, "itemName", {
|
|
125
|
+
baseComponent: true
|
|
126
|
+
});
|
|
127
|
+
export const FileUploadItemName = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
128
|
+
let {
|
|
129
|
+
textStyle = "label.medium",
|
|
130
|
+
fontWeight = "bold",
|
|
131
|
+
...props
|
|
132
|
+
} = _ref;
|
|
133
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
134
|
+
textStyle: textStyle,
|
|
135
|
+
fontWeight: fontWeight,
|
|
136
|
+
asChild: true,
|
|
137
|
+
...props,
|
|
138
|
+
ref: ref,
|
|
139
|
+
children: /*#__PURE__*/_jsx(InternalFileUploadItemName, {})
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
const InternalFileUploadItemSizeText = withContext(FileUpload.ItemSizeText, "itemSizeText", {
|
|
143
|
+
baseComponent: true
|
|
144
|
+
});
|
|
145
|
+
export const FileUploadItemSizeText = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
146
|
+
let {
|
|
147
|
+
textStyle = "label.small",
|
|
148
|
+
...props
|
|
149
|
+
} = _ref2;
|
|
150
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
151
|
+
textStyle: textStyle,
|
|
152
|
+
ref: ref,
|
|
153
|
+
asChild: true,
|
|
154
|
+
...props,
|
|
155
|
+
children: /*#__PURE__*/_jsx(InternalFileUploadItemSizeText, {})
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
const InternalFileUploadLabel = withContext(FileUpload.Label, "label");
|
|
159
|
+
export const FileUploadLabel = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
160
|
+
let {
|
|
161
|
+
textStyle = "label.medium",
|
|
162
|
+
fontWeight = "light",
|
|
163
|
+
children,
|
|
164
|
+
...props
|
|
165
|
+
} = _ref3;
|
|
166
|
+
return /*#__PURE__*/_jsx(InternalFileUploadLabel, {
|
|
167
|
+
asChild: true,
|
|
168
|
+
children: /*#__PURE__*/_jsx(Label, {
|
|
169
|
+
textStyle: textStyle,
|
|
170
|
+
fontWeight: fontWeight,
|
|
171
|
+
ref: ref,
|
|
172
|
+
...props,
|
|
173
|
+
children: children
|
|
174
|
+
})
|
|
175
|
+
});
|
|
176
|
+
});
|
package/es/Hero.js
CHANGED
package/es/ListItem/ListItem.js
CHANGED
|
@@ -119,8 +119,7 @@ export const listItemRecipe = sva({
|
|
|
119
119
|
brand2: {
|
|
120
120
|
root: {
|
|
121
121
|
"--background-hover": "colors.surface.brand.2.moderate",
|
|
122
|
-
|
|
123
|
-
"--background-current": "colors.blue.800",
|
|
122
|
+
"--background-current": "colors.surface.brand.2.bold",
|
|
124
123
|
"--border-hover": "colors.surface.brand.2.strong",
|
|
125
124
|
"--color-current-hover": "colors.text.onAction"
|
|
126
125
|
}
|
package/es/Popover.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { forwardRef } from "react";
|
|
9
10
|
import { Popover, popoverAnatomy } from "@ark-ui/react";
|
|
10
11
|
import { sva } from "@ndla/styled-system/css";
|
|
11
12
|
import { createStyleContext } from "./createStyleContext";
|
|
@@ -14,6 +15,7 @@ const popoverRecipe = sva({
|
|
|
14
15
|
slots: popoverAnatomy.keys(),
|
|
15
16
|
base: {
|
|
16
17
|
positioner: {
|
|
18
|
+
maxHeight: "inherit",
|
|
17
19
|
position: "relative"
|
|
18
20
|
},
|
|
19
21
|
content: {
|
|
@@ -81,11 +83,12 @@ export const PopoverCloseTrigger = withContext(Popover.CloseTrigger, "closeTrigg
|
|
|
81
83
|
export const PopoverContentStandalone = withContext(Popover.Content, "content", {
|
|
82
84
|
baseComponent: true
|
|
83
85
|
});
|
|
84
|
-
export const PopoverContent = props => /*#__PURE__*/_jsx(PopoverPositioner, {
|
|
86
|
+
export const PopoverContent = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(PopoverPositioner, {
|
|
85
87
|
children: /*#__PURE__*/_jsx(PopoverContentStandalone, {
|
|
86
|
-
...props
|
|
88
|
+
...props,
|
|
89
|
+
ref: ref
|
|
87
90
|
})
|
|
88
|
-
});
|
|
91
|
+
}));
|
|
89
92
|
export const PopoverDescription = withContext(Popover.Description, "description", {
|
|
90
93
|
baseComponent: true
|
|
91
94
|
});
|