@uva-glass/component-library 3.7.0 → 3.8.0
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/assets/FormField.css +1 -1
- package/dist/components/FormField/FormField.d.ts +3 -1
- package/dist/components/FormField/FormField.js +15 -13
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/FormField/FormField.stories.js +19 -15
- package/dist/components/FormField/FormField.stories.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
._form-
|
|
1
|
+
._form-field_hcyqx_1{display:flex;flex-direction:column;gap:.5rem 1rem}._form-field--outerspace_hcyqx_7{margin:1.5rem 0}._form-field--inline_hcyqx_11{align-items:center;flex-direction:row}._form-field--align-start_hcyqx_16{align-items:flex-start}
|
|
@@ -4,6 +4,8 @@ export interface FormFieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
4
4
|
outerSpace?: boolean;
|
|
5
5
|
/** true if the label and input field should be rendered on the same row; otherwise, false. The default is false. */
|
|
6
6
|
inline?: boolean;
|
|
7
|
+
/** to be used in combination with 'inline'; true if the label and input field should be rendered on start of the same row; otherwise, false. The default is false. */
|
|
8
|
+
alignStart?: boolean;
|
|
7
9
|
}
|
|
8
10
|
/** Represents an element to wrap a label and input field. */
|
|
9
|
-
export declare const FormField: ({ children, outerSpace, inline, ...rest }: PropsWithChildren<FormFieldProps>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const FormField: ({ children, outerSpace, inline, alignStart, ...rest }: PropsWithChildren<FormFieldProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/FormField.css';const
|
|
4
|
-
"form-field": "_form-
|
|
5
|
-
"form-field--outerspace": "_form-field--
|
|
6
|
-
"form-field--inline": "_form-field--
|
|
7
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as s } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import '../../assets/FormField.css';const f = {
|
|
4
|
+
"form-field": "_form-field_hcyqx_1",
|
|
5
|
+
"form-field--outerspace": "_form-field--outerspace_hcyqx_7",
|
|
6
|
+
"form-field--inline": "_form-field--inline_hcyqx_11",
|
|
7
|
+
"form-field--align-start": "_form-field--align-start_hcyqx_16"
|
|
8
|
+
}, a = ({ children: e, outerSpace: i, inline: r, alignStart: o, ...l }) => /* @__PURE__ */ m(
|
|
8
9
|
"div",
|
|
9
10
|
{
|
|
10
|
-
className:
|
|
11
|
-
[
|
|
12
|
-
[
|
|
11
|
+
className: s(f["form-field"], {
|
|
12
|
+
[f["form-field--outerspace"]]: i,
|
|
13
|
+
[f["form-field--inline"]]: r,
|
|
14
|
+
[f["form-field--align-start"]]: o
|
|
13
15
|
}),
|
|
14
|
-
...
|
|
15
|
-
children:
|
|
16
|
+
...l,
|
|
17
|
+
children: e
|
|
16
18
|
}
|
|
17
19
|
);
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
a as FormField
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=FormField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.js","sources":["../../../src/components/FormField/FormField.tsx"],"sourcesContent":["import classNames from 'clsx';\n\nimport type { HTMLAttributes, PropsWithChildren } from 'react';\n\nimport styles from './FormField.module.css';\n\nexport interface FormFieldProps extends HTMLAttributes<HTMLDivElement> {\n /** true if a margin at the top and bottom should be added; otherwise, false. The default is false. */\n outerSpace?: boolean;\n /** true if the label and input field should be rendered on the same row; otherwise, false. The default is false. */\n inline?: boolean;\n}\n\n/** Represents an element to wrap a label and input field. */\nexport const FormField = ({ children, outerSpace, inline, ...rest }: PropsWithChildren<FormFieldProps>) => (\n <div\n className={classNames(styles['form-field'], {\n [styles['form-field--outerspace']]: outerSpace,\n [styles['form-field--inline']]: inline,\n })}\n {...rest}\n >\n {children}\n </div>\n);\n"],"names":["FormField","children","outerSpace","inline","rest","jsx","classNames","styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormField.js","sources":["../../../src/components/FormField/FormField.tsx"],"sourcesContent":["import classNames from 'clsx';\n\nimport type { HTMLAttributes, PropsWithChildren } from 'react';\n\nimport styles from './FormField.module.css';\n\nexport interface FormFieldProps extends HTMLAttributes<HTMLDivElement> {\n /** true if a margin at the top and bottom should be added; otherwise, false. The default is false. */\n outerSpace?: boolean;\n /** true if the label and input field should be rendered on the same row; otherwise, false. The default is false. */\n inline?: boolean;\n /** to be used in combination with 'inline'; true if the label and input field should be rendered on start of the same row; otherwise, false. The default is false. */\n alignStart?: boolean;\n}\n\n/** Represents an element to wrap a label and input field. */\nexport const FormField = ({ children, outerSpace, inline, alignStart, ...rest }: PropsWithChildren<FormFieldProps>) => (\n <div\n className={classNames(styles['form-field'], {\n [styles['form-field--outerspace']]: outerSpace,\n [styles['form-field--inline']]: inline,\n [styles['form-field--align-start']]: alignStart,\n })}\n {...rest}\n >\n {children}\n </div>\n);\n"],"names":["FormField","children","outerSpace","inline","alignStart","rest","jsx","classNames","styles"],"mappings":";;;;;;;GAgBaA,IAAY,CAAC,EAAE,UAAAC,GAAU,YAAAC,GAAY,QAAAC,GAAQ,YAAAC,GAAY,GAAGC,EAAA,MACvE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAWC,EAAO,YAAY,GAAG;AAAA,MAC1C,CAACA,EAAO,wBAAwB,CAAC,GAAGN;AAAA,MACpC,CAACM,EAAO,oBAAoB,CAAC,GAAGL;AAAA,MAChC,CAACK,EAAO,yBAAyB,CAAC,GAAGJ;AAAA,IAAA,CACtC;AAAA,IACA,GAAGC;AAAA,IAEH,UAAAJ;AAAA,EAAA;AACH;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { FormField as o } from "./FormField.js";
|
|
3
3
|
import { InputField as t } from "../InputField/InputField.js";
|
|
4
|
-
import { Label as
|
|
5
|
-
import { Container as
|
|
6
|
-
const
|
|
4
|
+
import { Label as n } from "../Label/Label.js";
|
|
5
|
+
import { Container as a } from "../../storyComponents/Container/Container.js";
|
|
6
|
+
const i = "<FormField>{children}</FormField>", h = {
|
|
7
7
|
title: "Atoms/FormField",
|
|
8
8
|
component: o,
|
|
9
9
|
argTypes: {
|
|
@@ -12,30 +12,34 @@ const a = "<FormField>{children}</FormField>", b = {
|
|
|
12
12
|
},
|
|
13
13
|
inline: {
|
|
14
14
|
control: "boolean"
|
|
15
|
+
},
|
|
16
|
+
alignStart: {
|
|
17
|
+
control: "boolean"
|
|
15
18
|
}
|
|
16
19
|
},
|
|
17
20
|
parameters: {
|
|
18
21
|
inspectComponent: o,
|
|
19
|
-
codeString:
|
|
22
|
+
codeString: i
|
|
20
23
|
}
|
|
21
|
-
}, m = (
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */ e(
|
|
24
|
+
}, m = (r) => /* @__PURE__ */ l(a, { children: [
|
|
25
|
+
/* @__PURE__ */ l(o, { ...r, children: [
|
|
26
|
+
/* @__PURE__ */ e(n, { htmlFor: "d6aa53fd", children: "Example label" }),
|
|
24
27
|
/* @__PURE__ */ e(t, { id: "d6aa53fd" })
|
|
25
28
|
] }),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */ e(
|
|
29
|
+
/* @__PURE__ */ l(o, { ...r, children: [
|
|
30
|
+
/* @__PURE__ */ e(n, { htmlFor: "4e7a2f22", children: "Example very very very long label to display input alingment compared to label" }),
|
|
28
31
|
/* @__PURE__ */ e(t, { id: "4e7a2f22" })
|
|
29
32
|
] })
|
|
30
33
|
] }), d = {
|
|
31
34
|
outerSpace: !1,
|
|
32
|
-
inline: !1
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
inline: !1,
|
|
36
|
+
alignStart: !1
|
|
37
|
+
}, p = m.bind({});
|
|
38
|
+
p.args = {
|
|
35
39
|
...d
|
|
36
40
|
};
|
|
37
41
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
p as FormFieldExample,
|
|
43
|
+
h as default
|
|
40
44
|
};
|
|
41
45
|
//# sourceMappingURL=FormField.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.stories.js","sources":["../../../src/components/FormField/FormField.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { PropsWithChildren } from 'react';\nimport type { FormFieldProps } from './FormField';\n\nimport { FormField } from './FormField';\n\nimport { InputField } from 'components/InputField';\nimport { Label } from 'components/Label';\nimport { Container } from 'storyComponents/Container';\n\nconst codeString = '<FormField>{children}</FormField>';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/FormField',\n component: FormField,\n argTypes: {\n outerSpace: {\n control: 'boolean',\n },\n inline: {\n control: 'boolean',\n },\n },\n parameters: {\n inspectComponent: FormField,\n codeString: codeString,\n },\n} as Meta<PropsWithChildren<FormFieldProps>>;\n\nconst Template: StoryFn<PropsWithChildren<FormFieldProps>> = (args) => (\n <Container>\n <FormField {...args}>\n <Label htmlFor=\"d6aa53fd\">Example label
|
|
1
|
+
{"version":3,"file":"FormField.stories.js","sources":["../../../src/components/FormField/FormField.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { PropsWithChildren } from 'react';\nimport type { FormFieldProps } from './FormField';\n\nimport { FormField } from './FormField';\n\nimport { InputField } from 'components/InputField';\nimport { Label } from 'components/Label';\nimport { Container } from 'storyComponents/Container';\n\nconst codeString = '<FormField>{children}</FormField>';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/FormField',\n component: FormField,\n argTypes: {\n outerSpace: {\n control: 'boolean',\n },\n inline: {\n control: 'boolean',\n },\n alignStart: {\n control: 'boolean',\n },\n },\n parameters: {\n inspectComponent: FormField,\n codeString: codeString,\n },\n} as Meta<PropsWithChildren<FormFieldProps>>;\n\nconst Template: StoryFn<PropsWithChildren<FormFieldProps>> = (args) => (\n <Container>\n <FormField {...args}>\n <Label htmlFor=\"d6aa53fd\">Example label</Label>\n <InputField id=\"d6aa53fd\" />\n </FormField>\n <FormField {...args}>\n <Label htmlFor=\"4e7a2f22\">Example very very very long label to display input alingment compared to label</Label>\n <InputField id=\"4e7a2f22\" />\n </FormField>\n </Container>\n);\n\nconst defaultArgs: Partial<PropsWithChildren<FormFieldProps>> = {\n outerSpace: false,\n inline: false,\n alignStart: false,\n};\n\nexport const FormFieldExample = Template.bind({});\nFormFieldExample.args = {\n ...defaultArgs,\n};\n"],"names":["codeString","FormField_stories","FormField","Template","args","jsxs","Container","jsx","Label","InputField","defaultArgs","FormFieldExample"],"mappings":";;;;;AAUA,MAAMA,IAAa,qCAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,YAAY;AAAA,MACV,SAAS;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACV,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAAuD,CAACC,MAC5D,gBAAAC,EAACC,GACC,EAAA,UAAA;AAAA,EAAC,gBAAAD,EAAAH,GAAA,EAAW,GAAGE,GACb,UAAA;AAAA,IAAC,gBAAAG,EAAAC,GAAA,EAAM,SAAQ,YAAW,UAAa,iBAAA;AAAA,IACvC,gBAAAD,EAACE,GAAW,EAAA,IAAG,WAAW,CAAA;AAAA,EAAA,GAC5B;AAAA,EACA,gBAAAJ,EAACH,GAAW,EAAA,GAAGE,GACb,UAAA;AAAA,IAAC,gBAAAG,EAAAC,GAAA,EAAM,SAAQ,YAAW,UAA8E,kFAAA;AAAA,IACxG,gBAAAD,EAACE,GAAW,EAAA,IAAG,WAAW,CAAA;AAAA,EAAA,EAC5B,CAAA;AAAA,GACF,GAGIC,IAA0D;AAAA,EAC9D,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,YAAY;AACd,GAEaC,IAAmBR,EAAS,KAAK,CAAE,CAAA;AAChDQ,EAAiB,OAAO;AAAA,EACtB,GAAGD;AACL;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uva-glass/component-library",
|
|
3
3
|
"author": "Team Glass - Frontend vrienden",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.8.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@testing-library/react": "^16.3.0",
|
|
66
66
|
"@types/jest": "^29.5.14",
|
|
67
67
|
"@types/node": "^22.14.0",
|
|
68
|
-
"@types/react-dom": "^19.1.
|
|
68
|
+
"@types/react-dom": "^19.1.2",
|
|
69
69
|
"@types/react": "^19.1.0",
|
|
70
70
|
"@uva-glass/eslint-config": "^1.3.10",
|
|
71
71
|
"@uva-glass/stylelint-config": "^1.2.2",
|
|
@@ -95,11 +95,11 @@
|
|
|
95
95
|
"ts-node": "^10.9.2",
|
|
96
96
|
"typescript": "^5.8.3",
|
|
97
97
|
"vite-plugin-dts": "^4.5.3",
|
|
98
|
-
"vite-plugin-lib-inject-css": "^2.2.
|
|
99
|
-
"vite-plugin-static-copy": "^2.3.
|
|
98
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
99
|
+
"vite-plugin-static-copy": "^2.3.1",
|
|
100
100
|
"vite-plugin-svgr": "^4.3.0",
|
|
101
101
|
"vite-tsconfig-paths": "^5.1.4",
|
|
102
|
-
"vite": "^6.2.
|
|
102
|
+
"vite": "^6.2.6"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
105
|
"@babel/preset-env": "^7.26.9",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
},
|
|
114
114
|
"optionalDependencies": {
|
|
115
115
|
"@rollup/rollup-linux-x64-gnu": "^4.39.0",
|
|
116
|
-
"@rspack/binding-darwin-arm64": "1.3.
|
|
117
|
-
"@rspack/binding-linux-x64-gnu": "1.3.
|
|
116
|
+
"@rspack/binding-darwin-arm64": "1.3.4",
|
|
117
|
+
"@rspack/binding-linux-x64-gnu": "1.3.4",
|
|
118
118
|
"@ast-grep/napi-linux-x64-gnu": "0.36.2"
|
|
119
119
|
}
|
|
120
120
|
}
|