@ndla/primitives 0.0.2 → 0.0.4
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 +95 -25
- package/dist/styles.css +340 -50
- package/es/ArticleLists.js +4 -32
- package/es/Badge.js +4 -16
- package/es/BlockQuote.js +5 -17
- package/es/Button.js +40 -33
- package/es/Checkbox.js +160 -51
- package/es/Dialog.js +6 -7
- package/es/ExpandableBox.js +4 -17
- package/es/Field.js +17 -0
- package/es/FieldErrorMessage.js +12 -16
- package/es/FieldHelper.js +9 -12
- package/es/FramedContent.js +3 -15
- package/es/Icon.js +9 -6
- package/es/Input.js +25 -23
- package/es/Label.js +15 -39
- package/es/Menu.js +32 -6
- package/es/MessageBox.js +3 -15
- package/es/NdlaLogo.js +6 -5
- package/es/RadioGroup.js +7 -11
- package/es/Skeleton.js +2 -8
- package/es/Spinner.js +3 -15
- package/es/Switch.js +8 -15
- package/es/Table.js +2 -5
- package/es/Tabs.js +231 -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 +9 -3
- package/lib/BlockQuote.js +5 -18
- package/lib/Button.d.ts +24 -11
- package/lib/Button.js +39 -32
- package/lib/Checkbox.d.ts +172 -5
- package/lib/Checkbox.js +165 -56
- 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/Field.d.ts +9 -0
- package/lib/Field.js +23 -0
- package/lib/FieldErrorMessage.d.ts +3 -3
- package/lib/FieldErrorMessage.js +11 -15
- package/lib/FieldHelper.d.ts +3 -3
- package/lib/FieldHelper.js +8 -11
- 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 +25 -23
- package/lib/Label.d.ts +13 -7
- package/lib/Label.js +15 -39
- 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 +7 -11
- 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 +13 -20
- package/lib/Table.d.ts +6 -3
- package/lib/Table.js +4 -8
- package/lib/Tabs.d.ts +145 -0
- package/lib/Tabs.js +239 -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/es/FormControl.js +0 -163
- package/lib/FormControl.d.ts +0 -65
- package/lib/FormControl.js +0 -173
package/lib/Dialog.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Dialog } from "@ark-ui/react";
|
|
9
9
|
import { RecipeVariantProps } from "@ndla/styled-system/css";
|
|
10
|
-
import {
|
|
10
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
11
11
|
import { TextProps } from "./Text";
|
|
12
|
-
declare const dialogRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"content" | "
|
|
12
|
+
declare const dialogRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"title" | "description" | "content" | "trigger" | "backdrop" | "positioner" | "closeTrigger", {
|
|
13
13
|
variant: {
|
|
14
14
|
drawer: {
|
|
15
15
|
content: {
|
|
@@ -92,14 +92,22 @@ export declare const InternalDialogRoot: (props: Dialog.RootProps & {
|
|
|
92
92
|
variant?: "dialog" | "drawer" | undefined;
|
|
93
93
|
position?: "center" | "bottom" | "left" | "right" | "top" | undefined;
|
|
94
94
|
size?: "small" | "xsmall" | "medium" | "large" | "full" | undefined;
|
|
95
|
-
}) => import("
|
|
96
|
-
export declare const DialogRoot: ({ lazyMount, unmountOnExit, ...props }: DialogRootProps) => import("
|
|
97
|
-
export declare const DialogBackdrop: import("react").ForwardRefExoticComponent<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
export declare const
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
export declare const DialogRoot: ({ lazyMount, unmountOnExit, ...props }: DialogRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
export declare const DialogBackdrop: import("react").ForwardRefExoticComponent<{
|
|
98
|
+
forwardCssProp?: boolean | undefined;
|
|
99
|
+
} & import("@ndla/styled-system/types").WithCss & Dialog.BackdropProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
100
|
+
export declare const DialogStandaloneContent: import("react").ForwardRefExoticComponent<{
|
|
101
|
+
forwardCssProp?: boolean | undefined;
|
|
102
|
+
} & import("@ndla/styled-system/types").WithCss & Dialog.ContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
103
|
+
export declare const DialogPositioner: import("react").ForwardRefExoticComponent<{
|
|
104
|
+
forwardCssProp?: boolean | undefined;
|
|
105
|
+
} & import("@ndla/styled-system/types").WithCss & Dialog.PositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
106
|
+
export declare const DialogContent: import("react").ForwardRefExoticComponent<Dialog.ContentProps & {
|
|
107
|
+
forwardCssProp?: boolean | undefined;
|
|
108
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
109
|
+
export declare const DialogDescription: ({ textStyle, ...rest }: Dialog.DescriptionProps & TextProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
export declare const DialogTitle: ({ textStyle, ...rest }: Dialog.TitleProps & TextProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
103
111
|
export declare const DialogTrigger: import("react").ForwardRefExoticComponent<Dialog.TriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
104
112
|
export declare const DialogCloseTrigger: import("react").ForwardRefExoticComponent<Dialog.CloseTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
105
113
|
export declare const DialogHeader: import("@ndla/styled-system/jsx").StyledComponent<"div", {}>;
|
package/lib/Dialog.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.InternalDialogRoot = exports.DialogTrigger = exports.DialogTitle = exports.DialogStandaloneContent = exports.DialogRoot = exports.DialogPositioner = exports.DialogHeader = exports.DialogDescription = exports.DialogContent = exports.DialogCloseTrigger = exports.DialogBody = exports.DialogBackdrop = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _anatomy = require("@ark-ui/anatomy");
|
|
8
9
|
var _react2 = require("@ark-ui/react");
|
|
9
10
|
var _css = require("@ndla/styled-system/css");
|
|
10
11
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
@@ -20,9 +21,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
20
21
|
*/
|
|
21
22
|
|
|
22
23
|
const dialogRecipe = (0, _css.sva)({
|
|
23
|
-
|
|
24
|
-
slots: ["positioner", "backdrop", "content"],
|
|
25
|
-
className: "dialog",
|
|
24
|
+
slots: _anatomy.dialogAnatomy.keys(),
|
|
26
25
|
base: {
|
|
27
26
|
backdrop: {
|
|
28
27
|
position: "fixed",
|
|
@@ -285,30 +284,30 @@ const DialogContent = exports.DialogContent = /*#__PURE__*/(0, _react.forwardRef
|
|
|
285
284
|
})
|
|
286
285
|
})]
|
|
287
286
|
}));
|
|
287
|
+
const InternalDialogDescription = withContext(_react2.Dialog.Description, "description");
|
|
288
288
|
const DialogDescription = _ref2 => {
|
|
289
289
|
let {
|
|
290
290
|
textStyle = "body.large",
|
|
291
291
|
...rest
|
|
292
292
|
} = _ref2;
|
|
293
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
293
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalDialogDescription, {
|
|
294
294
|
asChild: true,
|
|
295
295
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
296
|
-
as: "p",
|
|
297
296
|
textStyle: textStyle,
|
|
298
297
|
...rest
|
|
299
298
|
})
|
|
300
299
|
});
|
|
301
300
|
};
|
|
302
301
|
exports.DialogDescription = DialogDescription;
|
|
302
|
+
const InternalDialogTitle = withContext(_react2.Dialog.Title, "title");
|
|
303
303
|
const DialogTitle = _ref3 => {
|
|
304
304
|
let {
|
|
305
305
|
textStyle = "title.medium",
|
|
306
306
|
...rest
|
|
307
307
|
} = _ref3;
|
|
308
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
308
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalDialogTitle, {
|
|
309
309
|
asChild: true,
|
|
310
310
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Heading, {
|
|
311
|
-
as: "h1",
|
|
312
311
|
textStyle: textStyle,
|
|
313
312
|
...rest
|
|
314
313
|
})
|
package/lib/ExpandableBox.d.ts
CHANGED
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
8
|
+
import { HTMLArkProps } from "@ark-ui/react";
|
|
9
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
|
+
export type ExpandableBoxProps = HTMLArkProps<"details"> & JsxStyleProps;
|
|
11
|
+
export declare const ExpandableBox: import("@ndla/styled-system/jsx").StyledComponent<"details", {}>;
|
|
12
|
+
export type ExpandableBoxSummaryProps = HTMLArkProps<"summary"> & JsxStyleProps;
|
|
13
|
+
export declare const ExpandableBoxSummary: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
14
|
+
ref?: ((instance: HTMLElement | null) => void) | import("react").RefObject<HTMLElement> | null | undefined;
|
|
15
|
+
} & import("@ark-ui/react").PolymorphicProps>, {}>;
|
package/lib/ExpandableBox.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ExpandableBoxSummary = exports.ExpandableBox = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _react = require("@ark-ui/react");
|
|
8
|
+
var _jsx = require("@ndla/styled-system/jsx");
|
|
9
9
|
/**
|
|
10
10
|
* Copyright (c) 2024-present, NDLA.
|
|
11
11
|
*
|
|
@@ -14,7 +14,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const ExpandableBox = exports.ExpandableBox = (0, _jsx.styled)("details", {
|
|
18
18
|
base: {
|
|
19
19
|
transitionDuration: "fast",
|
|
20
20
|
width: "100%",
|
|
@@ -31,11 +31,7 @@ const StyledExpandableBox = (0, _jsx2.styled)("details", {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
const
|
|
35
|
-
...props
|
|
36
|
-
});
|
|
37
|
-
exports.ExpandableBox = ExpandableBox;
|
|
38
|
-
const StyledExpandableBoxSummary = (0, _jsx2.styled)("summary", {
|
|
34
|
+
const ExpandableBoxSummary = exports.ExpandableBoxSummary = (0, _jsx.styled)(_react.ark.summary, {
|
|
39
35
|
base: {
|
|
40
36
|
cursor: "pointer",
|
|
41
37
|
margin: "-medium",
|
|
@@ -49,15 +45,4 @@ const StyledExpandableBoxSummary = (0, _jsx2.styled)("summary", {
|
|
|
49
45
|
textStyle: "label.large!"
|
|
50
46
|
}
|
|
51
47
|
}
|
|
52
|
-
});
|
|
53
|
-
const ExpandableBoxSummary = _ref => {
|
|
54
|
-
let {
|
|
55
|
-
children,
|
|
56
|
-
...rest
|
|
57
|
-
} = _ref;
|
|
58
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledExpandableBoxSummary, {
|
|
59
|
-
...rest,
|
|
60
|
-
children: children
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
exports.ExpandableBoxSummary = ExpandableBoxSummary;
|
|
48
|
+
});
|
package/lib/Field.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
import { Field } from "@ark-ui/react";
|
|
9
|
+
export declare const FieldRoot: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Field.RootProps & import("react").RefAttributes<HTMLDivElement>>, {}>;
|
package/lib/Field.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FieldRoot = void 0;
|
|
7
|
+
var _react = require("@ark-ui/react");
|
|
8
|
+
var _jsx = require("@ndla/styled-system/jsx");
|
|
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 FieldRoot = exports.FieldRoot = (0, _jsx.styled)(_react.Field.Root, {
|
|
18
|
+
base: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
gap: "3xsmall"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { TextProps } from "./Text";
|
|
9
|
-
export declare const FieldErrorMessage: import("react").ForwardRefExoticComponent<
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
export declare const FieldErrorMessage: import("react").ForwardRefExoticComponent<TextProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
10
|
+
forwardCssProp?: boolean | undefined;
|
|
11
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLSpanElement>>;
|
package/lib/FieldErrorMessage.js
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FieldErrorMessage = 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
|
-
var _FormControl = require("./FormControl");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
/**
|
|
13
13
|
* Copyright (c) 2024-present, NDLA.
|
|
@@ -17,34 +17,30 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const StyledErrorText = (0, _jsx2.styled)(_react2.Field.ErrorText, {
|
|
21
21
|
base: {
|
|
22
22
|
color: "text.error",
|
|
23
|
-
whiteSpace: "pre-line"
|
|
23
|
+
whiteSpace: "pre-line",
|
|
24
|
+
justifyContent: "center"
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
27
|
const FieldErrorMessage = exports.FieldErrorMessage = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
27
|
-
var _field$getErrorMessag;
|
|
28
28
|
let {
|
|
29
29
|
textStyle = "label.small",
|
|
30
30
|
fontWeight,
|
|
31
|
+
css: cssProp,
|
|
31
32
|
color,
|
|
32
33
|
srOnly,
|
|
33
|
-
className,
|
|
34
34
|
...props
|
|
35
35
|
} = _ref;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledErrorMessage, {
|
|
39
|
-
...((_field$getErrorMessag = field === null || field === void 0 ? void 0 : field.getErrorMessageProps(props, ref)) !== null && _field$getErrorMessag !== void 0 ? _field$getErrorMessag : {
|
|
40
|
-
ref,
|
|
41
|
-
...props
|
|
42
|
-
}),
|
|
43
|
-
className: (0, _css.cx)((0, _css.css)({
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledErrorText, {
|
|
37
|
+
css: _css.css.raw({
|
|
44
38
|
textStyle,
|
|
45
39
|
fontWeight,
|
|
46
40
|
color,
|
|
47
|
-
srOnly
|
|
48
|
-
}
|
|
41
|
+
srOnly
|
|
42
|
+
}, cssProp),
|
|
43
|
+
...props,
|
|
44
|
+
ref: ref
|
|
49
45
|
});
|
|
50
46
|
});
|
package/lib/FieldHelper.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { TextProps } from "./Text";
|
|
9
|
-
export declare const FieldHelper: import("react").ForwardRefExoticComponent<
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
export declare const FieldHelper: import("react").ForwardRefExoticComponent<TextProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
10
|
+
forwardCssProp?: boolean | undefined;
|
|
11
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
package/lib/FieldHelper.js
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FieldHelper = 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
|
-
var _FormControl = require("./FormControl");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
/**
|
|
13
13
|
* Copyright (c) 2024-present, NDLA.
|
|
@@ -17,27 +17,24 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
+
const StyledFieldHelper = (0, _jsx2.styled)(_react2.Field.HelperText);
|
|
20
21
|
const FieldHelper = exports.FieldHelper = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
21
|
-
var _field$getHelpTextPro;
|
|
22
22
|
let {
|
|
23
23
|
textStyle = "label.small",
|
|
24
24
|
fontWeight,
|
|
25
25
|
color,
|
|
26
26
|
srOnly,
|
|
27
|
-
|
|
27
|
+
css: cssProp,
|
|
28
28
|
...props
|
|
29
29
|
} = _ref;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
...((_field$getHelpTextPro = field === null || field === void 0 ? void 0 : field.getHelpTextProps(props, ref)) !== null && _field$getHelpTextPro !== void 0 ? _field$getHelpTextPro : {
|
|
33
|
-
ref,
|
|
34
|
-
...props
|
|
35
|
-
}),
|
|
36
|
-
className: (0, _css.cx)((0, _css.css)({
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledFieldHelper, {
|
|
31
|
+
css: _css.css.raw({
|
|
37
32
|
textStyle,
|
|
38
33
|
fontWeight,
|
|
39
34
|
color,
|
|
40
35
|
srOnly
|
|
41
|
-
}
|
|
36
|
+
}, cssProp),
|
|
37
|
+
...props,
|
|
38
|
+
ref: ref
|
|
42
39
|
});
|
|
43
40
|
});
|
package/lib/FramedContent.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 framedContentRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
11
11
|
colorTheme: {
|
|
12
12
|
neutral: {
|
|
@@ -27,6 +27,10 @@ declare const framedContentRecipe: import("@ndla/styled-system/types").RecipeRun
|
|
|
27
27
|
};
|
|
28
28
|
}>;
|
|
29
29
|
export type FramedContentVariantProps = RecipeVariantProps<typeof framedContentRecipe>;
|
|
30
|
-
export type FramedContentProps =
|
|
31
|
-
export declare const FramedContent:
|
|
30
|
+
export type FramedContentProps = HTMLArkProps<"div"> & JsxStyleProps & FramedContentVariantProps;
|
|
31
|
+
export declare const FramedContent: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
32
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
33
|
+
} & import("@ark-ui/react").PolymorphicProps>, {
|
|
34
|
+
colorTheme?: "neutral" | "brand1" | "brand2" | undefined;
|
|
35
|
+
}>;
|
|
32
36
|
export {};
|
package/lib/FramedContent.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.FramedContent = 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
|
*
|
|
@@ -45,17 +45,4 @@ const framedContentRecipe = (0, _css.cva)({
|
|
|
45
45
|
colorTheme: "neutral"
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
const FramedContent =
|
|
49
|
-
let {
|
|
50
|
-
className,
|
|
51
|
-
colorTheme,
|
|
52
|
-
...rest
|
|
53
|
-
} = _ref;
|
|
54
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsx2.styled.div, {
|
|
55
|
-
className: (0, _css.cx)(framedContentRecipe({
|
|
56
|
-
colorTheme
|
|
57
|
-
}), className),
|
|
58
|
-
...rest
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
exports.FramedContent = FramedContent;
|
|
48
|
+
const FramedContent = exports.FramedContent = (0, _jsx.styled)(_react.ark.div, framedContentRecipe);
|
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 FieldInput: 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 FieldTextArea: import("react").ForwardRefExoticComponent<TextAreaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
20
21
|
export {};
|
package/lib/Input.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TextArea = exports.InputContainer = exports.Input = exports.
|
|
6
|
+
exports.TextArea = exports.InputContainer = exports.Input = exports.FieldTextArea = exports.FieldInput = 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");
|
|
11
|
-
var _FormControl = require("./FormControl");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
/**
|
|
14
14
|
* Copyright (c) 2024-present, NDLA.
|
|
@@ -57,7 +57,7 @@ const inputCss = _css.css.raw({
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
const StyledInputContainer = (0, _jsx2.styled)(
|
|
60
|
+
const StyledInputContainer = (0, _jsx2.styled)(_react2.ark.div, {
|
|
61
61
|
base: {
|
|
62
62
|
width: "100%",
|
|
63
63
|
display: "flex",
|
|
@@ -71,13 +71,13 @@ const StyledInputContainer = (0, _jsx2.styled)("div", {
|
|
|
71
71
|
const InputContainer = exports.InputContainer = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
72
72
|
let {
|
|
73
73
|
children,
|
|
74
|
-
|
|
74
|
+
css: cssProp,
|
|
75
75
|
...rest
|
|
76
76
|
} = _ref;
|
|
77
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InputContext.Provider, {
|
|
78
78
|
value: {},
|
|
79
79
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInputContainer, {
|
|
80
|
-
|
|
80
|
+
css: _css.css.raw(inputCss, cssProp),
|
|
81
81
|
...rest,
|
|
82
82
|
ref: ref,
|
|
83
83
|
children: children
|
|
@@ -108,28 +108,30 @@ const baseTextAreaCss = _css.css.raw({
|
|
|
108
108
|
resize: "none",
|
|
109
109
|
overflowY: "hidden"
|
|
110
110
|
});
|
|
111
|
+
const StyledInput = (0, _jsx2.styled)(_react2.ark.input);
|
|
111
112
|
const Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
112
113
|
let {
|
|
113
|
-
|
|
114
|
+
css: cssProp,
|
|
114
115
|
...props
|
|
115
116
|
} = _ref2;
|
|
116
117
|
const context = (0, _react.useContext)(InputContext);
|
|
117
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
118
|
-
|
|
118
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInput, {
|
|
119
|
+
css: _css.css.raw(baseInputCss, context ? undefined : inputCss, cssProp),
|
|
119
120
|
ref: ref,
|
|
120
121
|
...props
|
|
121
122
|
});
|
|
122
123
|
});
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
...
|
|
124
|
+
const FieldInput = exports.FieldInput = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Field.Input, {
|
|
125
|
+
asChild: true,
|
|
126
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Input, {
|
|
127
|
+
...props,
|
|
127
128
|
ref: ref
|
|
128
|
-
})
|
|
129
|
-
});
|
|
129
|
+
})
|
|
130
|
+
}));
|
|
131
|
+
const StyledTextArea = (0, _jsx2.styled)(_react2.ark.textarea);
|
|
130
132
|
const TextArea = exports.TextArea = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
131
133
|
let {
|
|
132
|
-
|
|
134
|
+
css: cssProp,
|
|
133
135
|
...props
|
|
134
136
|
} = _ref3;
|
|
135
137
|
const context = (0, _react.useContext)(InputContext);
|
|
@@ -150,16 +152,16 @@ const TextArea = exports.TextArea = /*#__PURE__*/(0, _react.forwardRef)((_ref3,
|
|
|
150
152
|
window.removeEventListener("resize", resize);
|
|
151
153
|
};
|
|
152
154
|
}, [resize]);
|
|
153
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
154
|
-
|
|
155
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTextArea, {
|
|
156
|
+
css: _css.css.raw(baseInputCss, context ? undefined : inputCss, baseTextAreaCss, cssProp),
|
|
155
157
|
ref: (0, _util.composeRefs)(ref, localRef),
|
|
156
158
|
...props
|
|
157
159
|
});
|
|
158
160
|
});
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
...
|
|
161
|
+
const FieldTextArea = exports.FieldTextArea = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Field.Textarea, {
|
|
162
|
+
asChild: true,
|
|
163
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TextArea, {
|
|
164
|
+
...props,
|
|
163
165
|
ref: ref
|
|
164
|
-
})
|
|
165
|
-
});
|
|
166
|
+
})
|
|
167
|
+
}));
|
package/lib/Label.d.ts
CHANGED
|
@@ -5,12 +5,18 @@
|
|
|
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
|
|
15
|
-
export declare const
|
|
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 type LabelProps = HTMLArkProps<"label"> & TextProps & JsxStyleProps;
|
|
16
|
+
export declare const Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & TextProps & {
|
|
17
|
+
forwardCssProp?: boolean | undefined;
|
|
18
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLLabelElement>>;
|
|
19
|
+
export declare const FieldLabel: 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>>;
|
|
16
22
|
export declare const Fieldset: import("@ndla/styled-system/jsx").StyledComponent<"fieldset", {}>;
|