@ndla/primitives 0.0.2 → 0.0.3
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 +61 -14
- package/dist/styles.css +226 -26
- package/es/ArticleLists.js +4 -32
- package/es/Badge.js +4 -16
- package/es/BlockQuote.js +3 -15
- package/es/Button.js +40 -33
- package/es/Dialog.js +6 -7
- package/es/ExpandableBox.js +4 -17
- package/es/FieldErrorMessage.js +9 -7
- package/es/FieldHelper.js +7 -5
- package/es/FormControl.js +2 -1
- package/es/FramedContent.js +3 -15
- package/es/Icon.js +9 -6
- package/es/Input.js +13 -10
- package/es/Label.js +10 -9
- package/es/Menu.js +32 -6
- package/es/MessageBox.js +3 -15
- package/es/NdlaLogo.js +6 -5
- package/es/RadioGroup.js +6 -2
- package/es/Skeleton.js +2 -8
- package/es/Spinner.js +3 -15
- package/es/Switch.js +8 -4
- package/es/Table.js +2 -5
- package/es/Tabs.js +232 -0
- package/es/Text.js +33 -32
- package/es/Toast.js +14 -6
- package/es/createStyleContext.js +15 -7
- package/lib/Accordion.d.ts +14 -7
- package/lib/ArticleLists.d.ts +9 -11
- package/lib/ArticleLists.js +5 -36
- package/lib/Badge.d.ts +9 -4
- package/lib/Badge.js +4 -17
- package/lib/BlockQuote.d.ts +8 -3
- package/lib/BlockQuote.js +3 -16
- package/lib/Button.d.ts +24 -11
- package/lib/Button.js +39 -32
- package/lib/Checkbox.d.ts +12 -5
- package/lib/Dialog.d.ts +18 -10
- package/lib/Dialog.js +6 -7
- package/lib/ExpandableBox.d.ts +8 -5
- package/lib/ExpandableBox.js +5 -20
- package/lib/FieldErrorMessage.d.ts +3 -3
- package/lib/FieldErrorMessage.js +8 -6
- package/lib/FieldHelper.d.ts +3 -3
- package/lib/FieldHelper.js +6 -4
- package/lib/FormControl.d.ts +4 -2
- package/lib/FormControl.js +2 -1
- package/lib/FramedContent.d.ts +8 -4
- package/lib/FramedContent.js +3 -16
- package/lib/Icon.d.ts +3 -2
- package/lib/Icon.js +8 -5
- package/lib/Input.d.ts +12 -11
- package/lib/Input.js +12 -9
- package/lib/Label.d.ts +16 -7
- package/lib/Label.js +9 -8
- package/lib/Menu.d.ts +66 -13
- package/lib/Menu.js +41 -15
- package/lib/MessageBox.d.ts +8 -4
- package/lib/MessageBox.js +3 -16
- package/lib/NdlaLogo.d.ts +5 -4
- package/lib/NdlaLogo.js +5 -4
- package/lib/Pagination.d.ts +17 -6
- package/lib/Popover.d.ts +34 -13
- package/lib/RadioGroup.d.ts +18 -7
- package/lib/RadioGroup.js +6 -2
- package/lib/Skeleton.d.ts +5 -2
- package/lib/Skeleton.js +3 -10
- package/lib/Slider.d.ts +18 -7
- package/lib/Spinner.d.ts +8 -3
- package/lib/Spinner.js +3 -16
- package/lib/Switch.d.ts +12 -7
- package/lib/Switch.js +9 -5
- package/lib/Table.d.ts +6 -3
- package/lib/Table.js +4 -8
- package/lib/Tabs.d.ts +145 -0
- package/lib/Tabs.js +240 -0
- package/lib/Text.d.ts +6 -9
- package/lib/Text.js +32 -33
- package/lib/Toast.d.ts +10 -7
- package/lib/Toast.js +15 -7
- package/lib/Tooltip.d.ts +19 -7
- package/lib/createStyleContext.d.ts +5 -3
- package/lib/createStyleContext.js +14 -6
- package/package.json +5 -5
package/lib/Icon.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ComponentPropsWithRef } from "react";
|
|
9
9
|
import { type RecipeVariantProps } from "@ndla/styled-system/css";
|
|
10
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
11
|
export declare const iconRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
11
12
|
size: {
|
|
12
13
|
xsmall: {
|
|
@@ -32,6 +33,6 @@ interface BaseIconProps extends ComponentPropsWithRef<"svg"> {
|
|
|
32
33
|
title?: string;
|
|
33
34
|
description?: string;
|
|
34
35
|
}
|
|
35
|
-
export type IconProps = BaseIconProps & IconVariantProps;
|
|
36
|
-
export declare const Icon: ({ children, size, role, title, description, width, height,
|
|
36
|
+
export type IconProps = BaseIconProps & IconVariantProps & JsxStyleProps;
|
|
37
|
+
export declare const Icon: ({ children, size, role, title, description, width, height, css: cssProp, "aria-hidden": ariaHidden, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
38
|
export {};
|
package/lib/Icon.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.iconRecipe = exports.Icon = void 0;
|
|
7
7
|
var _css = require("@ndla/styled-system/css");
|
|
8
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
/**
|
|
10
11
|
* Copyright (c) 2024-present, NDLA.
|
|
@@ -46,6 +47,8 @@ const iconRecipe = exports.iconRecipe = (0, _css.cva)({
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
});
|
|
50
|
+
const StyledSvg = (0, _jsx2.styled)("svg");
|
|
51
|
+
|
|
49
52
|
// TODO: Move this component over to ndla/icons
|
|
50
53
|
const Icon = _ref => {
|
|
51
54
|
let {
|
|
@@ -56,18 +59,18 @@ const Icon = _ref => {
|
|
|
56
59
|
description,
|
|
57
60
|
width,
|
|
58
61
|
height,
|
|
59
|
-
|
|
62
|
+
css: cssProp,
|
|
60
63
|
"aria-hidden": ariaHidden = true,
|
|
61
64
|
...props
|
|
62
65
|
} = _ref;
|
|
63
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
66
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledSvg, {
|
|
64
67
|
"data-icon": "",
|
|
65
68
|
"aria-hidden": ariaHidden,
|
|
66
69
|
preserveAspectRatio: "xMidYMid meet",
|
|
67
|
-
|
|
68
|
-
className: (0, _css.cx)(iconRecipe({
|
|
70
|
+
css: _css.css.raw(iconRecipe.raw({
|
|
69
71
|
size
|
|
70
|
-
}),
|
|
72
|
+
}), cssProp),
|
|
73
|
+
...props,
|
|
71
74
|
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("title", {
|
|
72
75
|
children: title
|
|
73
76
|
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)("desc", {
|
package/lib/Input.d.ts
CHANGED
|
@@ -5,16 +5,17 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export
|
|
14
|
-
ref?: ((instance: HTMLInputElement | null) => void) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
15
|
-
}, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
16
|
-
interface TextAreaProps extends ComponentPropsWithRef<"textarea"> {
|
|
8
|
+
import { HTMLArkProps } from "@ark-ui/react";
|
|
9
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
|
+
export declare const InputContainer: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
11
|
+
forwardCssProp?: boolean | undefined;
|
|
12
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export interface InputProps extends HTMLArkProps<"input">, JsxStyleProps {
|
|
17
14
|
}
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
15
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
16
|
+
export declare const FormInput: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
17
|
+
interface TextAreaProps extends HTMLArkProps<"textarea">, JsxStyleProps {
|
|
18
|
+
}
|
|
19
|
+
export declare const TextArea: import("react").ForwardRefExoticComponent<TextAreaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
20
|
+
export declare const FormTextArea: import("react").ForwardRefExoticComponent<TextAreaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
20
21
|
export {};
|
package/lib/Input.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TextArea = exports.InputContainer = exports.Input = exports.FormTextArea = exports.FormInput = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
8
9
|
var _css = require("@ndla/styled-system/css");
|
|
9
10
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
10
11
|
var _util = require("@ndla/util");
|
|
@@ -57,7 +58,7 @@ const inputCss = _css.css.raw({
|
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
|
-
const StyledInputContainer = (0, _jsx2.styled)(
|
|
61
|
+
const StyledInputContainer = (0, _jsx2.styled)(_react2.ark.div, {
|
|
61
62
|
base: {
|
|
62
63
|
width: "100%",
|
|
63
64
|
display: "flex",
|
|
@@ -71,13 +72,13 @@ const StyledInputContainer = (0, _jsx2.styled)("div", {
|
|
|
71
72
|
const InputContainer = exports.InputContainer = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
72
73
|
let {
|
|
73
74
|
children,
|
|
74
|
-
|
|
75
|
+
css: cssProp,
|
|
75
76
|
...rest
|
|
76
77
|
} = _ref;
|
|
77
78
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InputContext.Provider, {
|
|
78
79
|
value: {},
|
|
79
80
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInputContainer, {
|
|
80
|
-
|
|
81
|
+
css: _css.css.raw(inputCss, cssProp),
|
|
81
82
|
...rest,
|
|
82
83
|
ref: ref,
|
|
83
84
|
children: children
|
|
@@ -108,14 +109,15 @@ const baseTextAreaCss = _css.css.raw({
|
|
|
108
109
|
resize: "none",
|
|
109
110
|
overflowY: "hidden"
|
|
110
111
|
});
|
|
112
|
+
const StyledInput = (0, _jsx2.styled)(_react2.ark.input);
|
|
111
113
|
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
112
114
|
let {
|
|
113
|
-
|
|
115
|
+
css: cssProp,
|
|
114
116
|
...props
|
|
115
117
|
} = _ref2;
|
|
116
118
|
const context = (0, _react.useContext)(InputContext);
|
|
117
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
118
|
-
|
|
119
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInput, {
|
|
120
|
+
css: _css.css.raw(baseInputCss, context ? undefined : inputCss, cssProp),
|
|
119
121
|
ref: ref,
|
|
120
122
|
...props
|
|
121
123
|
});
|
|
@@ -127,9 +129,10 @@ const FormInput = exports.FormInput = /*#__PURE__*/(0, _react.forwardRef)((props
|
|
|
127
129
|
ref: ref
|
|
128
130
|
});
|
|
129
131
|
});
|
|
132
|
+
const StyledTextArea = (0, _jsx2.styled)(_react2.ark.textarea);
|
|
130
133
|
const TextArea = exports.TextArea = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
131
134
|
let {
|
|
132
|
-
|
|
135
|
+
css: cssProp,
|
|
133
136
|
...props
|
|
134
137
|
} = _ref3;
|
|
135
138
|
const context = (0, _react.useContext)(InputContext);
|
|
@@ -150,8 +153,8 @@ const TextArea = exports.TextArea = /*#__PURE__*/(0, _react.forwardRef)((_ref3,
|
|
|
150
153
|
window.removeEventListener("resize", resize);
|
|
151
154
|
};
|
|
152
155
|
}, [resize]);
|
|
153
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
154
|
-
|
|
156
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTextArea, {
|
|
157
|
+
css: _css.css.raw(baseInputCss, context ? undefined : inputCss, baseTextAreaCss, cssProp),
|
|
155
158
|
ref: (0, _util.composeRefs)(ref, localRef),
|
|
156
159
|
...props
|
|
157
160
|
});
|
package/lib/Label.d.ts
CHANGED
|
@@ -5,12 +5,21 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { HTMLArkProps } from "@ark-ui/react";
|
|
9
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
9
10
|
import { TextProps } from "./Text";
|
|
10
|
-
export type LegendProps =
|
|
11
|
-
export declare const Legend: import("react").ForwardRefExoticComponent<Omit<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
11
|
+
export type LegendProps = HTMLArkProps<"legend"> & JsxStyleProps & TextProps;
|
|
12
|
+
export declare const Legend: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
13
|
+
forwardCssProp?: boolean | undefined;
|
|
14
|
+
} & import("@ndla/styled-system/types").WithCss & TextProps & import("react").RefAttributes<HTMLLegendElement>>;
|
|
15
|
+
export declare const FormLegend: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
16
|
+
forwardCssProp?: boolean | undefined;
|
|
17
|
+
} & import("@ndla/styled-system/types").WithCss & TextProps & import("react").RefAttributes<HTMLLegendElement>>;
|
|
18
|
+
export type LabelProps = HTMLArkProps<"label"> & TextProps & JsxStyleProps;
|
|
19
|
+
export declare const Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & TextProps & {
|
|
20
|
+
forwardCssProp?: boolean | undefined;
|
|
21
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLLabelElement>>;
|
|
22
|
+
export declare const FormLabel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & TextProps & {
|
|
23
|
+
forwardCssProp?: boolean | undefined;
|
|
24
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLLabelElement>>;
|
|
16
25
|
export declare const Fieldset: import("@ndla/styled-system/jsx").StyledComponent<"fieldset", {}>;
|
package/lib/Label.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Legend = exports.Label = exports.FormLegend = exports.FormLabel = exports.Fieldset = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
8
9
|
var _css = require("@ndla/styled-system/css");
|
|
9
10
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
10
11
|
var _FormControl = require("./FormControl");
|
|
@@ -17,7 +18,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
18
|
*
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
|
-
const StyledLegend = (0, _jsx2.styled)(
|
|
21
|
+
const StyledLegend = (0, _jsx2.styled)(_react2.ark.legend, {
|
|
21
22
|
base: {
|
|
22
23
|
float: "none",
|
|
23
24
|
width: "inherit",
|
|
@@ -30,16 +31,16 @@ const Legend = exports.Legend = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref)
|
|
|
30
31
|
let {
|
|
31
32
|
textStyle = "label.medium",
|
|
32
33
|
fontWeight = "bold",
|
|
33
|
-
|
|
34
|
+
css: cssProp,
|
|
34
35
|
srOnly,
|
|
35
36
|
...rest
|
|
36
37
|
} = _ref;
|
|
37
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledLegend, {
|
|
38
|
-
|
|
39
|
+
css: _css.css.raw({
|
|
39
40
|
textStyle,
|
|
40
41
|
fontWeight,
|
|
41
42
|
srOnly
|
|
42
|
-
}
|
|
43
|
+
}, cssProp),
|
|
43
44
|
...rest,
|
|
44
45
|
ref: ref
|
|
45
46
|
});
|
|
@@ -62,7 +63,7 @@ const FormLegend = exports.FormLegend = /*#__PURE__*/(0, _react.forwardRef)((pro
|
|
|
62
63
|
ref: ref
|
|
63
64
|
});
|
|
64
65
|
});
|
|
65
|
-
const StyledLabel = (0, _jsx2.styled)(
|
|
66
|
+
const StyledLabel = (0, _jsx2.styled)(_react2.ark.label, {
|
|
66
67
|
base: {
|
|
67
68
|
display: "inline-block",
|
|
68
69
|
_disabled: {
|
|
@@ -74,16 +75,16 @@ const Label = exports.Label = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =
|
|
|
74
75
|
let {
|
|
75
76
|
textStyle = "label.medium",
|
|
76
77
|
fontWeight = "bold",
|
|
77
|
-
|
|
78
|
+
css: cssProp,
|
|
78
79
|
srOnly,
|
|
79
80
|
...rest
|
|
80
81
|
} = _ref2;
|
|
81
82
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledLabel, {
|
|
82
|
-
|
|
83
|
+
css: _css.css.raw({
|
|
83
84
|
textStyle,
|
|
84
85
|
fontWeight,
|
|
85
86
|
srOnly
|
|
86
|
-
}
|
|
87
|
+
}, cssProp),
|
|
87
88
|
...rest,
|
|
88
89
|
ref: ref
|
|
89
90
|
});
|
package/lib/Menu.d.ts
CHANGED
|
@@ -6,20 +6,73 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { Menu } from "@ark-ui/react";
|
|
9
|
-
import {
|
|
9
|
+
import { JsxStyleProps, RecipeVariantProps } from "@ndla/styled-system/types";
|
|
10
10
|
import { TextProps } from "./Text";
|
|
11
|
+
declare const itemCva: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
12
|
+
variant: {
|
|
13
|
+
action: {
|
|
14
|
+
_hover: {
|
|
15
|
+
background: "surface.hover";
|
|
16
|
+
};
|
|
17
|
+
_highlighted: {
|
|
18
|
+
background: "surface.hover";
|
|
19
|
+
};
|
|
20
|
+
_active: {
|
|
21
|
+
background: "surface.active";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
destructive: {
|
|
25
|
+
color: "text.error";
|
|
26
|
+
"& svg": {
|
|
27
|
+
color: "icon.error";
|
|
28
|
+
};
|
|
29
|
+
_hover: {
|
|
30
|
+
color: "text.default";
|
|
31
|
+
"& svg": {
|
|
32
|
+
color: "icon.default";
|
|
33
|
+
};
|
|
34
|
+
background: "surface.errorSubtle.hover";
|
|
35
|
+
};
|
|
36
|
+
_highlighted: {
|
|
37
|
+
color: "text.default";
|
|
38
|
+
"& svg": {
|
|
39
|
+
color: "icon.default";
|
|
40
|
+
};
|
|
41
|
+
background: "surface.errorSubtle.hover";
|
|
42
|
+
};
|
|
43
|
+
_active: {
|
|
44
|
+
background: "surface.errorSubtle.active";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
11
49
|
export type MenuRootProps = Menu.RootProps;
|
|
12
|
-
export declare const MenuRoot: ({ lazyMount, unmountOnExit, ...props }: MenuRootProps) => import("
|
|
13
|
-
export declare const MenuContent: import("react").ForwardRefExoticComponent<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export declare const
|
|
50
|
+
export declare const MenuRoot: ({ lazyMount, unmountOnExit, ...props }: MenuRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare const MenuContent: import("react").ForwardRefExoticComponent<{
|
|
52
|
+
forwardCssProp?: boolean | undefined;
|
|
53
|
+
} & import("@ndla/styled-system/types").WithCss & Menu.ContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
|
+
export declare const MenuItemGroupLabel: ({ textStyle, fontWeight, children, ...props }: Menu.ItemGroupLabelProps & JsxStyleProps & TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export declare const MenuItemGroup: import("react").ForwardRefExoticComponent<{
|
|
56
|
+
forwardCssProp?: boolean | undefined;
|
|
57
|
+
} & import("@ndla/styled-system/types").WithCss & Menu.ItemGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
58
|
+
export type MenuItemVariantProps = RecipeVariantProps<typeof itemCva>;
|
|
59
|
+
export declare const MenuItem: import("react").ForwardRefExoticComponent<Menu.ItemProps & {
|
|
60
|
+
forwardCssProp?: boolean | undefined;
|
|
61
|
+
} & import("@ndla/styled-system/types").WithCss & {
|
|
18
62
|
variant?: "action" | "destructive" | undefined;
|
|
19
|
-
}
|
|
20
|
-
export declare const MenuPositioner: import("react").ForwardRefExoticComponent<
|
|
21
|
-
|
|
63
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
64
|
+
export declare const MenuPositioner: import("react").ForwardRefExoticComponent<{
|
|
65
|
+
forwardCssProp?: boolean | undefined;
|
|
66
|
+
} & import("@ndla/styled-system/types").WithCss & Menu.PositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
67
|
+
export declare const MenuTriggerItem: import("react").ForwardRefExoticComponent<Menu.TriggerItemProps & {
|
|
68
|
+
forwardCssProp?: boolean | undefined;
|
|
69
|
+
} & import("@ndla/styled-system/types").WithCss & {
|
|
22
70
|
variant?: "action" | "destructive" | undefined;
|
|
23
|
-
}
|
|
24
|
-
export declare const MenuTrigger: import("react").ForwardRefExoticComponent<
|
|
25
|
-
|
|
71
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
72
|
+
export declare const MenuTrigger: import("react").ForwardRefExoticComponent<{
|
|
73
|
+
forwardCssProp?: boolean | undefined;
|
|
74
|
+
} & import("@ndla/styled-system/types").WithCss & Menu.TriggerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
75
|
+
export declare const MenuSeparator: import("react").ForwardRefExoticComponent<{
|
|
76
|
+
forwardCssProp?: boolean | undefined;
|
|
77
|
+
} & import("@ndla/styled-system/types").WithCss & Menu.SeparatorProps & import("react").RefAttributes<HTMLHRElement>>;
|
|
78
|
+
export {};
|
package/lib/Menu.js
CHANGED
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MenuTriggerItem = exports.MenuTrigger = exports.MenuSeparator = exports.MenuRoot = exports.MenuPositioner = exports.MenuItemGroupLabel = exports.MenuItemGroup = exports.MenuItem = exports.MenuContent = void 0;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _anatomy = require("@ark-ui/anatomy");
|
|
8
|
-
var
|
|
9
|
+
var _react2 = require("@ark-ui/react");
|
|
9
10
|
var _css = require("@ndla/styled-system/css");
|
|
10
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
11
11
|
var _createStyleContext = require("./createStyleContext");
|
|
12
12
|
var _Text = require("./Text");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -19,7 +19,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
const itemStyle = {
|
|
22
|
+
const itemStyle = _css.css.raw({
|
|
23
23
|
display: "flex",
|
|
24
24
|
alignItems: "center",
|
|
25
25
|
borderRadius: "xsmall",
|
|
@@ -53,7 +53,7 @@ const itemStyle = {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
};
|
|
56
|
+
});
|
|
57
57
|
const itemCva = (0, _css.cva)({
|
|
58
58
|
defaultVariants: {
|
|
59
59
|
variant: "action"
|
|
@@ -135,7 +135,7 @@ const {
|
|
|
135
135
|
withRootProvider,
|
|
136
136
|
withContext
|
|
137
137
|
} = (0, _createStyleContext.createStyleContext)(menuRecipe);
|
|
138
|
-
const InternalMenuRoot = withRootProvider(
|
|
138
|
+
const InternalMenuRoot = withRootProvider(_react2.Menu.Root);
|
|
139
139
|
const MenuRoot = _ref => {
|
|
140
140
|
let {
|
|
141
141
|
lazyMount = true,
|
|
@@ -149,8 +149,8 @@ const MenuRoot = _ref => {
|
|
|
149
149
|
});
|
|
150
150
|
};
|
|
151
151
|
exports.MenuRoot = MenuRoot;
|
|
152
|
-
const MenuContent = exports.MenuContent = withContext(
|
|
153
|
-
const InternalMenuItemGroupLabel = withContext(
|
|
152
|
+
const MenuContent = exports.MenuContent = withContext(_react2.Menu.Content, "content");
|
|
153
|
+
const InternalMenuItemGroupLabel = withContext(_react2.Menu.ItemGroupLabel, "itemGroupLabel");
|
|
154
154
|
const MenuItemGroupLabel = _ref2 => {
|
|
155
155
|
let {
|
|
156
156
|
textStyle = "label.medium",
|
|
@@ -169,11 +169,37 @@ const MenuItemGroupLabel = _ref2 => {
|
|
|
169
169
|
});
|
|
170
170
|
};
|
|
171
171
|
exports.MenuItemGroupLabel = MenuItemGroupLabel;
|
|
172
|
-
const MenuItemGroup = exports.MenuItemGroup = withContext(
|
|
173
|
-
const InternalMenuItem = withContext(
|
|
174
|
-
const MenuItem = exports.MenuItem = (0,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
172
|
+
const MenuItemGroup = exports.MenuItemGroup = withContext(_react2.Menu.ItemGroup, "itemGroup");
|
|
173
|
+
const InternalMenuItem = withContext(_react2.Menu.Item, "item");
|
|
174
|
+
const MenuItem = exports.MenuItem = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
175
|
+
let {
|
|
176
|
+
css: cssProp = {},
|
|
177
|
+
variant,
|
|
178
|
+
...props
|
|
179
|
+
} = _ref3;
|
|
180
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalMenuItem, {
|
|
181
|
+
css: [itemCva.raw({
|
|
182
|
+
variant
|
|
183
|
+
}), ...(Array.isArray(cssProp) ? cssProp : [cssProp])],
|
|
184
|
+
...props,
|
|
185
|
+
ref: ref
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
const MenuPositioner = exports.MenuPositioner = withContext(_react2.Menu.Positioner, "positioner");
|
|
189
|
+
const InternalMenuTriggerItem = withContext(_react2.Menu.TriggerItem, "triggerItem");
|
|
190
|
+
const MenuTriggerItem = exports.MenuTriggerItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
191
|
+
let {
|
|
192
|
+
css: cssProp = {},
|
|
193
|
+
variant,
|
|
194
|
+
...props
|
|
195
|
+
} = _ref4;
|
|
196
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalMenuTriggerItem, {
|
|
197
|
+
css: [itemCva.raw({
|
|
198
|
+
variant
|
|
199
|
+
}), ...(Array.isArray(cssProp) ? cssProp : [cssProp])],
|
|
200
|
+
...props,
|
|
201
|
+
ref: ref
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
const MenuTrigger = exports.MenuTrigger = withContext(_react2.Menu.Trigger, "trigger");
|
|
205
|
+
const MenuSeparator = exports.MenuSeparator = withContext(_react2.Menu.Separator, "separator");
|
package/lib/MessageBox.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import { RecipeVariantProps } from "@ndla/styled-system/types";
|
|
8
|
+
import { HTMLArkProps } from "@ark-ui/react";
|
|
9
|
+
import { JsxStyleProps, RecipeVariantProps } from "@ndla/styled-system/types";
|
|
10
10
|
declare const messageBoxRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
11
11
|
variant: {
|
|
12
12
|
info: {
|
|
@@ -28,6 +28,10 @@ declare const messageBoxRecipe: import("@ndla/styled-system/types").RecipeRuntim
|
|
|
28
28
|
};
|
|
29
29
|
}>;
|
|
30
30
|
export type MessageBoxVariantProps = RecipeVariantProps<typeof messageBoxRecipe>;
|
|
31
|
-
export type MessageBoxProps =
|
|
32
|
-
export declare const MessageBox:
|
|
31
|
+
export type MessageBoxProps = HTMLArkProps<"div"> & JsxStyleProps & MessageBoxVariantProps;
|
|
32
|
+
export declare const MessageBox: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
33
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
34
|
+
} & import("@ark-ui/react").PolymorphicProps>, {
|
|
35
|
+
variant?: "error" | "success" | "info" | "warning" | undefined;
|
|
36
|
+
}>;
|
|
33
37
|
export {};
|
package/lib/MessageBox.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MessageBox = void 0;
|
|
7
|
+
var _react = require("@ark-ui/react");
|
|
7
8
|
var _css = require("@ndla/styled-system/css");
|
|
8
|
-
var
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
var _jsx = require("@ndla/styled-system/jsx");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2024-present, NDLA.
|
|
12
12
|
*
|
|
@@ -48,17 +48,4 @@ const messageBoxRecipe = (0, _css.cva)({
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
const MessageBox =
|
|
52
|
-
let {
|
|
53
|
-
className,
|
|
54
|
-
variant,
|
|
55
|
-
...rest
|
|
56
|
-
} = _ref;
|
|
57
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsx2.styled.div, {
|
|
58
|
-
className: (0, _css.cx)(messageBoxRecipe({
|
|
59
|
-
variant
|
|
60
|
-
}), className),
|
|
61
|
-
...rest
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
exports.MessageBox = MessageBox;
|
|
51
|
+
const MessageBox = exports.MessageBox = (0, _jsx.styled)(_react.ark.div, messageBoxRecipe);
|
package/lib/NdlaLogo.d.ts
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ComponentPropsWithoutRef } from "react";
|
|
9
9
|
import { ColorToken } from "@ndla/styled-system/tokens";
|
|
10
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
11
|
export type LogoProps = ComponentPropsWithoutRef<"svg"> & {
|
|
11
12
|
color?: ColorToken;
|
|
12
|
-
};
|
|
13
|
-
export declare const NdlaLogoEn: (props: LogoProps) => import("
|
|
14
|
-
export declare const NdlaLogoNb: (props: LogoProps) => import("
|
|
15
|
-
export declare const NdlaLogoText: (props: LogoProps) => import("
|
|
13
|
+
} & JsxStyleProps;
|
|
14
|
+
export declare const NdlaLogoEn: (props: LogoProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const NdlaLogoNb: (props: LogoProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const NdlaLogoText: (props: LogoProps) => import("react/jsx-runtime").JSX.Element;
|
package/lib/NdlaLogo.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.NdlaLogoText = exports.NdlaLogoNb = exports.NdlaLogoEn = void 0;
|
|
7
7
|
var _css = require("@ndla/styled-system/css");
|
|
8
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
/**
|
|
10
11
|
* Copyright (c) 2024-present, NDLA.
|
|
@@ -17,14 +18,14 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
18
|
const BaseSvg = _ref => {
|
|
18
19
|
let {
|
|
19
20
|
color = "primary",
|
|
20
|
-
|
|
21
|
+
css: cssProp,
|
|
21
22
|
...props
|
|
22
23
|
} = _ref;
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsx2.styled.svg, {
|
|
24
25
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
-
|
|
26
|
+
css: _css.css.raw({
|
|
26
27
|
color
|
|
27
|
-
}
|
|
28
|
+
}, cssProp),
|
|
28
29
|
...props
|
|
29
30
|
});
|
|
30
31
|
};
|
package/lib/Pagination.d.ts
CHANGED
|
@@ -6,9 +6,20 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { Pagination } from "@ark-ui/react";
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
9
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
|
+
export type PaginationRootProps = JsxStyleProps & Pagination.RootProps;
|
|
11
|
+
export declare const PaginationRoot: import("react").ForwardRefExoticComponent<{
|
|
12
|
+
forwardCssProp?: boolean | undefined;
|
|
13
|
+
} & import("@ndla/styled-system/types").WithCss & Pagination.RootProps & import("react").RefAttributes<HTMLElement>>;
|
|
14
|
+
export declare const PaginationItem: import("react").ForwardRefExoticComponent<{
|
|
15
|
+
forwardCssProp?: boolean | undefined;
|
|
16
|
+
} & import("@ndla/styled-system/types").WithCss & Pagination.ItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export declare const PaginationEllipsis: import("react").ForwardRefExoticComponent<{
|
|
18
|
+
forwardCssProp?: boolean | undefined;
|
|
19
|
+
} & import("@ndla/styled-system/types").WithCss & Pagination.EllipsisProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export declare const PaginationPrevTrigger: import("react").ForwardRefExoticComponent<{
|
|
21
|
+
forwardCssProp?: boolean | undefined;
|
|
22
|
+
} & import("@ndla/styled-system/types").WithCss & Pagination.PrevTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
export declare const PaginationNextTrigger: import("react").ForwardRefExoticComponent<{
|
|
24
|
+
forwardCssProp?: boolean | undefined;
|
|
25
|
+
} & import("@ndla/styled-system/types").WithCss & Pagination.NextTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
package/lib/Popover.d.ts
CHANGED
|
@@ -6,17 +6,38 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { Popover } from "@ark-ui/react";
|
|
9
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
9
10
|
export type PopoverRootProps = Popover.RootProps;
|
|
10
|
-
export declare const PopoverRoot: ({ lazyMount, unmountOnExit, ...props }: PopoverRootProps) => import("
|
|
11
|
-
export declare const PopoverAnchor: import("react").ForwardRefExoticComponent<Popover.AnchorProps &
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export declare const
|
|
22
|
-
|
|
11
|
+
export declare const PopoverRoot: ({ lazyMount, unmountOnExit, ...props }: PopoverRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const PopoverAnchor: import("react").ForwardRefExoticComponent<Popover.AnchorProps & {
|
|
13
|
+
forwardCssProp?: boolean | undefined;
|
|
14
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const PopoverArrowStandalone: import("react").ForwardRefExoticComponent<Popover.ArrowProps & {
|
|
16
|
+
forwardCssProp?: boolean | undefined;
|
|
17
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare const PopoverArrow: (props: Popover.ArrowTipProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const PopoverArrowTip: import("react").ForwardRefExoticComponent<Popover.ArrowTipProps & {
|
|
20
|
+
forwardCssProp?: boolean | undefined;
|
|
21
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export declare const PopoverCloseTrigger: import("react").ForwardRefExoticComponent<Popover.CloseTriggerProps & {
|
|
23
|
+
forwardCssProp?: boolean | undefined;
|
|
24
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
export declare const PopoverContentStandalone: import("react").ForwardRefExoticComponent<Popover.ContentProps & {
|
|
26
|
+
forwardCssProp?: boolean | undefined;
|
|
27
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export declare const PopoverContent: (props: Popover.ContentProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const PopoverDescription: import("react").ForwardRefExoticComponent<Popover.DescriptionProps & {
|
|
30
|
+
forwardCssProp?: boolean | undefined;
|
|
31
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
32
|
+
export declare const PopoverIndicator: import("react").ForwardRefExoticComponent<Popover.IndicatorProps & {
|
|
33
|
+
forwardCssProp?: boolean | undefined;
|
|
34
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
35
|
+
export declare const PopoverPositioner: import("react").ForwardRefExoticComponent<Popover.PositionerProps & {
|
|
36
|
+
forwardCssProp?: boolean | undefined;
|
|
37
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export declare const PopoverTitle: import("react").ForwardRefExoticComponent<Popover.TitleProps & {
|
|
39
|
+
forwardCssProp?: boolean | undefined;
|
|
40
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
+
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<Popover.TriggerProps & {
|
|
42
|
+
forwardCssProp?: boolean | undefined;
|
|
43
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLButtonElement>>;
|