@ndla/primitives 1.0.4-alpha.0 → 1.0.6-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.
@@ -39,12 +39,16 @@
39
39
  "transitionDuration]___[value:normal",
40
40
  "transitionProperty]___[value:transform",
41
41
  "transform]___[value:rotate(180deg)]___[cond:_open",
42
+ "transition]___[value:none]___[cond:_motionReduce",
43
+ "transitionDuration]___[value:0s]___[cond:_motionReduce",
42
44
  "overflow]___[value:hidden",
43
45
  "transitionProperty]___[value:padding-bottom",
44
46
  "paddingBlock]___[value:xsmall",
45
47
  "paddingInline]___[value:small",
46
48
  "animation]___[value:collapse-in]___[cond:_open",
49
+ "animation]___[value:none]___[cond:_open<___>_motionReduce",
47
50
  "animation]___[value:collapse-out]___[cond:_closed",
51
+ "animation]___[value:none]___[cond:_closed<___>_motionReduce",
48
52
  "borderBottomRadius]___[value:xsmall",
49
53
  "borderWidth]___[value:0 1px 1px",
50
54
  "borderStyle]___[value:solid",
@@ -236,6 +240,8 @@
236
240
  "transitionDuration]___[value:normal]___[cond:& svg",
237
241
  "transitionProperty]___[value:transform]___[cond:& svg",
238
242
  "transitionTimingFunction]___[value:default]___[cond:& svg",
243
+ "transition]___[value:none]___[cond:& svg<___>_motionReduce",
244
+ "transitionDuration]___[value:0s]___[cond:& svg<___>_motionReduce",
239
245
  "transform]___[value:rotate(180deg)]___[cond:_open<___>& svg",
240
246
  "color]___[value:stroke.default",
241
247
  "textDecoration]___[value:underline]___[cond:_checked",
@@ -432,6 +438,7 @@
432
438
  "cursor]___[value:default",
433
439
  "pointerEvents]___[value:none",
434
440
  "visibility]___[value:hidden]___[cond:&::before, &::after, *",
441
+ "animation]___[value:none]___[cond:_motionReduce",
435
442
  "background]___[value:surface.disabled",
436
443
  "flex]___[value:1",
437
444
  "width]___[value:4xsmall]___[cond:_vertical",
@@ -448,6 +455,7 @@
448
455
  "borderBlockColor]___[value:background.subtle",
449
456
  "borderInlineStartColor]___[value:background.subtle",
450
457
  "borderInlineEndColor]___[value:stroke.default",
458
+ "animationDuration]___[value:2s]___[cond:_motionReduce",
451
459
  "borderWidth]___[value:4px",
452
460
  "height]___[value:large",
453
461
  "width]___[value:large",
@@ -462,9 +470,11 @@
462
470
  "textStyle]___[value:label.xsmall",
463
471
  "transform]___[value:translateX(20%)]___[cond:_hover",
464
472
  "transform]___[value:translateX(0)]___[cond:_hover<___>_disabled",
473
+ "transform]___[value:translateX(0)]___[cond:_hover<___>_motionReduce",
465
474
  "transform]___[value:translateX(120%)]___[cond:_checked",
466
475
  "transform]___[value:translateX(100%)]___[cond:_checked<___>_hover",
467
476
  "transform]___[value:translateX(120%)]___[cond:_checked<___>_hover<___>_disabled",
477
+ "transform]___[value:translateX(120%)]___[cond:_checked<___>_hover<___>_motionReduce",
468
478
  "transitionProperty]___[value:color",
469
479
  "overflowX]___[value:auto",
470
480
  "padding]___[value:4xsmall",
@@ -553,11 +563,15 @@
553
563
  "transitionProperty]___[value:background, outline-color, color",
554
564
  "backgroundColor]___[value:surface.actionSubtle.hover]___[cond:_hover",
555
565
  "color]___[value:stroke.hover]___[cond:_hover<___>& svg",
566
+ "transition]___[value:none]___[cond:_hover<___>_motionReduce",
567
+ "transitionDuration]___[value:0s]___[cond:_hover<___>_motionReduce",
556
568
  "backgroundColor]___[value:surface.actionSubtle.hover]___[cond:_highlighted",
557
569
  "outlineWidth]___[value:3px]___[cond:_highlighted",
558
570
  "outlineOffset]___[value:-1px]___[cond:_highlighted",
559
571
  "outlineColor]___[value:stroke.hover]___[cond:_highlighted",
560
572
  "color]___[value:stroke.hover]___[cond:_highlighted<___>& svg",
573
+ "transition]___[value:none]___[cond:_highlighted<___>_motionReduce",
574
+ "transitionDuration]___[value:0s]___[cond:_highlighted<___>_motionReduce",
561
575
  "paddingBottom]___[value:1",
562
576
  "display]___[value:inline-block]___[cond:& span",
563
577
  "textStyle]___[value:body.medium",
package/dist/styles.css CHANGED
@@ -2508,5 +2508,68 @@
2508
2508
  .tabletDown\:min-h_100\% {
2509
2509
  min-height: 100%;
2510
2510
  }
2511
+ }
2512
+
2513
+ @media (prefers-reduced-motion: reduce) {
2514
+ .motionReduce\:trs_none {
2515
+ transition: none;
2516
+ }
2517
+ .motionReduce\:anim_none {
2518
+ animation: none;
2519
+ }
2520
+ .motionReduce\:trs-dur_0s {
2521
+ --transition-duration: 0s;
2522
+ transition-duration: 0s;
2523
+ }
2524
+ .motionReduce\:anim-dur_2s {
2525
+ animation-duration: 2s;
2526
+ }
2527
+ }
2528
+
2529
+ @media (prefers-reduced-motion: reduce) {
2530
+ .open\:motionReduce\:anim_none:is([open], [data-open], [data-state="open"]) {
2531
+ animation: none;
2532
+ }
2533
+ }
2534
+
2535
+ @media (prefers-reduced-motion: reduce) {
2536
+ .closed\:motionReduce\:anim_none:is([closed], [data-closed], [data-state="closed"]) {
2537
+ animation: none;
2538
+ }
2539
+ }
2540
+
2541
+ @media (prefers-reduced-motion: reduce) {
2542
+ .\[\&_svg\]\:motionReduce\:trs_none svg,.highlighted\:motionReduce\:trs_none[data-highlighted] {
2543
+ transition: none;
2544
+ }
2545
+ .\[\&_svg\]\:motionReduce\:trs-dur_0s svg,.highlighted\:motionReduce\:trs-dur_0s[data-highlighted] {
2546
+ --transition-duration: 0s;
2547
+ transition-duration: 0s;
2548
+ }
2549
+ }
2550
+
2551
+ @media (prefers-reduced-motion: reduce) {
2552
+ .hover\:motionReduce\:trf_translateX\(0\):is(:hover, [data-hover]) {
2553
+ transform: translateX(0);
2554
+ }
2555
+ }
2556
+
2557
+ @media (prefers-reduced-motion: reduce) {
2558
+ .hover\:motionReduce\:trs_none:is(:hover, [data-hover]) {
2559
+ transition: none;
2560
+ }
2561
+ }
2562
+
2563
+ @media (prefers-reduced-motion: reduce) {
2564
+ .hover\:motionReduce\:trs-dur_0s:is(:hover, [data-hover]) {
2565
+ --transition-duration: 0s;
2566
+ transition-duration: 0s;
2567
+ }
2568
+ }
2569
+
2570
+ @media (prefers-reduced-motion: reduce) {
2571
+ .checked\:hover\:motionReduce\:trf_translateX\(120\%\):is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]):is(:hover, [data-hover]) {
2572
+ transform: translateX(120%);
2573
+ }
2511
2574
  }
2512
2575
  }
package/es/Accordion.js CHANGED
@@ -49,6 +49,10 @@ const accordionRecipe = sva({
49
49
  transitionTimingFunction: "default",
50
50
  _open: {
51
51
  transform: "rotate(180deg)"
52
+ },
53
+ _motionReduce: {
54
+ transition: "none",
55
+ transitionDuration: "0s"
52
56
  }
53
57
  },
54
58
  itemContent: {
@@ -60,10 +64,16 @@ const accordionRecipe = sva({
60
64
  paddingBlock: "xsmall",
61
65
  paddingInline: "small",
62
66
  _open: {
63
- animation: "collapse-in"
67
+ animation: "collapse-in",
68
+ _motionReduce: {
69
+ animation: "none"
70
+ }
64
71
  },
65
72
  _closed: {
66
- animation: "collapse-out"
73
+ animation: "collapse-out",
74
+ _motionReduce: {
75
+ animation: "none"
76
+ }
67
77
  }
68
78
  },
69
79
  item: {
package/es/Button.js CHANGED
@@ -13,6 +13,7 @@ import { styled } from "@ndla/styled-system/jsx";
13
13
  import { Spinner } from "./Spinner";
14
14
 
15
15
  // TODO: Consider if any of the backgrounds should actually be transparent
16
+ // TODO: Figure out sizing for link variant.
16
17
  import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
17
18
  export const buttonBaseRecipe = cva({
18
19
  base: {
@@ -46,6 +47,10 @@ export const buttonBaseRecipe = cva({
46
47
  },
47
48
  _focusVisible: {
48
49
  boxShadow: "inset 0 0 0 3px var(--shadow-color)"
50
+ },
51
+ _motionReduce: {
52
+ transition: "none",
53
+ transitionDuration: "0s"
49
54
  }
50
55
  },
51
56
  defaultVariants: {
package/es/Checkbox.js CHANGED
@@ -43,7 +43,11 @@ const checkboxRecipe = sva({
43
43
  color: "text.strong",
44
44
  transitionDuration: "normal",
45
45
  transitionProperty: "border-color, background, box-shadow, color",
46
- transitionTimingFunction: "default"
46
+ transitionTimingFunction: "default",
47
+ _motionReduce: {
48
+ transition: "none",
49
+ transitionDuration: "0s"
50
+ }
47
51
  }
48
52
  },
49
53
  defaultVariants: {
package/es/Combobox.js CHANGED
@@ -37,10 +37,16 @@ const comboboxRecipe = sva({
37
37
  overflowY: "auto",
38
38
  maxHeight: "surface.xsmall",
39
39
  _open: {
40
- animation: "fade-shift-in 0.25s ease-out"
40
+ animation: "fade-shift-in 0.25s ease-out",
41
+ _motionReduce: {
42
+ animation: "none"
43
+ }
41
44
  },
42
45
  _closed: {
43
- animation: "fade-shift-out 0.25s ease-out"
46
+ animation: "fade-shift-out 0.25s ease-out",
47
+ _motionReduce: {
48
+ animation: "none"
49
+ }
44
50
  }
45
51
  },
46
52
  item: {
@@ -81,7 +87,11 @@ const comboboxRecipe = sva({
81
87
  transformOrigin: "center",
82
88
  transitionDuration: "normal",
83
89
  transitionProperty: "transform",
84
- transitionTimingFunction: "default"
90
+ transitionTimingFunction: "default",
91
+ _motionReduce: {
92
+ transition: "none",
93
+ transitionDuration: "0s"
94
+ }
85
95
  },
86
96
  _open: {
87
97
  "& svg": {
package/es/Dialog.js CHANGED
@@ -26,10 +26,16 @@ const dialogRecipe = sva({
26
26
  // TODO: Consider if this should be a token. It's probably consistent enough between dark and light mode to be a token.
27
27
  background: "rgba(1, 1, 1, 0.3)",
28
28
  _open: {
29
- animation: "backdrop-in"
29
+ animation: "backdrop-in",
30
+ _motionReduce: {
31
+ animation: "none"
32
+ }
30
33
  },
31
34
  _closed: {
32
- animation: "backdrop-out"
35
+ animation: "backdrop-out",
36
+ _motionReduce: {
37
+ animation: "none"
38
+ }
33
39
  }
34
40
  },
35
41
  positioner: {
@@ -83,10 +89,16 @@ const dialogRecipe = sva({
83
89
  maxHeight: "100%",
84
90
  width: "var(--size)",
85
91
  _open: {
86
- animation: "drawer-in-left"
92
+ animation: "drawer-in-left",
93
+ _motionReduce: {
94
+ animation: "none"
95
+ }
87
96
  },
88
97
  _closed: {
89
- animation: "drawer-out-left"
98
+ animation: "drawer-out-left",
99
+ _motionReduce: {
100
+ animation: "none"
101
+ }
90
102
  }
91
103
  }
92
104
  }
@@ -99,10 +111,16 @@ const dialogRecipe = sva({
99
111
  maxHeight: "100%",
100
112
  width: "var(--size)",
101
113
  _open: {
102
- animation: "drawer-in-right"
114
+ animation: "drawer-in-right",
115
+ _motionReduce: {
116
+ animation: "none"
117
+ }
103
118
  },
104
119
  _closed: {
105
- animation: "drawer-out-right"
120
+ animation: "drawer-out-right",
121
+ _motionReduce: {
122
+ animation: "none"
123
+ }
106
124
  }
107
125
  }
108
126
  }
@@ -115,10 +133,16 @@ const dialogRecipe = sva({
115
133
  maxWidth: "100%",
116
134
  height: "var(--size)",
117
135
  _open: {
118
- animation: "drawer-in-top"
136
+ animation: "drawer-in-top",
137
+ _motionReduce: {
138
+ animation: "none"
139
+ }
119
140
  },
120
141
  _closed: {
121
- animation: "drawer-out-top"
142
+ animation: "drawer-out-top",
143
+ _motionReduce: {
144
+ animation: "none"
145
+ }
122
146
  }
123
147
  }
124
148
  }
@@ -131,10 +155,16 @@ const dialogRecipe = sva({
131
155
  maxWidth: "100%",
132
156
  height: "var(--size)",
133
157
  _open: {
134
- animation: "drawer-in-bottom"
158
+ animation: "drawer-in-bottom",
159
+ _motionReduce: {
160
+ animation: "none"
161
+ }
135
162
  },
136
163
  _closed: {
137
- animation: "drawer-out-bottom"
164
+ animation: "drawer-out-bottom",
165
+ _motionReduce: {
166
+ animation: "none"
167
+ }
138
168
  }
139
169
  }
140
170
  }
@@ -186,10 +216,16 @@ const dialogRecipe = sva({
186
216
  content: {
187
217
  width: "var(--size)",
188
218
  _open: {
189
- animation: "dialog-in"
219
+ animation: "dialog-in",
220
+ _motionReduce: {
221
+ animation: "none"
222
+ }
190
223
  },
191
224
  _closed: {
192
- animation: "dialog-out"
225
+ animation: "dialog-out",
226
+ _motionReduce: {
227
+ animation: "none"
228
+ }
193
229
  }
194
230
  }
195
231
  }
package/es/Figure.js CHANGED
@@ -16,7 +16,11 @@ const figureRecipe = cva({
16
16
  position: "relative",
17
17
  transitionDuration: "normal",
18
18
  transitionProperty: "transform, width, height",
19
- transitionTimingFunction: "default"
19
+ transitionTimingFunction: "default",
20
+ _motionReduce: {
21
+ transition: "none",
22
+ transitionDuration: "0s"
23
+ }
20
24
  },
21
25
  variants: {
22
26
  size: {
package/es/Menu.js CHANGED
@@ -108,10 +108,16 @@ const menuRecipe = sva({
108
108
  outline: "none",
109
109
  zIndex: "dropdown",
110
110
  _open: {
111
- animation: "fade-shift-in 0.25s ease-out"
111
+ animation: "fade-shift-in 0.25s ease-out",
112
+ _motionReduce: {
113
+ animation: "none"
114
+ }
112
115
  },
113
116
  _closed: {
114
- animation: "fade-shift-out 0.25s ease-out"
117
+ animation: "fade-shift-out 0.25s ease-out",
118
+ _motionReduce: {
119
+ animation: "none"
120
+ }
115
121
  }
116
122
  },
117
123
  itemGroup: {
package/es/Pagination.js CHANGED
@@ -38,6 +38,7 @@ export const PaginationItem = withContext(Pagination.Item, "item", {
38
38
  export const PaginationEllipsis = withContext(Pagination.Ellipsis, "ellipsis", {
39
39
  baseComponent: true
40
40
  });
41
+ export const PaginationContext = Pagination.Context;
41
42
  export const PaginationPrevTrigger = withContext(Pagination.PrevTrigger, "prevTrigger", {
42
43
  baseComponent: true
43
44
  });
package/es/Popover.js CHANGED
@@ -26,10 +26,16 @@ const popoverRecipe = sva({
26
26
  zIndex: "popover",
27
27
  maxWidth: "var(--available-width)",
28
28
  _open: {
29
- animation: "fade-shift-in 0.2s ease-out"
29
+ animation: "fade-shift-in 0.2s ease-out",
30
+ _motionReduce: {
31
+ animation: "none"
32
+ }
30
33
  },
31
34
  _closed: {
32
- animation: "fade-shift-out 0.2s ease-out"
35
+ animation: "fade-shift-out 0.2s ease-out",
36
+ _motionReduce: {
37
+ animation: "none"
38
+ }
33
39
  }
34
40
  },
35
41
  arrow: {
package/es/RadioGroup.js CHANGED
@@ -57,6 +57,10 @@ const radioGroupRecipe = sva({
57
57
  borderColor: "stroke.disabled",
58
58
  boxShadow: "none"
59
59
  }
60
+ },
61
+ _motionReduce: {
62
+ transition: "none",
63
+ transitionDuration: "0s"
60
64
  }
61
65
  },
62
66
  item: {
package/es/Select.js CHANGED
@@ -40,10 +40,16 @@ const selectRecipe = sva({
40
40
  outlineOffset: "-1"
41
41
  },
42
42
  _open: {
43
- animation: "fade-shift-in 0.25s ease-out"
43
+ animation: "fade-shift-in 0.25s ease-out",
44
+ _motionReduce: {
45
+ animation: "none"
46
+ }
44
47
  },
45
48
  _closed: {
46
- animation: "fade-shift-out 0.25s ease-out"
49
+ animation: "fade-shift-out 0.25s ease-out",
50
+ _motionReduce: {
51
+ animation: "none"
52
+ }
47
53
  }
48
54
  },
49
55
  item: {
@@ -101,6 +107,10 @@ const selectRecipe = sva({
101
107
  transitionTimingFunction: "default",
102
108
  _open: {
103
109
  transform: "rotate(180deg)"
110
+ },
111
+ _motionReduce: {
112
+ transition: "none",
113
+ transitionDuration: "0s"
104
114
  }
105
115
  },
106
116
  itemIndicator: {
package/es/Skeleton.js CHANGED
@@ -20,6 +20,9 @@ export const Skeleton = styled(ark.div, {
20
20
  userSelect: "none",
21
21
  "&::before, &::after, *": {
22
22
  visibility: "hidden"
23
+ },
24
+ _motionReduce: {
25
+ animation: "none"
23
26
  }
24
27
  }
25
28
  }, {
package/es/Slider.js CHANGED
@@ -71,6 +71,10 @@ const sliderRecipe = sva({
71
71
  outline: "3px solid",
72
72
  outlineColor: "surface.action",
73
73
  outlineOffset: "0px"
74
+ },
75
+ _motionReduce: {
76
+ transition: "none",
77
+ transitionDuration: "0s"
74
78
  }
75
79
  }
76
80
  }
package/es/Spinner.js CHANGED
@@ -19,7 +19,10 @@ export const spinnerRecipe = cva({
19
19
  borderStyle: "solid",
20
20
  borderBlockColor: "background.subtle",
21
21
  borderInlineStartColor: "background.subtle",
22
- borderInlineEndColor: "stroke.default"
22
+ borderInlineEndColor: "stroke.default",
23
+ _motionReduce: {
24
+ animationDuration: "2s"
25
+ }
23
26
  },
24
27
  defaultVariants: {
25
28
  size: "large"
package/es/Switch.js CHANGED
@@ -44,6 +44,10 @@ const switchRecipe = sva({
44
44
  _disabled: {
45
45
  background: "surface.disabled",
46
46
  cursor: "not-allowed"
47
+ },
48
+ _motionReduce: {
49
+ transition: "none",
50
+ transitionDuration: "0s"
47
51
  }
48
52
  },
49
53
  thumb: {
@@ -64,6 +68,9 @@ const switchRecipe = sva({
64
68
  transform: "translateX(20%)",
65
69
  _disabled: {
66
70
  transform: "translateX(0)"
71
+ },
72
+ _motionReduce: {
73
+ transform: "translateX(0)"
67
74
  }
68
75
  },
69
76
  _checked: {
@@ -72,6 +79,9 @@ const switchRecipe = sva({
72
79
  transform: "translateX(100%)",
73
80
  _disabled: {
74
81
  transform: "translateX(120%)"
82
+ },
83
+ _motionReduce: {
84
+ transform: "translateX(120%)"
75
85
  }
76
86
  }
77
87
  }
@@ -89,6 +99,10 @@ const switchRecipe = sva({
89
99
  _hover: {
90
100
  color: "text.disabled"
91
101
  }
102
+ },
103
+ _motionReduce: {
104
+ transition: "none",
105
+ transitionDuration: "0s"
92
106
  }
93
107
  }
94
108
  }
package/es/Tabs.js CHANGED
@@ -65,6 +65,10 @@ const tabsRecipe = sva({
65
65
  _hover: {
66
66
  color: "text.subtle"
67
67
  }
68
+ },
69
+ _motionReduce: {
70
+ transition: "none",
71
+ transitionDuration: "0s"
68
72
  }
69
73
  },
70
74
  content: {
package/es/TagsInput.js CHANGED
@@ -52,6 +52,10 @@ const tagsInputRecipe = sva({
52
52
  color: "text.default",
53
53
  "& svg": {
54
54
  color: "stroke.hover"
55
+ },
56
+ _motionReduce: {
57
+ transition: "none",
58
+ transitionDuration: "0s"
55
59
  }
56
60
  },
57
61
  _highlighted: {
@@ -62,6 +66,10 @@ const tagsInputRecipe = sva({
62
66
  color: "text.default",
63
67
  "& svg": {
64
68
  color: "stroke.hover"
69
+ },
70
+ _motionReduce: {
71
+ transition: "none",
72
+ transitionDuration: "0s"
65
73
  }
66
74
  }
67
75
  },
package/es/Toast.js CHANGED
@@ -32,7 +32,11 @@ const toastRecipe = sva({
32
32
  zIndex: "var(--z-index)",
33
33
  transitionDuration: "slow",
34
34
  transitionProperty: "translate, scale, opacity, height",
35
- transitionTimingFunction: "default"
35
+ transitionTimingFunction: "default",
36
+ _motionReduce: {
37
+ transition: "none",
38
+ transitionDuration: "0s"
39
+ }
36
40
  },
37
41
  title: {
38
42
  paddingInlineEnd: "xxlarge"
package/es/Tooltip.js CHANGED
@@ -23,10 +23,16 @@ const tooltipRecipe = sva({
23
23
  "--arrow-size": "spacing.xxsmall",
24
24
  "--arrow-background": "colors.surface.action",
25
25
  _open: {
26
- animation: "fade-shift-in 0.2s ease-out"
26
+ animation: "fade-shift-in 0.2s ease-out",
27
+ _motionReduce: {
28
+ animation: "none"
29
+ }
27
30
  },
28
31
  _closed: {
29
- animation: "fade-shift-out 0.2s ease-out"
32
+ animation: "fade-shift-out 0.2s ease-out",
33
+ _motionReduce: {
34
+ animation: "none"
35
+ }
30
36
  }
31
37
  }
32
38
  }
package/es/index.js CHANGED
@@ -29,7 +29,7 @@ export { ListItemRoot, ListItemHeading, ListItemContent, ListItemImage } from ".
29
29
  export { MenuRoot, MenuContent, MenuItemGroupLabel, MenuItemGroup, MenuItem, MenuPositioner, MenuTriggerItem, MenuTrigger, MenuSeparator, MenuItemText } from "./Menu";
30
30
  export { MessageBox } from "./MessageBox";
31
31
  export { NdlaLogoEn, NdlaLogoNb, NdlaLogoText } from "./NdlaLogo";
32
- export { PaginationRoot, PaginationItem, PaginationEllipsis, PaginationPrevTrigger, PaginationNextTrigger } from "./Pagination";
32
+ export { PaginationRoot, PaginationContext, PaginationItem, PaginationEllipsis, PaginationPrevTrigger, PaginationNextTrigger } from "./Pagination";
33
33
  export { PopoverRoot, PopoverAnchor, PopoverArrowStandalone, PopoverArrow, PopoverArrowTip, PopoverCloseTrigger, PopoverContentStandalone, PopoverContent, PopoverDescription, PopoverIndicator, PopoverPositioner, PopoverTitle, PopoverTrigger } from "./Popover";
34
34
  export { RadioGroupRoot, RadioGroupIndicator, RadioGroupItemControl, RadioGroupItem, RadioGroupItemText, RadioGroupLabel, RadioGroupItemHiddenInput } from "./RadioGroup";
35
35
  export { SelectRoot, SelectClearTrigger, SelectContent, SelectControl, SelectIndicator, SelectItemGroupLabel, SelectItemGroup, SelectItemIndicator, SelectItem, SelectItemText, SelectLabel, SelectPositioner, SelectTrigger, SelectValueText, SelectList } from "./Select";
package/lib/Accordion.js CHANGED
@@ -55,6 +55,10 @@ const accordionRecipe = (0, _css.sva)({
55
55
  transitionTimingFunction: "default",
56
56
  _open: {
57
57
  transform: "rotate(180deg)"
58
+ },
59
+ _motionReduce: {
60
+ transition: "none",
61
+ transitionDuration: "0s"
58
62
  }
59
63
  },
60
64
  itemContent: {
@@ -66,10 +70,16 @@ const accordionRecipe = (0, _css.sva)({
66
70
  paddingBlock: "xsmall",
67
71
  paddingInline: "small",
68
72
  _open: {
69
- animation: "collapse-in"
73
+ animation: "collapse-in",
74
+ _motionReduce: {
75
+ animation: "none"
76
+ }
70
77
  },
71
78
  _closed: {
72
- animation: "collapse-out"
79
+ animation: "collapse-out",
80
+ _motionReduce: {
81
+ animation: "none"
82
+ }
73
83
  }
74
84
  },
75
85
  item: {
package/lib/Button.js CHANGED
@@ -19,6 +19,7 @@ var _jsxRuntime = require("react/jsx-runtime");
19
19
  */
20
20
 
21
21
  // TODO: Consider if any of the backgrounds should actually be transparent
22
+ // TODO: Figure out sizing for link variant.
22
23
  const buttonBaseRecipe = exports.buttonBaseRecipe = (0, _css.cva)({
23
24
  base: {
24
25
  display: "inline-flex",
@@ -51,6 +52,10 @@ const buttonBaseRecipe = exports.buttonBaseRecipe = (0, _css.cva)({
51
52
  },
52
53
  _focusVisible: {
53
54
  boxShadow: "inset 0 0 0 3px var(--shadow-color)"
55
+ },
56
+ _motionReduce: {
57
+ transition: "none",
58
+ transitionDuration: "0s"
54
59
  }
55
60
  },
56
61
  defaultVariants: {
package/lib/Checkbox.js CHANGED
@@ -49,7 +49,11 @@ const checkboxRecipe = (0, _css.sva)({
49
49
  color: "text.strong",
50
50
  transitionDuration: "normal",
51
51
  transitionProperty: "border-color, background, box-shadow, color",
52
- transitionTimingFunction: "default"
52
+ transitionTimingFunction: "default",
53
+ _motionReduce: {
54
+ transition: "none",
55
+ transitionDuration: "0s"
56
+ }
53
57
  }
54
58
  },
55
59
  defaultVariants: {
package/lib/Combobox.js CHANGED
@@ -43,10 +43,16 @@ const comboboxRecipe = (0, _css.sva)({
43
43
  overflowY: "auto",
44
44
  maxHeight: "surface.xsmall",
45
45
  _open: {
46
- animation: "fade-shift-in 0.25s ease-out"
46
+ animation: "fade-shift-in 0.25s ease-out",
47
+ _motionReduce: {
48
+ animation: "none"
49
+ }
47
50
  },
48
51
  _closed: {
49
- animation: "fade-shift-out 0.25s ease-out"
52
+ animation: "fade-shift-out 0.25s ease-out",
53
+ _motionReduce: {
54
+ animation: "none"
55
+ }
50
56
  }
51
57
  },
52
58
  item: {
@@ -87,7 +93,11 @@ const comboboxRecipe = (0, _css.sva)({
87
93
  transformOrigin: "center",
88
94
  transitionDuration: "normal",
89
95
  transitionProperty: "transform",
90
- transitionTimingFunction: "default"
96
+ transitionTimingFunction: "default",
97
+ _motionReduce: {
98
+ transition: "none",
99
+ transitionDuration: "0s"
100
+ }
91
101
  },
92
102
  _open: {
93
103
  "& svg": {
package/lib/Dialog.d.ts CHANGED
@@ -25,9 +25,15 @@ declare const dialogRecipe: import("@ndla/styled-system/types").SlotRecipeRuntim
25
25
  width: "var(--size)";
26
26
  _open: {
27
27
  animation: "dialog-in";
28
+ _motionReduce: {
29
+ animation: "none";
30
+ };
28
31
  };
29
32
  _closed: {
30
33
  animation: "dialog-out";
34
+ _motionReduce: {
35
+ animation: "none";
36
+ };
31
37
  };
32
38
  };
33
39
  };
package/lib/Dialog.js CHANGED
@@ -32,10 +32,16 @@ const dialogRecipe = (0, _css.sva)({
32
32
  // TODO: Consider if this should be a token. It's probably consistent enough between dark and light mode to be a token.
33
33
  background: "rgba(1, 1, 1, 0.3)",
34
34
  _open: {
35
- animation: "backdrop-in"
35
+ animation: "backdrop-in",
36
+ _motionReduce: {
37
+ animation: "none"
38
+ }
36
39
  },
37
40
  _closed: {
38
- animation: "backdrop-out"
41
+ animation: "backdrop-out",
42
+ _motionReduce: {
43
+ animation: "none"
44
+ }
39
45
  }
40
46
  },
41
47
  positioner: {
@@ -89,10 +95,16 @@ const dialogRecipe = (0, _css.sva)({
89
95
  maxHeight: "100%",
90
96
  width: "var(--size)",
91
97
  _open: {
92
- animation: "drawer-in-left"
98
+ animation: "drawer-in-left",
99
+ _motionReduce: {
100
+ animation: "none"
101
+ }
93
102
  },
94
103
  _closed: {
95
- animation: "drawer-out-left"
104
+ animation: "drawer-out-left",
105
+ _motionReduce: {
106
+ animation: "none"
107
+ }
96
108
  }
97
109
  }
98
110
  }
@@ -105,10 +117,16 @@ const dialogRecipe = (0, _css.sva)({
105
117
  maxHeight: "100%",
106
118
  width: "var(--size)",
107
119
  _open: {
108
- animation: "drawer-in-right"
120
+ animation: "drawer-in-right",
121
+ _motionReduce: {
122
+ animation: "none"
123
+ }
109
124
  },
110
125
  _closed: {
111
- animation: "drawer-out-right"
126
+ animation: "drawer-out-right",
127
+ _motionReduce: {
128
+ animation: "none"
129
+ }
112
130
  }
113
131
  }
114
132
  }
@@ -121,10 +139,16 @@ const dialogRecipe = (0, _css.sva)({
121
139
  maxWidth: "100%",
122
140
  height: "var(--size)",
123
141
  _open: {
124
- animation: "drawer-in-top"
142
+ animation: "drawer-in-top",
143
+ _motionReduce: {
144
+ animation: "none"
145
+ }
125
146
  },
126
147
  _closed: {
127
- animation: "drawer-out-top"
148
+ animation: "drawer-out-top",
149
+ _motionReduce: {
150
+ animation: "none"
151
+ }
128
152
  }
129
153
  }
130
154
  }
@@ -137,10 +161,16 @@ const dialogRecipe = (0, _css.sva)({
137
161
  maxWidth: "100%",
138
162
  height: "var(--size)",
139
163
  _open: {
140
- animation: "drawer-in-bottom"
164
+ animation: "drawer-in-bottom",
165
+ _motionReduce: {
166
+ animation: "none"
167
+ }
141
168
  },
142
169
  _closed: {
143
- animation: "drawer-out-bottom"
170
+ animation: "drawer-out-bottom",
171
+ _motionReduce: {
172
+ animation: "none"
173
+ }
144
174
  }
145
175
  }
146
176
  }
@@ -192,10 +222,16 @@ const dialogRecipe = (0, _css.sva)({
192
222
  content: {
193
223
  width: "var(--size)",
194
224
  _open: {
195
- animation: "dialog-in"
225
+ animation: "dialog-in",
226
+ _motionReduce: {
227
+ animation: "none"
228
+ }
196
229
  },
197
230
  _closed: {
198
- animation: "dialog-out"
231
+ animation: "dialog-out",
232
+ _motionReduce: {
233
+ animation: "none"
234
+ }
199
235
  }
200
236
  }
201
237
  }
package/lib/Figure.js CHANGED
@@ -22,7 +22,11 @@ const figureRecipe = (0, _css.cva)({
22
22
  position: "relative",
23
23
  transitionDuration: "normal",
24
24
  transitionProperty: "transform, width, height",
25
- transitionTimingFunction: "default"
25
+ transitionTimingFunction: "default",
26
+ _motionReduce: {
27
+ transition: "none",
28
+ transitionDuration: "0s"
29
+ }
26
30
  },
27
31
  variants: {
28
32
  size: {
package/lib/Menu.js CHANGED
@@ -114,10 +114,16 @@ const menuRecipe = (0, _css.sva)({
114
114
  outline: "none",
115
115
  zIndex: "dropdown",
116
116
  _open: {
117
- animation: "fade-shift-in 0.25s ease-out"
117
+ animation: "fade-shift-in 0.25s ease-out",
118
+ _motionReduce: {
119
+ animation: "none"
120
+ }
118
121
  },
119
122
  _closed: {
120
- animation: "fade-shift-out 0.25s ease-out"
123
+ animation: "fade-shift-out 0.25s ease-out",
124
+ _motionReduce: {
125
+ animation: "none"
126
+ }
121
127
  }
122
128
  },
123
129
  itemGroup: {
@@ -20,6 +20,7 @@ export declare const PaginationItem: import("react").ForwardRefExoticComponent<{
20
20
  export declare const PaginationEllipsis: import("react").ForwardRefExoticComponent<{
21
21
  consumeCss?: boolean | undefined;
22
22
  } & import("@ndla/styled-system/types").WithCss & Pagination.EllipsisProps & import("react").RefAttributes<HTMLDivElement>>;
23
+ export declare const PaginationContext: (props: Pagination.ContextProps) => import("react").ReactNode;
23
24
  export declare const PaginationPrevTrigger: import("react").ForwardRefExoticComponent<{
24
25
  consumeCss?: boolean | undefined;
25
26
  } & import("@ndla/styled-system/types").WithCss & Pagination.PrevTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
package/lib/Pagination.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.PaginationRoot = exports.PaginationPrevTrigger = exports.PaginationNextTrigger = exports.PaginationItem = exports.PaginationEllipsis = void 0;
6
+ exports.PaginationRoot = exports.PaginationPrevTrigger = exports.PaginationNextTrigger = exports.PaginationItem = exports.PaginationEllipsis = exports.PaginationContext = void 0;
7
7
  var _react = require("@ark-ui/react");
8
8
  var _css = require("@ndla/styled-system/css");
9
9
  var _createStyleContext = require("./createStyleContext");
@@ -44,6 +44,7 @@ const PaginationItem = exports.PaginationItem = withContext(_react.Pagination.It
44
44
  const PaginationEllipsis = exports.PaginationEllipsis = withContext(_react.Pagination.Ellipsis, "ellipsis", {
45
45
  baseComponent: true
46
46
  });
47
+ const PaginationContext = exports.PaginationContext = _react.Pagination.Context;
47
48
  const PaginationPrevTrigger = exports.PaginationPrevTrigger = withContext(_react.Pagination.PrevTrigger, "prevTrigger", {
48
49
  baseComponent: true
49
50
  });
package/lib/Popover.js CHANGED
@@ -32,10 +32,16 @@ const popoverRecipe = (0, _css.sva)({
32
32
  zIndex: "popover",
33
33
  maxWidth: "var(--available-width)",
34
34
  _open: {
35
- animation: "fade-shift-in 0.2s ease-out"
35
+ animation: "fade-shift-in 0.2s ease-out",
36
+ _motionReduce: {
37
+ animation: "none"
38
+ }
36
39
  },
37
40
  _closed: {
38
- animation: "fade-shift-out 0.2s ease-out"
41
+ animation: "fade-shift-out 0.2s ease-out",
42
+ _motionReduce: {
43
+ animation: "none"
44
+ }
39
45
  }
40
46
  },
41
47
  arrow: {
package/lib/RadioGroup.js CHANGED
@@ -63,6 +63,10 @@ const radioGroupRecipe = (0, _css.sva)({
63
63
  borderColor: "stroke.disabled",
64
64
  boxShadow: "none"
65
65
  }
66
+ },
67
+ _motionReduce: {
68
+ transition: "none",
69
+ transitionDuration: "0s"
66
70
  }
67
71
  },
68
72
  item: {
package/lib/Select.js CHANGED
@@ -46,10 +46,16 @@ const selectRecipe = (0, _css.sva)({
46
46
  outlineOffset: "-1"
47
47
  },
48
48
  _open: {
49
- animation: "fade-shift-in 0.25s ease-out"
49
+ animation: "fade-shift-in 0.25s ease-out",
50
+ _motionReduce: {
51
+ animation: "none"
52
+ }
50
53
  },
51
54
  _closed: {
52
- animation: "fade-shift-out 0.25s ease-out"
55
+ animation: "fade-shift-out 0.25s ease-out",
56
+ _motionReduce: {
57
+ animation: "none"
58
+ }
53
59
  }
54
60
  },
55
61
  item: {
@@ -107,6 +113,10 @@ const selectRecipe = (0, _css.sva)({
107
113
  transitionTimingFunction: "default",
108
114
  _open: {
109
115
  transform: "rotate(180deg)"
116
+ },
117
+ _motionReduce: {
118
+ transition: "none",
119
+ transitionDuration: "0s"
110
120
  }
111
121
  },
112
122
  itemIndicator: {
package/lib/Skeleton.js CHANGED
@@ -26,6 +26,9 @@ const Skeleton = exports.Skeleton = (0, _jsx.styled)(_react.ark.div, {
26
26
  userSelect: "none",
27
27
  "&::before, &::after, *": {
28
28
  visibility: "hidden"
29
+ },
30
+ _motionReduce: {
31
+ animation: "none"
29
32
  }
30
33
  }
31
34
  }, {
package/lib/Slider.js CHANGED
@@ -77,6 +77,10 @@ const sliderRecipe = (0, _css.sva)({
77
77
  outline: "3px solid",
78
78
  outlineColor: "surface.action",
79
79
  outlineOffset: "0px"
80
+ },
81
+ _motionReduce: {
82
+ transition: "none",
83
+ transitionDuration: "0s"
80
84
  }
81
85
  }
82
86
  }
package/lib/Spinner.js CHANGED
@@ -25,7 +25,10 @@ const spinnerRecipe = exports.spinnerRecipe = (0, _css.cva)({
25
25
  borderStyle: "solid",
26
26
  borderBlockColor: "background.subtle",
27
27
  borderInlineStartColor: "background.subtle",
28
- borderInlineEndColor: "stroke.default"
28
+ borderInlineEndColor: "stroke.default",
29
+ _motionReduce: {
30
+ animationDuration: "2s"
31
+ }
29
32
  },
30
33
  defaultVariants: {
31
34
  size: "large"
package/lib/Switch.js CHANGED
@@ -50,6 +50,10 @@ const switchRecipe = (0, _css.sva)({
50
50
  _disabled: {
51
51
  background: "surface.disabled",
52
52
  cursor: "not-allowed"
53
+ },
54
+ _motionReduce: {
55
+ transition: "none",
56
+ transitionDuration: "0s"
53
57
  }
54
58
  },
55
59
  thumb: {
@@ -70,6 +74,9 @@ const switchRecipe = (0, _css.sva)({
70
74
  transform: "translateX(20%)",
71
75
  _disabled: {
72
76
  transform: "translateX(0)"
77
+ },
78
+ _motionReduce: {
79
+ transform: "translateX(0)"
73
80
  }
74
81
  },
75
82
  _checked: {
@@ -78,6 +85,9 @@ const switchRecipe = (0, _css.sva)({
78
85
  transform: "translateX(100%)",
79
86
  _disabled: {
80
87
  transform: "translateX(120%)"
88
+ },
89
+ _motionReduce: {
90
+ transform: "translateX(120%)"
81
91
  }
82
92
  }
83
93
  }
@@ -95,6 +105,10 @@ const switchRecipe = (0, _css.sva)({
95
105
  _hover: {
96
106
  color: "text.disabled"
97
107
  }
108
+ },
109
+ _motionReduce: {
110
+ transition: "none",
111
+ transitionDuration: "0s"
98
112
  }
99
113
  }
100
114
  }
package/lib/Tabs.js CHANGED
@@ -71,6 +71,10 @@ const tabsRecipe = (0, _css.sva)({
71
71
  _hover: {
72
72
  color: "text.subtle"
73
73
  }
74
+ },
75
+ _motionReduce: {
76
+ transition: "none",
77
+ transitionDuration: "0s"
74
78
  }
75
79
  },
76
80
  content: {
package/lib/TagsInput.js CHANGED
@@ -58,6 +58,10 @@ const tagsInputRecipe = (0, _css.sva)({
58
58
  color: "text.default",
59
59
  "& svg": {
60
60
  color: "stroke.hover"
61
+ },
62
+ _motionReduce: {
63
+ transition: "none",
64
+ transitionDuration: "0s"
61
65
  }
62
66
  },
63
67
  _highlighted: {
@@ -68,6 +72,10 @@ const tagsInputRecipe = (0, _css.sva)({
68
72
  color: "text.default",
69
73
  "& svg": {
70
74
  color: "stroke.hover"
75
+ },
76
+ _motionReduce: {
77
+ transition: "none",
78
+ transitionDuration: "0s"
71
79
  }
72
80
  }
73
81
  },
package/lib/Toast.js CHANGED
@@ -38,7 +38,11 @@ const toastRecipe = (0, _css.sva)({
38
38
  zIndex: "var(--z-index)",
39
39
  transitionDuration: "slow",
40
40
  transitionProperty: "translate, scale, opacity, height",
41
- transitionTimingFunction: "default"
41
+ transitionTimingFunction: "default",
42
+ _motionReduce: {
43
+ transition: "none",
44
+ transitionDuration: "0s"
45
+ }
42
46
  },
43
47
  title: {
44
48
  paddingInlineEnd: "xxlarge"
package/lib/Tooltip.js CHANGED
@@ -29,10 +29,16 @@ const tooltipRecipe = (0, _css.sva)({
29
29
  "--arrow-size": "spacing.xxsmall",
30
30
  "--arrow-background": "colors.surface.action",
31
31
  _open: {
32
- animation: "fade-shift-in 0.2s ease-out"
32
+ animation: "fade-shift-in 0.2s ease-out",
33
+ _motionReduce: {
34
+ animation: "none"
35
+ }
33
36
  },
34
37
  _closed: {
35
- animation: "fade-shift-out 0.2s ease-out"
38
+ animation: "fade-shift-out 0.2s ease-out",
39
+ _motionReduce: {
40
+ animation: "none"
41
+ }
36
42
  }
37
43
  }
38
44
  }
package/lib/index.d.ts CHANGED
@@ -47,7 +47,7 @@ export { MessageBox } from "./MessageBox";
47
47
  export type { LogoProps } from "./NdlaLogo";
48
48
  export { NdlaLogoEn, NdlaLogoNb, NdlaLogoText } from "./NdlaLogo";
49
49
  export type { PaginationRootProps } from "./Pagination";
50
- export { PaginationRoot, PaginationItem, PaginationEllipsis, PaginationPrevTrigger, PaginationNextTrigger, } from "./Pagination";
50
+ export { PaginationRoot, PaginationContext, PaginationItem, PaginationEllipsis, PaginationPrevTrigger, PaginationNextTrigger, } from "./Pagination";
51
51
  export type { PopoverRootProps } from "./Popover";
52
52
  export { PopoverRoot, PopoverAnchor, PopoverArrowStandalone, PopoverArrow, PopoverArrowTip, PopoverCloseTrigger, PopoverContentStandalone, PopoverContent, PopoverDescription, PopoverIndicator, PopoverPositioner, PopoverTitle, PopoverTrigger, } from "./Popover";
53
53
  export type { RadioGroupRootProps } from "./RadioGroup";
package/lib/index.js CHANGED
@@ -531,6 +531,12 @@ Object.defineProperty(exports, "OrderedList", {
531
531
  return _ArticleLists.OrderedList;
532
532
  }
533
533
  });
534
+ Object.defineProperty(exports, "PaginationContext", {
535
+ enumerable: true,
536
+ get: function () {
537
+ return _Pagination.PaginationContext;
538
+ }
539
+ });
534
540
  Object.defineProperty(exports, "PaginationEllipsis", {
535
541
  enumerable: true,
536
542
  get: function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/primitives",
3
- "version": "1.0.4-alpha.0",
3
+ "version": "1.0.6-alpha.0",
4
4
  "description": "Primitive components for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -33,7 +33,7 @@
33
33
  "@ndla/util": "^4.1.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@ndla/preset-panda": "^0.0.15",
36
+ "@ndla/preset-panda": "^0.0.16",
37
37
  "@pandacss/dev": "^0.44.0"
38
38
  },
39
39
  "peerDependencies": {
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "0fdd094fea36baa5ee2bdfe5b2bc6c423d304f22"
46
+ "gitHead": "7770121967e96fe8d661b0f540e3397d6e2c453f"
47
47
  }