@ndla/primitives 0.0.18 → 0.0.20
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 +52 -13
- package/dist/styles.css +196 -38
- package/es/ArticleLists.js +67 -19
- package/es/Combobox.js +3 -0
- package/es/Hero.js +108 -0
- package/es/Select.js +3 -0
- package/es/Tabs.js +13 -9
- package/es/index.js +3 -2
- package/lib/ArticleLists.d.ts +56 -11
- package/lib/ArticleLists.js +66 -18
- package/lib/Combobox.d.ts +4 -0
- package/lib/Combobox.js +4 -1
- package/lib/Hero.d.ts +80 -0
- package/lib/Hero.js +114 -0
- package/lib/Select.d.ts +3 -0
- package/lib/Select.js +4 -1
- package/lib/Tabs.d.ts +8 -6
- package/lib/Tabs.js +12 -8
- package/lib/index.d.ts +5 -3
- package/lib/index.js +31 -0
- package/package.json +3 -3
package/es/Hero.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
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 { ark } from "@ark-ui/react";
|
|
10
|
+
import { sva } from "@ndla/styled-system/css";
|
|
11
|
+
import { createStyleContext } from "./createStyleContext";
|
|
12
|
+
const heroRecipe = sva({
|
|
13
|
+
slots: ["root", "background", "content"],
|
|
14
|
+
base: {
|
|
15
|
+
root: {
|
|
16
|
+
width: "100%",
|
|
17
|
+
position: "relative",
|
|
18
|
+
zIndex: "base"
|
|
19
|
+
},
|
|
20
|
+
background: {
|
|
21
|
+
height: "350px",
|
|
22
|
+
width: "100%",
|
|
23
|
+
zIndex: "hide",
|
|
24
|
+
overflow: "hidden",
|
|
25
|
+
clipPath: "polygon(0 0, 100% 0, 100% 65%, 0 100%)"
|
|
26
|
+
},
|
|
27
|
+
content: {
|
|
28
|
+
display: "flex",
|
|
29
|
+
flexWrap: "wrap",
|
|
30
|
+
alignItems: "flex-end",
|
|
31
|
+
paddingBlock: "xsmall",
|
|
32
|
+
tablet: {
|
|
33
|
+
paddingBlockStart: "xxlarge"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "primary",
|
|
39
|
+
absolute: true
|
|
40
|
+
},
|
|
41
|
+
variants: {
|
|
42
|
+
absolute: {
|
|
43
|
+
true: {
|
|
44
|
+
background: {
|
|
45
|
+
position: "absolute"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
variant: {
|
|
50
|
+
primary: {
|
|
51
|
+
background: {
|
|
52
|
+
background: "primary"
|
|
53
|
+
},
|
|
54
|
+
content: {
|
|
55
|
+
color: "text.onAction"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
brand2Strong: {
|
|
59
|
+
background: {
|
|
60
|
+
// TODO: This is not a semantic token.
|
|
61
|
+
background: "blue.800"
|
|
62
|
+
},
|
|
63
|
+
content: {
|
|
64
|
+
color: "text.onAction"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
brand2: {
|
|
68
|
+
background: {
|
|
69
|
+
background: "surface.brand.2"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
brand1: {
|
|
73
|
+
background: {
|
|
74
|
+
background: "surface.brand.1"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
brand1Subtle: {
|
|
78
|
+
background: {
|
|
79
|
+
background: "surface.brand.1.subtle"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
neutral: {
|
|
83
|
+
background: {
|
|
84
|
+
background: "surface.infoSubtle"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
brand4: {
|
|
88
|
+
background: {
|
|
89
|
+
// TODO: This needs a proper color...
|
|
90
|
+
background: "surface.brand.4"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const {
|
|
97
|
+
withProvider,
|
|
98
|
+
withContext
|
|
99
|
+
} = createStyleContext(heroRecipe);
|
|
100
|
+
export const Hero = withProvider(ark.div, "root", {
|
|
101
|
+
baseComponent: true
|
|
102
|
+
});
|
|
103
|
+
export const HeroBackground = withContext(ark.div, "background", {
|
|
104
|
+
baseComponent: true
|
|
105
|
+
});
|
|
106
|
+
export const HeroContent = withContext(ark.div, "content", {
|
|
107
|
+
baseComponent: true
|
|
108
|
+
});
|
package/es/Select.js
CHANGED
|
@@ -217,4 +217,7 @@ export const SelectTrigger = withContext(Select.Trigger, "trigger", {
|
|
|
217
217
|
});
|
|
218
218
|
export const SelectValueText = withContext(Select.ValueText, "valueText", {
|
|
219
219
|
baseComponent: true
|
|
220
|
+
});
|
|
221
|
+
export const SelectList = withContext(Select.List, "list", {
|
|
222
|
+
baseComponent: true
|
|
220
223
|
});
|
package/es/Tabs.js
CHANGED
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Tabs
|
|
9
|
+
import { Tabs } from "@ark-ui/react";
|
|
10
10
|
import { cx, sva } from "@ndla/styled-system/css";
|
|
11
11
|
import { createStyleContext } from "./createStyleContext";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const tabsRecipe = sva({
|
|
14
|
-
|
|
14
|
+
// TODO: This still doesn't work. Need to figure out why we need to pass keys manually.
|
|
15
|
+
// slots: tabsAnatomy.keys(),
|
|
16
|
+
slots: ["root", "list", "trigger", "content", "indicator"],
|
|
15
17
|
base: {
|
|
16
18
|
root: {
|
|
17
19
|
position: "relative",
|
|
@@ -28,7 +30,7 @@ const tabsRecipe = sva({
|
|
|
28
30
|
position: "relative",
|
|
29
31
|
display: "flex",
|
|
30
32
|
flexShrink: "0",
|
|
31
|
-
|
|
33
|
+
flexWrap: "wrap",
|
|
32
34
|
_horizontal: {
|
|
33
35
|
flexDirection: "row"
|
|
34
36
|
},
|
|
@@ -106,10 +108,9 @@ const tabsRecipe = sva({
|
|
|
106
108
|
},
|
|
107
109
|
indicator: {
|
|
108
110
|
background: "transparent",
|
|
109
|
-
outline: "
|
|
111
|
+
outline: "3px solid",
|
|
110
112
|
outlineColor: "stroke.default",
|
|
111
|
-
|
|
112
|
-
outlineOffset: "-4px",
|
|
113
|
+
outlineOffset: "-3px",
|
|
113
114
|
_peerFocusVisible: {
|
|
114
115
|
height: "var(--height)",
|
|
115
116
|
width: "var(--width)",
|
|
@@ -121,14 +122,17 @@ const tabsRecipe = sva({
|
|
|
121
122
|
}
|
|
122
123
|
},
|
|
123
124
|
_horizontal: {
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
top: "calc(var(--top) + var(--height) - 6px)",
|
|
126
|
+
_peerFocusVisible: {
|
|
127
|
+
top: "var(--top)"
|
|
128
|
+
},
|
|
129
|
+
height: "3",
|
|
126
130
|
width: "var(--width)"
|
|
127
131
|
},
|
|
128
132
|
_vertical: {
|
|
129
133
|
height: "var(--height)",
|
|
130
134
|
left: "0",
|
|
131
|
-
width: "
|
|
135
|
+
width: "3"
|
|
132
136
|
}
|
|
133
137
|
},
|
|
134
138
|
content: {
|
package/es/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { BlockQuote } from "./BlockQuote";
|
|
|
13
13
|
export { Button, IconButton, buttonBaseRecipe, buttonRecipe, iconButtonRecipe } from "./Button";
|
|
14
14
|
export { CardRoot, CardHeading, CardContent, CardImage } from "./Card/Card";
|
|
15
15
|
export { CheckboxRoot, CheckboxIndicator, CheckboxLabel, CheckboxControl, CheckboxGroup, CheckboxHiddenInput } from "./Checkbox";
|
|
16
|
-
export { ComboboxRoot, ComboboxClearTrigger, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItemGroupLabel, ComboboxItemGroup, ComboboxItemIndicator, ComboboxItem, ComboboxItemText, ComboboxLabel, ComboboxPositioner, ComboboxTrigger } from "./Combobox";
|
|
16
|
+
export { ComboboxRoot, ComboboxClearTrigger, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItemGroupLabel, ComboboxItemGroup, ComboboxItemIndicator, ComboboxItem, ComboboxItemText, ComboboxLabel, ComboboxPositioner, ComboboxTrigger, ComboboxList } from "./Combobox";
|
|
17
17
|
export { DialogRoot, DialogBackdrop, DialogStandaloneContent, DialogPositioner, DialogContent, DialogDescription, DialogTitle, DialogTrigger, DialogCloseTrigger, DialogHeader, DialogBody } from "./Dialog";
|
|
18
18
|
export { ExpandableBox, ExpandableBoxSummary } from "./ExpandableBox";
|
|
19
19
|
export { FieldRoot } from "./Field";
|
|
@@ -21,6 +21,7 @@ export { FieldErrorMessage } from "./FieldErrorMessage";
|
|
|
21
21
|
export { FieldHelper } from "./FieldHelper";
|
|
22
22
|
export { Figure } from "./Figure";
|
|
23
23
|
export { FramedContent } from "./FramedContent";
|
|
24
|
+
export { Hero, HeroBackground, HeroContent } from "./Hero";
|
|
24
25
|
export { Picture, Img, Image, makeSrcQueryString, getSrcSet } from "./Image";
|
|
25
26
|
export { Input, FieldInput, InputContainer, TextArea, FieldTextArea } from "./Input";
|
|
26
27
|
export { Label, FieldLabel } from "./Label";
|
|
@@ -30,7 +31,7 @@ export { NdlaLogoEn, NdlaLogoNb, NdlaLogoText } from "./NdlaLogo";
|
|
|
30
31
|
export { PaginationRoot, PaginationItem, PaginationEllipsis, PaginationPrevTrigger, PaginationNextTrigger } from "./Pagination";
|
|
31
32
|
export { PopoverRoot, PopoverAnchor, PopoverArrowStandalone, PopoverArrow, PopoverArrowTip, PopoverCloseTrigger, PopoverContentStandalone, PopoverContent, PopoverDescription, PopoverIndicator, PopoverPositioner, PopoverTitle, PopoverTrigger } from "./Popover";
|
|
32
33
|
export { RadioGroupRoot, RadioGroupIndicator, RadioGroupItemControl, RadioGroupItem, RadioGroupItemText, RadioGroupLabel, RadioGroupItemHiddenInput } from "./RadioGroup";
|
|
33
|
-
export { SelectRoot, SelectClearTrigger, SelectContent, SelectControl, SelectIndicator, SelectItemGroupLabel, SelectItemGroup, SelectItemIndicator, SelectItem, SelectItemText, SelectLabel, SelectPositioner, SelectTrigger, SelectValueText } from "./Select";
|
|
34
|
+
export { SelectRoot, SelectClearTrigger, SelectContent, SelectControl, SelectIndicator, SelectItemGroupLabel, SelectItemGroup, SelectItemIndicator, SelectItem, SelectItemText, SelectLabel, SelectPositioner, SelectTrigger, SelectValueText, SelectList } from "./Select";
|
|
34
35
|
export { Skeleton } from "./Skeleton";
|
|
35
36
|
export { SliderRoot, SliderControl, SliderTrack, SliderRange, SliderThumb, SliderLabel, SliderHiddenInput } from "./Slider";
|
|
36
37
|
export { Spinner } from "./Spinner";
|
package/lib/ArticleLists.d.ts
CHANGED
|
@@ -10,29 +10,74 @@ import { JsxStyleProps, RecipeVariantProps } from "@ndla/styled-system/types";
|
|
|
10
10
|
declare const orderedListRecipe: import("@ndla/styled-system/types").RecipeRuntimeFn<{
|
|
11
11
|
variant: {
|
|
12
12
|
numbers: {
|
|
13
|
+
counterReset: "level1";
|
|
14
|
+
"&[data-count='true']": {
|
|
15
|
+
counterReset: "level1 var(--start, 0)";
|
|
16
|
+
};
|
|
17
|
+
marginInline: "small";
|
|
13
18
|
"& > li": {
|
|
19
|
+
counterIncrement: "level1";
|
|
14
20
|
_marker: {
|
|
15
|
-
content: "
|
|
21
|
+
content: "counter(level1, decimal) '. '";
|
|
22
|
+
};
|
|
23
|
+
"& > ol:not([data-variant='letters'])": {
|
|
24
|
+
marginInlineStart: "xlarge";
|
|
25
|
+
counterReset: "level2";
|
|
26
|
+
"&[data-count='true']": {
|
|
27
|
+
counterReset: "level2 var(--start, 0)";
|
|
28
|
+
};
|
|
29
|
+
"& > li": {
|
|
30
|
+
counterIncrement: "level2";
|
|
31
|
+
_marker: {
|
|
32
|
+
content: "counter(level1, decimal) '.' counter(level2, decimal) '. '";
|
|
33
|
+
};
|
|
34
|
+
"& > ol:not([data-variant='letters'])": {
|
|
35
|
+
marginInlineStart: "xxlarge";
|
|
36
|
+
counterReset: "level3";
|
|
37
|
+
"&[data-count='true']": {
|
|
38
|
+
counterReset: "level3 var(--start, 0)";
|
|
39
|
+
};
|
|
40
|
+
"& > li": {
|
|
41
|
+
counterIncrement: "level3";
|
|
42
|
+
_marker: {
|
|
43
|
+
content: "counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '. '";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
"& > ol:not([data-variant='letters'])": {
|
|
47
|
+
counterReset: "level4";
|
|
48
|
+
"&[data-count='true']": {
|
|
49
|
+
counterReset: "level4 var(--start, 0)";
|
|
50
|
+
};
|
|
51
|
+
"& > li": {
|
|
52
|
+
counterIncrement: "level4";
|
|
53
|
+
_marker: {
|
|
54
|
+
content: "counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '.' counter(level4, decimal) '. '";
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
16
60
|
};
|
|
17
61
|
};
|
|
18
62
|
};
|
|
19
63
|
letters: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
64
|
+
counterReset: "level1";
|
|
65
|
+
"&[data-count='true']": {
|
|
66
|
+
counterReset: "level1 var(--start, 0)";
|
|
24
67
|
};
|
|
25
|
-
|
|
68
|
+
paddingInlineStart: "small";
|
|
69
|
+
"& > li": {
|
|
70
|
+
counterIncrement: "level1";
|
|
26
71
|
_marker: {
|
|
27
|
-
content: "counter(
|
|
72
|
+
content: "counter(level1, upper-alpha) '. '";
|
|
28
73
|
};
|
|
29
|
-
"& > ol > li": {
|
|
74
|
+
"& > ol[data-variant='letters'] > li": {
|
|
30
75
|
_marker: {
|
|
31
|
-
content: "counter(
|
|
76
|
+
content: "counter(level1, lower-alpha) '. '";
|
|
32
77
|
};
|
|
33
|
-
"& li": {
|
|
78
|
+
"& > ol[data-variant='letters'] > li": {
|
|
34
79
|
_marker: {
|
|
35
|
-
content: "counter(
|
|
80
|
+
content: "counter(level1, lower-roman) '. '";
|
|
36
81
|
};
|
|
37
82
|
};
|
|
38
83
|
};
|
package/lib/ArticleLists.js
CHANGED
|
@@ -19,9 +19,6 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
19
|
|
|
20
20
|
const orderedListRecipe = (0, _css.cva)({
|
|
21
21
|
base: {
|
|
22
|
-
listStyle: "revert",
|
|
23
|
-
listStylePosition: "inside",
|
|
24
|
-
paddingInlineStart: "small",
|
|
25
22
|
"& li": {
|
|
26
23
|
marginBlock: "small"
|
|
27
24
|
}
|
|
@@ -32,29 +29,74 @@ const orderedListRecipe = (0, _css.cva)({
|
|
|
32
29
|
variants: {
|
|
33
30
|
variant: {
|
|
34
31
|
numbers: {
|
|
32
|
+
counterReset: "level1",
|
|
33
|
+
"&[data-count='true']": {
|
|
34
|
+
counterReset: "level1 var(--start, 0)"
|
|
35
|
+
},
|
|
36
|
+
marginInline: "small",
|
|
35
37
|
"& > li": {
|
|
38
|
+
counterIncrement: "level1",
|
|
36
39
|
_marker: {
|
|
37
|
-
content: "
|
|
40
|
+
content: "counter(level1, decimal) '. '"
|
|
41
|
+
},
|
|
42
|
+
"& > ol:not([data-variant='letters'])": {
|
|
43
|
+
marginInlineStart: "xlarge",
|
|
44
|
+
counterReset: "level2",
|
|
45
|
+
"&[data-count='true']": {
|
|
46
|
+
counterReset: "level2 var(--start, 0)"
|
|
47
|
+
},
|
|
48
|
+
"& > li": {
|
|
49
|
+
counterIncrement: "level2",
|
|
50
|
+
_marker: {
|
|
51
|
+
content: "counter(level1, decimal) '.' counter(level2, decimal) '. '"
|
|
52
|
+
},
|
|
53
|
+
"& > ol:not([data-variant='letters'])": {
|
|
54
|
+
marginInlineStart: "xxlarge",
|
|
55
|
+
counterReset: "level3",
|
|
56
|
+
"&[data-count='true']": {
|
|
57
|
+
counterReset: "level3 var(--start, 0)"
|
|
58
|
+
},
|
|
59
|
+
"& > li": {
|
|
60
|
+
counterIncrement: "level3",
|
|
61
|
+
_marker: {
|
|
62
|
+
content: "counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '. '"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"& > ol:not([data-variant='letters'])": {
|
|
66
|
+
counterReset: "level4",
|
|
67
|
+
"&[data-count='true']": {
|
|
68
|
+
counterReset: "level4 var(--start, 0)"
|
|
69
|
+
},
|
|
70
|
+
"& > li": {
|
|
71
|
+
counterIncrement: "level4",
|
|
72
|
+
_marker: {
|
|
73
|
+
content: "counter(level1, decimal) '.' counter(level2, decimal) '.' counter(level3, decimal) '.' counter(level4, decimal) '. '"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
38
79
|
}
|
|
39
80
|
}
|
|
40
81
|
},
|
|
41
82
|
letters: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
83
|
+
counterReset: "level1",
|
|
84
|
+
"&[data-count='true']": {
|
|
85
|
+
counterReset: "level1 var(--start, 0)"
|
|
46
86
|
},
|
|
47
|
-
|
|
87
|
+
paddingInlineStart: "small",
|
|
88
|
+
"& > li": {
|
|
89
|
+
counterIncrement: "level1",
|
|
48
90
|
_marker: {
|
|
49
|
-
content: "counter(
|
|
91
|
+
content: "counter(level1, upper-alpha) '. '"
|
|
50
92
|
},
|
|
51
|
-
"& > ol > li": {
|
|
93
|
+
"& > ol[data-variant='letters'] > li": {
|
|
52
94
|
_marker: {
|
|
53
|
-
content: "counter(
|
|
95
|
+
content: "counter(level1, lower-alpha) '. '"
|
|
54
96
|
},
|
|
55
|
-
"& li": {
|
|
97
|
+
"& > ol[data-variant='letters'] > li": {
|
|
56
98
|
_marker: {
|
|
57
|
-
content: "counter(
|
|
99
|
+
content: "counter(level1, lower-roman) '. '"
|
|
58
100
|
}
|
|
59
101
|
}
|
|
60
102
|
}
|
|
@@ -70,21 +112,27 @@ const OrderedList = exports.OrderedList = /*#__PURE__*/(0, _react.forwardRef)((_
|
|
|
70
112
|
let {
|
|
71
113
|
variant,
|
|
72
114
|
css: cssProp,
|
|
115
|
+
start,
|
|
73
116
|
...props
|
|
74
117
|
} = _ref;
|
|
118
|
+
const style = (0, _react.useMemo)(() => ({
|
|
119
|
+
"--start": start ? start - 1 : undefined
|
|
120
|
+
}), [start]);
|
|
75
121
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledOrderedList, {
|
|
122
|
+
"data-variant": variant,
|
|
123
|
+
"data-count": start !== undefined,
|
|
76
124
|
css: _css.css.raw(orderedListRecipe.raw({
|
|
77
125
|
variant
|
|
78
126
|
}), cssProp),
|
|
79
|
-
|
|
80
|
-
ref: ref
|
|
127
|
+
style: style,
|
|
128
|
+
ref: ref,
|
|
129
|
+
...props
|
|
81
130
|
});
|
|
82
131
|
});
|
|
83
132
|
const UnOrderedList = exports.UnOrderedList = (0, _jsx2.styled)("ul", {
|
|
84
133
|
base: {
|
|
85
134
|
listStyle: "revert",
|
|
86
|
-
|
|
87
|
-
paddingInlineStart: "small",
|
|
135
|
+
paddingInlineStart: "medium",
|
|
88
136
|
"& li": {
|
|
89
137
|
marginBlock: "small",
|
|
90
138
|
_marker: {
|
package/lib/Combobox.d.ts
CHANGED
|
@@ -88,4 +88,8 @@ export type ComboboxTriggerProps = Combobox.TriggerProps & JsxStyleProps;
|
|
|
88
88
|
export declare const ComboboxTrigger: import("react").ForwardRefExoticComponent<Combobox.TriggerProps & {
|
|
89
89
|
consumeCss?: boolean | undefined;
|
|
90
90
|
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLButtonElement>>;
|
|
91
|
+
export type ComboboxListProps = Combobox.ListProps & JsxStyleProps;
|
|
92
|
+
export declare const ComboboxList: import("react").ForwardRefExoticComponent<Combobox.ListProps & {
|
|
93
|
+
consumeCss?: boolean | undefined;
|
|
94
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
91
95
|
export {};
|
package/lib/Combobox.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ComboboxTrigger = exports.ComboboxRoot = exports.ComboboxPositioner = exports.ComboboxLabel = exports.ComboboxItemText = exports.ComboboxItemIndicator = exports.ComboboxItemGroupLabel = exports.ComboboxItemGroup = exports.ComboboxItem = exports.ComboboxInput = exports.ComboboxControl = exports.ComboboxContent = exports.ComboboxClearTrigger = void 0;
|
|
6
|
+
exports.ComboboxTrigger = exports.ComboboxRoot = exports.ComboboxPositioner = exports.ComboboxList = exports.ComboboxLabel = exports.ComboboxItemText = exports.ComboboxItemIndicator = exports.ComboboxItemGroupLabel = exports.ComboboxItemGroup = exports.ComboboxItem = exports.ComboboxInput = exports.ComboboxControl = exports.ComboboxContent = exports.ComboboxClearTrigger = void 0;
|
|
7
7
|
var _react = require("@ark-ui/react");
|
|
8
8
|
var _css = require("@ndla/styled-system/css");
|
|
9
9
|
var _createStyleContext = require("./createStyleContext");
|
|
@@ -256,4 +256,7 @@ const ComboboxPositioner = exports.ComboboxPositioner = withContext(_react.Combo
|
|
|
256
256
|
});
|
|
257
257
|
const ComboboxTrigger = exports.ComboboxTrigger = withContext(_react.Combobox.Trigger, "trigger", {
|
|
258
258
|
baseComponent: true
|
|
259
|
+
});
|
|
260
|
+
const ComboboxList = exports.ComboboxList = withContext(_react.Combobox.List, "list", {
|
|
261
|
+
baseComponent: true
|
|
259
262
|
});
|
package/lib/Hero.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
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 { type HTMLArkProps } from "@ark-ui/react";
|
|
9
|
+
import { type RecipeVariantProps } from "@ndla/styled-system/css";
|
|
10
|
+
import { type JsxStyleProps } from "@ndla/styled-system/types";
|
|
11
|
+
declare const heroRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"content" | "root" | "background", {
|
|
12
|
+
absolute: {
|
|
13
|
+
true: {
|
|
14
|
+
background: {
|
|
15
|
+
position: "absolute";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
variant: {
|
|
20
|
+
primary: {
|
|
21
|
+
background: {
|
|
22
|
+
background: "primary";
|
|
23
|
+
};
|
|
24
|
+
content: {
|
|
25
|
+
color: "text.onAction";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
brand2Strong: {
|
|
29
|
+
background: {
|
|
30
|
+
background: "blue.800";
|
|
31
|
+
};
|
|
32
|
+
content: {
|
|
33
|
+
color: "text.onAction";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
brand2: {
|
|
37
|
+
background: {
|
|
38
|
+
background: "surface.brand.2";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
brand1: {
|
|
42
|
+
background: {
|
|
43
|
+
background: "surface.brand.1";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
brand1Subtle: {
|
|
47
|
+
background: {
|
|
48
|
+
background: "surface.brand.1.subtle";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
neutral: {
|
|
52
|
+
background: {
|
|
53
|
+
background: "surface.infoSubtle";
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
brand4: {
|
|
57
|
+
background: {
|
|
58
|
+
background: "surface.brand.4";
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}>;
|
|
63
|
+
export type HeroVariantProps = RecipeVariantProps<typeof heroRecipe>;
|
|
64
|
+
export type HeroVariant = NonNullable<HeroVariantProps>["variant"];
|
|
65
|
+
export type HeroProps = HTMLArkProps<"div"> & JsxStyleProps & HeroVariantProps;
|
|
66
|
+
export declare const Hero: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
67
|
+
consumeCss?: boolean | undefined;
|
|
68
|
+
} & import("@ndla/styled-system/types").WithCss & {
|
|
69
|
+
absolute?: boolean | undefined;
|
|
70
|
+
variant?: "primary" | "neutral" | "brand1" | "brand2" | "brand2Strong" | "brand1Subtle" | "brand4" | undefined;
|
|
71
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
72
|
+
export type HeroBackgroundProps = HTMLArkProps<"div"> & JsxStyleProps;
|
|
73
|
+
export declare const HeroBackground: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
74
|
+
consumeCss?: boolean | undefined;
|
|
75
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
76
|
+
export type HeroContentProps = HTMLArkProps<"div"> & JsxStyleProps;
|
|
77
|
+
export declare const HeroContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
78
|
+
consumeCss?: boolean | undefined;
|
|
79
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
80
|
+
export {};
|
package/lib/Hero.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.HeroContent = exports.HeroBackground = exports.Hero = void 0;
|
|
7
|
+
var _react = require("@ark-ui/react");
|
|
8
|
+
var _css = require("@ndla/styled-system/css");
|
|
9
|
+
var _createStyleContext = require("./createStyleContext");
|
|
10
|
+
/**
|
|
11
|
+
* Copyright (c) 2024-present, NDLA.
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const heroRecipe = (0, _css.sva)({
|
|
19
|
+
slots: ["root", "background", "content"],
|
|
20
|
+
base: {
|
|
21
|
+
root: {
|
|
22
|
+
width: "100%",
|
|
23
|
+
position: "relative",
|
|
24
|
+
zIndex: "base"
|
|
25
|
+
},
|
|
26
|
+
background: {
|
|
27
|
+
height: "350px",
|
|
28
|
+
width: "100%",
|
|
29
|
+
zIndex: "hide",
|
|
30
|
+
overflow: "hidden",
|
|
31
|
+
clipPath: "polygon(0 0, 100% 0, 100% 65%, 0 100%)"
|
|
32
|
+
},
|
|
33
|
+
content: {
|
|
34
|
+
display: "flex",
|
|
35
|
+
flexWrap: "wrap",
|
|
36
|
+
alignItems: "flex-end",
|
|
37
|
+
paddingBlock: "xsmall",
|
|
38
|
+
tablet: {
|
|
39
|
+
paddingBlockStart: "xxlarge"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
variant: "primary",
|
|
45
|
+
absolute: true
|
|
46
|
+
},
|
|
47
|
+
variants: {
|
|
48
|
+
absolute: {
|
|
49
|
+
true: {
|
|
50
|
+
background: {
|
|
51
|
+
position: "absolute"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
variant: {
|
|
56
|
+
primary: {
|
|
57
|
+
background: {
|
|
58
|
+
background: "primary"
|
|
59
|
+
},
|
|
60
|
+
content: {
|
|
61
|
+
color: "text.onAction"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
brand2Strong: {
|
|
65
|
+
background: {
|
|
66
|
+
// TODO: This is not a semantic token.
|
|
67
|
+
background: "blue.800"
|
|
68
|
+
},
|
|
69
|
+
content: {
|
|
70
|
+
color: "text.onAction"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
brand2: {
|
|
74
|
+
background: {
|
|
75
|
+
background: "surface.brand.2"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
brand1: {
|
|
79
|
+
background: {
|
|
80
|
+
background: "surface.brand.1"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
brand1Subtle: {
|
|
84
|
+
background: {
|
|
85
|
+
background: "surface.brand.1.subtle"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
neutral: {
|
|
89
|
+
background: {
|
|
90
|
+
background: "surface.infoSubtle"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
brand4: {
|
|
94
|
+
background: {
|
|
95
|
+
// TODO: This needs a proper color...
|
|
96
|
+
background: "surface.brand.4"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const {
|
|
103
|
+
withProvider,
|
|
104
|
+
withContext
|
|
105
|
+
} = (0, _createStyleContext.createStyleContext)(heroRecipe);
|
|
106
|
+
const Hero = exports.Hero = withProvider(_react.ark.div, "root", {
|
|
107
|
+
baseComponent: true
|
|
108
|
+
});
|
|
109
|
+
const HeroBackground = exports.HeroBackground = withContext(_react.ark.div, "background", {
|
|
110
|
+
baseComponent: true
|
|
111
|
+
});
|
|
112
|
+
const HeroContent = exports.HeroContent = withContext(_react.ark.div, "content", {
|
|
113
|
+
baseComponent: true
|
|
114
|
+
});
|
package/lib/Select.d.ts
CHANGED
|
@@ -49,3 +49,6 @@ export declare const SelectTrigger: import("react").ForwardRefExoticComponent<Se
|
|
|
49
49
|
export declare const SelectValueText: import("react").ForwardRefExoticComponent<Select.ValueTextProps & {
|
|
50
50
|
consumeCss?: boolean | undefined;
|
|
51
51
|
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLSpanElement>>;
|
|
52
|
+
export declare const SelectList: import("react").ForwardRefExoticComponent<Select.ListProps & {
|
|
53
|
+
consumeCss?: boolean | undefined;
|
|
54
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
package/lib/Select.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SelectValueText = exports.SelectTrigger = exports.SelectRoot = exports.SelectPositioner = exports.SelectLabel = exports.SelectItemText = exports.SelectItemIndicator = exports.SelectItemGroupLabel = exports.SelectItemGroup = exports.SelectItem = exports.SelectIndicator = exports.SelectControl = exports.SelectContent = exports.SelectClearTrigger = void 0;
|
|
6
|
+
exports.SelectValueText = exports.SelectTrigger = exports.SelectRoot = exports.SelectPositioner = exports.SelectList = exports.SelectLabel = exports.SelectItemText = exports.SelectItemIndicator = exports.SelectItemGroupLabel = exports.SelectItemGroup = exports.SelectItem = exports.SelectIndicator = exports.SelectControl = exports.SelectContent = exports.SelectClearTrigger = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _react2 = require("@ark-ui/react");
|
|
9
9
|
var _css = require("@ndla/styled-system/css");
|
|
@@ -224,4 +224,7 @@ const SelectTrigger = exports.SelectTrigger = withContext(_react2.Select.Trigger
|
|
|
224
224
|
});
|
|
225
225
|
const SelectValueText = exports.SelectValueText = withContext(_react2.Select.ValueText, "valueText", {
|
|
226
226
|
baseComponent: true
|
|
227
|
+
});
|
|
228
|
+
const SelectList = exports.SelectList = withContext(_react2.Select.List, "list", {
|
|
229
|
+
baseComponent: true
|
|
227
230
|
});
|