@ndla/primitives 1.0.99-alpha.0 → 1.0.100-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/styles.css +40 -40
- package/es/Accordion.mjs.map +1 -1
- package/es/ArticleLists.mjs.map +1 -1
- package/es/Badge.mjs.map +1 -1
- package/es/BlockQuote.mjs.map +1 -1
- package/es/Button.mjs.map +1 -1
- package/es/Card/Card.mjs.map +1 -1
- package/es/Checkbox.mjs.map +1 -1
- package/es/Combobox.mjs.map +1 -1
- package/es/DatePicker.mjs.map +1 -1
- package/es/Dialog.mjs.map +1 -1
- package/es/ErrorMessage/ErrorMessage.mjs.map +1 -1
- package/es/ExpandableBox.mjs.map +1 -1
- package/es/Field.mjs.map +1 -1
- package/es/FieldErrorMessage.mjs.map +1 -1
- package/es/FieldHelper.mjs.map +1 -1
- package/es/Figure.mjs.map +1 -1
- package/es/FileUpload.mjs.map +1 -1
- package/es/FramedContent.mjs.map +1 -1
- package/es/Hero.mjs.map +1 -1
- package/es/Image.mjs +3 -5
- package/es/Image.mjs.map +1 -1
- package/es/Input.mjs.map +1 -1
- package/es/Label.mjs.map +1 -1
- package/es/Layout/PageContainer.mjs.map +1 -1
- package/es/Layout/PageContent.mjs.map +1 -1
- package/es/ListItem/ListItem.mjs.map +1 -1
- package/es/Menu.mjs.map +1 -1
- package/es/MessageBox.mjs.map +1 -1
- package/es/NdlaLogo.mjs.map +1 -1
- package/es/Pagination.mjs.map +1 -1
- package/es/Popover.mjs.map +1 -1
- package/es/RadioGroup.mjs.map +1 -1
- package/es/Select.mjs.map +1 -1
- package/es/Skeleton.mjs.map +1 -1
- package/es/Slider.mjs.map +1 -1
- package/es/Spinner.mjs.map +1 -1
- package/es/Switch.mjs.map +1 -1
- package/es/Table.mjs.map +1 -1
- package/es/Tabs.mjs.map +1 -1
- package/es/TagsInput.mjs.map +1 -1
- package/es/Text.mjs.map +1 -1
- package/es/Toast.mjs.map +1 -1
- package/es/ToggleGroup.mjs.map +1 -1
- package/es/Tooltip.mjs.map +1 -1
- package/es/Tree/Tree.mjs.map +1 -1
- package/lib/Accordion.js +6 -3
- package/lib/Accordion.js.map +1 -1
- package/lib/ArticleLists.js +10 -5
- package/lib/ArticleLists.js.map +1 -1
- package/lib/Badge.js +10 -5
- package/lib/Badge.js.map +1 -1
- package/lib/BlockQuote.js +10 -5
- package/lib/BlockQuote.js.map +1 -1
- package/lib/Button.js +13 -8
- package/lib/Button.js.map +1 -1
- package/lib/Card/Card.js +14 -9
- package/lib/Card/Card.js.map +1 -1
- package/lib/Checkbox.js +10 -6
- package/lib/Checkbox.js.map +1 -1
- package/lib/Combobox.js +15 -10
- package/lib/Combobox.js.map +1 -1
- package/lib/DatePicker.js +12 -7
- package/lib/DatePicker.js.map +1 -1
- package/lib/Dialog.js +13 -8
- package/lib/Dialog.js.map +1 -1
- package/lib/ErrorMessage/ErrorMessage.js +13 -8
- package/lib/ErrorMessage/ErrorMessage.js.map +1 -1
- package/lib/ExpandableBox.js +8 -4
- package/lib/ExpandableBox.js.map +1 -1
- package/lib/Field.js +4 -2
- package/lib/Field.js.map +1 -1
- package/lib/FieldErrorMessage.js +10 -5
- package/lib/FieldErrorMessage.js.map +1 -1
- package/lib/FieldHelper.js +10 -5
- package/lib/FieldHelper.js.map +1 -1
- package/lib/Figure.js +10 -5
- package/lib/Figure.js.map +1 -1
- package/lib/FileUpload.js +15 -10
- package/lib/FileUpload.js.map +1 -1
- package/lib/FramedContent.js +10 -5
- package/lib/FramedContent.js.map +1 -1
- package/lib/Hero.js +6 -3
- package/lib/Hero.js.map +1 -1
- package/lib/Image.js +11 -9
- package/lib/Image.js.map +1 -1
- package/lib/Input.js +12 -6
- package/lib/Input.js.map +1 -1
- package/lib/Label.js +10 -5
- package/lib/Label.js.map +1 -1
- package/lib/Layout/PageContainer.js +10 -6
- package/lib/Layout/PageContainer.js.map +1 -1
- package/lib/Layout/PageContent.js +10 -5
- package/lib/Layout/PageContent.js.map +1 -1
- package/lib/ListItem/ListItem.js +14 -9
- package/lib/ListItem/ListItem.js.map +1 -1
- package/lib/Menu.js +12 -7
- package/lib/Menu.js.map +1 -1
- package/lib/MessageBox.js +10 -5
- package/lib/MessageBox.js.map +1 -1
- package/lib/NdlaLogo.js +8 -4
- package/lib/NdlaLogo.js.map +1 -1
- package/lib/Pagination.js +6 -3
- package/lib/Pagination.js.map +1 -1
- package/lib/Popover.js +12 -7
- package/lib/Popover.js.map +1 -1
- package/lib/RadioGroup.js +13 -8
- package/lib/RadioGroup.js.map +1 -1
- package/lib/Select.js +13 -8
- package/lib/Select.js.map +1 -1
- package/lib/Skeleton.js +4 -2
- package/lib/Skeleton.js.map +1 -1
- package/lib/Slider.js +10 -6
- package/lib/Slider.js.map +1 -1
- package/lib/Spinner.js +10 -5
- package/lib/Spinner.js.map +1 -1
- package/lib/Switch.js +10 -6
- package/lib/Switch.js.map +1 -1
- package/lib/Table.js +4 -2
- package/lib/Table.js.map +1 -1
- package/lib/Tabs.js +8 -4
- package/lib/Tabs.js.map +1 -1
- package/lib/TagsInput.js +12 -7
- package/lib/TagsInput.js.map +1 -1
- package/lib/Text.js +10 -5
- package/lib/Text.js.map +1 -1
- package/lib/Toast.js +11 -7
- package/lib/Toast.js.map +1 -1
- package/lib/ToggleGroup.js +6 -3
- package/lib/ToggleGroup.js.map +1 -1
- package/lib/Tooltip.js +10 -5
- package/lib/Tooltip.js.map +1 -1
- package/lib/Tree/Tree.js +14 -9
- package/lib/Tree/Tree.js.map +1 -1
- package/lib/_virtual/rolldown_runtime.js +1 -6
- package/lib/index.js +299 -298
- package/package.json +4 -4
package/dist/styles.css
CHANGED
|
@@ -1536,7 +1536,7 @@
|
|
|
1536
1536
|
max-width: 56px;
|
|
1537
1537
|
}
|
|
1538
1538
|
|
|
1539
|
-
.disabled\:bg_surface\.disabled\.subtle:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1539
|
+
.disabled\:bg_surface\.disabled\.subtle:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1540
1540
|
background: var(--colors-surface-disabled-subtle);
|
|
1541
1541
|
}
|
|
1542
1542
|
|
|
@@ -1552,7 +1552,7 @@
|
|
|
1552
1552
|
animation: var(--animations-collapse-out);
|
|
1553
1553
|
}
|
|
1554
1554
|
|
|
1555
|
-
.disabled\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1555
|
+
.disabled\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1556
1556
|
background: var(--colors-surface-disabled);
|
|
1557
1557
|
}
|
|
1558
1558
|
|
|
@@ -1700,7 +1700,7 @@
|
|
|
1700
1700
|
margin-block: 0;
|
|
1701
1701
|
}
|
|
1702
1702
|
|
|
1703
|
-
.disabled\:bd-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1703
|
+
.disabled\:bd-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1704
1704
|
border-color: var(--colors-stroke-disabled);
|
|
1705
1705
|
}
|
|
1706
1706
|
|
|
@@ -1776,7 +1776,7 @@
|
|
|
1776
1776
|
border-bottom: 1px solid;
|
|
1777
1777
|
}
|
|
1778
1778
|
|
|
1779
|
-
.disabled\:bd-c_stroke\.default:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1779
|
+
.disabled\:bd-c_stroke\.default:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1780
1780
|
border-color: var(--colors-stroke-default);
|
|
1781
1781
|
}
|
|
1782
1782
|
|
|
@@ -1793,15 +1793,15 @@
|
|
|
1793
1793
|
transition-property: background, border-color, border, border-radius;
|
|
1794
1794
|
}
|
|
1795
1795
|
|
|
1796
|
-
.disabled\:cursor_not-allowed:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1796
|
+
.disabled\:cursor_not-allowed:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1797
1797
|
cursor: not-allowed;
|
|
1798
1798
|
}
|
|
1799
1799
|
|
|
1800
|
-
.disabled\:bx-sh-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1800
|
+
.disabled\:bx-sh-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1801
1801
|
--shadow-color: var(--colors-stroke-disabled);
|
|
1802
1802
|
}
|
|
1803
1803
|
|
|
1804
|
-
.disabled\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1804
|
+
.disabled\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1805
1805
|
color: var(--colors-text-disabled);
|
|
1806
1806
|
}
|
|
1807
1807
|
|
|
@@ -1862,11 +1862,11 @@
|
|
|
1862
1862
|
margin-inline-start: var(--spacing-medium);
|
|
1863
1863
|
}
|
|
1864
1864
|
|
|
1865
|
-
.disabled\:c_text\.onAction:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1865
|
+
.disabled\:c_text\.onAction:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1866
1866
|
color: var(--colors-text-on-action);
|
|
1867
1867
|
}
|
|
1868
1868
|
|
|
1869
|
-
.disabled\:bx-sh-c_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1869
|
+
.disabled\:bx-sh-c_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1870
1870
|
--shadow-color: var(--colors-surface-disabled);
|
|
1871
1871
|
}
|
|
1872
1872
|
|
|
@@ -1902,7 +1902,7 @@
|
|
|
1902
1902
|
display: flex;
|
|
1903
1903
|
}
|
|
1904
1904
|
|
|
1905
|
-
.disabled\:c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1905
|
+
.disabled\:c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1906
1906
|
color: var(--colors-stroke-disabled);
|
|
1907
1907
|
}
|
|
1908
1908
|
|
|
@@ -1961,7 +1961,7 @@
|
|
|
1961
1961
|
padding-inline-end: var(--spacing-xsmall);
|
|
1962
1962
|
}
|
|
1963
1963
|
|
|
1964
|
-
.disabled\:c_text\.subtle:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
1964
|
+
.disabled\:c_text\.subtle:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
1965
1965
|
color: var(--colors-text-subtle);
|
|
1966
1966
|
}
|
|
1967
1967
|
|
|
@@ -2526,15 +2526,15 @@
|
|
|
2526
2526
|
color: var(--colors-text-on-action);
|
|
2527
2527
|
}
|
|
2528
2528
|
|
|
2529
|
-
.disabled\:hover\:bg_surface\.disabled\.subtle:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2529
|
+
.disabled\:hover\:bg_surface\.disabled\.subtle:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2530
2530
|
background: var(--colors-surface-disabled-subtle);
|
|
2531
2531
|
}
|
|
2532
2532
|
|
|
2533
|
-
.disabled\:hover\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2533
|
+
.disabled\:hover\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2534
2534
|
background: var(--colors-surface-disabled);
|
|
2535
2535
|
}
|
|
2536
2536
|
|
|
2537
|
-
.disabled\:checked\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2537
|
+
.disabled\:checked\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]) {
|
|
2538
2538
|
background: var(--colors-surface-disabled);
|
|
2539
2539
|
}
|
|
2540
2540
|
|
|
@@ -2550,7 +2550,7 @@
|
|
|
2550
2550
|
background: var(--colors-surface-hover);
|
|
2551
2551
|
}
|
|
2552
2552
|
|
|
2553
|
-
.disabled\:hover\:bg_surface\.default:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2553
|
+
.disabled\:hover\:bg_surface\.default:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2554
2554
|
background: var(--colors-surface-default);
|
|
2555
2555
|
}
|
|
2556
2556
|
|
|
@@ -2566,19 +2566,19 @@
|
|
|
2566
2566
|
background: var(--colors-surface-hover);
|
|
2567
2567
|
}
|
|
2568
2568
|
|
|
2569
|
-
.disabled\:highlighted\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2569
|
+
.disabled\:highlighted\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true])[data-highlighted] {
|
|
2570
2570
|
background: var(--colors-surface-disabled);
|
|
2571
2571
|
}
|
|
2572
2572
|
|
|
2573
|
-
.disabled\:selected\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2573
|
+
.disabled\:selected\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is([aria-selected=true], [data-selected]) {
|
|
2574
2574
|
background: var(--colors-surface-disabled);
|
|
2575
2575
|
}
|
|
2576
2576
|
|
|
2577
|
-
.disabled\:hover\:bd-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2577
|
+
.disabled\:hover\:bd-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2578
2578
|
border-color: var(--colors-stroke-disabled);
|
|
2579
2579
|
}
|
|
2580
2580
|
|
|
2581
|
-
.disabled\:checked\:bd-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2581
|
+
.disabled\:checked\:bd-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]) {
|
|
2582
2582
|
border-color: var(--colors-stroke-disabled);
|
|
2583
2583
|
}
|
|
2584
2584
|
|
|
@@ -2590,11 +2590,11 @@
|
|
|
2590
2590
|
border-color: var(--colors-stroke-error);
|
|
2591
2591
|
}
|
|
2592
2592
|
|
|
2593
|
-
.disabled\:hover\:td_none:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2593
|
+
.disabled\:hover\:td_none:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2594
2594
|
text-decoration: none;
|
|
2595
2595
|
}
|
|
2596
2596
|
|
|
2597
|
-
.disabled\:hover\:bd-c_stroke\.default:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2597
|
+
.disabled\:hover\:bd-c_stroke\.default:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2598
2598
|
border-color: var(--colors-stroke-default);
|
|
2599
2599
|
}
|
|
2600
2600
|
|
|
@@ -2606,11 +2606,11 @@
|
|
|
2606
2606
|
border-right: none;
|
|
2607
2607
|
}
|
|
2608
2608
|
|
|
2609
|
-
.disabled\:hover\:bx-sh-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2609
|
+
.disabled\:hover\:bx-sh-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2610
2610
|
--shadow-color: var(--colors-stroke-disabled);
|
|
2611
2611
|
}
|
|
2612
2612
|
|
|
2613
|
-
.disabled\:hover\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2613
|
+
.disabled\:hover\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2614
2614
|
color: var(--colors-text-disabled);
|
|
2615
2615
|
}
|
|
2616
2616
|
|
|
@@ -2654,15 +2654,15 @@
|
|
|
2654
2654
|
list-style-type: square;
|
|
2655
2655
|
}
|
|
2656
2656
|
|
|
2657
|
-
.disabled\:\[\&_svg\]\:c_text\.onAction:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2657
|
+
.disabled\:\[\&_svg\]\:c_text\.onAction:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) svg {
|
|
2658
2658
|
color: var(--colors-text-on-action);
|
|
2659
2659
|
}
|
|
2660
2660
|
|
|
2661
|
-
.disabled\:hover\:c_text\.onAction:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2661
|
+
.disabled\:hover\:c_text\.onAction:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2662
2662
|
color: var(--colors-text-on-action);
|
|
2663
2663
|
}
|
|
2664
2664
|
|
|
2665
|
-
.disabled\:checked\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2665
|
+
.disabled\:checked\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]) {
|
|
2666
2666
|
color: var(--colors-text-disabled);
|
|
2667
2667
|
}
|
|
2668
2668
|
|
|
@@ -2694,7 +2694,7 @@
|
|
|
2694
2694
|
outline-offset: -2px;
|
|
2695
2695
|
}
|
|
2696
2696
|
|
|
2697
|
-
.disabled\:hover\:bx-sh_none:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2697
|
+
.disabled\:hover\:bx-sh_none:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2698
2698
|
box-shadow: none;
|
|
2699
2699
|
}
|
|
2700
2700
|
|
|
@@ -2710,7 +2710,7 @@
|
|
|
2710
2710
|
color: var(--colors-stroke-hover);
|
|
2711
2711
|
}
|
|
2712
2712
|
|
|
2713
|
-
.disabled\:hover\:c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2713
|
+
.disabled\:hover\:c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2714
2714
|
color: var(--colors-stroke-disabled);
|
|
2715
2715
|
}
|
|
2716
2716
|
|
|
@@ -2750,7 +2750,7 @@
|
|
|
2750
2750
|
--shadow-color: var(--colors-stroke-subtle);
|
|
2751
2751
|
}
|
|
2752
2752
|
|
|
2753
|
-
.disabled\:\[\&_svg\]\:c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2753
|
+
.disabled\:\[\&_svg\]\:c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) svg {
|
|
2754
2754
|
color: var(--colors-stroke-disabled);
|
|
2755
2755
|
}
|
|
2756
2756
|
|
|
@@ -2758,11 +2758,11 @@
|
|
|
2758
2758
|
color: var(--colors-icon-default);
|
|
2759
2759
|
}
|
|
2760
2760
|
|
|
2761
|
-
.disabled\:highlighted\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2761
|
+
.disabled\:highlighted\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true])[data-highlighted] {
|
|
2762
2762
|
color: var(--colors-text-disabled);
|
|
2763
2763
|
}
|
|
2764
2764
|
|
|
2765
|
-
.disabled\:selected\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2765
|
+
.disabled\:selected\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is([aria-selected=true], [data-selected]) {
|
|
2766
2766
|
color: var(--colors-text-disabled);
|
|
2767
2767
|
}
|
|
2768
2768
|
|
|
@@ -2786,7 +2786,7 @@
|
|
|
2786
2786
|
text-align: right;
|
|
2787
2787
|
}
|
|
2788
2788
|
|
|
2789
|
-
.disabled\:hover\:c_text\.subtle:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2789
|
+
.disabled\:hover\:c_text\.subtle:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) {
|
|
2790
2790
|
color: var(--colors-text-subtle);
|
|
2791
2791
|
}
|
|
2792
2792
|
|
|
@@ -2824,11 +2824,11 @@
|
|
|
2824
2824
|
--shadow-color: var(--colors-stroke-default);
|
|
2825
2825
|
}
|
|
2826
2826
|
|
|
2827
|
-
.hover\:disabled\:border-style_solid:is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2827
|
+
.hover\:disabled\:border-style_solid:is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
2828
2828
|
border-style: solid;
|
|
2829
2829
|
}
|
|
2830
2830
|
|
|
2831
|
-
.hover\:disabled\:bd-c_stroke\.subtle:is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2831
|
+
.hover\:disabled\:bd-c_stroke\.subtle:is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
2832
2832
|
border-color: var(--colors-stroke-subtle);
|
|
2833
2833
|
}
|
|
2834
2834
|
|
|
@@ -2848,7 +2848,7 @@
|
|
|
2848
2848
|
color: var(--colors-icon-default);
|
|
2849
2849
|
}
|
|
2850
2850
|
|
|
2851
|
-
.hover\:disabled\:trf_translateX\(0\):is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2851
|
+
.hover\:disabled\:trf_translateX\(0\):is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
2852
2852
|
transform: translateX(0);
|
|
2853
2853
|
}
|
|
2854
2854
|
|
|
@@ -2860,11 +2860,11 @@
|
|
|
2860
2860
|
border-block-end-color: var(--border-hover);
|
|
2861
2861
|
}
|
|
2862
2862
|
|
|
2863
|
-
.disabled\:checked\:hover\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2863
|
+
.disabled\:checked\:hover\:bg_surface\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]):is(:hover, [data-hover]) {
|
|
2864
2864
|
background: var(--colors-surface-disabled);
|
|
2865
2865
|
}
|
|
2866
2866
|
|
|
2867
|
-
.disabled\:checked\:hover\:bd-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2867
|
+
.disabled\:checked\:hover\:bd-c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]):is(:hover, [data-hover]) {
|
|
2868
2868
|
border-color: var(--colors-stroke-disabled);
|
|
2869
2869
|
}
|
|
2870
2870
|
|
|
@@ -2888,7 +2888,7 @@
|
|
|
2888
2888
|
content: counter(level1, lower-alpha) '. ';
|
|
2889
2889
|
}
|
|
2890
2890
|
|
|
2891
|
-
.disabled\:checked\:hover\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2891
|
+
.disabled\:checked\:hover\:c_text\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]):is(:hover, [data-hover]) {
|
|
2892
2892
|
color: var(--colors-text-disabled);
|
|
2893
2893
|
}
|
|
2894
2894
|
|
|
@@ -2900,11 +2900,11 @@
|
|
|
2900
2900
|
--shadow-color: var(--colors-stroke-error);
|
|
2901
2901
|
}
|
|
2902
2902
|
|
|
2903
|
-
.disabled\:hover\:\[\&_svg\]\:c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2903
|
+
.disabled\:hover\:\[\&_svg\]\:c_stroke\.disabled:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]):is(:hover, [data-hover]) svg {
|
|
2904
2904
|
color: var(--colors-stroke-disabled);
|
|
2905
2905
|
}
|
|
2906
2906
|
|
|
2907
|
-
.checked\:hover\:disabled\:trf_translateX\(120\%\):is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]):is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled=
|
|
2907
|
+
.checked\:hover\:disabled\:trf_translateX\(120\%\):is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]):is(:hover, [data-hover]):is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
2908
2908
|
transform: translateX(120%);
|
|
2909
2909
|
}
|
|
2910
2910
|
|
package/es/Accordion.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.mjs","names":[],"sources":["../src/Accordion.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Accordion, accordionAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\n\nconst accordionRecipe = sva({\n slots: accordionAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n },\n itemTrigger: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n background: \"surface.default\",\n cursor: \"pointer\",\n transitionDuration: \"fast\",\n transitionTimingFunction: \"default\",\n transitionProperty: \"background, border-color, border, border-radius\",\n _closed: {\n transitionProperty: \"background, border-color, border, border-radius\",\n },\n _disabled: {\n cursor: \"not-allowed\",\n background: \"surface.disabled.subtle\",\n boxShadowColor: \"stroke.disabled\",\n color: \"text.disabled\",\n _hover: {\n background: \"surface.disabled.subtle\",\n boxShadowColor: \"stroke.disabled\",\n color: \"text.disabled\",\n },\n },\n },\n itemIndicator: {\n color: \"icon.strong\",\n transformOrigin: \"center\",\n transitionDuration: \"normal\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"default\",\n _open: {\n transform: \"rotate(180deg)\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n itemContent: {\n overflow: \"hidden\",\n // TODO: Is this needed?\n transitionProperty: \"padding-bottom\",\n transitionDuration: \"normal\",\n transitionTimingFunction: \"default\",\n paddingBlock: \"xsmall\",\n paddingInline: \"small\",\n _open: {\n animation: \"collapse-in\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"collapse-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n item: {\n width: \"100%\",\n },\n },\n defaultVariants: {\n variant: \"bordered\",\n },\n variants: {\n variant: {\n clean: {},\n bordered: {\n itemTrigger: {\n paddingInline: \"medium\",\n paddingBlock: \"medium\",\n width: \"100%\",\n borderRadius: \"xsmall\",\n boxShadowColor: \"stroke.subtle\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n _hover: {\n background: \"surface.actionSubtle.hover\",\n boxShadowColor: \"stroke.hover\",\n },\n _open: {\n background: \"surface.actionSubtle.active\",\n boxShadowColor: \"stroke.default\",\n borderBottomRadius: \"sharp\",\n },\n _focusVisible: {\n outline: \"none\",\n boxShadowColor: \"stroke.default\",\n boxShadow: \"inset 0 0 0 3px var(--shadow-color)\",\n },\n },\n itemContent: {\n borderBottomRadius: \"xsmall\",\n borderWidth: \"0 1px 1px\",\n borderStyle: \"solid\",\n borderColor: \"stroke.default\",\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(accordionRecipe);\n\nexport type AccordionVariantProps = NonNullable<RecipeVariantProps<typeof accordionRecipe>>;\n\nexport interface AccordionRootProps extends StyledProps, Accordion.RootProps, AccordionVariantProps {}\n\nexport const AccordionRoot = withProvider(Accordion.Root, \"root\", { baseComponent: true });\n\nexport const AccordionItemContent = withContext(Accordion.ItemContent, \"itemContent\", { baseComponent: true });\n\nexport const AccordionItemIndicator = withContext(Accordion.ItemIndicator, \"itemIndicator\", { baseComponent: true });\n\nexport interface AccordionItemProps extends StyledProps, Accordion.ItemProps {}\n\nexport const AccordionItem = withContext(Accordion.Item, \"item\", { baseComponent: true });\n\nexport const AccordionItemTrigger = withContext(Accordion.ItemTrigger, \"itemTrigger\", { baseComponent: true });\n"],"mappings":";;;;;AAaA,MAAM,kBAAkB,IAAI;CAC1B,OAAO,iBAAiB,MAAM;CAC9B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;
|
|
1
|
+
{"version":3,"file":"Accordion.mjs","names":[],"sources":["../src/Accordion.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Accordion, accordionAnatomy } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\n\nconst accordionRecipe = sva({\n slots: accordionAnatomy.keys(),\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n },\n itemTrigger: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n background: \"surface.default\",\n cursor: \"pointer\",\n transitionDuration: \"fast\",\n transitionTimingFunction: \"default\",\n transitionProperty: \"background, border-color, border, border-radius\",\n _closed: {\n transitionProperty: \"background, border-color, border, border-radius\",\n },\n _disabled: {\n cursor: \"not-allowed\",\n background: \"surface.disabled.subtle\",\n boxShadowColor: \"stroke.disabled\",\n color: \"text.disabled\",\n _hover: {\n background: \"surface.disabled.subtle\",\n boxShadowColor: \"stroke.disabled\",\n color: \"text.disabled\",\n },\n },\n },\n itemIndicator: {\n color: \"icon.strong\",\n transformOrigin: \"center\",\n transitionDuration: \"normal\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"default\",\n _open: {\n transform: \"rotate(180deg)\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n itemContent: {\n overflow: \"hidden\",\n // TODO: Is this needed?\n transitionProperty: \"padding-bottom\",\n transitionDuration: \"normal\",\n transitionTimingFunction: \"default\",\n paddingBlock: \"xsmall\",\n paddingInline: \"small\",\n _open: {\n animation: \"collapse-in\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n _closed: {\n animation: \"collapse-out\",\n _motionReduce: {\n animation: \"none\",\n },\n },\n },\n item: {\n width: \"100%\",\n },\n },\n defaultVariants: {\n variant: \"bordered\",\n },\n variants: {\n variant: {\n clean: {},\n bordered: {\n itemTrigger: {\n paddingInline: \"medium\",\n paddingBlock: \"medium\",\n width: \"100%\",\n borderRadius: \"xsmall\",\n boxShadowColor: \"stroke.subtle\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n _hover: {\n background: \"surface.actionSubtle.hover\",\n boxShadowColor: \"stroke.hover\",\n },\n _open: {\n background: \"surface.actionSubtle.active\",\n boxShadowColor: \"stroke.default\",\n borderBottomRadius: \"sharp\",\n },\n _focusVisible: {\n outline: \"none\",\n boxShadowColor: \"stroke.default\",\n boxShadow: \"inset 0 0 0 3px var(--shadow-color)\",\n },\n },\n itemContent: {\n borderBottomRadius: \"xsmall\",\n borderWidth: \"0 1px 1px\",\n borderStyle: \"solid\",\n borderColor: \"stroke.default\",\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(accordionRecipe);\n\nexport type AccordionVariantProps = NonNullable<RecipeVariantProps<typeof accordionRecipe>>;\n\nexport interface AccordionRootProps extends StyledProps, Accordion.RootProps, AccordionVariantProps {}\n\nexport const AccordionRoot = withProvider(Accordion.Root, \"root\", { baseComponent: true });\n\nexport const AccordionItemContent = withContext(Accordion.ItemContent, \"itemContent\", { baseComponent: true });\n\nexport const AccordionItemIndicator = withContext(Accordion.ItemIndicator, \"itemIndicator\", { baseComponent: true });\n\nexport interface AccordionItemProps extends StyledProps, Accordion.ItemProps {}\n\nexport const AccordionItem = withContext(Accordion.Item, \"item\", { baseComponent: true });\n\nexport const AccordionItemTrigger = withContext(Accordion.ItemTrigger, \"itemTrigger\", { baseComponent: true });\n"],"mappings":";;;;;AAaA,MAAM,kBAAkB,IAAI;CAC1B,OAAO,iBAAiB,MAAM;CAC9B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACN;EACD,aAAa;GACX,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,YAAY;GACZ,QAAQ;GACR,oBAAoB;GACpB,0BAA0B;GAC1B,oBAAoB;GACpB,SAAS,EACP,oBAAoB,mDACrB;GACD,WAAW;IACT,QAAQ;IACR,YAAY;IACZ,gBAAgB;IAChB,OAAO;IACP,QAAQ;KACN,YAAY;KACZ,gBAAgB;KAChB,OAAO;KACR;IACF;GACF;EACD,eAAe;GACb,OAAO;GACP,iBAAiB;GACjB,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,OAAO,EACL,WAAW,kBACZ;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACD,aAAa;GACX,UAAU;GAEV,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,cAAc;GACd,eAAe;GACf,OAAO;IACL,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACD,SAAS;IACP,WAAW;IACX,eAAe,EACb,WAAW,QACZ;IACF;GACF;EACD,MAAM,EACJ,OAAO,QACR;EACF;CACD,iBAAiB,EACf,SAAS,YACV;CACD,UAAU,EACR,SAAS;EACP,OAAO,EAAE;EACT,UAAU;GACR,aAAa;IACX,eAAe;IACf,cAAc;IACd,OAAO;IACP,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,QAAQ;KACN,YAAY;KACZ,gBAAgB;KACjB;IACD,OAAO;KACL,YAAY;KACZ,gBAAgB;KAChB,oBAAoB;KACrB;IACD,eAAe;KACb,SAAS;KACT,gBAAgB;KAChB,WAAW;KACZ;IACF;GACD,aAAa;IACX,oBAAoB;IACpB,aAAa;IACb,aAAa;IACb,aAAa;IACd;GACF;EACF,EACF;CACF,CAAC;AAEF,MAAM,EAAE,cAAc,gBAAgB,mBAAmB,gBAAgB;AAMzE,MAAa,gBAAgB,aAAa,UAAU,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAE1F,MAAa,uBAAuB,YAAY,UAAU,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC;AAE9G,MAAa,yBAAyB,YAAY,UAAU,eAAe,iBAAiB,EAAE,eAAe,MAAM,CAAC;AAIpH,MAAa,gBAAgB,YAAY,UAAU,MAAM,QAAQ,EAAE,eAAe,MAAM,CAAC;AAEzF,MAAa,uBAAuB,YAAY,UAAU,aAAa,eAAe,EAAE,eAAe,MAAM,CAAC"}
|
package/es/ArticleLists.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleLists.mjs","names":[],"sources":["../src/ArticleLists.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type CSSProperties, forwardRef, useMemo } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { HTMLStyledProps, RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\n\nconst LIST_ITEM = \"& > li\";\nconst LETTER_LIST = \"& > ol[data-variant='letters']\";\nconst NUMBER_LIST = \"& > ol:not([data-variant='letters'])\";\nconst LETTER_LIST_ITEM = `${LETTER_LIST} > li`;\n\nconst orderedListRecipe = cva({\n base: {\n marginInlineStart: \"small\",\n paddingInlineStart: \"small\",\n [LIST_ITEM]: {\n \"& > ul\": {\n marginInlineStart: \"0 !important\",\n },\n _before: {\n position: \"absolute\",\n transform: \"translateX(calc(-100% + (token(spacing.small) * -1)))\",\n fontVariantNumeric: \"tabular-nums\",\n },\n },\n \"& li\": {\n marginBlock: \"small\",\n },\n },\n defaultVariants: {\n variant: \"numbers\",\n },\n variants: {\n variant: {\n numbers: {\n [NUMBER_LIST]: {\n marginInlineStart: \"0\",\n paddingInlineStart: \"0\",\n },\n counterReset: \"level1\",\n \"&[data-count='true']\": {\n counterReset: \"level1 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n counterIncrement: \"level1\",\n _before: {\n content: \"counter(level1, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level2\",\n \"&[data-count='true']\": {\n counterReset: \"level2 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"small\",\n counterIncrement: \"level2\",\n _before: {\n content: \"counter(level1, decimal) '.' counter(level2, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level3\",\n \"&[data-count='true']\": {\n counterReset: \"level3 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"calc(1.5ch + token(spacing.small))\",\n counterIncrement: \"level3\",\n _before: {\n content: \"counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level4\",\n \"&[data-count='true']\": {\n counterReset: \"level4 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"calc(3ch + token(spacing.small))\",\n counterIncrement: \"level4\",\n _before: {\n content:\n \"counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '.' counter(level4, decimal) '. '\",\n },\n },\n },\n },\n },\n },\n },\n },\n },\n letters: {\n counterReset: \"level1\",\n \"&[data-count='true']\": {\n counterReset: \"level1 var(--start, 0)\",\n },\n [LETTER_LIST]: {\n marginInlineStart: \"0\",\n paddingInlineStart: \"0\",\n },\n [LIST_ITEM]: {\n counterIncrement: \"level1\",\n _before: {\n content: \"counter(level1, upper-alpha) '. '\",\n },\n [LETTER_LIST_ITEM]: {\n _before: {\n content: \"counter(level1, lower-alpha) '. '\",\n },\n [LETTER_LIST_ITEM]: {\n _before: {\n content: \"counter(level1, lower-roman) '. '\",\n },\n },\n },\n },\n },\n },\n },\n});\n\nexport type OrderedListVariantProps = NonNullable<RecipeVariantProps<typeof orderedListRecipe>>;\n\nexport interface OrderedListProps extends StyledProps, HTMLArkProps<\"ol\">, OrderedListVariantProps {}\n\nconst StyledOrderedList = styled(ark.ol, {}, { baseComponent: true });\n\nexport const OrderedList = forwardRef<HTMLOListElement, OrderedListProps>(\n ({ variant, css: cssProp, start, ...props }, ref) => {\n const style = useMemo(() => ({ \"--start\": start ? start - 1 : undefined }) as CSSProperties, [start]);\n return (\n <StyledOrderedList\n data-embed-type=\"ordered-list\"\n data-variant={variant}\n data-count={start !== undefined}\n css={css.raw(orderedListRecipe.raw({ variant }), cssProp)}\n style={style}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nexport interface UnOrderedListProps extends StyledProps, HTMLArkProps<\"ul\"> {}\n\nexport const UnOrderedList = styled(\"ul\", {\n base: {\n listStyle: \"revert\",\n marginInlineStart: \"medium\",\n paddingInlineStart: \"small\",\n \"& ul\": {\n marginInlineStart: \"0\",\n },\n \"& li\": {\n marginBlock: \"small\",\n paddingInlineStart: \"small\",\n _marker: {\n color: \"icon.strong\",\n },\n\n \"& > ol\": {\n marginInlineStart: \"0 !important\",\n },\n },\n\n listStyleType: \"disc\",\n \"& > li > ul\": {\n listStyleType: \"circle\",\n \"& > li > ul\": {\n listStyleType: \"square\",\n },\n },\n },\n});\n\nexport const DefinitionList = styled(\"dl\", {\n base: {\n \"& dt\": {\n fontWeight: \"bold\",\n },\n \"& dd\": {\n marginInlineStart: \"medium\",\n },\n },\n});\n\nexport type DefinitionListProps = HTMLStyledProps<\"dl\">;\n"],"mappings":";;;;;;;AAcA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,cAAc;AACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"ArticleLists.mjs","names":[],"sources":["../src/ArticleLists.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type CSSProperties, forwardRef, useMemo } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { HTMLStyledProps, RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\n\nconst LIST_ITEM = \"& > li\";\nconst LETTER_LIST = \"& > ol[data-variant='letters']\";\nconst NUMBER_LIST = \"& > ol:not([data-variant='letters'])\";\nconst LETTER_LIST_ITEM = `${LETTER_LIST} > li`;\n\nconst orderedListRecipe = cva({\n base: {\n marginInlineStart: \"small\",\n paddingInlineStart: \"small\",\n [LIST_ITEM]: {\n \"& > ul\": {\n marginInlineStart: \"0 !important\",\n },\n _before: {\n position: \"absolute\",\n transform: \"translateX(calc(-100% + (token(spacing.small) * -1)))\",\n fontVariantNumeric: \"tabular-nums\",\n },\n },\n \"& li\": {\n marginBlock: \"small\",\n },\n },\n defaultVariants: {\n variant: \"numbers\",\n },\n variants: {\n variant: {\n numbers: {\n [NUMBER_LIST]: {\n marginInlineStart: \"0\",\n paddingInlineStart: \"0\",\n },\n counterReset: \"level1\",\n \"&[data-count='true']\": {\n counterReset: \"level1 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n counterIncrement: \"level1\",\n _before: {\n content: \"counter(level1, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level2\",\n \"&[data-count='true']\": {\n counterReset: \"level2 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"small\",\n counterIncrement: \"level2\",\n _before: {\n content: \"counter(level1, decimal) '.' counter(level2, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level3\",\n \"&[data-count='true']\": {\n counterReset: \"level3 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"calc(1.5ch + token(spacing.small))\",\n counterIncrement: \"level3\",\n _before: {\n content: \"counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '. '\",\n },\n [NUMBER_LIST]: {\n counterReset: \"level4\",\n \"&[data-count='true']\": {\n counterReset: \"level4 var(--start, 0)\",\n },\n [LIST_ITEM]: {\n marginInlineStart: \"calc(3ch + token(spacing.small))\",\n counterIncrement: \"level4\",\n _before: {\n content:\n \"counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '.' counter(level4, decimal) '. '\",\n },\n },\n },\n },\n },\n },\n },\n },\n },\n letters: {\n counterReset: \"level1\",\n \"&[data-count='true']\": {\n counterReset: \"level1 var(--start, 0)\",\n },\n [LETTER_LIST]: {\n marginInlineStart: \"0\",\n paddingInlineStart: \"0\",\n },\n [LIST_ITEM]: {\n counterIncrement: \"level1\",\n _before: {\n content: \"counter(level1, upper-alpha) '. '\",\n },\n [LETTER_LIST_ITEM]: {\n _before: {\n content: \"counter(level1, lower-alpha) '. '\",\n },\n [LETTER_LIST_ITEM]: {\n _before: {\n content: \"counter(level1, lower-roman) '. '\",\n },\n },\n },\n },\n },\n },\n },\n});\n\nexport type OrderedListVariantProps = NonNullable<RecipeVariantProps<typeof orderedListRecipe>>;\n\nexport interface OrderedListProps extends StyledProps, HTMLArkProps<\"ol\">, OrderedListVariantProps {}\n\nconst StyledOrderedList = styled(ark.ol, {}, { baseComponent: true });\n\nexport const OrderedList = forwardRef<HTMLOListElement, OrderedListProps>(\n ({ variant, css: cssProp, start, ...props }, ref) => {\n const style = useMemo(() => ({ \"--start\": start ? start - 1 : undefined }) as CSSProperties, [start]);\n return (\n <StyledOrderedList\n data-embed-type=\"ordered-list\"\n data-variant={variant}\n data-count={start !== undefined}\n css={css.raw(orderedListRecipe.raw({ variant }), cssProp)}\n style={style}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nexport interface UnOrderedListProps extends StyledProps, HTMLArkProps<\"ul\"> {}\n\nexport const UnOrderedList = styled(\"ul\", {\n base: {\n listStyle: \"revert\",\n marginInlineStart: \"medium\",\n paddingInlineStart: \"small\",\n \"& ul\": {\n marginInlineStart: \"0\",\n },\n \"& li\": {\n marginBlock: \"small\",\n paddingInlineStart: \"small\",\n _marker: {\n color: \"icon.strong\",\n },\n\n \"& > ol\": {\n marginInlineStart: \"0 !important\",\n },\n },\n\n listStyleType: \"disc\",\n \"& > li > ul\": {\n listStyleType: \"circle\",\n \"& > li > ul\": {\n listStyleType: \"square\",\n },\n },\n },\n});\n\nexport const DefinitionList = styled(\"dl\", {\n base: {\n \"& dt\": {\n fontWeight: \"bold\",\n },\n \"& dd\": {\n marginInlineStart: \"medium\",\n },\n },\n});\n\nexport type DefinitionListProps = HTMLStyledProps<\"dl\">;\n"],"mappings":";;;;;;;AAcA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,cAAc;AACpB,MAAM,mBAAmB,GAAG,YAAY;AAExC,MAAM,oBAAoB,IAAI;CAC5B,MAAM;EACJ,mBAAmB;EACnB,oBAAoB;GACnB,YAAY;GACX,UAAU,EACR,mBAAmB,gBACpB;GACD,SAAS;IACP,UAAU;IACV,WAAW;IACX,oBAAoB;IACrB;GACF;EACD,QAAQ,EACN,aAAa,SACd;EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACD,UAAU,EACR,SAAS;EACP,SAAS;IACN,cAAc;IACb,mBAAmB;IACnB,oBAAoB;IACrB;GACD,cAAc;GACd,wBAAwB,EACtB,cAAc,0BACf;IACA,YAAY;IACX,kBAAkB;IAClB,SAAS,EACP,SAAS,iCACV;KACA,cAAc;KACb,cAAc;KACd,wBAAwB,EACtB,cAAc,0BACf;MACA,YAAY;MACX,mBAAmB;MACnB,kBAAkB;MAClB,SAAS,EACP,SAAS,8DACV;OACA,cAAc;OACb,cAAc;OACd,wBAAwB,EACtB,cAAc,0BACf;QACA,YAAY;QACX,mBAAmB;QACnB,kBAAkB;QAClB,SAAS,EACP,SAAS,2FACV;SACA,cAAc;SACb,cAAc;SACd,wBAAwB,EACtB,cAAc,0BACf;UACA,YAAY;UACX,mBAAmB;UACnB,kBAAkB;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badge.mjs","names":[],"sources":["../src/Badge.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { forwardRef } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst badgeRecipe = cva({\n base: {\n paddingInline: \"xsmall\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n width: \"fit-content\",\n color: \"text.default\",\n },\n defaultVariants: {\n colorTheme: \"neutral\",\n size: \"medium\",\n },\n variants: {\n size: {\n small: {\n textStyle: \"label.small\",\n },\n medium: {\n textStyle: \"label.medium\",\n },\n },\n colorTheme: {\n brand1: {\n backgroundColor: \"surface.brand.1.moderate\",\n borderColor: \"surface.brand.1.strong\",\n },\n brand2: {\n backgroundColor: \"surface.brand.2.moderate\",\n borderColor: \"surface.brand.2.strong\",\n },\n brand3: {\n backgroundColor: \"surface.brand.3.subtle\",\n borderColor: \"surface.brand.3.strong\",\n },\n neutral: {\n backgroundColor: \"surface.infoSubtle\",\n borderColor: \"stroke.default\",\n },\n danger: {\n backgroundColor: \"surface.dangerSubtle\",\n borderColor: \"surface.danger\",\n },\n success: {\n backgroundColor: \"surface.successSubtle\",\n borderColor: \"surface.success\",\n },\n warning: {\n backgroundColor: \"surface.warningSubtle\",\n borderColor: \"surface.warning\",\n },\n },\n },\n});\n\nexport type BadgeVariantProps = NonNullable<RecipeVariantProps<typeof badgeRecipe>>;\n\nexport type BadgeVariant = NonNullable<BadgeVariantProps>[\"colorTheme\"];\n\nexport interface BadgeProps extends StyledProps, HTMLArkProps<\"div\">, BadgeVariantProps {}\n\nconst StyledBadge = styled(ark.div, {}, { baseComponent: true });\n\nexport const Badge = forwardRef<HTMLDivElement, BadgeProps>(({ colorTheme, size, css: cssProp, ...props }, ref) => (\n <StyledBadge css={css.raw(badgeRecipe.raw({ colorTheme, size }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;AAcA,MAAM,cAAc,IAAI;CACtB,MAAM;EACJ,eAAe;EACf,cAAc;EACd,QAAQ;EACR,OAAO;EACP,OAAO;
|
|
1
|
+
{"version":3,"file":"Badge.mjs","names":[],"sources":["../src/Badge.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { forwardRef } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst badgeRecipe = cva({\n base: {\n paddingInline: \"xsmall\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n width: \"fit-content\",\n color: \"text.default\",\n },\n defaultVariants: {\n colorTheme: \"neutral\",\n size: \"medium\",\n },\n variants: {\n size: {\n small: {\n textStyle: \"label.small\",\n },\n medium: {\n textStyle: \"label.medium\",\n },\n },\n colorTheme: {\n brand1: {\n backgroundColor: \"surface.brand.1.moderate\",\n borderColor: \"surface.brand.1.strong\",\n },\n brand2: {\n backgroundColor: \"surface.brand.2.moderate\",\n borderColor: \"surface.brand.2.strong\",\n },\n brand3: {\n backgroundColor: \"surface.brand.3.subtle\",\n borderColor: \"surface.brand.3.strong\",\n },\n neutral: {\n backgroundColor: \"surface.infoSubtle\",\n borderColor: \"stroke.default\",\n },\n danger: {\n backgroundColor: \"surface.dangerSubtle\",\n borderColor: \"surface.danger\",\n },\n success: {\n backgroundColor: \"surface.successSubtle\",\n borderColor: \"surface.success\",\n },\n warning: {\n backgroundColor: \"surface.warningSubtle\",\n borderColor: \"surface.warning\",\n },\n },\n },\n});\n\nexport type BadgeVariantProps = NonNullable<RecipeVariantProps<typeof badgeRecipe>>;\n\nexport type BadgeVariant = NonNullable<BadgeVariantProps>[\"colorTheme\"];\n\nexport interface BadgeProps extends StyledProps, HTMLArkProps<\"div\">, BadgeVariantProps {}\n\nconst StyledBadge = styled(ark.div, {}, { baseComponent: true });\n\nexport const Badge = forwardRef<HTMLDivElement, BadgeProps>(({ colorTheme, size, css: cssProp, ...props }, ref) => (\n <StyledBadge css={css.raw(badgeRecipe.raw({ colorTheme, size }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;AAcA,MAAM,cAAc,IAAI;CACtB,MAAM;EACJ,eAAe;EACf,cAAc;EACd,QAAQ;EACR,OAAO;EACP,OAAO;EACR;CACD,iBAAiB;EACf,YAAY;EACZ,MAAM;EACP;CACD,UAAU;EACR,MAAM;GACJ,OAAO,EACL,WAAW,eACZ;GACD,QAAQ,EACN,WAAW,gBACZ;GACF;EACD,YAAY;GACV,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,SAAS;IACP,iBAAiB;IACjB,aAAa;IACd;GACD,QAAQ;IACN,iBAAiB;IACjB,aAAa;IACd;GACD,SAAS;IACP,iBAAiB;IACjB,aAAa;IACd;GACD,SAAS;IACP,iBAAiB;IACjB,aAAa;IACd;GACF;EACF;CACF,CAAC;AAQF,MAAM,cAAc,OAAO,IAAI,KAAK,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAEhE,MAAa,QAAQ,YAAwC,EAAE,YAAY,MAAM,KAAK,QAAS,GAAG,SAAS,QACzG,oBAAC;CAAY,KAAK,IAAI,IAAI,YAAY,IAAI;EAAE;EAAY;EAAM,CAAC,EAAE,QAAQ;CAAE,GAAI;CAAY;EAAO,CAClG"}
|
package/es/BlockQuote.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockQuote.mjs","names":[],"sources":["../src/BlockQuote.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { forwardRef } from \"react\";\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst blockQuoteRecipe = cva({\n base: {\n borderInlineStart: \"4px solid\",\n paddingInline: \"medium\",\n },\n variants: {\n variant: {\n neutral: {\n borderColor: \"stroke.subtle\",\n background: \"surface.default\",\n },\n brand1: {\n background: \"surface.brand.1.subtle\",\n borderColor: \"surface.brand.1.strong\",\n },\n brand2: {\n background: \"surface.brand.2.subtle\",\n borderColor: \"surface.brand.2.strong\",\n },\n },\n },\n defaultVariants: {\n variant: \"neutral\",\n },\n});\n\nexport type BlockQuoteVariantProps = NonNullable<RecipeVariantProps<typeof blockQuoteRecipe>>;\n\nexport interface BlockQuoteProps extends HTMLArkProps<\"blockquote\">, StyledProps, BlockQuoteVariantProps {}\n\nconst StyledBlockQuote = styled(ark.blockquote, {}, { baseComponent: true });\n\nexport const BlockQuote = forwardRef<HTMLQuoteElement, BlockQuoteProps>(({ variant, css: cssProp, ...props }, ref) => (\n <StyledBlockQuote css={css.raw(blockQuoteRecipe.raw({ variant }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;AAcA,MAAM,mBAAmB,IAAI;CAC3B,MAAM;EACJ,mBAAmB;EACnB,eAAe;
|
|
1
|
+
{"version":3,"file":"BlockQuote.mjs","names":[],"sources":["../src/BlockQuote.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { forwardRef } from \"react\";\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps } from \"@ndla/styled-system/types\";\n\nconst blockQuoteRecipe = cva({\n base: {\n borderInlineStart: \"4px solid\",\n paddingInline: \"medium\",\n },\n variants: {\n variant: {\n neutral: {\n borderColor: \"stroke.subtle\",\n background: \"surface.default\",\n },\n brand1: {\n background: \"surface.brand.1.subtle\",\n borderColor: \"surface.brand.1.strong\",\n },\n brand2: {\n background: \"surface.brand.2.subtle\",\n borderColor: \"surface.brand.2.strong\",\n },\n },\n },\n defaultVariants: {\n variant: \"neutral\",\n },\n});\n\nexport type BlockQuoteVariantProps = NonNullable<RecipeVariantProps<typeof blockQuoteRecipe>>;\n\nexport interface BlockQuoteProps extends HTMLArkProps<\"blockquote\">, StyledProps, BlockQuoteVariantProps {}\n\nconst StyledBlockQuote = styled(ark.blockquote, {}, { baseComponent: true });\n\nexport const BlockQuote = forwardRef<HTMLQuoteElement, BlockQuoteProps>(({ variant, css: cssProp, ...props }, ref) => (\n <StyledBlockQuote css={css.raw(blockQuoteRecipe.raw({ variant }), cssProp)} {...props} ref={ref} />\n));\n"],"mappings":";;;;;;;AAcA,MAAM,mBAAmB,IAAI;CAC3B,MAAM;EACJ,mBAAmB;EACnB,eAAe;EAChB;CACD,UAAU,EACR,SAAS;EACP,SAAS;GACP,aAAa;GACb,YAAY;GACb;EACD,QAAQ;GACN,YAAY;GACZ,aAAa;GACd;EACD,QAAQ;GACN,YAAY;GACZ,aAAa;GACd;EACF,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CAAC;AAMF,MAAM,mBAAmB,OAAO,IAAI,YAAY,EAAE,EAAE,EAAE,eAAe,MAAM,CAAC;AAE5E,MAAa,aAAa,YAA+C,EAAE,SAAS,KAAK,QAAS,GAAG,SAAS,QAC5G,oBAAC;CAAiB,KAAK,IAAI,IAAI,iBAAiB,IAAI,EAAE,SAAS,CAAC,EAAE,QAAQ;CAAE,GAAI;CAAY;EAAO,CACnG"}
|
package/es/Button.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.mjs","names":[],"sources":["../src/Button.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type ReactNode, forwardRef, useMemo } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariant, StyledProps } from \"@ndla/styled-system/types\";\nimport { Spinner } from \"./Spinner\";\n\nexport const buttonBaseRecipe = cva({\n base: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"xxsmall\",\n cursor: \"pointer\",\n textDecoration: \"none\",\n fontWeight: \"bold\",\n transitionProperty: \"all\",\n transitionDuration: \"fast\",\n transitionTimingFunction: \"default\",\n textAlign: \"center\",\n borderRadius: \"xsmall\",\n outline: \"none\",\n boxShadowColor: \"stroke.default\",\n _disabled: {\n cursor: \"not-allowed\",\n color: \"text.onAction\",\n background: \"surface.disabled\",\n boxShadowColor: \"surface.disabled\",\n \"& svg\": {\n color: \"text.onAction\",\n },\n _hover: {\n color: \"text.onAction\",\n background: \"surface.disabled\",\n },\n },\n _focusVisible: {\n boxShadow: \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color)\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n },\n variants: {\n variant: {\n primary: {\n color: \"text.onAction\",\n background: \"surface.action\",\n _hover: {\n color: \"text.onAction\",\n background: \"surface.action.hover\",\n },\n _active: {\n color: \"text.onAction\",\n background: \"surface.action.active\",\n },\n _focusVisible: {\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n _on: {\n background: \"surface.action.selected\",\n },\n },\n secondary: {\n color: \"text.strong\",\n background: \"surface.default\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n _hover: {\n background: \"surface.actionSubtle.hover\",\n },\n _active: {\n background: \"surface.actionSubtle.hover.strong\",\n },\n _on: {\n background: \"surface.actionSubtle.active\",\n },\n },\n tertiary: {\n color: \"text.strong\",\n background: \"transparent\",\n _hover: {\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n background: \"surface.actionSubtle.hover\",\n _focusVisible: {\n boxShadow: \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color)\",\n },\n },\n _active: {\n borderColor: \"stroke.default\",\n background: \"surface.actionSubtle.hover.strong\",\n },\n _on: {\n background: \"surface.actionSubtle.active\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n },\n },\n clear: {\n background: \"transparent\",\n color: \"text.strong\",\n _hover: {\n color: \"stroke.hover\",\n },\n },\n clearSubtle: {\n background: \"transparent\",\n color: \"text.onAction\",\n _hover: {\n color: \"surface.actionSubtle.hover.strong\",\n },\n },\n danger: {\n background: \"surface.danger\",\n color: \"text.onAction\",\n _hover: {\n background: \"surface.danger.hover\",\n },\n _active: {\n background: \"surface.danger.active\",\n },\n _focusVisible: {\n boxShadowColor: \"surface.danger\",\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n },\n success: {\n background: \"surface.success\",\n color: \"text.onAction\",\n _hover: {\n background: \"surface.success.hover\",\n },\n _active: {\n background: \"surface.success.active\",\n },\n _focusVisible: {\n boxShadowColor: \"surface.success\",\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n },\n link: {\n background: \"transparent\",\n color: \"text.link\",\n fontWeight: \"normal\",\n textDecoration: \"underline\",\n transitionProperty: \"unset\",\n transitionTimingFunction: \"unset\",\n transitionDuration: \"unset\",\n _hover: {\n textDecoration: \"none\",\n },\n _focusVisible: {\n boxShadow: \"none\",\n outline: \"3px\",\n borderRadius: \"xsmall\",\n outlineColor: \"stroke.default\",\n outlineOffset: \"3px\",\n outlineStyle: \"solid\",\n },\n },\n },\n },\n});\n\nexport const buttonRecipe = cva({\n defaultVariants: {\n size: \"medium\",\n },\n variants: {\n size: {\n medium: {\n textStyle: \"label.medium\",\n paddingInline: \"small\",\n paddingBlock: \"xxsmall\",\n minHeight: \"24\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n },\n small: {\n textStyle: \"label.small\",\n minHeight: \"large\",\n paddingInline: \"xsmall\",\n paddingBlock: \"4xsmall\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"small\",\n height: \"small\",\n },\n },\n },\n },\n});\n\nexport const iconButtonRecipe = cva({\n base: {\n lineHeight: \"1\",\n minHeight: \"unset\",\n },\n defaultVariants: {\n size: \"medium\",\n },\n variants: {\n size: {\n medium: {\n \"--shadow-width\": \"3px\",\n height: \"xxlarge\",\n width: \"xxlarge\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n paddingInline: \"xsmall\",\n paddingBlock: \"xsmall\",\n },\n small: {\n \"--shadow-width\": \"2px\",\n height: \"large\",\n width: \"large\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"small\",\n height: \"small\",\n },\n paddingInline: \"xxsmall\",\n paddingBlock: \"xxsmall\",\n },\n },\n },\n});\n\ntype Variant = RecipeVariant<typeof buttonBaseRecipe>[\"variant\"];\n\ntype ButtonVariant = Exclude<Variant, \"clear\" | \"clearSubtle\">;\n\nexport interface ButtonVariantProps extends NonNullable<RecipeVariantProps<typeof buttonRecipe>> {\n variant?: ButtonVariant;\n}\n\nexport interface BaseButtonProps extends HTMLArkProps<\"button\">, StyledProps {\n loading?: boolean;\n loadingContent?: ReactNode;\n replaceContent?: boolean;\n}\n\nexport interface ButtonProps extends BaseButtonProps, ButtonVariantProps {}\n\nconst StyledButton = styled(ark.button, {}, { baseComponent: true, defaultProps: { type: \"button\" } });\n\nexport const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(\n ({ loading, loadingContent: loadingContentProp, replaceContent, onClick: _onClick, children, ...props }, ref) => {\n const ariaDisabled = loading ? { \"aria-disabled\": true } : {};\n\n const onClick = useMemo(() => (loading ? undefined : _onClick), [_onClick, loading]);\n\n const loadingContent = useMemo(() => {\n return replaceContent ? (\n loadingContentProp\n ) : (\n <>\n {loadingContentProp}\n {children}\n </>\n );\n }, [children, loadingContentProp, replaceContent]);\n\n return (\n <StyledButton onClick={onClick} {...ariaDisabled} {...props} ref={ref}>\n {loading ? loadingContent : children}\n </StyledButton>\n );\n },\n);\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant, loadingContent, size, css: cssProp, ...props }, ref) => (\n <BaseButton\n {...props}\n loadingContent={loadingContent ?? <Spinner size=\"small\" />}\n css={css.raw(\n buttonBaseRecipe.raw({ variant }),\n variant !== \"link\" ? buttonRecipe.raw({ size }) : undefined,\n cssProp,\n )}\n ref={ref}\n />\n ),\n);\n\ntype IconButtonVariant = Exclude<Variant, \"link\">;\n\nexport interface IconButtonVariantProps extends NonNullable<RecipeVariantProps<typeof iconButtonRecipe>> {\n variant?: IconButtonVariant;\n}\n\nexport interface IconButtonProps extends BaseButtonProps, IconButtonVariantProps {}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ variant, css: cssProp, loadingContent, size, replaceContent = true, ...props }, ref) => (\n <BaseButton\n {...props}\n css={css.raw(buttonBaseRecipe.raw({ variant }), iconButtonRecipe.raw({ size }), cssProp)}\n loadingContent={loadingContent ?? <Spinner size=\"small\" />}\n replaceContent={replaceContent}\n ref={ref}\n />\n ),\n);\n"],"mappings":";;;;;;;;AAeA,MAAa,mBAAmB,IAAI;CAClC,MAAM;EACJ,SAAS;EACT,YAAY;EACZ,gBAAgB;EAChB,KAAK;EACL,QAAQ;EACR,gBAAgB;EAChB,YAAY;EACZ,oBAAoB;EACpB,oBAAoB;EACpB,0BAA0B;EAC1B,WAAW;EACX,cAAc;EACd,SAAS;EACT,gBAAgB;EAChB,WAAW;GACT,QAAQ;GACR,OAAO;GACP,YAAY;GACZ,gBAAgB;GAChB,SAAS,EACP,OAAO,gBACR;GACD,QAAQ;IACN,OAAO;IACP,YAAY;GACb;EACF;EACD,eAAe,EACb,WAAW,2DACZ;EACD,eAAe;GACb,YAAY;GACZ,oBAAoB;EACrB;CACF;CACD,iBAAiB,EACf,SAAS,UACV;CACD,UAAU,EACR,SAAS;EACP,SAAS;GACP,OAAO;GACP,YAAY;GACZ,QAAQ;IACN,OAAO;IACP,YAAY;GACb;GACD,SAAS;IACP,OAAO;IACP,YAAY;GACb;GACD,eAAe,EACb,WACE,8HACH;GACD,KAAK,EACH,YAAY,0BACb;EACF;EACD,WAAW;GACT,OAAO;GACP,YAAY;GACZ,WAAW;GACX,QAAQ,EACN,YAAY,6BACb;GACD,SAAS,EACP,YAAY,oCACb;GACD,KAAK,EACH,YAAY,8BACb;EACF;EACD,UAAU;GACR,OAAO;GACP,YAAY;GACZ,QAAQ;IACN,WAAW;IACX,YAAY;IACZ,eAAe,EACb,WAAW,2DACZ;GACF;GACD,SAAS;IACP,aAAa;IACb,YAAY;GACb;GACD,KAAK;IACH,YAAY;IACZ,WAAW;GACZ;EACF;EACD,OAAO;GACL,YAAY;GACZ,OAAO;GACP,QAAQ,EACN,OAAO,eACR;EACF;EACD,aAAa;GACX,YAAY;GACZ,OAAO;GACP,QAAQ,EACN,OAAO,oCACR;EACF;EACD,QAAQ;GACN,YAAY;GACZ,OAAO;GACP,QAAQ,EACN,YAAY,uBACb;GACD,SAAS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E,GAAE;CAAE,eAAe;CAAM,cAAc,EAAE,MAAM,SAAU;AAAE,EAAC;AAEtG,MAAa,aAAa,WACxB,CAAC,EAAE,SAAS,gBAAgB,oBAAoB,gBAAgB,SAAS,UAAU,SAAU,GAAG,OAAO,EAAE,QAAQ;CAC/G,MAAM,eAAe,UAAU,EAAE,iBAAiB,KAAM,IAAG,CAAE;CAE7D,MAAM,UAAU,QAAQ,MAAO,mBAAsB,UAAW,CAAC,UAAU,OAAQ,EAAC;CAEpF,MAAM,iBAAiB,QAAQ,MAAM;AACnC,SAAO,iBACL,qCAEA,4BACG,oBACA,YACA;CAEN,GAAE;EAAC;EAAU;EAAoB;CAAe,EAAC;AAElD,wBACE,IAAC;EAAsB;EAAS,GAAI;EAAc,GAAI;EAAY;YAC/D,UAAU,iBAAiB;GACf;AAElB,EACF;AAED,MAAa,SAAS,WACpB,CAAC,EAAE,SAAS,gBAAgB,MAAM,KAAK,QAAS,GAAG,OAAO,EAAE,wBAC1D,IAAC;CACC,GAAI;CACJ,gBAAgB,kCAAkB,IAAC,WAAQ,MAAK,UAAU;CAC1D,KAAK,IAAI,IACP,iBAAiB,IAAI,EAAE,QAAS,EAAC,EACjC,YAAY,SAAS,aAAa,IAAI,EAAE,KAAM,EAAC,WAC/C,QACD;CACI;EACL,CAEL;AAUD,MAAa,aAAa,WACxB,CAAC,EAAE,SAAS,KAAK,SAAS,gBAAgB,MAAM,iBAAiB,KAAM,GAAG,OAAO,EAAE,wBACjF,IAAC;CACC,GAAI;CACJ,KAAK,IAAI,IAAI,iBAAiB,IAAI,EAAE,QAAS,EAAC,EAAE,iBAAiB,IAAI,EAAE,KAAM,EAAC,EAAE,QAAQ;CACxF,gBAAgB,kCAAkB,IAAC,WAAQ,MAAK,UAAU;CAC1C;CACX;EACL,CAEL"}
|
|
1
|
+
{"version":3,"file":"Button.mjs","names":[],"sources":["../src/Button.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type ReactNode, forwardRef, useMemo } from \"react\";\nimport { type HTMLArkProps, ark } from \"@ark-ui/react\";\nimport { type RecipeVariantProps, css, cva } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariant, StyledProps } from \"@ndla/styled-system/types\";\nimport { Spinner } from \"./Spinner\";\n\nexport const buttonBaseRecipe = cva({\n base: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"xxsmall\",\n cursor: \"pointer\",\n textDecoration: \"none\",\n fontWeight: \"bold\",\n transitionProperty: \"all\",\n transitionDuration: \"fast\",\n transitionTimingFunction: \"default\",\n textAlign: \"center\",\n borderRadius: \"xsmall\",\n outline: \"none\",\n boxShadowColor: \"stroke.default\",\n _disabled: {\n cursor: \"not-allowed\",\n color: \"text.onAction\",\n background: \"surface.disabled\",\n boxShadowColor: \"surface.disabled\",\n \"& svg\": {\n color: \"text.onAction\",\n },\n _hover: {\n color: \"text.onAction\",\n background: \"surface.disabled\",\n },\n },\n _focusVisible: {\n boxShadow: \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color)\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n },\n variants: {\n variant: {\n primary: {\n color: \"text.onAction\",\n background: \"surface.action\",\n _hover: {\n color: \"text.onAction\",\n background: \"surface.action.hover\",\n },\n _active: {\n color: \"text.onAction\",\n background: \"surface.action.active\",\n },\n _focusVisible: {\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n _on: {\n background: \"surface.action.selected\",\n },\n },\n secondary: {\n color: \"text.strong\",\n background: \"surface.default\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n _hover: {\n background: \"surface.actionSubtle.hover\",\n },\n _active: {\n background: \"surface.actionSubtle.hover.strong\",\n },\n _on: {\n background: \"surface.actionSubtle.active\",\n },\n },\n tertiary: {\n color: \"text.strong\",\n background: \"transparent\",\n _hover: {\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n background: \"surface.actionSubtle.hover\",\n _focusVisible: {\n boxShadow: \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color)\",\n },\n },\n _active: {\n borderColor: \"stroke.default\",\n background: \"surface.actionSubtle.hover.strong\",\n },\n _on: {\n background: \"surface.actionSubtle.active\",\n boxShadow: \"inset 0 0 0 1px var(--shadow-color)\",\n },\n },\n clear: {\n background: \"transparent\",\n color: \"text.strong\",\n _hover: {\n color: \"stroke.hover\",\n },\n },\n clearSubtle: {\n background: \"transparent\",\n color: \"text.onAction\",\n _hover: {\n color: \"surface.actionSubtle.hover.strong\",\n },\n },\n danger: {\n background: \"surface.danger\",\n color: \"text.onAction\",\n _hover: {\n background: \"surface.danger.hover\",\n },\n _active: {\n background: \"surface.danger.active\",\n },\n _focusVisible: {\n boxShadowColor: \"surface.danger\",\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n },\n success: {\n background: \"surface.success\",\n color: \"text.onAction\",\n _hover: {\n background: \"surface.success.hover\",\n },\n _active: {\n background: \"surface.success.active\",\n },\n _focusVisible: {\n boxShadowColor: \"surface.success\",\n boxShadow:\n \"inset 0 0 0 var(--shadow-width, 3px) var(--shadow-color), inset 0px 0px 0px calc(var(--shadow-width, 3px) * 2) currentcolor\",\n },\n },\n link: {\n background: \"transparent\",\n color: \"text.link\",\n fontWeight: \"normal\",\n textDecoration: \"underline\",\n transitionProperty: \"unset\",\n transitionTimingFunction: \"unset\",\n transitionDuration: \"unset\",\n _hover: {\n textDecoration: \"none\",\n },\n _focusVisible: {\n boxShadow: \"none\",\n outline: \"3px\",\n borderRadius: \"xsmall\",\n outlineColor: \"stroke.default\",\n outlineOffset: \"3px\",\n outlineStyle: \"solid\",\n },\n },\n },\n },\n});\n\nexport const buttonRecipe = cva({\n defaultVariants: {\n size: \"medium\",\n },\n variants: {\n size: {\n medium: {\n textStyle: \"label.medium\",\n paddingInline: \"small\",\n paddingBlock: \"xxsmall\",\n minHeight: \"24\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n },\n small: {\n textStyle: \"label.small\",\n minHeight: \"large\",\n paddingInline: \"xsmall\",\n paddingBlock: \"4xsmall\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"small\",\n height: \"small\",\n },\n },\n },\n },\n});\n\nexport const iconButtonRecipe = cva({\n base: {\n lineHeight: \"1\",\n minHeight: \"unset\",\n },\n defaultVariants: {\n size: \"medium\",\n },\n variants: {\n size: {\n medium: {\n \"--shadow-width\": \"3px\",\n height: \"xxlarge\",\n width: \"xxlarge\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"medium\",\n height: \"medium\",\n },\n paddingInline: \"xsmall\",\n paddingBlock: \"xsmall\",\n },\n small: {\n \"--shadow-width\": \"2px\",\n height: \"large\",\n width: \"large\",\n \"& svg\": {\n marginInline: \"0\",\n marginBlock: \"0\",\n width: \"small\",\n height: \"small\",\n },\n paddingInline: \"xxsmall\",\n paddingBlock: \"xxsmall\",\n },\n },\n },\n});\n\ntype Variant = RecipeVariant<typeof buttonBaseRecipe>[\"variant\"];\n\ntype ButtonVariant = Exclude<Variant, \"clear\" | \"clearSubtle\">;\n\nexport interface ButtonVariantProps extends NonNullable<RecipeVariantProps<typeof buttonRecipe>> {\n variant?: ButtonVariant;\n}\n\nexport interface BaseButtonProps extends HTMLArkProps<\"button\">, StyledProps {\n loading?: boolean;\n loadingContent?: ReactNode;\n replaceContent?: boolean;\n}\n\nexport interface ButtonProps extends BaseButtonProps, ButtonVariantProps {}\n\nconst StyledButton = styled(ark.button, {}, { baseComponent: true, defaultProps: { type: \"button\" } });\n\nexport const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(\n ({ loading, loadingContent: loadingContentProp, replaceContent, onClick: _onClick, children, ...props }, ref) => {\n const ariaDisabled = loading ? { \"aria-disabled\": true } : {};\n\n const onClick = useMemo(() => (loading ? undefined : _onClick), [_onClick, loading]);\n\n const loadingContent = useMemo(() => {\n return replaceContent ? (\n loadingContentProp\n ) : (\n <>\n {loadingContentProp}\n {children}\n </>\n );\n }, [children, loadingContentProp, replaceContent]);\n\n return (\n <StyledButton onClick={onClick} {...ariaDisabled} {...props} ref={ref}>\n {loading ? loadingContent : children}\n </StyledButton>\n );\n },\n);\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant, loadingContent, size, css: cssProp, ...props }, ref) => (\n <BaseButton\n {...props}\n loadingContent={loadingContent ?? <Spinner size=\"small\" />}\n css={css.raw(\n buttonBaseRecipe.raw({ variant }),\n variant !== \"link\" ? buttonRecipe.raw({ size }) : undefined,\n cssProp,\n )}\n ref={ref}\n />\n ),\n);\n\ntype IconButtonVariant = Exclude<Variant, \"link\">;\n\nexport interface IconButtonVariantProps extends NonNullable<RecipeVariantProps<typeof iconButtonRecipe>> {\n variant?: IconButtonVariant;\n}\n\nexport interface IconButtonProps extends BaseButtonProps, IconButtonVariantProps {}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ variant, css: cssProp, loadingContent, size, replaceContent = true, ...props }, ref) => (\n <BaseButton\n {...props}\n css={css.raw(buttonBaseRecipe.raw({ variant }), iconButtonRecipe.raw({ size }), cssProp)}\n loadingContent={loadingContent ?? <Spinner size=\"small\" />}\n replaceContent={replaceContent}\n ref={ref}\n />\n ),\n);\n"],"mappings":";;;;;;;;AAeA,MAAa,mBAAmB,IAAI;CAClC,MAAM;EACJ,SAAS;EACT,YAAY;EACZ,gBAAgB;EAChB,KAAK;EACL,QAAQ;EACR,gBAAgB;EAChB,YAAY;EACZ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,iBAAiB,MAAM,GAAG,EAAE;CAE7D,MAAM,UAAU,cAAe,UAAU,SAAY,UAAW,CAAC,UAAU,QAAQ,CAAC;CAEpF,MAAM,iBAAiB,cAAc;AACnC,SAAO,iBACL,qBAEA,4CACG,oBACA,YACA;IAEJ;EAAC;EAAU;EAAoB;EAAe,CAAC;AAElD,QACE,oBAAC;EAAsB;EAAS,GAAI;EAAc,GAAI;EAAY;YAC/D,UAAU,iBAAiB;GACf;EAGpB;AAED,MAAa,SAAS,YACnB,EAAE,SAAS,gBAAgB,MAAM,KAAK,QAAS,GAAG,SAAS,QAC1D,oBAAC;CACC,GAAI;CACJ,gBAAgB,kBAAkB,oBAAC,WAAQ,MAAK,UAAU;CAC1D,KAAK,IAAI,IACP,iBAAiB,IAAI,EAAE,SAAS,CAAC,EACjC,YAAY,SAAS,aAAa,IAAI,EAAE,MAAM,CAAC,GAAG,QAClD,QACD;CACI;EACL,CAEL;AAUD,MAAa,aAAa,YACvB,EAAE,SAAS,KAAK,SAAS,gBAAgB,MAAM,iBAAiB,KAAM,GAAG,SAAS,QACjF,oBAAC;CACC,GAAI;CACJ,KAAK,IAAI,IAAI,iBAAiB,IAAI,EAAE,SAAS,CAAC,EAAE,iBAAiB,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ;CACxF,gBAAgB,kBAAkB,oBAAC,WAAQ,MAAK,UAAU;CAC1C;CACX;EACL,CAEL"}
|
package/es/Card/Card.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.mjs","names":[],"sources":["../../src/Card/Card.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { forwardRef } from \"react\";\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps, RecipeVariantProps } from \"@ndla/styled-system/types\";\nimport { Image } from \"../Image\";\nimport { Heading, type TextProps } from \"../Text\";\n\nconst cardRecipe = sva({\n slots: [\"root\", \"title\", \"content\", \"image\"],\n base: {\n root: {\n position: \"relative\",\n border: \"1px solid\",\n borderRadius: \"xsmall\",\n borderColor: \"stroke.subtle\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color\",\n transitionTimingFunction: \"default\",\n background: \"surface.default\",\n overflow: \"hidden\",\n _hover: {\n borderColor: \"stroke.hover\",\n },\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n paddingBlock: \"xsmall\",\n paddingInline: \"medium\",\n },\n title: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n image: {\n height: \"200px\",\n objectFit: \"cover\",\n width: \"100%\",\n },\n },\n defaultVariants: {\n variant: \"intense\",\n },\n variants: {\n variant: {\n subtle: {},\n intense: {\n root: {\n _hover: {\n background: \"surface.actionSubtle.hover\",\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(cardRecipe);\n\nexport type CardVariantProps = NonNullable<RecipeVariantProps<typeof cardRecipe>>;\n\nexport interface CardRootProps extends HTMLArkProps<\"article\">, StyledProps, CardVariantProps {}\n\nexport const CardRoot = withProvider(ark.article, \"root\", { baseComponent: true });\n\ninterface CardHeadingProps extends StyledProps, Omit<HTMLArkProps<\"p\">, \"color\">, TextProps {}\n\nconst InternalCardHeading = forwardRef<HTMLHeadingElement, CardHeadingProps>(\n ({ textStyle = \"label.large\", fontWeight = \"bold\", ...props }, ref) => (\n <Heading textStyle={textStyle} fontWeight={fontWeight} {...props} ref={ref} />\n ),\n);\n\nexport const CardHeading = withContext(InternalCardHeading, \"title\");\n\nexport const CardContent = withContext(ark.div, \"content\", { baseComponent: true });\n\nexport const CardImage = withContext(Image, \"image\");\n"],"mappings":";;;;;;;;;AAgBA,MAAM,aAAa,IAAI;CACrB,OAAO;EAAC;EAAQ;EAAS;EAAW;
|
|
1
|
+
{"version":3,"file":"Card.mjs","names":[],"sources":["../../src/Card/Card.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { forwardRef } from \"react\";\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { StyledProps, RecipeVariantProps } from \"@ndla/styled-system/types\";\nimport { Image } from \"../Image\";\nimport { Heading, type TextProps } from \"../Text\";\n\nconst cardRecipe = sva({\n slots: [\"root\", \"title\", \"content\", \"image\"],\n base: {\n root: {\n position: \"relative\",\n border: \"1px solid\",\n borderRadius: \"xsmall\",\n borderColor: \"stroke.subtle\",\n transitionDuration: \"fast\",\n transitionProperty: \"background, color\",\n transitionTimingFunction: \"default\",\n background: \"surface.default\",\n overflow: \"hidden\",\n _hover: {\n borderColor: \"stroke.hover\",\n },\n },\n content: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n paddingBlock: \"xsmall\",\n paddingInline: \"medium\",\n },\n title: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n image: {\n height: \"200px\",\n objectFit: \"cover\",\n width: \"100%\",\n },\n },\n defaultVariants: {\n variant: \"intense\",\n },\n variants: {\n variant: {\n subtle: {},\n intense: {\n root: {\n _hover: {\n background: \"surface.actionSubtle.hover\",\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(cardRecipe);\n\nexport type CardVariantProps = NonNullable<RecipeVariantProps<typeof cardRecipe>>;\n\nexport interface CardRootProps extends HTMLArkProps<\"article\">, StyledProps, CardVariantProps {}\n\nexport const CardRoot = withProvider(ark.article, \"root\", { baseComponent: true });\n\ninterface CardHeadingProps extends StyledProps, Omit<HTMLArkProps<\"p\">, \"color\">, TextProps {}\n\nconst InternalCardHeading = forwardRef<HTMLHeadingElement, CardHeadingProps>(\n ({ textStyle = \"label.large\", fontWeight = \"bold\", ...props }, ref) => (\n <Heading textStyle={textStyle} fontWeight={fontWeight} {...props} ref={ref} />\n ),\n);\n\nexport const CardHeading = withContext(InternalCardHeading, \"title\");\n\nexport const CardContent = withContext(ark.div, \"content\", { baseComponent: true });\n\nexport const CardImage = withContext(Image, \"image\");\n"],"mappings":";;;;;;;;;AAgBA,MAAM,aAAa,IAAI;CACrB,OAAO;EAAC;EAAQ;EAAS;EAAW;EAAQ;CAC5C,MAAM;EACJ,MAAM;GACJ,UAAU;GACV,QAAQ;GACR,cAAc;GACd,aAAa;GACb,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,YAAY;GACZ,UAAU;GACV,QAAQ,EACN,aAAa,gBACd;GACF;EACD,SAAS;GACP,SAAS;GACT,eAAe;GACf,KAAK;GACL,cAAc;GACd,eAAe;GAChB;EACD,OAAO;GACL,gBAAgB;GAChB,QAAQ,EACN,gBAAgB,QACjB;GACF;EACD,OAAO;GACL,QAAQ;GACR,WAAW;GACX,OAAO;GACR;EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACD,UAAU,EACR,SAAS;EACP,QAAQ,EAAE;EACV,SAAS,EACP,MAAM,EACJ,QAAQ,EACN,YAAY,8BACb,EACF,EACF;EACF,EACF;CACF,CAAC;AAEF,MAAM,EAAE,cAAc,gBAAgB,mBAAmB,WAAW;AAMpE,MAAa,WAAW,aAAa,IAAI,SAAS,QAAQ,EAAE,eAAe,MAAM,CAAC;AAIlF,MAAM,sBAAsB,YACzB,EAAE,YAAY,eAAe,aAAa,OAAQ,GAAG,SAAS,QAC7D,oBAAC;CAAmB;CAAuB;CAAY,GAAI;CAAY;EAAO,CAEjF;AAED,MAAa,cAAc,YAAY,qBAAqB,QAAQ;AAEpE,MAAa,cAAc,YAAY,IAAI,KAAK,WAAW,EAAE,eAAe,MAAM,CAAC;AAEnF,MAAa,YAAY,YAAY,OAAO,QAAQ"}
|
package/es/Checkbox.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.mjs","names":[],"sources":["../src/Checkbox.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Checkbox, checkboxAnatomy, type HTMLArkProps } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst checkboxRecipe = sva({\n slots: checkboxAnatomy.keys(),\n base: {\n root: {\n userSelect: \"none\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"fit-content\",\n cursor: \"pointer\",\n _disabled: {\n color: \"text.disabled\",\n cursor: \"not-allowed\",\n _hover: {\n color: \"text.disabled\",\n },\n },\n },\n group: {\n display: \"flex\",\n gap: \"xxsmall\",\n flexDirection: \"column\",\n },\n control: {\n flexShrink: \"0\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n width: \"medium\",\n height: \"medium\",\n color: \"text.strong\",\n transitionDuration: \"normal\",\n transitionProperty: \"border-color, background, box-shadow, color\",\n transitionTimingFunction: \"default\",\n _disabled: {\n cursor: \"not-allowed\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n },\n defaultVariants: {\n variant: \"checkbox\",\n },\n variants: {\n variant: {\n checkbox: {\n root: {\n gap: \"xxsmall\",\n _hover: {\n color: \"text.action\",\n },\n _focusVisible: {\n outline: \"2px solid\",\n outlineOffset: \"4xsmall\",\n outlineColor: \"stroke.default\",\n borderRadius: \"xsmall\",\n },\n },\n control: {\n border: \"2px solid\",\n borderColor: \"stroke.subtle\",\n borderRadius: \"xsmall\",\n background: \"surface.default\",\n _hover: {\n boxShadow: \"0 0 0 4px var(--shadow-color)\",\n boxShadowColor: \"surface.actionSubtle.hover.strong\",\n },\n _checked: {\n backgroundColor: \"surface.action\",\n borderColor: \"surface.action\",\n color: \"icon.onAction\",\n },\n _disabled: {\n borderColor: \"stroke.disabled\",\n _hover: {\n borderColor: \"stroke.disabled\",\n boxShadow: \"none\",\n },\n _checked: {\n background: \"surface.disabled\",\n borderColor: \"stroke.disabled\",\n },\n },\n _invalid: {\n borderColor: \"stroke.error\",\n _checked: {\n color: \"stroke.error\",\n borderColor: \"stroke.error\",\n backgroundColor: \"surface.default\",\n },\n },\n },\n },\n chip: {\n root: {\n width: \"fit-content\",\n color: \"text.default\",\n gap: \"4xsmall\",\n background: \"surface.actionSubtle\",\n border: \"1px solid\",\n borderColor: \"stroke.subtle\",\n outlineColor: \"stroke.subtle\",\n paddingInline: \"xsmall\",\n paddingBlock: \"4xsmall\",\n borderRadius: \"large\",\n minHeight: \"large\",\n transitionDuration: \"normal\",\n transitionProperty: \"border-color, background, box-shadow, color\",\n transitionTimingFunction: \"default\",\n _disabled: {\n color: \"text.disabled\",\n borderColor: \"stroke.disabled\",\n background: \"surface.disabled\",\n _hover: {\n color: \"text.disabled\",\n borderColor: \"stroke.disabled\",\n background: \"surface.disabled\",\n },\n _checked: {\n color: \"text.disabled\",\n borderColor: \"stroke.disabled\",\n background: \"surface.disabled\",\n _hover: {\n color: \"text.disabled\",\n borderColor: \"stroke.disabled\",\n background: \"surface.disabled\",\n },\n },\n },\n _hover: {\n background: \"surface.actionSubtle.hover\",\n borderColor: \"stroke.hover\",\n outlineColor: \"stroke.hover\",\n _invalid: {\n backgroundColor: \"surface.dangerSubtle\",\n },\n },\n _checked: {\n color: \"text.onAction\",\n background: \"surface.action.selected\",\n borderColor: \"surface.action.selected\",\n outlineColor: \"icon.onAction\",\n _focus: {\n outlineOffset: \"-4px\",\n },\n _hover: {\n outlineOffset: \"-2px\",\n background: \"surface.actionSubtle.hover\",\n color: \"text.default\",\n borderColor: \"stroke.hover\",\n outlineColor: \"stroke.hover\",\n },\n },\n _invalid: {\n borderColor: \"stroke.error\",\n outlineColor: \"stroke.error\",\n background: \"surface.dangerSubtle\",\n outlineOffset: \"-2px\",\n _checked: {\n color: \"text.default\",\n borderColor: \"stroke.error\",\n outlineColor: \"stroke.error\",\n background: \"surface.dangerSubtle\",\n outlineOffset: \"-2px\",\n _hover: {\n borderColor: \"stroke.hover\",\n outlineColor: \"stroke.hover\",\n },\n },\n },\n _focus: {\n outlineStyle: \"solid\",\n outlineWidth: \"2px\",\n outlineOffset: \"-2px\",\n },\n },\n control: {\n display: \"none\",\n _checked: {\n display: \"flex\",\n color: \"text.onAction\",\n _hover: {\n color: \"stroke.hover\",\n },\n },\n _disabled: {\n color: \"stroke.disabled\",\n _hover: {\n color: \"stroke.disabled\",\n },\n },\n _invalid: {\n _checked: {\n color: \"stroke.error\",\n },\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(checkboxRecipe);\n\nexport type CheckboxVariantProps = NonNullable<RecipeVariantProps<typeof checkboxRecipe>>;\n\nexport interface CheckboxRootProps extends StyledProps, HTMLArkProps<\"label\">, CheckboxVariantProps {}\n\nexport const CheckboxRoot = withProvider(Checkbox.Root, \"root\", { baseComponent: true });\n\nexport const CheckboxIndicator = withContext(Checkbox.Indicator, \"indicator\", { baseComponent: true });\n\nconst InternalCheckboxLabel = withContext(Checkbox.Label, \"label\");\n\ninterface CheckboxLabelProps extends StyledProps, Omit<Checkbox.LabelProps, \"color\">, TextProps {}\n\nexport const CheckboxLabel = ({ textStyle = \"label.medium\", children, ...props }: CheckboxLabelProps) => (\n <InternalCheckboxLabel {...props} asChild>\n <Text textStyle={textStyle}>{children}</Text>\n </InternalCheckboxLabel>\n);\n\nexport const CheckboxControl = withContext(Checkbox.Control, \"control\", { baseComponent: true });\n\nexport const CheckboxGroup = withProvider(Checkbox.Group, \"group\", { baseComponent: true });\n\nexport const CheckboxHiddenInput = Checkbox.HiddenInput;\n"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B;AAG1B,MAAa,kBAAkB,YAAY,SAAS,SAAS,WAAW,EAAE,eAAe,KAAM,EAAC;AAEhG,MAAa,gBAAgB,aAAa,SAAS,OAAO,SAAS,EAAE,eAAe,KAAM,EAAC;AAE3F,MAAa,sBAAsB,SAAS"}
|
|
1
|
+
{"version":3,"file":"Checkbox.mjs","names":[],"sources":["../src/Checkbox.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Checkbox, checkboxAnatomy, type HTMLArkProps } from \"@ark-ui/react\";\nimport { sva } from \"@ndla/styled-system/css\";\nimport { createStyleContext } from \"@ndla/styled-system/jsx\";\nimport type { RecipeVariantProps, StyledProps } from \"@ndla/styled-system/types\";\nimport { Text, type TextProps } from \"./Text\";\n\nconst checkboxRecipe = sva({\n slots: checkboxAnatomy.keys(),\n base: {\n root: {\n userSelect: \"none\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"fit-content\",\n cursor: \"pointer\",\n _disabled: {\n color: \"text.disabled\",\n cursor: \"not-allowed\",\n _hover: {\n color: \"text.disabled\",\n },\n },\n },\n group: {\n display: \"flex\",\n gap: \"xxsmall\",\n flexDirection: \"column\",\n },\n control: {\n flexShrink: \"0\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n width: \"medium\",\n height: \"medium\",\n color: \"text.strong\",\n transitionDuration: \"normal\",\n transitionProperty: \"border-color, background, box-shadow, color\",\n transitionTimingFunction: \"default\",\n _disabled: {\n cursor: \"not-allowed\",\n },\n _motionReduce: {\n transition: \"none\",\n transitionDuration: \"0s\",\n },\n },\n },\n defaultVariants: {\n variant: \"checkbox\",\n },\n variants: {\n variant: {\n checkbox: {\n root: {\n gap: \"xxsmall\",\n _hover: {\n color: \"text.action\",\n },\n _focusVisible: {\n outline: \"2px solid\",\n outlineOffset: \"4xsmall\",\n outlineColor: \"stroke.default\",\n borderRadius: \"xsmall\",\n },\n },\n control: {\n border: \"2px solid\",\n borderColor: \"stroke.subtle\",\n borderRadius: \"xsmall\",\n background: \"surface.default\",\n _hover: {\n boxShadow: \"0 0 0 4px var(--shadow-color)\",\n boxShadowColor: \"surface.actionSubtle.hover.strong\",\n },\n _checked: {\n backgroundColor: \"surface.action\",\n borderColor: \"surface.action\",\n color: \"icon.onAction\",\n },\n _disabled: {\n borderColor: \"stroke.disabled\",\n _hover: {\n borderColor: \"stroke.disabled\",\n boxShadow: \"none\",\n },\n _checked: {\n background: \"surface.disabled\",\n borderColor: \"stroke.disabled\",\n },\n },\n _invalid: {\n borderColor: \"stroke.error\",\n _checked: {\n color: \"stroke.error\",\n borderColor: \"stroke.error\",\n backgroundColor: \"surface.default\",\n },\n },\n },\n },\n chip: {\n root: {\n width: \"fit-content\",\n color: \"text.default\",\n gap: \"4xsmall\",\n background: \"surface.actionSubtle\",\n border: \"1px solid\",\n borderColor: \"stroke.subtle\",\n outlineColor: \"stroke.subtle\",\n paddingInline: \"xsmall\",\n paddingBlock: \"4xsmall\",\n borderRadius: \"large\",\n minHeight: \"large\",\n transitionDuration: \"normal\",\n transitionProperty: \"border-color, background, box-shadow, color\",\n transitionTimingFunction: \"default\",\n _disabled: {\n color: \"text.disabled\",\n borderColor: \"stroke.disabled\",\n background: \"surface.disabled\",\n _hover: {\n color: \"text.disabled\",\n borderColor: \"stroke.disabled\",\n background: \"surface.disabled\",\n },\n _checked: {\n color: \"text.disabled\",\n borderColor: \"stroke.disabled\",\n background: \"surface.disabled\",\n _hover: {\n color: \"text.disabled\",\n borderColor: \"stroke.disabled\",\n background: \"surface.disabled\",\n },\n },\n },\n _hover: {\n background: \"surface.actionSubtle.hover\",\n borderColor: \"stroke.hover\",\n outlineColor: \"stroke.hover\",\n _invalid: {\n backgroundColor: \"surface.dangerSubtle\",\n },\n },\n _checked: {\n color: \"text.onAction\",\n background: \"surface.action.selected\",\n borderColor: \"surface.action.selected\",\n outlineColor: \"icon.onAction\",\n _focus: {\n outlineOffset: \"-4px\",\n },\n _hover: {\n outlineOffset: \"-2px\",\n background: \"surface.actionSubtle.hover\",\n color: \"text.default\",\n borderColor: \"stroke.hover\",\n outlineColor: \"stroke.hover\",\n },\n },\n _invalid: {\n borderColor: \"stroke.error\",\n outlineColor: \"stroke.error\",\n background: \"surface.dangerSubtle\",\n outlineOffset: \"-2px\",\n _checked: {\n color: \"text.default\",\n borderColor: \"stroke.error\",\n outlineColor: \"stroke.error\",\n background: \"surface.dangerSubtle\",\n outlineOffset: \"-2px\",\n _hover: {\n borderColor: \"stroke.hover\",\n outlineColor: \"stroke.hover\",\n },\n },\n },\n _focus: {\n outlineStyle: \"solid\",\n outlineWidth: \"2px\",\n outlineOffset: \"-2px\",\n },\n },\n control: {\n display: \"none\",\n _checked: {\n display: \"flex\",\n color: \"text.onAction\",\n _hover: {\n color: \"stroke.hover\",\n },\n },\n _disabled: {\n color: \"stroke.disabled\",\n _hover: {\n color: \"stroke.disabled\",\n },\n },\n _invalid: {\n _checked: {\n color: \"stroke.error\",\n },\n },\n },\n },\n },\n },\n});\n\nconst { withProvider, withContext } = createStyleContext(checkboxRecipe);\n\nexport type CheckboxVariantProps = NonNullable<RecipeVariantProps<typeof checkboxRecipe>>;\n\nexport interface CheckboxRootProps extends StyledProps, HTMLArkProps<\"label\">, CheckboxVariantProps {}\n\nexport const CheckboxRoot = withProvider(Checkbox.Root, \"root\", { baseComponent: true });\n\nexport const CheckboxIndicator = withContext(Checkbox.Indicator, \"indicator\", { baseComponent: true });\n\nconst InternalCheckboxLabel = withContext(Checkbox.Label, \"label\");\n\ninterface CheckboxLabelProps extends StyledProps, Omit<Checkbox.LabelProps, \"color\">, TextProps {}\n\nexport const CheckboxLabel = ({ textStyle = \"label.medium\", children, ...props }: CheckboxLabelProps) => (\n <InternalCheckboxLabel {...props} asChild>\n <Text textStyle={textStyle}>{children}</Text>\n </InternalCheckboxLabel>\n);\n\nexport const CheckboxControl = withContext(Checkbox.Control, \"control\", { baseComponent: true });\n\nexport const CheckboxGroup = withProvider(Checkbox.Group, \"group\", { baseComponent: true });\n\nexport const CheckboxHiddenInput = Checkbox.HiddenInput;\n"],"mappings":";;;;;;;AAcA,MAAM,iBAAiB,IAAI;CACzB,OAAO,gBAAgB,MAAM;CAC7B,MAAM;EACJ,MAAM;GACJ,YAAY;GACZ,SAAS;GACT,YAAY;GACZ,OAAO;GACP,QAAQ;GACR,WAAW;IACT,OAAO;IACP,QAAQ;IACR,QAAQ,EACN,OAAO,iBACR;IACF;GACF;EACD,OAAO;GACL,SAAS;GACT,KAAK;GACL,eAAe;GAChB;EACD,SAAS;GACP,YAAY;GACZ,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,QAAQ;GACR,OAAO;GACP,QAAQ;GACR,OAAO;GACP,oBAAoB;GACpB,oBAAoB;GACpB,0BAA0B;GAC1B,WAAW,EACT,QAAQ,eACT;GACD,eAAe;IACb,YAAY;IACZ,oBAAoB;IACrB;GACF;EACF;CACD,iBAAiB,EACf,SAAS,YACV;CACD,UAAU,EACR,SAAS;EACP,UAAU;GACR,MAAM;IACJ,KAAK;IACL,QAAQ,EACN,OAAO,eACR;IACD,eAAe;KACb,SAAS;KACT,eAAe;KACf,cAAc;KACd,cAAc;KACf;IACF;GACD,SAAS;IACP,QAAQ;IACR,aAAa;IACb,cAAc;IACd,YAAY;IACZ,QAAQ;KACN,WAAW;KACX,gBAAgB;KACjB;IACD,UAAU;KACR,iBAAiB;KACjB,aAAa;KACb,OAAO;KACR;IACD,WAAW;KACT,aAAa;KACb,QAAQ;MACN,aAAa;MACb,WAAW;MACZ;KACD,UAAU;MACR,YAAY;MACZ,aAAa;MACd;KACF;IACD,UAAU;KACR,aAAa;KACb,UAAU;MACR,OAAO;MACP,aAAa;MACb,iBAAiB;MAClB;KACF;IACF;GACF;EACD,MAAM;GACJ,MAAM;IACJ,OAAO;IACP,OAAO;IACP,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,aAAa;I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