@ndla/primitives 1.0.61-alpha.0 → 1.0.63-alpha.0
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 +2 -2
- package/dist/styles.css +12 -12
- package/es/Badge.js +13 -3
- package/es/RadioGroup.js +4 -3
- package/es/Table.js +7 -2
- package/lib/Badge.d.ts +9 -0
- package/lib/Badge.js +13 -3
- package/lib/Layout/PageContent.d.ts +1 -3
- package/lib/RadioGroup.js +4 -3
- package/lib/Skeleton.d.ts +1 -3
- package/lib/Table.d.ts +1 -3
- package/lib/Table.js +7 -2
- package/package.json +3 -3
|
@@ -95,8 +95,9 @@
|
|
|
95
95
|
"paddingInline]___[value:xsmall",
|
|
96
96
|
"border]___[value:1px solid",
|
|
97
97
|
"width]___[value:fit-content",
|
|
98
|
-
"textStyle]___[value:label.medium",
|
|
99
98
|
"color]___[value:text.default",
|
|
99
|
+
"textStyle]___[value:label.small",
|
|
100
|
+
"textStyle]___[value:label.medium",
|
|
100
101
|
"backgroundColor]___[value:surface.brand.1.moderate",
|
|
101
102
|
"borderColor]___[value:surface.brand.1.strong",
|
|
102
103
|
"backgroundColor]___[value:surface.brand.2.moderate",
|
|
@@ -175,7 +176,6 @@
|
|
|
175
176
|
"marginBlock]___[value:0]___[cond:& svg",
|
|
176
177
|
"width]___[value:medium]___[cond:& svg",
|
|
177
178
|
"height]___[value:medium]___[cond:& svg",
|
|
178
|
-
"textStyle]___[value:label.small",
|
|
179
179
|
"minHeight]___[value:large",
|
|
180
180
|
"paddingBlock]___[value:4xsmall",
|
|
181
181
|
"width]___[value:small]___[cond:& svg",
|
package/dist/styles.css
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
@layer utilities {
|
|
2
2
|
@layer compositions {
|
|
3
|
-
.textStyle_label\.
|
|
3
|
+
.textStyle_label\.small {
|
|
4
4
|
letter-spacing: normal;
|
|
5
5
|
font-family: var(--fonts-sans);
|
|
6
6
|
font-weight: var(--font-weights-normal);
|
|
7
|
-
font-size: var(--font-sizes-
|
|
8
|
-
line-height: var(--line-heights-
|
|
7
|
+
font-size: var(--font-sizes-xsmall);
|
|
8
|
+
line-height: var(--line-heights-xsmall);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.textStyle_label\.
|
|
12
|
-
font-size: calc(var(--font-sizes-
|
|
13
|
-
line-height: calc(var(--line-heights-
|
|
11
|
+
.textStyle_label\.small:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
12
|
+
font-size: calc(var(--font-sizes-xsmall) * 1.11);
|
|
13
|
+
line-height: calc(var(--line-heights-xsmall) * 1.11);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.textStyle_label\.
|
|
16
|
+
.textStyle_label\.medium {
|
|
17
17
|
letter-spacing: normal;
|
|
18
18
|
font-family: var(--fonts-sans);
|
|
19
19
|
font-weight: var(--font-weights-normal);
|
|
20
|
-
font-size: var(--font-sizes-
|
|
21
|
-
line-height: var(--line-heights-
|
|
20
|
+
font-size: var(--font-sizes-small);
|
|
21
|
+
line-height: var(--line-heights-small);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.textStyle_label\.
|
|
25
|
-
font-size: calc(var(--font-sizes-
|
|
26
|
-
line-height: calc(var(--line-heights-
|
|
24
|
+
.textStyle_label\.medium:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
25
|
+
font-size: calc(var(--font-sizes-small) * 1.11);
|
|
26
|
+
line-height: calc(var(--line-heights-small) * 1.11);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.textStyle_label\.large\! {
|
package/es/Badge.js
CHANGED
|
@@ -17,13 +17,21 @@ const badgeRecipe = cva({
|
|
|
17
17
|
borderRadius: "xsmall",
|
|
18
18
|
border: "1px solid",
|
|
19
19
|
width: "fit-content",
|
|
20
|
-
textStyle: "label.medium",
|
|
21
20
|
color: "text.default"
|
|
22
21
|
},
|
|
23
22
|
defaultVariants: {
|
|
24
|
-
colorTheme: "neutral"
|
|
23
|
+
colorTheme: "neutral",
|
|
24
|
+
size: "medium"
|
|
25
25
|
},
|
|
26
26
|
variants: {
|
|
27
|
+
size: {
|
|
28
|
+
small: {
|
|
29
|
+
textStyle: "label.small"
|
|
30
|
+
},
|
|
31
|
+
medium: {
|
|
32
|
+
textStyle: "label.medium"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
27
35
|
colorTheme: {
|
|
28
36
|
brand1: {
|
|
29
37
|
backgroundColor: "surface.brand.1.moderate",
|
|
@@ -62,12 +70,14 @@ const StyledBadge = styled(ark.div, {}, {
|
|
|
62
70
|
export const Badge = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
63
71
|
let {
|
|
64
72
|
colorTheme,
|
|
73
|
+
size,
|
|
65
74
|
css: cssProp,
|
|
66
75
|
...props
|
|
67
76
|
} = _ref;
|
|
68
77
|
return /*#__PURE__*/_jsx(StyledBadge, {
|
|
69
78
|
css: css.raw(badgeRecipe.raw({
|
|
70
|
-
colorTheme
|
|
79
|
+
colorTheme,
|
|
80
|
+
size
|
|
71
81
|
}), cssProp),
|
|
72
82
|
...props,
|
|
73
83
|
ref: ref
|
package/es/RadioGroup.js
CHANGED
|
@@ -10,7 +10,6 @@ import { forwardRef } from "react";
|
|
|
10
10
|
import { RadioGroup, radioGroupAnatomy } from "@ark-ui/react";
|
|
11
11
|
import { sva } from "@ndla/styled-system/css";
|
|
12
12
|
import { createStyleContext } from "./createStyleContext";
|
|
13
|
-
import { Label } from "./Label";
|
|
14
13
|
import { Text } from "./Text";
|
|
15
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
15
|
const radioGroupRecipe = sva({
|
|
@@ -131,15 +130,17 @@ export const InternalRadioGroupLabel = withContext(RadioGroup.Label, "label");
|
|
|
131
130
|
export const RadioGroupLabel = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
132
131
|
let {
|
|
133
132
|
textStyle = "label.large",
|
|
133
|
+
fontWeight = "bold",
|
|
134
134
|
children,
|
|
135
135
|
...props
|
|
136
136
|
} = _ref2;
|
|
137
137
|
return /*#__PURE__*/_jsx(InternalRadioGroupLabel, {
|
|
138
|
-
ref: ref,
|
|
139
138
|
...props,
|
|
140
139
|
asChild: true,
|
|
141
|
-
|
|
140
|
+
ref: ref,
|
|
141
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
142
142
|
textStyle: textStyle,
|
|
143
|
+
fontWeight: fontWeight,
|
|
143
144
|
children: children
|
|
144
145
|
})
|
|
145
146
|
});
|
package/es/Table.js
CHANGED
|
@@ -70,6 +70,11 @@ export const Table = styled(ark.table, {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
},
|
|
74
|
-
|
|
73
|
+
},
|
|
74
|
+
// TODO: Chrome doesn't support automatically making overflowed elements tabbable yet. Revisit this in a year or two
|
|
75
|
+
{
|
|
76
|
+
baseComponent: true,
|
|
77
|
+
defaultProps: {
|
|
78
|
+
tabIndex: 0
|
|
79
|
+
}
|
|
75
80
|
});
|
package/lib/Badge.d.ts
CHANGED
|
@@ -9,6 +9,14 @@ import { type HTMLArkProps } from "@ark-ui/react";
|
|
|
9
9
|
import { type RecipeVariantProps } from "@ndla/styled-system/css";
|
|
10
10
|
import type { JsxStyleProps } from "@ndla/styled-system/types";
|
|
11
11
|
declare const badgeRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
12
|
+
size: {
|
|
13
|
+
small: {
|
|
14
|
+
textStyle: "label.small";
|
|
15
|
+
};
|
|
16
|
+
medium: {
|
|
17
|
+
textStyle: "label.medium";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
12
20
|
colorTheme: {
|
|
13
21
|
brand1: {
|
|
14
22
|
backgroundColor: "surface.brand.1.moderate";
|
|
@@ -46,6 +54,7 @@ export type BadgeProps = HTMLArkProps<"div"> & JsxStyleProps & BadgeVariantProps
|
|
|
46
54
|
export declare const Badge: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
47
55
|
consumeCss?: boolean;
|
|
48
56
|
} & import("@ndla/styled-system/types").WithCss & {
|
|
57
|
+
size?: "small" | "medium" | undefined;
|
|
49
58
|
colorTheme?: "neutral" | "brand1" | "brand2" | "brand3" | "danger" | "success" | "warning" | undefined;
|
|
50
59
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
51
60
|
export {};
|
package/lib/Badge.js
CHANGED
|
@@ -23,13 +23,21 @@ const badgeRecipe = (0, _css.cva)({
|
|
|
23
23
|
borderRadius: "xsmall",
|
|
24
24
|
border: "1px solid",
|
|
25
25
|
width: "fit-content",
|
|
26
|
-
textStyle: "label.medium",
|
|
27
26
|
color: "text.default"
|
|
28
27
|
},
|
|
29
28
|
defaultVariants: {
|
|
30
|
-
colorTheme: "neutral"
|
|
29
|
+
colorTheme: "neutral",
|
|
30
|
+
size: "medium"
|
|
31
31
|
},
|
|
32
32
|
variants: {
|
|
33
|
+
size: {
|
|
34
|
+
small: {
|
|
35
|
+
textStyle: "label.small"
|
|
36
|
+
},
|
|
37
|
+
medium: {
|
|
38
|
+
textStyle: "label.medium"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
33
41
|
colorTheme: {
|
|
34
42
|
brand1: {
|
|
35
43
|
backgroundColor: "surface.brand.1.moderate",
|
|
@@ -68,12 +76,14 @@ const StyledBadge = (0, _jsx2.styled)(_react2.ark.div, {}, {
|
|
|
68
76
|
const Badge = exports.Badge = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
69
77
|
let {
|
|
70
78
|
colorTheme,
|
|
79
|
+
size,
|
|
71
80
|
css: cssProp,
|
|
72
81
|
...props
|
|
73
82
|
} = _ref;
|
|
74
83
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBadge, {
|
|
75
84
|
css: _css.css.raw(badgeRecipe.raw({
|
|
76
|
-
colorTheme
|
|
85
|
+
colorTheme,
|
|
86
|
+
size
|
|
77
87
|
}), cssProp),
|
|
78
88
|
...props,
|
|
79
89
|
ref: ref
|
|
@@ -52,7 +52,5 @@ export declare const PageContent: import("react").ForwardRefExoticComponent<Omit
|
|
|
52
52
|
} & {
|
|
53
53
|
consumeCss?: boolean;
|
|
54
54
|
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
|
-
export declare const BleedPageContent: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<
|
|
56
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
57
|
-
} & import("@ark-ui/react").PolymorphicProps>, {}>;
|
|
55
|
+
export declare const BleedPageContent: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & import("@ark-ui/react").PolymorphicProps>, {}>;
|
|
58
56
|
export {};
|
package/lib/RadioGroup.js
CHANGED
|
@@ -8,7 +8,6 @@ var _react = require("react");
|
|
|
8
8
|
var _react2 = require("@ark-ui/react");
|
|
9
9
|
var _css = require("@ndla/styled-system/css");
|
|
10
10
|
var _createStyleContext = require("./createStyleContext");
|
|
11
|
-
var _Label = require("./Label");
|
|
12
11
|
var _Text = require("./Text");
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
13
|
/**
|
|
@@ -138,15 +137,17 @@ const InternalRadioGroupLabel = exports.InternalRadioGroupLabel = withContext(_r
|
|
|
138
137
|
const RadioGroupLabel = exports.RadioGroupLabel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
139
138
|
let {
|
|
140
139
|
textStyle = "label.large",
|
|
140
|
+
fontWeight = "bold",
|
|
141
141
|
children,
|
|
142
142
|
...props
|
|
143
143
|
} = _ref2;
|
|
144
144
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalRadioGroupLabel, {
|
|
145
|
-
ref: ref,
|
|
146
145
|
...props,
|
|
147
146
|
asChild: true,
|
|
148
|
-
|
|
147
|
+
ref: ref,
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
149
149
|
textStyle: textStyle,
|
|
150
|
+
fontWeight: fontWeight,
|
|
150
151
|
children: children
|
|
151
152
|
})
|
|
152
153
|
});
|
package/lib/Skeleton.d.ts
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { type HTMLArkProps } from "@ark-ui/react";
|
|
9
9
|
import type { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
|
-
export declare const Skeleton: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<
|
|
11
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
|
-
} & import("@ark-ui/react").PolymorphicProps>, {}>;
|
|
10
|
+
export declare const Skeleton: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & import("@ark-ui/react").PolymorphicProps>, {}>;
|
|
13
11
|
export interface SkeletonProps extends HTMLArkProps<"div">, JsxStyleProps {
|
|
14
12
|
}
|
package/lib/Table.d.ts
CHANGED
|
@@ -8,6 +8,4 @@
|
|
|
8
8
|
import { type HTMLArkProps } from "@ark-ui/react";
|
|
9
9
|
import type { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
10
|
export type TableProps = HTMLArkProps<"table"> & JsxStyleProps;
|
|
11
|
-
export declare const Table: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<
|
|
12
|
-
ref?: ((instance: HTMLTableElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLTableElement> | null | undefined;
|
|
13
|
-
} & import("@ark-ui/react").PolymorphicProps>, {}>;
|
|
11
|
+
export declare const Table: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ClassAttributes<HTMLTableElement> & import("react").TableHTMLAttributes<HTMLTableElement> & import("@ark-ui/react").PolymorphicProps>, {}>;
|
package/lib/Table.js
CHANGED
|
@@ -76,6 +76,11 @@ const Table = exports.Table = (0, _jsx.styled)(_react.ark.table, {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
},
|
|
80
|
-
|
|
79
|
+
},
|
|
80
|
+
// TODO: Chrome doesn't support automatically making overflowed elements tabbable yet. Revisit this in a year or two
|
|
81
|
+
{
|
|
82
|
+
baseComponent: true,
|
|
83
|
+
defaultProps: {
|
|
84
|
+
tabIndex: 0
|
|
85
|
+
}
|
|
81
86
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/primitives",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.63-alpha.0",
|
|
4
4
|
"description": "Primitive components for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@ark-ui/react": "^4.1.2",
|
|
32
32
|
"@ndla/styled-system": "^0.0.29",
|
|
33
|
-
"@ndla/util": "^5.0.
|
|
33
|
+
"@ndla/util": "^5.0.4-alpha.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@ndla/preset-panda": "^0.0.48",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e1109fda9f34b6ab504a45ce844b2f7fbfa374a9"
|
|
47
47
|
}
|