@ndla/primitives 0.0.8 → 0.0.10
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 +80 -31
- package/dist/styles.css +292 -101
- package/es/Accordion.js +1 -2
- package/es/Button.js +4 -0
- package/es/Checkbox.js +1 -2
- package/es/Combobox.js +226 -0
- package/es/Dialog.js +1 -2
- package/es/Figure.js +75 -0
- package/es/Menu.js +1 -2
- package/es/Pagination.js +1 -2
- package/es/Popover.js +1 -2
- package/es/RadioGroup.js +1 -2
- package/es/Select.js +197 -0
- package/es/Slider.js +1 -2
- package/es/Switch.js +1 -2
- package/es/Tabs.js +2 -3
- package/es/TagsInput.js +121 -0
- package/es/Toast.js +1 -2
- package/es/Tooltip.js +1 -2
- package/es/storybookHelpers/data.js +212 -0
- package/lib/Accordion.js +1 -2
- package/lib/Button.js +4 -0
- package/lib/Checkbox.js +1 -2
- package/lib/Combobox.d.ts +59 -0
- package/lib/Combobox.js +236 -0
- package/lib/Dialog.d.ts +1 -1
- package/lib/Dialog.js +1 -2
- package/lib/Figure.d.ts +11 -0
- package/lib/Figure.js +81 -0
- package/lib/Menu.js +1 -2
- package/lib/Pagination.js +1 -2
- package/lib/Popover.js +1 -2
- package/lib/RadioGroup.js +1 -2
- package/lib/Select.d.ts +51 -0
- package/lib/Select.js +204 -0
- package/lib/Slider.js +1 -2
- package/lib/Switch.js +1 -2
- package/lib/Tabs.js +1 -2
- package/lib/TagsInput.d.ts +41 -0
- package/lib/TagsInput.js +127 -0
- package/lib/Toast.js +1 -2
- package/lib/Tooltip.js +1 -2
- package/lib/storybookHelpers/data.d.ts +23 -0
- package/lib/storybookHelpers/data.js +218 -0
- package/package.json +7 -8
package/es/Combobox.js
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
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 { Combobox, comboboxAnatomy } from "@ark-ui/react";
|
|
10
|
+
import { sva } from "@ndla/styled-system/css";
|
|
11
|
+
import { createStyleContext } from "./createStyleContext";
|
|
12
|
+
import { Label } from "./Label";
|
|
13
|
+
import { Text } from "./Text";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
const comboboxRecipe = sva({
|
|
16
|
+
slots: comboboxAnatomy.keys(),
|
|
17
|
+
base: {
|
|
18
|
+
root: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
gap: "3xsmall"
|
|
22
|
+
},
|
|
23
|
+
control: {
|
|
24
|
+
display: "flex",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
gap: "4xsmall"
|
|
27
|
+
},
|
|
28
|
+
content: {
|
|
29
|
+
display: "flex",
|
|
30
|
+
gap: "4xsmall",
|
|
31
|
+
flexDirection: "column",
|
|
32
|
+
zIndex: "dropdown",
|
|
33
|
+
background: "surface.default",
|
|
34
|
+
borderRadius: "xsmall",
|
|
35
|
+
boxShadow: "large",
|
|
36
|
+
padding: "xsmall",
|
|
37
|
+
overflowY: "auto",
|
|
38
|
+
maxHeight: "surface.xsmall",
|
|
39
|
+
_open: {
|
|
40
|
+
animation: "fade-shift-in 0.25s ease-out"
|
|
41
|
+
},
|
|
42
|
+
_closed: {
|
|
43
|
+
animation: "fade-shift-out 0.25s ease-out"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
item: {
|
|
47
|
+
display: "flex",
|
|
48
|
+
justifyContent: "space-between",
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
cursor: "pointer",
|
|
51
|
+
borderRadius: "xsmall",
|
|
52
|
+
transitionDuration: "fast",
|
|
53
|
+
transitionProperty: "background, color, border-color",
|
|
54
|
+
transitionTimingFunction: "default",
|
|
55
|
+
background: "surface.default",
|
|
56
|
+
_disabled: {
|
|
57
|
+
cursor: "not-allowed",
|
|
58
|
+
background: "surface.disabled",
|
|
59
|
+
color: "text.disabled",
|
|
60
|
+
_hover: {
|
|
61
|
+
background: "surface.disabled",
|
|
62
|
+
color: "text.disabled"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
_hover: {
|
|
66
|
+
background: "surface.hover"
|
|
67
|
+
},
|
|
68
|
+
_highlighted: {
|
|
69
|
+
background: "surface.hover"
|
|
70
|
+
},
|
|
71
|
+
_checked: {
|
|
72
|
+
background: "surface.selected",
|
|
73
|
+
_highlighted: {
|
|
74
|
+
background: "surface.hover"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
trigger: {
|
|
79
|
+
"& svg": {
|
|
80
|
+
color: "icon.default",
|
|
81
|
+
transformOrigin: "center",
|
|
82
|
+
transitionDuration: "normal",
|
|
83
|
+
transitionProperty: "transform",
|
|
84
|
+
transitionTimingFunction: "default"
|
|
85
|
+
},
|
|
86
|
+
_open: {
|
|
87
|
+
"& svg": {
|
|
88
|
+
transform: "rotate(180deg)"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
itemIndicator: {
|
|
93
|
+
color: "stroke.default"
|
|
94
|
+
},
|
|
95
|
+
itemText: {
|
|
96
|
+
_checked: {
|
|
97
|
+
textDecoration: "underline"
|
|
98
|
+
},
|
|
99
|
+
_highlighted: {
|
|
100
|
+
textDecoration: "underline"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
itemGroup: {
|
|
104
|
+
display: "flex",
|
|
105
|
+
flexDirection: "column",
|
|
106
|
+
gap: "4xsmall"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
defaultVariants: {
|
|
110
|
+
variant: "simple"
|
|
111
|
+
},
|
|
112
|
+
variants: {
|
|
113
|
+
variant: {
|
|
114
|
+
simple: {
|
|
115
|
+
item: {
|
|
116
|
+
padding: "xsmall"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
bordered: {
|
|
120
|
+
item: {
|
|
121
|
+
paddingInline: "small",
|
|
122
|
+
paddingBlock: "xsmall",
|
|
123
|
+
border: "1px solid",
|
|
124
|
+
borderColor: "stroke.subtle",
|
|
125
|
+
_hover: {
|
|
126
|
+
borderColor: "stroke.hover",
|
|
127
|
+
background: "surface.default"
|
|
128
|
+
},
|
|
129
|
+
_highlighted: {
|
|
130
|
+
borderColor: "stroke.default"
|
|
131
|
+
},
|
|
132
|
+
_checked: {
|
|
133
|
+
borderColor: "stroke.default"
|
|
134
|
+
},
|
|
135
|
+
_disabled: {
|
|
136
|
+
borderColor: "stroke.disabled",
|
|
137
|
+
_hover: {
|
|
138
|
+
borderColor: "stroke.disabled"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
const {
|
|
147
|
+
withProvider,
|
|
148
|
+
withContext
|
|
149
|
+
} = createStyleContext(comboboxRecipe);
|
|
150
|
+
const InternalComboboxRoot = withProvider(Combobox.Root, "root");
|
|
151
|
+
export const ComboboxRoot = _ref => {
|
|
152
|
+
let {
|
|
153
|
+
...props
|
|
154
|
+
} = _ref;
|
|
155
|
+
return (
|
|
156
|
+
/*#__PURE__*/
|
|
157
|
+
//@ts-expect-error - withProvider swallows the generic that Combobox.Root expects.
|
|
158
|
+
_jsx(InternalComboboxRoot, {
|
|
159
|
+
...props
|
|
160
|
+
})
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
export const ComboboxClearTrigger = withContext(Combobox.ClearTrigger, "clearTrigger");
|
|
164
|
+
export const ComboboxContent = withContext(Combobox.Content, "content");
|
|
165
|
+
export const ComboboxControl = withContext(Combobox.Control, "control");
|
|
166
|
+
export const ComboboxInput = withContext(Combobox.Input, "input");
|
|
167
|
+
const InternalComboboxItemGroupLabel = withContext(Combobox.ItemGroupLabel, "itemGroupLabel");
|
|
168
|
+
export const ComboboxItemGroupLabel = _ref2 => {
|
|
169
|
+
let {
|
|
170
|
+
children,
|
|
171
|
+
textStyle = "label.small",
|
|
172
|
+
fontWeight = "bold",
|
|
173
|
+
...props
|
|
174
|
+
} = _ref2;
|
|
175
|
+
return /*#__PURE__*/_jsx(InternalComboboxItemGroupLabel, {
|
|
176
|
+
forwardCssProp: true,
|
|
177
|
+
asChild: true,
|
|
178
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
179
|
+
asChild: true,
|
|
180
|
+
forwardCssProp: true,
|
|
181
|
+
textStyle: textStyle,
|
|
182
|
+
fontWeight: fontWeight,
|
|
183
|
+
...props,
|
|
184
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
185
|
+
children: children
|
|
186
|
+
})
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
export const ComboboxItemGroup = withContext(Combobox.ItemGroup, "itemGroup");
|
|
191
|
+
export const ComboboxItemIndicator = withContext(Combobox.ItemIndicator, "itemIndicator");
|
|
192
|
+
export const ComboboxItem = withContext(Combobox.Item, "item");
|
|
193
|
+
const InternalComboboxItemText = withContext(Combobox.ItemText, "itemText");
|
|
194
|
+
export const ComboboxItemText = _ref3 => {
|
|
195
|
+
let {
|
|
196
|
+
textStyle = "label.medium",
|
|
197
|
+
fontWeight = "bold",
|
|
198
|
+
...props
|
|
199
|
+
} = _ref3;
|
|
200
|
+
return /*#__PURE__*/_jsx(InternalComboboxItemText, {
|
|
201
|
+
forwardCssProp: true,
|
|
202
|
+
asChild: true,
|
|
203
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
204
|
+
...props
|
|
205
|
+
})
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
const InternalComboboxLabel = withContext(Combobox.Label, "label");
|
|
209
|
+
export const ComboboxLabel = _ref4 => {
|
|
210
|
+
let {
|
|
211
|
+
textStyle = "label.medium",
|
|
212
|
+
fontWeight = "bold",
|
|
213
|
+
...props
|
|
214
|
+
} = _ref4;
|
|
215
|
+
return /*#__PURE__*/_jsx(InternalComboboxLabel, {
|
|
216
|
+
forwardCssProp: true,
|
|
217
|
+
asChild: true,
|
|
218
|
+
children: /*#__PURE__*/_jsx(Label, {
|
|
219
|
+
textStyle: textStyle,
|
|
220
|
+
fontWeight: fontWeight,
|
|
221
|
+
...props
|
|
222
|
+
})
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
export const ComboboxPositioner = withContext(Combobox.Positioner, "positioner");
|
|
226
|
+
export const ComboboxTrigger = withContext(Combobox.Trigger, "trigger");
|
package/es/Dialog.js
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { forwardRef } from "react";
|
|
10
|
-
import { dialogAnatomy } from "@ark-ui/
|
|
11
|
-
import { Dialog } from "@ark-ui/react";
|
|
10
|
+
import { Dialog, dialogAnatomy } from "@ark-ui/react";
|
|
12
11
|
import { sva } from "@ndla/styled-system/css";
|
|
13
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
14
13
|
import { createStyleContext } from "./createStyleContext";
|
package/es/Figure.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
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 { styled } from "@ndla/styled-system/jsx";
|
|
10
|
+
export const Figure = styled("figure", {
|
|
11
|
+
base: {
|
|
12
|
+
position: "relative",
|
|
13
|
+
transitionDuration: "normal",
|
|
14
|
+
transitionProperty: "transform, width, height",
|
|
15
|
+
transitionTimingFunction: "default"
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
size: {
|
|
19
|
+
full: {
|
|
20
|
+
width: "100%"
|
|
21
|
+
},
|
|
22
|
+
medium: {
|
|
23
|
+
tablet: {
|
|
24
|
+
width: "50%"
|
|
25
|
+
},
|
|
26
|
+
desktop: {
|
|
27
|
+
width: "65%"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
small: {
|
|
31
|
+
tablet: {
|
|
32
|
+
width: "35%"
|
|
33
|
+
},
|
|
34
|
+
desktop: {
|
|
35
|
+
width: "50%"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
xsmall: {
|
|
39
|
+
tablet: {
|
|
40
|
+
width: "25%"
|
|
41
|
+
},
|
|
42
|
+
desktop: {
|
|
43
|
+
width: "35%"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
float: {
|
|
48
|
+
left: {
|
|
49
|
+
tablet: {
|
|
50
|
+
float: "left",
|
|
51
|
+
clear: "left",
|
|
52
|
+
paddingInlineEnd: "medium"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
right: {
|
|
56
|
+
tablet: {
|
|
57
|
+
float: "right",
|
|
58
|
+
clear: "right",
|
|
59
|
+
paddingInlineStart: "medium"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
defaultVariants: {
|
|
65
|
+
size: "full"
|
|
66
|
+
},
|
|
67
|
+
compoundVariants: [{
|
|
68
|
+
float: ["left", "right"],
|
|
69
|
+
css: {
|
|
70
|
+
zIndex: "base",
|
|
71
|
+
left: "auto",
|
|
72
|
+
marginBlock: "xsmall"
|
|
73
|
+
}
|
|
74
|
+
}]
|
|
75
|
+
});
|
package/es/Menu.js
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { forwardRef } from "react";
|
|
10
|
-
import { menuAnatomy } from "@ark-ui/
|
|
11
|
-
import { Menu } from "@ark-ui/react";
|
|
10
|
+
import { Menu, menuAnatomy } from "@ark-ui/react";
|
|
12
11
|
import { css, cva, sva } from "@ndla/styled-system/css";
|
|
13
12
|
import { createStyleContext } from "./createStyleContext";
|
|
14
13
|
import { Text } from "./Text";
|
package/es/Pagination.js
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { paginationAnatomy } from "@ark-ui/
|
|
10
|
-
import { Pagination } from "@ark-ui/react";
|
|
9
|
+
import { Pagination, paginationAnatomy } from "@ark-ui/react";
|
|
11
10
|
import { sva } from "@ndla/styled-system/css";
|
|
12
11
|
import { createStyleContext } from "./createStyleContext";
|
|
13
12
|
const paginationRecipe = sva({
|
package/es/Popover.js
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { popoverAnatomy } from "@ark-ui/
|
|
10
|
-
import { Popover } from "@ark-ui/react";
|
|
9
|
+
import { Popover, popoverAnatomy } from "@ark-ui/react";
|
|
11
10
|
import { sva } from "@ndla/styled-system/css";
|
|
12
11
|
import { createStyleContext } from "./createStyleContext";
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
package/es/RadioGroup.js
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { forwardRef } from "react";
|
|
10
|
-
import { radioGroupAnatomy } from "@ark-ui/
|
|
11
|
-
import { RadioGroup } from "@ark-ui/react";
|
|
10
|
+
import { RadioGroup, radioGroupAnatomy } from "@ark-ui/react";
|
|
12
11
|
import { sva } from "@ndla/styled-system/css";
|
|
13
12
|
import { createStyleContext } from "./createStyleContext";
|
|
14
13
|
import { Label } from "./Label";
|
package/es/Select.js
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
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 { forwardRef } from "react";
|
|
10
|
+
import { Select, selectAnatomy } from "@ark-ui/react";
|
|
11
|
+
import { sva } from "@ndla/styled-system/css";
|
|
12
|
+
import { createStyleContext } from "./createStyleContext";
|
|
13
|
+
import { Label } from "./Label";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
const selectRecipe = sva({
|
|
16
|
+
slots: selectAnatomy.keys(),
|
|
17
|
+
base: {
|
|
18
|
+
root: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
gap: "3xsmall"
|
|
22
|
+
},
|
|
23
|
+
control: {
|
|
24
|
+
display: "flex",
|
|
25
|
+
gap: "4xsmall",
|
|
26
|
+
alignItems: "center"
|
|
27
|
+
},
|
|
28
|
+
content: {
|
|
29
|
+
display: "flex",
|
|
30
|
+
gap: "4xsmall",
|
|
31
|
+
flexDirection: "column",
|
|
32
|
+
zIndex: "dropdown",
|
|
33
|
+
background: "surface.default",
|
|
34
|
+
borderRadius: "xsmall",
|
|
35
|
+
boxShadow: "large",
|
|
36
|
+
padding: "xsmall",
|
|
37
|
+
overflowY: "auto",
|
|
38
|
+
maxHeight: "surface.xsmall",
|
|
39
|
+
_focusVisible: {
|
|
40
|
+
outlineOffset: "-1"
|
|
41
|
+
},
|
|
42
|
+
_open: {
|
|
43
|
+
animation: "fade-shift-in 0.25s ease-out"
|
|
44
|
+
},
|
|
45
|
+
_closed: {
|
|
46
|
+
animation: "fade-shift-out 0.25s ease-out"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
item: {
|
|
50
|
+
display: "flex",
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
justifyContent: "space-between",
|
|
53
|
+
padding: "xsmall",
|
|
54
|
+
background: "surface.default",
|
|
55
|
+
borderRadius: "xsmall",
|
|
56
|
+
cursor: "pointer",
|
|
57
|
+
transitionDuration: "fast",
|
|
58
|
+
transitionProperty: "background, color",
|
|
59
|
+
transitionTimingFunction: "default",
|
|
60
|
+
_hover: {
|
|
61
|
+
background: "surface.hover"
|
|
62
|
+
},
|
|
63
|
+
_selected: {
|
|
64
|
+
background: "surface.selected",
|
|
65
|
+
_hover: {
|
|
66
|
+
background: "surface.hover"
|
|
67
|
+
},
|
|
68
|
+
_highlighted: {
|
|
69
|
+
background: "surface.hover"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
_highlighted: {
|
|
73
|
+
background: "surface.hover",
|
|
74
|
+
_hover: {
|
|
75
|
+
background: "surface.hover"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
_disabled: {
|
|
79
|
+
cursor: "not-allowed",
|
|
80
|
+
color: "text.disabled",
|
|
81
|
+
background: "surface.disabled",
|
|
82
|
+
_highlighted: {
|
|
83
|
+
color: "text.disabled",
|
|
84
|
+
background: "surface.disabled"
|
|
85
|
+
},
|
|
86
|
+
_selected: {
|
|
87
|
+
color: "text.disabled",
|
|
88
|
+
background: "surface.disabled"
|
|
89
|
+
},
|
|
90
|
+
_hover: {
|
|
91
|
+
color: "text.disabled",
|
|
92
|
+
background: "surface.disabled"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
indicator: {
|
|
97
|
+
color: "icon.default",
|
|
98
|
+
transformOrigin: "center",
|
|
99
|
+
transitionDuration: "normal",
|
|
100
|
+
transitionProperty: "transform",
|
|
101
|
+
transitionTimingFunction: "default",
|
|
102
|
+
_open: {
|
|
103
|
+
transform: "rotate(180deg)"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
itemIndicator: {
|
|
107
|
+
color: "stroke.default"
|
|
108
|
+
},
|
|
109
|
+
itemText: {
|
|
110
|
+
_checked: {
|
|
111
|
+
textDecoration: "underline"
|
|
112
|
+
},
|
|
113
|
+
_highlighted: {
|
|
114
|
+
textDecoration: "underline"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
trigger: {
|
|
118
|
+
justifyContent: "space-between",
|
|
119
|
+
width: "surface.small",
|
|
120
|
+
_ariaInvalid: {
|
|
121
|
+
boxShadowColor: "stroke.error"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
itemGroup: {
|
|
125
|
+
display: "flex",
|
|
126
|
+
flexDirection: "column",
|
|
127
|
+
gap: "4xsmall"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
const {
|
|
132
|
+
withProvider,
|
|
133
|
+
withContext
|
|
134
|
+
} = createStyleContext(selectRecipe);
|
|
135
|
+
const InternalSelectRoot = withProvider(Select.Root, "root");
|
|
136
|
+
export const SelectRoot = _ref => {
|
|
137
|
+
let {
|
|
138
|
+
lazyMount = true,
|
|
139
|
+
unmountOnExit = true,
|
|
140
|
+
...props
|
|
141
|
+
} = _ref;
|
|
142
|
+
return (
|
|
143
|
+
/*#__PURE__*/
|
|
144
|
+
//@ts-expect-error -- T does not necessarily match Select.CollectionItem. However, we prefer to use T over Select.CollectionItem to get the correct type during use.
|
|
145
|
+
_jsx(InternalSelectRoot, {
|
|
146
|
+
lazyMount: lazyMount,
|
|
147
|
+
unmountOnExit: unmountOnExit,
|
|
148
|
+
...props
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
export const SelectClearTrigger = withContext(Select.ClearTrigger, "clearTrigger");
|
|
153
|
+
export const SelectContent = withContext(Select.Content, "content");
|
|
154
|
+
export const SelectControl = withContext(Select.Control, "control");
|
|
155
|
+
export const SelectIndicator = withContext(Select.Indicator, "indicator");
|
|
156
|
+
export const SelectItemGroupLabel = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
157
|
+
let {
|
|
158
|
+
children,
|
|
159
|
+
...props
|
|
160
|
+
} = _ref2;
|
|
161
|
+
return /*#__PURE__*/_jsx(InternalSelectItemGroupLabel, {
|
|
162
|
+
asChild: true,
|
|
163
|
+
forwardCssProp: true,
|
|
164
|
+
ref: ref,
|
|
165
|
+
...props,
|
|
166
|
+
children: /*#__PURE__*/_jsx(Label, {
|
|
167
|
+
asChild: true,
|
|
168
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
169
|
+
children: children
|
|
170
|
+
})
|
|
171
|
+
})
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
const InternalSelectItemGroupLabel = withContext(Select.ItemGroupLabel, "itemGroupLabel");
|
|
175
|
+
export const SelectItemGroup = withContext(Select.ItemGroup, "itemGroup");
|
|
176
|
+
export const SelectItemIndicator = withContext(Select.ItemIndicator, "itemIndicator");
|
|
177
|
+
export const SelectItem = withContext(Select.Item, "item");
|
|
178
|
+
export const SelectItemText = withContext(Select.ItemText, "itemText");
|
|
179
|
+
const InternalSelectLabel = withContext(Select.Label, "label");
|
|
180
|
+
export const SelectLabel = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
181
|
+
let {
|
|
182
|
+
children,
|
|
183
|
+
...props
|
|
184
|
+
} = _ref3;
|
|
185
|
+
return /*#__PURE__*/_jsx(InternalSelectLabel, {
|
|
186
|
+
asChild: true,
|
|
187
|
+
forwardCssProp: true,
|
|
188
|
+
ref: ref,
|
|
189
|
+
...props,
|
|
190
|
+
children: /*#__PURE__*/_jsx(Label, {
|
|
191
|
+
children: children
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
export const SelectPositioner = withContext(Select.Positioner, "positioner");
|
|
196
|
+
export const SelectTrigger = withContext(Select.Trigger, "trigger");
|
|
197
|
+
export const SelectValueText = withContext(Select.ValueText, "valueText");
|
package/es/Slider.js
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { sliderAnatomy } from "@ark-ui/
|
|
10
|
-
import { Slider } from "@ark-ui/react";
|
|
9
|
+
import { Slider, sliderAnatomy } from "@ark-ui/react";
|
|
11
10
|
import { sva } from "@ndla/styled-system/css";
|
|
12
11
|
import { createStyleContext } from "./createStyleContext";
|
|
13
12
|
import { Label } from "./Label";
|
package/es/Switch.js
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { switchAnatomy } from "@ark-ui/
|
|
10
|
-
import { Switch } from "@ark-ui/react";
|
|
9
|
+
import { Switch, switchAnatomy } from "@ark-ui/react";
|
|
11
10
|
import { sva } from "@ndla/styled-system/css";
|
|
12
11
|
import { createStyleContext } from "./createStyleContext";
|
|
13
12
|
import { Text } from "./Text";
|
package/es/Tabs.js
CHANGED
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Tabs } from "@ark-ui/react";
|
|
9
|
+
import { Tabs, tabsAnatomy } 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
|
-
|
|
15
|
-
slots: ["content", "list", "root", "indicator", "trigger"],
|
|
14
|
+
slots: tabsAnatomy.keys(),
|
|
16
15
|
base: {
|
|
17
16
|
root: {
|
|
18
17
|
position: "relative",
|