@ndla/primitives 0.0.12 → 0.0.13
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 +5 -15
- package/dist/styles.css +18 -58
- package/es/ArticleLists.js +22 -1
- package/es/Badge.js +20 -2
- package/es/BlockQuote.js +20 -2
- package/es/Button.js +2 -0
- package/es/Checkbox.js +0 -1
- package/es/Combobox.js +8 -4
- package/es/Dialog.js +6 -4
- package/es/ExpandableBox.js +2 -0
- package/es/Field.js +2 -0
- package/es/FieldErrorMessage.js +2 -0
- package/es/FieldHelper.js +3 -1
- package/es/Figure.js +24 -1
- package/es/FramedContent.js +24 -10
- package/es/Input.js +8 -2
- package/es/Label.js +10 -2
- package/es/Menu.js +1 -2
- package/es/MessageBox.js +20 -2
- package/es/RadioGroup.js +1 -2
- package/es/Select.js +1 -2
- package/es/Skeleton.js +2 -0
- package/es/Slider.js +0 -1
- package/es/Spinner.js +20 -2
- package/es/Switch.js +2 -2
- package/es/Table.js +2 -0
- package/es/TagsInput.js +0 -1
- package/es/Text.js +6 -2
- package/es/Toast.js +2 -2
- package/es/createStyleContext.js +10 -3
- package/lib/Accordion.d.ts +4 -4
- package/lib/ArticleLists.d.ts +40 -4
- package/lib/ArticleLists.js +25 -4
- package/lib/Badge.d.ts +4 -4
- package/lib/Badge.js +21 -3
- package/lib/BlockQuote.d.ts +4 -4
- package/lib/BlockQuote.js +21 -3
- package/lib/Button.d.ts +2 -2
- package/lib/Button.js +2 -0
- package/lib/Checkbox.d.ts +4 -4
- package/lib/Checkbox.js +0 -1
- package/lib/Combobox.d.ts +2 -2
- package/lib/Combobox.js +8 -4
- package/lib/Dialog.d.ts +7 -7
- package/lib/Dialog.js +6 -4
- package/lib/ExpandableBox.js +2 -0
- package/lib/Field.js +2 -0
- package/lib/FieldErrorMessage.d.ts +1 -1
- package/lib/FieldErrorMessage.js +2 -0
- package/lib/FieldHelper.d.ts +1 -1
- package/lib/FieldHelper.js +3 -1
- package/lib/Figure.d.ts +57 -2
- package/lib/Figure.js +25 -2
- package/lib/FramedContent.d.ts +4 -7
- package/lib/FramedContent.js +25 -11
- package/lib/Input.d.ts +1 -1
- package/lib/Input.js +8 -2
- package/lib/Label.d.ts +3 -3
- package/lib/Label.js +10 -2
- package/lib/Menu.d.ts +7 -7
- package/lib/Menu.js +1 -2
- package/lib/MessageBox.d.ts +4 -4
- package/lib/MessageBox.js +21 -3
- package/lib/Pagination.d.ts +5 -5
- package/lib/Popover.d.ts +10 -10
- package/lib/RadioGroup.d.ts +5 -5
- package/lib/RadioGroup.js +1 -2
- package/lib/Select.d.ts +13 -13
- package/lib/Select.js +1 -2
- package/lib/Skeleton.js +2 -0
- package/lib/Slider.d.ts +5 -5
- package/lib/Slider.js +0 -1
- package/lib/Spinner.d.ts +5 -5
- package/lib/Spinner.js +21 -3
- package/lib/Switch.d.ts +3 -3
- package/lib/Switch.js +2 -2
- package/lib/Table.js +2 -0
- package/lib/Tabs.d.ts +4 -4
- package/lib/TagsInput.d.ts +10 -10
- package/lib/TagsInput.js +0 -1
- package/lib/Text.d.ts +2 -2
- package/lib/Text.js +6 -2
- package/lib/Toast.d.ts +2 -2
- package/lib/Toast.js +2 -2
- package/lib/Tooltip.d.ts +6 -6
- package/lib/createStyleContext.d.ts +6 -6
- package/lib/createStyleContext.js +9 -2
- package/package.json +5 -5
- package/es/Icon.js +0 -74
- package/lib/Icon.d.ts +0 -38
- package/lib/Icon.js +0 -81
package/es/Select.js
CHANGED
|
@@ -160,11 +160,11 @@ export const SelectItemGroupLabel = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
160
160
|
} = _ref2;
|
|
161
161
|
return /*#__PURE__*/_jsx(InternalSelectItemGroupLabel, {
|
|
162
162
|
asChild: true,
|
|
163
|
-
forwardCssProp: true,
|
|
164
163
|
ref: ref,
|
|
165
164
|
...props,
|
|
166
165
|
children: /*#__PURE__*/_jsx(Label, {
|
|
167
166
|
asChild: true,
|
|
167
|
+
consumeCss: true,
|
|
168
168
|
children: /*#__PURE__*/_jsx("div", {
|
|
169
169
|
children: children
|
|
170
170
|
})
|
|
@@ -184,7 +184,6 @@ export const SelectLabel = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
184
184
|
} = _ref3;
|
|
185
185
|
return /*#__PURE__*/_jsx(InternalSelectLabel, {
|
|
186
186
|
asChild: true,
|
|
187
|
-
forwardCssProp: true,
|
|
188
187
|
ref: ref,
|
|
189
188
|
...props,
|
|
190
189
|
children: /*#__PURE__*/_jsx(Label, {
|
package/es/Skeleton.js
CHANGED
package/es/Slider.js
CHANGED
package/es/Spinner.js
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { forwardRef } from "react";
|
|
9
10
|
import { ark } from "@ark-ui/react";
|
|
10
|
-
import { cva } from "@ndla/styled-system/css";
|
|
11
|
+
import { css, cva } from "@ndla/styled-system/css";
|
|
11
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
export const spinnerRecipe = cva({
|
|
13
15
|
base: {
|
|
14
16
|
borderRadius: "full",
|
|
@@ -39,4 +41,20 @@ export const spinnerRecipe = cva({
|
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
});
|
|
42
|
-
|
|
44
|
+
const StyledSpinner = styled(ark.div, {}, {
|
|
45
|
+
baseComponent: true
|
|
46
|
+
});
|
|
47
|
+
export const Spinner = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
48
|
+
let {
|
|
49
|
+
size,
|
|
50
|
+
css: cssProp,
|
|
51
|
+
...props
|
|
52
|
+
} = _ref;
|
|
53
|
+
return /*#__PURE__*/_jsx(StyledSpinner, {
|
|
54
|
+
css: css.raw(spinnerRecipe.raw({
|
|
55
|
+
size
|
|
56
|
+
}), cssProp),
|
|
57
|
+
...props,
|
|
58
|
+
ref: ref
|
|
59
|
+
});
|
|
60
|
+
});
|
package/es/Switch.js
CHANGED
|
@@ -52,7 +52,7 @@ const switchRecipe = sva({
|
|
|
52
52
|
justifyContent: "center",
|
|
53
53
|
background: "icon.onAction",
|
|
54
54
|
borderRadius: "full",
|
|
55
|
-
boxShadow: "
|
|
55
|
+
boxShadow: "small",
|
|
56
56
|
transitionDuration: "fast",
|
|
57
57
|
transitionProperty: "transform",
|
|
58
58
|
transitionTimingFunction: "default",
|
|
@@ -109,9 +109,9 @@ export const SwitchLabel = _ref => {
|
|
|
109
109
|
} = _ref;
|
|
110
110
|
return /*#__PURE__*/_jsx(InternalSwitchLabel, {
|
|
111
111
|
asChild: true,
|
|
112
|
-
forwardCssProp: true,
|
|
113
112
|
children: /*#__PURE__*/_jsx(Text, {
|
|
114
113
|
asChild: true,
|
|
114
|
+
consumeCss: true,
|
|
115
115
|
textStyle: textStyle,
|
|
116
116
|
...props,
|
|
117
117
|
children: /*#__PURE__*/_jsx("span", {
|
package/es/Table.js
CHANGED
package/es/TagsInput.js
CHANGED
package/es/Text.js
CHANGED
|
@@ -11,7 +11,9 @@ import { ark } from "@ark-ui/react";
|
|
|
11
11
|
import { css } from "@ndla/styled-system/css";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
const StyledP = styled(ark.p
|
|
14
|
+
const StyledP = styled(ark.p, {}, {
|
|
15
|
+
baseComponent: true
|
|
16
|
+
});
|
|
15
17
|
export const Text = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
16
18
|
let {
|
|
17
19
|
textStyle = "body.medium",
|
|
@@ -32,7 +34,9 @@ export const Text = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
32
34
|
...rest
|
|
33
35
|
});
|
|
34
36
|
});
|
|
35
|
-
const StyledH1 = styled(ark.h1
|
|
37
|
+
const StyledH1 = styled(ark.h1, {}, {
|
|
38
|
+
baseComponent: true
|
|
39
|
+
});
|
|
36
40
|
export const Heading = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
37
41
|
let {
|
|
38
42
|
textStyle = "heading.medium",
|
package/es/Toast.js
CHANGED
|
@@ -56,9 +56,9 @@ export const ToastDescription = _ref => {
|
|
|
56
56
|
} = _ref;
|
|
57
57
|
return /*#__PURE__*/_jsx(InternalToastDescription, {
|
|
58
58
|
asChild: true,
|
|
59
|
-
forwardCssProp: true,
|
|
60
59
|
children: /*#__PURE__*/_jsx(Text, {
|
|
61
60
|
asChild: true,
|
|
61
|
+
consumeCss: true,
|
|
62
62
|
textStyle: textStyle,
|
|
63
63
|
...props,
|
|
64
64
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -77,9 +77,9 @@ export const ToastTitle = _ref2 => {
|
|
|
77
77
|
} = _ref2;
|
|
78
78
|
return /*#__PURE__*/_jsx(InternalToastTitle, {
|
|
79
79
|
asChild: true,
|
|
80
|
-
forwardCssProp: true,
|
|
81
80
|
children: /*#__PURE__*/_jsx(Text, {
|
|
82
81
|
asChild: true,
|
|
82
|
+
consumeCss: true,
|
|
83
83
|
fontWeight: fontWeight,
|
|
84
84
|
textStyle: textStyle,
|
|
85
85
|
...props,
|
package/es/createStyleContext.js
CHANGED
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
import { createContext, forwardRef, useContext } from "react";
|
|
10
10
|
import { css } from "@ndla/styled-system/css";
|
|
11
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
/**
|
|
14
14
|
* A utility for creating a style context for a recipe, allowing one to change the styles of all parts of a component from the root component. Credit: https://github.com/cschroeter/park-ui/blob/main/website/src/lib/create-style-context.tsx.
|
|
15
15
|
*/
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
export const createStyleContext = recipe => {
|
|
17
18
|
const StyleContext = /*#__PURE__*/createContext(null);
|
|
18
19
|
const withRootProvider = Component => {
|
|
@@ -29,7 +30,10 @@ export const createStyleContext = recipe => {
|
|
|
29
30
|
return StyledComponent;
|
|
30
31
|
};
|
|
31
32
|
const withProvider = (Component, slot) => {
|
|
32
|
-
const
|
|
33
|
+
const opts = typeof Component === "string" ? undefined : {
|
|
34
|
+
baseComponent: true
|
|
35
|
+
};
|
|
36
|
+
const StyledComponent = styled(Component, {}, opts);
|
|
33
37
|
return /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
34
38
|
let {
|
|
35
39
|
css: cssProp,
|
|
@@ -48,7 +52,10 @@ export const createStyleContext = recipe => {
|
|
|
48
52
|
});
|
|
49
53
|
};
|
|
50
54
|
const withContext = (Component, slot) => {
|
|
51
|
-
const
|
|
55
|
+
const opts = typeof Component === "string" ? undefined : {
|
|
56
|
+
baseComponent: true
|
|
57
|
+
};
|
|
58
|
+
const StyledComponent = styled(Component, {}, opts);
|
|
52
59
|
return /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
53
60
|
let {
|
|
54
61
|
css: cssProp,
|
package/lib/Accordion.d.ts
CHANGED
|
@@ -11,14 +11,14 @@ export interface AccordionRootProps extends JsxStyleProps, Accordion.RootProps {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const AccordionRoot: import("react").ForwardRefExoticComponent<AccordionRootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
13
|
export declare const AccordionItemContent: import("react").ForwardRefExoticComponent<{
|
|
14
|
-
|
|
14
|
+
consumeCss?: boolean | undefined;
|
|
15
15
|
} & import("@ndla/styled-system/types").WithCss & Accordion.ItemContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
16
|
export declare const AccordionItemIndicator: import("react").ForwardRefExoticComponent<{
|
|
17
|
-
|
|
17
|
+
consumeCss?: boolean | undefined;
|
|
18
18
|
} & import("@ndla/styled-system/types").WithCss & Accordion.ItemIndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
19
|
export declare const AccordionItem: import("react").ForwardRefExoticComponent<{
|
|
20
|
-
|
|
20
|
+
consumeCss?: boolean | undefined;
|
|
21
21
|
} & import("@ndla/styled-system/types").WithCss & Accordion.ItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
22
|
export declare const AccordionItemTrigger: import("react").ForwardRefExoticComponent<{
|
|
23
|
-
|
|
23
|
+
consumeCss?: boolean | undefined;
|
|
24
24
|
} & import("@ndla/styled-system/types").WithCss & Accordion.ItemTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
package/lib/ArticleLists.d.ts
CHANGED
|
@@ -6,13 +6,49 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { HTMLArkProps } from "@ark-ui/react";
|
|
9
|
-
import { JsxStyleProps,
|
|
10
|
-
|
|
9
|
+
import { JsxStyleProps, RecipeVariantProps } from "@ndla/styled-system/types";
|
|
10
|
+
declare const orderedListRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
11
|
+
variant: {
|
|
12
|
+
numbers: {
|
|
13
|
+
"& > li": {
|
|
14
|
+
_marker: {
|
|
15
|
+
content: "counters(list-item, '.') '. '";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
letters: {
|
|
20
|
+
"& ol[data-variant='numbers'] > li": {
|
|
21
|
+
_marker: {
|
|
22
|
+
content: "counter(list-item, numeric) '. '";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
"& li": {
|
|
26
|
+
_marker: {
|
|
27
|
+
content: "counter(list-item, upper-alpha) '. '";
|
|
28
|
+
};
|
|
29
|
+
"& > ol > li": {
|
|
30
|
+
_marker: {
|
|
31
|
+
content: "counter(list-item, lower-alpha) '. '";
|
|
32
|
+
};
|
|
33
|
+
"& li": {
|
|
34
|
+
_marker: {
|
|
35
|
+
content: "counter(list-item, lower-roman) '. '";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}>;
|
|
43
|
+
export type OrderedListVariantProps = RecipeVariantProps<typeof orderedListRecipe>;
|
|
11
44
|
export type OrderedListProps = HTMLArkProps<"ol"> & JsxStyleProps & OrderedListVariantProps;
|
|
12
|
-
export declare const OrderedList: import("
|
|
45
|
+
export declare const OrderedList: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
46
|
+
consumeCss?: boolean | undefined;
|
|
47
|
+
} & import("@ndla/styled-system/types").WithCss & {
|
|
13
48
|
variant?: "numbers" | "letters" | undefined;
|
|
14
|
-
}
|
|
49
|
+
} & import("react").RefAttributes<HTMLOListElement>>;
|
|
15
50
|
export type UnOrderedListProps = HTMLArkProps<"ul"> & JsxStyleProps;
|
|
16
51
|
export declare const UnOrderedList: import("@ndla/styled-system/jsx").StyledComponent<"ul", {}>;
|
|
17
52
|
export declare const DefinitionList: import("@ndla/styled-system/jsx").StyledComponent<"dl", {}>;
|
|
18
53
|
export type DefinitionListProps = HTMLArkProps<"dl"> & JsxStyleProps;
|
|
54
|
+
export {};
|
package/lib/ArticleLists.js
CHANGED
|
@@ -4,7 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.UnOrderedList = exports.OrderedList = exports.DefinitionList = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
9
|
+
var _css = require("@ndla/styled-system/css");
|
|
10
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
12
|
/**
|
|
9
13
|
* Copyright (c) 2024-present, NDLA.
|
|
10
14
|
*
|
|
@@ -13,7 +17,7 @@ var _jsx = require("@ndla/styled-system/jsx");
|
|
|
13
17
|
*
|
|
14
18
|
*/
|
|
15
19
|
|
|
16
|
-
const
|
|
20
|
+
const orderedListRecipe = (0, _css.cva)({
|
|
17
21
|
base: {
|
|
18
22
|
listStyle: "revert",
|
|
19
23
|
listStylePosition: "inside",
|
|
@@ -59,7 +63,24 @@ const OrderedList = exports.OrderedList = (0, _jsx.styled)("ol", {
|
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
});
|
|
62
|
-
const
|
|
66
|
+
const StyledOrderedList = (0, _jsx2.styled)(_react2.ark.ol, {}, {
|
|
67
|
+
baseComponent: true
|
|
68
|
+
});
|
|
69
|
+
const OrderedList = exports.OrderedList = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
70
|
+
let {
|
|
71
|
+
variant,
|
|
72
|
+
css: cssProp,
|
|
73
|
+
...props
|
|
74
|
+
} = _ref;
|
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledOrderedList, {
|
|
76
|
+
css: _css.css.raw(orderedListRecipe.raw({
|
|
77
|
+
variant
|
|
78
|
+
}), cssProp),
|
|
79
|
+
...props,
|
|
80
|
+
ref: ref
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
const UnOrderedList = exports.UnOrderedList = (0, _jsx2.styled)("ul", {
|
|
63
84
|
base: {
|
|
64
85
|
listStyle: "revert",
|
|
65
86
|
listStylePosition: "inside",
|
|
@@ -72,7 +93,7 @@ const UnOrderedList = exports.UnOrderedList = (0, _jsx.styled)("ul", {
|
|
|
72
93
|
}
|
|
73
94
|
}
|
|
74
95
|
});
|
|
75
|
-
const DefinitionList = exports.DefinitionList = (0,
|
|
96
|
+
const DefinitionList = exports.DefinitionList = (0, _jsx2.styled)("dl", {
|
|
76
97
|
base: {
|
|
77
98
|
"& dt": {
|
|
78
99
|
fontWeight: "bold"
|
package/lib/Badge.d.ts
CHANGED
|
@@ -30,9 +30,9 @@ declare const badgeRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
|
30
30
|
}>;
|
|
31
31
|
export type BadgeVariantProps = RecipeVariantProps<typeof badgeRecipe>;
|
|
32
32
|
export type BadgeProps = HTMLArkProps<"div"> & JsxStyleProps & BadgeVariantProps;
|
|
33
|
-
export declare const Badge: import("
|
|
34
|
-
|
|
35
|
-
} & import("@
|
|
33
|
+
export declare const Badge: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
34
|
+
consumeCss?: boolean | undefined;
|
|
35
|
+
} & import("@ndla/styled-system/types").WithCss & {
|
|
36
36
|
colorTheme?: "neutral" | "brand1" | "brand2" | "brand3" | undefined;
|
|
37
|
-
}
|
|
37
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
38
38
|
export {};
|
package/lib/Badge.js
CHANGED
|
@@ -4,9 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Badge = void 0;
|
|
7
|
-
var _react = require("
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
8
9
|
var _css = require("@ndla/styled-system/css");
|
|
9
|
-
var
|
|
10
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
12
|
/**
|
|
11
13
|
* Copyright (c) 2024-present, NDLA.
|
|
12
14
|
*
|
|
@@ -46,4 +48,20 @@ const badgeRecipe = (0, _css.cva)({
|
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
});
|
|
49
|
-
const
|
|
51
|
+
const StyledBadge = (0, _jsx2.styled)(_react2.ark.div, {}, {
|
|
52
|
+
baseComponent: true
|
|
53
|
+
});
|
|
54
|
+
const Badge = exports.Badge = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
55
|
+
let {
|
|
56
|
+
colorTheme,
|
|
57
|
+
css: cssProp,
|
|
58
|
+
...props
|
|
59
|
+
} = _ref;
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBadge, {
|
|
61
|
+
css: _css.css.raw(badgeRecipe.raw({
|
|
62
|
+
colorTheme
|
|
63
|
+
}), cssProp),
|
|
64
|
+
...props,
|
|
65
|
+
ref: ref
|
|
66
|
+
});
|
|
67
|
+
});
|
package/lib/BlockQuote.d.ts
CHANGED
|
@@ -26,9 +26,9 @@ declare const blockQuoteRecipe: import("@ndla/styled-system/types").RecipeRuntim
|
|
|
26
26
|
}>;
|
|
27
27
|
export type BlockQuoteVariantProps = RecipeVariantProps<typeof blockQuoteRecipe>;
|
|
28
28
|
export type BlockQuoteProps = HTMLArkProps<"blockquote"> & JsxStyleProps & BlockQuoteVariantProps;
|
|
29
|
-
export declare const BlockQuote: import("
|
|
30
|
-
|
|
31
|
-
} & import("@
|
|
29
|
+
export declare const BlockQuote: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
30
|
+
consumeCss?: boolean | undefined;
|
|
31
|
+
} & import("@ndla/styled-system/types").WithCss & {
|
|
32
32
|
variant?: "neutral" | "brand1" | "brand2" | undefined;
|
|
33
|
-
}
|
|
33
|
+
} & import("react").RefAttributes<HTMLQuoteElement>>;
|
|
34
34
|
export {};
|
package/lib/BlockQuote.js
CHANGED
|
@@ -4,9 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.BlockQuote = void 0;
|
|
7
|
-
var _react = require("
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
8
9
|
var _css = require("@ndla/styled-system/css");
|
|
9
|
-
var
|
|
10
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
12
|
/**
|
|
11
13
|
* Copyright (c) 2024-present, NDLA.
|
|
12
14
|
*
|
|
@@ -40,4 +42,20 @@ const blockQuoteRecipe = (0, _css.cva)({
|
|
|
40
42
|
variant: "neutral"
|
|
41
43
|
}
|
|
42
44
|
});
|
|
43
|
-
const
|
|
45
|
+
const StyledBlockQuote = (0, _jsx2.styled)(_react2.ark.blockquote, {}, {
|
|
46
|
+
baseComponent: true
|
|
47
|
+
});
|
|
48
|
+
const BlockQuote = exports.BlockQuote = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
49
|
+
let {
|
|
50
|
+
variant,
|
|
51
|
+
css: cssProp,
|
|
52
|
+
...props
|
|
53
|
+
} = _ref;
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBlockQuote, {
|
|
55
|
+
css: _css.css.raw(blockQuoteRecipe.raw({
|
|
56
|
+
variant
|
|
57
|
+
}), cssProp),
|
|
58
|
+
...props,
|
|
59
|
+
ref: ref
|
|
60
|
+
});
|
|
61
|
+
});
|
package/lib/Button.d.ts
CHANGED
|
@@ -127,7 +127,7 @@ export type ButtonVariantProps = {
|
|
|
127
127
|
} & RecipeVariantProps<typeof buttonRecipe>;
|
|
128
128
|
export type ButtonProps = HTMLArkProps<"button"> & JsxStyleProps & ButtonVariantProps;
|
|
129
129
|
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
130
|
-
|
|
130
|
+
consumeCss?: boolean | undefined;
|
|
131
131
|
} & import("@ndla/styled-system/types").WithCss & {
|
|
132
132
|
variant?: ButtonVariant | undefined;
|
|
133
133
|
} & {
|
|
@@ -139,6 +139,6 @@ export type IconButtonVariantProps = {
|
|
|
139
139
|
};
|
|
140
140
|
export type IconButtonProps = HTMLArkProps<"button"> & IconButtonVariantProps & JsxStyleProps;
|
|
141
141
|
export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & IconButtonVariantProps & {
|
|
142
|
-
|
|
142
|
+
consumeCss?: boolean | undefined;
|
|
143
143
|
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLButtonElement>>;
|
|
144
144
|
export {};
|
package/lib/Button.js
CHANGED
|
@@ -188,6 +188,7 @@ const iconButtonRecipe = exports.iconButtonRecipe = (0, _css.cva)({
|
|
|
188
188
|
}
|
|
189
189
|
});
|
|
190
190
|
const StyledButton = (0, _jsx2.styled)(_react2.ark.button, {}, {
|
|
191
|
+
baseComponent: true,
|
|
191
192
|
defaultProps: {
|
|
192
193
|
type: "button"
|
|
193
194
|
}
|
|
@@ -210,6 +211,7 @@ const Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref)
|
|
|
210
211
|
});
|
|
211
212
|
});
|
|
212
213
|
const StyledIconButton = (0, _jsx2.styled)(_react2.ark.button, {}, {
|
|
214
|
+
baseComponent: true,
|
|
213
215
|
defaultProps: {
|
|
214
216
|
type: "button"
|
|
215
217
|
}
|
package/lib/Checkbox.d.ts
CHANGED
|
@@ -169,17 +169,17 @@ export type CheckboxRootProps = Checkbox.RootProps & CheckboxVariantProps & JsxS
|
|
|
169
169
|
export declare const CheckboxRoot: import("react").ForwardRefExoticComponent<Checkbox.RootProps & {
|
|
170
170
|
variant?: "checkbox" | "chip" | undefined;
|
|
171
171
|
} & {
|
|
172
|
-
|
|
172
|
+
consumeCss?: boolean | undefined;
|
|
173
173
|
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLLabelElement>>;
|
|
174
174
|
export declare const CheckboxIndicator: import("react").ForwardRefExoticComponent<Checkbox.IndicatorProps & {
|
|
175
|
-
|
|
175
|
+
consumeCss?: boolean | undefined;
|
|
176
176
|
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
177
177
|
export declare const CheckboxLabel: ({ textStyle, children, ...props }: Checkbox.LabelProps & TextProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
178
178
|
export declare const CheckboxControl: import("react").ForwardRefExoticComponent<{
|
|
179
|
-
|
|
179
|
+
consumeCss?: boolean | undefined;
|
|
180
180
|
} & import("@ndla/styled-system/types").WithCss & Checkbox.ControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
181
181
|
export declare const CheckboxGroup: import("react").ForwardRefExoticComponent<{
|
|
182
|
-
|
|
182
|
+
consumeCss?: boolean | undefined;
|
|
183
183
|
} & import("@ndla/styled-system/types").WithCss & Checkbox.GroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
184
184
|
export declare const CheckboxHiddenInput: import("react").ForwardRefExoticComponent<Checkbox.HiddenInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
185
185
|
export {};
|
package/lib/Checkbox.js
CHANGED
|
@@ -227,7 +227,6 @@ const CheckboxLabel = _ref => {
|
|
|
227
227
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalCheckboxLabel, {
|
|
228
228
|
...props,
|
|
229
229
|
asChild: true,
|
|
230
|
-
forwardCssProp: true,
|
|
231
230
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
232
231
|
textStyle: textStyle,
|
|
233
232
|
children: children
|
package/lib/Combobox.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { Combobox } from "@ark-ui/react";
|
|
9
9
|
import { JsxStyleProps, RecipeVariantProps } from "@ndla/styled-system/types";
|
|
10
10
|
import { TextProps } from "./Text";
|
|
11
|
-
declare const comboboxRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"input" | "label" | "
|
|
11
|
+
declare const comboboxRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"input" | "label" | "list" | "content" | "root" | "item" | "itemIndicator" | "control" | "clearTrigger" | "itemGroup" | "itemGroupLabel" | "itemText" | "positioner" | "trigger", {
|
|
12
12
|
variant: {
|
|
13
13
|
simple: {
|
|
14
14
|
item: {
|
|
@@ -52,7 +52,7 @@ export declare const ComboboxItemGroupLabel: ({ children, textStyle, fontWeight,
|
|
|
52
52
|
export declare const ComboboxItemGroup: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.ItemGroupProps> & Combobox.ItemGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
53
53
|
export declare const ComboboxItemIndicator: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.ItemIndicatorProps> & Combobox.ItemIndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
54
|
export declare const ComboboxItem: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.ItemProps> & Combobox.ItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
|
-
export declare const ComboboxItemText: ({ textStyle, fontWeight, ...props }: Combobox.ItemTextProps & TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export declare const ComboboxItemText: ({ textStyle, fontWeight, children, ...props }: Combobox.ItemTextProps & TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
56
56
|
export declare const ComboboxLabel: ({ textStyle, fontWeight, ...props }: Combobox.LabelProps & TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
57
|
export declare const ComboboxPositioner: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.PositionerProps> & Combobox.PositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
58
58
|
export declare const ComboboxTrigger: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.TriggerProps> & Combobox.TriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
package/lib/Combobox.js
CHANGED
|
@@ -180,10 +180,10 @@ const ComboboxItemGroupLabel = _ref2 => {
|
|
|
180
180
|
...props
|
|
181
181
|
} = _ref2;
|
|
182
182
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalComboboxItemGroupLabel, {
|
|
183
|
-
forwardCssProp: true,
|
|
184
183
|
asChild: true,
|
|
185
184
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
186
185
|
asChild: true,
|
|
186
|
+
consumeCss: true,
|
|
187
187
|
textStyle: textStyle,
|
|
188
188
|
fontWeight: fontWeight,
|
|
189
189
|
...props,
|
|
@@ -202,13 +202,18 @@ const ComboboxItemText = _ref3 => {
|
|
|
202
202
|
let {
|
|
203
203
|
textStyle = "label.medium",
|
|
204
204
|
fontWeight = "bold",
|
|
205
|
+
children,
|
|
205
206
|
...props
|
|
206
207
|
} = _ref3;
|
|
207
208
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalComboboxItemText, {
|
|
208
|
-
forwardCssProp: true,
|
|
209
209
|
asChild: true,
|
|
210
210
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
211
|
-
...props
|
|
211
|
+
...props,
|
|
212
|
+
asChild: true,
|
|
213
|
+
consumeCss: true,
|
|
214
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
215
|
+
children: children
|
|
216
|
+
})
|
|
212
217
|
})
|
|
213
218
|
});
|
|
214
219
|
};
|
|
@@ -221,7 +226,6 @@ const ComboboxLabel = _ref4 => {
|
|
|
221
226
|
...props
|
|
222
227
|
} = _ref4;
|
|
223
228
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalComboboxLabel, {
|
|
224
|
-
forwardCssProp: true,
|
|
225
229
|
asChild: true,
|
|
226
230
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Label.Label, {
|
|
227
231
|
textStyle: textStyle,
|
package/lib/Dialog.d.ts
CHANGED
|
@@ -90,24 +90,24 @@ export type DialogVariantProps = RecipeVariantProps<typeof dialogRecipe>;
|
|
|
90
90
|
export type DialogRootProps = Dialog.RootProps & DialogVariantProps;
|
|
91
91
|
export declare const InternalDialogRoot: (props: Dialog.RootProps & {
|
|
92
92
|
variant?: "dialog" | "drawer" | undefined;
|
|
93
|
-
position?: "center" | "
|
|
93
|
+
position?: "center" | "left" | "right" | "bottom" | "top" | undefined;
|
|
94
94
|
size?: "small" | "xsmall" | "medium" | "large" | "full" | undefined;
|
|
95
95
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
96
96
|
export declare const DialogRoot: ({ lazyMount, unmountOnExit, ...props }: DialogRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
97
97
|
export declare const DialogBackdrop: import("react").ForwardRefExoticComponent<{
|
|
98
|
-
|
|
98
|
+
consumeCss?: boolean | undefined;
|
|
99
99
|
} & import("@ndla/styled-system/types").WithCss & Dialog.BackdropProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
100
100
|
export declare const DialogStandaloneContent: import("react").ForwardRefExoticComponent<{
|
|
101
|
-
|
|
101
|
+
consumeCss?: boolean | undefined;
|
|
102
102
|
} & import("@ndla/styled-system/types").WithCss & Dialog.ContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
103
103
|
export declare const DialogPositioner: import("react").ForwardRefExoticComponent<{
|
|
104
|
-
|
|
104
|
+
consumeCss?: boolean | undefined;
|
|
105
105
|
} & import("@ndla/styled-system/types").WithCss & Dialog.PositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
106
106
|
export declare const DialogContent: import("react").ForwardRefExoticComponent<Dialog.ContentProps & {
|
|
107
|
-
|
|
107
|
+
consumeCss?: boolean | undefined;
|
|
108
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;
|
|
109
|
+
export declare const DialogDescription: ({ textStyle, children, ...rest }: Dialog.DescriptionProps & TextProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
export declare const DialogTitle: ({ textStyle, children, ...rest }: Dialog.TitleProps & TextProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
111
111
|
export declare const DialogTrigger: import("react").ForwardRefExoticComponent<Dialog.TriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
112
112
|
export declare const DialogCloseTrigger: import("react").ForwardRefExoticComponent<Dialog.CloseTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
113
113
|
export declare const DialogHeader: import("@ndla/styled-system/jsx").StyledComponent<"div", {}>;
|
package/lib/Dialog.js
CHANGED
|
@@ -287,14 +287,15 @@ const InternalDialogDescription = withContext(_react2.Dialog.Description, "descr
|
|
|
287
287
|
const DialogDescription = _ref2 => {
|
|
288
288
|
let {
|
|
289
289
|
textStyle = "body.large",
|
|
290
|
+
children,
|
|
290
291
|
...rest
|
|
291
292
|
} = _ref2;
|
|
292
293
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalDialogDescription, {
|
|
293
294
|
asChild: true,
|
|
294
|
-
forwardCssProp: true,
|
|
295
295
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
296
296
|
textStyle: textStyle,
|
|
297
|
-
...rest
|
|
297
|
+
...rest,
|
|
298
|
+
children: children
|
|
298
299
|
})
|
|
299
300
|
});
|
|
300
301
|
};
|
|
@@ -303,14 +304,15 @@ const InternalDialogTitle = withContext(_react2.Dialog.Title, "title");
|
|
|
303
304
|
const DialogTitle = _ref3 => {
|
|
304
305
|
let {
|
|
305
306
|
textStyle = "title.medium",
|
|
307
|
+
children,
|
|
306
308
|
...rest
|
|
307
309
|
} = _ref3;
|
|
308
310
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalDialogTitle, {
|
|
309
311
|
asChild: true,
|
|
310
|
-
forwardCssProp: true,
|
|
311
312
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Heading, {
|
|
312
313
|
textStyle: textStyle,
|
|
313
|
-
...rest
|
|
314
|
+
...rest,
|
|
315
|
+
children: children
|
|
314
316
|
})
|
|
315
317
|
});
|
|
316
318
|
};
|
package/lib/ExpandableBox.js
CHANGED