@ndla/ui 56.0.40-alpha.0 → 56.0.42-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/panda.buildinfo.json +3 -3
- package/dist/styles.css +8 -8
- package/es/AudioPlayer/Controls.js +6 -3
- package/es/Embed/UuDisclaimerEmbed.js +10 -1
- package/es/locale/messages-en.js +1 -1
- package/es/locale/messages-nb.js +1 -1
- package/es/locale/messages-nn.js +1 -1
- package/es/locale/messages-se.js +1 -1
- package/es/locale/messages-sma.js +1 -1
- package/lib/AudioPlayer/Controls.js +6 -3
- package/lib/Embed/UuDisclaimerEmbed.js +10 -1
- package/lib/TagSelector/TagSelector.d.ts +3 -3
- package/lib/i18n/useComponentTranslations.d.ts +2 -3
- package/lib/index.d.ts +1 -1
- package/lib/locale/messages-en.js +1 -1
- package/lib/locale/messages-nb.js +1 -1
- package/lib/locale/messages-nn.js +1 -1
- package/lib/locale/messages-se.js +1 -1
- package/lib/locale/messages-sma.js +1 -1
- package/package.json +4 -4
- package/src/AudioPlayer/Controls.tsx +4 -4
- package/src/Embed/UuDisclaimerEmbed.tsx +9 -0
- package/src/TagSelector/TagSelector.stories.tsx +4 -2
- package/src/TagSelector/TagSelector.tsx +3 -3
- package/src/i18n/useComponentTranslations.ts +3 -3
- package/src/index.ts +1 -1
- package/src/locale/messages-en.ts +1 -1
- package/src/locale/messages-nb.ts +1 -1
- package/src/locale/messages-nn.ts +1 -1
- package/src/locale/messages-se.ts +1 -1
- package/src/locale/messages-sma.ts +1 -1
|
@@ -298,6 +298,9 @@
|
|
|
298
298
|
"outlineOffset]___[value:3px]___[cond:_focusVisible<___>_after",
|
|
299
299
|
"outlineStyle]___[value:solid]___[cond:_focusVisible<___>_after",
|
|
300
300
|
"paddingInlineStart]___[value:4xsmall",
|
|
301
|
+
"color]___[value:text.link",
|
|
302
|
+
"whiteSpace]___[value:nowrap",
|
|
303
|
+
"textDecoration]___[value:none]___[cond:_focusWithin",
|
|
301
304
|
"textAlign]___[value:center",
|
|
302
305
|
"color]___[value:text.strong]___[cond:& a",
|
|
303
306
|
"marginTop]___[value:0]___[cond:& h1",
|
|
@@ -412,9 +415,6 @@
|
|
|
412
415
|
"whiteSpace]___[value:pre-wrap]___[cond:mobileWideDown<___>_open",
|
|
413
416
|
"maxHeight]___[value:none]___[cond:mobileWideDown<___>_open",
|
|
414
417
|
"display]___[value:none]___[cond:mobileWide",
|
|
415
|
-
"color]___[value:text.link",
|
|
416
|
-
"whiteSpace]___[value:nowrap",
|
|
417
|
-
"textDecoration]___[value:none]___[cond:_focusWithin",
|
|
418
418
|
"display]___[value:none]___[cond:mobileWideDown<___>_disabled",
|
|
419
419
|
"textDecoration]___[value:underline]___[cond:& h3",
|
|
420
420
|
"transitionProperty]___[value:width, height]___[cond:& [data-forward]",
|
package/dist/styles.css
CHANGED
|
@@ -550,6 +550,14 @@
|
|
|
550
550
|
padding-inline-start: var(--spacing-4xsmall);
|
|
551
551
|
}
|
|
552
552
|
|
|
553
|
+
.c_text\.link {
|
|
554
|
+
color: var(--colors-text-link);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.white-space_nowrap {
|
|
558
|
+
white-space: nowrap;
|
|
559
|
+
}
|
|
560
|
+
|
|
553
561
|
.ta_center {
|
|
554
562
|
text-align: center;
|
|
555
563
|
}
|
|
@@ -626,14 +634,6 @@
|
|
|
626
634
|
white-space: pre-wrap;
|
|
627
635
|
}
|
|
628
636
|
|
|
629
|
-
.c_text\.link {
|
|
630
|
-
color: var(--colors-text-link);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
.white-space_nowrap {
|
|
634
|
-
white-space: nowrap;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
637
|
.c_icon\.strong {
|
|
638
638
|
color: var(--colors-icon-strong);
|
|
639
639
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useEffect, useRef, useState } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
+
import { createListCollection } from "@ark-ui/react";
|
|
11
12
|
import { Replay15Line, Forward15Line } from "@ndla/icons/action";
|
|
12
13
|
import { PlayFill, PauseLine, VolumeUpFill } from "@ndla/icons/common";
|
|
13
14
|
import { CheckLine } from "@ndla/icons/editor";
|
|
@@ -115,7 +116,9 @@ const formatTime = seconds => {
|
|
|
115
116
|
const formattedSeconds = currentSeconds < 10 ? `0${currentSeconds}` : currentSeconds;
|
|
116
117
|
return `${minutes}:${formattedSeconds}`;
|
|
117
118
|
};
|
|
118
|
-
const speedValues =
|
|
119
|
+
const speedValues = createListCollection({
|
|
120
|
+
items: ["0.5", "0.75", "1", "1.25", "1.5", "1.75", "2"]
|
|
121
|
+
});
|
|
119
122
|
const Controls = _ref => {
|
|
120
123
|
let {
|
|
121
124
|
src,
|
|
@@ -253,7 +256,7 @@ const Controls = _ref => {
|
|
|
253
256
|
})
|
|
254
257
|
})]
|
|
255
258
|
}), /*#__PURE__*/_jsxs(StyledSelectRoot, {
|
|
256
|
-
|
|
259
|
+
collection: speedValues,
|
|
257
260
|
value: [speedValue.toString()],
|
|
258
261
|
onValueChange: details => setSpeedValue(parseFloat(details.value[0])),
|
|
259
262
|
positioning: {
|
|
@@ -276,7 +279,7 @@ const Controls = _ref => {
|
|
|
276
279
|
})
|
|
277
280
|
}), /*#__PURE__*/_jsx(SelectPositioner, {
|
|
278
281
|
children: /*#__PURE__*/_jsx(SelectContent, {
|
|
279
|
-
children: speedValues.map(speed => /*#__PURE__*/_jsxs(SelectItem, {
|
|
282
|
+
children: speedValues.items.map(speed => /*#__PURE__*/_jsxs(SelectItem, {
|
|
280
283
|
item: speed,
|
|
281
284
|
children: [/*#__PURE__*/_jsxs(SelectItemText, {
|
|
282
285
|
children: [speed, "x"]
|
|
@@ -25,7 +25,16 @@ const Disclaimer = styled("div", {
|
|
|
25
25
|
});
|
|
26
26
|
const StyledSafeLink = styled(SafeLink, {
|
|
27
27
|
base: {
|
|
28
|
-
paddingInlineStart: "4xsmall"
|
|
28
|
+
paddingInlineStart: "4xsmall",
|
|
29
|
+
color: "text.link",
|
|
30
|
+
textDecoration: "underline",
|
|
31
|
+
whiteSpace: "nowrap",
|
|
32
|
+
_hover: {
|
|
33
|
+
textDecoration: "none"
|
|
34
|
+
},
|
|
35
|
+
_focusWithin: {
|
|
36
|
+
textDecoration: "none"
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
});
|
|
31
40
|
const UuDisclaimerEmbed = _ref => {
|
package/es/locale/messages-en.js
CHANGED
|
@@ -1074,7 +1074,7 @@ const messages = {
|
|
|
1074
1074
|
fetchMore: "Fetch more answers",
|
|
1075
1075
|
deleted: "This post has been deleted by the author.",
|
|
1076
1076
|
upvote: "Like",
|
|
1077
|
-
numberOfUpvotes: "{{ count }} people have
|
|
1077
|
+
numberOfUpvotes: "{{ count }} people have liked this post.",
|
|
1078
1078
|
removeUpvote: "Stop liking",
|
|
1079
1079
|
reply: "Write a reply to {{ name }}"
|
|
1080
1080
|
},
|
package/es/locale/messages-nb.js
CHANGED
|
@@ -1074,7 +1074,7 @@ const messages = {
|
|
|
1074
1074
|
fetchMore: "Hent flere svar",
|
|
1075
1075
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1076
1076
|
upvote: "Liker",
|
|
1077
|
-
numberOfUpvotes: "{{ count }} personer har
|
|
1077
|
+
numberOfUpvotes: "{{ count }} personer har likt innlegget.",
|
|
1078
1078
|
removeUpvote: "Slutt å like",
|
|
1079
1079
|
reply: "Skriv et svar til {{ name }}"
|
|
1080
1080
|
},
|
package/es/locale/messages-nn.js
CHANGED
|
@@ -1074,7 +1074,7 @@ const messages = {
|
|
|
1074
1074
|
fetchMore: "Hent fleire svar",
|
|
1075
1075
|
deleted: "Dette innlegget er sletta av forfatteren.",
|
|
1076
1076
|
upvote: "Liker",
|
|
1077
|
-
numberOfUpvotes: "{{ count }} personar har
|
|
1077
|
+
numberOfUpvotes: "{{ count }} personar har likt innlegget.",
|
|
1078
1078
|
removeUpvote: "Slutt å like",
|
|
1079
1079
|
reply: "Skriv eit svar til {{ name }}"
|
|
1080
1080
|
},
|
package/es/locale/messages-se.js
CHANGED
|
@@ -1074,7 +1074,7 @@ const messages = {
|
|
|
1074
1074
|
fetchMore: "Hent flere svar",
|
|
1075
1075
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1076
1076
|
upvote: "Liker",
|
|
1077
|
-
numberOfUpvotes: "{{ count }} personer har
|
|
1077
|
+
numberOfUpvotes: "{{ count }} personer har likt innlegget.",
|
|
1078
1078
|
removeUpvote: "Slutt å like",
|
|
1079
1079
|
reply: "Skriv et svar til {{ name }}"
|
|
1080
1080
|
},
|
|
@@ -1074,7 +1074,7 @@ const messages = {
|
|
|
1074
1074
|
fetchMore: "Hent flere svar",
|
|
1075
1075
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1076
1076
|
upvote: "Liker",
|
|
1077
|
-
numberOfUpvotes: "{{ count }} personer har
|
|
1077
|
+
numberOfUpvotes: "{{ count }} personer har likt innlegget.",
|
|
1078
1078
|
removeUpvote: "Slutt å like",
|
|
1079
1079
|
reply: "Skriv et svar til {{ name }}"
|
|
1080
1080
|
},
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactI18next = require("react-i18next");
|
|
9
|
+
var _react2 = require("@ark-ui/react");
|
|
9
10
|
var _action = require("@ndla/icons/action");
|
|
10
11
|
var _common = require("@ndla/icons/common");
|
|
11
12
|
var _editor = require("@ndla/icons/editor");
|
|
@@ -121,7 +122,9 @@ const formatTime = seconds => {
|
|
|
121
122
|
const formattedSeconds = currentSeconds < 10 ? `0${currentSeconds}` : currentSeconds;
|
|
122
123
|
return `${minutes}:${formattedSeconds}`;
|
|
123
124
|
};
|
|
124
|
-
const speedValues =
|
|
125
|
+
const speedValues = (0, _react2.createListCollection)({
|
|
126
|
+
items: ["0.5", "0.75", "1", "1.25", "1.5", "1.75", "2"]
|
|
127
|
+
});
|
|
125
128
|
const Controls = _ref => {
|
|
126
129
|
let {
|
|
127
130
|
src,
|
|
@@ -259,7 +262,7 @@ const Controls = _ref => {
|
|
|
259
262
|
})
|
|
260
263
|
})]
|
|
261
264
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledSelectRoot, {
|
|
262
|
-
|
|
265
|
+
collection: speedValues,
|
|
263
266
|
value: [speedValue.toString()],
|
|
264
267
|
onValueChange: details => setSpeedValue(parseFloat(details.value[0])),
|
|
265
268
|
positioning: {
|
|
@@ -282,7 +285,7 @@ const Controls = _ref => {
|
|
|
282
285
|
})
|
|
283
286
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.SelectPositioner, {
|
|
284
287
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.SelectContent, {
|
|
285
|
-
children: speedValues.map(speed => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.SelectItem, {
|
|
288
|
+
children: speedValues.items.map(speed => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.SelectItem, {
|
|
286
289
|
item: speed,
|
|
287
290
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.SelectItemText, {
|
|
288
291
|
children: [speed, "x"]
|
|
@@ -31,7 +31,16 @@ const Disclaimer = (0, _jsx2.styled)("div", {
|
|
|
31
31
|
});
|
|
32
32
|
const StyledSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
|
|
33
33
|
base: {
|
|
34
|
-
paddingInlineStart: "4xsmall"
|
|
34
|
+
paddingInlineStart: "4xsmall",
|
|
35
|
+
color: "text.link",
|
|
36
|
+
textDecoration: "underline",
|
|
37
|
+
whiteSpace: "nowrap",
|
|
38
|
+
_hover: {
|
|
39
|
+
textDecoration: "none"
|
|
40
|
+
},
|
|
41
|
+
_focusWithin: {
|
|
42
|
+
textDecoration: "none"
|
|
43
|
+
}
|
|
35
44
|
}
|
|
36
45
|
});
|
|
37
46
|
const UuDisclaimerEmbed = _ref => {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
/// <reference types="react" />
|
|
9
|
-
import type {
|
|
9
|
+
import type { CollectionItem } from "@ark-ui/react";
|
|
10
10
|
import { ComboboxControlProps, ComboboxInputProps, ComboboxRootProps, TagsInputControlProps, TagsInputInputProps, TagsInputRootProps } from "@ndla/primitives";
|
|
11
|
-
export type TagSelectorRootProps<T extends
|
|
12
|
-
export declare const TagSelectorRoot: <T extends
|
|
11
|
+
export type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;
|
|
12
|
+
export declare const TagSelectorRoot: <T extends unknown>({ allowCustomValue, multiple, selectionBehavior, editable, addOnPaste, onValueChange, children, value, translations, ...rest }: TagSelectorRootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export type TagSelectorControlProps = ComboboxControlProps & TagsInputControlProps;
|
|
14
14
|
export declare const TagSelectorLabel: ({ textStyle, fontWeight, ...props }: import("@ndla/primitives").ComboboxLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export declare const TagSelectorItemInput: import("react").ForwardRefExoticComponent<import("@ark-ui/react").TagsInputItemInputProps & {
|
|
@@ -5,15 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import type { ComboboxCollectionItem } from "@ark-ui/react";
|
|
9
8
|
import type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps } from "@ndla/primitives";
|
|
10
9
|
import { TagSelectorRootProps } from "../TagSelector/TagSelector";
|
|
11
10
|
type DeepPartial<T> = {
|
|
12
11
|
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
13
12
|
};
|
|
14
13
|
export declare const useTagsInputTranslations: (translations?: Partial<TagsInputRootProps["translations"]>) => TagsInputRootProps["translations"];
|
|
15
|
-
export declare const useComboboxTranslations: <T extends
|
|
16
|
-
export declare const useTagSelectorTranslations: <T extends
|
|
14
|
+
export declare const useComboboxTranslations: <T extends unknown>(translations?: Partial<ComboboxRootProps<T>["translations"]>) => ComboboxRootProps<T>["translations"];
|
|
15
|
+
export declare const useTagSelectorTranslations: <T extends unknown>(translations?: Partial<TagSelectorRootProps<T>["translations"]>) => TagSelectorRootProps<T>["translations"];
|
|
17
16
|
export declare const usePaginationTranslations: (translations?: Partial<PaginationRootProps["translations"]>) => PaginationRootProps["translations"];
|
|
18
17
|
interface AudioSearchTranslations {
|
|
19
18
|
searchPlaceholder: string;
|
package/lib/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export { Grid, GridParallaxItem } from "./Grid";
|
|
|
48
48
|
export type { GridType } from "./Grid";
|
|
49
49
|
export { Gloss, GlossExample } from "./Gloss";
|
|
50
50
|
export { LinkBlock, LinkBlockSection } from "./LinkBlock";
|
|
51
|
-
export type { Article as ArticleType } from "./types";
|
|
51
|
+
export type { Article as ArticleType, HeadingLevel } from "./types";
|
|
52
52
|
export { CodeBlock, codeLanguageOptions } from "./CodeBlock";
|
|
53
53
|
export { ZendeskButton } from "./ZendeskButton/ZendeskButton";
|
|
54
54
|
export type { ZendeskButtonProps } from "./ZendeskButton/ZendeskButton";
|
|
@@ -1081,7 +1081,7 @@ const messages = {
|
|
|
1081
1081
|
fetchMore: "Fetch more answers",
|
|
1082
1082
|
deleted: "This post has been deleted by the author.",
|
|
1083
1083
|
upvote: "Like",
|
|
1084
|
-
numberOfUpvotes: "{{ count }} people have
|
|
1084
|
+
numberOfUpvotes: "{{ count }} people have liked this post.",
|
|
1085
1085
|
removeUpvote: "Stop liking",
|
|
1086
1086
|
reply: "Write a reply to {{ name }}"
|
|
1087
1087
|
},
|
|
@@ -1081,7 +1081,7 @@ const messages = {
|
|
|
1081
1081
|
fetchMore: "Hent flere svar",
|
|
1082
1082
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1083
1083
|
upvote: "Liker",
|
|
1084
|
-
numberOfUpvotes: "{{ count }} personer har
|
|
1084
|
+
numberOfUpvotes: "{{ count }} personer har likt innlegget.",
|
|
1085
1085
|
removeUpvote: "Slutt å like",
|
|
1086
1086
|
reply: "Skriv et svar til {{ name }}"
|
|
1087
1087
|
},
|
|
@@ -1081,7 +1081,7 @@ const messages = {
|
|
|
1081
1081
|
fetchMore: "Hent fleire svar",
|
|
1082
1082
|
deleted: "Dette innlegget er sletta av forfatteren.",
|
|
1083
1083
|
upvote: "Liker",
|
|
1084
|
-
numberOfUpvotes: "{{ count }} personar har
|
|
1084
|
+
numberOfUpvotes: "{{ count }} personar har likt innlegget.",
|
|
1085
1085
|
removeUpvote: "Slutt å like",
|
|
1086
1086
|
reply: "Skriv eit svar til {{ name }}"
|
|
1087
1087
|
},
|
|
@@ -1081,7 +1081,7 @@ const messages = {
|
|
|
1081
1081
|
fetchMore: "Hent flere svar",
|
|
1082
1082
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1083
1083
|
upvote: "Liker",
|
|
1084
|
-
numberOfUpvotes: "{{ count }} personer har
|
|
1084
|
+
numberOfUpvotes: "{{ count }} personer har likt innlegget.",
|
|
1085
1085
|
removeUpvote: "Slutt å like",
|
|
1086
1086
|
reply: "Skriv et svar til {{ name }}"
|
|
1087
1087
|
},
|
|
@@ -1081,7 +1081,7 @@ const messages = {
|
|
|
1081
1081
|
fetchMore: "Hent flere svar",
|
|
1082
1082
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1083
1083
|
upvote: "Liker",
|
|
1084
|
-
numberOfUpvotes: "{{ count }} personer har
|
|
1084
|
+
numberOfUpvotes: "{{ count }} personer har likt innlegget.",
|
|
1085
1085
|
removeUpvote: "Slutt å like",
|
|
1086
1086
|
reply: "Skriv et svar til {{ name }}"
|
|
1087
1087
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.42-alpha.0",
|
|
4
4
|
"description": "UI component library for NDLA",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@ndla/core": "^5.0.2",
|
|
36
36
|
"@ndla/icons": "^8.0.27-alpha.0",
|
|
37
37
|
"@ndla/licenses": "^8.0.3-alpha.0",
|
|
38
|
-
"@ndla/primitives": "^1.0.
|
|
39
|
-
"@ndla/safelink": "^7.0.
|
|
38
|
+
"@ndla/primitives": "^1.0.38-alpha.0",
|
|
39
|
+
"@ndla/safelink": "^7.0.38-alpha.0",
|
|
40
40
|
"@ndla/styled-system": "^0.0.23",
|
|
41
41
|
"@ndla/util": "^5.0.0-alpha.0",
|
|
42
42
|
"html-react-parser": "^5.1.8",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "fa8b235f77c036a235f87c3e5875a2e938cb0ccd"
|
|
62
62
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useEffect, useRef, useState } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
import type
|
|
11
|
+
import { type SliderValueChangeDetails, createListCollection } from "@ark-ui/react";
|
|
12
12
|
import { Replay15Line, Forward15Line } from "@ndla/icons/action";
|
|
13
13
|
import { PlayFill, PauseLine, VolumeUpFill } from "@ndla/icons/common";
|
|
14
14
|
import { CheckLine } from "@ndla/icons/editor";
|
|
@@ -152,7 +152,7 @@ const formatTime = (seconds: number) => {
|
|
|
152
152
|
return `${minutes}:${formattedSeconds}`;
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
-
const speedValues = ["0.5", "0.75", "1", "1.25", "1.5", "1.75", "2"];
|
|
155
|
+
const speedValues = createListCollection({ items: ["0.5", "0.75", "1", "1.25", "1.5", "1.75", "2"] });
|
|
156
156
|
|
|
157
157
|
interface Props {
|
|
158
158
|
src: string;
|
|
@@ -291,7 +291,7 @@ const Controls = ({ src, title }: Props) => {
|
|
|
291
291
|
</StyledText>
|
|
292
292
|
</ProgressWrapper>
|
|
293
293
|
<StyledSelectRoot
|
|
294
|
-
|
|
294
|
+
collection={speedValues}
|
|
295
295
|
value={[speedValue.toString()]}
|
|
296
296
|
onValueChange={(details) => setSpeedValue(parseFloat(details.value[0]))}
|
|
297
297
|
positioning={{ placement: "top" }}
|
|
@@ -310,7 +310,7 @@ const Controls = ({ src, title }: Props) => {
|
|
|
310
310
|
</SelectControl>
|
|
311
311
|
<SelectPositioner>
|
|
312
312
|
<SelectContent>
|
|
313
|
-
{speedValues.map((speed) => (
|
|
313
|
+
{speedValues.items.map((speed) => (
|
|
314
314
|
<SelectItem key={speed} item={speed}>
|
|
315
315
|
<SelectItemText>{speed}x</SelectItemText>
|
|
316
316
|
<SelectItemIndicator>
|
|
@@ -33,6 +33,15 @@ const Disclaimer = styled("div", {
|
|
|
33
33
|
const StyledSafeLink = styled(SafeLink, {
|
|
34
34
|
base: {
|
|
35
35
|
paddingInlineStart: "4xsmall",
|
|
36
|
+
color: "text.link",
|
|
37
|
+
textDecoration: "underline",
|
|
38
|
+
whiteSpace: "nowrap",
|
|
39
|
+
_hover: {
|
|
40
|
+
textDecoration: "none",
|
|
41
|
+
},
|
|
42
|
+
_focusWithin: {
|
|
43
|
+
textDecoration: "none",
|
|
44
|
+
},
|
|
36
45
|
},
|
|
37
46
|
});
|
|
38
47
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useState } from "react";
|
|
10
|
-
import type
|
|
10
|
+
import { type ComboboxInputValueChangeDetails, createListCollection } from "@ark-ui/react";
|
|
11
11
|
|
|
12
12
|
import { Meta, StoryFn } from "@storybook/react";
|
|
13
13
|
import { CloseLine } from "@ndla/icons/action";
|
|
@@ -63,11 +63,13 @@ export const Default: StoryFn<typeof TagSelectorRoot> = ({ translations, ...args
|
|
|
63
63
|
setOptions(filtered);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
+
const collection = createListCollection({ items: options });
|
|
67
|
+
|
|
66
68
|
return (
|
|
67
69
|
<TagSelectorRoot
|
|
68
70
|
{...args}
|
|
69
71
|
value={value}
|
|
70
|
-
|
|
72
|
+
collection={collection}
|
|
71
73
|
onInputValueChange={handleChange}
|
|
72
74
|
onValueChange={(details) => setValue(details.value)}
|
|
73
75
|
translations={componentTranslations}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { forwardRef, useEffect, useId, useRef } from "react";
|
|
10
|
-
import type {
|
|
10
|
+
import type { CollectionItem } from "@ark-ui/react";
|
|
11
11
|
import { ComboboxContext, useTagsInputContext } from "@ark-ui/react";
|
|
12
12
|
import { CloseLine } from "@ndla/icons/action";
|
|
13
13
|
import {
|
|
@@ -34,9 +34,9 @@ import {
|
|
|
34
34
|
} from "@ndla/primitives";
|
|
35
35
|
import { contains } from "@ndla/util";
|
|
36
36
|
|
|
37
|
-
export type TagSelectorRootProps<T extends
|
|
37
|
+
export type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;
|
|
38
38
|
|
|
39
|
-
export const TagSelectorRoot = <T extends
|
|
39
|
+
export const TagSelectorRoot = <T extends CollectionItem>({
|
|
40
40
|
allowCustomValue = true,
|
|
41
41
|
multiple = true,
|
|
42
42
|
selectionBehavior = "clear",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
|
-
import type {
|
|
10
|
+
import type { CollectionItem } from "@ark-ui/react";
|
|
11
11
|
import type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps } from "@ndla/primitives";
|
|
12
12
|
import { TagSelectorRootProps } from "../TagSelector/TagSelector";
|
|
13
13
|
|
|
@@ -33,7 +33,7 @@ export const useTagsInputTranslations = (
|
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export const useComboboxTranslations = <T extends
|
|
36
|
+
export const useComboboxTranslations = <T extends CollectionItem>(
|
|
37
37
|
translations?: Partial<ComboboxRootProps<T>["translations"]>,
|
|
38
38
|
): ComboboxRootProps<T>["translations"] => {
|
|
39
39
|
const { t } = useTranslation("translation", { keyPrefix: "component.combobox" });
|
|
@@ -45,7 +45,7 @@ export const useComboboxTranslations = <T extends ComboboxCollectionItem>(
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
export const useTagSelectorTranslations = <T extends
|
|
48
|
+
export const useTagSelectorTranslations = <T extends CollectionItem>(
|
|
49
49
|
translations?: Partial<TagSelectorRootProps<T>["translations"]>,
|
|
50
50
|
): TagSelectorRootProps<T>["translations"] => {
|
|
51
51
|
const tagsInputTranslations = useTagsInputTranslations();
|
package/src/index.ts
CHANGED
|
@@ -142,7 +142,7 @@ export { Gloss, GlossExample } from "./Gloss";
|
|
|
142
142
|
|
|
143
143
|
export { LinkBlock, LinkBlockSection } from "./LinkBlock";
|
|
144
144
|
|
|
145
|
-
export type { Article as ArticleType } from "./types";
|
|
145
|
+
export type { Article as ArticleType, HeadingLevel } from "./types";
|
|
146
146
|
|
|
147
147
|
export { CodeBlock, codeLanguageOptions } from "./CodeBlock";
|
|
148
148
|
|
|
@@ -1093,7 +1093,7 @@ const messages = {
|
|
|
1093
1093
|
fetchMore: "Fetch more answers",
|
|
1094
1094
|
deleted: "This post has been deleted by the author.",
|
|
1095
1095
|
upvote: "Like",
|
|
1096
|
-
numberOfUpvotes: "{{ count }} people have
|
|
1096
|
+
numberOfUpvotes: "{{ count }} people have liked this post.",
|
|
1097
1097
|
removeUpvote: "Stop liking",
|
|
1098
1098
|
reply: "Write a reply to {{ name }}",
|
|
1099
1099
|
},
|
|
@@ -1094,7 +1094,7 @@ const messages = {
|
|
|
1094
1094
|
fetchMore: "Hent flere svar",
|
|
1095
1095
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1096
1096
|
upvote: "Liker",
|
|
1097
|
-
numberOfUpvotes: "{{ count }} personer har
|
|
1097
|
+
numberOfUpvotes: "{{ count }} personer har likt innlegget.",
|
|
1098
1098
|
removeUpvote: "Slutt å like",
|
|
1099
1099
|
reply: "Skriv et svar til {{ name }}",
|
|
1100
1100
|
},
|
|
@@ -1094,7 +1094,7 @@ const messages = {
|
|
|
1094
1094
|
fetchMore: "Hent fleire svar",
|
|
1095
1095
|
deleted: "Dette innlegget er sletta av forfatteren.",
|
|
1096
1096
|
upvote: "Liker",
|
|
1097
|
-
numberOfUpvotes: "{{ count }} personar har
|
|
1097
|
+
numberOfUpvotes: "{{ count }} personar har likt innlegget.",
|
|
1098
1098
|
removeUpvote: "Slutt å like",
|
|
1099
1099
|
reply: "Skriv eit svar til {{ name }}",
|
|
1100
1100
|
},
|
|
@@ -1096,7 +1096,7 @@ const messages = {
|
|
|
1096
1096
|
fetchMore: "Hent flere svar",
|
|
1097
1097
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1098
1098
|
upvote: "Liker",
|
|
1099
|
-
numberOfUpvotes: "{{ count }} personer har
|
|
1099
|
+
numberOfUpvotes: "{{ count }} personer har likt innlegget.",
|
|
1100
1100
|
removeUpvote: "Slutt å like",
|
|
1101
1101
|
reply: "Skriv et svar til {{ name }}",
|
|
1102
1102
|
},
|
|
@@ -1098,7 +1098,7 @@ const messages = {
|
|
|
1098
1098
|
fetchMore: "Hent flere svar",
|
|
1099
1099
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1100
1100
|
upvote: "Liker",
|
|
1101
|
-
numberOfUpvotes: "{{ count }} personer har
|
|
1101
|
+
numberOfUpvotes: "{{ count }} personer har likt innlegget.",
|
|
1102
1102
|
removeUpvote: "Slutt å like",
|
|
1103
1103
|
reply: "Skriv et svar til {{ name }}",
|
|
1104
1104
|
},
|