@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
package/lib/Select.js
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
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;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
9
|
+
var _css = require("@ndla/styled-system/css");
|
|
10
|
+
var _createStyleContext = require("./createStyleContext");
|
|
11
|
+
var _Label = require("./Label");
|
|
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 selectRecipe = (0, _css.sva)({
|
|
22
|
+
slots: _react2.selectAnatomy.keys(),
|
|
23
|
+
base: {
|
|
24
|
+
root: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
gap: "3xsmall"
|
|
28
|
+
},
|
|
29
|
+
control: {
|
|
30
|
+
display: "flex",
|
|
31
|
+
gap: "4xsmall",
|
|
32
|
+
alignItems: "center"
|
|
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
|
+
_focusVisible: {
|
|
46
|
+
outlineOffset: "-1"
|
|
47
|
+
},
|
|
48
|
+
_open: {
|
|
49
|
+
animation: "fade-shift-in 0.25s ease-out"
|
|
50
|
+
},
|
|
51
|
+
_closed: {
|
|
52
|
+
animation: "fade-shift-out 0.25s ease-out"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
item: {
|
|
56
|
+
display: "flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: "space-between",
|
|
59
|
+
padding: "xsmall",
|
|
60
|
+
background: "surface.default",
|
|
61
|
+
borderRadius: "xsmall",
|
|
62
|
+
cursor: "pointer",
|
|
63
|
+
transitionDuration: "fast",
|
|
64
|
+
transitionProperty: "background, color",
|
|
65
|
+
transitionTimingFunction: "default",
|
|
66
|
+
_hover: {
|
|
67
|
+
background: "surface.hover"
|
|
68
|
+
},
|
|
69
|
+
_selected: {
|
|
70
|
+
background: "surface.selected",
|
|
71
|
+
_hover: {
|
|
72
|
+
background: "surface.hover"
|
|
73
|
+
},
|
|
74
|
+
_highlighted: {
|
|
75
|
+
background: "surface.hover"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
_highlighted: {
|
|
79
|
+
background: "surface.hover",
|
|
80
|
+
_hover: {
|
|
81
|
+
background: "surface.hover"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
_disabled: {
|
|
85
|
+
cursor: "not-allowed",
|
|
86
|
+
color: "text.disabled",
|
|
87
|
+
background: "surface.disabled",
|
|
88
|
+
_highlighted: {
|
|
89
|
+
color: "text.disabled",
|
|
90
|
+
background: "surface.disabled"
|
|
91
|
+
},
|
|
92
|
+
_selected: {
|
|
93
|
+
color: "text.disabled",
|
|
94
|
+
background: "surface.disabled"
|
|
95
|
+
},
|
|
96
|
+
_hover: {
|
|
97
|
+
color: "text.disabled",
|
|
98
|
+
background: "surface.disabled"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
indicator: {
|
|
103
|
+
color: "icon.default",
|
|
104
|
+
transformOrigin: "center",
|
|
105
|
+
transitionDuration: "normal",
|
|
106
|
+
transitionProperty: "transform",
|
|
107
|
+
transitionTimingFunction: "default",
|
|
108
|
+
_open: {
|
|
109
|
+
transform: "rotate(180deg)"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
itemIndicator: {
|
|
113
|
+
color: "stroke.default"
|
|
114
|
+
},
|
|
115
|
+
itemText: {
|
|
116
|
+
_checked: {
|
|
117
|
+
textDecoration: "underline"
|
|
118
|
+
},
|
|
119
|
+
_highlighted: {
|
|
120
|
+
textDecoration: "underline"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
trigger: {
|
|
124
|
+
justifyContent: "space-between",
|
|
125
|
+
width: "surface.small",
|
|
126
|
+
_ariaInvalid: {
|
|
127
|
+
boxShadowColor: "stroke.error"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
itemGroup: {
|
|
131
|
+
display: "flex",
|
|
132
|
+
flexDirection: "column",
|
|
133
|
+
gap: "4xsmall"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
const {
|
|
138
|
+
withProvider,
|
|
139
|
+
withContext
|
|
140
|
+
} = (0, _createStyleContext.createStyleContext)(selectRecipe);
|
|
141
|
+
const InternalSelectRoot = withProvider(_react2.Select.Root, "root");
|
|
142
|
+
const SelectRoot = _ref => {
|
|
143
|
+
let {
|
|
144
|
+
lazyMount = true,
|
|
145
|
+
unmountOnExit = true,
|
|
146
|
+
...props
|
|
147
|
+
} = _ref;
|
|
148
|
+
return (
|
|
149
|
+
/*#__PURE__*/
|
|
150
|
+
//@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.
|
|
151
|
+
(0, _jsxRuntime.jsx)(InternalSelectRoot, {
|
|
152
|
+
lazyMount: lazyMount,
|
|
153
|
+
unmountOnExit: unmountOnExit,
|
|
154
|
+
...props
|
|
155
|
+
})
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
exports.SelectRoot = SelectRoot;
|
|
159
|
+
const SelectClearTrigger = exports.SelectClearTrigger = withContext(_react2.Select.ClearTrigger, "clearTrigger");
|
|
160
|
+
const SelectContent = exports.SelectContent = withContext(_react2.Select.Content, "content");
|
|
161
|
+
const SelectControl = exports.SelectControl = withContext(_react2.Select.Control, "control");
|
|
162
|
+
const SelectIndicator = exports.SelectIndicator = withContext(_react2.Select.Indicator, "indicator");
|
|
163
|
+
const SelectItemGroupLabel = exports.SelectItemGroupLabel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
164
|
+
let {
|
|
165
|
+
children,
|
|
166
|
+
...props
|
|
167
|
+
} = _ref2;
|
|
168
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalSelectItemGroupLabel, {
|
|
169
|
+
asChild: true,
|
|
170
|
+
forwardCssProp: true,
|
|
171
|
+
ref: ref,
|
|
172
|
+
...props,
|
|
173
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Label.Label, {
|
|
174
|
+
asChild: true,
|
|
175
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
176
|
+
children: children
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
const InternalSelectItemGroupLabel = withContext(_react2.Select.ItemGroupLabel, "itemGroupLabel");
|
|
182
|
+
const SelectItemGroup = exports.SelectItemGroup = withContext(_react2.Select.ItemGroup, "itemGroup");
|
|
183
|
+
const SelectItemIndicator = exports.SelectItemIndicator = withContext(_react2.Select.ItemIndicator, "itemIndicator");
|
|
184
|
+
const SelectItem = exports.SelectItem = withContext(_react2.Select.Item, "item");
|
|
185
|
+
const SelectItemText = exports.SelectItemText = withContext(_react2.Select.ItemText, "itemText");
|
|
186
|
+
const InternalSelectLabel = withContext(_react2.Select.Label, "label");
|
|
187
|
+
const SelectLabel = exports.SelectLabel = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
188
|
+
let {
|
|
189
|
+
children,
|
|
190
|
+
...props
|
|
191
|
+
} = _ref3;
|
|
192
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalSelectLabel, {
|
|
193
|
+
asChild: true,
|
|
194
|
+
forwardCssProp: true,
|
|
195
|
+
ref: ref,
|
|
196
|
+
...props,
|
|
197
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Label.Label, {
|
|
198
|
+
children: children
|
|
199
|
+
})
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
const SelectPositioner = exports.SelectPositioner = withContext(_react2.Select.Positioner, "positioner");
|
|
203
|
+
const SelectTrigger = exports.SelectTrigger = withContext(_react2.Select.Trigger, "trigger");
|
|
204
|
+
const SelectValueText = exports.SelectValueText = withContext(_react2.Select.ValueText, "valueText");
|
|
@@ -0,0 +1,41 @@
|
|
|
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 { TagsInput } from "@ark-ui/react";
|
|
9
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
10
|
+
import { TextProps } from "./Text";
|
|
11
|
+
export type TagsInputRootProps = TagsInput.RootProps & JsxStyleProps;
|
|
12
|
+
export declare const TagsInputRoot: import("react").ForwardRefExoticComponent<TagsInput.RootProps & {
|
|
13
|
+
forwardCssProp?: boolean | undefined;
|
|
14
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const TagsInputClearTrigger: import("react").ForwardRefExoticComponent<TagsInput.ClearTriggerProps & {
|
|
16
|
+
forwardCssProp?: boolean | undefined;
|
|
17
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export declare const TagsInputControl: import("react").ForwardRefExoticComponent<TagsInput.ControlProps & {
|
|
19
|
+
forwardCssProp?: boolean | undefined;
|
|
20
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export declare const TagsInputInput: import("react").ForwardRefExoticComponent<TagsInput.InputProps & {
|
|
22
|
+
forwardCssProp?: boolean | undefined;
|
|
23
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLInputElement>>;
|
|
24
|
+
export declare const TagsInputItemDeleteTrigger: import("react").ForwardRefExoticComponent<TagsInput.ItemDeleteTriggerProps & {
|
|
25
|
+
forwardCssProp?: boolean | undefined;
|
|
26
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
export declare const TagsInputItemInput: import("react").ForwardRefExoticComponent<TagsInput.ItemInputProps & {
|
|
28
|
+
forwardCssProp?: boolean | undefined;
|
|
29
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLInputElement>>;
|
|
30
|
+
export declare const TagsInputItemPreview: import("react").ForwardRefExoticComponent<TagsInput.ItemPreviewProps & {
|
|
31
|
+
forwardCssProp?: boolean | undefined;
|
|
32
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export declare const TagsInputItem: import("react").ForwardRefExoticComponent<TagsInput.ItemProps & {
|
|
34
|
+
forwardCssProp?: boolean | undefined;
|
|
35
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
|
+
export declare const TagsInputItemText: import("react").ForwardRefExoticComponent<TagsInput.ItemTextProps & {
|
|
37
|
+
forwardCssProp?: boolean | undefined;
|
|
38
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLSpanElement>>;
|
|
39
|
+
export declare const TagsInputLabel: import("react").ForwardRefExoticComponent<TagsInput.LabelProps & {
|
|
40
|
+
forwardCssProp?: boolean | undefined;
|
|
41
|
+
} & import("@ndla/styled-system/types").WithCss & TextProps & import("react").RefAttributes<HTMLLabelElement>>;
|
package/lib/TagsInput.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TagsInputRoot = exports.TagsInputLabel = exports.TagsInputItemText = exports.TagsInputItemPreview = exports.TagsInputItemInput = exports.TagsInputItemDeleteTrigger = exports.TagsInputItem = exports.TagsInputInput = exports.TagsInputControl = exports.TagsInputClearTrigger = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
9
|
+
var _css = require("@ndla/styled-system/css");
|
|
10
|
+
var _createStyleContext = require("./createStyleContext");
|
|
11
|
+
var _Label = require("./Label");
|
|
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 tagsInputRecipe = (0, _css.sva)({
|
|
22
|
+
slots: _react2.tagsInputAnatomy.keys(),
|
|
23
|
+
base: {
|
|
24
|
+
root: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
gap: "xxsmall",
|
|
28
|
+
width: "full"
|
|
29
|
+
},
|
|
30
|
+
control: {
|
|
31
|
+
display: "inline-flex",
|
|
32
|
+
gap: "xxsmall",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
flexWrap: "wrap"
|
|
35
|
+
},
|
|
36
|
+
item: {
|
|
37
|
+
paddingBlock: "3xsmall"
|
|
38
|
+
},
|
|
39
|
+
itemPreview: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
gap: "1",
|
|
42
|
+
paddingBlock: "4xsmall",
|
|
43
|
+
paddingInlineEnd: "3xsmall",
|
|
44
|
+
paddingInlineStart: "xsmall",
|
|
45
|
+
cursor: "initial",
|
|
46
|
+
borderRadius: "large",
|
|
47
|
+
outline: "1px solid",
|
|
48
|
+
outlineColor: "transparent",
|
|
49
|
+
backgroundColor: "surface.actionSubtle.selected",
|
|
50
|
+
color: "text.onAction",
|
|
51
|
+
transitionDuration: "normal",
|
|
52
|
+
transitionProperty: "background, outline-color, color",
|
|
53
|
+
transitionTimingFunction: "default",
|
|
54
|
+
textStyle: "label.medium",
|
|
55
|
+
_hover: {
|
|
56
|
+
backgroundColor: "surface.actionSubtle.hover",
|
|
57
|
+
outlineColor: "stroke.hover",
|
|
58
|
+
color: "text.default",
|
|
59
|
+
"& svg": {
|
|
60
|
+
color: "stroke.hover"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
_highlighted: {
|
|
64
|
+
backgroundColor: "surface.actionSubtle.hover",
|
|
65
|
+
outlineWidth: "3px",
|
|
66
|
+
outlineOffset: "-1px",
|
|
67
|
+
outlineColor: "stroke.hover",
|
|
68
|
+
color: "text.default",
|
|
69
|
+
"& svg": {
|
|
70
|
+
color: "stroke.hover"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
input: {
|
|
75
|
+
flex: "1"
|
|
76
|
+
},
|
|
77
|
+
itemDeleteTrigger: {
|
|
78
|
+
paddingBottom: "1",
|
|
79
|
+
cursor: "pointer",
|
|
80
|
+
"& span": {
|
|
81
|
+
display: "inline-block"
|
|
82
|
+
},
|
|
83
|
+
"& svg": {
|
|
84
|
+
marginInline: "0",
|
|
85
|
+
marginBlock: "0",
|
|
86
|
+
width: "medium",
|
|
87
|
+
height: "medium"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
itemText: {
|
|
91
|
+
paddingBottom: "1"
|
|
92
|
+
},
|
|
93
|
+
itemInput: {
|
|
94
|
+
outline: "none",
|
|
95
|
+
background: "transparent"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
const {
|
|
100
|
+
withProvider,
|
|
101
|
+
withContext
|
|
102
|
+
} = (0, _createStyleContext.createStyleContext)(tagsInputRecipe);
|
|
103
|
+
const TagsInputRoot = exports.TagsInputRoot = withProvider(_react2.TagsInput.Root, "root");
|
|
104
|
+
const TagsInputClearTrigger = exports.TagsInputClearTrigger = withContext(_react2.TagsInput.ClearTrigger, "clearTrigger");
|
|
105
|
+
const TagsInputControl = exports.TagsInputControl = withContext(_react2.TagsInput.Control, "control");
|
|
106
|
+
const TagsInputInput = exports.TagsInputInput = withContext(_react2.TagsInput.Input, "input");
|
|
107
|
+
const TagsInputItemDeleteTrigger = exports.TagsInputItemDeleteTrigger = withContext(_react2.TagsInput.ItemDeleteTrigger, "itemDeleteTrigger");
|
|
108
|
+
const TagsInputItemInput = exports.TagsInputItemInput = withContext(_react2.TagsInput.ItemInput, "itemInput");
|
|
109
|
+
const TagsInputItemPreview = exports.TagsInputItemPreview = withContext(_react2.TagsInput.ItemPreview, "itemPreview");
|
|
110
|
+
const TagsInputItem = exports.TagsInputItem = withContext(_react2.TagsInput.Item, "item");
|
|
111
|
+
const TagsInputItemText = exports.TagsInputItemText = withContext(_react2.TagsInput.ItemText, "itemText");
|
|
112
|
+
const InternalTagsInputLabel = withContext(_react2.TagsInput.Label, "label");
|
|
113
|
+
const TagsInputLabel = exports.TagsInputLabel = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
114
|
+
let {
|
|
115
|
+
children,
|
|
116
|
+
...props
|
|
117
|
+
} = _ref;
|
|
118
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalTagsInputLabel, {
|
|
119
|
+
asChild: true,
|
|
120
|
+
forwardCssProp: true,
|
|
121
|
+
ref: ref,
|
|
122
|
+
...props,
|
|
123
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Label.Label, {
|
|
124
|
+
children: children
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
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 europeanCountries: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
export declare const measurements: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
export interface AdvancedItem {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
description: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
img: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const advancedItems: AdvancedItem[];
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.measurements = exports.europeanCountries = exports.advancedItems = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) 2024-present, NDLA.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const europeanCountries = exports.europeanCountries = [{
|
|
16
|
+
label: "Albania",
|
|
17
|
+
value: "AL"
|
|
18
|
+
}, {
|
|
19
|
+
label: "Andorra",
|
|
20
|
+
value: "AD"
|
|
21
|
+
}, {
|
|
22
|
+
label: "Armenia",
|
|
23
|
+
value: "AM"
|
|
24
|
+
}, {
|
|
25
|
+
label: "Austria",
|
|
26
|
+
value: "AT"
|
|
27
|
+
}, {
|
|
28
|
+
label: "Azerbaijan",
|
|
29
|
+
value: "AZ"
|
|
30
|
+
}, {
|
|
31
|
+
label: "Belarus",
|
|
32
|
+
value: "BY"
|
|
33
|
+
}, {
|
|
34
|
+
label: "Belgium",
|
|
35
|
+
value: "BE"
|
|
36
|
+
}, {
|
|
37
|
+
label: "Bosnia and Herzegovina",
|
|
38
|
+
value: "BA"
|
|
39
|
+
}, {
|
|
40
|
+
label: "Bulgaria",
|
|
41
|
+
value: "BG"
|
|
42
|
+
}, {
|
|
43
|
+
label: "Croatia",
|
|
44
|
+
value: "HR"
|
|
45
|
+
}, {
|
|
46
|
+
label: "Cyprus",
|
|
47
|
+
value: "CY"
|
|
48
|
+
}, {
|
|
49
|
+
label: "Czech Republic",
|
|
50
|
+
value: "CZ"
|
|
51
|
+
}, {
|
|
52
|
+
label: "Denmark",
|
|
53
|
+
value: "DK"
|
|
54
|
+
}, {
|
|
55
|
+
label: "Estonia",
|
|
56
|
+
value: "EE"
|
|
57
|
+
}, {
|
|
58
|
+
label: "Finland",
|
|
59
|
+
value: "FI"
|
|
60
|
+
}, {
|
|
61
|
+
label: "France",
|
|
62
|
+
value: "FR"
|
|
63
|
+
}, {
|
|
64
|
+
label: "Georgia",
|
|
65
|
+
value: "GE"
|
|
66
|
+
}, {
|
|
67
|
+
label: "Germany",
|
|
68
|
+
value: "DE"
|
|
69
|
+
}, {
|
|
70
|
+
label: "Greece",
|
|
71
|
+
value: "GR"
|
|
72
|
+
}, {
|
|
73
|
+
label: "Hungary",
|
|
74
|
+
value: "HU"
|
|
75
|
+
}, {
|
|
76
|
+
label: "Iceland",
|
|
77
|
+
value: "IS"
|
|
78
|
+
}, {
|
|
79
|
+
label: "Ireland",
|
|
80
|
+
value: "IE"
|
|
81
|
+
}, {
|
|
82
|
+
label: "Italy",
|
|
83
|
+
value: "IT"
|
|
84
|
+
}, {
|
|
85
|
+
label: "Kazakhstan",
|
|
86
|
+
value: "KZ"
|
|
87
|
+
}, {
|
|
88
|
+
label: "Kosovo",
|
|
89
|
+
value: "XK"
|
|
90
|
+
}, {
|
|
91
|
+
label: "Latvia",
|
|
92
|
+
value: "LV"
|
|
93
|
+
}, {
|
|
94
|
+
label: "Liechtenstein",
|
|
95
|
+
value: "LI"
|
|
96
|
+
}, {
|
|
97
|
+
label: "Lithuania",
|
|
98
|
+
value: "LT"
|
|
99
|
+
}, {
|
|
100
|
+
label: "Luxembourg",
|
|
101
|
+
value: "LU"
|
|
102
|
+
}, {
|
|
103
|
+
label: "Malta",
|
|
104
|
+
value: "MT"
|
|
105
|
+
}, {
|
|
106
|
+
label: "Moldova",
|
|
107
|
+
value: "MD"
|
|
108
|
+
}, {
|
|
109
|
+
label: "Monaco",
|
|
110
|
+
value: "MC"
|
|
111
|
+
}, {
|
|
112
|
+
label: "Montenegro",
|
|
113
|
+
value: "ME"
|
|
114
|
+
}, {
|
|
115
|
+
label: "Netherlands",
|
|
116
|
+
value: "NL"
|
|
117
|
+
}, {
|
|
118
|
+
label: "North Macedonia",
|
|
119
|
+
value: "MK"
|
|
120
|
+
}, {
|
|
121
|
+
label: "Norway",
|
|
122
|
+
value: "NO"
|
|
123
|
+
}, {
|
|
124
|
+
label: "Poland",
|
|
125
|
+
value: "PL"
|
|
126
|
+
}, {
|
|
127
|
+
label: "Portugal",
|
|
128
|
+
value: "PT"
|
|
129
|
+
}, {
|
|
130
|
+
label: "Romania",
|
|
131
|
+
value: "RO"
|
|
132
|
+
}, {
|
|
133
|
+
label: "Russia",
|
|
134
|
+
value: "RU"
|
|
135
|
+
}, {
|
|
136
|
+
label: "San Marino",
|
|
137
|
+
value: "SM"
|
|
138
|
+
}, {
|
|
139
|
+
label: "Serbia",
|
|
140
|
+
value: "RS"
|
|
141
|
+
}, {
|
|
142
|
+
label: "Slovakia",
|
|
143
|
+
value: "SK"
|
|
144
|
+
}, {
|
|
145
|
+
label: "Slovenia",
|
|
146
|
+
value: "SI"
|
|
147
|
+
}, {
|
|
148
|
+
label: "Spain",
|
|
149
|
+
value: "ES"
|
|
150
|
+
}, {
|
|
151
|
+
label: "Sweden",
|
|
152
|
+
value: "SE"
|
|
153
|
+
}, {
|
|
154
|
+
label: "Switzerland",
|
|
155
|
+
value: "CH"
|
|
156
|
+
}, {
|
|
157
|
+
label: "Turkey",
|
|
158
|
+
value: "TR"
|
|
159
|
+
}, {
|
|
160
|
+
label: "Ukraine",
|
|
161
|
+
value: "UA"
|
|
162
|
+
}, {
|
|
163
|
+
label: "United Kingdom",
|
|
164
|
+
value: "GB"
|
|
165
|
+
}, {
|
|
166
|
+
label: "Vatican City",
|
|
167
|
+
value: "VA"
|
|
168
|
+
}];
|
|
169
|
+
const measurements = exports.measurements = [{
|
|
170
|
+
label: "Kilometer",
|
|
171
|
+
value: "km"
|
|
172
|
+
}, {
|
|
173
|
+
label: "Meter",
|
|
174
|
+
value: "m"
|
|
175
|
+
}, {
|
|
176
|
+
label: "Centimeter",
|
|
177
|
+
value: "cm"
|
|
178
|
+
}, {
|
|
179
|
+
label: "Millimeter",
|
|
180
|
+
value: "mm"
|
|
181
|
+
}, {
|
|
182
|
+
label: "Mile",
|
|
183
|
+
value: "mi"
|
|
184
|
+
}, {
|
|
185
|
+
label: "Yard",
|
|
186
|
+
value: "yd"
|
|
187
|
+
}, {
|
|
188
|
+
label: "Foot",
|
|
189
|
+
value: "ft"
|
|
190
|
+
}, {
|
|
191
|
+
label: "Inch",
|
|
192
|
+
value: "in"
|
|
193
|
+
}, {
|
|
194
|
+
label: "Nautical mile",
|
|
195
|
+
value: "nmi"
|
|
196
|
+
}];
|
|
197
|
+
const advancedItems = exports.advancedItems = [{
|
|
198
|
+
label: "React",
|
|
199
|
+
value: "react",
|
|
200
|
+
description: "A JavaScript library for building user interfaces",
|
|
201
|
+
img: "https://api.test.ndla.no/image-api/raw/YQyWgMkg.png"
|
|
202
|
+
}, {
|
|
203
|
+
label: "Solid",
|
|
204
|
+
value: "solid",
|
|
205
|
+
description: "React, but with signals",
|
|
206
|
+
img: "https://api.test.ndla.no/image-api/raw/YQyWgMkg.png"
|
|
207
|
+
}, {
|
|
208
|
+
label: "Svelte",
|
|
209
|
+
value: "svelte",
|
|
210
|
+
disabled: true,
|
|
211
|
+
description: "No more JS than required",
|
|
212
|
+
img: "https://api.test.ndla.no/image-api/raw/YQyWgMkg.png"
|
|
213
|
+
}, {
|
|
214
|
+
label: "Vue",
|
|
215
|
+
value: "vue",
|
|
216
|
+
description: "The Progressive JavaScript Framework",
|
|
217
|
+
img: "https://api.test.ndla.no/image-api/raw/YQyWgMkg.png"
|
|
218
|
+
}];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/primitives",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
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": "^3.5.0",
|
|
32
32
|
"@ndla/styled-system": "^0.0.2",
|
|
33
|
-
"@ndla/util": "^4.0
|
|
33
|
+
"@ndla/util": "^4.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@ndla/preset-panda": "^0.0.6",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "2591a4413a91a0fa4bd4498bdb17ff0b7d0b4c60"
|
|
47
47
|
}
|