@ndla/primitives 0.0.9 → 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 +71 -9
- package/dist/styles.css +277 -32
- package/es/Button.js +4 -0
- package/es/Combobox.js +226 -0
- package/es/Figure.js +75 -0
- package/es/Select.js +197 -0
- package/es/TagsInput.js +121 -0
- package/es/storybookHelpers/data.js +212 -0
- package/lib/Button.js +4 -0
- package/lib/Combobox.d.ts +59 -0
- package/lib/Combobox.js +236 -0
- package/lib/Dialog.d.ts +1 -1
- package/lib/Figure.d.ts +11 -0
- package/lib/Figure.js +81 -0
- package/lib/Select.d.ts +51 -0
- package/lib/Select.js +204 -0
- package/lib/TagsInput.d.ts +41 -0
- package/lib/TagsInput.js +127 -0
- package/lib/storybookHelpers/data.d.ts +23 -0
- package/lib/storybookHelpers/data.js +218 -0
- package/package.json +3 -3
|
@@ -0,0 +1,212 @@
|
|
|
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
|
+
export const europeanCountries = [{
|
|
10
|
+
label: "Albania",
|
|
11
|
+
value: "AL"
|
|
12
|
+
}, {
|
|
13
|
+
label: "Andorra",
|
|
14
|
+
value: "AD"
|
|
15
|
+
}, {
|
|
16
|
+
label: "Armenia",
|
|
17
|
+
value: "AM"
|
|
18
|
+
}, {
|
|
19
|
+
label: "Austria",
|
|
20
|
+
value: "AT"
|
|
21
|
+
}, {
|
|
22
|
+
label: "Azerbaijan",
|
|
23
|
+
value: "AZ"
|
|
24
|
+
}, {
|
|
25
|
+
label: "Belarus",
|
|
26
|
+
value: "BY"
|
|
27
|
+
}, {
|
|
28
|
+
label: "Belgium",
|
|
29
|
+
value: "BE"
|
|
30
|
+
}, {
|
|
31
|
+
label: "Bosnia and Herzegovina",
|
|
32
|
+
value: "BA"
|
|
33
|
+
}, {
|
|
34
|
+
label: "Bulgaria",
|
|
35
|
+
value: "BG"
|
|
36
|
+
}, {
|
|
37
|
+
label: "Croatia",
|
|
38
|
+
value: "HR"
|
|
39
|
+
}, {
|
|
40
|
+
label: "Cyprus",
|
|
41
|
+
value: "CY"
|
|
42
|
+
}, {
|
|
43
|
+
label: "Czech Republic",
|
|
44
|
+
value: "CZ"
|
|
45
|
+
}, {
|
|
46
|
+
label: "Denmark",
|
|
47
|
+
value: "DK"
|
|
48
|
+
}, {
|
|
49
|
+
label: "Estonia",
|
|
50
|
+
value: "EE"
|
|
51
|
+
}, {
|
|
52
|
+
label: "Finland",
|
|
53
|
+
value: "FI"
|
|
54
|
+
}, {
|
|
55
|
+
label: "France",
|
|
56
|
+
value: "FR"
|
|
57
|
+
}, {
|
|
58
|
+
label: "Georgia",
|
|
59
|
+
value: "GE"
|
|
60
|
+
}, {
|
|
61
|
+
label: "Germany",
|
|
62
|
+
value: "DE"
|
|
63
|
+
}, {
|
|
64
|
+
label: "Greece",
|
|
65
|
+
value: "GR"
|
|
66
|
+
}, {
|
|
67
|
+
label: "Hungary",
|
|
68
|
+
value: "HU"
|
|
69
|
+
}, {
|
|
70
|
+
label: "Iceland",
|
|
71
|
+
value: "IS"
|
|
72
|
+
}, {
|
|
73
|
+
label: "Ireland",
|
|
74
|
+
value: "IE"
|
|
75
|
+
}, {
|
|
76
|
+
label: "Italy",
|
|
77
|
+
value: "IT"
|
|
78
|
+
}, {
|
|
79
|
+
label: "Kazakhstan",
|
|
80
|
+
value: "KZ"
|
|
81
|
+
}, {
|
|
82
|
+
label: "Kosovo",
|
|
83
|
+
value: "XK"
|
|
84
|
+
}, {
|
|
85
|
+
label: "Latvia",
|
|
86
|
+
value: "LV"
|
|
87
|
+
}, {
|
|
88
|
+
label: "Liechtenstein",
|
|
89
|
+
value: "LI"
|
|
90
|
+
}, {
|
|
91
|
+
label: "Lithuania",
|
|
92
|
+
value: "LT"
|
|
93
|
+
}, {
|
|
94
|
+
label: "Luxembourg",
|
|
95
|
+
value: "LU"
|
|
96
|
+
}, {
|
|
97
|
+
label: "Malta",
|
|
98
|
+
value: "MT"
|
|
99
|
+
}, {
|
|
100
|
+
label: "Moldova",
|
|
101
|
+
value: "MD"
|
|
102
|
+
}, {
|
|
103
|
+
label: "Monaco",
|
|
104
|
+
value: "MC"
|
|
105
|
+
}, {
|
|
106
|
+
label: "Montenegro",
|
|
107
|
+
value: "ME"
|
|
108
|
+
}, {
|
|
109
|
+
label: "Netherlands",
|
|
110
|
+
value: "NL"
|
|
111
|
+
}, {
|
|
112
|
+
label: "North Macedonia",
|
|
113
|
+
value: "MK"
|
|
114
|
+
}, {
|
|
115
|
+
label: "Norway",
|
|
116
|
+
value: "NO"
|
|
117
|
+
}, {
|
|
118
|
+
label: "Poland",
|
|
119
|
+
value: "PL"
|
|
120
|
+
}, {
|
|
121
|
+
label: "Portugal",
|
|
122
|
+
value: "PT"
|
|
123
|
+
}, {
|
|
124
|
+
label: "Romania",
|
|
125
|
+
value: "RO"
|
|
126
|
+
}, {
|
|
127
|
+
label: "Russia",
|
|
128
|
+
value: "RU"
|
|
129
|
+
}, {
|
|
130
|
+
label: "San Marino",
|
|
131
|
+
value: "SM"
|
|
132
|
+
}, {
|
|
133
|
+
label: "Serbia",
|
|
134
|
+
value: "RS"
|
|
135
|
+
}, {
|
|
136
|
+
label: "Slovakia",
|
|
137
|
+
value: "SK"
|
|
138
|
+
}, {
|
|
139
|
+
label: "Slovenia",
|
|
140
|
+
value: "SI"
|
|
141
|
+
}, {
|
|
142
|
+
label: "Spain",
|
|
143
|
+
value: "ES"
|
|
144
|
+
}, {
|
|
145
|
+
label: "Sweden",
|
|
146
|
+
value: "SE"
|
|
147
|
+
}, {
|
|
148
|
+
label: "Switzerland",
|
|
149
|
+
value: "CH"
|
|
150
|
+
}, {
|
|
151
|
+
label: "Turkey",
|
|
152
|
+
value: "TR"
|
|
153
|
+
}, {
|
|
154
|
+
label: "Ukraine",
|
|
155
|
+
value: "UA"
|
|
156
|
+
}, {
|
|
157
|
+
label: "United Kingdom",
|
|
158
|
+
value: "GB"
|
|
159
|
+
}, {
|
|
160
|
+
label: "Vatican City",
|
|
161
|
+
value: "VA"
|
|
162
|
+
}];
|
|
163
|
+
export const measurements = [{
|
|
164
|
+
label: "Kilometer",
|
|
165
|
+
value: "km"
|
|
166
|
+
}, {
|
|
167
|
+
label: "Meter",
|
|
168
|
+
value: "m"
|
|
169
|
+
}, {
|
|
170
|
+
label: "Centimeter",
|
|
171
|
+
value: "cm"
|
|
172
|
+
}, {
|
|
173
|
+
label: "Millimeter",
|
|
174
|
+
value: "mm"
|
|
175
|
+
}, {
|
|
176
|
+
label: "Mile",
|
|
177
|
+
value: "mi"
|
|
178
|
+
}, {
|
|
179
|
+
label: "Yard",
|
|
180
|
+
value: "yd"
|
|
181
|
+
}, {
|
|
182
|
+
label: "Foot",
|
|
183
|
+
value: "ft"
|
|
184
|
+
}, {
|
|
185
|
+
label: "Inch",
|
|
186
|
+
value: "in"
|
|
187
|
+
}, {
|
|
188
|
+
label: "Nautical mile",
|
|
189
|
+
value: "nmi"
|
|
190
|
+
}];
|
|
191
|
+
export const advancedItems = [{
|
|
192
|
+
label: "React",
|
|
193
|
+
value: "react",
|
|
194
|
+
description: "A JavaScript library for building user interfaces",
|
|
195
|
+
img: "https://api.test.ndla.no/image-api/raw/YQyWgMkg.png"
|
|
196
|
+
}, {
|
|
197
|
+
label: "Solid",
|
|
198
|
+
value: "solid",
|
|
199
|
+
description: "React, but with signals",
|
|
200
|
+
img: "https://api.test.ndla.no/image-api/raw/YQyWgMkg.png"
|
|
201
|
+
}, {
|
|
202
|
+
label: "Svelte",
|
|
203
|
+
value: "svelte",
|
|
204
|
+
disabled: true,
|
|
205
|
+
description: "No more JS than required",
|
|
206
|
+
img: "https://api.test.ndla.no/image-api/raw/YQyWgMkg.png"
|
|
207
|
+
}, {
|
|
208
|
+
label: "Vue",
|
|
209
|
+
value: "vue",
|
|
210
|
+
description: "The Progressive JavaScript Framework",
|
|
211
|
+
img: "https://api.test.ndla.no/image-api/raw/YQyWgMkg.png"
|
|
212
|
+
}];
|
package/lib/Button.js
CHANGED
|
@@ -38,6 +38,10 @@ const buttonBaseRecipe = exports.buttonBaseRecipe = (0, _css.cva)({
|
|
|
38
38
|
cursor: "not-allowed",
|
|
39
39
|
color: "text.onAction",
|
|
40
40
|
background: "surface.disabled",
|
|
41
|
+
boxShadowColor: "surface.disabled",
|
|
42
|
+
"& svg": {
|
|
43
|
+
color: "text.onAction"
|
|
44
|
+
},
|
|
41
45
|
_hover: {
|
|
42
46
|
color: "text.onAction",
|
|
43
47
|
background: "surface.disabled"
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { Combobox } from "@ark-ui/react";
|
|
9
|
+
import { JsxStyleProps, RecipeVariantProps } from "@ndla/styled-system/types";
|
|
10
|
+
import { TextProps } from "./Text";
|
|
11
|
+
declare const comboboxRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"input" | "label" | "content" | "list" | "root" | "item" | "itemIndicator" | "control" | "clearTrigger" | "itemGroup" | "itemGroupLabel" | "itemText" | "positioner" | "trigger", {
|
|
12
|
+
variant: {
|
|
13
|
+
simple: {
|
|
14
|
+
item: {
|
|
15
|
+
padding: "xsmall";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
bordered: {
|
|
19
|
+
item: {
|
|
20
|
+
paddingInline: "small";
|
|
21
|
+
paddingBlock: "xsmall";
|
|
22
|
+
border: "1px solid";
|
|
23
|
+
borderColor: "stroke.subtle";
|
|
24
|
+
_hover: {
|
|
25
|
+
borderColor: "stroke.hover";
|
|
26
|
+
background: "surface.default";
|
|
27
|
+
};
|
|
28
|
+
_highlighted: {
|
|
29
|
+
borderColor: "stroke.default";
|
|
30
|
+
};
|
|
31
|
+
_checked: {
|
|
32
|
+
borderColor: "stroke.default";
|
|
33
|
+
};
|
|
34
|
+
_disabled: {
|
|
35
|
+
borderColor: "stroke.disabled";
|
|
36
|
+
_hover: {
|
|
37
|
+
borderColor: "stroke.disabled";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
type ComboboxVariantProps = RecipeVariantProps<typeof comboboxRecipe>;
|
|
45
|
+
export type ComboboxRootProps<T extends Combobox.CollectionItem> = Combobox.RootProps<T> & ComboboxVariantProps;
|
|
46
|
+
export declare const ComboboxRoot: <T extends Combobox.CollectionItem>({ ...props }: ComboboxRootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare const ComboboxClearTrigger: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.ClearTriggerProps> & Combobox.ClearTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
export declare const ComboboxContent: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.ContentProps> & Combobox.ContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
+
export declare const ComboboxControl: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.ControlProps> & Combobox.ControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
50
|
+
export declare const ComboboxInput: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.InputProps> & Combobox.InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
51
|
+
export declare const ComboboxItemGroupLabel: ({ children, textStyle, fontWeight, ...props }: Combobox.ItemGroupLabelProps & TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare const ComboboxItemGroup: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.ItemGroupProps> & Combobox.ItemGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
53
|
+
export declare const ComboboxItemIndicator: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.ItemIndicatorProps> & Combobox.ItemIndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
|
+
export declare const ComboboxItem: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.ItemProps> & Combobox.ItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
|
+
export declare const ComboboxItemText: ({ textStyle, fontWeight, ...props }: Combobox.ItemTextProps & TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare const ComboboxLabel: ({ textStyle, fontWeight, ...props }: Combobox.LabelProps & TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare const ComboboxPositioner: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.PositionerProps> & Combobox.PositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
58
|
+
export declare const ComboboxTrigger: import("react").ForwardRefExoticComponent<Omit<JsxStyleProps, keyof Combobox.TriggerProps> & Combobox.TriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
59
|
+
export {};
|
package/lib/Combobox.js
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
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;
|
|
7
|
+
var _react = require("@ark-ui/react");
|
|
8
|
+
var _css = require("@ndla/styled-system/css");
|
|
9
|
+
var _createStyleContext = require("./createStyleContext");
|
|
10
|
+
var _Label = require("./Label");
|
|
11
|
+
var _Text = require("./Text");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* Copyright (c) 2024-present, NDLA.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const comboboxRecipe = (0, _css.sva)({
|
|
22
|
+
slots: _react.comboboxAnatomy.keys(),
|
|
23
|
+
base: {
|
|
24
|
+
root: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
gap: "3xsmall"
|
|
28
|
+
},
|
|
29
|
+
control: {
|
|
30
|
+
display: "flex",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
gap: "4xsmall"
|
|
33
|
+
},
|
|
34
|
+
content: {
|
|
35
|
+
display: "flex",
|
|
36
|
+
gap: "4xsmall",
|
|
37
|
+
flexDirection: "column",
|
|
38
|
+
zIndex: "dropdown",
|
|
39
|
+
background: "surface.default",
|
|
40
|
+
borderRadius: "xsmall",
|
|
41
|
+
boxShadow: "large",
|
|
42
|
+
padding: "xsmall",
|
|
43
|
+
overflowY: "auto",
|
|
44
|
+
maxHeight: "surface.xsmall",
|
|
45
|
+
_open: {
|
|
46
|
+
animation: "fade-shift-in 0.25s ease-out"
|
|
47
|
+
},
|
|
48
|
+
_closed: {
|
|
49
|
+
animation: "fade-shift-out 0.25s ease-out"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
item: {
|
|
53
|
+
display: "flex",
|
|
54
|
+
justifyContent: "space-between",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
cursor: "pointer",
|
|
57
|
+
borderRadius: "xsmall",
|
|
58
|
+
transitionDuration: "fast",
|
|
59
|
+
transitionProperty: "background, color, border-color",
|
|
60
|
+
transitionTimingFunction: "default",
|
|
61
|
+
background: "surface.default",
|
|
62
|
+
_disabled: {
|
|
63
|
+
cursor: "not-allowed",
|
|
64
|
+
background: "surface.disabled",
|
|
65
|
+
color: "text.disabled",
|
|
66
|
+
_hover: {
|
|
67
|
+
background: "surface.disabled",
|
|
68
|
+
color: "text.disabled"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
_hover: {
|
|
72
|
+
background: "surface.hover"
|
|
73
|
+
},
|
|
74
|
+
_highlighted: {
|
|
75
|
+
background: "surface.hover"
|
|
76
|
+
},
|
|
77
|
+
_checked: {
|
|
78
|
+
background: "surface.selected",
|
|
79
|
+
_highlighted: {
|
|
80
|
+
background: "surface.hover"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
trigger: {
|
|
85
|
+
"& svg": {
|
|
86
|
+
color: "icon.default",
|
|
87
|
+
transformOrigin: "center",
|
|
88
|
+
transitionDuration: "normal",
|
|
89
|
+
transitionProperty: "transform",
|
|
90
|
+
transitionTimingFunction: "default"
|
|
91
|
+
},
|
|
92
|
+
_open: {
|
|
93
|
+
"& svg": {
|
|
94
|
+
transform: "rotate(180deg)"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
itemIndicator: {
|
|
99
|
+
color: "stroke.default"
|
|
100
|
+
},
|
|
101
|
+
itemText: {
|
|
102
|
+
_checked: {
|
|
103
|
+
textDecoration: "underline"
|
|
104
|
+
},
|
|
105
|
+
_highlighted: {
|
|
106
|
+
textDecoration: "underline"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
itemGroup: {
|
|
110
|
+
display: "flex",
|
|
111
|
+
flexDirection: "column",
|
|
112
|
+
gap: "4xsmall"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
defaultVariants: {
|
|
116
|
+
variant: "simple"
|
|
117
|
+
},
|
|
118
|
+
variants: {
|
|
119
|
+
variant: {
|
|
120
|
+
simple: {
|
|
121
|
+
item: {
|
|
122
|
+
padding: "xsmall"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
bordered: {
|
|
126
|
+
item: {
|
|
127
|
+
paddingInline: "small",
|
|
128
|
+
paddingBlock: "xsmall",
|
|
129
|
+
border: "1px solid",
|
|
130
|
+
borderColor: "stroke.subtle",
|
|
131
|
+
_hover: {
|
|
132
|
+
borderColor: "stroke.hover",
|
|
133
|
+
background: "surface.default"
|
|
134
|
+
},
|
|
135
|
+
_highlighted: {
|
|
136
|
+
borderColor: "stroke.default"
|
|
137
|
+
},
|
|
138
|
+
_checked: {
|
|
139
|
+
borderColor: "stroke.default"
|
|
140
|
+
},
|
|
141
|
+
_disabled: {
|
|
142
|
+
borderColor: "stroke.disabled",
|
|
143
|
+
_hover: {
|
|
144
|
+
borderColor: "stroke.disabled"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
const {
|
|
153
|
+
withProvider,
|
|
154
|
+
withContext
|
|
155
|
+
} = (0, _createStyleContext.createStyleContext)(comboboxRecipe);
|
|
156
|
+
const InternalComboboxRoot = withProvider(_react.Combobox.Root, "root");
|
|
157
|
+
const ComboboxRoot = _ref => {
|
|
158
|
+
let {
|
|
159
|
+
...props
|
|
160
|
+
} = _ref;
|
|
161
|
+
return (
|
|
162
|
+
/*#__PURE__*/
|
|
163
|
+
//@ts-expect-error - withProvider swallows the generic that Combobox.Root expects.
|
|
164
|
+
(0, _jsxRuntime.jsx)(InternalComboboxRoot, {
|
|
165
|
+
...props
|
|
166
|
+
})
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
exports.ComboboxRoot = ComboboxRoot;
|
|
170
|
+
const ComboboxClearTrigger = exports.ComboboxClearTrigger = withContext(_react.Combobox.ClearTrigger, "clearTrigger");
|
|
171
|
+
const ComboboxContent = exports.ComboboxContent = withContext(_react.Combobox.Content, "content");
|
|
172
|
+
const ComboboxControl = exports.ComboboxControl = withContext(_react.Combobox.Control, "control");
|
|
173
|
+
const ComboboxInput = exports.ComboboxInput = withContext(_react.Combobox.Input, "input");
|
|
174
|
+
const InternalComboboxItemGroupLabel = withContext(_react.Combobox.ItemGroupLabel, "itemGroupLabel");
|
|
175
|
+
const ComboboxItemGroupLabel = _ref2 => {
|
|
176
|
+
let {
|
|
177
|
+
children,
|
|
178
|
+
textStyle = "label.small",
|
|
179
|
+
fontWeight = "bold",
|
|
180
|
+
...props
|
|
181
|
+
} = _ref2;
|
|
182
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalComboboxItemGroupLabel, {
|
|
183
|
+
forwardCssProp: true,
|
|
184
|
+
asChild: true,
|
|
185
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
186
|
+
asChild: true,
|
|
187
|
+
forwardCssProp: true,
|
|
188
|
+
textStyle: textStyle,
|
|
189
|
+
fontWeight: fontWeight,
|
|
190
|
+
...props,
|
|
191
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
192
|
+
children: children
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
exports.ComboboxItemGroupLabel = ComboboxItemGroupLabel;
|
|
198
|
+
const ComboboxItemGroup = exports.ComboboxItemGroup = withContext(_react.Combobox.ItemGroup, "itemGroup");
|
|
199
|
+
const ComboboxItemIndicator = exports.ComboboxItemIndicator = withContext(_react.Combobox.ItemIndicator, "itemIndicator");
|
|
200
|
+
const ComboboxItem = exports.ComboboxItem = withContext(_react.Combobox.Item, "item");
|
|
201
|
+
const InternalComboboxItemText = withContext(_react.Combobox.ItemText, "itemText");
|
|
202
|
+
const ComboboxItemText = _ref3 => {
|
|
203
|
+
let {
|
|
204
|
+
textStyle = "label.medium",
|
|
205
|
+
fontWeight = "bold",
|
|
206
|
+
...props
|
|
207
|
+
} = _ref3;
|
|
208
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalComboboxItemText, {
|
|
209
|
+
forwardCssProp: true,
|
|
210
|
+
asChild: true,
|
|
211
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
212
|
+
...props
|
|
213
|
+
})
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
exports.ComboboxItemText = ComboboxItemText;
|
|
217
|
+
const InternalComboboxLabel = withContext(_react.Combobox.Label, "label");
|
|
218
|
+
const ComboboxLabel = _ref4 => {
|
|
219
|
+
let {
|
|
220
|
+
textStyle = "label.medium",
|
|
221
|
+
fontWeight = "bold",
|
|
222
|
+
...props
|
|
223
|
+
} = _ref4;
|
|
224
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalComboboxLabel, {
|
|
225
|
+
forwardCssProp: true,
|
|
226
|
+
asChild: true,
|
|
227
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Label.Label, {
|
|
228
|
+
textStyle: textStyle,
|
|
229
|
+
fontWeight: fontWeight,
|
|
230
|
+
...props
|
|
231
|
+
})
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
exports.ComboboxLabel = ComboboxLabel;
|
|
235
|
+
const ComboboxPositioner = exports.ComboboxPositioner = withContext(_react.Combobox.Positioner, "positioner");
|
|
236
|
+
const ComboboxTrigger = exports.ComboboxTrigger = withContext(_react.Combobox.Trigger, "trigger");
|
package/lib/Dialog.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Dialog } from "@ark-ui/react";
|
|
|
9
9
|
import { RecipeVariantProps } from "@ndla/styled-system/css";
|
|
10
10
|
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
11
11
|
import { TextProps } from "./Text";
|
|
12
|
-
declare const dialogRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"title" | "description" | "content" | "
|
|
12
|
+
declare const dialogRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"title" | "description" | "content" | "positioner" | "trigger" | "backdrop" | "closeTrigger", {
|
|
13
13
|
variant: {
|
|
14
14
|
drawer: {
|
|
15
15
|
content: {
|
package/lib/Figure.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export declare const Figure: import("@ndla/styled-system/jsx").StyledComponent<"figure", {
|
|
9
|
+
size?: "small" | "xsmall" | "medium" | "full" | undefined;
|
|
10
|
+
float?: "left" | "right" | undefined;
|
|
11
|
+
}>;
|
package/lib/Figure.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Figure = void 0;
|
|
7
|
+
var _jsx = require("@ndla/styled-system/jsx");
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) 2024-present, NDLA.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const Figure = exports.Figure = (0, _jsx.styled)("figure", {
|
|
17
|
+
base: {
|
|
18
|
+
position: "relative",
|
|
19
|
+
transitionDuration: "normal",
|
|
20
|
+
transitionProperty: "transform, width, height",
|
|
21
|
+
transitionTimingFunction: "default"
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
full: {
|
|
26
|
+
width: "100%"
|
|
27
|
+
},
|
|
28
|
+
medium: {
|
|
29
|
+
tablet: {
|
|
30
|
+
width: "50%"
|
|
31
|
+
},
|
|
32
|
+
desktop: {
|
|
33
|
+
width: "65%"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
small: {
|
|
37
|
+
tablet: {
|
|
38
|
+
width: "35%"
|
|
39
|
+
},
|
|
40
|
+
desktop: {
|
|
41
|
+
width: "50%"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
xsmall: {
|
|
45
|
+
tablet: {
|
|
46
|
+
width: "25%"
|
|
47
|
+
},
|
|
48
|
+
desktop: {
|
|
49
|
+
width: "35%"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
float: {
|
|
54
|
+
left: {
|
|
55
|
+
tablet: {
|
|
56
|
+
float: "left",
|
|
57
|
+
clear: "left",
|
|
58
|
+
paddingInlineEnd: "medium"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
right: {
|
|
62
|
+
tablet: {
|
|
63
|
+
float: "right",
|
|
64
|
+
clear: "right",
|
|
65
|
+
paddingInlineStart: "medium"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
defaultVariants: {
|
|
71
|
+
size: "full"
|
|
72
|
+
},
|
|
73
|
+
compoundVariants: [{
|
|
74
|
+
float: ["left", "right"],
|
|
75
|
+
css: {
|
|
76
|
+
zIndex: "base",
|
|
77
|
+
left: "auto",
|
|
78
|
+
marginBlock: "xsmall"
|
|
79
|
+
}
|
|
80
|
+
}]
|
|
81
|
+
});
|
package/lib/Select.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
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 { Select } from "@ark-ui/react";
|
|
9
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
|
+
import { TextProps } from "./Text";
|
|
11
|
+
export type SelectRootProps<T extends Select.CollectionItem> = Select.RootProps<T> & JsxStyleProps;
|
|
12
|
+
export declare const SelectRoot: <T extends Select.CollectionItem>({ lazyMount, unmountOnExit, ...props }: SelectRootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const SelectClearTrigger: import("react").ForwardRefExoticComponent<Select.ClearTriggerProps & {
|
|
14
|
+
forwardCssProp?: boolean | undefined;
|
|
15
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export declare const SelectContent: import("react").ForwardRefExoticComponent<Select.ContentProps & {
|
|
17
|
+
forwardCssProp?: boolean | undefined;
|
|
18
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export declare const SelectControl: import("react").ForwardRefExoticComponent<Select.ControlProps & {
|
|
20
|
+
forwardCssProp?: boolean | undefined;
|
|
21
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export declare const SelectIndicator: import("react").ForwardRefExoticComponent<Select.IndicatorProps & {
|
|
23
|
+
forwardCssProp?: boolean | undefined;
|
|
24
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export declare const SelectItemGroupLabel: import("react").ForwardRefExoticComponent<Select.ItemGroupLabelProps & {
|
|
26
|
+
forwardCssProp?: boolean | undefined;
|
|
27
|
+
} & import("@ndla/styled-system/types").WithCss & TextProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export declare const SelectItemGroup: import("react").ForwardRefExoticComponent<Select.ItemGroupProps & {
|
|
29
|
+
forwardCssProp?: boolean | undefined;
|
|
30
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export declare const SelectItemIndicator: import("react").ForwardRefExoticComponent<Select.ItemIndicatorProps & {
|
|
32
|
+
forwardCssProp?: boolean | undefined;
|
|
33
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
34
|
+
export declare const SelectItem: import("react").ForwardRefExoticComponent<Select.ItemProps & {
|
|
35
|
+
forwardCssProp?: boolean | undefined;
|
|
36
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export declare const SelectItemText: import("react").ForwardRefExoticComponent<Select.ItemTextProps & {
|
|
38
|
+
forwardCssProp?: boolean | undefined;
|
|
39
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export declare const SelectLabel: import("react").ForwardRefExoticComponent<Select.LabelProps & {
|
|
41
|
+
forwardCssProp?: boolean | undefined;
|
|
42
|
+
} & import("@ndla/styled-system/types").WithCss & TextProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
43
|
+
export declare const SelectPositioner: import("react").ForwardRefExoticComponent<Select.PositionerProps & {
|
|
44
|
+
forwardCssProp?: boolean | undefined;
|
|
45
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
|
+
export declare const SelectTrigger: import("react").ForwardRefExoticComponent<Select.TriggerProps & {
|
|
47
|
+
forwardCssProp?: boolean | undefined;
|
|
48
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLButtonElement>>;
|
|
49
|
+
export declare const SelectValueText: import("react").ForwardRefExoticComponent<Select.ValueTextProps & {
|
|
50
|
+
forwardCssProp?: boolean | undefined;
|
|
51
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLSpanElement>>;
|