@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/Badge.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Badge = 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
|
*
|
|
@@ -32,7 +32,7 @@ const badgeRecipe = (0, _css.cva)({
|
|
|
32
32
|
borderColor: "surface.brand.1.strong"
|
|
33
33
|
},
|
|
34
34
|
brand2: {
|
|
35
|
-
backgroundColor: "surface.brand.2.
|
|
35
|
+
backgroundColor: "surface.brand.2.moderate",
|
|
36
36
|
borderColor: "surface.brand.2.strong"
|
|
37
37
|
},
|
|
38
38
|
brand3: {
|
|
@@ -46,17 +46,4 @@ const badgeRecipe = (0, _css.cva)({
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
const Badge =
|
|
50
|
-
let {
|
|
51
|
-
colorTheme,
|
|
52
|
-
className,
|
|
53
|
-
...rest
|
|
54
|
-
} = _ref;
|
|
55
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsx2.styled.div, {
|
|
56
|
-
className: (0, _css.cx)(badgeRecipe({
|
|
57
|
-
colorTheme
|
|
58
|
-
}), className),
|
|
59
|
-
...rest
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
exports.Badge = Badge;
|
|
49
|
+
const Badge = exports.Badge = (0, _jsx.styled)(_react.ark.div, badgeRecipe);
|
package/lib/BlockQuote.d.ts
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
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
9
|
import { RecipeVariantProps } from "@ndla/styled-system/css";
|
|
10
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
11
|
declare const blockQuoteRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
11
12
|
variant: {
|
|
12
13
|
neutral: {
|
|
@@ -23,6 +24,10 @@ declare const blockQuoteRecipe: import("@ndla/styled-system/types").RecipeRuntim
|
|
|
23
24
|
};
|
|
24
25
|
}>;
|
|
25
26
|
export type BlockQuoteVariantProps = RecipeVariantProps<typeof blockQuoteRecipe>;
|
|
26
|
-
export type BlockQuoteProps =
|
|
27
|
-
export declare const BlockQuote:
|
|
27
|
+
export type BlockQuoteProps = HTMLArkProps<"blockquote"> & JsxStyleProps & BlockQuoteVariantProps;
|
|
28
|
+
export declare const BlockQuote: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, "ref"> & {
|
|
29
|
+
ref?: ((instance: HTMLQuoteElement | null) => void) | import("react").RefObject<HTMLQuoteElement> | null | undefined;
|
|
30
|
+
} & import("@ark-ui/react").PolymorphicProps>, {
|
|
31
|
+
variant?: "neutral" | "brand1" | "brand2" | undefined;
|
|
32
|
+
}>;
|
|
28
33
|
export {};
|
package/lib/BlockQuote.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.BlockQuote = 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
|
*
|
|
@@ -40,17 +40,4 @@ const blockQuoteRecipe = (0, _css.cva)({
|
|
|
40
40
|
variant: "neutral"
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
const BlockQuote =
|
|
44
|
-
let {
|
|
45
|
-
className,
|
|
46
|
-
variant,
|
|
47
|
-
...rest
|
|
48
|
-
} = _ref;
|
|
49
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsx2.styled.blockquote, {
|
|
50
|
-
className: (0, _css.cx)(blockQuoteRecipe({
|
|
51
|
-
variant
|
|
52
|
-
}), className),
|
|
53
|
-
...rest
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
exports.BlockQuote = BlockQuote;
|
|
43
|
+
const BlockQuote = exports.BlockQuote = (0, _jsx.styled)(_react.ark.blockquote, blockQuoteRecipe);
|
package/lib/Button.d.ts
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
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
9
|
import { RecipeVariantProps } from "@ndla/styled-system/css";
|
|
10
|
+
import { JsxStyleProps, RecipeVariant } from "@ndla/styled-system/types";
|
|
10
11
|
export declare const buttonBaseRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
11
12
|
variant: {
|
|
12
13
|
primary: {
|
|
@@ -118,14 +119,26 @@ export declare const buttonRecipe: import("@ndla/styled-system/types").RecipeRun
|
|
|
118
119
|
};
|
|
119
120
|
};
|
|
120
121
|
}>;
|
|
121
|
-
export type ButtonVariantProps = RecipeVariantProps<typeof buttonBaseRecipe> & RecipeVariantProps<typeof buttonRecipe>;
|
|
122
|
-
export type ButtonProps = ComponentPropsWithRef<"button"> & ButtonVariantProps & {
|
|
123
|
-
variant?: Exclude<NonNullable<ButtonVariantProps>["variant"], "clear" | "clearSubtle">;
|
|
124
|
-
};
|
|
125
|
-
export declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
126
|
-
export type IconButtonVariantProps = RecipeVariantProps<typeof buttonBaseRecipe>;
|
|
127
|
-
export type IconButtonProps = ComponentPropsWithRef<"button"> & IconButtonVariantProps & {
|
|
128
|
-
variant?: Exclude<NonNullable<IconButtonVariantProps>["variant"], "link">;
|
|
129
|
-
};
|
|
130
|
-
export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
131
122
|
export declare const iconButtonRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<import("@ndla/styled-system/types").RecipeVariantRecord>;
|
|
123
|
+
type Variant = RecipeVariant<typeof buttonBaseRecipe>["variant"];
|
|
124
|
+
type ButtonVariant = Exclude<Variant, "clear" | "clearSubtle">;
|
|
125
|
+
export type ButtonVariantProps = {
|
|
126
|
+
variant?: ButtonVariant;
|
|
127
|
+
} & RecipeVariantProps<typeof buttonRecipe>;
|
|
128
|
+
export type ButtonProps = HTMLArkProps<"button"> & JsxStyleProps & ButtonVariantProps;
|
|
129
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
130
|
+
forwardCssProp?: boolean | undefined;
|
|
131
|
+
} & import("@ndla/styled-system/types").WithCss & {
|
|
132
|
+
variant?: ButtonVariant | undefined;
|
|
133
|
+
} & {
|
|
134
|
+
size?: "small" | "default" | undefined;
|
|
135
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
136
|
+
type IconButtonVariant = Exclude<Variant, "link">;
|
|
137
|
+
export type IconButtonVariantProps = {
|
|
138
|
+
variant?: IconButtonVariant;
|
|
139
|
+
};
|
|
140
|
+
export type IconButtonProps = HTMLArkProps<"button"> & IconButtonVariantProps & JsxStyleProps;
|
|
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
|
+
forwardCssProp?: boolean | undefined;
|
|
143
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLButtonElement>>;
|
|
144
|
+
export {};
|
package/lib/Button.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.iconButtonRecipe = exports.buttonRecipe = exports.buttonBaseRecipe = exports.IconButton = exports.Button = 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 _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -166,53 +167,59 @@ const buttonRecipe = exports.buttonRecipe = (0, _css.cva)({
|
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
169
|
});
|
|
170
|
+
const iconButtonRecipe = exports.iconButtonRecipe = (0, _css.cva)({
|
|
171
|
+
base: {
|
|
172
|
+
lineHeight: "1",
|
|
173
|
+
minHeight: "unset",
|
|
174
|
+
height: "fit-content",
|
|
175
|
+
"& svg": {
|
|
176
|
+
marginInline: "0",
|
|
177
|
+
marginBlock: "0",
|
|
178
|
+
width: "medium",
|
|
179
|
+
height: "medium"
|
|
180
|
+
},
|
|
181
|
+
paddingInline: "xsmall",
|
|
182
|
+
paddingBlock: "xsmall"
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
const StyledButton = (0, _jsx2.styled)(_react2.ark.button, {}, {
|
|
186
|
+
defaultProps: {
|
|
187
|
+
type: "button"
|
|
188
|
+
}
|
|
189
|
+
});
|
|
169
190
|
const Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
170
191
|
let {
|
|
171
|
-
type,
|
|
172
|
-
size,
|
|
173
|
-
className,
|
|
174
192
|
variant,
|
|
175
|
-
|
|
193
|
+
size,
|
|
194
|
+
css: cssProp,
|
|
195
|
+
...props
|
|
176
196
|
} = _ref;
|
|
177
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
178
|
-
|
|
179
|
-
|
|
197
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledButton, {
|
|
198
|
+
...props,
|
|
199
|
+
css: _css.css.raw(buttonBaseRecipe.raw({
|
|
180
200
|
variant
|
|
181
201
|
}), buttonRecipe.raw({
|
|
182
202
|
size
|
|
183
|
-
})
|
|
184
|
-
...rest,
|
|
203
|
+
}), cssProp),
|
|
185
204
|
ref: ref
|
|
186
205
|
});
|
|
187
206
|
});
|
|
207
|
+
const StyledIconButton = (0, _jsx2.styled)(_react2.ark.button, {}, {
|
|
208
|
+
defaultProps: {
|
|
209
|
+
type: "button"
|
|
210
|
+
}
|
|
211
|
+
});
|
|
188
212
|
const IconButton = exports.IconButton = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
189
213
|
let {
|
|
190
|
-
type,
|
|
191
|
-
className,
|
|
192
214
|
variant,
|
|
193
|
-
|
|
215
|
+
css: cssProp,
|
|
216
|
+
...props
|
|
194
217
|
} = _ref2;
|
|
195
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
196
|
-
|
|
197
|
-
|
|
218
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledIconButton, {
|
|
219
|
+
...props,
|
|
220
|
+
css: _css.css.raw(buttonBaseRecipe.raw({
|
|
198
221
|
variant
|
|
199
|
-
}), iconButtonRecipe.raw()
|
|
200
|
-
...rest,
|
|
222
|
+
}), iconButtonRecipe.raw(), cssProp),
|
|
201
223
|
ref: ref
|
|
202
224
|
});
|
|
203
|
-
});
|
|
204
|
-
const iconButtonRecipe = exports.iconButtonRecipe = (0, _css.cva)({
|
|
205
|
-
base: {
|
|
206
|
-
lineHeight: "1",
|
|
207
|
-
minHeight: "unset",
|
|
208
|
-
height: "fit-content",
|
|
209
|
-
"& svg": {
|
|
210
|
-
marginInline: "0",
|
|
211
|
-
marginBlock: "0",
|
|
212
|
-
width: "medium",
|
|
213
|
-
height: "medium"
|
|
214
|
-
},
|
|
215
|
-
paddingInline: "xsmall",
|
|
216
|
-
paddingBlock: "xsmall"
|
|
217
|
-
}
|
|
218
225
|
});
|
package/lib/Checkbox.d.ts
CHANGED
|
@@ -6,10 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { Checkbox } from "@ark-ui/react";
|
|
9
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
9
10
|
import { TextProps } from "./Text";
|
|
10
|
-
export type CheckboxRootProps = Checkbox.RootProps;
|
|
11
|
-
export declare const CheckboxRoot: import("react").ForwardRefExoticComponent<Checkbox.RootProps &
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
11
|
+
export type CheckboxRootProps = Checkbox.RootProps & JsxStyleProps;
|
|
12
|
+
export declare const CheckboxRoot: import("react").ForwardRefExoticComponent<Checkbox.RootProps & {
|
|
13
|
+
forwardCssProp?: boolean | undefined;
|
|
14
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLLabelElement>>;
|
|
15
|
+
export declare const CheckboxIndicator: import("react").ForwardRefExoticComponent<Checkbox.IndicatorProps & {
|
|
16
|
+
forwardCssProp?: boolean | undefined;
|
|
17
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare const CheckboxLabel: ({ textStyle, children, ...props }: Checkbox.LabelProps & TextProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const CheckboxControl: import("react").ForwardRefExoticComponent<{
|
|
20
|
+
forwardCssProp?: boolean | undefined;
|
|
21
|
+
} & import("@ndla/styled-system/types").WithCss & Checkbox.ControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
22
|
export declare const CheckboxHiddenInput: import("react").ForwardRefExoticComponent<Checkbox.HiddenInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
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
|
+
});
|
|
@@ -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,6 +5,7 @@ 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
11
|
var _FormControl = require("./FormControl");
|
|
@@ -17,10 +18,11 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
18
|
*
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
|
-
const StyledErrorMessage = (0, _jsx2.styled)(
|
|
21
|
+
const StyledErrorMessage = (0, _jsx2.styled)(_react2.ark.div, {
|
|
21
22
|
base: {
|
|
22
23
|
color: "text.error",
|
|
23
|
-
whiteSpace: "pre-line"
|
|
24
|
+
whiteSpace: "pre-line",
|
|
25
|
+
justifyContent: "center"
|
|
24
26
|
}
|
|
25
27
|
});
|
|
26
28
|
const FieldErrorMessage = exports.FieldErrorMessage = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
@@ -28,9 +30,9 @@ const FieldErrorMessage = exports.FieldErrorMessage = /*#__PURE__*/(0, _react.fo
|
|
|
28
30
|
let {
|
|
29
31
|
textStyle = "label.small",
|
|
30
32
|
fontWeight,
|
|
33
|
+
css: cssProp,
|
|
31
34
|
color,
|
|
32
35
|
srOnly,
|
|
33
|
-
className,
|
|
34
36
|
...props
|
|
35
37
|
} = _ref;
|
|
36
38
|
const field = (0, _FormControl.useFormControlContext)();
|
|
@@ -40,11 +42,11 @@ const FieldErrorMessage = exports.FieldErrorMessage = /*#__PURE__*/(0, _react.fo
|
|
|
40
42
|
ref,
|
|
41
43
|
...props
|
|
42
44
|
}),
|
|
43
|
-
|
|
45
|
+
css: _css.css.raw({
|
|
44
46
|
textStyle,
|
|
45
47
|
fontWeight,
|
|
46
48
|
color,
|
|
47
|
-
srOnly
|
|
48
|
-
}
|
|
49
|
+
srOnly
|
|
50
|
+
}, cssProp)
|
|
49
51
|
});
|
|
50
52
|
});
|
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,6 +5,7 @@ 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
11
|
var _FormControl = require("./FormControl");
|
|
@@ -17,6 +18,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
18
|
*
|
|
18
19
|
*/
|
|
19
20
|
|
|
21
|
+
const StyledDiv = (0, _jsx2.styled)(_react2.ark.div);
|
|
20
22
|
const FieldHelper = exports.FieldHelper = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
21
23
|
var _field$getHelpTextPro;
|
|
22
24
|
let {
|
|
@@ -24,20 +26,20 @@ const FieldHelper = exports.FieldHelper = /*#__PURE__*/(0, _react.forwardRef)((_
|
|
|
24
26
|
fontWeight,
|
|
25
27
|
color,
|
|
26
28
|
srOnly,
|
|
27
|
-
|
|
29
|
+
css: cssProp,
|
|
28
30
|
...props
|
|
29
31
|
} = _ref;
|
|
30
32
|
const field = (0, _FormControl.useFormControlContext)();
|
|
31
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledDiv, {
|
|
32
34
|
...((_field$getHelpTextPro = field === null || field === void 0 ? void 0 : field.getHelpTextProps(props, ref)) !== null && _field$getHelpTextPro !== void 0 ? _field$getHelpTextPro : {
|
|
33
35
|
ref,
|
|
34
36
|
...props
|
|
35
37
|
}),
|
|
36
|
-
|
|
38
|
+
css: _css.css.raw({
|
|
37
39
|
textStyle,
|
|
38
40
|
fontWeight,
|
|
39
41
|
color,
|
|
40
42
|
srOnly
|
|
41
|
-
}
|
|
43
|
+
}, cssProp)
|
|
42
44
|
});
|
|
43
45
|
});
|
package/lib/FormControl.d.ts
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import { ComponentPropsWithRef, ElementType,
|
|
8
|
+
import { ComponentPropsWithRef, ElementType, Ref, RefObject } from "react";
|
|
9
|
+
import { HTMLArkProps } from "@ark-ui/react";
|
|
10
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
9
11
|
type Merge<T, P> = P & Omit<T, keyof P>;
|
|
10
12
|
type PropGetter<T extends ElementType = ElementType, P = {}> = (props?: Merge<ComponentPropsWithRef<T>, P>, ref?: Ref<any> | RefObject<any>) => Merge<ComponentPropsWithRef<T>, P>;
|
|
11
13
|
export interface FormControlOptions {
|
|
@@ -19,7 +21,7 @@ export interface FormControlProps extends FormControlOptions {
|
|
|
19
21
|
/**
|
|
20
22
|
* Form control component inspired by chakra-ui. Allows for easy composition of form fields.
|
|
21
23
|
*/
|
|
22
|
-
export declare const FormControl: ({ children, id, isDisabled, isInvalid, isRequired, ...rest }:
|
|
24
|
+
export declare const FormControl: ({ children, id, isDisabled, isInvalid, isRequired, ...rest }: HTMLArkProps<"div"> & JsxStyleProps & FormControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
export declare const useFormControlContext: () => {
|
|
24
26
|
isRequired: boolean;
|
|
25
27
|
isDisabled: boolean;
|
package/lib/FormControl.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useFormControlProps = exports.useFormControlContext = exports.useFormControl = exports.FormControl = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
8
9
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
9
10
|
var _util = require("@ndla/util");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -16,7 +17,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
16
17
|
*
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
|
-
const StyledFormControl = (0, _jsx2.styled)(
|
|
20
|
+
const StyledFormControl = (0, _jsx2.styled)(_react2.ark.div, {
|
|
20
21
|
base: {
|
|
21
22
|
display: "flex",
|
|
22
23
|
flexDirection: "column",
|
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);
|