@obosbbl/grunnmuren-react 2.0.0-canary.0 → 2.0.0-canary.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/README.md +99 -0
- package/dist/Button-client-XmGlKEk4.js +143 -0
- package/dist/index.d.mts +397 -0
- package/dist/index.mjs +537 -0
- package/package.json +8 -38
- package/dist/button/Button.d.mts +0 -82
- package/dist/button/Button.d.ts +0 -82
- package/dist/button/Button.mjs +0 -130
- package/dist/checkbox/index.d.mts +0 -32
- package/dist/checkbox/index.d.ts +0 -32
- package/dist/checkbox/index.mjs +0 -106
- package/dist/label/index.d.mts +0 -13
- package/dist/label/index.d.ts +0 -13
- package/dist/label/index.mjs +0 -45
- package/dist/radiogroup/index.d.mts +0 -30
- package/dist/radiogroup/index.d.ts +0 -30
- package/dist/radiogroup/index.mjs +0 -65
- package/dist/textfield/index.d.mts +0 -31
- package/dist/textfield/index.d.ts +0 -31
- package/dist/textfield/index.mjs +0 -88
package/dist/textfield/index.mjs
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { cx, cva } from 'cva';
|
|
3
|
-
import { TextField as TextField$1, Input } from 'react-aria-components';
|
|
4
|
-
import { Label, Description, ErrorMessage } from '../label/index.mjs';
|
|
5
|
-
|
|
6
|
-
const classes = {
|
|
7
|
-
base: cx("group flex flex-col gap-2"),
|
|
8
|
-
inputWrapper: cva({
|
|
9
|
-
base: [
|
|
10
|
-
"relative inline-flex flex-row items-center rounded-md border border-black py-2.5 text-sm font-normal leading-6",
|
|
11
|
-
// prevent icons in addons from being flexed and affected by the text size of the input
|
|
12
|
-
"[&>svg]:flex-none [&>svg]:text-base",
|
|
13
|
-
// focus
|
|
14
|
-
"focus-within:ring-2 focus-within:ring-blue-dark",
|
|
15
|
-
// invalid
|
|
16
|
-
"group-data-[invalid]:border-red group-data-[invalid]:outline group-data-[invalid]:outline-1 group-data-[invalid]:outline-red"
|
|
17
|
-
],
|
|
18
|
-
variants: {
|
|
19
|
-
leftAddon: {
|
|
20
|
-
true: "pl-3"
|
|
21
|
-
},
|
|
22
|
-
rightAddon: {
|
|
23
|
-
true: "pr-3"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}),
|
|
27
|
-
input: cva({
|
|
28
|
-
base: "relative w-full px-3 font-normal leading-6 placeholder-[#727070] !outline-none",
|
|
29
|
-
variants: {
|
|
30
|
-
textAlign: {
|
|
31
|
-
right: "text-right",
|
|
32
|
-
left: ""
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}),
|
|
36
|
-
divider: cx("block h-6 w-px flex-none bg-black")
|
|
37
|
-
};
|
|
38
|
-
function TextField(props) {
|
|
39
|
-
const {
|
|
40
|
-
className,
|
|
41
|
-
description,
|
|
42
|
-
errorMessage,
|
|
43
|
-
label,
|
|
44
|
-
leftAddon,
|
|
45
|
-
isRequired,
|
|
46
|
-
isInvalid: _isInvalid,
|
|
47
|
-
textAlign,
|
|
48
|
-
rightAddon,
|
|
49
|
-
withAddonDivider,
|
|
50
|
-
...restProps
|
|
51
|
-
} = props;
|
|
52
|
-
const isInvalid = _isInvalid || errorMessage != null;
|
|
53
|
-
return /* @__PURE__ */ jsxs(
|
|
54
|
-
TextField$1,
|
|
55
|
-
{
|
|
56
|
-
...restProps,
|
|
57
|
-
className: cx(className, classes.base),
|
|
58
|
-
isInvalid,
|
|
59
|
-
isRequired,
|
|
60
|
-
children: [
|
|
61
|
-
label && /* @__PURE__ */ jsx(Label, { children: label }),
|
|
62
|
-
description && /* @__PURE__ */ jsx(Description, { children: description }),
|
|
63
|
-
/* @__PURE__ */ jsxs(
|
|
64
|
-
"div",
|
|
65
|
-
{
|
|
66
|
-
className: classes.inputWrapper({
|
|
67
|
-
leftAddon: !!leftAddon,
|
|
68
|
-
rightAddon: !!rightAddon
|
|
69
|
-
}),
|
|
70
|
-
children: [
|
|
71
|
-
leftAddon,
|
|
72
|
-
withAddonDivider && leftAddon && /* @__PURE__ */ jsx(Divider, { className: "ml-3" }),
|
|
73
|
-
/* @__PURE__ */ jsx(Input, { className: classes.input({ textAlign }) }),
|
|
74
|
-
withAddonDivider && rightAddon && /* @__PURE__ */ jsx(Divider, { className: "mr-3" }),
|
|
75
|
-
rightAddon
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
errorMessage && /* @__PURE__ */ jsx(ErrorMessage, { children: errorMessage })
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
function Divider({ className }) {
|
|
85
|
-
return /* @__PURE__ */ jsx("span", { className: cx(className, classes.divider) });
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export { TextField };
|