@ndla/ui 56.0.20-alpha.0 → 56.0.22-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 +6 -10
- package/dist/styles.css +8 -25
- package/es/Embed/ImageEmbed.js +2 -38
- package/es/TagSelector/TagSelector.js +3 -3
- 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/es/styles.css +8 -25
- package/lib/Embed/ImageEmbed.js +2 -38
- package/lib/TagSelector/TagSelector.js +3 -3
- 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/lib/styles.css +8 -25
- package/package.json +7 -7
- package/src/Embed/ImageEmbed.stories.tsx +17 -1
- package/src/Embed/ImageEmbed.tsx +2 -44
- package/src/TagSelector/TagSelector.tsx +4 -8
- 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
|
@@ -256,25 +256,21 @@
|
|
|
256
256
|
"background]___[value:background.default]___[cond:_hover<___>& [data-byline-button]",
|
|
257
257
|
"transform]___[value:scale(1.2)]___[cond:_hover<___>& button[data-expanded]",
|
|
258
258
|
"transform]___[value:rotate(-45deg)]___[cond:& button[data-expanded='true']<___>& svg",
|
|
259
|
-
"bottom]___[value:0",
|
|
260
|
-
"right]___[value:0",
|
|
261
|
-
"transitionProperty]___[value:transform, background-color, color",
|
|
262
|
-
"transitionDuration]___[value:normal",
|
|
263
|
-
"transitionTimingFunction]___[value:ease-out",
|
|
264
|
-
"background]___[value:background.default/20",
|
|
265
|
-
"transitionProperty]___[value:transform]___[cond:& svg",
|
|
266
|
-
"transitionDuration]___[value:normal]___[cond:& svg",
|
|
267
|
-
"transitionTimingFunction]___[value:ease-out]___[cond:& svg",
|
|
268
|
-
"fill]___[value:primary]___[cond:& svg",
|
|
269
259
|
"padding]___[value:0",
|
|
270
260
|
"top]___[value:xsmall",
|
|
271
261
|
"right]___[value:xsmall",
|
|
272
262
|
"width]___[value:medium",
|
|
273
263
|
"height]___[value:medium",
|
|
274
264
|
"borderColor]___[value:background.default",
|
|
265
|
+
"transitionProperty]___[value:transform, background-color, color",
|
|
266
|
+
"transitionDuration]___[value:normal",
|
|
267
|
+
"transitionTimingFunction]___[value:ease-out",
|
|
275
268
|
"color]___[value:background.default",
|
|
276
269
|
"backgroundColor]___[value:surface.action",
|
|
277
270
|
"borderRadius]___[value:large",
|
|
271
|
+
"transitionProperty]___[value:transform]___[cond:& svg",
|
|
272
|
+
"transitionDuration]___[value:normal]___[cond:& svg",
|
|
273
|
+
"transitionTimingFunction]___[value:ease-out]___[cond:& svg",
|
|
278
274
|
"overflow]___[value:visible",
|
|
279
275
|
"borderBottom]___[value:1px solid",
|
|
280
276
|
"borderStyle]___[value:dashed",
|
package/dist/styles.css
CHANGED
|
@@ -458,11 +458,6 @@
|
|
|
458
458
|
border-bottom: 0;
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
.bg_background\.default\/20 {
|
|
462
|
-
--mix-background: color-mix(in srgb, var(--colors-background-default) 20%, transparent);
|
|
463
|
-
background: var(--mix-background, var(--colors-background-default));
|
|
464
|
-
}
|
|
465
|
-
|
|
466
461
|
.p_0 {
|
|
467
462
|
padding: 0;
|
|
468
463
|
}
|
|
@@ -742,12 +737,16 @@
|
|
|
742
737
|
border-bottom-right-radius: 0;
|
|
743
738
|
}
|
|
744
739
|
|
|
745
|
-
.
|
|
746
|
-
|
|
740
|
+
.top_xsmall {
|
|
741
|
+
top: var(--spacing-xsmall);
|
|
747
742
|
}
|
|
748
743
|
|
|
749
|
-
.
|
|
750
|
-
right:
|
|
744
|
+
.right_xsmall {
|
|
745
|
+
right: var(--spacing-xsmall);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.bd-c_background\.default {
|
|
749
|
+
border-color: var(--colors-background-default);
|
|
751
750
|
}
|
|
752
751
|
|
|
753
752
|
.trs-prop_transform\,_background-color\,_color {
|
|
@@ -765,18 +764,6 @@
|
|
|
765
764
|
transition-timing-function: ease-out;
|
|
766
765
|
}
|
|
767
766
|
|
|
768
|
-
.top_xsmall {
|
|
769
|
-
top: var(--spacing-xsmall);
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
.right_xsmall {
|
|
773
|
-
right: var(--spacing-xsmall);
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
.bd-c_background\.default {
|
|
777
|
-
border-color: var(--colors-background-default);
|
|
778
|
-
}
|
|
779
|
-
|
|
780
767
|
.bg-c_surface\.action {
|
|
781
768
|
background-color: var(--colors-surface-action);
|
|
782
769
|
}
|
|
@@ -1092,10 +1079,6 @@
|
|
|
1092
1079
|
margin-inline-start: var(--spacing-1);
|
|
1093
1080
|
}
|
|
1094
1081
|
|
|
1095
|
-
.\[\&_svg\]\:fill_primary svg {
|
|
1096
|
-
fill: var(--colors-primary);
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
1082
|
.\[\&_a\]\:c_text\.strong a {
|
|
1100
1083
|
color: var(--colors-text-strong);
|
|
1101
1084
|
}
|
package/es/Embed/ImageEmbed.js
CHANGED
|
@@ -10,7 +10,6 @@ import parse from "html-react-parser";
|
|
|
10
10
|
import { useMemo, useState } from "react";
|
|
11
11
|
import { useTranslation } from "react-i18next";
|
|
12
12
|
import { AddLine } from "@ndla/icons/action";
|
|
13
|
-
import { ArrowDownShortLine, ArrowUpShortLine } from "@ndla/icons/common";
|
|
14
13
|
import { Figure, Image } from "@ndla/primitives";
|
|
15
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
16
15
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
@@ -127,32 +126,6 @@ const StyledFigure = styled(Figure, {
|
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
128
|
});
|
|
130
|
-
const BylineButton = styled("button", {
|
|
131
|
-
base: {
|
|
132
|
-
cursor: "pointer",
|
|
133
|
-
position: "absolute",
|
|
134
|
-
zIndex: "base",
|
|
135
|
-
bottom: "0",
|
|
136
|
-
right: "0",
|
|
137
|
-
paddingBlock: "xsmall",
|
|
138
|
-
paddingInline: "xsmall",
|
|
139
|
-
transitionProperty: "transform, background-color, color",
|
|
140
|
-
transitionDuration: "normal",
|
|
141
|
-
transitionTimingFunction: "ease-out",
|
|
142
|
-
background: "background.default/20",
|
|
143
|
-
border: "0",
|
|
144
|
-
"& svg": {
|
|
145
|
-
transitionProperty: "transform",
|
|
146
|
-
transitionDuration: "normal",
|
|
147
|
-
transitionTimingFunction: "ease-out",
|
|
148
|
-
fill: "primary"
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}, {
|
|
152
|
-
defaultProps: {
|
|
153
|
-
type: "button"
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
129
|
const ExpandButton = styled("button", {
|
|
157
130
|
base: {
|
|
158
131
|
display: "flex",
|
|
@@ -192,7 +165,6 @@ const ImageEmbed = _ref => {
|
|
|
192
165
|
renderContext = "article",
|
|
193
166
|
children
|
|
194
167
|
} = _ref;
|
|
195
|
-
const [isBylineHidden, setIsBylineHidden] = useState(hideByline(embed.embedData));
|
|
196
168
|
const [imageSizes, setImageSizes] = useState(undefined);
|
|
197
169
|
const figureProps = getFigureProps(embed.embedData.size, embed.embedData.align);
|
|
198
170
|
const {
|
|
@@ -249,21 +221,13 @@ const ImageEmbed = _ref => {
|
|
|
249
221
|
onClick: toggleImageSize,
|
|
250
222
|
"data-expanded": !!imageSizes,
|
|
251
223
|
children: /*#__PURE__*/_jsx(AddLine, {})
|
|
252
|
-
}), (embedData.size?.endsWith("-hide-byline") || embedData.hideByline === "true") && /*#__PURE__*/_jsx(BylineButton, {
|
|
253
|
-
"data-byline-button": "",
|
|
254
|
-
"aria-label": t(`license.images.itemImage.${isBylineHidden ? "expandByline" : "minimizeByline"}`),
|
|
255
|
-
onClick: () => setIsBylineHidden(p => !p),
|
|
256
|
-
children: isBylineHidden ? /*#__PURE__*/_jsx(ArrowDownShortLine, {}) : /*#__PURE__*/_jsx(ArrowUpShortLine, {})
|
|
257
224
|
})]
|
|
258
|
-
}),
|
|
225
|
+
}), embedData.hideByline === "true" ? null : /*#__PURE__*/_jsx(EmbedByline, {
|
|
259
226
|
type: "image",
|
|
260
227
|
copyright: data.copyright,
|
|
261
|
-
description: parsedDescription,
|
|
228
|
+
description: embedData.hideCaption === "true" ? "" : parsedDescription,
|
|
262
229
|
visibleAlt: previewAlt ? embed.embedData.alt : ""
|
|
263
230
|
})]
|
|
264
231
|
});
|
|
265
232
|
};
|
|
266
|
-
const hideByline = embed => {
|
|
267
|
-
return !!embed.size && embed.size.endsWith("-hide-byline") || embed.hideByline === "true";
|
|
268
|
-
};
|
|
269
233
|
export default ImageEmbed;
|
|
@@ -74,10 +74,10 @@ export const TagSelectorControl = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
74
74
|
...props
|
|
75
75
|
} = _ref2;
|
|
76
76
|
return /*#__PURE__*/_jsx(ComboboxControl, {
|
|
77
|
+
ref: ref,
|
|
77
78
|
asChild: true,
|
|
78
79
|
children: /*#__PURE__*/_jsx(TagsInputControl, {
|
|
79
80
|
...props,
|
|
80
|
-
ref: ref,
|
|
81
81
|
children: children
|
|
82
82
|
})
|
|
83
83
|
});
|
|
@@ -91,6 +91,7 @@ export const TagSelectorInputBase = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
91
91
|
} = _ref3;
|
|
92
92
|
const tagsApi = useTagsInputContext();
|
|
93
93
|
return /*#__PURE__*/_jsx(ComboboxInput, {
|
|
94
|
+
ref: ref,
|
|
94
95
|
asChild: true,
|
|
95
96
|
children: /*#__PURE__*/_jsx(TagsInputInput, {
|
|
96
97
|
...props,
|
|
@@ -99,7 +100,6 @@ export const TagSelectorInputBase = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
99
100
|
tagsApi.addValue(tagsApi.inputValue);
|
|
100
101
|
}
|
|
101
102
|
},
|
|
102
|
-
ref: ref,
|
|
103
103
|
children: children
|
|
104
104
|
})
|
|
105
105
|
});
|
|
@@ -122,6 +122,7 @@ export const TagSelectorInput = /*#__PURE__*/forwardRef((_ref4, ref) => {
|
|
|
122
122
|
})]
|
|
123
123
|
}), /*#__PURE__*/_jsx(TagsInputItemInput, {})]
|
|
124
124
|
}, value)), /*#__PURE__*/_jsx(ComboboxInput, {
|
|
125
|
+
ref: ref,
|
|
125
126
|
asChild: true,
|
|
126
127
|
children: /*#__PURE__*/_jsx(TagsInputInput, {
|
|
127
128
|
...props,
|
|
@@ -130,7 +131,6 @@ export const TagSelectorInput = /*#__PURE__*/forwardRef((_ref4, ref) => {
|
|
|
130
131
|
tagsApi.addValue(tagsApi.inputValue);
|
|
131
132
|
}
|
|
132
133
|
},
|
|
133
|
-
ref: ref,
|
|
134
134
|
children: children
|
|
135
135
|
})
|
|
136
136
|
})]
|
package/es/locale/messages-en.js
CHANGED
|
@@ -1108,7 +1108,7 @@ const messages = {
|
|
|
1108
1108
|
},
|
|
1109
1109
|
topicsBy: "Topics by",
|
|
1110
1110
|
admin: {
|
|
1111
|
-
title: "Arena
|
|
1111
|
+
title: "Arena admin",
|
|
1112
1112
|
description: "Tools to moderate and administer the arena.",
|
|
1113
1113
|
administrate: "Administrate",
|
|
1114
1114
|
category: {
|
package/es/locale/messages-nb.js
CHANGED
|
@@ -1108,7 +1108,7 @@ const messages = {
|
|
|
1108
1108
|
},
|
|
1109
1109
|
topicsBy: "Innlegg av",
|
|
1110
1110
|
admin: {
|
|
1111
|
-
title: "Arena
|
|
1111
|
+
title: "Arena admin",
|
|
1112
1112
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1113
1113
|
administrate: "Administrer",
|
|
1114
1114
|
category: {
|
package/es/locale/messages-nn.js
CHANGED
|
@@ -1108,7 +1108,7 @@ const messages = {
|
|
|
1108
1108
|
},
|
|
1109
1109
|
topicsBy: "Innlegg av",
|
|
1110
1110
|
admin: {
|
|
1111
|
-
title: "Arena
|
|
1111
|
+
title: "Arena admin",
|
|
1112
1112
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1113
1113
|
administrate: "Administrer",
|
|
1114
1114
|
category: {
|
package/es/locale/messages-se.js
CHANGED
|
@@ -1108,7 +1108,7 @@ const messages = {
|
|
|
1108
1108
|
},
|
|
1109
1109
|
topicsBy: "Innlegg av",
|
|
1110
1110
|
admin: {
|
|
1111
|
-
title: "Arena
|
|
1111
|
+
title: "Arena admin",
|
|
1112
1112
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1113
1113
|
administrate: "Administrer",
|
|
1114
1114
|
category: {
|
|
@@ -1108,7 +1108,7 @@ const messages = {
|
|
|
1108
1108
|
},
|
|
1109
1109
|
topicsBy: "Innlegg av",
|
|
1110
1110
|
admin: {
|
|
1111
|
-
title: "Arena
|
|
1111
|
+
title: "Arena admin",
|
|
1112
1112
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1113
1113
|
administrate: "Administrer",
|
|
1114
1114
|
category: {
|
package/es/styles.css
CHANGED
|
@@ -458,11 +458,6 @@
|
|
|
458
458
|
border-bottom: 0;
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
.bg_background\.default\/20 {
|
|
462
|
-
--mix-background: color-mix(in srgb, var(--colors-background-default) 20%, transparent);
|
|
463
|
-
background: var(--mix-background, var(--colors-background-default));
|
|
464
|
-
}
|
|
465
|
-
|
|
466
461
|
.p_0 {
|
|
467
462
|
padding: 0;
|
|
468
463
|
}
|
|
@@ -742,12 +737,16 @@
|
|
|
742
737
|
border-bottom-right-radius: 0;
|
|
743
738
|
}
|
|
744
739
|
|
|
745
|
-
.
|
|
746
|
-
|
|
740
|
+
.top_xsmall {
|
|
741
|
+
top: var(--spacing-xsmall);
|
|
747
742
|
}
|
|
748
743
|
|
|
749
|
-
.
|
|
750
|
-
right:
|
|
744
|
+
.right_xsmall {
|
|
745
|
+
right: var(--spacing-xsmall);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.bd-c_background\.default {
|
|
749
|
+
border-color: var(--colors-background-default);
|
|
751
750
|
}
|
|
752
751
|
|
|
753
752
|
.trs-prop_transform\,_background-color\,_color {
|
|
@@ -765,18 +764,6 @@
|
|
|
765
764
|
transition-timing-function: ease-out;
|
|
766
765
|
}
|
|
767
766
|
|
|
768
|
-
.top_xsmall {
|
|
769
|
-
top: var(--spacing-xsmall);
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
.right_xsmall {
|
|
773
|
-
right: var(--spacing-xsmall);
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
.bd-c_background\.default {
|
|
777
|
-
border-color: var(--colors-background-default);
|
|
778
|
-
}
|
|
779
|
-
|
|
780
767
|
.bg-c_surface\.action {
|
|
781
768
|
background-color: var(--colors-surface-action);
|
|
782
769
|
}
|
|
@@ -1092,10 +1079,6 @@
|
|
|
1092
1079
|
margin-inline-start: var(--spacing-1);
|
|
1093
1080
|
}
|
|
1094
1081
|
|
|
1095
|
-
.\[\&_svg\]\:fill_primary svg {
|
|
1096
|
-
fill: var(--colors-primary);
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
1082
|
.\[\&_a\]\:c_text\.strong a {
|
|
1100
1083
|
color: var(--colors-text-strong);
|
|
1101
1084
|
}
|
package/lib/Embed/ImageEmbed.js
CHANGED
|
@@ -8,7 +8,6 @@ var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactI18next = require("react-i18next");
|
|
10
10
|
var _action = require("@ndla/icons/action");
|
|
11
|
-
var _common = require("@ndla/icons/common");
|
|
12
11
|
var _primitives = require("@ndla/primitives");
|
|
13
12
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
14
13
|
var _EmbedErrorPlaceholder = _interopRequireDefault(require("./EmbedErrorPlaceholder"));
|
|
@@ -137,32 +136,6 @@ const StyledFigure = (0, _jsx2.styled)(_primitives.Figure, {
|
|
|
137
136
|
}
|
|
138
137
|
}
|
|
139
138
|
});
|
|
140
|
-
const BylineButton = (0, _jsx2.styled)("button", {
|
|
141
|
-
base: {
|
|
142
|
-
cursor: "pointer",
|
|
143
|
-
position: "absolute",
|
|
144
|
-
zIndex: "base",
|
|
145
|
-
bottom: "0",
|
|
146
|
-
right: "0",
|
|
147
|
-
paddingBlock: "xsmall",
|
|
148
|
-
paddingInline: "xsmall",
|
|
149
|
-
transitionProperty: "transform, background-color, color",
|
|
150
|
-
transitionDuration: "normal",
|
|
151
|
-
transitionTimingFunction: "ease-out",
|
|
152
|
-
background: "background.default/20",
|
|
153
|
-
border: "0",
|
|
154
|
-
"& svg": {
|
|
155
|
-
transitionProperty: "transform",
|
|
156
|
-
transitionDuration: "normal",
|
|
157
|
-
transitionTimingFunction: "ease-out",
|
|
158
|
-
fill: "primary"
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}, {
|
|
162
|
-
defaultProps: {
|
|
163
|
-
type: "button"
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
139
|
const ExpandButton = (0, _jsx2.styled)("button", {
|
|
167
140
|
base: {
|
|
168
141
|
display: "flex",
|
|
@@ -202,7 +175,6 @@ const ImageEmbed = _ref => {
|
|
|
202
175
|
renderContext = "article",
|
|
203
176
|
children
|
|
204
177
|
} = _ref;
|
|
205
|
-
const [isBylineHidden, setIsBylineHidden] = (0, _react.useState)(hideByline(embed.embedData));
|
|
206
178
|
const [imageSizes, setImageSizes] = (0, _react.useState)(undefined);
|
|
207
179
|
const figureProps = getFigureProps(embed.embedData.size, embed.embedData.align);
|
|
208
180
|
const {
|
|
@@ -259,21 +231,13 @@ const ImageEmbed = _ref => {
|
|
|
259
231
|
onClick: toggleImageSize,
|
|
260
232
|
"data-expanded": !!imageSizes,
|
|
261
233
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_action.AddLine, {})
|
|
262
|
-
}), (embedData.size?.endsWith("-hide-byline") || embedData.hideByline === "true") && /*#__PURE__*/(0, _jsxRuntime.jsx)(BylineButton, {
|
|
263
|
-
"data-byline-button": "",
|
|
264
|
-
"aria-label": t(`license.images.itemImage.${isBylineHidden ? "expandByline" : "minimizeByline"}`),
|
|
265
|
-
onClick: () => setIsBylineHidden(p => !p),
|
|
266
|
-
children: isBylineHidden ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.ArrowDownShortLine, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.ArrowUpShortLine, {})
|
|
267
234
|
})]
|
|
268
|
-
}),
|
|
235
|
+
}), embedData.hideByline === "true" ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseByline.EmbedByline, {
|
|
269
236
|
type: "image",
|
|
270
237
|
copyright: data.copyright,
|
|
271
|
-
description: parsedDescription,
|
|
238
|
+
description: embedData.hideCaption === "true" ? "" : parsedDescription,
|
|
272
239
|
visibleAlt: previewAlt ? embed.embedData.alt : ""
|
|
273
240
|
})]
|
|
274
241
|
});
|
|
275
242
|
};
|
|
276
|
-
const hideByline = embed => {
|
|
277
|
-
return !!embed.size && embed.size.endsWith("-hide-byline") || embed.hideByline === "true";
|
|
278
|
-
};
|
|
279
243
|
var _default = exports.default = ImageEmbed;
|
|
@@ -81,10 +81,10 @@ const TagSelectorControl = exports.TagSelectorControl = /*#__PURE__*/(0, _react.
|
|
|
81
81
|
...props
|
|
82
82
|
} = _ref2;
|
|
83
83
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ComboboxControl, {
|
|
84
|
+
ref: ref,
|
|
84
85
|
asChild: true,
|
|
85
86
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.TagsInputControl, {
|
|
86
87
|
...props,
|
|
87
|
-
ref: ref,
|
|
88
88
|
children: children
|
|
89
89
|
})
|
|
90
90
|
});
|
|
@@ -98,6 +98,7 @@ const TagSelectorInputBase = exports.TagSelectorInputBase = /*#__PURE__*/(0, _re
|
|
|
98
98
|
} = _ref3;
|
|
99
99
|
const tagsApi = (0, _react2.useTagsInputContext)();
|
|
100
100
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ComboboxInput, {
|
|
101
|
+
ref: ref,
|
|
101
102
|
asChild: true,
|
|
102
103
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.TagsInputInput, {
|
|
103
104
|
...props,
|
|
@@ -106,7 +107,6 @@ const TagSelectorInputBase = exports.TagSelectorInputBase = /*#__PURE__*/(0, _re
|
|
|
106
107
|
tagsApi.addValue(tagsApi.inputValue);
|
|
107
108
|
}
|
|
108
109
|
},
|
|
109
|
-
ref: ref,
|
|
110
110
|
children: children
|
|
111
111
|
})
|
|
112
112
|
});
|
|
@@ -129,6 +129,7 @@ const TagSelectorInput = exports.TagSelectorInput = /*#__PURE__*/(0, _react.forw
|
|
|
129
129
|
})]
|
|
130
130
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.TagsInputItemInput, {})]
|
|
131
131
|
}, value)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ComboboxInput, {
|
|
132
|
+
ref: ref,
|
|
132
133
|
asChild: true,
|
|
133
134
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.TagsInputInput, {
|
|
134
135
|
...props,
|
|
@@ -137,7 +138,6 @@ const TagSelectorInput = exports.TagSelectorInput = /*#__PURE__*/(0, _react.forw
|
|
|
137
138
|
tagsApi.addValue(tagsApi.inputValue);
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
|
-
ref: ref,
|
|
141
141
|
children: children
|
|
142
142
|
})
|
|
143
143
|
})]
|
|
@@ -1115,7 +1115,7 @@ const messages = {
|
|
|
1115
1115
|
},
|
|
1116
1116
|
topicsBy: "Topics by",
|
|
1117
1117
|
admin: {
|
|
1118
|
-
title: "Arena
|
|
1118
|
+
title: "Arena admin",
|
|
1119
1119
|
description: "Tools to moderate and administer the arena.",
|
|
1120
1120
|
administrate: "Administrate",
|
|
1121
1121
|
category: {
|
|
@@ -1115,7 +1115,7 @@ const messages = {
|
|
|
1115
1115
|
},
|
|
1116
1116
|
topicsBy: "Innlegg av",
|
|
1117
1117
|
admin: {
|
|
1118
|
-
title: "Arena
|
|
1118
|
+
title: "Arena admin",
|
|
1119
1119
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1120
1120
|
administrate: "Administrer",
|
|
1121
1121
|
category: {
|
|
@@ -1115,7 +1115,7 @@ const messages = {
|
|
|
1115
1115
|
},
|
|
1116
1116
|
topicsBy: "Innlegg av",
|
|
1117
1117
|
admin: {
|
|
1118
|
-
title: "Arena
|
|
1118
|
+
title: "Arena admin",
|
|
1119
1119
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1120
1120
|
administrate: "Administrer",
|
|
1121
1121
|
category: {
|
|
@@ -1115,7 +1115,7 @@ const messages = {
|
|
|
1115
1115
|
},
|
|
1116
1116
|
topicsBy: "Innlegg av",
|
|
1117
1117
|
admin: {
|
|
1118
|
-
title: "Arena
|
|
1118
|
+
title: "Arena admin",
|
|
1119
1119
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1120
1120
|
administrate: "Administrer",
|
|
1121
1121
|
category: {
|
|
@@ -1115,7 +1115,7 @@ const messages = {
|
|
|
1115
1115
|
},
|
|
1116
1116
|
topicsBy: "Innlegg av",
|
|
1117
1117
|
admin: {
|
|
1118
|
-
title: "Arena
|
|
1118
|
+
title: "Arena admin",
|
|
1119
1119
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1120
1120
|
administrate: "Administrer",
|
|
1121
1121
|
category: {
|
package/lib/styles.css
CHANGED
|
@@ -458,11 +458,6 @@
|
|
|
458
458
|
border-bottom: 0;
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
.bg_background\.default\/20 {
|
|
462
|
-
--mix-background: color-mix(in srgb, var(--colors-background-default) 20%, transparent);
|
|
463
|
-
background: var(--mix-background, var(--colors-background-default));
|
|
464
|
-
}
|
|
465
|
-
|
|
466
461
|
.p_0 {
|
|
467
462
|
padding: 0;
|
|
468
463
|
}
|
|
@@ -742,12 +737,16 @@
|
|
|
742
737
|
border-bottom-right-radius: 0;
|
|
743
738
|
}
|
|
744
739
|
|
|
745
|
-
.
|
|
746
|
-
|
|
740
|
+
.top_xsmall {
|
|
741
|
+
top: var(--spacing-xsmall);
|
|
747
742
|
}
|
|
748
743
|
|
|
749
|
-
.
|
|
750
|
-
right:
|
|
744
|
+
.right_xsmall {
|
|
745
|
+
right: var(--spacing-xsmall);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.bd-c_background\.default {
|
|
749
|
+
border-color: var(--colors-background-default);
|
|
751
750
|
}
|
|
752
751
|
|
|
753
752
|
.trs-prop_transform\,_background-color\,_color {
|
|
@@ -765,18 +764,6 @@
|
|
|
765
764
|
transition-timing-function: ease-out;
|
|
766
765
|
}
|
|
767
766
|
|
|
768
|
-
.top_xsmall {
|
|
769
|
-
top: var(--spacing-xsmall);
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
.right_xsmall {
|
|
773
|
-
right: var(--spacing-xsmall);
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
.bd-c_background\.default {
|
|
777
|
-
border-color: var(--colors-background-default);
|
|
778
|
-
}
|
|
779
|
-
|
|
780
767
|
.bg-c_surface\.action {
|
|
781
768
|
background-color: var(--colors-surface-action);
|
|
782
769
|
}
|
|
@@ -1092,10 +1079,6 @@
|
|
|
1092
1079
|
margin-inline-start: var(--spacing-1);
|
|
1093
1080
|
}
|
|
1094
1081
|
|
|
1095
|
-
.\[\&_svg\]\:fill_primary svg {
|
|
1096
|
-
fill: var(--colors-primary);
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
1082
|
.\[\&_a\]\:c_text\.strong a {
|
|
1100
1083
|
color: var(--colors-text-strong);
|
|
1101
1084
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.22-alpha.0",
|
|
4
4
|
"description": "UI component library for NDLA",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ndla/core": "^5.0.2",
|
|
37
|
-
"@ndla/icons": "^8.0.
|
|
37
|
+
"@ndla/icons": "^8.0.15-alpha.0",
|
|
38
38
|
"@ndla/licenses": "^8.0.2-alpha.0",
|
|
39
|
-
"@ndla/primitives": "^1.0.
|
|
40
|
-
"@ndla/safelink": "^7.0.
|
|
41
|
-
"@ndla/styled-system": "^0.0.
|
|
39
|
+
"@ndla/primitives": "^1.0.20-alpha.0",
|
|
40
|
+
"@ndla/safelink": "^7.0.20-alpha.0",
|
|
41
|
+
"@ndla/styled-system": "^0.0.17",
|
|
42
42
|
"@ndla/util": "^4.1.0",
|
|
43
43
|
"html-react-parser": "^5.1.8",
|
|
44
44
|
"i18next-browser-languagedetector": "^7.1.0"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"react-router-dom": "> 6.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@ndla/preset-panda": "^0.0.
|
|
56
|
+
"@ndla/preset-panda": "^0.0.25",
|
|
57
57
|
"@ndla/types-backend": "^0.2.86",
|
|
58
58
|
"@ndla/types-embed": "^5.0.1-alpha.0",
|
|
59
59
|
"@pandacss/dev": "^0.45.2",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "d40977f8ad6f9927572a6a62bf6a397189d0cfa4"
|
|
70
70
|
}
|
|
@@ -139,7 +139,23 @@ export const HiddenByline: StoryObj<typeof ImageEmbed> = {
|
|
|
139
139
|
status: "success",
|
|
140
140
|
embedData: {
|
|
141
141
|
...embedData,
|
|
142
|
-
size: "full
|
|
142
|
+
size: "full",
|
|
143
|
+
hideByline: "true",
|
|
144
|
+
},
|
|
145
|
+
data: metaData,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const HiddenCaption: StoryObj<typeof ImageEmbed> = {
|
|
151
|
+
args: {
|
|
152
|
+
embed: {
|
|
153
|
+
resource: "image",
|
|
154
|
+
status: "success",
|
|
155
|
+
embedData: {
|
|
156
|
+
...embedData,
|
|
157
|
+
size: "full",
|
|
158
|
+
hideCaption: "true",
|
|
143
159
|
},
|
|
144
160
|
data: metaData,
|
|
145
161
|
},
|
package/src/Embed/ImageEmbed.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import parse from "html-react-parser";
|
|
|
10
10
|
import { ReactNode, useMemo, useState } from "react";
|
|
11
11
|
import { useTranslation } from "react-i18next";
|
|
12
12
|
import { AddLine } from "@ndla/icons/action";
|
|
13
|
-
import { ArrowDownShortLine, ArrowUpShortLine } from "@ndla/icons/common";
|
|
14
13
|
import { Figure, FigureSize, FigureVariantProps, Image } from "@ndla/primitives";
|
|
15
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
16
15
|
import { ImageEmbedData, ImageMetaData } from "@ndla/types-embed";
|
|
@@ -157,33 +156,6 @@ const StyledFigure = styled(Figure, {
|
|
|
157
156
|
},
|
|
158
157
|
});
|
|
159
158
|
|
|
160
|
-
const BylineButton = styled(
|
|
161
|
-
"button",
|
|
162
|
-
{
|
|
163
|
-
base: {
|
|
164
|
-
cursor: "pointer",
|
|
165
|
-
position: "absolute",
|
|
166
|
-
zIndex: "base",
|
|
167
|
-
bottom: "0",
|
|
168
|
-
right: "0",
|
|
169
|
-
paddingBlock: "xsmall",
|
|
170
|
-
paddingInline: "xsmall",
|
|
171
|
-
transitionProperty: "transform, background-color, color",
|
|
172
|
-
transitionDuration: "normal",
|
|
173
|
-
transitionTimingFunction: "ease-out",
|
|
174
|
-
background: "background.default/20",
|
|
175
|
-
border: "0",
|
|
176
|
-
"& svg": {
|
|
177
|
-
transitionProperty: "transform",
|
|
178
|
-
transitionDuration: "normal",
|
|
179
|
-
transitionTimingFunction: "ease-out",
|
|
180
|
-
fill: "primary",
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
{ defaultProps: { type: "button" } },
|
|
185
|
-
);
|
|
186
|
-
|
|
187
159
|
const ExpandButton = styled(
|
|
188
160
|
"button",
|
|
189
161
|
{
|
|
@@ -217,7 +189,6 @@ const ExpandButton = styled(
|
|
|
217
189
|
);
|
|
218
190
|
|
|
219
191
|
const ImageEmbed = ({ embed, previewAlt, lang, renderContext = "article", children }: Props) => {
|
|
220
|
-
const [isBylineHidden, setIsBylineHidden] = useState(hideByline(embed.embedData));
|
|
221
192
|
const [imageSizes, setImageSizes] = useState<string | undefined>(undefined);
|
|
222
193
|
const figureProps = getFigureProps(embed.embedData.size, embed.embedData.align);
|
|
223
194
|
const { t } = useTranslation();
|
|
@@ -279,21 +250,12 @@ const ImageEmbed = ({ embed, previewAlt, lang, renderContext = "article", childr
|
|
|
279
250
|
<AddLine />
|
|
280
251
|
</ExpandButton>
|
|
281
252
|
)}
|
|
282
|
-
{(embedData.size?.endsWith("-hide-byline") || embedData.hideByline === "true") && (
|
|
283
|
-
<BylineButton
|
|
284
|
-
data-byline-button=""
|
|
285
|
-
aria-label={t(`license.images.itemImage.${isBylineHidden ? "expandByline" : "minimizeByline"}`)}
|
|
286
|
-
onClick={() => setIsBylineHidden((p) => !p)}
|
|
287
|
-
>
|
|
288
|
-
{isBylineHidden ? <ArrowDownShortLine /> : <ArrowUpShortLine />}
|
|
289
|
-
</BylineButton>
|
|
290
|
-
)}
|
|
291
253
|
</ImageWrapper>
|
|
292
|
-
{
|
|
254
|
+
{embedData.hideByline === "true" ? null : (
|
|
293
255
|
<EmbedByline
|
|
294
256
|
type="image"
|
|
295
257
|
copyright={data.copyright}
|
|
296
|
-
description={parsedDescription}
|
|
258
|
+
description={embedData.hideCaption === "true" ? "" : parsedDescription}
|
|
297
259
|
visibleAlt={previewAlt ? embed.embedData.alt : ""}
|
|
298
260
|
/>
|
|
299
261
|
)}
|
|
@@ -301,8 +263,4 @@ const ImageEmbed = ({ embed, previewAlt, lang, renderContext = "article", childr
|
|
|
301
263
|
);
|
|
302
264
|
};
|
|
303
265
|
|
|
304
|
-
const hideByline = (embed: ImageEmbedData): boolean => {
|
|
305
|
-
return (!!embed.size && embed.size.endsWith("-hide-byline")) || embed.hideByline === "true";
|
|
306
|
-
};
|
|
307
|
-
|
|
308
266
|
export default ImageEmbed;
|
|
@@ -108,10 +108,8 @@ export const TagSelectorTrigger = ComboboxTrigger;
|
|
|
108
108
|
|
|
109
109
|
export const TagSelectorControl = forwardRef<HTMLDivElement, TagSelectorControlProps>(({ children, ...props }, ref) => {
|
|
110
110
|
return (
|
|
111
|
-
<ComboboxControl asChild>
|
|
112
|
-
<TagsInputControl {...props}
|
|
113
|
-
{children}
|
|
114
|
-
</TagsInputControl>
|
|
111
|
+
<ComboboxControl ref={ref} asChild>
|
|
112
|
+
<TagsInputControl {...props}>{children}</TagsInputControl>
|
|
115
113
|
</ComboboxControl>
|
|
116
114
|
);
|
|
117
115
|
});
|
|
@@ -126,7 +124,7 @@ export const TagSelectorInputBase = forwardRef<HTMLInputElement, TagSelectorInpu
|
|
|
126
124
|
const tagsApi = useTagsInputContext();
|
|
127
125
|
|
|
128
126
|
return (
|
|
129
|
-
<ComboboxInput asChild>
|
|
127
|
+
<ComboboxInput ref={ref} asChild>
|
|
130
128
|
<TagsInputInput
|
|
131
129
|
{...props}
|
|
132
130
|
onKeyDown={(event) => {
|
|
@@ -134,7 +132,6 @@ export const TagSelectorInputBase = forwardRef<HTMLInputElement, TagSelectorInpu
|
|
|
134
132
|
tagsApi.addValue(tagsApi.inputValue);
|
|
135
133
|
}
|
|
136
134
|
}}
|
|
137
|
-
ref={ref}
|
|
138
135
|
>
|
|
139
136
|
{children}
|
|
140
137
|
</TagsInputInput>
|
|
@@ -159,7 +156,7 @@ export const TagSelectorInput = forwardRef<HTMLInputElement, TagSelectorInputPro
|
|
|
159
156
|
<TagsInputItemInput />
|
|
160
157
|
</TagsInputItem>
|
|
161
158
|
))}
|
|
162
|
-
<ComboboxInput asChild>
|
|
159
|
+
<ComboboxInput ref={ref} asChild>
|
|
163
160
|
<TagsInputInput
|
|
164
161
|
{...props}
|
|
165
162
|
onKeyDown={(event) => {
|
|
@@ -167,7 +164,6 @@ export const TagSelectorInput = forwardRef<HTMLInputElement, TagSelectorInputPro
|
|
|
167
164
|
tagsApi.addValue(tagsApi.inputValue);
|
|
168
165
|
}
|
|
169
166
|
}}
|
|
170
|
-
ref={ref}
|
|
171
167
|
>
|
|
172
168
|
{children}
|
|
173
169
|
</TagsInputInput>
|
|
@@ -1130,7 +1130,7 @@ const messages = {
|
|
|
1130
1130
|
},
|
|
1131
1131
|
topicsBy: "Topics by",
|
|
1132
1132
|
admin: {
|
|
1133
|
-
title: "Arena
|
|
1133
|
+
title: "Arena admin",
|
|
1134
1134
|
description: "Tools to moderate and administer the arena.",
|
|
1135
1135
|
administrate: "Administrate",
|
|
1136
1136
|
category: {
|
|
@@ -1131,7 +1131,7 @@ const messages = {
|
|
|
1131
1131
|
},
|
|
1132
1132
|
topicsBy: "Innlegg av",
|
|
1133
1133
|
admin: {
|
|
1134
|
-
title: "Arena
|
|
1134
|
+
title: "Arena admin",
|
|
1135
1135
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1136
1136
|
administrate: "Administrer",
|
|
1137
1137
|
category: {
|
|
@@ -1131,7 +1131,7 @@ const messages = {
|
|
|
1131
1131
|
},
|
|
1132
1132
|
topicsBy: "Innlegg av",
|
|
1133
1133
|
admin: {
|
|
1134
|
-
title: "Arena
|
|
1134
|
+
title: "Arena admin",
|
|
1135
1135
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1136
1136
|
administrate: "Administrer",
|
|
1137
1137
|
category: {
|
|
@@ -1133,7 +1133,7 @@ const messages = {
|
|
|
1133
1133
|
},
|
|
1134
1134
|
topicsBy: "Innlegg av",
|
|
1135
1135
|
admin: {
|
|
1136
|
-
title: "Arena
|
|
1136
|
+
title: "Arena admin",
|
|
1137
1137
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1138
1138
|
administrate: "Administrer",
|
|
1139
1139
|
category: {
|
|
@@ -1135,7 +1135,7 @@ const messages = {
|
|
|
1135
1135
|
},
|
|
1136
1136
|
topicsBy: "Innlegg av",
|
|
1137
1137
|
admin: {
|
|
1138
|
-
title: "Arena
|
|
1138
|
+
title: "Arena admin",
|
|
1139
1139
|
description: "Verktøy for å moderere og administrere arenaen.",
|
|
1140
1140
|
administrate: "Administrer",
|
|
1141
1141
|
category: {
|