grommet 2.42.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/all/stories/Colors.js +6 -6
- package/components/Accordion/stories/CustomThemed/Rich.tsx +1 -1
- package/components/Box/stories/Background.js +5 -11
- package/components/Button/stories/CustomThemed/Typescript.tsx +1 -1
- package/components/Button/stories/Kind.js +6 -10
- package/components/Calendar/Calendar.js +21 -11
- 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/Card/stories/Simple.js +2 -2
- package/components/Cards/stories/Children.js +2 -2
- package/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/components/Data/stories/Cards.js +3 -2
- package/components/Data/stories/Properties.js +3 -2
- 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/FormField.js +9 -2
- package/components/FormField/stories/CustomThemed/Custom.tsx +1 -1
- package/components/FormField/stories/ThresholdValidation.js +5 -1
- package/components/Grid/stories/AreasPropAlternative.js +4 -1
- package/components/Grommet/index.d.ts +23 -1
- package/components/Grommet/propTypes.js +22 -0
- package/components/Grommet/stories/Theme.js +1 -1
- package/components/Grommet/stories/Vars.js +2 -2
- package/components/Layer/LayerContainer.js +3 -14
- package/components/List/List.js +27 -3
- package/components/List/stories/RenderedList.js +1 -1
- package/components/Meter/Meter.js +36 -17
- package/components/Meter/index.d.ts +18 -0
- package/components/Meter/propTypes.js +18 -0
- 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/Pagination/stories/CustomThemed/Custom.tsx +8 -2
- package/components/Pagination/stories/NumberEdgePages.js +2 -0
- package/components/Pagination/stories/NumberMiddlePages.js +2 -0
- package/components/Pagination/stories/Simple.js +4 -2
- package/components/Pagination/stories/Size.js +3 -0
- package/components/Pagination/stories/Steps.js +3 -0
- package/components/RadioButton/RadioButton.js +14 -3
- package/components/RadioButton/stories/Children.js +16 -3
- package/components/RadioButtonGroup/stories/Children.js +13 -1
- 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/Tabs/stories/Scrollable.js +2 -1
- package/components/TextArea/stories/CustomThemed/Themed.js +1 -0
- package/components/TextInput/TextInput.js +7 -2
- 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/all/stories/Colors.js +6 -6
- package/es6/components/Accordion/stories/CustomThemed/Rich.tsx +1 -1
- package/es6/components/Box/stories/Background.js +5 -11
- 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 +21 -11
- 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/Card/stories/Simple.js +3 -3
- package/es6/components/Cards/stories/Children.js +3 -3
- package/es6/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/Data/stories/Cards.js +4 -3
- package/es6/components/Data/stories/Properties.js +4 -3
- 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/FormField.js +10 -3
- package/es6/components/FormField/stories/CustomThemed/Custom.tsx +1 -1
- package/es6/components/FormField/stories/ThresholdValidation.js +5 -1
- package/es6/components/Grid/stories/AreasPropAlternative.js +4 -1
- package/es6/components/Grommet/index.d.ts +23 -1
- package/es6/components/Grommet/propTypes.js +22 -0
- package/es6/components/Grommet/stories/Theme.js +1 -1
- package/es6/components/Grommet/stories/Vars.js +2 -2
- package/es6/components/Layer/LayerContainer.js +4 -15
- package/es6/components/List/List.js +27 -3
- package/es6/components/List/stories/RenderedList.js +1 -1
- package/es6/components/Meter/Meter.js +37 -18
- package/es6/components/Meter/index.d.ts +18 -0
- package/es6/components/Meter/propTypes.js +18 -0
- 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/Pagination/stories/CustomThemed/Custom.tsx +8 -2
- package/es6/components/Pagination/stories/NumberEdgePages.js +2 -0
- package/es6/components/Pagination/stories/NumberMiddlePages.js +2 -0
- package/es6/components/Pagination/stories/Simple.js +4 -2
- package/es6/components/Pagination/stories/Size.js +3 -0
- package/es6/components/Pagination/stories/Steps.js +3 -0
- package/es6/components/RadioButton/RadioButton.js +15 -4
- package/es6/components/RadioButton/stories/Children.js +16 -3
- package/es6/components/RadioButtonGroup/stories/Children.js +12 -1
- 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/Tabs/stories/Scrollable.js +2 -1
- package/es6/components/TextArea/stories/CustomThemed/Themed.js +1 -0
- package/es6/components/TextInput/TextInput.js +7 -2
- package/es6/components/TextInput/stories/Simple.js +2 -7
- package/es6/components/ThumbsRating/ThumbsRating.js +20 -5
- package/es6/languages/default.json +22 -0
- package/es6/themes/base.d.ts +3 -0
- package/es6/themes/base.js +8 -5
- package/es6/utils/useId.js +3 -2
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +22 -0
- package/package.json +28 -28
- package/themes/base.d.ts +3 -0
- package/themes/base.js +8 -5
- package/tools/release-stable.js +1 -1
- package/utils/useId.js +5 -2
- package/components/CheckBox/stories/InsideButton.js +0 -38
- package/components/Form/stories/FieldWithComponentProp.js +0 -138
- package/es6/components/CheckBox/stories/InsideButton.js +0 -32
- package/es6/components/Form/stories/FieldWithComponentProp.js +0 -133
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import { Box, Form, Button, FormField } from 'grommet';
|
|
3
|
+
import { Box, Form, Button, FormField, TextInput } from 'grommet';
|
|
4
4
|
import { Add } from "grommet-icons/es6/icons/Add";
|
|
5
5
|
import { Trash } from "grommet-icons/es6/icons/Trash";
|
|
6
6
|
export var ArrayOfFormFields = function ArrayOfFormFields() {
|
|
@@ -52,7 +52,7 @@ export var ArrayOfFormFields = function ArrayOfFormFields() {
|
|
|
52
52
|
align: "center"
|
|
53
53
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
54
54
|
label: "Phone Number",
|
|
55
|
-
|
|
55
|
+
htmlFor: "phone number",
|
|
56
56
|
name: "phones[" + index + "].number",
|
|
57
57
|
required: true,
|
|
58
58
|
validate: [{
|
|
@@ -61,9 +61,14 @@ export var ArrayOfFormFields = function ArrayOfFormFields() {
|
|
|
61
61
|
if (number && number.length > 10) return 'Only 10 numbers';
|
|
62
62
|
return undefined;
|
|
63
63
|
}]
|
|
64
|
-
}
|
|
64
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
65
|
+
"aria-required": true,
|
|
66
|
+
id: "phone number",
|
|
67
|
+
name: "phone number",
|
|
68
|
+
type: "tel"
|
|
69
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
65
70
|
label: "Extension",
|
|
66
|
-
|
|
71
|
+
htmlFor: "extension",
|
|
67
72
|
name: "phones[" + index + "].ext",
|
|
68
73
|
validate: [{
|
|
69
74
|
regexp: /^[0-9]*$/
|
|
@@ -71,7 +76,11 @@ export var ArrayOfFormFields = function ArrayOfFormFields() {
|
|
|
71
76
|
if (ext && ext.length > 3) return 'Only 3 numbers';
|
|
72
77
|
return undefined;
|
|
73
78
|
}]
|
|
74
|
-
}
|
|
79
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
80
|
+
id: "extension",
|
|
81
|
+
name: "extension",
|
|
82
|
+
type: "tel"
|
|
83
|
+
})), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Button, {
|
|
75
84
|
icon: /*#__PURE__*/React.createElement(Trash, null),
|
|
76
85
|
label: "Remove",
|
|
77
86
|
plain: true,
|
|
@@ -110,14 +119,18 @@ export var ArrayOfFormFields = function ArrayOfFormFields() {
|
|
|
110
119
|
}
|
|
111
120
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
112
121
|
label: "Name",
|
|
113
|
-
"aria-label": "name",
|
|
114
122
|
name: "name",
|
|
115
123
|
pad: true,
|
|
116
124
|
required: true,
|
|
125
|
+
htmlFor: "name",
|
|
117
126
|
validate: [{
|
|
118
127
|
regexp: /^[a-zA-Z ]*$/
|
|
119
128
|
}]
|
|
120
|
-
}
|
|
129
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
130
|
+
"aria-required": true,
|
|
131
|
+
id: "name",
|
|
132
|
+
name: "name"
|
|
133
|
+
})), PhoneNumberGroup, /*#__PURE__*/React.createElement(Button, {
|
|
121
134
|
icon: /*#__PURE__*/React.createElement(Add, null),
|
|
122
135
|
label: "Add Number",
|
|
123
136
|
plain: true,
|
|
@@ -53,6 +53,7 @@ export var Controlled = function Controlled() {
|
|
|
53
53
|
}, /*#__PURE__*/React.createElement(MaskedInput, {
|
|
54
54
|
id: "email",
|
|
55
55
|
name: "email",
|
|
56
|
+
"aria-required": true,
|
|
56
57
|
mask: [{
|
|
57
58
|
regexp: /^[\w\-_.]+$/,
|
|
58
59
|
placeholder: 'example'
|
|
@@ -68,13 +69,17 @@ export var Controlled = function Controlled() {
|
|
|
68
69
|
placeholder: 'com'
|
|
69
70
|
}]
|
|
70
71
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
72
|
+
htmlFor: "subscribe",
|
|
71
73
|
name: "subscribe"
|
|
72
74
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
75
|
+
id: "subscribe",
|
|
73
76
|
name: "subscribe",
|
|
74
77
|
label: "Subscribe?"
|
|
75
78
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
79
|
+
htmlFor: "ampm",
|
|
76
80
|
name: "ampm"
|
|
77
81
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
82
|
+
id: "ampm",
|
|
78
83
|
name: "ampm",
|
|
79
84
|
options: ['morning', 'evening']
|
|
80
85
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -83,7 +88,6 @@ export var Controlled = function Controlled() {
|
|
|
83
88
|
name: "size"
|
|
84
89
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
85
90
|
id: "size",
|
|
86
|
-
"aria-label": "size",
|
|
87
91
|
name: "size",
|
|
88
92
|
options: ['small', 'medium', 'large']
|
|
89
93
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -99,6 +103,9 @@ export var Controlled = function Controlled() {
|
|
|
99
103
|
name: "age",
|
|
100
104
|
pad: true
|
|
101
105
|
}, /*#__PURE__*/React.createElement(RangeInput, {
|
|
106
|
+
"aria-valuemin": 15,
|
|
107
|
+
"aria-valuemax": 75,
|
|
108
|
+
"aria-valuenow": 30,
|
|
102
109
|
id: "age",
|
|
103
110
|
name: "age",
|
|
104
111
|
min: 15,
|
|
@@ -65,6 +65,7 @@ export var ControlledInput = function ControlledInput() {
|
|
|
65
65
|
name: "email",
|
|
66
66
|
required: true
|
|
67
67
|
}, /*#__PURE__*/React.createElement(MaskedInput, {
|
|
68
|
+
"aria-required": true,
|
|
68
69
|
id: "email",
|
|
69
70
|
name: "email",
|
|
70
71
|
mask: [{
|
|
@@ -86,18 +87,22 @@ export var ControlledInput = function ControlledInput() {
|
|
|
86
87
|
return setEmail(event.target.value);
|
|
87
88
|
}
|
|
88
89
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
90
|
+
htmlFor: "subscribe",
|
|
89
91
|
name: "subscribe"
|
|
90
92
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
91
93
|
name: "subscribe",
|
|
94
|
+
id: "subscribe",
|
|
92
95
|
label: "Subscribe?",
|
|
93
96
|
checked: subscribe,
|
|
94
97
|
onChange: function onChange(event) {
|
|
95
98
|
return setSubscribe(event.target.checked);
|
|
96
99
|
}
|
|
97
100
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
101
|
+
htmlFor: "ampm",
|
|
98
102
|
name: "ampm"
|
|
99
103
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
100
104
|
name: "ampm",
|
|
105
|
+
id: "ampm",
|
|
101
106
|
options: ['morning', 'evening'],
|
|
102
107
|
value: ampm,
|
|
103
108
|
onChange: function onChange(event) {
|
|
@@ -109,7 +114,6 @@ export var ControlledInput = function ControlledInput() {
|
|
|
109
114
|
name: "size"
|
|
110
115
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
111
116
|
id: "size",
|
|
112
|
-
"aria-label": "size",
|
|
113
117
|
name: "size",
|
|
114
118
|
options: ['small', 'medium', 'large'],
|
|
115
119
|
value: size,
|
|
@@ -138,6 +142,9 @@ export var ControlledInput = function ControlledInput() {
|
|
|
138
142
|
min: 15,
|
|
139
143
|
max: 75,
|
|
140
144
|
value: age,
|
|
145
|
+
"aria-valuemin": 15,
|
|
146
|
+
"aria-valuemax": 75,
|
|
147
|
+
"aria-valuenow": 30,
|
|
141
148
|
onChange: function onChange(event) {
|
|
142
149
|
return setAge(event.target.value);
|
|
143
150
|
}
|
|
@@ -74,6 +74,7 @@ export var ControlledInputLazy = function ControlledInputLazy() {
|
|
|
74
74
|
name: "email",
|
|
75
75
|
required: true
|
|
76
76
|
}, /*#__PURE__*/React.createElement(MaskedInput, {
|
|
77
|
+
"aria-required": true,
|
|
77
78
|
id: "email",
|
|
78
79
|
name: "email",
|
|
79
80
|
mask: [{
|
|
@@ -95,18 +96,22 @@ export var ControlledInputLazy = function ControlledInputLazy() {
|
|
|
95
96
|
return setEmail(event.target.value);
|
|
96
97
|
}
|
|
97
98
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
99
|
+
htmlFor: "subscribe",
|
|
98
100
|
name: "subscribe"
|
|
99
101
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
100
102
|
name: "subscribe",
|
|
103
|
+
id: "subscribe",
|
|
101
104
|
label: "Subscribe?",
|
|
102
105
|
checked: subscribe,
|
|
103
106
|
onChange: function onChange(event) {
|
|
104
107
|
return setSubscribe(event.target.checked);
|
|
105
108
|
}
|
|
106
109
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
110
|
+
htmlFor: "ampm",
|
|
107
111
|
name: "ampm"
|
|
108
112
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
109
113
|
name: "ampm",
|
|
114
|
+
id: "ampm",
|
|
110
115
|
options: ['morning', 'evening'],
|
|
111
116
|
value: ampm,
|
|
112
117
|
onChange: function onChange(event) {
|
|
@@ -118,7 +123,6 @@ export var ControlledInputLazy = function ControlledInputLazy() {
|
|
|
118
123
|
name: "size"
|
|
119
124
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
120
125
|
id: "size",
|
|
121
|
-
"aria-label": "size",
|
|
122
126
|
name: "size",
|
|
123
127
|
options: ['small', 'medium', 'large'],
|
|
124
128
|
value: size,
|
|
@@ -59,6 +59,7 @@ export var ControlledLazy = function ControlledLazy() {
|
|
|
59
59
|
name: "email",
|
|
60
60
|
required: true
|
|
61
61
|
}, /*#__PURE__*/React.createElement(MaskedInput, {
|
|
62
|
+
"aria-required": true,
|
|
62
63
|
id: "email",
|
|
63
64
|
name: "email",
|
|
64
65
|
mask: [{
|
|
@@ -76,13 +77,17 @@ export var ControlledLazy = function ControlledLazy() {
|
|
|
76
77
|
placeholder: 'com'
|
|
77
78
|
}]
|
|
78
79
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
80
|
+
htmlFor: "subscribe",
|
|
79
81
|
name: "subscribe"
|
|
80
82
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
83
|
+
id: "subscribe",
|
|
81
84
|
name: "subscribe",
|
|
82
85
|
label: "Subscribe?"
|
|
83
86
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
87
|
+
htmlFor: "ampm",
|
|
84
88
|
name: "ampm"
|
|
85
89
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
90
|
+
id: "ampm",
|
|
86
91
|
name: "ampm",
|
|
87
92
|
options: ['morning', 'evening']
|
|
88
93
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -91,7 +96,6 @@ export var ControlledLazy = function ControlledLazy() {
|
|
|
91
96
|
name: "size"
|
|
92
97
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
93
98
|
id: "size",
|
|
94
|
-
"aria-label": "size",
|
|
95
99
|
name: "size",
|
|
96
100
|
options: ['small', 'medium', 'large']
|
|
97
101
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -13,7 +13,7 @@ var customTheme = {
|
|
|
13
13
|
},
|
|
14
14
|
formField: {
|
|
15
15
|
label: {
|
|
16
|
-
color: 'dark-
|
|
16
|
+
color: 'dark-2',
|
|
17
17
|
size: 'small',
|
|
18
18
|
margin: 'xsmall',
|
|
19
19
|
weight: 600
|
|
@@ -59,17 +59,23 @@ export var Custom = function Custom() {
|
|
|
59
59
|
return console.log('Submit', value);
|
|
60
60
|
}
|
|
61
61
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
62
|
+
htmlFor: "name",
|
|
62
63
|
label: "Name",
|
|
63
64
|
name: "name",
|
|
64
65
|
required: true
|
|
65
66
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
67
|
+
id: "name",
|
|
68
|
+
"aria-required": true,
|
|
66
69
|
name: "name"
|
|
67
70
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
71
|
+
htmlFor: "email",
|
|
68
72
|
label: "Email",
|
|
69
73
|
name: "email",
|
|
70
74
|
required: true
|
|
71
75
|
}, /*#__PURE__*/React.createElement(MaskedInput, {
|
|
72
76
|
name: "email",
|
|
77
|
+
id: "email",
|
|
78
|
+
"aria-required": true,
|
|
73
79
|
mask: [{
|
|
74
80
|
regexp: /^[\w\-_.]+$/,
|
|
75
81
|
placeholder: 'example'
|
|
@@ -85,32 +91,42 @@ export var Custom = function Custom() {
|
|
|
85
91
|
placeholder: 'com'
|
|
86
92
|
}]
|
|
87
93
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
94
|
+
htmlFor: "subscribe",
|
|
88
95
|
name: "subscribe"
|
|
89
96
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
97
|
+
id: "subscribe",
|
|
90
98
|
name: "subscribe",
|
|
91
99
|
label: "Subscribe?"
|
|
92
100
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
101
|
+
htmlFor: "ampm",
|
|
93
102
|
name: "ampm"
|
|
94
103
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
104
|
+
id: "ampm",
|
|
95
105
|
name: "ampm",
|
|
96
106
|
options: ['morning', 'evening']
|
|
97
107
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
108
|
+
htmlFor: "size",
|
|
98
109
|
label: "Size",
|
|
99
110
|
name: "size"
|
|
100
111
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
112
|
+
id: "size",
|
|
101
113
|
name: "size",
|
|
102
114
|
options: ['small', 'medium', 'large']
|
|
103
115
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
116
|
+
htmlFor: "comments",
|
|
104
117
|
label: "Comments",
|
|
105
118
|
name: "comments",
|
|
106
119
|
disabled: true
|
|
107
120
|
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
121
|
+
id: "comments",
|
|
108
122
|
name: "comments",
|
|
109
123
|
disabled: true
|
|
110
124
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
125
|
+
htmlFor: "age",
|
|
111
126
|
label: "Age",
|
|
112
127
|
name: "age"
|
|
113
128
|
}, /*#__PURE__*/React.createElement(RangeInput, {
|
|
129
|
+
id: "age",
|
|
114
130
|
name: "age",
|
|
115
131
|
min: 15,
|
|
116
132
|
max: 75
|
|
@@ -59,23 +59,23 @@ export var FieldSpacingOptions = function FieldSpacingOptions() {
|
|
|
59
59
|
level: 2,
|
|
60
60
|
size: "xsmall"
|
|
61
61
|
}, "Default Spacing"), /*#__PURE__*/React.createElement(FormField, {
|
|
62
|
-
htmlFor: "
|
|
62
|
+
htmlFor: "textinput1-id",
|
|
63
63
|
name: "example1",
|
|
64
64
|
label: "Field Label",
|
|
65
65
|
help: "Some helpful descriptive text",
|
|
66
66
|
error: "Message to show on error",
|
|
67
67
|
info: "Additional contextual information"
|
|
68
68
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
69
|
-
id: "
|
|
69
|
+
id: "textinput1-id",
|
|
70
70
|
name: "example1",
|
|
71
71
|
placeholder: "Placeholder input prompt"
|
|
72
72
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
73
|
-
htmlFor: "
|
|
73
|
+
htmlFor: "radiobutton2-id",
|
|
74
74
|
name: "example2",
|
|
75
75
|
label: "Field Label for Grouped Input",
|
|
76
76
|
help: "Choose your favorite"
|
|
77
77
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
78
|
-
id: "
|
|
78
|
+
id: "radiobutton2-id",
|
|
79
79
|
name: "example2",
|
|
80
80
|
options: ['Eenie', 'Meenie', 'Miney', 'Moe']
|
|
81
81
|
})))), /*#__PURE__*/React.createElement(Box, {
|
|
@@ -90,24 +90,24 @@ export var FieldSpacingOptions = function FieldSpacingOptions() {
|
|
|
90
90
|
formField: adjustedLabelMargins
|
|
91
91
|
}
|
|
92
92
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
93
|
-
htmlFor: "
|
|
94
|
-
name: "
|
|
93
|
+
htmlFor: "textinput3-id",
|
|
94
|
+
name: "example3",
|
|
95
95
|
label: "Field Label",
|
|
96
96
|
help: "Some helpful descriptive text",
|
|
97
97
|
error: "Message to show on error",
|
|
98
98
|
info: "Additional contextual information"
|
|
99
99
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
100
|
-
id: "
|
|
101
|
-
name: "
|
|
100
|
+
id: "textinput3-id",
|
|
101
|
+
name: "example3",
|
|
102
102
|
placeholder: "Placeholder input prompt"
|
|
103
103
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
104
|
-
htmlFor: "
|
|
105
|
-
name: "
|
|
104
|
+
htmlFor: "radiobutton4-id",
|
|
105
|
+
name: "example4",
|
|
106
106
|
label: "Field Label for Grouped Input",
|
|
107
107
|
help: "Choose your favorite"
|
|
108
108
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
109
|
-
id: "
|
|
110
|
-
name: "
|
|
109
|
+
id: "radiobutton4-id",
|
|
110
|
+
name: "example4",
|
|
111
111
|
options: ['Eenie', 'Meenie', 'Miney', 'Moe']
|
|
112
112
|
}))))), /*#__PURE__*/React.createElement(Box, {
|
|
113
113
|
pad: {
|
|
@@ -125,24 +125,24 @@ export var FieldSpacingOptions = function FieldSpacingOptions() {
|
|
|
125
125
|
}, adjustedLabelMargins)
|
|
126
126
|
}
|
|
127
127
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
128
|
-
htmlFor: "
|
|
129
|
-
name: "
|
|
128
|
+
htmlFor: "textinput5-id",
|
|
129
|
+
name: "example5",
|
|
130
130
|
label: "Field Label",
|
|
131
131
|
help: "Some helpful descriptive text",
|
|
132
132
|
error: "Message to show on error",
|
|
133
133
|
info: "Additional contextual information"
|
|
134
134
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
135
|
-
id: "
|
|
136
|
-
name: "
|
|
135
|
+
id: "textinput5-id",
|
|
136
|
+
name: "example5",
|
|
137
137
|
placeholder: "Placeholder input prompt"
|
|
138
138
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
139
|
-
htmlFor: "
|
|
140
|
-
name: "
|
|
139
|
+
htmlFor: "radiobutton6-id",
|
|
140
|
+
name: "example6",
|
|
141
141
|
label: "Field Label for Grouped Input",
|
|
142
142
|
help: "Choose your favorite"
|
|
143
143
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
144
|
-
id: "
|
|
145
|
-
name: "
|
|
144
|
+
id: "radiobutton6-id",
|
|
145
|
+
name: "example6",
|
|
146
146
|
options: ['Eenie', 'Meenie', 'Miney', 'Moe']
|
|
147
147
|
}))))), /*#__PURE__*/React.createElement(Box, {
|
|
148
148
|
pad: {
|
|
@@ -163,24 +163,24 @@ export var FieldSpacingOptions = function FieldSpacingOptions() {
|
|
|
163
163
|
}, adjustedLabelMargins)
|
|
164
164
|
}
|
|
165
165
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
166
|
-
htmlFor: "
|
|
167
|
-
name: "
|
|
166
|
+
htmlFor: "textinput7-id",
|
|
167
|
+
name: "example7",
|
|
168
168
|
label: "Field Label",
|
|
169
169
|
help: "Some helpful descriptive text",
|
|
170
170
|
error: "Message to show on error",
|
|
171
171
|
info: "Additional contextual information"
|
|
172
172
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
173
|
-
id: "
|
|
174
|
-
name: "
|
|
173
|
+
id: "textinput7-id",
|
|
174
|
+
name: "example7",
|
|
175
175
|
placeholder: "Placeholder input prompt"
|
|
176
176
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
177
|
-
htmlFor: "
|
|
178
|
-
name: "
|
|
177
|
+
htmlFor: "radiobutton8-id",
|
|
178
|
+
name: "example8",
|
|
179
179
|
label: "Field Label for Grouped Input",
|
|
180
180
|
help: "Choose your favorite"
|
|
181
181
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
182
|
-
id: "
|
|
183
|
-
name: "
|
|
182
|
+
id: "radiobutton8-id",
|
|
183
|
+
name: "example8",
|
|
184
184
|
options: ['Eenie', 'Meenie', 'Miney', 'Moe']
|
|
185
185
|
}))))), /*#__PURE__*/React.createElement(Box, {
|
|
186
186
|
pad: {
|
|
@@ -198,25 +198,25 @@ export var FieldSpacingOptions = function FieldSpacingOptions() {
|
|
|
198
198
|
}, adjustedLabelMargins)
|
|
199
199
|
}
|
|
200
200
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
201
|
-
htmlFor: "
|
|
202
|
-
name: "
|
|
201
|
+
htmlFor: "textinput9-id",
|
|
202
|
+
name: "example9",
|
|
203
203
|
label: "Field Label",
|
|
204
204
|
help: "Some helpful descriptive text",
|
|
205
205
|
error: "Message to show on error",
|
|
206
206
|
info: "Additional contextual information",
|
|
207
207
|
pad: true
|
|
208
208
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
209
|
-
id: "
|
|
210
|
-
name: "
|
|
209
|
+
id: "textinput9-id",
|
|
210
|
+
name: "example9",
|
|
211
211
|
placeholder: "Placeholder input prompt"
|
|
212
212
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
213
|
-
htmlFor: "
|
|
214
|
-
name: "
|
|
213
|
+
htmlFor: "radiobutton10-id",
|
|
214
|
+
name: "example10",
|
|
215
215
|
label: "Field Label for Grouped Input",
|
|
216
216
|
help: "Choose your favorite"
|
|
217
217
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
218
|
-
id: "
|
|
219
|
-
name: "
|
|
218
|
+
id: "radiobutton10-id",
|
|
219
|
+
name: "example10",
|
|
220
220
|
options: ['Eenie', 'Meenie', 'Miney', 'Moe']
|
|
221
221
|
})))))));
|
|
222
222
|
};
|
|
@@ -21,6 +21,7 @@ export var RequiredLabel = function RequiredLabel() {
|
|
|
21
21
|
label: "First Name",
|
|
22
22
|
required: true
|
|
23
23
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
24
|
+
"aria-required": true,
|
|
24
25
|
id: "firstName",
|
|
25
26
|
name: "firstName"
|
|
26
27
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -29,6 +30,7 @@ export var RequiredLabel = function RequiredLabel() {
|
|
|
29
30
|
label: "Last Name",
|
|
30
31
|
required: true
|
|
31
32
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
33
|
+
"aria-required": true,
|
|
32
34
|
id: "lastName",
|
|
33
35
|
name: "lastName"
|
|
34
36
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -37,6 +39,7 @@ export var RequiredLabel = function RequiredLabel() {
|
|
|
37
39
|
label: "Email",
|
|
38
40
|
required: true
|
|
39
41
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
42
|
+
"aria-required": true,
|
|
40
43
|
id: "email",
|
|
41
44
|
name: "email",
|
|
42
45
|
type: "email"
|
|
@@ -116,8 +116,8 @@ export var Themed = function Themed() {
|
|
|
116
116
|
overflow: 'auto'
|
|
117
117
|
}
|
|
118
118
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
119
|
-
id: "
|
|
120
|
-
name: "
|
|
119
|
+
id: "example2-id",
|
|
120
|
+
name: "example2",
|
|
121
121
|
placeholder: "Placeholder input prompt",
|
|
122
122
|
disabled: true
|
|
123
123
|
}))))));
|
|
@@ -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: {
|