@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.
Files changed (89) hide show
  1. package/dist/panda.buildinfo.json +95 -25
  2. package/dist/styles.css +340 -50
  3. package/es/ArticleLists.js +4 -32
  4. package/es/Badge.js +4 -16
  5. package/es/BlockQuote.js +5 -17
  6. package/es/Button.js +40 -33
  7. package/es/Checkbox.js +160 -51
  8. package/es/Dialog.js +6 -7
  9. package/es/ExpandableBox.js +4 -17
  10. package/es/Field.js +17 -0
  11. package/es/FieldErrorMessage.js +12 -16
  12. package/es/FieldHelper.js +9 -12
  13. package/es/FramedContent.js +3 -15
  14. package/es/Icon.js +9 -6
  15. package/es/Input.js +25 -23
  16. package/es/Label.js +15 -39
  17. package/es/Menu.js +32 -6
  18. package/es/MessageBox.js +3 -15
  19. package/es/NdlaLogo.js +6 -5
  20. package/es/RadioGroup.js +7 -11
  21. package/es/Skeleton.js +2 -8
  22. package/es/Spinner.js +3 -15
  23. package/es/Switch.js +8 -15
  24. package/es/Table.js +2 -5
  25. package/es/Tabs.js +231 -0
  26. package/es/Text.js +33 -32
  27. package/es/Toast.js +14 -6
  28. package/es/createStyleContext.js +15 -7
  29. package/lib/Accordion.d.ts +14 -7
  30. package/lib/ArticleLists.d.ts +9 -11
  31. package/lib/ArticleLists.js +5 -36
  32. package/lib/Badge.d.ts +9 -4
  33. package/lib/Badge.js +4 -17
  34. package/lib/BlockQuote.d.ts +9 -3
  35. package/lib/BlockQuote.js +5 -18
  36. package/lib/Button.d.ts +24 -11
  37. package/lib/Button.js +39 -32
  38. package/lib/Checkbox.d.ts +172 -5
  39. package/lib/Checkbox.js +165 -56
  40. package/lib/Dialog.d.ts +18 -10
  41. package/lib/Dialog.js +6 -7
  42. package/lib/ExpandableBox.d.ts +8 -5
  43. package/lib/ExpandableBox.js +5 -20
  44. package/lib/Field.d.ts +9 -0
  45. package/lib/Field.js +23 -0
  46. package/lib/FieldErrorMessage.d.ts +3 -3
  47. package/lib/FieldErrorMessage.js +11 -15
  48. package/lib/FieldHelper.d.ts +3 -3
  49. package/lib/FieldHelper.js +8 -11
  50. package/lib/FramedContent.d.ts +8 -4
  51. package/lib/FramedContent.js +3 -16
  52. package/lib/Icon.d.ts +3 -2
  53. package/lib/Icon.js +8 -5
  54. package/lib/Input.d.ts +12 -11
  55. package/lib/Input.js +25 -23
  56. package/lib/Label.d.ts +13 -7
  57. package/lib/Label.js +15 -39
  58. package/lib/Menu.d.ts +66 -13
  59. package/lib/Menu.js +41 -15
  60. package/lib/MessageBox.d.ts +8 -4
  61. package/lib/MessageBox.js +3 -16
  62. package/lib/NdlaLogo.d.ts +5 -4
  63. package/lib/NdlaLogo.js +5 -4
  64. package/lib/Pagination.d.ts +17 -6
  65. package/lib/Popover.d.ts +34 -13
  66. package/lib/RadioGroup.d.ts +18 -7
  67. package/lib/RadioGroup.js +7 -11
  68. package/lib/Skeleton.d.ts +5 -2
  69. package/lib/Skeleton.js +3 -10
  70. package/lib/Slider.d.ts +18 -7
  71. package/lib/Spinner.d.ts +8 -3
  72. package/lib/Spinner.js +3 -16
  73. package/lib/Switch.d.ts +12 -7
  74. package/lib/Switch.js +13 -20
  75. package/lib/Table.d.ts +6 -3
  76. package/lib/Table.js +4 -8
  77. package/lib/Tabs.d.ts +145 -0
  78. package/lib/Tabs.js +239 -0
  79. package/lib/Text.d.ts +6 -9
  80. package/lib/Text.js +32 -33
  81. package/lib/Toast.d.ts +10 -7
  82. package/lib/Toast.js +15 -7
  83. package/lib/Tooltip.d.ts +19 -7
  84. package/lib/createStyleContext.d.ts +5 -3
  85. package/lib/createStyleContext.js +14 -6
  86. package/package.json +5 -5
  87. package/es/FormControl.js +0 -163
  88. package/lib/FormControl.d.ts +0 -65
  89. package/lib/FormControl.js +0 -173
package/es/Tabs.js ADDED
@@ -0,0 +1,231 @@
1
+ /**
2
+ * Copyright (c) 2024-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import { tabsAnatomy } from "@ark-ui/anatomy";
10
+ import { Tabs } from "@ark-ui/react";
11
+ import { cx, sva } from "@ndla/styled-system/css";
12
+ import { createStyleContext } from "./createStyleContext";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ const tabsRecipe = sva({
15
+ slots: tabsAnatomy.keys(),
16
+ base: {
17
+ root: {
18
+ position: "relative",
19
+ display: "flex",
20
+ width: "100%",
21
+ _horizontal: {
22
+ flexDirection: "column"
23
+ },
24
+ _vertical: {
25
+ flexDirection: "row"
26
+ }
27
+ },
28
+ list: {
29
+ position: "relative",
30
+ display: "flex",
31
+ flexShrink: "0",
32
+ overflow: "auto",
33
+ _horizontal: {
34
+ flexDirection: "row"
35
+ },
36
+ _vertical: {
37
+ flexDirection: "column"
38
+ }
39
+ },
40
+ trigger: {
41
+ display: "inline-flex",
42
+ alignItems: "center",
43
+ justifyContent: "center",
44
+ flexShrink: "0",
45
+ cursor: "pointer",
46
+ textStyle: "label.small",
47
+ fontWeight: "bold",
48
+ transitionDuration: "normal",
49
+ transitionProperty: "color, background, border-color",
50
+ transitionTimingFunction: "default",
51
+ whiteSpace: "nowrap",
52
+ paddingInline: "small",
53
+ paddingBlock: "3xsmall",
54
+ zIndex: "1",
55
+ _hover: {
56
+ color: "text.action"
57
+ },
58
+ _selected: {
59
+ color: "text.strong"
60
+ },
61
+ _disabled: {
62
+ color: "text.subtle",
63
+ cursor: "not-allowed",
64
+ _hover: {
65
+ color: "text.subtle"
66
+ }
67
+ }
68
+ },
69
+ content: {
70
+ display: "flex",
71
+ flexDirection: "column",
72
+ alignItems: "flex-start",
73
+ gap: "xsmall"
74
+ }
75
+ },
76
+ defaultVariants: {
77
+ variant: "line"
78
+ },
79
+ variants: {
80
+ variant: {
81
+ line: {
82
+ trigger: {
83
+ borderColor: "stroke.default",
84
+ _hover: {
85
+ borderColor: "stroke.hover",
86
+ _focusVisible: {
87
+ borderColor: "stroke.default"
88
+ }
89
+ },
90
+ _horizontal: {
91
+ borderBottom: "1px solid"
92
+ },
93
+ _disabled: {
94
+ borderColor: "stroke.default",
95
+ _hover: {
96
+ borderColor: "stroke.default"
97
+ }
98
+ },
99
+ _vertical: {
100
+ borderLeft: "1px solid",
101
+ justifyContent: "flex-start"
102
+ },
103
+ _focusVisible: {
104
+ outline: "none",
105
+ borderRadius: "unset"
106
+ }
107
+ },
108
+ indicator: {
109
+ background: "transparent",
110
+ outline: "4px solid",
111
+ outlineColor: "stroke.default",
112
+ pointerEvents: "none",
113
+ outlineOffset: "-4px",
114
+ _peerFocusVisible: {
115
+ height: "var(--height)",
116
+ width: "var(--width)",
117
+ _horizontal: {
118
+ borderTopRadius: "xsmall"
119
+ },
120
+ _vertical: {
121
+ borderRightRadius: "xsmall"
122
+ }
123
+ },
124
+ _horizontal: {
125
+ bottom: "0",
126
+ height: "2",
127
+ width: "var(--width)"
128
+ },
129
+ _vertical: {
130
+ height: "var(--height)",
131
+ left: "0",
132
+ width: "2"
133
+ }
134
+ },
135
+ content: {
136
+ zIndex: "1",
137
+ _horizontal: {
138
+ paddingBlockStart: "xsmall"
139
+ },
140
+ _vertical: {
141
+ paddingInlineStart: "xsmall"
142
+ },
143
+ _focusVisible: {
144
+ outline: "none",
145
+ boxShadow: "0 0 0 3px var(--shadow-color)",
146
+ boxShadowColor: "stroke.default"
147
+ }
148
+ }
149
+ },
150
+ outline: {
151
+ list: {
152
+ _horizontal: {
153
+ marginBlockEnd: "-1px"
154
+ },
155
+ _vertical: {
156
+ marginInlineEnd: "-1px"
157
+ }
158
+ },
159
+ trigger: {
160
+ borderColor: "transparent",
161
+ borderWidth: "1px",
162
+ _horizontal: {
163
+ borderTopRadius: "xsmall"
164
+ },
165
+ _vertical: {
166
+ borderTopLeftRadius: "xsmall",
167
+ borderBottomLeftRadius: "xsmall"
168
+ },
169
+ _selected: {
170
+ background: "surface.default",
171
+ borderColor: "stroke.subtle",
172
+ _horizontal: {
173
+ borderBottomColor: "transparent"
174
+ },
175
+ _vertical: {
176
+ borderRightColor: "transparent"
177
+ }
178
+ },
179
+ _focusVisible: {
180
+ outline: "3px solid",
181
+ outlineOffset: "-3px",
182
+ outlineColor: "stroke.default"
183
+ }
184
+ },
185
+ content: {
186
+ borderWidth: "1px",
187
+ borderColor: "stroke.subtle",
188
+ background: "surface.default",
189
+ width: "100%",
190
+ padding: "xsmall",
191
+ _focusVisible: {
192
+ outline: "3px solid",
193
+ outlineOffset: "-3px",
194
+ outlineColor: "stroke.default"
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ });
201
+ const {
202
+ withProvider,
203
+ withContext
204
+ } = createStyleContext(tabsRecipe);
205
+ const InternalTabsRoot = withProvider(Tabs.Root, "root");
206
+ export const TabsRoot = _ref => {
207
+ let {
208
+ lazyMount = true,
209
+ unmountOnExit = true,
210
+ ...props
211
+ } = _ref;
212
+ return /*#__PURE__*/_jsx(InternalTabsRoot, {
213
+ lazyMount: lazyMount,
214
+ unmountOnExit: unmountOnExit,
215
+ ...props
216
+ });
217
+ };
218
+ export const TabsContent = withContext(Tabs.Content, "content");
219
+ export const TabsIndicator = withContext(Tabs.Indicator, "indicator");
220
+ export const TabsList = withContext(Tabs.List, "list");
221
+ const InternalTabsTrigger = withContext(Tabs.Trigger, "trigger");
222
+ export const TabsTrigger = _ref2 => {
223
+ let {
224
+ className,
225
+ ...props
226
+ } = _ref2;
227
+ return /*#__PURE__*/_jsx(InternalTabsTrigger, {
228
+ className: cx("peer", className),
229
+ ...props
230
+ });
231
+ };
package/es/Text.js CHANGED
@@ -6,49 +6,50 @@
6
6
  *
7
7
  */
8
8
 
9
- import { css, cx } from "@ndla/styled-system/css";
9
+ import { forwardRef } from "react";
10
+ import { ark } from "@ark-ui/react";
11
+ import { css } from "@ndla/styled-system/css";
12
+ import { styled } from "@ndla/styled-system/jsx";
10
13
  import { jsx as _jsx } from "react/jsx-runtime";
11
- const BaseText = props => {
12
- const {
13
- as: As = "p",
14
- className,
14
+ const StyledP = styled(ark.p);
15
+ export const Text = /*#__PURE__*/forwardRef((_ref, ref) => {
16
+ let {
17
+ textStyle = "body.medium",
15
18
  fontWeight,
16
19
  color,
17
- textStyle = "body.medium",
18
20
  srOnly,
21
+ css: cssProp,
19
22
  ...rest
20
- } = props;
21
- return /*#__PURE__*/_jsx(As, {
22
- className: cx(css({
23
+ } = _ref;
24
+ return /*#__PURE__*/_jsx(StyledP, {
25
+ css: css.raw({
23
26
  textStyle,
24
27
  fontWeight,
25
28
  color,
26
- srOnly: srOnly
27
- }), className),
29
+ srOnly
30
+ }, cssProp),
31
+ ref: ref,
28
32
  ...rest
29
33
  });
30
- };
31
- export const Heading = props => {
32
- const {
33
- as = "h1",
34
+ });
35
+ const StyledH1 = styled(ark.h1);
36
+ export const Heading = /*#__PURE__*/forwardRef((_ref2, ref) => {
37
+ let {
34
38
  textStyle = "heading.medium",
39
+ fontWeight,
40
+ color,
41
+ srOnly,
42
+ css: cssProp,
35
43
  ...rest
36
- } = props;
37
- return /*#__PURE__*/_jsx(BaseText, {
38
- as: as,
39
- textStyle: textStyle,
40
- ...rest
41
- });
42
- };
43
- export const Text = props => {
44
- const {
45
- as = "p",
46
- textStyle = "body.medium",
47
- ...rest
48
- } = props;
49
- return /*#__PURE__*/_jsx(BaseText, {
50
- as: as,
51
- textStyle: textStyle,
44
+ } = _ref2;
45
+ return /*#__PURE__*/_jsx(StyledH1, {
46
+ css: css.raw({
47
+ textStyle,
48
+ fontWeight,
49
+ color,
50
+ srOnly
51
+ }, cssProp),
52
+ ref: ref,
52
53
  ...rest
53
54
  });
54
- };
55
+ });
package/es/Toast.js CHANGED
@@ -48,35 +48,43 @@ const {
48
48
  export const ToastRoot = withProvider(Toast.Root, "root");
49
49
  export const ToastActionTrigger = withContext(Toast.ActionTrigger, "actionTrigger");
50
50
  export const ToastCloseTrigger = withContext(Toast.CloseTrigger, "closeTrigger");
51
- export const InternalToastDescription = withContext(Toast.Description, "description");
51
+ const InternalToastDescription = withContext(Toast.Description, "description");
52
52
  export const ToastDescription = _ref => {
53
53
  let {
54
54
  textStyle = "label.medium",
55
+ children,
55
56
  ...props
56
57
  } = _ref;
57
58
  return /*#__PURE__*/_jsx(InternalToastDescription, {
58
59
  asChild: true,
59
60
  children: /*#__PURE__*/_jsx(Text, {
60
- as: "div",
61
+ asChild: true,
61
62
  textStyle: textStyle,
62
- ...props
63
+ ...props,
64
+ children: /*#__PURE__*/_jsx("div", {
65
+ children: children
66
+ })
63
67
  })
64
68
  });
65
69
  };
66
- export const InternalToastTitle = withContext(Toast.Title, "title");
70
+ const InternalToastTitle = withContext(Toast.Title, "title");
67
71
  export const ToastTitle = _ref2 => {
68
72
  let {
69
73
  textStyle = "label.medium",
70
74
  fontWeight = "semibold",
75
+ children,
71
76
  ...props
72
77
  } = _ref2;
73
78
  return /*#__PURE__*/_jsx(InternalToastTitle, {
74
79
  asChild: true,
75
80
  children: /*#__PURE__*/_jsx(Text, {
76
- as: "div",
81
+ asChild: true,
77
82
  fontWeight: fontWeight,
78
83
  textStyle: textStyle,
79
- ...props
84
+ ...props,
85
+ children: /*#__PURE__*/_jsx("div", {
86
+ children: children
87
+ })
80
88
  })
81
89
  });
82
90
  };
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { createContext, forwardRef, useContext } from "react";
10
- import { cx } from "@ndla/styled-system/css";
10
+ import { css } from "@ndla/styled-system/css";
11
11
  import { styled } from "@ndla/styled-system/jsx";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  /**
@@ -18,7 +18,7 @@ export const createStyleContext = recipe => {
18
18
  const withRootProvider = Component => {
19
19
  const StyledComponent = props => {
20
20
  const [variantProps, otherProps] = recipe.splitVariantProps(props);
21
- const slotStyles = recipe(variantProps);
21
+ const slotStyles = recipe.raw(variantProps);
22
22
  return /*#__PURE__*/_jsx(StyleContext.Provider, {
23
23
  value: slotStyles,
24
24
  children: /*#__PURE__*/_jsx(Component, {
@@ -30,27 +30,35 @@ export const createStyleContext = recipe => {
30
30
  };
31
31
  const withProvider = (Component, slot) => {
32
32
  const StyledComponent = styled(Component);
33
- return /*#__PURE__*/forwardRef((props, ref) => {
33
+ return /*#__PURE__*/forwardRef((_ref, ref) => {
34
+ let {
35
+ css: cssProp,
36
+ ...props
37
+ } = _ref;
34
38
  const [variantProps, otherProps] = recipe.splitVariantProps(props);
35
- const slotStyles = recipe(variantProps);
39
+ const slotStyles = recipe.raw(variantProps);
36
40
  return /*#__PURE__*/_jsx(StyleContext.Provider, {
37
41
  value: slotStyles,
38
42
  children: /*#__PURE__*/_jsx(StyledComponent, {
39
43
  ...otherProps,
40
44
  ref: ref,
41
- className: cx(slotStyles === null || slotStyles === void 0 ? void 0 : slotStyles[slot], props.className)
45
+ css: css.raw(slotStyles === null || slotStyles === void 0 ? void 0 : slotStyles[slot], cssProp)
42
46
  })
43
47
  });
44
48
  });
45
49
  };
46
50
  const withContext = (Component, slot) => {
47
51
  const StyledComponent = styled(Component);
48
- return /*#__PURE__*/forwardRef((props, ref) => {
52
+ return /*#__PURE__*/forwardRef((_ref2, ref) => {
53
+ let {
54
+ css: cssProp,
55
+ ...props
56
+ } = _ref2;
49
57
  const slotStyles = useContext(StyleContext);
50
58
  return /*#__PURE__*/_jsx(StyledComponent, {
51
59
  ...props,
52
60
  ref: ref,
53
- className: cx(slotStyles === null || slotStyles === void 0 ? void 0 : slotStyles[slot], props.className)
61
+ css: css.raw(slotStyles === null || slotStyles === void 0 ? void 0 : slotStyles[slot], cssProp)
54
62
  });
55
63
  });
56
64
  };
@@ -5,13 +5,20 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { Assign } from "@ark-ui/react";
9
8
  import { Accordion } from "@ark-ui/react";
10
- import { SystemProperties } from "@ndla/styled-system/types";
11
- export interface AccordionRootProps extends Assign<SystemProperties, Accordion.RootProps> {
9
+ import { JsxStyleProps } from "@ndla/styled-system/types";
10
+ export interface AccordionRootProps extends JsxStyleProps, Accordion.RootProps {
12
11
  }
13
12
  export declare const AccordionRoot: import("react").ForwardRefExoticComponent<AccordionRootProps & import("react").RefAttributes<HTMLDivElement>>;
14
- export declare const AccordionItemContent: import("react").ForwardRefExoticComponent<Omit<SystemProperties, keyof Accordion.ItemContentProps> & Accordion.ItemContentProps & import("react").RefAttributes<HTMLDivElement>>;
15
- export declare const AccordionItemIndicator: import("react").ForwardRefExoticComponent<Omit<SystemProperties, keyof Accordion.ItemIndicatorProps> & Accordion.ItemIndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
16
- export declare const AccordionItem: import("react").ForwardRefExoticComponent<Omit<SystemProperties, keyof Accordion.ItemProps> & Accordion.ItemProps & import("react").RefAttributes<HTMLDivElement>>;
17
- export declare const AccordionItemTrigger: import("react").ForwardRefExoticComponent<Omit<SystemProperties, keyof Accordion.ItemTriggerProps> & Accordion.ItemTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
13
+ export declare const AccordionItemContent: import("react").ForwardRefExoticComponent<{
14
+ forwardCssProp?: boolean | undefined;
15
+ } & import("@ndla/styled-system/types").WithCss & Accordion.ItemContentProps & import("react").RefAttributes<HTMLDivElement>>;
16
+ export declare const AccordionItemIndicator: import("react").ForwardRefExoticComponent<{
17
+ forwardCssProp?: boolean | undefined;
18
+ } & import("@ndla/styled-system/types").WithCss & Accordion.ItemIndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
19
+ export declare const AccordionItem: import("react").ForwardRefExoticComponent<{
20
+ forwardCssProp?: boolean | undefined;
21
+ } & import("@ndla/styled-system/types").WithCss & Accordion.ItemProps & import("react").RefAttributes<HTMLDivElement>>;
22
+ export declare const AccordionItemTrigger: import("react").ForwardRefExoticComponent<{
23
+ forwardCssProp?: boolean | undefined;
24
+ } & import("@ndla/styled-system/types").WithCss & Accordion.ItemTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -5,16 +5,14 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { ComponentPropsWithoutRef } from "react";
9
- import { StyledVariantProps } from "@ndla/styled-system/types";
10
- declare const StyledOrderedList: import("@ndla/styled-system/jsx").StyledComponent<"ol", {
8
+ import { HTMLArkProps } from "@ark-ui/react";
9
+ import { JsxStyleProps, StyledVariantProps } from "@ndla/styled-system/types";
10
+ export type OrderedListVariantProps = StyledVariantProps<typeof OrderedList>;
11
+ export type OrderedListProps = HTMLArkProps<"ol"> & JsxStyleProps & OrderedListVariantProps;
12
+ export declare const OrderedList: import("@ndla/styled-system/jsx").StyledComponent<"ol", {
11
13
  variant?: "numbers" | "letters" | undefined;
12
14
  }>;
13
- export type OrderedListVariantProps = StyledVariantProps<typeof StyledOrderedList>;
14
- export type OrderedListProps = ComponentPropsWithoutRef<"ol"> & OrderedListVariantProps;
15
- export declare const OrderedList: ({ variant, ...props }: OrderedListProps) => import("@emotion/react/jsx-runtime").JSX.Element;
16
- export type UnOrderedListProps = ComponentPropsWithoutRef<"ul">;
17
- export declare const UnOrderedList: ({ ...props }: UnOrderedListProps) => import("@emotion/react/jsx-runtime").JSX.Element;
18
- export type DefinitionListProps = ComponentPropsWithoutRef<"dl">;
19
- export declare const DefinitionList: ({ ...props }: DefinitionListProps) => import("@emotion/react/jsx-runtime").JSX.Element;
20
- export {};
15
+ export type UnOrderedListProps = HTMLArkProps<"ul"> & JsxStyleProps;
16
+ export declare const UnOrderedList: import("@ndla/styled-system/jsx").StyledComponent<"ul", {}>;
17
+ export declare const DefinitionList: import("@ndla/styled-system/jsx").StyledComponent<"dl", {}>;
18
+ export type DefinitionListProps = HTMLArkProps<"dl"> & JsxStyleProps;
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UnOrderedList = exports.OrderedList = exports.DefinitionList = void 0;
7
- var _jsx2 = require("@ndla/styled-system/jsx");
8
- var _jsxRuntime = require("react/jsx-runtime");
7
+ var _jsx = require("@ndla/styled-system/jsx");
9
8
  /**
10
9
  * Copyright (c) 2024-present, NDLA.
11
10
  *
@@ -14,7 +13,7 @@ var _jsxRuntime = require("react/jsx-runtime");
14
13
  *
15
14
  */
16
15
 
17
- const StyledOrderedList = (0, _jsx2.styled)("ol", {
16
+ const OrderedList = exports.OrderedList = (0, _jsx.styled)("ol", {
18
17
  base: {
19
18
  listStyle: "revert",
20
19
  listStylePosition: "inside",
@@ -60,19 +59,7 @@ const StyledOrderedList = (0, _jsx2.styled)("ol", {
60
59
  }
61
60
  }
62
61
  });
63
- const OrderedList = _ref => {
64
- let {
65
- variant = "numbers",
66
- ...props
67
- } = _ref;
68
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledOrderedList, {
69
- variant: variant,
70
- "data-variant": variant,
71
- ...props
72
- });
73
- };
74
- exports.OrderedList = OrderedList;
75
- const StyledUnOrderedList = (0, _jsx2.styled)("ul", {
62
+ const UnOrderedList = exports.UnOrderedList = (0, _jsx.styled)("ul", {
76
63
  base: {
77
64
  listStyle: "revert",
78
65
  listStylePosition: "inside",
@@ -85,16 +72,7 @@ const StyledUnOrderedList = (0, _jsx2.styled)("ul", {
85
72
  }
86
73
  }
87
74
  });
88
- const UnOrderedList = _ref2 => {
89
- let {
90
- ...props
91
- } = _ref2;
92
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledUnOrderedList, {
93
- ...props
94
- });
95
- };
96
- exports.UnOrderedList = UnOrderedList;
97
- const StyledDefinitionList = (0, _jsx2.styled)("dl", {
75
+ const DefinitionList = exports.DefinitionList = (0, _jsx.styled)("dl", {
98
76
  base: {
99
77
  "& dt": {
100
78
  fontWeight: "bold"
@@ -103,13 +81,4 @@ const StyledDefinitionList = (0, _jsx2.styled)("dl", {
103
81
  marginInlineStart: "medium"
104
82
  }
105
83
  }
106
- });
107
- const DefinitionList = _ref3 => {
108
- let {
109
- ...props
110
- } = _ref3;
111
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledDefinitionList, {
112
- ...props
113
- });
114
- };
115
- exports.DefinitionList = DefinitionList;
84
+ });
package/lib/Badge.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 { ComponentPropsWithoutRef } from "react";
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 badgeRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
11
12
  colorTheme: {
12
13
  brand1: {
@@ -14,7 +15,7 @@ declare const badgeRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
14
15
  borderColor: "surface.brand.1.strong";
15
16
  };
16
17
  brand2: {
17
- backgroundColor: "surface.brand.2.subtle";
18
+ backgroundColor: "surface.brand.2.moderate";
18
19
  borderColor: "surface.brand.2.strong";
19
20
  };
20
21
  brand3: {
@@ -28,6 +29,10 @@ declare const badgeRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
28
29
  };
29
30
  }>;
30
31
  export type BadgeVariantProps = RecipeVariantProps<typeof badgeRecipe>;
31
- export type BadgeProps = BadgeVariantProps & ComponentPropsWithoutRef<"div">;
32
- export declare const Badge: ({ colorTheme, className, ...rest }: BadgeProps) => import("@emotion/react/jsx-runtime").JSX.Element;
32
+ export type BadgeProps = HTMLArkProps<"div"> & JsxStyleProps & BadgeVariantProps;
33
+ export declare const Badge: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
34
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
35
+ } & import("@ark-ui/react").PolymorphicProps>, {
36
+ colorTheme?: "neutral" | "brand1" | "brand2" | "brand3" | undefined;
37
+ }>;
33
38
  export {};
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 _jsx2 = require("@ndla/styled-system/jsx");
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.subtle",
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 = _ref => {
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);
@@ -5,12 +5,14 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { ComponentPropsWithoutRef } from "react";
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: {
13
14
  borderColor: "stroke.subtle";
15
+ background: "surface.default";
14
16
  };
15
17
  brand1: {
16
18
  background: "surface.brand.1.subtle";
@@ -23,6 +25,10 @@ declare const blockQuoteRecipe: import("@ndla/styled-system/types").RecipeRuntim
23
25
  };
24
26
  }>;
25
27
  export type BlockQuoteVariantProps = RecipeVariantProps<typeof blockQuoteRecipe>;
26
- export type BlockQuoteProps = ComponentPropsWithoutRef<"blockquote"> & BlockQuoteVariantProps;
27
- export declare const BlockQuote: ({ className, variant, ...rest }: BlockQuoteProps) => import("@emotion/react/jsx-runtime").JSX.Element;
28
+ export type BlockQuoteProps = HTMLArkProps<"blockquote"> & JsxStyleProps & BlockQuoteVariantProps;
29
+ export declare const BlockQuote: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, "ref"> & {
30
+ ref?: ((instance: HTMLQuoteElement | null) => void) | import("react").RefObject<HTMLQuoteElement> | null | undefined;
31
+ } & import("@ark-ui/react").PolymorphicProps>, {
32
+ variant?: "neutral" | "brand1" | "brand2" | undefined;
33
+ }>;
28
34
  export {};