@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.
Files changed (84) hide show
  1. package/dist/panda.buildinfo.json +61 -14
  2. package/dist/styles.css +226 -26
  3. package/es/ArticleLists.js +4 -32
  4. package/es/Badge.js +4 -16
  5. package/es/BlockQuote.js +3 -15
  6. package/es/Button.js +40 -33
  7. package/es/Dialog.js +6 -7
  8. package/es/ExpandableBox.js +4 -17
  9. package/es/FieldErrorMessage.js +9 -7
  10. package/es/FieldHelper.js +7 -5
  11. package/es/FormControl.js +2 -1
  12. package/es/FramedContent.js +3 -15
  13. package/es/Icon.js +9 -6
  14. package/es/Input.js +13 -10
  15. package/es/Label.js +10 -9
  16. package/es/Menu.js +32 -6
  17. package/es/MessageBox.js +3 -15
  18. package/es/NdlaLogo.js +6 -5
  19. package/es/RadioGroup.js +6 -2
  20. package/es/Skeleton.js +2 -8
  21. package/es/Spinner.js +3 -15
  22. package/es/Switch.js +8 -4
  23. package/es/Table.js +2 -5
  24. package/es/Tabs.js +232 -0
  25. package/es/Text.js +33 -32
  26. package/es/Toast.js +14 -6
  27. package/es/createStyleContext.js +15 -7
  28. package/lib/Accordion.d.ts +14 -7
  29. package/lib/ArticleLists.d.ts +9 -11
  30. package/lib/ArticleLists.js +5 -36
  31. package/lib/Badge.d.ts +9 -4
  32. package/lib/Badge.js +4 -17
  33. package/lib/BlockQuote.d.ts +8 -3
  34. package/lib/BlockQuote.js +3 -16
  35. package/lib/Button.d.ts +24 -11
  36. package/lib/Button.js +39 -32
  37. package/lib/Checkbox.d.ts +12 -5
  38. package/lib/Dialog.d.ts +18 -10
  39. package/lib/Dialog.js +6 -7
  40. package/lib/ExpandableBox.d.ts +8 -5
  41. package/lib/ExpandableBox.js +5 -20
  42. package/lib/FieldErrorMessage.d.ts +3 -3
  43. package/lib/FieldErrorMessage.js +8 -6
  44. package/lib/FieldHelper.d.ts +3 -3
  45. package/lib/FieldHelper.js +6 -4
  46. package/lib/FormControl.d.ts +4 -2
  47. package/lib/FormControl.js +2 -1
  48. package/lib/FramedContent.d.ts +8 -4
  49. package/lib/FramedContent.js +3 -16
  50. package/lib/Icon.d.ts +3 -2
  51. package/lib/Icon.js +8 -5
  52. package/lib/Input.d.ts +12 -11
  53. package/lib/Input.js +12 -9
  54. package/lib/Label.d.ts +16 -7
  55. package/lib/Label.js +9 -8
  56. package/lib/Menu.d.ts +66 -13
  57. package/lib/Menu.js +41 -15
  58. package/lib/MessageBox.d.ts +8 -4
  59. package/lib/MessageBox.js +3 -16
  60. package/lib/NdlaLogo.d.ts +5 -4
  61. package/lib/NdlaLogo.js +5 -4
  62. package/lib/Pagination.d.ts +17 -6
  63. package/lib/Popover.d.ts +34 -13
  64. package/lib/RadioGroup.d.ts +18 -7
  65. package/lib/RadioGroup.js +6 -2
  66. package/lib/Skeleton.d.ts +5 -2
  67. package/lib/Skeleton.js +3 -10
  68. package/lib/Slider.d.ts +18 -7
  69. package/lib/Spinner.d.ts +8 -3
  70. package/lib/Spinner.js +3 -16
  71. package/lib/Switch.d.ts +12 -7
  72. package/lib/Switch.js +9 -5
  73. package/lib/Table.d.ts +6 -3
  74. package/lib/Table.js +4 -8
  75. package/lib/Tabs.d.ts +145 -0
  76. package/lib/Tabs.js +240 -0
  77. package/lib/Text.d.ts +6 -9
  78. package/lib/Text.js +32 -33
  79. package/lib/Toast.d.ts +10 -7
  80. package/lib/Toast.js +15 -7
  81. package/lib/Tooltip.d.ts +19 -7
  82. package/lib/createStyleContext.d.ts +5 -3
  83. package/lib/createStyleContext.js +14 -6
  84. package/package.json +5 -5
@@ -6,14 +6,25 @@
6
6
  *
7
7
  */
8
8
  import { RadioGroup } from "@ark-ui/react";
9
+ import { JsxStyleProps } from "@ndla/styled-system/types";
9
10
  import { TextProps } from "./Text";
10
- export interface RadioGroupRootProps extends RadioGroup.RootProps {
11
+ export interface RadioGroupRootProps extends RadioGroup.RootProps, JsxStyleProps {
11
12
  }
12
13
  export declare const RadioGroupRoot: import("react").ForwardRefExoticComponent<RadioGroupRootProps & import("react").RefAttributes<HTMLDivElement>>;
13
- export declare const RadioGroupIndicator: import("react").ForwardRefExoticComponent<RadioGroup.IndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
14
- export declare const RadioGroupItemControl: import("react").ForwardRefExoticComponent<RadioGroup.ItemControlProps & import("react").RefAttributes<HTMLDivElement>>;
15
- export declare const RadioGroupItem: import("react").ForwardRefExoticComponent<RadioGroup.ItemProps & import("react").RefAttributes<HTMLLabelElement>>;
16
- export declare const RadioGroupItemText: ({ textStyle, ...props }: RadioGroup.ItemTextProps & TextProps) => import("@emotion/react/jsx-runtime").JSX.Element;
17
- export declare const InternalRadioGroupLabel: import("react").ForwardRefExoticComponent<RadioGroup.LabelProps & import("react").RefAttributes<HTMLLabelElement>>;
18
- export declare const RadioGroupLabel: import("react").ForwardRefExoticComponent<RadioGroup.LabelProps & TextProps & import("react").RefAttributes<HTMLLabelElement>>;
14
+ export declare const RadioGroupIndicator: import("react").ForwardRefExoticComponent<RadioGroup.IndicatorProps & {
15
+ forwardCssProp?: boolean | undefined;
16
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
17
+ export declare const RadioGroupItemControl: import("react").ForwardRefExoticComponent<RadioGroup.ItemControlProps & {
18
+ forwardCssProp?: boolean | undefined;
19
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
20
+ export declare const RadioGroupItem: import("react").ForwardRefExoticComponent<RadioGroup.ItemProps & {
21
+ forwardCssProp?: boolean | undefined;
22
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLLabelElement>>;
23
+ export declare const RadioGroupItemText: ({ textStyle, children, ...props }: RadioGroup.ItemTextProps & TextProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const InternalRadioGroupLabel: import("react").ForwardRefExoticComponent<RadioGroup.LabelProps & {
25
+ forwardCssProp?: boolean | undefined;
26
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLLabelElement>>;
27
+ export declare const RadioGroupLabel: import("react").ForwardRefExoticComponent<RadioGroup.LabelProps & TextProps & {
28
+ forwardCssProp?: boolean | undefined;
29
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLLabelElement>>;
19
30
  export declare const RadioGroupItemHiddenInput: import("react").ForwardRefExoticComponent<RadioGroup.ItemHiddenInputProps & import("react").RefAttributes<HTMLInputElement>>;
package/lib/RadioGroup.js CHANGED
@@ -113,14 +113,18 @@ const InternalRadioGroupItemText = withContext(_react2.RadioGroup.ItemText, "ite
113
113
  const RadioGroupItemText = _ref => {
114
114
  let {
115
115
  textStyle = "label.medium",
116
+ children,
116
117
  ...props
117
118
  } = _ref;
118
119
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalRadioGroupItemText, {
119
120
  asChild: true,
120
121
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
121
- as: "span",
122
+ asChild: true,
122
123
  textStyle: textStyle,
123
- ...props
124
+ ...props,
125
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
126
+ children: children
127
+ })
124
128
  })
125
129
  });
126
130
  };
package/lib/Skeleton.d.ts CHANGED
@@ -6,6 +6,9 @@
6
6
  *
7
7
  */
8
8
  import { HTMLArkProps } from "@ark-ui/react";
9
- export interface SkeletonProps extends HTMLArkProps<"div"> {
9
+ import { JsxStyleProps } from "@ndla/styled-system/types";
10
+ export declare const Skeleton: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
11
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
12
+ } & import("@ark-ui/react").PolymorphicProps>, {}>;
13
+ export interface SkeletonProps extends HTMLArkProps<"div">, JsxStyleProps {
10
14
  }
11
- export declare const Skeleton: (props: SkeletonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
package/lib/Skeleton.js CHANGED
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Skeleton = void 0;
7
7
  var _react = require("@ark-ui/react");
8
- var _jsx2 = require("@ndla/styled-system/jsx");
9
- var _jsxRuntime = require("react/jsx-runtime");
8
+ var _jsx = require("@ndla/styled-system/jsx");
10
9
  /**
11
10
  * Copyright (c) 2024-present, NDLA.
12
11
  *
@@ -15,7 +14,7 @@ var _jsxRuntime = require("react/jsx-runtime");
15
14
  *
16
15
  */
17
16
 
18
- const StyledDiv = (0, _jsx2.styled)(_react.ark.div, {
17
+ const Skeleton = exports.Skeleton = (0, _jsx.styled)(_react.ark.div, {
19
18
  base: {
20
19
  animation: "skeleton-pulse",
21
20
  backgroundColor: "surface.disabled",
@@ -29,10 +28,4 @@ const StyledDiv = (0, _jsx2.styled)(_react.ark.div, {
29
28
  visibility: "hidden"
30
29
  }
31
30
  }
32
- });
33
- const Skeleton = props => {
34
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledDiv, {
35
- ...props
36
- });
37
- };
38
- exports.Skeleton = Skeleton;
31
+ });
package/lib/Slider.d.ts CHANGED
@@ -6,12 +6,23 @@
6
6
  *
7
7
  */
8
8
  import { Slider } from "@ark-ui/react";
9
+ import { JsxStyleProps } from "@ndla/styled-system/types";
9
10
  import { TextProps } from "./Text";
10
- export type SliderRootProps = Slider.RootProps;
11
- export declare const SliderRoot: import("react").ForwardRefExoticComponent<Slider.RootProps & import("react").RefAttributes<HTMLDivElement>>;
12
- export declare const SliderControl: import("react").ForwardRefExoticComponent<Slider.ControlProps & import("react").RefAttributes<HTMLDivElement>>;
13
- export declare const SliderTrack: import("react").ForwardRefExoticComponent<Slider.TrackProps & import("react").RefAttributes<HTMLDivElement>>;
14
- export declare const SliderRange: import("react").ForwardRefExoticComponent<Slider.RangeProps & import("react").RefAttributes<HTMLDivElement>>;
15
- export declare const SliderThumb: import("react").ForwardRefExoticComponent<Slider.ThumbProps & import("react").RefAttributes<HTMLDivElement>>;
16
- export declare const SliderLabel: ({ textStyle, ...props }: Slider.LabelProps & TextProps) => import("@emotion/react/jsx-runtime").JSX.Element;
11
+ export type SliderRootProps = Slider.RootProps & JsxStyleProps;
12
+ export declare const SliderRoot: import("react").ForwardRefExoticComponent<Slider.RootProps & {
13
+ forwardCssProp?: boolean | undefined;
14
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
15
+ export declare const SliderControl: import("react").ForwardRefExoticComponent<{
16
+ forwardCssProp?: boolean | undefined;
17
+ } & import("@ndla/styled-system/types").WithCss & Slider.ControlProps & import("react").RefAttributes<HTMLDivElement>>;
18
+ export declare const SliderTrack: import("react").ForwardRefExoticComponent<{
19
+ forwardCssProp?: boolean | undefined;
20
+ } & import("@ndla/styled-system/types").WithCss & Slider.TrackProps & import("react").RefAttributes<HTMLDivElement>>;
21
+ export declare const SliderRange: import("react").ForwardRefExoticComponent<{
22
+ forwardCssProp?: boolean | undefined;
23
+ } & import("@ndla/styled-system/types").WithCss & Slider.RangeProps & import("react").RefAttributes<HTMLDivElement>>;
24
+ export declare const SliderThumb: import("react").ForwardRefExoticComponent<{
25
+ forwardCssProp?: boolean | undefined;
26
+ } & import("@ndla/styled-system/types").WithCss & Slider.ThumbProps & import("react").RefAttributes<HTMLDivElement>>;
27
+ export declare const SliderLabel: ({ textStyle, ...props }: Slider.LabelProps & TextProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
17
28
  export declare const SliderHiddenInput: import("react").ForwardRefExoticComponent<Slider.HiddenInputProps & import("react").RefAttributes<HTMLInputElement>>;
package/lib/Spinner.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
  export declare const spinnerRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
11
12
  size: {
12
13
  medium: {
@@ -22,5 +23,9 @@ export declare const spinnerRecipe: import("@ndla/styled-system/types").RecipeRu
22
23
  };
23
24
  }>;
24
25
  export type SpinnerVariantProps = RecipeVariantProps<typeof spinnerRecipe>;
25
- export type SpinnerProps = ComponentPropsWithoutRef<"div"> & SpinnerVariantProps;
26
- export declare const Spinner: ({ size, className, ...props }: SpinnerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
26
+ export type SpinnerProps = HTMLArkProps<"div"> & SpinnerVariantProps & JsxStyleProps;
27
+ export declare const Spinner: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
28
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
29
+ } & import("@ark-ui/react").PolymorphicProps>, {
30
+ size?: "medium" | "large" | undefined;
31
+ }>;
package/lib/Spinner.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.spinnerRecipe = exports.Spinner = 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
  *
@@ -45,17 +45,4 @@ const spinnerRecipe = exports.spinnerRecipe = (0, _css.cva)({
45
45
  }
46
46
  }
47
47
  });
48
- const Spinner = _ref => {
49
- let {
50
- size,
51
- className,
52
- ...props
53
- } = _ref;
54
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsx2.styled.div, {
55
- className: (0, _css.cx)(spinnerRecipe({
56
- size
57
- }), className),
58
- ...props
59
- });
60
- };
61
- exports.Spinner = Spinner;
48
+ const Spinner = exports.Spinner = (0, _jsx.styled)(_react.ark.div, spinnerRecipe);
package/lib/Switch.d.ts CHANGED
@@ -7,15 +7,20 @@
7
7
  */
8
8
  import { Switch } from "@ark-ui/react";
9
9
  import { RecipeVariantProps } from "@ndla/styled-system/css";
10
+ import { JsxStyleProps } from "@ndla/styled-system/types";
10
11
  import { TextProps } from "./Text";
11
12
  declare const switchRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"label" | "root" | "control" | "thumb", import("@ndla/styled-system/types").SlotRecipeVariantRecord<"label" | "root" | "control" | "thumb">>;
12
13
  export type SwitchVariantProps = RecipeVariantProps<typeof switchRecipe>;
13
- export type SwitchRootProps = Switch.RootProps & SwitchVariantProps;
14
- export declare const InternalSwitchRoot: import("react").ForwardRefExoticComponent<Switch.RootProps & {} & import("react").RefAttributes<HTMLLabelElement>>;
15
- export declare const SwitchRoot: import("react").ForwardRefExoticComponent<Switch.RootProps & {} & import("react").RefAttributes<HTMLLabelElement>>;
16
- export declare const SwitchControl: import("react").ForwardRefExoticComponent<Switch.ControlProps & import("react").RefAttributes<HTMLSpanElement>>;
17
- export declare const SwitchThumb: import("react").ForwardRefExoticComponent<Switch.ThumbProps & import("react").RefAttributes<HTMLSpanElement>>;
18
- export declare const InternalSwitchLabel: import("react").ForwardRefExoticComponent<Switch.LabelProps & import("react").RefAttributes<HTMLSpanElement>>;
19
- export declare const SwitchLabel: ({ textStyle, ...props }: Switch.LabelProps & TextProps) => import("@emotion/react/jsx-runtime").JSX.Element;
14
+ export type SwitchRootProps = Switch.RootProps & JsxStyleProps & SwitchVariantProps;
15
+ export declare const SwitchRoot: import("react").ForwardRefExoticComponent<Switch.RootProps & {
16
+ forwardCssProp?: boolean | undefined;
17
+ } & import("@ndla/styled-system/types").WithCss & {} & import("react").RefAttributes<HTMLLabelElement>>;
18
+ export declare const SwitchControl: import("react").ForwardRefExoticComponent<{
19
+ forwardCssProp?: boolean | undefined;
20
+ } & import("@ndla/styled-system/types").WithCss & Switch.ControlProps & import("react").RefAttributes<HTMLSpanElement>>;
21
+ export declare const SwitchThumb: import("react").ForwardRefExoticComponent<{
22
+ forwardCssProp?: boolean | undefined;
23
+ } & import("@ndla/styled-system/types").WithCss & Switch.ThumbProps & import("react").RefAttributes<HTMLSpanElement>>;
24
+ export declare const SwitchLabel: ({ textStyle, children, ...props }: Switch.LabelProps & TextProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
20
25
  export declare const SwitchHiddenInput: import("react").ForwardRefExoticComponent<Switch.HiddenInputProps & import("react").RefAttributes<HTMLInputElement>>;
21
26
  export {};
package/lib/Switch.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SwitchThumb = exports.SwitchRoot = exports.SwitchLabel = exports.SwitchHiddenInput = exports.SwitchControl = exports.InternalSwitchRoot = exports.InternalSwitchLabel = void 0;
6
+ exports.SwitchThumb = exports.SwitchRoot = exports.SwitchLabel = exports.SwitchHiddenInput = exports.SwitchControl = void 0;
7
7
  var _react = require("react");
8
8
  var _anatomy = require("@ark-ui/anatomy");
9
9
  var _react2 = require("@ark-ui/react");
@@ -106,7 +106,7 @@ const {
106
106
  withProvider,
107
107
  withContext
108
108
  } = (0, _createStyleContext.createStyleContext)(switchRecipe);
109
- const InternalSwitchRoot = exports.InternalSwitchRoot = withProvider(_react2.Switch.Root, "root");
109
+ const InternalSwitchRoot = withProvider(_react2.Switch.Root, "root");
110
110
  const SwitchRoot = exports.SwitchRoot = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
111
111
  var _field$invalid;
112
112
  const field = (0, _FormControl.useFormControl)(props);
@@ -118,18 +118,22 @@ const SwitchRoot = exports.SwitchRoot = /*#__PURE__*/(0, _react.forwardRef)((pro
118
118
  });
119
119
  const SwitchControl = exports.SwitchControl = withContext(_react2.Switch.Control, "control");
120
120
  const SwitchThumb = exports.SwitchThumb = withContext(_react2.Switch.Thumb, "thumb");
121
- const InternalSwitchLabel = exports.InternalSwitchLabel = withContext(_react2.Switch.Label, "label");
121
+ const InternalSwitchLabel = withContext(_react2.Switch.Label, "label");
122
122
  const SwitchLabel = _ref => {
123
123
  let {
124
124
  textStyle = "label.medium",
125
+ children,
125
126
  ...props
126
127
  } = _ref;
127
128
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalSwitchLabel, {
128
129
  asChild: true,
129
130
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
130
- as: "span",
131
+ asChild: true,
131
132
  textStyle: textStyle,
132
- ...props
133
+ ...props,
134
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
135
+ children: children
136
+ })
133
137
  })
134
138
  });
135
139
  };
package/lib/Table.d.ts CHANGED
@@ -5,6 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { ComponentPropsWithoutRef } from "react";
9
- export type TableProps = ComponentPropsWithoutRef<"table">;
10
- export declare const Table: (props: TableProps) => import("@emotion/react/jsx-runtime").JSX.Element;
8
+ import { HTMLArkProps } from "@ark-ui/react";
9
+ import { JsxStyleProps } from "@ndla/styled-system/types";
10
+ export type TableProps = HTMLArkProps<"table"> & JsxStyleProps;
11
+ export declare const Table: import("@ndla/styled-system/jsx").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref"> & {
12
+ ref?: ((instance: HTMLTableElement | null) => void) | import("react").RefObject<HTMLTableElement> | null | undefined;
13
+ } & import("@ark-ui/react").PolymorphicProps>, {}>;
package/lib/Table.js CHANGED
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Table = void 0;
7
- var _jsx2 = require("@ndla/styled-system/jsx");
8
- var _jsxRuntime = require("react/jsx-runtime");
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 StyledTable = (0, _jsx2.styled)("table", {
17
+ const Table = exports.Table = (0, _jsx.styled)(_react.ark.table, {
18
18
  base: {
19
19
  display: "block",
20
20
  overflowX: "auto",
@@ -75,8 +75,4 @@ const StyledTable = (0, _jsx2.styled)("table", {
75
75
  }
76
76
  }
77
77
  }
78
- });
79
- const Table = props => /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTable, {
80
- ...props
81
- });
82
- exports.Table = Table;
78
+ });
package/lib/Tabs.d.ts ADDED
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Copyright (c) 2024-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { Tabs } from "@ark-ui/react";
9
+ import { RecipeVariantProps } from "@ndla/styled-system/css";
10
+ import { JsxStyleProps } from "@ndla/styled-system/types";
11
+ declare const tabsRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"content" | "list" | "root" | "indicator" | "trigger", {
12
+ variant: {
13
+ line: {
14
+ trigger: {
15
+ borderColor: "stroke.default";
16
+ _hover: {
17
+ borderColor: "stroke.hover";
18
+ _focusVisible: {
19
+ borderColor: "stroke.default";
20
+ };
21
+ };
22
+ _horizontal: {
23
+ borderBottom: "1px solid";
24
+ };
25
+ _disabled: {
26
+ borderColor: "stroke.default";
27
+ _hover: {
28
+ borderColor: "stroke.default";
29
+ };
30
+ };
31
+ _vertical: {
32
+ borderLeft: "1px solid";
33
+ justifyContent: "flex-start";
34
+ };
35
+ _focusVisible: {
36
+ outline: "none";
37
+ borderRadius: "unset";
38
+ };
39
+ };
40
+ indicator: {
41
+ background: "transparent";
42
+ outline: "4px solid";
43
+ outlineColor: "stroke.default";
44
+ pointerEvents: "none";
45
+ outlineOffset: "-4px";
46
+ _peerFocusVisible: {
47
+ height: "var(--height)";
48
+ width: "var(--width)";
49
+ _horizontal: {
50
+ borderTopRadius: "xsmall";
51
+ };
52
+ _vertical: {
53
+ borderRightRadius: "xsmall";
54
+ };
55
+ };
56
+ _horizontal: {
57
+ bottom: "0";
58
+ height: "2";
59
+ width: "var(--width)";
60
+ };
61
+ _vertical: {
62
+ height: "var(--height)";
63
+ left: "0";
64
+ width: "2";
65
+ };
66
+ };
67
+ content: {
68
+ zIndex: "1";
69
+ _horizontal: {
70
+ paddingBlockStart: "xsmall";
71
+ };
72
+ _vertical: {
73
+ paddingInlineStart: "xsmall";
74
+ };
75
+ _focusVisible: {
76
+ outline: "none";
77
+ boxShadow: "0 0 0 3px var(--shadow-color)";
78
+ boxShadowColor: "stroke.default";
79
+ };
80
+ };
81
+ };
82
+ outline: {
83
+ list: {
84
+ _horizontal: {
85
+ marginBlockEnd: "-1px";
86
+ };
87
+ _vertical: {
88
+ marginInlineEnd: "-1px";
89
+ };
90
+ };
91
+ trigger: {
92
+ borderColor: "transparent";
93
+ borderWidth: "1px";
94
+ _horizontal: {
95
+ borderTopRadius: "xsmall";
96
+ };
97
+ _vertical: {
98
+ borderTopLeftRadius: "xsmall";
99
+ borderBottomLeftRadius: "xsmall";
100
+ };
101
+ _selected: {
102
+ background: "surface.default";
103
+ borderColor: "stroke.subtle";
104
+ _horizontal: {
105
+ borderBottomColor: "transparent";
106
+ };
107
+ _vertical: {
108
+ borderRightColor: "transparent";
109
+ };
110
+ };
111
+ _focusVisible: {
112
+ outline: "3px solid";
113
+ outlineOffset: "-3px";
114
+ outlineColor: "stroke.default";
115
+ };
116
+ };
117
+ content: {
118
+ borderWidth: "1px";
119
+ borderColor: "stroke.subtle";
120
+ background: "surface.default";
121
+ width: "100%";
122
+ padding: "xsmall";
123
+ _focusVisible: {
124
+ outline: "3px solid";
125
+ outlineOffset: "-3px";
126
+ outlineColor: "stroke.default";
127
+ };
128
+ };
129
+ };
130
+ };
131
+ }>;
132
+ export type TabsVariantProps = RecipeVariantProps<typeof tabsRecipe>;
133
+ export type TabsRootProps = Tabs.RootProps & TabsVariantProps & JsxStyleProps;
134
+ export declare const TabsRoot: ({ lazyMount, unmountOnExit, ...props }: TabsRootProps) => import("react/jsx-runtime").JSX.Element;
135
+ export declare const TabsContent: import("react").ForwardRefExoticComponent<Tabs.ContentProps & {
136
+ forwardCssProp?: boolean | undefined;
137
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
138
+ export declare const TabsIndicator: import("react").ForwardRefExoticComponent<Tabs.IndicatorProps & {
139
+ forwardCssProp?: boolean | undefined;
140
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
141
+ export declare const TabsList: import("react").ForwardRefExoticComponent<Tabs.ListProps & {
142
+ forwardCssProp?: boolean | undefined;
143
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
144
+ export declare const TabsTrigger: ({ className, ...props }: Tabs.TriggerProps & JsxStyleProps) => import("react/jsx-runtime").JSX.Element;
145
+ export {};