@cognite/aura 1.48556.0 → 1.48565.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/DESIGN.md +9 -5
- package/dist/components/ui/core/input/input.gallery.js +5 -6
- package/dist/components/ui/core/input/input.gallery.js.map +1 -1
- package/dist/components/ui/core/label/examples/label.gallery.js +3 -3
- package/dist/components/ui/core/label/examples/label.gallery.js.map +1 -1
- package/dist/components/ui/core/slider/slider.gallery.js +3 -3
- package/dist/components/ui/core/slider/slider.gallery.js.map +1 -1
- package/dist/components/ui/core/textarea/textarea.gallery.js +2 -4
- package/dist/components/ui/core/textarea/textarea.gallery.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/core/input/input.md +3 -0
- package/src/components/ui/core/label/label.md +16 -0
- package/src/components/ui/core/textarea/textarea.md +3 -0
package/DESIGN.md
CHANGED
|
@@ -598,8 +598,10 @@ Standard layout primitives used across all patterns:
|
|
|
598
598
|
|
|
599
599
|
- space-y-8 — between major page sections (e.g. form groups)
|
|
600
600
|
- space-y-6 — between sections within a page
|
|
601
|
-
- space-y-4 — between items within a section
|
|
602
|
-
|
|
601
|
+
- space-y-4 — between items within a section, including between form fields
|
|
602
|
+
|
|
603
|
+
Do not add `gap-*` or `space-y-*` between a label, its control, and its helper text.
|
|
604
|
+
`Label` includes 8px of padding below the text, and helper text includes 8px of padding above the text.
|
|
603
605
|
|
|
604
606
|
**Grid gaps**
|
|
605
607
|
|
|
@@ -1651,7 +1653,8 @@ Placeholder when there is no data yet or results are empty.
|
|
|
1651
1653
|
**Storybook-slug:** form
|
|
1652
1654
|
|
|
1653
1655
|
**Definition**
|
|
1654
|
-
A
|
|
1656
|
+
A group of fields for collecting structured input.
|
|
1657
|
+
Each field is a `Label`, a control, and optional helper text, and those parts own the spacing between them.
|
|
1655
1658
|
|
|
1656
1659
|
**Use when**
|
|
1657
1660
|
|
|
@@ -1662,7 +1665,7 @@ A structural wrapper for form fields that manages layout, spacing, validation st
|
|
|
1662
1665
|
|
|
1663
1666
|
- Do group semantically related fields together.
|
|
1664
1667
|
- Do associate every field with a `Label`.
|
|
1665
|
-
- Do not
|
|
1668
|
+
- Do not add `gap-*` or `space-y-*` between a `Label`, its control, and its helper text.
|
|
1666
1669
|
|
|
1667
1670
|
**Often used with**
|
|
1668
1671
|
|
|
@@ -1723,7 +1726,7 @@ A flexible list-row primitive for displaying a title, optional description, lead
|
|
|
1723
1726
|
**Use something else when**
|
|
1724
1727
|
|
|
1725
1728
|
- Selecting from predefined options in a dropdown (use `Select` or `Dropdown Menu`).
|
|
1726
|
-
- Displaying form inputs inline (
|
|
1729
|
+
- Displaying form inputs inline (place a `Checkbox`, `Radio`, or `Switch` beside its `Label`).
|
|
1727
1730
|
- Presenting dense tabular data across many columns (use `Table` or `DataGrid`).
|
|
1728
1731
|
|
|
1729
1732
|
**Dos and don'ts**
|
|
@@ -1768,6 +1771,7 @@ A form label that identifies and is programmatically associated with an input fi
|
|
|
1768
1771
|
|
|
1769
1772
|
- Do associate labels with fields via `htmlFor`/`id` for accessibility.
|
|
1770
1773
|
- Do mark required fields consistently (asterisk or explicit text).
|
|
1774
|
+
- Do not add `gap-*` or `space-y-*` between a `Label`, its control, and helper text.
|
|
1771
1775
|
- Do not replace labels with placeholder text — placeholders disappear and are inaccessible.
|
|
1772
1776
|
- Do not hide labels for visual cleanliness; use `Tooltip` to supplement shortened labels.
|
|
1773
1777
|
|
|
@@ -9,7 +9,7 @@ export function InputGallery() {
|
|
|
9
9
|
className: "w-75 space-y-4",
|
|
10
10
|
children: [
|
|
11
11
|
/*#__PURE__*/ _jsxs("div", {
|
|
12
|
-
className: "
|
|
12
|
+
className: "flex w-full flex-col",
|
|
13
13
|
children: [
|
|
14
14
|
/*#__PURE__*/ _jsx(Label, {
|
|
15
15
|
htmlFor: `${id}-default`,
|
|
@@ -22,7 +22,7 @@ export function InputGallery() {
|
|
|
22
22
|
]
|
|
23
23
|
}),
|
|
24
24
|
/*#__PURE__*/ _jsxs("div", {
|
|
25
|
-
className: "
|
|
25
|
+
className: "flex w-full flex-col",
|
|
26
26
|
children: [
|
|
27
27
|
/*#__PURE__*/ _jsx(Label, {
|
|
28
28
|
htmlFor: `${id}-filled`,
|
|
@@ -35,7 +35,7 @@ export function InputGallery() {
|
|
|
35
35
|
]
|
|
36
36
|
}),
|
|
37
37
|
/*#__PURE__*/ _jsxs("div", {
|
|
38
|
-
className: "group
|
|
38
|
+
className: "group flex w-full flex-col",
|
|
39
39
|
"data-disabled": "true",
|
|
40
40
|
children: [
|
|
41
41
|
/*#__PURE__*/ _jsx(Label, {
|
|
@@ -50,7 +50,7 @@ export function InputGallery() {
|
|
|
50
50
|
]
|
|
51
51
|
}),
|
|
52
52
|
/*#__PURE__*/ _jsxs("div", {
|
|
53
|
-
className: "
|
|
53
|
+
className: "flex w-full flex-col",
|
|
54
54
|
children: [
|
|
55
55
|
/*#__PURE__*/ _jsx(Label, {
|
|
56
56
|
htmlFor: `${id}-readonly`,
|
|
@@ -64,7 +64,7 @@ export function InputGallery() {
|
|
|
64
64
|
]
|
|
65
65
|
}),
|
|
66
66
|
/*#__PURE__*/ _jsxs("div", {
|
|
67
|
-
className: "
|
|
67
|
+
className: "flex w-full flex-col",
|
|
68
68
|
children: [
|
|
69
69
|
/*#__PURE__*/ _jsx(Label, {
|
|
70
70
|
htmlFor: `${id}-error`,
|
|
@@ -77,7 +77,6 @@ export function InputGallery() {
|
|
|
77
77
|
}),
|
|
78
78
|
/*#__PURE__*/ _jsx(HelperText, {
|
|
79
79
|
isError: true,
|
|
80
|
-
className: "pt-1",
|
|
81
80
|
children: "Help text"
|
|
82
81
|
})
|
|
83
82
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/input/input.gallery.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { HelperText } from '../helper-text/helper-text';\nimport { Label } from '../label/label';\n\nimport { Input } from './input';\n\nexport function InputGallery(): ReactElement {\n const id = useId();\n\n return (\n <div className=\"w-75 space-y-4\">\n <div className=\"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/input/input.gallery.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { HelperText } from '../helper-text/helper-text';\nimport { Label } from '../label/label';\n\nimport { Input } from './input';\n\nexport function InputGallery(): ReactElement {\n const id = useId();\n\n return (\n <div className=\"w-75 space-y-4\">\n <div className=\"flex w-full flex-col\">\n <Label htmlFor={`${id}-default`}>Default</Label>\n <Input id={`${id}-default`} placeholder=\"Placeholder\" />\n </div>\n <div className=\"flex w-full flex-col\">\n <Label htmlFor={`${id}-filled`}>Filled</Label>\n <Input id={`${id}-filled`} defaultValue=\"Input text\" />\n </div>\n <div className=\"group flex w-full flex-col\" data-disabled=\"true\">\n <Label htmlFor={`${id}-disabled`}>Disabled</Label>\n <Input id={`${id}-disabled`} placeholder=\"Placeholder\" disabled />\n </div>\n <div className=\"flex w-full flex-col\">\n <Label htmlFor={`${id}-readonly`}>Read-only</Label>\n <Input id={`${id}-readonly`} defaultValue=\"Input text\" readOnly />\n </div>\n <div className=\"flex w-full flex-col\">\n <Label htmlFor={`${id}-error`}>Error</Label>\n <Input id={`${id}-error`} placeholder=\"Placeholder\" aria-invalid />\n <HelperText isError>Help text</HelperText>\n </div>\n </div>\n );\n}\n"],"names":["useId","HelperText","Label","Input","InputGallery","id","div","className","htmlFor","placeholder","defaultValue","data-disabled","disabled","readOnly","aria-invalid","isError"],"mappings":";AAAA,SAA4BA,KAAK,QAAQ,QAAQ;AAEjD,SAASC,UAAU,QAAQ,gCAA6B;AACxD,SAASC,KAAK,QAAQ,oBAAiB;AAEvC,SAASC,KAAK,QAAQ,aAAU;AAEhC,OAAO,SAASC;IACd,MAAMC,KAAKL;IAEX,qBACE,MAACM;QAAIC,WAAU;;0BACb,MAACD;gBAAIC,WAAU;;kCACb,KAACL;wBAAMM,SAAS,GAAGH,GAAG,QAAQ,CAAC;kCAAE;;kCACjC,KAACF;wBAAME,IAAI,GAAGA,GAAG,QAAQ,CAAC;wBAAEI,aAAY;;;;0BAE1C,MAACH;gBAAIC,WAAU;;kCACb,KAACL;wBAAMM,SAAS,GAAGH,GAAG,OAAO,CAAC;kCAAE;;kCAChC,KAACF;wBAAME,IAAI,GAAGA,GAAG,OAAO,CAAC;wBAAEK,cAAa;;;;0BAE1C,MAACJ;gBAAIC,WAAU;gBAA6BI,iBAAc;;kCACxD,KAACT;wBAAMM,SAAS,GAAGH,GAAG,SAAS,CAAC;kCAAE;;kCAClC,KAACF;wBAAME,IAAI,GAAGA,GAAG,SAAS,CAAC;wBAAEI,aAAY;wBAAcG,QAAQ;;;;0BAEjE,MAACN;gBAAIC,WAAU;;kCACb,KAACL;wBAAMM,SAAS,GAAGH,GAAG,SAAS,CAAC;kCAAE;;kCAClC,KAACF;wBAAME,IAAI,GAAGA,GAAG,SAAS,CAAC;wBAAEK,cAAa;wBAAaG,QAAQ;;;;0BAEjE,MAACP;gBAAIC,WAAU;;kCACb,KAACL;wBAAMM,SAAS,GAAGH,GAAG,MAAM,CAAC;kCAAE;;kCAC/B,KAACF;wBAAME,IAAI,GAAGA,GAAG,MAAM,CAAC;wBAAEI,aAAY;wBAAcK,cAAY;;kCAChE,KAACb;wBAAWc,OAAO;kCAAC;;;;;;AAI5B"}
|
|
@@ -8,7 +8,7 @@ export function LabelGallery() {
|
|
|
8
8
|
className: "w-75 space-y-4",
|
|
9
9
|
children: [
|
|
10
10
|
/*#__PURE__*/ _jsxs("div", {
|
|
11
|
-
className: "
|
|
11
|
+
className: "flex w-full flex-col",
|
|
12
12
|
children: [
|
|
13
13
|
/*#__PURE__*/ _jsx(Label, {
|
|
14
14
|
htmlFor: `${id}-name`,
|
|
@@ -21,7 +21,7 @@ export function LabelGallery() {
|
|
|
21
21
|
]
|
|
22
22
|
}),
|
|
23
23
|
/*#__PURE__*/ _jsxs("div", {
|
|
24
|
-
className: "
|
|
24
|
+
className: "flex w-full flex-col",
|
|
25
25
|
children: [
|
|
26
26
|
/*#__PURE__*/ _jsx(Label, {
|
|
27
27
|
htmlFor: `${id}-email`,
|
|
@@ -36,7 +36,7 @@ export function LabelGallery() {
|
|
|
36
36
|
]
|
|
37
37
|
}),
|
|
38
38
|
/*#__PURE__*/ _jsxs("div", {
|
|
39
|
-
className: "group
|
|
39
|
+
className: "group flex w-full flex-col",
|
|
40
40
|
"data-disabled": "true",
|
|
41
41
|
children: [
|
|
42
42
|
/*#__PURE__*/ _jsx(Label, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/ui/core/label/examples/label.gallery.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { Input } from '../../input/input';\nimport { Label } from '../label';\n\nexport function LabelGallery(): ReactElement {\n const id = useId();\n\n return (\n <div className=\"w-75 space-y-4\">\n <div className=\"
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/label/examples/label.gallery.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { Input } from '../../input/input';\nimport { Label } from '../label';\n\nexport function LabelGallery(): ReactElement {\n const id = useId();\n\n return (\n <div className=\"w-75 space-y-4\">\n <div className=\"flex w-full flex-col\">\n <Label htmlFor={`${id}-name`}>Name</Label>\n <Input id={`${id}-name`} placeholder=\"Enter name\" />\n </div>\n <div className=\"flex w-full flex-col\">\n <Label htmlFor={`${id}-email`} required>\n Email address\n </Label>\n <Input id={`${id}-email`} type=\"email\" required />\n </div>\n <div className=\"group flex w-full flex-col\" data-disabled=\"true\">\n <Label htmlFor={`${id}-workspace`}>Workspace</Label>\n <Input id={`${id}-workspace`} defaultValue=\"Default\" disabled />\n </div>\n </div>\n );\n}\n"],"names":["useId","Input","Label","LabelGallery","id","div","className","htmlFor","placeholder","required","type","data-disabled","defaultValue","disabled"],"mappings":";AAAA,SAA4BA,KAAK,QAAQ,QAAQ;AAEjD,SAASC,KAAK,QAAQ,uBAAoB;AAC1C,SAASC,KAAK,QAAQ,cAAW;AAEjC,OAAO,SAASC;IACd,MAAMC,KAAKJ;IAEX,qBACE,MAACK;QAAIC,WAAU;;0BACb,MAACD;gBAAIC,WAAU;;kCACb,KAACJ;wBAAMK,SAAS,GAAGH,GAAG,KAAK,CAAC;kCAAE;;kCAC9B,KAACH;wBAAMG,IAAI,GAAGA,GAAG,KAAK,CAAC;wBAAEI,aAAY;;;;0BAEvC,MAACH;gBAAIC,WAAU;;kCACb,KAACJ;wBAAMK,SAAS,GAAGH,GAAG,MAAM,CAAC;wBAAEK,QAAQ;kCAAC;;kCAGxC,KAACR;wBAAMG,IAAI,GAAGA,GAAG,MAAM,CAAC;wBAAEM,MAAK;wBAAQD,QAAQ;;;;0BAEjD,MAACJ;gBAAIC,WAAU;gBAA6BK,iBAAc;;kCACxD,KAACT;wBAAMK,SAAS,GAAGH,GAAG,UAAU,CAAC;kCAAE;;kCACnC,KAACH;wBAAMG,IAAI,GAAGA,GAAG,UAAU,CAAC;wBAAEQ,cAAa;wBAAUC,QAAQ;;;;;;AAIrE"}
|
|
@@ -8,7 +8,7 @@ export function SliderGallery() {
|
|
|
8
8
|
className: "w-80 space-y-6",
|
|
9
9
|
children: [
|
|
10
10
|
/*#__PURE__*/ _jsxs("div", {
|
|
11
|
-
className: "
|
|
11
|
+
className: "flex flex-col",
|
|
12
12
|
children: [
|
|
13
13
|
/*#__PURE__*/ _jsx(Label, {
|
|
14
14
|
id: `${id}-volume`,
|
|
@@ -23,7 +23,7 @@ export function SliderGallery() {
|
|
|
23
23
|
]
|
|
24
24
|
}),
|
|
25
25
|
/*#__PURE__*/ _jsxs("div", {
|
|
26
|
-
className: "
|
|
26
|
+
className: "flex flex-col",
|
|
27
27
|
children: [
|
|
28
28
|
/*#__PURE__*/ _jsx(Label, {
|
|
29
29
|
id: `${id}-price`,
|
|
@@ -39,7 +39,7 @@ export function SliderGallery() {
|
|
|
39
39
|
]
|
|
40
40
|
}),
|
|
41
41
|
/*#__PURE__*/ _jsxs("div", {
|
|
42
|
-
className: "group
|
|
42
|
+
className: "group flex flex-col",
|
|
43
43
|
"data-disabled": "true",
|
|
44
44
|
children: [
|
|
45
45
|
/*#__PURE__*/ _jsx(Label, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/slider/slider.gallery.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { Label } from '../label/label';\n\nimport { Slider } from './slider';\n\nexport function SliderGallery(): ReactElement {\n const id = useId();\n\n return (\n <div className=\"w-80 space-y-6\">\n <div className=\"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/slider/slider.gallery.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { Label } from '../label/label';\n\nimport { Slider } from './slider';\n\nexport function SliderGallery(): ReactElement {\n const id = useId();\n\n return (\n <div className=\"w-80 space-y-6\">\n <div className=\"flex flex-col\">\n <Label id={`${id}-volume`}>Volume</Label>\n <Slider defaultValue={[50]} aria-labelledby={`${id}-volume`} />\n </div>\n <div className=\"flex flex-col\">\n <Label id={`${id}-price`}>Price range</Label>\n <Slider defaultValue={[20, 80]} aria-labelledby={`${id}-price`} />\n </div>\n <div className=\"group flex flex-col\" data-disabled=\"true\">\n <Label id={`${id}-brightness`}>Brightness</Label>\n <Slider\n defaultValue={[30]}\n aria-labelledby={`${id}-brightness`}\n disabled\n />\n </div>\n </div>\n );\n}\n"],"names":["useId","Label","Slider","SliderGallery","id","div","className","defaultValue","aria-labelledby","data-disabled","disabled"],"mappings":";AAAA,SAA4BA,KAAK,QAAQ,QAAQ;AAEjD,SAASC,KAAK,QAAQ,oBAAiB;AAEvC,SAASC,MAAM,QAAQ,cAAW;AAElC,OAAO,SAASC;IACd,MAAMC,KAAKJ;IAEX,qBACE,MAACK;QAAIC,WAAU;;0BACb,MAACD;gBAAIC,WAAU;;kCACb,KAACL;wBAAMG,IAAI,GAAGA,GAAG,OAAO,CAAC;kCAAE;;kCAC3B,KAACF;wBAAOK,cAAc;4BAAC;yBAAG;wBAAEC,mBAAiB,GAAGJ,GAAG,OAAO,CAAC;;;;0BAE7D,MAACC;gBAAIC,WAAU;;kCACb,KAACL;wBAAMG,IAAI,GAAGA,GAAG,MAAM,CAAC;kCAAE;;kCAC1B,KAACF;wBAAOK,cAAc;4BAAC;4BAAI;yBAAG;wBAAEC,mBAAiB,GAAGJ,GAAG,MAAM,CAAC;;;;0BAEhE,MAACC;gBAAIC,WAAU;gBAAsBG,iBAAc;;kCACjD,KAACR;wBAAMG,IAAI,GAAGA,GAAG,WAAW,CAAC;kCAAE;;kCAC/B,KAACF;wBACCK,cAAc;4BAAC;yBAAG;wBAClBC,mBAAiB,GAAGJ,GAAG,WAAW,CAAC;wBACnCM,QAAQ;;;;;;AAKlB"}
|
|
@@ -9,7 +9,7 @@ export function TextareaGallery() {
|
|
|
9
9
|
className: "w-88 space-y-4",
|
|
10
10
|
children: [
|
|
11
11
|
/*#__PURE__*/ _jsxs("div", {
|
|
12
|
-
className: "
|
|
12
|
+
className: "flex w-full flex-col",
|
|
13
13
|
children: [
|
|
14
14
|
/*#__PURE__*/ _jsx(Label, {
|
|
15
15
|
htmlFor: `${id}-message`,
|
|
@@ -20,13 +20,12 @@ export function TextareaGallery() {
|
|
|
20
20
|
placeholder: "Type your message here..."
|
|
21
21
|
}),
|
|
22
22
|
/*#__PURE__*/ _jsx(HelperText, {
|
|
23
|
-
className: "pt-2",
|
|
24
23
|
children: "Visible to everyone on the team."
|
|
25
24
|
})
|
|
26
25
|
]
|
|
27
26
|
}),
|
|
28
27
|
/*#__PURE__*/ _jsxs("div", {
|
|
29
|
-
className: "
|
|
28
|
+
className: "flex w-full flex-col",
|
|
30
29
|
children: [
|
|
31
30
|
/*#__PURE__*/ _jsx(Label, {
|
|
32
31
|
htmlFor: `${id}-comments`,
|
|
@@ -38,7 +37,6 @@ export function TextareaGallery() {
|
|
|
38
37
|
"aria-invalid": true
|
|
39
38
|
}),
|
|
40
39
|
/*#__PURE__*/ _jsx(HelperText, {
|
|
41
|
-
className: "pt-2",
|
|
42
40
|
isError: true,
|
|
43
41
|
children: "Enter at least 20 characters."
|
|
44
42
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/textarea/textarea.gallery.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { HelperText } from '../helper-text/helper-text';\nimport { Label } from '../label/label';\n\nimport { Textarea } from './textarea';\n\nexport function TextareaGallery(): ReactElement {\n const id = useId();\n\n return (\n <div className=\"w-88 space-y-4\">\n <div className=\"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/textarea/textarea.gallery.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { HelperText } from '../helper-text/helper-text';\nimport { Label } from '../label/label';\n\nimport { Textarea } from './textarea';\n\nexport function TextareaGallery(): ReactElement {\n const id = useId();\n\n return (\n <div className=\"w-88 space-y-4\">\n <div className=\"flex w-full flex-col\">\n <Label htmlFor={`${id}-message`}>Your message</Label>\n <Textarea\n id={`${id}-message`}\n placeholder=\"Type your message here...\"\n />\n <HelperText>Visible to everyone on the team.</HelperText>\n </div>\n <div className=\"flex w-full flex-col\">\n <Label htmlFor={`${id}-comments`}>Comments</Label>\n <Textarea id={`${id}-comments`} defaultValue=\"Too short\" aria-invalid />\n <HelperText isError>Enter at least 20 characters.</HelperText>\n </div>\n </div>\n );\n}\n"],"names":["useId","HelperText","Label","Textarea","TextareaGallery","id","div","className","htmlFor","placeholder","defaultValue","aria-invalid","isError"],"mappings":";AAAA,SAA4BA,KAAK,QAAQ,QAAQ;AAEjD,SAASC,UAAU,QAAQ,gCAA6B;AACxD,SAASC,KAAK,QAAQ,oBAAiB;AAEvC,SAASC,QAAQ,QAAQ,gBAAa;AAEtC,OAAO,SAASC;IACd,MAAMC,KAAKL;IAEX,qBACE,MAACM;QAAIC,WAAU;;0BACb,MAACD;gBAAIC,WAAU;;kCACb,KAACL;wBAAMM,SAAS,GAAGH,GAAG,QAAQ,CAAC;kCAAE;;kCACjC,KAACF;wBACCE,IAAI,GAAGA,GAAG,QAAQ,CAAC;wBACnBI,aAAY;;kCAEd,KAACR;kCAAW;;;;0BAEd,MAACK;gBAAIC,WAAU;;kCACb,KAACL;wBAAMM,SAAS,GAAGH,GAAG,SAAS,CAAC;kCAAE;;kCAClC,KAACF;wBAASE,IAAI,GAAGA,GAAG,SAAS,CAAC;wBAAEK,cAAa;wBAAYC,cAAY;;kCACrE,KAACV;wBAAWW,OAAO;kCAAC;;;;;;AAI5B"}
|
package/package.json
CHANGED
|
@@ -16,6 +16,9 @@ Use an Input to capture short, single-line text in forms and toolbars.
|
|
|
16
16
|
## Content
|
|
17
17
|
|
|
18
18
|
- Give every Input a visible [Label](?path=/docs/primitives-label--docs).
|
|
19
|
+
- Do not add `gap-*` or `space-y-*` between the Label, the Input, and helper text.
|
|
20
|
+
The Label and helper text already include that spacing.
|
|
21
|
+
See [Label layout](?path=/docs/primitives-label--docs).
|
|
19
22
|
- Use placeholder text only for a short example of the expected format.
|
|
20
23
|
- Set `type` to match the data, such as `email`, `number`, `tel`, or `url`, so browsers offer the right keyboard and autofill.
|
|
21
24
|
|
|
@@ -12,6 +12,22 @@ Labels are not intended as general-purpose text.
|
|
|
12
12
|
- Use [Helper Text](?path=/docs/primitives-helper-text--docs) for descriptive text below a field.
|
|
13
13
|
- Use plain text or a [Badge](?path=/docs/primitives-badge--docs) for non-interactive elements such as status indicators.
|
|
14
14
|
|
|
15
|
+
## Layout
|
|
16
|
+
|
|
17
|
+
`Label` includes 8px of padding below the text.
|
|
18
|
+
Helper text includes 8px of padding above the text.
|
|
19
|
+
Do not add `gap-*` or `space-y-*` between a Label, its field, and its helper text.
|
|
20
|
+
When a field needs a wrapper, use `flex flex-col` with no gap.
|
|
21
|
+
Separate fields with `space-y-4`.
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<div className="flex flex-col">
|
|
25
|
+
<Label htmlFor="name">Name</Label>
|
|
26
|
+
<Input id="name" />
|
|
27
|
+
<HelperText>Shown on your profile.</HelperText>
|
|
28
|
+
</div>
|
|
29
|
+
```
|
|
30
|
+
|
|
15
31
|
## Required fields
|
|
16
32
|
|
|
17
33
|
- Set `required` on the Label to show the required asterisk.
|
|
@@ -15,6 +15,9 @@ Use a Textarea for extended, free-form, multi-line input such as comments, feedb
|
|
|
15
15
|
## Content
|
|
16
16
|
|
|
17
17
|
- Give every Textarea a visible [Label](?path=/docs/primitives-label--docs).
|
|
18
|
+
- Do not add `gap-*` or `space-y-*` between the Label, the Textarea, and helper text.
|
|
19
|
+
The Label and helper text already include that spacing.
|
|
20
|
+
See [Label layout](?path=/docs/primitives-label--docs).
|
|
18
21
|
- Keep placeholder text concise and use it for an example, not instructions the user needs later.
|
|
19
22
|
- Show a character count in helper text when there is a length limit.
|
|
20
23
|
|