@obosbbl/grunnmuren-react 2.0.0-canary.0 → 2.0.0-canary.2
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 +27 -0
- package/dist/index.d.mts +228 -0
- package/dist/index.mjs +585 -0
- package/dist/useClientLayoutEffect-client-2_5nawgR.js +9 -0
- package/package.json +7 -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
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { TextFieldProps as TextFieldProps$1 } from 'react-aria-components';
|
|
3
|
-
|
|
4
|
-
type TextFieldProps = {
|
|
5
|
-
/** Additional CSS className for the element. */
|
|
6
|
-
className?: string;
|
|
7
|
-
/** Help text for the form control. */
|
|
8
|
-
description?: React.ReactNode;
|
|
9
|
-
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
10
|
-
errorMessage?: React.ReactNode;
|
|
11
|
-
/** Element to be rendered in the left side of the input. */
|
|
12
|
-
leftAddon?: React.ReactNode;
|
|
13
|
-
/** Label for the form control. */
|
|
14
|
-
label?: React.ReactNode;
|
|
15
|
-
/** Element to be rendered in the right side of the input. */
|
|
16
|
-
rightAddon?: React.ReactNode;
|
|
17
|
-
/** Placeholder text. Only visible when the input value is empty. */
|
|
18
|
-
placeholder?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Text alignment of the input
|
|
21
|
-
* @default left
|
|
22
|
-
*/
|
|
23
|
-
textAlign?: 'left' | 'right';
|
|
24
|
-
/** Additional style properties for the element. */
|
|
25
|
-
style?: React.CSSProperties;
|
|
26
|
-
/** Add a divider between the left/right addons and the input */
|
|
27
|
-
withAddonDivider?: boolean;
|
|
28
|
-
} & Omit<TextFieldProps$1, 'className' | 'isReadOnly' | 'isDisabled' | 'children' | 'style'>;
|
|
29
|
-
declare function TextField(props: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
30
|
-
|
|
31
|
-
export { TextField, type TextFieldProps };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { TextFieldProps as TextFieldProps$1 } from 'react-aria-components';
|
|
3
|
-
|
|
4
|
-
type TextFieldProps = {
|
|
5
|
-
/** Additional CSS className for the element. */
|
|
6
|
-
className?: string;
|
|
7
|
-
/** Help text for the form control. */
|
|
8
|
-
description?: React.ReactNode;
|
|
9
|
-
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
10
|
-
errorMessage?: React.ReactNode;
|
|
11
|
-
/** Element to be rendered in the left side of the input. */
|
|
12
|
-
leftAddon?: React.ReactNode;
|
|
13
|
-
/** Label for the form control. */
|
|
14
|
-
label?: React.ReactNode;
|
|
15
|
-
/** Element to be rendered in the right side of the input. */
|
|
16
|
-
rightAddon?: React.ReactNode;
|
|
17
|
-
/** Placeholder text. Only visible when the input value is empty. */
|
|
18
|
-
placeholder?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Text alignment of the input
|
|
21
|
-
* @default left
|
|
22
|
-
*/
|
|
23
|
-
textAlign?: 'left' | 'right';
|
|
24
|
-
/** Additional style properties for the element. */
|
|
25
|
-
style?: React.CSSProperties;
|
|
26
|
-
/** Add a divider between the left/right addons and the input */
|
|
27
|
-
withAddonDivider?: boolean;
|
|
28
|
-
} & Omit<TextFieldProps$1, 'className' | 'isReadOnly' | 'isDisabled' | 'children' | 'style'>;
|
|
29
|
-
declare function TextField(props: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
30
|
-
|
|
31
|
-
export { TextField, type TextFieldProps };
|
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 };
|