@ndla/ui 56.0.60-alpha.0 → 56.0.62-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 +20 -20
- package/dist/styles.css +24 -24
- package/es/Embed/ConceptEmbed.js +2 -2
- package/es/Embed/ConceptInlineTriggerButton.js +45 -0
- package/es/Embed/GlossEmbed.js +2 -2
- package/es/Embed/InlineTriggerButton.js +1 -33
- package/lib/Embed/ConceptEmbed.js +2 -2
- package/lib/Embed/ConceptInlineTriggerButton.d.ts +11 -0
- package/lib/Embed/ConceptInlineTriggerButton.js +51 -0
- package/lib/Embed/GlossEmbed.js +2 -2
- package/lib/Embed/InlineTriggerButton.js +1 -33
- package/package.json +3 -3
- package/src/Embed/ConceptEmbed.tsx +2 -2
- package/src/Embed/ConceptInlineTriggerButton.tsx +46 -0
- package/src/Embed/GlossEmbed.tsx +2 -2
- package/src/Embed/InlineTriggerButton.tsx +1 -35
|
@@ -205,6 +205,26 @@
|
|
|
205
205
|
"width]___[value:surface.xlarge",
|
|
206
206
|
"maxHeight]___[value:50vh",
|
|
207
207
|
"overflowY]___[value:auto",
|
|
208
|
+
"overflow]___[value:visible",
|
|
209
|
+
"borderBottom]___[value:1px solid",
|
|
210
|
+
"borderStyle]___[value:dashed",
|
|
211
|
+
"borderColor]___[value:stroke.hover",
|
|
212
|
+
"paddingBlockStart]___[value:5xsmall",
|
|
213
|
+
"width]___[value:fit-content",
|
|
214
|
+
"borderColor]___[value:text.link]___[cond:_hover",
|
|
215
|
+
"background]___[value:surface.actionSubtle.hover]___[cond:_hover",
|
|
216
|
+
"borderColor]___[value:text.link]___[cond:_active",
|
|
217
|
+
"background]___[value:surface.actionSubtle.active]___[cond:_active",
|
|
218
|
+
"outline]___[value:none]___[cond:_focusVisible",
|
|
219
|
+
"borderRadius]___[value:0]___[cond:_focusVisible",
|
|
220
|
+
"content]___[value:\"\"]___[cond:_focusVisible<___>_after",
|
|
221
|
+
"position]___[value:absolute]___[cond:_focusVisible<___>_after",
|
|
222
|
+
"inset]___[value:0]___[cond:_focusVisible<___>_after",
|
|
223
|
+
"outline]___[value:3px]___[cond:_focusVisible<___>_after",
|
|
224
|
+
"borderRadius]___[value:xsmall]___[cond:_focusVisible<___>_after",
|
|
225
|
+
"outlineColor]___[value:stroke.default]___[cond:_focusVisible<___>_after",
|
|
226
|
+
"outlineOffset]___[value:3px]___[cond:_focusVisible<___>_after",
|
|
227
|
+
"outlineStyle]___[value:solid]___[cond:_focusVisible<___>_after",
|
|
208
228
|
"marginBlockEnd]___[value:xsmall",
|
|
209
229
|
"background]___[value:background.subtle",
|
|
210
230
|
"height]___[value:5xlarge]___[cond:& svg",
|
|
@@ -237,26 +257,6 @@
|
|
|
237
257
|
"transitionProperty]___[value:transform]___[cond:& svg",
|
|
238
258
|
"transitionDuration]___[value:normal]___[cond:& svg",
|
|
239
259
|
"transitionTimingFunction]___[value:ease-out]___[cond:& svg",
|
|
240
|
-
"overflow]___[value:visible",
|
|
241
|
-
"borderBottom]___[value:1px solid",
|
|
242
|
-
"borderStyle]___[value:dashed",
|
|
243
|
-
"borderColor]___[value:stroke.hover",
|
|
244
|
-
"paddingBlockStart]___[value:5xsmall",
|
|
245
|
-
"width]___[value:fit-content",
|
|
246
|
-
"borderColor]___[value:text.link]___[cond:_hover",
|
|
247
|
-
"background]___[value:surface.actionSubtle.hover]___[cond:_hover",
|
|
248
|
-
"borderColor]___[value:text.link]___[cond:_active",
|
|
249
|
-
"background]___[value:surface.actionSubtle.active]___[cond:_active",
|
|
250
|
-
"outline]___[value:none]___[cond:_focusVisible",
|
|
251
|
-
"borderRadius]___[value:0]___[cond:_focusVisible",
|
|
252
|
-
"content]___[value:\"\"]___[cond:_focusVisible<___>_after",
|
|
253
|
-
"position]___[value:absolute]___[cond:_focusVisible<___>_after",
|
|
254
|
-
"inset]___[value:0]___[cond:_focusVisible<___>_after",
|
|
255
|
-
"outline]___[value:3px]___[cond:_focusVisible<___>_after",
|
|
256
|
-
"borderRadius]___[value:xsmall]___[cond:_focusVisible<___>_after",
|
|
257
|
-
"outlineColor]___[value:stroke.default]___[cond:_focusVisible<___>_after",
|
|
258
|
-
"outlineOffset]___[value:3px]___[cond:_focusVisible<___>_after",
|
|
259
|
-
"outlineStyle]___[value:solid]___[cond:_focusVisible<___>_after",
|
|
260
260
|
"paddingInlineStart]___[value:4xsmall",
|
|
261
261
|
"color]___[value:text.link",
|
|
262
262
|
"whiteSpace]___[value:nowrap",
|
package/dist/styles.css
CHANGED
|
@@ -461,6 +461,22 @@
|
|
|
461
461
|
max-height: 50vh;
|
|
462
462
|
}
|
|
463
463
|
|
|
464
|
+
.ov_visible {
|
|
465
|
+
overflow: visible;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.bd-b_1px_solid {
|
|
469
|
+
border-bottom: 1px solid;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.pbs_5xsmall {
|
|
473
|
+
padding-block-start: var(--spacing-5xsmall);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.w_fit-content {
|
|
477
|
+
width: fit-content;
|
|
478
|
+
}
|
|
479
|
+
|
|
464
480
|
.mbe_xsmall {
|
|
465
481
|
margin-block-end: var(--spacing-xsmall);
|
|
466
482
|
}
|
|
@@ -497,22 +513,6 @@
|
|
|
497
513
|
border-radius: var(--radii-large);
|
|
498
514
|
}
|
|
499
515
|
|
|
500
|
-
.ov_visible {
|
|
501
|
-
overflow: visible;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
.bd-b_1px_solid {
|
|
505
|
-
border-bottom: 1px solid;
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
.pbs_5xsmall {
|
|
509
|
-
padding-block-start: var(--spacing-5xsmall);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
.w_fit-content {
|
|
513
|
-
width: fit-content;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
516
|
.ps_4xsmall {
|
|
517
517
|
padding-inline-start: var(--spacing-4xsmall);
|
|
518
518
|
}
|
|
@@ -717,6 +717,14 @@
|
|
|
717
717
|
overflow-y: auto;
|
|
718
718
|
}
|
|
719
719
|
|
|
720
|
+
.border-style_dashed {
|
|
721
|
+
border-style: dashed;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
.bd-c_stroke\.hover {
|
|
725
|
+
border-color: var(--colors-stroke-hover);
|
|
726
|
+
}
|
|
727
|
+
|
|
720
728
|
.top_xsmall {
|
|
721
729
|
top: var(--spacing-xsmall);
|
|
722
730
|
}
|
|
@@ -748,14 +756,6 @@
|
|
|
748
756
|
background-color: var(--colors-surface-action);
|
|
749
757
|
}
|
|
750
758
|
|
|
751
|
-
.border-style_dashed {
|
|
752
|
-
border-style: dashed;
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
.bd-c_stroke\.hover {
|
|
756
|
-
border-color: var(--colors-stroke-hover);
|
|
757
|
-
}
|
|
758
|
-
|
|
759
759
|
.mb_medium {
|
|
760
760
|
margin-bottom: var(--spacing-medium);
|
|
761
761
|
}
|
package/es/Embed/ConceptEmbed.js
CHANGED
|
@@ -11,9 +11,9 @@ import { forwardRef, useMemo, useRef } from "react";
|
|
|
11
11
|
import { Portal } from "@ark-ui/react";
|
|
12
12
|
import { PopoverContent, PopoverRoot, PopoverTrigger } from "@ndla/primitives";
|
|
13
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
14
|
+
import { ConceptInlineTriggerButton } from "./ConceptInlineTriggerButton";
|
|
14
15
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
15
16
|
import { GlossEmbed } from "./GlossEmbed";
|
|
16
|
-
import { InlineTriggerButton } from "./InlineTriggerButton";
|
|
17
17
|
import { Concept } from "../Concept/Concept";
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
19
|
const StyledPopoverContent = styled(PopoverContent, {
|
|
@@ -97,7 +97,7 @@ export const InlineConcept = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
97
97
|
asChild: true,
|
|
98
98
|
ref: ref,
|
|
99
99
|
...rest,
|
|
100
|
-
children: /*#__PURE__*/_jsx(
|
|
100
|
+
children: /*#__PURE__*/_jsx(ConceptInlineTriggerButton, {
|
|
101
101
|
children: linkText
|
|
102
102
|
})
|
|
103
103
|
}), /*#__PURE__*/_jsx(Portal, {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
10
|
+
import { InlineTriggerButton } from "./InlineTriggerButton";
|
|
11
|
+
export const ConceptInlineTriggerButton = styled(InlineTriggerButton, {
|
|
12
|
+
base: {
|
|
13
|
+
position: "relative",
|
|
14
|
+
overflow: "visible",
|
|
15
|
+
borderBottom: "1px solid",
|
|
16
|
+
borderStyle: "dashed",
|
|
17
|
+
borderColor: "stroke.hover",
|
|
18
|
+
paddingBlockStart: "5xsmall",
|
|
19
|
+
width: "fit-content",
|
|
20
|
+
cursor: "pointer",
|
|
21
|
+
_hover: {
|
|
22
|
+
borderColor: "text.link",
|
|
23
|
+
background: "surface.actionSubtle.hover"
|
|
24
|
+
},
|
|
25
|
+
_active: {
|
|
26
|
+
borderColor: "text.link",
|
|
27
|
+
background: "surface.actionSubtle.active"
|
|
28
|
+
},
|
|
29
|
+
// The global focus ring forces the border-radius to be xsmall, causing the dashed border to be cut off. This is a workaround.
|
|
30
|
+
_focusVisible: {
|
|
31
|
+
outline: "none",
|
|
32
|
+
borderRadius: "0",
|
|
33
|
+
_after: {
|
|
34
|
+
content: '""',
|
|
35
|
+
position: "absolute",
|
|
36
|
+
inset: "0",
|
|
37
|
+
outline: "3px",
|
|
38
|
+
borderRadius: "xsmall",
|
|
39
|
+
outlineColor: "stroke.default",
|
|
40
|
+
outlineOffset: "3px",
|
|
41
|
+
outlineStyle: "solid"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
package/es/Embed/GlossEmbed.js
CHANGED
|
@@ -10,8 +10,8 @@ import { useRef } from "react";
|
|
|
10
10
|
import { Portal } from "@ark-ui/react";
|
|
11
11
|
import { Figure, PopoverContent, PopoverRoot, PopoverTrigger } from "@ndla/primitives";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
|
+
import { ConceptInlineTriggerButton } from "./ConceptInlineTriggerButton";
|
|
13
14
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
14
|
-
import { InlineTriggerButton } from "./InlineTriggerButton";
|
|
15
15
|
import { Gloss } from "../Gloss";
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const StyledPopoverContent = styled(PopoverContent, {
|
|
@@ -47,7 +47,7 @@ export const GlossEmbed = _ref => {
|
|
|
47
47
|
initialFocusEl: () => contentRef.current,
|
|
48
48
|
children: [/*#__PURE__*/_jsx(PopoverTrigger, {
|
|
49
49
|
asChild: true,
|
|
50
|
-
children: /*#__PURE__*/_jsx(
|
|
50
|
+
children: /*#__PURE__*/_jsx(ConceptInlineTriggerButton, {
|
|
51
51
|
children: embed.embedData.linkText
|
|
52
52
|
})
|
|
53
53
|
}), /*#__PURE__*/_jsx(Portal, {
|
|
@@ -11,39 +11,7 @@ import { styled } from "@ndla/styled-system/jsx";
|
|
|
11
11
|
import { composeRefs } from "@ndla/util";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const StyledSpan = styled("span", {
|
|
14
|
-
base: {
|
|
15
|
-
position: "relative",
|
|
16
|
-
overflow: "visible",
|
|
17
|
-
borderBottom: "1px solid",
|
|
18
|
-
borderStyle: "dashed",
|
|
19
|
-
borderColor: "stroke.hover",
|
|
20
|
-
paddingBlockStart: "5xsmall",
|
|
21
|
-
width: "fit-content",
|
|
22
|
-
cursor: "pointer",
|
|
23
|
-
_hover: {
|
|
24
|
-
borderColor: "text.link",
|
|
25
|
-
background: "surface.actionSubtle.hover"
|
|
26
|
-
},
|
|
27
|
-
_active: {
|
|
28
|
-
borderColor: "text.link",
|
|
29
|
-
background: "surface.actionSubtle.active"
|
|
30
|
-
},
|
|
31
|
-
// The global focus ring forces the border-radius to be xsmall, causing the dashed border to be cut off. This is a workaround.
|
|
32
|
-
_focusVisible: {
|
|
33
|
-
outline: "none",
|
|
34
|
-
borderRadius: "0",
|
|
35
|
-
_after: {
|
|
36
|
-
content: '""',
|
|
37
|
-
position: "absolute",
|
|
38
|
-
inset: "0",
|
|
39
|
-
outline: "3px",
|
|
40
|
-
borderRadius: "xsmall",
|
|
41
|
-
outlineColor: "stroke.default",
|
|
42
|
-
outlineOffset: "3px",
|
|
43
|
-
outlineStyle: "solid"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
14
|
+
base: {}
|
|
47
15
|
});
|
|
48
16
|
export const InlineTriggerButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
49
17
|
let {
|
|
@@ -9,9 +9,9 @@ var _react = require("react");
|
|
|
9
9
|
var _react2 = require("@ark-ui/react");
|
|
10
10
|
var _primitives = require("@ndla/primitives");
|
|
11
11
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
12
|
+
var _ConceptInlineTriggerButton = require("./ConceptInlineTriggerButton");
|
|
12
13
|
var _EmbedErrorPlaceholder = _interopRequireDefault(require("./EmbedErrorPlaceholder"));
|
|
13
14
|
var _GlossEmbed = require("./GlossEmbed");
|
|
14
|
-
var _InlineTriggerButton = require("./InlineTriggerButton");
|
|
15
15
|
var _Concept = require("../Concept/Concept");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -105,7 +105,7 @@ const InlineConcept = exports.InlineConcept = /*#__PURE__*/(0, _react.forwardRef
|
|
|
105
105
|
asChild: true,
|
|
106
106
|
ref: ref,
|
|
107
107
|
...rest,
|
|
108
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
108
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConceptInlineTriggerButton.ConceptInlineTriggerButton, {
|
|
109
109
|
children: linkText
|
|
110
110
|
})
|
|
111
111
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Portal, {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="react" />
|
|
9
|
+
export declare const ConceptInlineTriggerButton: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
10
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
11
|
+
}, "ref"> & import("react").RefAttributes<HTMLSpanElement>>, {}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ConceptInlineTriggerButton = void 0;
|
|
7
|
+
var _jsx = require("@ndla/styled-system/jsx");
|
|
8
|
+
var _InlineTriggerButton = require("./InlineTriggerButton");
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) 2024-present, NDLA.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const ConceptInlineTriggerButton = exports.ConceptInlineTriggerButton = (0, _jsx.styled)(_InlineTriggerButton.InlineTriggerButton, {
|
|
18
|
+
base: {
|
|
19
|
+
position: "relative",
|
|
20
|
+
overflow: "visible",
|
|
21
|
+
borderBottom: "1px solid",
|
|
22
|
+
borderStyle: "dashed",
|
|
23
|
+
borderColor: "stroke.hover",
|
|
24
|
+
paddingBlockStart: "5xsmall",
|
|
25
|
+
width: "fit-content",
|
|
26
|
+
cursor: "pointer",
|
|
27
|
+
_hover: {
|
|
28
|
+
borderColor: "text.link",
|
|
29
|
+
background: "surface.actionSubtle.hover"
|
|
30
|
+
},
|
|
31
|
+
_active: {
|
|
32
|
+
borderColor: "text.link",
|
|
33
|
+
background: "surface.actionSubtle.active"
|
|
34
|
+
},
|
|
35
|
+
// The global focus ring forces the border-radius to be xsmall, causing the dashed border to be cut off. This is a workaround.
|
|
36
|
+
_focusVisible: {
|
|
37
|
+
outline: "none",
|
|
38
|
+
borderRadius: "0",
|
|
39
|
+
_after: {
|
|
40
|
+
content: '""',
|
|
41
|
+
position: "absolute",
|
|
42
|
+
inset: "0",
|
|
43
|
+
outline: "3px",
|
|
44
|
+
borderRadius: "xsmall",
|
|
45
|
+
outlineColor: "stroke.default",
|
|
46
|
+
outlineOffset: "3px",
|
|
47
|
+
outlineStyle: "solid"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
package/lib/Embed/GlossEmbed.js
CHANGED
|
@@ -8,8 +8,8 @@ var _react = require("react");
|
|
|
8
8
|
var _react2 = require("@ark-ui/react");
|
|
9
9
|
var _primitives = require("@ndla/primitives");
|
|
10
10
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
11
|
+
var _ConceptInlineTriggerButton = require("./ConceptInlineTriggerButton");
|
|
11
12
|
var _EmbedErrorPlaceholder = _interopRequireDefault(require("./EmbedErrorPlaceholder"));
|
|
12
|
-
var _InlineTriggerButton = require("./InlineTriggerButton");
|
|
13
13
|
var _Gloss = require("../Gloss");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -54,7 +54,7 @@ const GlossEmbed = _ref => {
|
|
|
54
54
|
initialFocusEl: () => contentRef.current,
|
|
55
55
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.PopoverTrigger, {
|
|
56
56
|
asChild: true,
|
|
57
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
57
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConceptInlineTriggerButton.ConceptInlineTriggerButton, {
|
|
58
58
|
children: embed.embedData.linkText
|
|
59
59
|
})
|
|
60
60
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Portal, {
|
|
@@ -17,39 +17,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
const StyledSpan = (0, _jsx2.styled)("span", {
|
|
20
|
-
base: {
|
|
21
|
-
position: "relative",
|
|
22
|
-
overflow: "visible",
|
|
23
|
-
borderBottom: "1px solid",
|
|
24
|
-
borderStyle: "dashed",
|
|
25
|
-
borderColor: "stroke.hover",
|
|
26
|
-
paddingBlockStart: "5xsmall",
|
|
27
|
-
width: "fit-content",
|
|
28
|
-
cursor: "pointer",
|
|
29
|
-
_hover: {
|
|
30
|
-
borderColor: "text.link",
|
|
31
|
-
background: "surface.actionSubtle.hover"
|
|
32
|
-
},
|
|
33
|
-
_active: {
|
|
34
|
-
borderColor: "text.link",
|
|
35
|
-
background: "surface.actionSubtle.active"
|
|
36
|
-
},
|
|
37
|
-
// The global focus ring forces the border-radius to be xsmall, causing the dashed border to be cut off. This is a workaround.
|
|
38
|
-
_focusVisible: {
|
|
39
|
-
outline: "none",
|
|
40
|
-
borderRadius: "0",
|
|
41
|
-
_after: {
|
|
42
|
-
content: '""',
|
|
43
|
-
position: "absolute",
|
|
44
|
-
inset: "0",
|
|
45
|
-
outline: "3px",
|
|
46
|
-
borderRadius: "xsmall",
|
|
47
|
-
outlineColor: "stroke.default",
|
|
48
|
-
outlineOffset: "3px",
|
|
49
|
-
outlineStyle: "solid"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
20
|
+
base: {}
|
|
53
21
|
});
|
|
54
22
|
const InlineTriggerButton = exports.InlineTriggerButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
55
23
|
let {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.62-alpha.0",
|
|
4
4
|
"description": "UI component library for NDLA",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ndla/core": "^5.0.2",
|
|
36
|
-
"@ndla/icons": "^8.0.
|
|
36
|
+
"@ndla/icons": "^8.0.37-alpha.0",
|
|
37
37
|
"@ndla/licenses": "^8.0.3-alpha.0",
|
|
38
38
|
"@ndla/primitives": "^1.0.49-alpha.0",
|
|
39
39
|
"@ndla/safelink": "^7.0.50-alpha.0",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "faf01f6c462480fde97a45881d27893bac3d4f69"
|
|
62
62
|
}
|
|
@@ -12,9 +12,9 @@ import { Portal } from "@ark-ui/react";
|
|
|
12
12
|
import { PopoverContent, PopoverRoot, PopoverTrigger } from "@ndla/primitives";
|
|
13
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
14
14
|
import { ConceptMetaData } from "@ndla/types-embed";
|
|
15
|
+
import { ConceptInlineTriggerButton } from "./ConceptInlineTriggerButton";
|
|
15
16
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
16
17
|
import { GlossEmbed } from "./GlossEmbed";
|
|
17
|
-
import { InlineTriggerButton } from "./InlineTriggerButton";
|
|
18
18
|
import { RenderContext } from "./types";
|
|
19
19
|
import { Concept, ConceptProps } from "../Concept/Concept";
|
|
20
20
|
|
|
@@ -99,7 +99,7 @@ export const InlineConcept = forwardRef<HTMLSpanElement, InlineConceptProps>(
|
|
|
99
99
|
<PopoverRoot initialFocusEl={() => contentRef.current}>
|
|
100
100
|
{/* @ts-expect-error placing ref and rest on popover trigger somehow removes a bug where the popover target becomes a bit bigger */}
|
|
101
101
|
<PopoverTrigger asChild ref={ref} {...rest}>
|
|
102
|
-
<
|
|
102
|
+
<ConceptInlineTriggerButton>{linkText}</ConceptInlineTriggerButton>
|
|
103
103
|
</PopoverTrigger>
|
|
104
104
|
<Portal>
|
|
105
105
|
<StyledPopoverContent ref={contentRef}>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
10
|
+
import { InlineTriggerButton } from "./InlineTriggerButton";
|
|
11
|
+
|
|
12
|
+
export const ConceptInlineTriggerButton = styled(InlineTriggerButton, {
|
|
13
|
+
base: {
|
|
14
|
+
position: "relative",
|
|
15
|
+
overflow: "visible",
|
|
16
|
+
borderBottom: "1px solid",
|
|
17
|
+
borderStyle: "dashed",
|
|
18
|
+
borderColor: "stroke.hover",
|
|
19
|
+
paddingBlockStart: "5xsmall",
|
|
20
|
+
width: "fit-content",
|
|
21
|
+
cursor: "pointer",
|
|
22
|
+
_hover: {
|
|
23
|
+
borderColor: "text.link",
|
|
24
|
+
background: "surface.actionSubtle.hover",
|
|
25
|
+
},
|
|
26
|
+
_active: {
|
|
27
|
+
borderColor: "text.link",
|
|
28
|
+
background: "surface.actionSubtle.active",
|
|
29
|
+
},
|
|
30
|
+
// The global focus ring forces the border-radius to be xsmall, causing the dashed border to be cut off. This is a workaround.
|
|
31
|
+
_focusVisible: {
|
|
32
|
+
outline: "none",
|
|
33
|
+
borderRadius: "0",
|
|
34
|
+
_after: {
|
|
35
|
+
content: '""',
|
|
36
|
+
position: "absolute",
|
|
37
|
+
inset: "0",
|
|
38
|
+
outline: "3px",
|
|
39
|
+
borderRadius: "xsmall",
|
|
40
|
+
outlineColor: "stroke.default",
|
|
41
|
+
outlineOffset: "3px",
|
|
42
|
+
outlineStyle: "solid",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
package/src/Embed/GlossEmbed.tsx
CHANGED
|
@@ -11,8 +11,8 @@ import { Portal } from "@ark-ui/react";
|
|
|
11
11
|
import { Figure, PopoverContent, PopoverRoot, PopoverTrigger } from "@ndla/primitives";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
13
|
import { ConceptMetaData } from "@ndla/types-embed";
|
|
14
|
+
import { ConceptInlineTriggerButton } from "./ConceptInlineTriggerButton";
|
|
14
15
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
15
|
-
import { InlineTriggerButton } from "./InlineTriggerButton";
|
|
16
16
|
import { Gloss } from "../Gloss";
|
|
17
17
|
|
|
18
18
|
interface Props {
|
|
@@ -48,7 +48,7 @@ export const GlossEmbed = ({ embed }: Props) => {
|
|
|
48
48
|
return (
|
|
49
49
|
<PopoverRoot initialFocusEl={() => contentRef.current}>
|
|
50
50
|
<PopoverTrigger asChild>
|
|
51
|
-
<
|
|
51
|
+
<ConceptInlineTriggerButton>{embed.embedData.linkText}</ConceptInlineTriggerButton>
|
|
52
52
|
</PopoverTrigger>
|
|
53
53
|
<Portal>
|
|
54
54
|
<StyledPopoverContent ref={contentRef}>
|
|
@@ -10,41 +10,7 @@ import { ComponentPropsWithRef, KeyboardEvent, forwardRef, useCallback, useRef }
|
|
|
10
10
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
11
|
import { composeRefs } from "@ndla/util";
|
|
12
12
|
|
|
13
|
-
const StyledSpan = styled("span", {
|
|
14
|
-
base: {
|
|
15
|
-
position: "relative",
|
|
16
|
-
overflow: "visible",
|
|
17
|
-
borderBottom: "1px solid",
|
|
18
|
-
borderStyle: "dashed",
|
|
19
|
-
borderColor: "stroke.hover",
|
|
20
|
-
paddingBlockStart: "5xsmall",
|
|
21
|
-
width: "fit-content",
|
|
22
|
-
cursor: "pointer",
|
|
23
|
-
_hover: {
|
|
24
|
-
borderColor: "text.link",
|
|
25
|
-
background: "surface.actionSubtle.hover",
|
|
26
|
-
},
|
|
27
|
-
_active: {
|
|
28
|
-
borderColor: "text.link",
|
|
29
|
-
background: "surface.actionSubtle.active",
|
|
30
|
-
},
|
|
31
|
-
// The global focus ring forces the border-radius to be xsmall, causing the dashed border to be cut off. This is a workaround.
|
|
32
|
-
_focusVisible: {
|
|
33
|
-
outline: "none",
|
|
34
|
-
borderRadius: "0",
|
|
35
|
-
_after: {
|
|
36
|
-
content: '""',
|
|
37
|
-
position: "absolute",
|
|
38
|
-
inset: "0",
|
|
39
|
-
outline: "3px",
|
|
40
|
-
borderRadius: "xsmall",
|
|
41
|
-
outlineColor: "stroke.default",
|
|
42
|
-
outlineOffset: "3px",
|
|
43
|
-
outlineStyle: "solid",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
});
|
|
13
|
+
const StyledSpan = styled("span", { base: {} });
|
|
48
14
|
|
|
49
15
|
export const InlineTriggerButton = forwardRef<HTMLSpanElement, ComponentPropsWithRef<"span">>(
|
|
50
16
|
({ onClick, ...props }, ref) => {
|