grommet 2.43.0 → 2.44.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/all/stories/AllComponents.js +7 -2
- package/components/Box/stories/Background.js +1 -1
- package/components/Button/stories/CustomThemed/Typescript.tsx +1 -1
- package/components/Button/stories/Kind.js +6 -10
- package/components/Calendar/Calendar.js +15 -8
- package/components/Calendar/StyledCalendar.js +6 -5
- package/components/Calendar/index.d.ts +1 -0
- package/components/Calendar/propTypes.js +1 -0
- package/components/Calendar/stories/DaylightSavings.js +1 -1
- package/components/Calendar/stories/HeaderLevel.js +36 -0
- package/components/Calendar/stories/ShowAdjacentDays.js +3 -2
- package/components/Card/stories/CustomThemed/Clickable.js +2 -2
- package/components/Card/stories/CustomThemed/Stacked.js +2 -2
- package/components/Card/stories/CustomThemed/Themed.js +4 -4
- package/components/Cards/stories/Children.js +2 -2
- package/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/components/DataChart/Detail.js +55 -25
- package/components/DataChart/Legend.js +1 -0
- package/components/DataTable/Body.js +16 -2
- package/components/DataTable/stories/CustomThemed/Fill.js +1 -0
- package/components/Drop/stories/CustomThemed/Lazy.js +4 -4
- package/components/Drop/stories/CustomThemed/Themed.js +1 -1
- package/components/Form/stories/AggregateValidation.js +5 -2
- package/components/Form/stories/ArrayOfFormFields.js +19 -6
- package/components/Form/stories/Controlled.js +8 -1
- package/components/Form/stories/ControlledInput.js +8 -1
- package/components/Form/stories/ControlledInputLazy.js +5 -1
- package/components/Form/stories/ControlledLazy.js +5 -1
- package/components/Form/stories/CustomThemed/Custom.js +17 -1
- package/components/Form/stories/CustomThemed/FieldSpacingOptions.js +36 -36
- package/components/Form/stories/CustomThemed/RequiredLabel.js +3 -0
- package/components/Form/stories/CustomThemed/Themed.js +2 -2
- package/components/Form/stories/DynamicFields.js +9 -2
- package/components/Form/stories/FieldWithChildren.js +6 -1
- package/components/Form/stories/TriggerValidationUsingFormField.js +18 -6
- package/components/Form/stories/Uncontrolled.js +6 -1
- package/components/Form/stories/ValidateOnBlur.js +10 -3
- package/components/Form/stories/ValidateOnChange.js +11 -5
- package/components/Form/stories/ValidateOnMount.js +11 -4
- package/components/Form/stories/typescript/TypedForm.tsx +39 -45
- package/components/FormField/stories/CustomThemed/Custom.tsx +1 -1
- package/components/Grid/stories/AreasPropAlternative.js +4 -1
- package/components/Grommet/index.d.ts +4 -0
- package/components/Grommet/propTypes.js +4 -0
- package/components/Layer/LayerContainer.js +3 -14
- package/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
- package/components/Notification/stories/CustomThemed/ThemedNotification.tsx +2 -1
- package/components/PageHeader/stories/Level.js +2 -2
- package/components/PageHeader/stories/Size.js +3 -2
- package/components/Skeleton/stories/CustomThemed/Custom.js +2 -0
- package/components/Skeleton/stories/GridContainer.js +1 -1
- package/components/Skeleton/stories/Group.js +1 -1
- package/components/Skeleton/stories/Individual.js +1 -2
- package/components/Skeleton/stories/Simple.js +1 -0
- package/components/SkipLinks/stories/CustomThemed/Themed.js +1 -1
- package/components/StarRating/StarRating.js +17 -3
- package/components/Tabs/Tabs.js +1 -1
- package/components/Tabs/stories/CustomThemed/Custom.js +3 -3
- package/components/TextArea/stories/CustomThemed/Themed.js +1 -0
- package/components/TextInput/stories/Simple.js +1 -6
- package/components/ThumbsRating/ThumbsRating.js +20 -5
- package/es6/all/stories/AllComponents.js +7 -2
- package/es6/components/Box/stories/Background.js +1 -1
- package/es6/components/Button/stories/CustomThemed/Typescript.tsx +1 -1
- package/es6/components/Button/stories/Kind.js +6 -10
- package/es6/components/Calendar/Calendar.js +15 -8
- package/es6/components/Calendar/StyledCalendar.js +6 -5
- package/es6/components/Calendar/index.d.ts +1 -0
- package/es6/components/Calendar/propTypes.js +1 -0
- package/es6/components/Calendar/stories/DaylightSavings.js +2 -2
- package/es6/components/Calendar/stories/HeaderLevel.js +30 -0
- package/es6/components/Calendar/stories/ShowAdjacentDays.js +3 -2
- package/es6/components/Card/stories/CustomThemed/Clickable.js +3 -3
- package/es6/components/Card/stories/CustomThemed/Stacked.js +3 -3
- package/es6/components/Card/stories/CustomThemed/Themed.js +5 -5
- package/es6/components/Cards/stories/Children.js +3 -3
- package/es6/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/DataChart/Detail.js +55 -25
- package/es6/components/DataChart/Legend.js +1 -0
- package/es6/components/DataTable/Body.js +18 -4
- package/es6/components/DataTable/stories/CustomThemed/Fill.js +1 -0
- package/es6/components/Drop/stories/CustomThemed/Lazy.js +4 -4
- package/es6/components/Drop/stories/CustomThemed/Themed.js +1 -1
- package/es6/components/Form/stories/AggregateValidation.js +5 -2
- package/es6/components/Form/stories/ArrayOfFormFields.js +20 -7
- package/es6/components/Form/stories/Controlled.js +8 -1
- package/es6/components/Form/stories/ControlledInput.js +8 -1
- package/es6/components/Form/stories/ControlledInputLazy.js +5 -1
- package/es6/components/Form/stories/ControlledLazy.js +5 -1
- package/es6/components/Form/stories/CustomThemed/Custom.js +17 -1
- package/es6/components/Form/stories/CustomThemed/FieldSpacingOptions.js +36 -36
- package/es6/components/Form/stories/CustomThemed/RequiredLabel.js +3 -0
- package/es6/components/Form/stories/CustomThemed/Themed.js +2 -2
- package/es6/components/Form/stories/DynamicFields.js +9 -2
- package/es6/components/Form/stories/FieldWithChildren.js +6 -1
- package/es6/components/Form/stories/TriggerValidationUsingFormField.js +19 -7
- package/es6/components/Form/stories/Uncontrolled.js +6 -1
- package/es6/components/Form/stories/ValidateOnBlur.js +10 -3
- package/es6/components/Form/stories/ValidateOnChange.js +12 -6
- package/es6/components/Form/stories/ValidateOnMount.js +11 -4
- package/es6/components/Form/stories/typescript/TypedForm.tsx +39 -45
- package/es6/components/FormField/stories/CustomThemed/Custom.tsx +1 -1
- package/es6/components/Grid/stories/AreasPropAlternative.js +4 -1
- package/es6/components/Grommet/index.d.ts +4 -0
- package/es6/components/Grommet/propTypes.js +4 -0
- package/es6/components/Layer/LayerContainer.js +4 -15
- package/es6/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
- package/es6/components/Notification/stories/CustomThemed/ThemedNotification.tsx +2 -1
- package/es6/components/PageHeader/stories/Level.js +3 -3
- package/es6/components/PageHeader/stories/Size.js +3 -2
- package/es6/components/Skeleton/stories/CustomThemed/Custom.js +2 -0
- package/es6/components/Skeleton/stories/GridContainer.js +2 -2
- package/es6/components/Skeleton/stories/Group.js +2 -2
- package/es6/components/Skeleton/stories/Individual.js +2 -3
- package/es6/components/Skeleton/stories/Simple.js +1 -0
- package/es6/components/SkipLinks/stories/CustomThemed/Themed.js +1 -1
- package/es6/components/StarRating/StarRating.js +16 -3
- package/es6/components/Tabs/Tabs.js +1 -1
- package/es6/components/Tabs/stories/CustomThemed/Custom.js +3 -3
- package/es6/components/TextArea/stories/CustomThemed/Themed.js +1 -0
- package/es6/components/TextInput/stories/Simple.js +2 -7
- package/es6/components/ThumbsRating/ThumbsRating.js +20 -5
- package/es6/languages/default.json +4 -0
- package/es6/themes/base.d.ts +3 -0
- package/es6/themes/base.js +8 -5
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +4 -0
- package/package.json +8 -8
- package/themes/base.d.ts +3 -0
- package/themes/base.js +8 -5
- package/tools/release-stable.js +1 -1
- package/components/Form/stories/FieldWithComponentProp.js +0 -138
- package/es6/components/Form/stories/FieldWithComponentProp.js +0 -133
|
@@ -27,26 +27,33 @@ export var DynamicFields = function DynamicFields() {
|
|
|
27
27
|
return console.log('Submit', value);
|
|
28
28
|
}
|
|
29
29
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
30
|
+
htmlFor: "name",
|
|
30
31
|
label: "Name",
|
|
31
32
|
name: "name",
|
|
32
33
|
required: true
|
|
33
34
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
"aria-required": true,
|
|
36
|
+
id: "name",
|
|
37
|
+
name: "name"
|
|
36
38
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
39
|
+
htmlFor: "havingAlias",
|
|
37
40
|
name: "haveAlias"
|
|
38
41
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
39
42
|
name: "haveAlias",
|
|
43
|
+
id: "havingAlias",
|
|
40
44
|
label: "alias?",
|
|
41
45
|
checked: haveAlias,
|
|
42
46
|
onChange: function onChange() {
|
|
43
47
|
return setHaveAlias(!haveAlias);
|
|
44
48
|
}
|
|
45
49
|
})), haveAlias && /*#__PURE__*/React.createElement(FormField, {
|
|
50
|
+
htmlFor: "alias",
|
|
46
51
|
label: "Alias",
|
|
47
52
|
name: "alias",
|
|
48
53
|
required: true
|
|
49
54
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
55
|
+
id: "alias",
|
|
56
|
+
"aria-required": true,
|
|
50
57
|
name: "alias"
|
|
51
58
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
52
59
|
direction: "row",
|
|
@@ -47,6 +47,7 @@ export var FieldWithChildren = function FieldWithChildren() {
|
|
|
47
47
|
name: "name",
|
|
48
48
|
required: true
|
|
49
49
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
50
|
+
"aria-required": true,
|
|
50
51
|
id: "name",
|
|
51
52
|
name: "name"
|
|
52
53
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -55,6 +56,7 @@ export var FieldWithChildren = function FieldWithChildren() {
|
|
|
55
56
|
name: "email",
|
|
56
57
|
required: true
|
|
57
58
|
}, /*#__PURE__*/React.createElement(MaskedInput, {
|
|
59
|
+
"aria-required": true,
|
|
58
60
|
id: "email",
|
|
59
61
|
name: "email",
|
|
60
62
|
mask: [{
|
|
@@ -81,13 +83,17 @@ export var FieldWithChildren = function FieldWithChildren() {
|
|
|
81
83
|
id: "password",
|
|
82
84
|
type: "password"
|
|
83
85
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
86
|
+
htmlFor: "subscription",
|
|
84
87
|
name: "subscription"
|
|
85
88
|
}, /*#__PURE__*/React.createElement(CheckBoxGroup, {
|
|
86
89
|
name: "subscription",
|
|
90
|
+
id: "subscription",
|
|
87
91
|
options: ['subscribe', 'receive email notifications']
|
|
88
92
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
93
|
+
htmlFor: "ampm",
|
|
89
94
|
name: "ampm"
|
|
90
95
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
96
|
+
id: "ampm",
|
|
91
97
|
name: "ampm",
|
|
92
98
|
options: ['morning', 'evening']
|
|
93
99
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -96,7 +102,6 @@ export var FieldWithChildren = function FieldWithChildren() {
|
|
|
96
102
|
name: "size"
|
|
97
103
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
98
104
|
id: "size",
|
|
99
|
-
"aria-label": "size",
|
|
100
105
|
name: "size",
|
|
101
106
|
multiple: true,
|
|
102
107
|
options: ['small', 'medium', 'large']
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StatusGood } from "grommet-icons/es6/icons/StatusGood";
|
|
3
|
-
import { Box, Button, Form, FormField, Heading } from 'grommet';
|
|
3
|
+
import { Box, Button, Form, FormField, Heading, TextInput } from 'grommet';
|
|
4
4
|
export var TriggerValidationUsingFormField = function TriggerValidationUsingFormField() {
|
|
5
5
|
return /*#__PURE__*/React.createElement(Box, {
|
|
6
6
|
fill: true,
|
|
@@ -22,7 +22,7 @@ export var TriggerValidationUsingFormField = function TriggerValidationUsingForm
|
|
|
22
22
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
23
23
|
label: "Blur",
|
|
24
24
|
name: "blur",
|
|
25
|
-
|
|
25
|
+
htmlFor: "blur",
|
|
26
26
|
required: true,
|
|
27
27
|
validate: [{
|
|
28
28
|
regexp: /^[a-z]/i
|
|
@@ -39,11 +39,15 @@ export var TriggerValidationUsingFormField = function TriggerValidationUsingForm
|
|
|
39
39
|
return undefined;
|
|
40
40
|
}],
|
|
41
41
|
validateOn: "blur"
|
|
42
|
-
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
43
|
+
id: "blur",
|
|
44
|
+
"aria-required": true,
|
|
45
|
+
name: "blur"
|
|
46
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
43
47
|
label: "Submit",
|
|
44
48
|
name: "submit",
|
|
45
|
-
"aria-label": "submit",
|
|
46
49
|
required: true,
|
|
50
|
+
htmlFor: "submit",
|
|
47
51
|
validate: [{
|
|
48
52
|
regexp: /^[a-z]/i
|
|
49
53
|
}, function (name) {
|
|
@@ -59,10 +63,14 @@ export var TriggerValidationUsingFormField = function TriggerValidationUsingForm
|
|
|
59
63
|
return undefined;
|
|
60
64
|
}],
|
|
61
65
|
validateOn: "submit"
|
|
62
|
-
}
|
|
66
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
67
|
+
id: "submit",
|
|
68
|
+
"aria-required": true,
|
|
69
|
+
name: "submit"
|
|
70
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
63
71
|
label: "Change",
|
|
64
72
|
name: "change",
|
|
65
|
-
|
|
73
|
+
htmlFor: "change",
|
|
66
74
|
required: true,
|
|
67
75
|
validate: [{
|
|
68
76
|
regexp: /^[a-z]/i
|
|
@@ -79,7 +87,11 @@ export var TriggerValidationUsingFormField = function TriggerValidationUsingForm
|
|
|
79
87
|
return undefined;
|
|
80
88
|
}],
|
|
81
89
|
validateOn: "change"
|
|
82
|
-
}
|
|
90
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
91
|
+
id: "change",
|
|
92
|
+
"aria-required": true,
|
|
93
|
+
name: "change"
|
|
94
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
83
95
|
direction: "row",
|
|
84
96
|
justify: "between",
|
|
85
97
|
margin: {
|
|
@@ -33,6 +33,7 @@ export var Uncontrolled = function Uncontrolled() {
|
|
|
33
33
|
name: "email",
|
|
34
34
|
required: true
|
|
35
35
|
}, /*#__PURE__*/React.createElement(MaskedInput, {
|
|
36
|
+
"aria-required": true,
|
|
36
37
|
id: "email",
|
|
37
38
|
name: "email",
|
|
38
39
|
mask: [{
|
|
@@ -50,13 +51,17 @@ export var Uncontrolled = function Uncontrolled() {
|
|
|
50
51
|
placeholder: 'com'
|
|
51
52
|
}]
|
|
52
53
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
54
|
+
htmlFor: "subscribe",
|
|
53
55
|
name: "subscribe"
|
|
54
56
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
57
|
+
id: "subscribe",
|
|
55
58
|
name: "subscribe",
|
|
56
59
|
label: "Subscribe?"
|
|
57
60
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
61
|
+
htmlFor: "ampm",
|
|
58
62
|
name: "ampm"
|
|
59
63
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
64
|
+
id: "ampm",
|
|
60
65
|
name: "ampm",
|
|
61
66
|
options: ['morning', 'evening']
|
|
62
67
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -65,7 +70,6 @@ export var Uncontrolled = function Uncontrolled() {
|
|
|
65
70
|
name: "size"
|
|
66
71
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
67
72
|
id: "size",
|
|
68
|
-
"aria-label": "size",
|
|
69
73
|
name: "size",
|
|
70
74
|
options: ['small', 'medium', 'large']
|
|
71
75
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -91,6 +95,7 @@ export var Uncontrolled = function Uncontrolled() {
|
|
|
91
95
|
htmlFor: "image",
|
|
92
96
|
name: "image"
|
|
93
97
|
}, /*#__PURE__*/React.createElement(FileInput, {
|
|
98
|
+
"aria-required": true,
|
|
94
99
|
id: "image",
|
|
95
100
|
name: "image"
|
|
96
101
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
@@ -23,8 +23,8 @@ export var ValidateOnBlur = function ValidateOnBlur() {
|
|
|
23
23
|
}
|
|
24
24
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
25
25
|
label: "Name",
|
|
26
|
-
"aria-label": "name",
|
|
27
26
|
name: "name",
|
|
27
|
+
htmlFor: "name",
|
|
28
28
|
required: true,
|
|
29
29
|
validate: [{
|
|
30
30
|
regexp: /^[a-z]/i
|
|
@@ -40,13 +40,19 @@ export var ValidateOnBlur = function ValidateOnBlur() {
|
|
|
40
40
|
};
|
|
41
41
|
return undefined;
|
|
42
42
|
}]
|
|
43
|
-
}
|
|
43
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
44
|
+
id: "name",
|
|
45
|
+
"aria-required": true,
|
|
46
|
+
name: "name"
|
|
47
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
48
|
+
htmlFor: "email",
|
|
44
49
|
label: "Email",
|
|
45
50
|
name: "email",
|
|
46
51
|
required: true
|
|
47
52
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
53
|
+
"aria-required": true,
|
|
48
54
|
name: "email",
|
|
49
|
-
|
|
55
|
+
id: "email",
|
|
50
56
|
type: "email"
|
|
51
57
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
52
58
|
label: "Size",
|
|
@@ -64,6 +70,7 @@ export var ValidateOnBlur = function ValidateOnBlur() {
|
|
|
64
70
|
}
|
|
65
71
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
66
72
|
name: "select-size",
|
|
73
|
+
"aria-required": true,
|
|
67
74
|
id: "select-size",
|
|
68
75
|
options: ['small', 'medium', 'large']
|
|
69
76
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Box, Button, Form, FormField, Select } from 'grommet';
|
|
2
|
+
import { Box, Button, Form, FormField, TextInput, Select } from 'grommet';
|
|
3
3
|
export var ValidateOnChange = function ValidateOnChange() {
|
|
4
4
|
var _useState = useState(false),
|
|
5
5
|
valid = _useState[0],
|
|
@@ -30,7 +30,6 @@ export var ValidateOnChange = function ValidateOnChange() {
|
|
|
30
30
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
31
31
|
label: "First Name",
|
|
32
32
|
htmlFor: "firstName",
|
|
33
|
-
id: "firstName",
|
|
34
33
|
name: "firstName",
|
|
35
34
|
required: true,
|
|
36
35
|
validate: [{
|
|
@@ -39,10 +38,13 @@ export var ValidateOnChange = function ValidateOnChange() {
|
|
|
39
38
|
if (firstName && firstName.length === 1) return 'must be >1 character';
|
|
40
39
|
return undefined;
|
|
41
40
|
}]
|
|
42
|
-
}
|
|
41
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
42
|
+
"aria-required": true,
|
|
43
|
+
id: "firstName",
|
|
44
|
+
name: "firstName"
|
|
45
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
43
46
|
label: "Last Name",
|
|
44
47
|
htmlFor: "lastName",
|
|
45
|
-
id: "lastName",
|
|
46
48
|
name: "lastName",
|
|
47
49
|
required: true,
|
|
48
50
|
validate: [{
|
|
@@ -51,7 +53,11 @@ export var ValidateOnChange = function ValidateOnChange() {
|
|
|
51
53
|
if (lastName && lastName.length === 1) return 'must be >1 character';
|
|
52
54
|
return undefined;
|
|
53
55
|
}]
|
|
54
|
-
}
|
|
56
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
57
|
+
"aria-required": true,
|
|
58
|
+
id: "lastName",
|
|
59
|
+
name: "lastName"
|
|
60
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
55
61
|
label: "Size",
|
|
56
62
|
name: "select-size",
|
|
57
63
|
htmlFor: "select-size",
|
|
@@ -68,8 +74,8 @@ export var ValidateOnChange = function ValidateOnChange() {
|
|
|
68
74
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
69
75
|
name: "select-size",
|
|
70
76
|
htmlFor: "select-size",
|
|
77
|
+
"aria-required": true,
|
|
71
78
|
id: "select-size",
|
|
72
|
-
"aria-label": "select-size",
|
|
73
79
|
options: ['small', 'medium', 'large']
|
|
74
80
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
75
81
|
direction: "row",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { Box, Button, Form, FormField } from 'grommet';
|
|
3
|
+
import { TextInput } from '../../TextInput';
|
|
3
4
|
export var ValidateOnMount = function ValidateOnMount() {
|
|
4
5
|
var defaultValue = {
|
|
5
6
|
firstName: 'J',
|
|
@@ -39,7 +40,6 @@ export var ValidateOnMount = function ValidateOnMount() {
|
|
|
39
40
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
40
41
|
label: "First Name",
|
|
41
42
|
htmlFor: "firstName",
|
|
42
|
-
id: "firstName",
|
|
43
43
|
name: "firstName",
|
|
44
44
|
required: true,
|
|
45
45
|
validate: [{
|
|
@@ -48,10 +48,13 @@ export var ValidateOnMount = function ValidateOnMount() {
|
|
|
48
48
|
if (firstName && firstName.length === 1) return 'must be >1 character';
|
|
49
49
|
return undefined;
|
|
50
50
|
}]
|
|
51
|
-
}
|
|
51
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
52
|
+
"aria-required": true,
|
|
53
|
+
id: "firstName",
|
|
54
|
+
name: "firstName"
|
|
55
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
52
56
|
label: "Last Name",
|
|
53
57
|
htmlFor: "lastName",
|
|
54
|
-
id: "lastName",
|
|
55
58
|
name: "lastName",
|
|
56
59
|
required: true,
|
|
57
60
|
validate: [{
|
|
@@ -60,7 +63,11 @@ export var ValidateOnMount = function ValidateOnMount() {
|
|
|
60
63
|
if (lastName && lastName.length === 1) return 'must be >1 character';
|
|
61
64
|
return undefined;
|
|
62
65
|
}]
|
|
63
|
-
}
|
|
66
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
67
|
+
"aria-required": true,
|
|
68
|
+
id: "lastName",
|
|
69
|
+
name: "lastName"
|
|
70
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
64
71
|
direction: "row",
|
|
65
72
|
justify: "between",
|
|
66
73
|
margin: {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
RangeInput,
|
|
11
11
|
Select,
|
|
12
12
|
TextArea,
|
|
13
|
+
TextInput,
|
|
13
14
|
} from 'grommet';
|
|
14
15
|
import { useState } from 'react';
|
|
15
16
|
|
|
@@ -51,66 +52,59 @@ export const TypedForm = () => {
|
|
|
51
52
|
<FormField
|
|
52
53
|
label="Name"
|
|
53
54
|
htmlFor="name"
|
|
54
|
-
id="name"
|
|
55
55
|
name="name"
|
|
56
56
|
required
|
|
57
57
|
validate={{ regexp: /^[a-z]/i }}
|
|
58
|
-
|
|
58
|
+
>
|
|
59
|
+
<TextInput aria-required name="name" id="name" type="name" />
|
|
60
|
+
</FormField>
|
|
59
61
|
<FormField
|
|
60
62
|
label="Email"
|
|
61
63
|
htmlFor="email"
|
|
62
|
-
id="email"
|
|
63
64
|
name="email"
|
|
64
65
|
type="email"
|
|
65
66
|
required
|
|
66
|
-
|
|
67
|
+
>
|
|
68
|
+
<TextInput aria-required name="email" type="email" id="email" />
|
|
69
|
+
</FormField>
|
|
67
70
|
<FormField
|
|
68
71
|
label="Employee ID"
|
|
69
72
|
htmlFor="employeeId"
|
|
70
|
-
id="employeeId"
|
|
71
73
|
name="employeeId"
|
|
72
74
|
required
|
|
73
75
|
validate={{ regexp: /^[0-9]{4,6}$/, message: '4-6 digits' }}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
name="comments"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
htmlFor="age"
|
|
107
|
-
id="age"
|
|
108
|
-
name="age"
|
|
109
|
-
component={RangeInput}
|
|
110
|
-
pad
|
|
111
|
-
min={15}
|
|
112
|
-
max={75}
|
|
113
|
-
/>
|
|
76
|
+
>
|
|
77
|
+
<TextInput
|
|
78
|
+
aria-required
|
|
79
|
+
id="employeeId"
|
|
80
|
+
name="employeeId"
|
|
81
|
+
type="employeeId"
|
|
82
|
+
/>
|
|
83
|
+
</FormField>
|
|
84
|
+
<FormField name="subscribe" pad>
|
|
85
|
+
<CheckBox label="Subscribe?" name="subscribe" id="subscribe" />
|
|
86
|
+
</FormField>
|
|
87
|
+
<FormField name="ampm" pad options={['morning', 'evening']}>
|
|
88
|
+
<RadioButtonGroup
|
|
89
|
+
name="ampm"
|
|
90
|
+
id="ampm"
|
|
91
|
+
options={['morning', 'evening']}
|
|
92
|
+
/>
|
|
93
|
+
</FormField>
|
|
94
|
+
<FormField label="Size" htmlFor="size" name="size">
|
|
95
|
+
<Select
|
|
96
|
+
id="size"
|
|
97
|
+
name="size"
|
|
98
|
+
onChange={(event) => console.log(event)}
|
|
99
|
+
options={['small', 'medium', 'large', 'xlarge']}
|
|
100
|
+
/>
|
|
101
|
+
</FormField>
|
|
102
|
+
<FormField label="Comments" htmlFor="comments" name="comments">
|
|
103
|
+
<TextArea name="comments" id="comments" />
|
|
104
|
+
</FormField>
|
|
105
|
+
<FormField label="Age" htmlFor="age" name="age" pad>
|
|
106
|
+
<RangeInput name="age" id="age" type="age" min={15} max={75} />
|
|
107
|
+
</FormField>
|
|
114
108
|
<Box direction="row" justify="between" margin={{ top: 'medium' }}>
|
|
115
109
|
<Button label="Cancel" />
|
|
116
110
|
<Button type="reset" label="Reset" />
|
|
@@ -10,8 +10,11 @@ export var GridAreasAlternative = function GridAreasAlternative() {
|
|
|
10
10
|
columns: ['1/4', '3/4'],
|
|
11
11
|
areas: [['header', 'header'], ['sidebar', 'main'], ['footer', 'footer']],
|
|
12
12
|
gap: "small"
|
|
13
|
+
// needed for keyboard accessibility of scroll region
|
|
14
|
+
,
|
|
15
|
+
tabIndex: 0
|
|
13
16
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
14
|
-
background: "
|
|
17
|
+
background: "dark-1",
|
|
15
18
|
gridArea: "header"
|
|
16
19
|
}, "Header"), /*#__PURE__*/React.createElement(Box, {
|
|
17
20
|
background: "light-5",
|
|
@@ -43,6 +43,10 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
43
43
|
enterCalendar: PropTypes.string,
|
|
44
44
|
exitCalendar: PropTypes.string
|
|
45
45
|
}),
|
|
46
|
+
dataChart: PropTypes.shape({
|
|
47
|
+
detailTitle: PropTypes.string,
|
|
48
|
+
detailFocus: PropTypes.string
|
|
49
|
+
}),
|
|
46
50
|
dataFilters: PropTypes.shape({
|
|
47
51
|
clear: PropTypes.string,
|
|
48
52
|
heading: PropTypes.string,
|
|
@@ -2,20 +2,16 @@ var _excluded = ["background", "children", "full", "id", "margin", "modal", "onC
|
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { forwardRef, useContext, useEffect, useMemo, useRef } from 'react';
|
|
5
|
-
import
|
|
5
|
+
import { ThemeContext } from 'styled-components';
|
|
6
6
|
import { FocusedContainer } from '../FocusedContainer';
|
|
7
7
|
import { Keyboard } from '../Keyboard';
|
|
8
8
|
import { ResponsiveContext } from '../../contexts/ResponsiveContext';
|
|
9
9
|
import { OptionsContext } from '../../contexts/OptionsContext';
|
|
10
10
|
import { ContainerTargetContext } from '../../contexts/ContainerTargetContext';
|
|
11
11
|
import { useAnalytics } from '../../contexts/AnalyticsContext';
|
|
12
|
-
import { backgroundIsDark, findVisibleParent, PortalContext
|
|
12
|
+
import { backgroundIsDark, findVisibleParent, PortalContext } from '../../utils';
|
|
13
13
|
import { StyledLayer, StyledContainer, StyledOverlay } from './StyledLayer';
|
|
14
14
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
15
|
-
var HiddenAnchor = styled.a.withConfig(styledComponentsConfig).withConfig({
|
|
16
|
-
displayName: "LayerContainer__HiddenAnchor",
|
|
17
|
-
componentId: "sc-1srj14c-0"
|
|
18
|
-
})(["width:0;height:0;overflow:hidden;position:absolute;&:focus{outline:none;}"]);
|
|
19
15
|
var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
20
16
|
var background = _ref.background,
|
|
21
17
|
children = _ref.children,
|
|
@@ -44,7 +40,6 @@ var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
44
40
|
// should not be supported in v3
|
|
45
41
|
var _useContext = useContext(OptionsContext),
|
|
46
42
|
layerOptions = _useContext.layer;
|
|
47
|
-
var anchorRef = useRef();
|
|
48
43
|
var containerRef = useRef();
|
|
49
44
|
var layerRef = useRef();
|
|
50
45
|
var portalContext = useContext(PortalContext);
|
|
@@ -82,7 +77,8 @@ var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
82
77
|
// Once layer is open we make sure it has focus so that you
|
|
83
78
|
// can start tabbing inside the layer. If the caller put focus
|
|
84
79
|
// on an element already, we honor that. Otherwise, we put
|
|
85
|
-
// the focus
|
|
80
|
+
// the focus within the layer. Look at FocusedContainer.js for
|
|
81
|
+
// more details.
|
|
86
82
|
var element = document.activeElement;
|
|
87
83
|
while (element) {
|
|
88
84
|
if (element === containerRef.current) {
|
|
@@ -91,9 +87,6 @@ var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
91
87
|
}
|
|
92
88
|
element = element.parentElement;
|
|
93
89
|
}
|
|
94
|
-
if (modal && !element && anchorRef.current) {
|
|
95
|
-
anchorRef.current.focus();
|
|
96
|
-
}
|
|
97
90
|
}
|
|
98
91
|
}, [modal, position, ref]);
|
|
99
92
|
useEffect(function () {
|
|
@@ -193,10 +186,6 @@ var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
193
186
|
// or outside of the layer
|
|
194
187
|
,
|
|
195
188
|
"data-g-portal-id": portalId
|
|
196
|
-
}), /*#__PURE__*/React.createElement(HiddenAnchor, {
|
|
197
|
-
ref: anchorRef,
|
|
198
|
-
tabIndex: "-1",
|
|
199
|
-
"aria-hidden": "true"
|
|
200
189
|
}), children);
|
|
201
190
|
content = /*#__PURE__*/React.createElement(StyledLayer, _extends({
|
|
202
191
|
ref: layerRef,
|
|
@@ -36,7 +36,7 @@ var SidebarNav = function SidebarNav() {
|
|
|
36
36
|
fill: true,
|
|
37
37
|
direction: "row"
|
|
38
38
|
}, /*#__PURE__*/React.createElement(Nav, {
|
|
39
|
-
background: "
|
|
39
|
+
background: "dark-2"
|
|
40
40
|
}, [{
|
|
41
41
|
label: 'Dashboard',
|
|
42
42
|
icon: /*#__PURE__*/React.createElement(Dashboard, null),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, Page, PageContent, PageHeader } from 'grommet';
|
|
1
|
+
import { Button, Main, Page, PageContent, PageHeader } from 'grommet';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export var Level = function Level() {
|
|
4
4
|
return /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(PageContent, null, /*#__PURE__*/React.createElement(PageHeader, {
|
|
@@ -8,7 +8,7 @@ export var Level = function Level() {
|
|
|
8
8
|
label: "View Details"
|
|
9
9
|
}),
|
|
10
10
|
level: 1 // Use different levels for different headers
|
|
11
|
-
}), /*#__PURE__*/React.createElement(PageHeader, {
|
|
11
|
+
}), /*#__PURE__*/React.createElement(Main, null, /*#__PURE__*/React.createElement(PageHeader, {
|
|
12
12
|
title: "Main Section",
|
|
13
13
|
subtitle: "This is the main section of your application where you can display more detailed information about a specific topic or category.",
|
|
14
14
|
actions: /*#__PURE__*/React.createElement(Button, {
|
|
@@ -22,7 +22,7 @@ export var Level = function Level() {
|
|
|
22
22
|
label: "View Details"
|
|
23
23
|
}),
|
|
24
24
|
level: 3
|
|
25
|
-
})));
|
|
25
|
+
}))));
|
|
26
26
|
};
|
|
27
27
|
export default {
|
|
28
28
|
title: 'Layout/PageHeader/Level'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Anchor, Button, PageHeader, Page, PageContent } from 'grommet';
|
|
3
|
+
import { Main } from '../../Main';
|
|
3
4
|
export var Size = function Size() {
|
|
4
5
|
return (
|
|
5
6
|
/*#__PURE__*/
|
|
@@ -15,7 +16,7 @@ export var Size = function Size() {
|
|
|
15
16
|
label: "Parent Page"
|
|
16
17
|
}),
|
|
17
18
|
size: "small"
|
|
18
|
-
}), /*#__PURE__*/React.createElement(PageHeader, {
|
|
19
|
+
}), /*#__PURE__*/React.createElement(Main, null, /*#__PURE__*/React.createElement(PageHeader, {
|
|
19
20
|
title: "Medium PageHeader (default)",
|
|
20
21
|
subtitle: "Grommet helps you build responsive and accessible \n mobile-first projects for the web with an easy to use component \n library.",
|
|
21
22
|
actions: /*#__PURE__*/React.createElement(Button, {
|
|
@@ -34,7 +35,7 @@ export var Size = function Size() {
|
|
|
34
35
|
label: "Parent Page"
|
|
35
36
|
}),
|
|
36
37
|
size: "large"
|
|
37
|
-
})))
|
|
38
|
+
}))))
|
|
38
39
|
// </Grommet>
|
|
39
40
|
);
|
|
40
41
|
};
|
|
@@ -46,8 +46,10 @@ export var Custom = function Custom() {
|
|
|
46
46
|
align: "start",
|
|
47
47
|
skeleton: skeleton
|
|
48
48
|
}, /*#__PURE__*/React.createElement(Heading, {
|
|
49
|
+
"aria-label": skeleton ? 'heading 1 loading' : undefined,
|
|
49
50
|
level: 1
|
|
50
51
|
}, "Heading 1"), /*#__PURE__*/React.createElement(Text, null, "text"), /*#__PURE__*/React.createElement(Heading, {
|
|
52
|
+
"aria-label": skeleton ? 'heading 2 loading' : undefined,
|
|
51
53
|
level: 2
|
|
52
54
|
}, "Heading 2"), /*#__PURE__*/React.createElement(Button, {
|
|
53
55
|
alignSelf: "end",
|
|
@@ -2,7 +2,7 @@ var _excluded = ["title"];
|
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
|
-
import { Box, Button, Card, Grid,
|
|
5
|
+
import { Box, Button, Card, Grid, Text } from 'grommet';
|
|
6
6
|
import { FormAdd } from "grommet-icons/es6/icons/FormAdd";
|
|
7
7
|
var labels = [];
|
|
8
8
|
for (var i = 0; i < 10; i += 1) labels.push("Item " + i);
|
|
@@ -34,7 +34,7 @@ var Item = function Item(_ref) {
|
|
|
34
34
|
background: "brand",
|
|
35
35
|
round: "small",
|
|
36
36
|
flex: false
|
|
37
|
-
}
|
|
37
|
+
}), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Text, {
|
|
38
38
|
size: "large",
|
|
39
39
|
color: "text-strong",
|
|
40
40
|
weight: "bold",
|