@zendeskgarden/react-forms 9.0.0-next.2 → 9.0.0-next.20

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.
Files changed (138) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/elements/Checkbox.js +97 -0
  3. package/dist/esm/elements/FileUpload.js +75 -0
  4. package/dist/esm/elements/Input.js +93 -0
  5. package/dist/esm/elements/MediaInput.js +156 -0
  6. package/dist/esm/elements/Radio.js +81 -0
  7. package/dist/esm/elements/Range.js +108 -0
  8. package/dist/esm/elements/Select.js +98 -0
  9. package/dist/esm/elements/Textarea.js +170 -0
  10. package/dist/esm/elements/Toggle.js +81 -0
  11. package/dist/esm/elements/common/Field.js +97 -0
  12. package/dist/esm/elements/common/Fieldset.js +73 -0
  13. package/dist/esm/elements/common/Hint.js +92 -0
  14. package/dist/esm/elements/common/Label.js +134 -0
  15. package/dist/esm/elements/common/Legend.js +63 -0
  16. package/dist/esm/elements/common/Message.js +113 -0
  17. package/dist/esm/elements/faux-input/FauxInput.js +100 -0
  18. package/dist/esm/elements/faux-input/components/EndIcon.js +72 -0
  19. package/dist/esm/elements/faux-input/components/StartIcon.js +72 -0
  20. package/dist/esm/elements/file-list/FileList.js +66 -0
  21. package/dist/esm/elements/file-list/components/Close.js +75 -0
  22. package/dist/esm/elements/file-list/components/Delete.js +75 -0
  23. package/dist/esm/elements/file-list/components/File.js +95 -0
  24. package/dist/esm/elements/file-list/components/Item.js +64 -0
  25. package/dist/esm/elements/file-list/utils.js +50 -0
  26. package/dist/esm/elements/input-group/InputGroup.js +75 -0
  27. package/dist/esm/elements/tiles/Tiles.js +64 -0
  28. package/dist/esm/elements/tiles/components/Description.js +64 -0
  29. package/dist/esm/elements/tiles/components/Icon.js +64 -0
  30. package/dist/esm/elements/tiles/components/Label.js +73 -0
  31. package/dist/esm/elements/tiles/components/Tile.js +89 -0
  32. package/dist/esm/index.js +26 -0
  33. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-circle-stroke.svg.js +33 -0
  34. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-sm-fill.svg.js +29 -0
  35. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/circle-sm-fill.svg.js +27 -0
  36. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/dash-fill.svg.js +27 -0
  37. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-document-stroke.svg.js +27 -0
  38. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-error-stroke.svg.js +27 -0
  39. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-generic-stroke.svg.js +26 -0
  40. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-image-stroke.svg.js +33 -0
  41. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-pdf-stroke.svg.js +35 -0
  42. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-presentation-stroke.svg.js +26 -0
  43. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-spreadsheet-stroke.svg.js +27 -0
  44. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-zip-stroke.svg.js +27 -0
  45. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/trash-stroke.svg.js +27 -0
  46. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/x-stroke.svg.js +26 -0
  47. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +37 -0
  48. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js +32 -0
  49. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js +33 -0
  50. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +25 -0
  51. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/circle-sm-fill.svg.js +27 -0
  52. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-document-stroke.svg.js +27 -0
  53. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-error-stroke.svg.js +27 -0
  54. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-generic-stroke.svg.js +26 -0
  55. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-image-stroke.svg.js +32 -0
  56. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-pdf-stroke.svg.js +35 -0
  57. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-presentation-stroke.svg.js +26 -0
  58. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-spreadsheet-stroke.svg.js +27 -0
  59. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-zip-stroke.svg.js +27 -0
  60. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/trash-stroke.svg.js +27 -0
  61. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
  62. package/dist/esm/styled/checkbox/StyledCheckHint.js +23 -0
  63. package/dist/esm/styled/checkbox/StyledCheckInput.js +78 -0
  64. package/dist/esm/styled/checkbox/StyledCheckLabel.js +23 -0
  65. package/dist/esm/styled/checkbox/StyledCheckMessage.js +23 -0
  66. package/dist/esm/styled/checkbox/StyledCheckSvg.js +25 -0
  67. package/dist/esm/styled/checkbox/StyledDashSvg.js +25 -0
  68. package/dist/esm/styled/common/StyledField.js +22 -0
  69. package/dist/esm/styled/common/StyledFieldset.js +24 -0
  70. package/dist/esm/styled/common/StyledHint.js +25 -0
  71. package/dist/esm/styled/common/StyledLabel.js +26 -0
  72. package/dist/esm/styled/common/StyledLegend.js +24 -0
  73. package/dist/esm/styled/common/StyledMessage.js +57 -0
  74. package/dist/esm/styled/common/StyledMessageIcon.js +45 -0
  75. package/dist/esm/styled/file-list/StyledFile.js +97 -0
  76. package/dist/esm/styled/file-list/StyledFileClose.js +25 -0
  77. package/dist/esm/styled/file-list/StyledFileDelete.js +26 -0
  78. package/dist/esm/styled/file-list/StyledFileIcon.js +42 -0
  79. package/dist/esm/styled/file-list/StyledFileList.js +22 -0
  80. package/dist/esm/styled/file-list/StyledFileListItem.js +24 -0
  81. package/dist/esm/styled/file-upload/StyledFileUpload.js +116 -0
  82. package/dist/esm/styled/input-group/StyledInputGroup.js +35 -0
  83. package/dist/esm/styled/radio/StyledRadioHint.js +24 -0
  84. package/dist/esm/styled/radio/StyledRadioInput.js +122 -0
  85. package/dist/esm/styled/radio/StyledRadioLabel.js +30 -0
  86. package/dist/esm/styled/radio/StyledRadioMessage.js +24 -0
  87. package/dist/esm/styled/radio/StyledRadioSvg.js +25 -0
  88. package/dist/esm/styled/range/StyledRangeInput.js +210 -0
  89. package/dist/esm/styled/select/StyledSelect.js +60 -0
  90. package/dist/esm/styled/select/StyledSelectWrapper.js +32 -0
  91. package/dist/esm/styled/text/StyledTextFauxInput.js +69 -0
  92. package/dist/esm/styled/text/StyledTextInput.js +152 -0
  93. package/dist/esm/styled/text/StyledTextMediaFigure.js +68 -0
  94. package/dist/esm/styled/text/StyledTextMediaInput.js +24 -0
  95. package/dist/esm/styled/text/StyledTextarea.js +33 -0
  96. package/dist/esm/styled/tiles/StyledTile.js +114 -0
  97. package/dist/esm/styled/tiles/StyledTileDescription.js +34 -0
  98. package/dist/esm/styled/tiles/StyledTileIcon.js +77 -0
  99. package/dist/esm/styled/tiles/StyledTileInput.js +18 -0
  100. package/dist/esm/styled/tiles/StyledTileLabel.js +34 -0
  101. package/dist/esm/styled/toggle/StyledToggleHint.js +24 -0
  102. package/dist/esm/styled/toggle/StyledToggleInput.js +65 -0
  103. package/dist/esm/styled/toggle/StyledToggleLabel.js +28 -0
  104. package/dist/esm/styled/toggle/StyledToggleMessage.js +25 -0
  105. package/dist/esm/styled/toggle/StyledToggleSvg.js +23 -0
  106. package/dist/esm/types/index.js +11 -0
  107. package/dist/esm/utils/useFieldContext.js +15 -0
  108. package/dist/esm/utils/useFieldsetContext.js +15 -0
  109. package/dist/esm/utils/useFileContext.js +14 -0
  110. package/dist/esm/utils/useInputContext.js +14 -0
  111. package/dist/esm/utils/useInputGroupContext.js +14 -0
  112. package/dist/esm/utils/useTilesContext.js +14 -0
  113. package/dist/index.cjs.js +1239 -919
  114. package/dist/typings/elements/common/Field.d.ts +10 -9
  115. package/dist/typings/elements/common/Hint.d.ts +2 -0
  116. package/dist/typings/elements/common/Label.d.ts +2 -0
  117. package/dist/typings/elements/common/Message.d.ts +2 -0
  118. package/dist/typings/elements/faux-input/FauxInput.d.ts +1 -11
  119. package/dist/typings/elements/faux-input/components/EndIcon.d.ts +1 -1
  120. package/dist/typings/elements/faux-input/components/StartIcon.d.ts +1 -1
  121. package/dist/typings/index.d.ts +3 -4
  122. package/dist/typings/styled/file-list/StyledFileIcon.d.ts +8 -2
  123. package/dist/typings/styled/index.d.ts +0 -4
  124. package/dist/typings/styled/select/StyledSelect.d.ts +1 -4
  125. package/dist/typings/styled/select/StyledSelectWrapper.d.ts +3 -1
  126. package/dist/typings/styled/text/StyledTextFauxInput.d.ts +0 -4
  127. package/dist/typings/styled/text/StyledTextMediaFigure.d.ts +7 -7
  128. package/dist/typings/styled/text/StyledTextarea.d.ts +1 -1
  129. package/dist/typings/styled/tiles/StyledTile.d.ts +4 -7
  130. package/dist/typings/types/index.d.ts +6 -33
  131. package/dist/typings/utils/useFieldContext.d.ts +1 -2
  132. package/package.json +8 -9
  133. package/dist/index.esm.js +0 -2921
  134. package/dist/typings/elements/MultiThumbRange.d.ts +0 -14
  135. package/dist/typings/styled/range/StyledSlider.d.ts +0 -10
  136. package/dist/typings/styled/range/StyledSliderThumb.d.ts +0 -13
  137. package/dist/typings/styled/range/StyledSliderTrack.d.ts +0 -14
  138. package/dist/typings/styled/range/StyledSliderTrackRail.d.ts +0 -11
package/dist/index.esm.js DELETED
@@ -1,2921 +0,0 @@
1
- /**
2
- * Copyright Zendesk, Inc.
3
- *
4
- * Use of this source code is governed under the Apache License, Version 2.0
5
- * found at http://www.apache.org/licenses/LICENSE-2.0.
6
- */
7
-
8
- import * as React from 'react';
9
- import React__default, { createContext, useContext, Children, useState, useRef, useMemo, forwardRef, useEffect, useCallback, useLayoutEffect } from 'react';
10
- import { useField } from '@zendeskgarden/container-field';
11
- import styled, { css, ThemeContext } from 'styled-components';
12
- import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColor, focusStyles, SELECTOR_FOCUS_VISIBLE, getFocusBoxShadow, useText, useDocument } from '@zendeskgarden/react-theming';
13
- import { hideVisually, math, em, rgba } from 'polished';
14
- import PropTypes from 'prop-types';
15
- import { composeEventHandlers, getControlledValue } from '@zendeskgarden/container-utilities';
16
- import { mergeRefs } from 'react-merge-refs';
17
- import { useSlider } from '@zendeskgarden/container-slider';
18
-
19
- function _extends$t() {
20
- _extends$t = Object.assign ? Object.assign.bind() : function (target) {
21
- for (var i = 1; i < arguments.length; i++) {
22
- var source = arguments[i];
23
- for (var key in source) {
24
- if (Object.prototype.hasOwnProperty.call(source, key)) {
25
- target[key] = source[key];
26
- }
27
- }
28
- }
29
- return target;
30
- };
31
- return _extends$t.apply(this, arguments);
32
- }
33
-
34
- const FieldContext = createContext(undefined);
35
- const useFieldContext = () => {
36
- const fieldContext = useContext(FieldContext);
37
- return fieldContext;
38
- };
39
-
40
- const COMPONENT_ID$K = 'forms.field';
41
- const StyledField = styled.div.attrs({
42
- 'data-garden-id': COMPONENT_ID$K,
43
- 'data-garden-version': '9.0.0-next.2'
44
- }).withConfig({
45
- displayName: "StyledField",
46
- componentId: "sc-12gzfsu-0"
47
- })(["position:relative;direction:", ";margin:0;border:0;padding:0;font-size:0;", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => retrieveComponentStyles(COMPONENT_ID$K, props));
48
- StyledField.defaultProps = {
49
- theme: DEFAULT_THEME
50
- };
51
-
52
- const COMPONENT_ID$J = 'forms.fieldset';
53
- const StyledFieldset = styled(StyledField).attrs({
54
- as: 'fieldset',
55
- 'data-garden-id': COMPONENT_ID$J,
56
- 'data-garden-version': '9.0.0-next.2'
57
- }).withConfig({
58
- displayName: "StyledFieldset",
59
- componentId: "sc-1vr4mxv-0"
60
- })(["", "{margin-top:", "px;}", ";"], StyledField, props => props.theme.space.base * (props.isCompact ? 1 : 2), props => retrieveComponentStyles(COMPONENT_ID$J, props));
61
- StyledFieldset.defaultProps = {
62
- theme: DEFAULT_THEME
63
- };
64
-
65
- const COMPONENT_ID$I = 'forms.input_label';
66
- const StyledLabel = styled.label.attrs(props => ({
67
- 'data-garden-id': props['data-garden-id'] || COMPONENT_ID$I,
68
- 'data-garden-version': props['data-garden-version'] || '9.0.0-next.2'
69
- })).withConfig({
70
- displayName: "StyledLabel",
71
- componentId: "sc-2utmsz-0"
72
- })(["direction:", ";vertical-align:middle;line-height:", ";color:", ";font-size:", ";font-weight:", ";&[hidden]{display:", ";vertical-align:", ";text-indent:", ";font-size:", ";", ";}", ";"], props => props.theme.rtl && 'rtl', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => props.isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, props => props.isRadio ? 'inline-block' : 'inline', props => props.isRadio && 'top', props => props.isRadio && '-100%', props => props.isRadio && '0', props => !props.isRadio && hideVisually(), props => retrieveComponentStyles(COMPONENT_ID$I, props));
73
- StyledLabel.defaultProps = {
74
- theme: DEFAULT_THEME
75
- };
76
-
77
- const COMPONENT_ID$H = 'forms.fieldset_legend';
78
- const StyledLegend = styled(StyledLabel).attrs({
79
- as: 'legend',
80
- 'data-garden-id': COMPONENT_ID$H,
81
- 'data-garden-version': '9.0.0-next.2'
82
- }).withConfig({
83
- displayName: "StyledLegend",
84
- componentId: "sc-6s0zwq-0"
85
- })(["padding:0;", ";"], props => retrieveComponentStyles(COMPONENT_ID$H, props));
86
- StyledLegend.defaultProps = {
87
- theme: DEFAULT_THEME
88
- };
89
-
90
- const COMPONENT_ID$G = 'forms.input_hint';
91
- const StyledHint = styled.div.attrs(props => ({
92
- 'data-garden-id': props['data-garden-id'] || COMPONENT_ID$G,
93
- 'data-garden-version': props['data-garden-version'] || '9.0.0-next.2'
94
- })).withConfig({
95
- displayName: "StyledHint",
96
- componentId: "sc-17c2wu8-0"
97
- })(["direction:", ";display:block;vertical-align:middle;line-height:", ";color:", ";font-size:", ";", ";"], props => props.theme.rtl && 'rtl', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => getColor('neutralHue', 600, props.theme), props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID$G, props));
98
- StyledHint.defaultProps = {
99
- theme: DEFAULT_THEME
100
- };
101
-
102
- var _g$2, _circle$5;
103
- function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
104
- var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
105
- return /*#__PURE__*/React.createElement("svg", _extends$s({
106
- xmlns: "http://www.w3.org/2000/svg",
107
- width: 16,
108
- height: 16,
109
- focusable: "false",
110
- viewBox: "0 0 16 16",
111
- "aria-hidden": "true"
112
- }, props), _g$2 || (_g$2 = /*#__PURE__*/React.createElement("g", {
113
- fill: "none",
114
- stroke: "currentColor"
115
- }, /*#__PURE__*/React.createElement("circle", {
116
- cx: 7.5,
117
- cy: 8.5,
118
- r: 7
119
- }), /*#__PURE__*/React.createElement("path", {
120
- strokeLinecap: "round",
121
- d: "M7.5 4.5V9"
122
- }))), _circle$5 || (_circle$5 = /*#__PURE__*/React.createElement("circle", {
123
- cx: 7.5,
124
- cy: 12,
125
- r: 1,
126
- fill: "currentColor"
127
- })));
128
- };
129
-
130
- var _path$n, _circle$4;
131
- function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
132
- var SvgAlertWarningStroke = function SvgAlertWarningStroke(props) {
133
- return /*#__PURE__*/React.createElement("svg", _extends$r({
134
- xmlns: "http://www.w3.org/2000/svg",
135
- width: 16,
136
- height: 16,
137
- focusable: "false",
138
- viewBox: "0 0 16 16",
139
- "aria-hidden": "true"
140
- }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
141
- fill: "none",
142
- stroke: "currentColor",
143
- strokeLinecap: "round",
144
- d: "M.88 13.77L7.06 1.86c.19-.36.7-.36.89 0l6.18 11.91c.17.33-.07.73-.44.73H1.32c-.37 0-.61-.4-.44-.73zM7.5 6v3.5"
145
- })), _circle$4 || (_circle$4 = /*#__PURE__*/React.createElement("circle", {
146
- cx: 7.5,
147
- cy: 12,
148
- r: 1,
149
- fill: "currentColor"
150
- })));
151
- };
152
-
153
- var _g$1;
154
- function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
155
- var SvgCheckCircleStroke$1 = function SvgCheckCircleStroke(props) {
156
- return /*#__PURE__*/React.createElement("svg", _extends$q({
157
- xmlns: "http://www.w3.org/2000/svg",
158
- width: 16,
159
- height: 16,
160
- focusable: "false",
161
- viewBox: "0 0 16 16",
162
- "aria-hidden": "true"
163
- }, props), _g$1 || (_g$1 = /*#__PURE__*/React.createElement("g", {
164
- fill: "none",
165
- stroke: "currentColor"
166
- }, /*#__PURE__*/React.createElement("path", {
167
- strokeLinecap: "round",
168
- strokeLinejoin: "round",
169
- d: "M4 9l2.5 2.5 5-5"
170
- }), /*#__PURE__*/React.createElement("circle", {
171
- cx: 7.5,
172
- cy: 8.5,
173
- r: 7
174
- }))));
175
- };
176
-
177
- const MessageIcon = _ref => {
178
- let {
179
- children,
180
- validation,
181
- ...props
182
- } = _ref;
183
- let retVal;
184
- if (validation === 'error') {
185
- retVal = React__default.createElement(SvgAlertErrorStroke, props);
186
- } else if (validation === 'success') {
187
- retVal = React__default.createElement(SvgCheckCircleStroke$1, props);
188
- } else if (validation === 'warning') {
189
- retVal = React__default.createElement(SvgAlertWarningStroke, props);
190
- } else {
191
- retVal = React__default.cloneElement(Children.only(children));
192
- }
193
- return retVal;
194
- };
195
- const COMPONENT_ID$F = 'forms.input_message_icon';
196
- const StyledMessageIcon = styled(MessageIcon).attrs({
197
- 'data-garden-id': COMPONENT_ID$F,
198
- 'data-garden-version': '9.0.0-next.2',
199
- 'aria-hidden': null
200
- }).withConfig({
201
- displayName: "StyledMessageIcon",
202
- componentId: "sc-1ph2gba-0"
203
- })(["width:", ";height:", ";", ";"], props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, props => retrieveComponentStyles(COMPONENT_ID$F, props));
204
- StyledMessageIcon.defaultProps = {
205
- theme: DEFAULT_THEME
206
- };
207
-
208
- const validationStyles = props => {
209
- const rtl = props.theme.rtl;
210
- const padding = math(`${props.theme.space.base} * 2px + ${props.theme.iconSizes.md}`);
211
- let color;
212
- if (props.validation === 'error') {
213
- color = getColor('dangerHue', 600, props.theme);
214
- } else if (props.validation === 'success') {
215
- color = getColor('successHue', 600, props.theme);
216
- } else if (props.validation === 'warning') {
217
- color = getColor('warningHue', 700, props.theme);
218
- } else {
219
- color = getColor('neutralHue', 700, props.theme);
220
- }
221
- return css(["padding-", ":", ";color:", ";"], rtl ? 'right' : 'left', props.validation && padding, color);
222
- };
223
- const COMPONENT_ID$E = 'forms.input_message';
224
- const StyledMessage = styled.div.attrs(props => ({
225
- 'data-garden-id': props['data-garden-id'] || COMPONENT_ID$E,
226
- 'data-garden-version': props['data-garden-version'] || '9.0.0-next.2'
227
- })).withConfig({
228
- displayName: "StyledMessage",
229
- componentId: "sc-30hgg7-0"
230
- })(["direction:", ";display:inline-block;position:relative;vertical-align:middle;line-height:", ";font-size:", ";", ";& ", "{position:absolute;top:-1px;", ":0;}", ":not([hidden]) + &{display:block;margin-top:", ";}", ";"], props => props.theme.rtl && 'rtl', props => getLineHeight(props.theme.iconSizes.md, props.theme.fontSizes.sm), props => props.theme.fontSizes.sm, props => validationStyles(props), StyledMessageIcon, props => props.theme.rtl ? 'right' : 'left', StyledLabel, props => math(`${props.theme.space.base} * 1px`), props => retrieveComponentStyles(COMPONENT_ID$E, props));
231
- StyledMessage.defaultProps = {
232
- theme: DEFAULT_THEME
233
- };
234
-
235
- const COMPONENT_ID$D = 'forms.input';
236
- const isInvalid = validation => {
237
- return validation === 'warning' || validation === 'error';
238
- };
239
- const colorStyles$c = props => {
240
- const HUE = 'primaryHue';
241
- const SHADE = 600;
242
- const placeholderColor = getColor('neutralHue', SHADE - 200, props.theme);
243
- let borderColor;
244
- let hoverBorderColor;
245
- let focusBorderColor;
246
- let focusRingHue = HUE;
247
- let focusRingShade = SHADE;
248
- if (props.validation) {
249
- let hue = HUE;
250
- if (props.validation === 'success') {
251
- hue = 'successHue';
252
- } else if (props.validation === 'warning') {
253
- hue = 'warningHue';
254
- focusRingShade = 700;
255
- } else if (props.validation === 'error') {
256
- hue = 'dangerHue';
257
- }
258
- borderColor = getColor(hue, SHADE, props.theme);
259
- hoverBorderColor = borderColor;
260
- focusBorderColor = borderColor;
261
- focusRingHue = hue;
262
- } else {
263
- borderColor = getColor('neutralHue', SHADE - 300, props.theme);
264
- hoverBorderColor = getColor('primaryHue', SHADE, props.theme);
265
- focusBorderColor = hoverBorderColor;
266
- }
267
- const readOnlyBackgroundColor = getColor('neutralHue', SHADE - 500, props.theme);
268
- const readOnlyBorderColor = getColor('neutralHue', SHADE - 300, props.theme);
269
- const disabledBackgroundColor = readOnlyBackgroundColor;
270
- const disabledBorderColor = getColor('neutralHue', SHADE - 400, props.theme);
271
- const disabledForegroundColor = getColor('neutralHue', SHADE - 200, props.theme);
272
- let controlledBorderColor = borderColor;
273
- if (props.isFocused) {
274
- controlledBorderColor = focusBorderColor;
275
- }
276
- if (props.isHovered) {
277
- controlledBorderColor = hoverBorderColor;
278
- }
279
- return css(["border-color:", ";background-color:", ";color:", ";&::placeholder{color:", ";}&[readonly],&[aria-readonly='true']{border-color:", ";background-color:", ";}&:hover{border-color:", ";}", " &:disabled,&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], controlledBorderColor, props.isBare ? 'transparent' : props.theme.colors.background, props.theme.colors.foreground, placeholderColor, readOnlyBorderColor, !props.isBare && readOnlyBackgroundColor, hoverBorderColor, focusStyles({
280
- theme: props.theme,
281
- inset: props.focusInset,
282
- condition: !props.isBare,
283
- hue: focusRingHue,
284
- shade: focusRingShade,
285
- styles: {
286
- borderColor: focusBorderColor
287
- }
288
- }), disabledBorderColor, !props.isBare && disabledBackgroundColor, disabledForegroundColor);
289
- };
290
- const sizeStyles$f = props => {
291
- const fontSize = props.theme.fontSizes.md;
292
- const paddingHorizontal = `${props.theme.space.base * 3}px`;
293
- let height;
294
- let paddingVertical;
295
- let browseFontSize;
296
- let swatchHeight;
297
- if (props.isCompact) {
298
- height = `${props.theme.space.base * 8}px`;
299
- paddingVertical = `${props.theme.space.base * 1.5}px`;
300
- browseFontSize = math(`${props.theme.fontSizes.sm} - 1`);
301
- swatchHeight = `${props.theme.space.base * 6}px`;
302
- } else {
303
- height = `${props.theme.space.base * 10}px`;
304
- paddingVertical = `${props.theme.space.base * 2.5}px`;
305
- browseFontSize = props.theme.fontSizes.sm;
306
- swatchHeight = `${props.theme.space.base * 7}px`;
307
- }
308
- const lineHeight = math(`${height} - (${paddingVertical} * 2) - (${props.theme.borderWidths.sm} * 2)`);
309
- const padding = props.isBare ? '0' : `${em(paddingVertical, fontSize)} ${em(paddingHorizontal, fontSize)}`;
310
- const swatchMarginVertical = math(`(${lineHeight} - ${swatchHeight}) / 2`);
311
- const swatchMarginHorizontal = math(`${paddingVertical} + ${swatchMarginVertical} - ${paddingHorizontal}`);
312
- return css(["padding:", ";min-height:", ";line-height:", ";font-size:", ";&::-ms-browse{font-size:", ";}&[type='date'],&[type='datetime-local'],&[type='file'],&[type='month'],&[type='time'],&[type='week']{max-height:", ";}&[type='file']{line-height:1;}@supports (-ms-ime-align:auto){&[type='color']{padding:", ";}}&::-moz-color-swatch{margin-top:", ";margin-left:", ";width:calc(100% + ", ");height:", ";}&::-webkit-color-swatch{margin:", " ", ";}", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", "px;}"], padding, props.isBare ? '1em' : height, getLineHeight(lineHeight, fontSize), fontSize, browseFontSize, height, props.isCompact ? '0 2px' : '1px 3px', swatchMarginVertical, swatchMarginHorizontal, math(`${swatchMarginHorizontal} * -2`), swatchHeight, swatchMarginVertical, swatchMarginHorizontal, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, props.theme.space.base * (props.isCompact ? 1 : 2));
313
- };
314
- const StyledTextInput = styled.input.attrs(props => ({
315
- 'data-garden-id': COMPONENT_ID$D,
316
- 'data-garden-version': '9.0.0-next.2',
317
- 'aria-invalid': isInvalid(props.validation)
318
- })).withConfig({
319
- displayName: "StyledTextInput",
320
- componentId: "sc-k12n8x-0"
321
- })(["appearance:none;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;direction:", ";border:", ";border-radius:", ";width:100%;box-sizing:border-box;vertical-align:middle;font-family:inherit;&::-ms-browse{border-radius:", ";}&::-ms-clear,&::-ms-reveal{display:none;}&::-moz-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch-wrapper{padding:0;}&::-webkit-clear-button,&::-webkit-inner-spin-button,&::-webkit-search-cancel-button,&::-webkit-search-results-button{display:none;}&::-webkit-datetime-edit{direction:", ";line-height:1;}&::placeholder{opacity:1;}&:invalid{box-shadow:none;}&[type='file']::-ms-value{display:none;}@media screen and (min--moz-device-pixel-ratio:0){&[type='number']{appearance:textfield;}}", ";", ";&:disabled{cursor:default;}", ";"], props => props.theme.rtl && 'rtl', props => props.isBare ? 'none' : props.theme.borders.sm, props => props.isBare ? '0' : props.theme.borderRadii.md, props => props.theme.borderRadii.sm, props => props.theme.borderRadii.sm, props => props.theme.borderRadii.sm, props => props.theme.rtl && 'rtl', props => sizeStyles$f(props), props => colorStyles$c(props), props => retrieveComponentStyles(COMPONENT_ID$D, props));
322
- StyledTextInput.defaultProps = {
323
- theme: DEFAULT_THEME
324
- };
325
-
326
- const COMPONENT_ID$C = 'forms.textarea';
327
- const hiddenStyles = `
328
- visibility: hidden;
329
- position: absolute;
330
- overflow: hidden;
331
- height: 0;
332
- top: 0;
333
- left: 0;
334
- transform: translateZ(0);
335
- `;
336
- const StyledTextarea = styled(StyledTextInput).attrs({
337
- as: 'textarea',
338
- 'data-garden-id': COMPONENT_ID$C,
339
- 'data-garden-version': '9.0.0-next.2'
340
- }).withConfig({
341
- displayName: "StyledTextarea",
342
- componentId: "sc-wxschl-0"
343
- })(["resize:", ";overflow:auto;", ";", ";"], props => props.isResizable ? 'vertical' : 'none', props => props.isHidden && hiddenStyles, props => retrieveComponentStyles(COMPONENT_ID$C, props));
344
- StyledTextarea.defaultProps = {
345
- theme: DEFAULT_THEME
346
- };
347
-
348
- const COMPONENT_ID$B = 'forms.media_figure';
349
- const colorStyles$b = props => {
350
- let shade = 600;
351
- if (props.isDisabled) {
352
- shade = 400;
353
- } else if (props.isHovered || props.isFocused) {
354
- shade = 700;
355
- }
356
- return css(["color:", ";"], getColor('neutralHue', shade, props.theme));
357
- };
358
- const sizeStyles$e = props => {
359
- const size = props.theme.iconSizes.md;
360
- const marginFirst = `1px ${props.theme.space.base * 2}px auto 0`;
361
- const marginLast = `1px 0 auto ${props.theme.space.base * 2}px`;
362
- let margin;
363
- if (props.position === 'start') {
364
- margin = props.theme.rtl ? marginLast : marginFirst;
365
- } else {
366
- margin = props.theme.rtl ? marginFirst : marginLast;
367
- }
368
- return css(["margin:", ";width:", ";height:", ";"], margin, size, size);
369
- };
370
- const StyledTextMediaFigure = styled(
371
- _ref => {
372
- let {
373
- children,
374
- position,
375
- isHovered,
376
- isFocused,
377
- isDisabled,
378
- isRotated,
379
- theme,
380
- ...props
381
- } = _ref;
382
- return React__default.cloneElement(Children.only(children), props);
383
- }).attrs({
384
- 'data-garden-id': COMPONENT_ID$B,
385
- 'data-garden-version': '9.0.0-next.2'
386
- }).withConfig({
387
- displayName: "StyledTextMediaFigure",
388
- componentId: "sc-1qepknj-0"
389
- })(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", " ", ";"], props => props.isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, props => colorStyles$b(props), props => sizeStyles$e(props), props => retrieveComponentStyles(COMPONENT_ID$B, props));
390
- StyledTextMediaFigure.defaultProps = {
391
- theme: DEFAULT_THEME
392
- };
393
-
394
- const COMPONENT_ID$A = 'forms.faux_input';
395
- const VALIDATION_HUES = {
396
- success: 'successHue',
397
- warning: 'warningHue',
398
- error: 'dangerHue'
399
- };
400
- function getValidationHue(validation) {
401
- let defaultHue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'primaryHue';
402
- if (validation) {
403
- return VALIDATION_HUES[validation];
404
- }
405
- return defaultHue;
406
- }
407
- const colorStyles$a = props => {
408
- const {
409
- theme,
410
- validation,
411
- focusInset,
412
- isBare,
413
- isFocused
414
- } = props;
415
- return css(["", ""], focusStyles({
416
- theme,
417
- inset: focusInset,
418
- condition: !isBare,
419
- hue: getValidationHue(validation),
420
- shade: validation === 'warning' ? 700 : 600,
421
- selector: isFocused ? '&' : '&:focus-within',
422
- styles: {
423
- borderColor: getColor(getValidationHue(validation), 600, theme)
424
- }
425
- }));
426
- };
427
- const StyledTextFauxInput = styled(StyledTextInput).attrs(props => ({
428
- as: 'div',
429
- 'aria-readonly': props.isReadOnly,
430
- 'aria-disabled': props.isDisabled,
431
- 'data-garden-id': COMPONENT_ID$A,
432
- 'data-garden-version': '9.0.0-next.2'
433
- })).withConfig({
434
- displayName: "StyledTextFauxInput",
435
- componentId: "sc-yqw7j9-0"
436
- })(["display:", ";align-items:", ";cursor:", ";overflow:hidden;", " & > ", "{vertical-align:", ";", "{box-shadow:unset;}}& > ", "{flex-shrink:", ";}", ";"], props => props.mediaLayout ? 'inline-flex' : 'inline-block', props => props.mediaLayout && 'baseline', props => props.mediaLayout && !props.isDisabled ? 'text' : 'default', colorStyles$a, StyledTextInput, props => !props.mediaLayout && 'baseline', SELECTOR_FOCUS_VISIBLE, StyledTextMediaFigure, props => props.mediaLayout && '0', props => retrieveComponentStyles(COMPONENT_ID$A, props));
437
- StyledTextFauxInput.defaultProps = {
438
- theme: DEFAULT_THEME
439
- };
440
-
441
- const COMPONENT_ID$z = 'forms.media_input';
442
- const StyledTextMediaInput = styled(StyledTextInput).attrs({
443
- 'data-garden-id': COMPONENT_ID$z,
444
- 'data-garden-version': '9.0.0-next.2',
445
- isBare: true
446
- }).withConfig({
447
- displayName: "StyledTextMediaInput",
448
- componentId: "sc-12i9xfi-0"
449
- })(["flex-grow:1;", ";"], props => retrieveComponentStyles(COMPONENT_ID$z, props));
450
- StyledTextMediaInput.defaultProps = {
451
- theme: DEFAULT_THEME
452
- };
453
-
454
- const COMPONENT_ID$y = 'forms.input_group';
455
- const positionStyles = props => {
456
- const topMargin = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
457
- return css(["", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}& > ", "{position:relative;flex:1 1 auto;margin-top:0;margin-bottom:0;width:auto;min-width:0;}"], StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, topMargin, StyledTextInput);
458
- };
459
- const itemStyles = props => {
460
- const startDirection = props.theme.rtl ? 'right' : 'left';
461
- const endDirection = props.theme.rtl ? 'left' : 'right';
462
- return css(["& > *{z-index:-1;}& > ", "{z-index:0;}& > ", ":disabled{z-index:-2;}& > ", ":hover,& > button:hover,& > ", ":focus-visible,& > button:focus-visible,& > ", "[data-garden-focus-visible],& > button[data-garden-focus-visible],& > ", ":active,& > button:active{z-index:1;}& > button:disabled{border-top-width:0;border-bottom-width:0;}& > *:not(:first-child){margin-", ":-", ";}& > *:first-child:not(:last-child){border-top-", "-radius:0;border-bottom-", "-radius:0;}& > *:last-child:not(:first-child){border-top-", "-radius:0;border-bottom-", "-radius:0;}& > *:not(:first-child):not(:last-child){border-radius:0;}"], StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, startDirection, props.theme.borderWidths.sm, endDirection, endDirection, startDirection, startDirection);
463
- };
464
- const StyledInputGroup = styled.div.attrs({
465
- 'data-garden-id': COMPONENT_ID$y,
466
- 'data-garden-version': '9.0.0-next.2'
467
- }).withConfig({
468
- displayName: "StyledInputGroup",
469
- componentId: "sc-kjh1f0-0"
470
- })(["display:inline-flex;position:relative;flex-wrap:nowrap;align-items:stretch;z-index:0;width:100%;", ";", ";", ";"], props => positionStyles(props), props => itemStyles(props), props => retrieveComponentStyles(COMPONENT_ID$y, props));
471
- StyledInputGroup.defaultProps = {
472
- theme: DEFAULT_THEME
473
- };
474
-
475
- const COMPONENT_ID$x = 'forms.radio_label';
476
- const sizeStyles$d = props => {
477
- const size = props.theme.space.base * 4;
478
- const padding = size + props.theme.space.base * 2;
479
- const lineHeight = props.theme.space.base * 5;
480
- return css(["padding-", ":", "px;&[hidden]{padding-", ":", "px;line-height:", "px;}"], props.theme.rtl ? 'right' : 'left', padding, props.theme.rtl ? 'right' : 'left', size, lineHeight);
481
- };
482
- const StyledRadioLabel = styled(StyledLabel).attrs({
483
- 'data-garden-id': COMPONENT_ID$x,
484
- 'data-garden-version': '9.0.0-next.2',
485
- isRadio: true
486
- }).withConfig({
487
- displayName: "StyledRadioLabel",
488
- componentId: "sc-1aq2e5t-0"
489
- })(["display:inline-block;position:relative;cursor:pointer;", ";", ";"], props => sizeStyles$d(props), props => retrieveComponentStyles(COMPONENT_ID$x, props));
490
- StyledRadioLabel.defaultProps = {
491
- theme: DEFAULT_THEME
492
- };
493
-
494
- const COMPONENT_ID$w = 'forms.checkbox_label';
495
- const StyledCheckLabel = styled(StyledRadioLabel).attrs({
496
- 'data-garden-id': COMPONENT_ID$w,
497
- 'data-garden-version': '9.0.0-next.2'
498
- }).withConfig({
499
- displayName: "StyledCheckLabel",
500
- componentId: "sc-x7nr1-0"
501
- })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$w, props));
502
- StyledCheckLabel.defaultProps = {
503
- theme: DEFAULT_THEME
504
- };
505
-
506
- const COMPONENT_ID$v = 'forms.radio_hint';
507
- const StyledRadioHint = styled(StyledHint).attrs({
508
- 'data-garden-id': COMPONENT_ID$v,
509
- 'data-garden-version': '9.0.0-next.2'
510
- }).withConfig({
511
- displayName: "StyledRadioHint",
512
- componentId: "sc-eo8twg-0"
513
- })(["padding-", ":", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => math(`${props.theme.space.base} * 6px`), props => retrieveComponentStyles(COMPONENT_ID$v, props));
514
- StyledRadioHint.defaultProps = {
515
- theme: DEFAULT_THEME
516
- };
517
-
518
- const COMPONENT_ID$u = 'forms.checkbox_hint';
519
- const StyledCheckHint = styled(StyledRadioHint).attrs({
520
- 'data-garden-id': COMPONENT_ID$u,
521
- 'data-garden-version': '9.0.0-next.2'
522
- }).withConfig({
523
- displayName: "StyledCheckHint",
524
- componentId: "sc-1kl8e8c-0"
525
- })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$u, props));
526
- StyledCheckHint.defaultProps = {
527
- theme: DEFAULT_THEME
528
- };
529
-
530
- const COMPONENT_ID$t = 'forms.radio';
531
- const colorStyles$9 = props => {
532
- const SHADE = 600;
533
- const borderColor = getColor('neutralHue', SHADE - 300, props.theme);
534
- const backgroundColor = props.theme.colors.background;
535
- const iconColor = backgroundColor;
536
- const hoverBackgroundColor = getColor('primaryHue', SHADE, props.theme, 0.08);
537
- const hoverBorderColor = getColor('primaryHue', SHADE, props.theme);
538
- const focusBorderColor = hoverBorderColor;
539
- const activeBackgroundColor = getColor('primaryHue', SHADE, props.theme, 0.2);
540
- const activeBorderColor = focusBorderColor;
541
- const checkedBorderColor = focusBorderColor;
542
- const checkedBackgroundColor = checkedBorderColor;
543
- const checkedHoverBorderColor = getColor('primaryHue', SHADE + 100, props.theme);
544
- const checkedHoverBackgroundColor = checkedHoverBorderColor;
545
- const checkedActiveBorderColor = getColor('primaryHue', SHADE + 200, props.theme);
546
- const checkedActiveBackgroundColor = checkedActiveBorderColor;
547
- const disabledBackgroundColor = getColor('neutralHue', SHADE - 400, props.theme);
548
- return css(["& ~ ", "::before{border-color:", ";background-color:", ";}& ~ ", " > svg{color:", ";}& ~ ", ":hover::before{border-color:", ";background-color:", ";}", " & ~ ", ":active::before{border-color:", ";background-color:", ";}&:checked ~ ", "::before{border-color:", ";background-color:", ";}&:enabled:checked ~ ", ":hover::before{border-color:", ";background-color:", ";}&:enabled:checked ~ ", ":active::before{border-color:", ";background-color:", ";}&:disabled ~ ", "::before{border-color:transparent;background-color:", ";}"], StyledRadioLabel, borderColor, backgroundColor, StyledRadioLabel, iconColor, StyledRadioLabel, hoverBorderColor, hoverBackgroundColor, focusStyles({
549
- theme: props.theme,
550
- styles: {
551
- borderColor: focusBorderColor
552
- },
553
- selector: `&:focus-visible ~ ${StyledRadioLabel}::before, &[data-garden-focus-visible='true'] ~ ${StyledRadioLabel}::before`
554
- }), StyledRadioLabel, activeBorderColor, activeBackgroundColor, StyledRadioLabel, checkedBorderColor, checkedBackgroundColor, StyledRadioLabel, checkedHoverBorderColor, checkedHoverBackgroundColor, StyledRadioLabel, checkedActiveBorderColor, checkedActiveBackgroundColor, StyledRadioLabel, disabledBackgroundColor);
555
- };
556
- const sizeStyles$c = props => {
557
- const lineHeight = `${props.theme.space.base * 5}px`;
558
- const size = `${props.theme.space.base * 4}px`;
559
- const top = math(`(${lineHeight} - ${size}) / 2`);
560
- const iconSize = props.theme.iconSizes.sm;
561
- const iconPosition = math(`(${size} - ${iconSize}) / 2`);
562
- const iconTop = math(`${iconPosition} + ${top}`);
563
- const marginTop = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
564
- return css(["top:", ";width:", ";height:", ";& ~ ", "::before{top:", ";background-size:", ";width:", ";height:", ";box-sizing:border-box;}& ~ ", " > svg{top:", ";", ":", ";width:", ";height:", ";}&& ~ ", " ~ ", "{margin-top:", ";}"], top, size, size, StyledRadioLabel, top, props.theme.iconSizes.sm, size, size, StyledRadioLabel, iconTop, props.theme.rtl ? 'right' : 'left', iconPosition, iconSize, iconSize, StyledRadioLabel, StyledMessage, marginTop);
565
- };
566
- const StyledRadioInput = styled.input.attrs({
567
- 'data-garden-id': COMPONENT_ID$t,
568
- 'data-garden-version': '9.0.0-next.2',
569
- type: 'radio'
570
- }).withConfig({
571
- displayName: "StyledRadioInput",
572
- componentId: "sc-qsavpv-0"
573
- })(["position:absolute;opacity:0;margin:0;& ~ ", "::before{position:absolute;", ":0;transition:border-color .25s ease-in-out,box-shadow .1s ease-in-out,background-color .25s ease-in-out,color .25s ease-in-out;border:", ";border-radius:50%;background-repeat:no-repeat;background-position:center;content:'';}& ~ ", " > svg{position:absolute;}", ";&:focus ~ ", "::before{outline:none;}& ~ ", ":active::before{transition:border-color 0.1s ease-in-out,background-color 0.1s ease-in-out,color 0.1s ease-in-out;}", ";&:disabled ~ ", "{cursor:default;}", ";"], StyledRadioLabel, props => props.theme.rtl ? 'right' : 'left', props => props.theme.borders.sm, StyledRadioLabel, props => sizeStyles$c(props), StyledRadioLabel, StyledRadioLabel, props => colorStyles$9(props), StyledRadioLabel, props => retrieveComponentStyles(COMPONENT_ID$t, props));
574
- StyledRadioInput.defaultProps = {
575
- theme: DEFAULT_THEME
576
- };
577
-
578
- const COMPONENT_ID$s = 'forms.checkbox';
579
- const colorStyles$8 = props => {
580
- const SHADE = 600;
581
- const indeterminateBorderColor = getColor('primaryHue', SHADE, props.theme);
582
- const indeterminateBackgroundColor = indeterminateBorderColor;
583
- const indeterminateActiveBorderColor = getColor('primaryHue', SHADE + 100, props.theme);
584
- const indeterminateActiveBackgroundColor = indeterminateActiveBorderColor;
585
- const indeterminateDisabledBackgroundColor = getColor('neutralHue', SHADE - 400, props.theme);
586
- return css(["&:indeterminate ~ ", "::before{border-color:", ";background-color:", ";}&:enabled:indeterminate ~ ", ":active::before{border-color:", ";background-color:", ";}&:disabled:indeterminate ~ ", "::before{border-color:transparent;background-color:", ";}"], StyledCheckLabel, indeterminateBorderColor, indeterminateBackgroundColor, StyledCheckLabel, indeterminateActiveBorderColor, indeterminateActiveBackgroundColor, StyledCheckLabel, indeterminateDisabledBackgroundColor);
587
- };
588
- const StyledCheckInput = styled(StyledRadioInput).attrs({
589
- 'data-garden-id': COMPONENT_ID$s,
590
- 'data-garden-version': '9.0.0-next.2',
591
- type: 'checkbox'
592
- }).withConfig({
593
- displayName: "StyledCheckInput",
594
- componentId: "sc-176jxxe-0"
595
- })(["& ~ ", "::before{border-radius:", ";}", ";", ";"], StyledCheckLabel, props => props.theme.borderRadii.md, props => colorStyles$8(props), props => retrieveComponentStyles(COMPONENT_ID$s, props));
596
- StyledCheckInput.defaultProps = {
597
- theme: DEFAULT_THEME
598
- };
599
-
600
- const COMPONENT_ID$r = 'forms.radio_message';
601
- const StyledRadioMessage = styled(StyledMessage).attrs({
602
- 'data-garden-id': COMPONENT_ID$r,
603
- 'data-garden-version': '9.0.0-next.2'
604
- }).withConfig({
605
- displayName: "StyledRadioMessage",
606
- componentId: "sc-1pmi0q8-0"
607
- })(["padding-", ":", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => math(`${props.theme.space.base} * 6px`), props => retrieveComponentStyles(COMPONENT_ID$r, props));
608
- StyledRadioMessage.defaultProps = {
609
- theme: DEFAULT_THEME
610
- };
611
-
612
- const COMPONENT_ID$q = 'forms.checkbox_message';
613
- const StyledCheckMessage = styled(StyledRadioMessage).attrs({
614
- 'data-garden-id': COMPONENT_ID$q,
615
- 'data-garden-version': '9.0.0-next.2'
616
- }).withConfig({
617
- displayName: "StyledCheckMessage",
618
- componentId: "sc-s4p6kd-0"
619
- })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$q, props));
620
- StyledCheckMessage.defaultProps = {
621
- theme: DEFAULT_THEME
622
- };
623
-
624
- var _path$m;
625
- function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
626
- var SvgCheckSmFill = function SvgCheckSmFill(props) {
627
- return /*#__PURE__*/React.createElement("svg", _extends$p({
628
- xmlns: "http://www.w3.org/2000/svg",
629
- width: 12,
630
- height: 12,
631
- focusable: "false",
632
- viewBox: "0 0 12 12",
633
- "aria-hidden": "true"
634
- }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
635
- fill: "none",
636
- stroke: "currentColor",
637
- strokeLinecap: "round",
638
- strokeLinejoin: "round",
639
- strokeWidth: 2,
640
- d: "M3 6l2 2 4-4"
641
- })));
642
- };
643
-
644
- const COMPONENT_ID$p = 'forms.check_svg';
645
- const StyledCheckSvg = styled(SvgCheckSmFill).attrs({
646
- 'data-garden-id': COMPONENT_ID$p,
647
- 'data-garden-version': '9.0.0-next.2'
648
- }).withConfig({
649
- displayName: "StyledCheckSvg",
650
- componentId: "sc-fvxetk-0"
651
- })(["transition:opacity 0.25s ease-in-out;opacity:0;pointer-events:none;", ":checked ~ ", " > &{opacity:1;}", ":indeterminate ~ ", " > &{opacity:0;}", ";"], StyledCheckInput, StyledCheckLabel, StyledCheckInput, StyledCheckLabel, props => retrieveComponentStyles(COMPONENT_ID$p, props));
652
- StyledCheckSvg.defaultProps = {
653
- theme: DEFAULT_THEME
654
- };
655
-
656
- var _path$l;
657
- function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
658
- var SvgDashFill = function SvgDashFill(props) {
659
- return /*#__PURE__*/React.createElement("svg", _extends$o({
660
- xmlns: "http://www.w3.org/2000/svg",
661
- width: 12,
662
- height: 12,
663
- focusable: "false",
664
- viewBox: "0 0 12 12",
665
- "aria-hidden": "true"
666
- }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
667
- stroke: "currentColor",
668
- strokeLinecap: "round",
669
- strokeWidth: 2,
670
- d: "M3 6h6"
671
- })));
672
- };
673
-
674
- const COMPONENT_ID$o = 'forms.dash_svg';
675
- const StyledDashSvg = styled(SvgDashFill).attrs({
676
- 'data-garden-id': COMPONENT_ID$o,
677
- 'data-garden-version': '9.0.0-next.2'
678
- }).withConfig({
679
- displayName: "StyledDashSvg",
680
- componentId: "sc-z3vq71-0"
681
- })(["transition:opacity 0.25s ease-in-out;opacity:0;pointer-events:none;", ":indeterminate ~ ", " > &{opacity:1;}", ";"], StyledCheckInput, StyledCheckLabel, props => retrieveComponentStyles(COMPONENT_ID$o, props));
682
- StyledDashSvg.defaultProps = {
683
- theme: DEFAULT_THEME
684
- };
685
-
686
- const COMPONENT_ID$n = 'forms.file_upload';
687
- const colorStyles$7 = props => {
688
- const baseColor = getColor('primaryHue', 600, props.theme);
689
- const hoverColor = getColor('primaryHue', 700, props.theme);
690
- const activeColor = getColor('primaryHue', 800, props.theme);
691
- const disabledBackgroundColor = getColor('neutralHue', 200, props.theme);
692
- const disabledForegroundColor = getColor('neutralHue', 400, props.theme);
693
- return css(["border-color:", ";background-color:", ";color:", ";&:hover{border-color:", ";background-color:", ";color:", ";}", " &:active{border-color:", ";background-color:", ";color:", ";}&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], props.isDragging ? activeColor : getColor('neutralHue', 600, props.theme), props.isDragging && rgba(baseColor, 0.2), props.isDragging ? activeColor : baseColor, hoverColor, rgba(baseColor, 0.08), hoverColor, focusStyles({
694
- theme: props.theme,
695
- hue: baseColor
696
- }), activeColor, rgba(baseColor, 0.2), activeColor, disabledForegroundColor, disabledBackgroundColor, disabledForegroundColor);
697
- };
698
- const sizeStyles$b = props => {
699
- const marginTop = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
700
- const paddingHorizontal = `${props.isCompact ? 2 : 4}em`;
701
- const paddingVertical = math(`${props.theme.space.base * (props.isCompact ? 2.5 : 5)} - ${props.theme.borderWidths.sm}`);
702
- const fontSize = props.theme.fontSizes.md;
703
- const lineHeight = getLineHeight(props.theme.space.base * 5, fontSize);
704
- return css(["padding:", " ", ";min-width:4em;line-height:", ";font-size:", ";", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}"], paddingVertical, paddingHorizontal, lineHeight, fontSize, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, marginTop);
705
- };
706
- const StyledFileUpload = styled.div.attrs({
707
- 'data-garden-id': COMPONENT_ID$n,
708
- 'data-garden-version': '9.0.0-next.2'
709
- }).withConfig({
710
- displayName: "StyledFileUpload",
711
- componentId: "sc-1rodjgn-0"
712
- })(["display:flex;align-items:center;justify-content:center;box-sizing:border-box;direction:", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:dashed ", ";border-radius:", ";cursor:pointer;text-align:center;user-select:none;", ";&[aria-disabled='true']{cursor:default;}", ";", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => props.theme.borderWidths.sm, props => props.theme.borderRadii.md, sizeStyles$b, colorStyles$7, props => retrieveComponentStyles(COMPONENT_ID$n, props));
713
- StyledFileUpload.defaultProps = {
714
- theme: DEFAULT_THEME
715
- };
716
-
717
- const COMPONENT_ID$m = 'forms.file.close';
718
- const StyledFileClose = styled.button.attrs({
719
- 'data-garden-id': COMPONENT_ID$m,
720
- 'data-garden-version': '9.0.0-next.2'
721
- }).withConfig({
722
- displayName: "StyledFileClose",
723
- componentId: "sc-1m31jbf-0"
724
- })(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:opacity 0.25s ease-in-out;opacity:0.8;border:none;background:transparent;cursor:pointer;color:", ";appearance:none;&:hover{opacity:0.9;}&:focus{outline:none;}", ";"], props => props.theme.colors.foreground, props => retrieveComponentStyles(COMPONENT_ID$m, props));
725
- StyledFileClose.defaultProps = {
726
- theme: DEFAULT_THEME
727
- };
728
-
729
- const COMPONENT_ID$l = 'forms.file';
730
- const colorStyles$6 = props => {
731
- let borderColor;
732
- let focusBorderColor;
733
- let foregroundColor;
734
- if (props.validation === 'success') {
735
- borderColor = getColor('successHue', 600, props.theme);
736
- focusBorderColor = borderColor;
737
- foregroundColor = borderColor;
738
- } else if (props.validation === 'error') {
739
- borderColor = getColor('dangerHue', 600, props.theme);
740
- focusBorderColor = borderColor;
741
- foregroundColor = borderColor;
742
- } else {
743
- borderColor = getColor('neutralHue', 300, props.theme);
744
- focusBorderColor = getColor('primaryHue', 600, props.theme);
745
- foregroundColor = props.theme.colors.foreground;
746
- }
747
- return css(["border-color:", ";color:", ";", ""], borderColor, foregroundColor, focusStyles({
748
- theme: props.theme,
749
- inset: props.focusInset,
750
- hue: focusBorderColor,
751
- styles: {
752
- borderColor: focusBorderColor
753
- }
754
- }));
755
- };
756
- const sizeStyles$a = props => {
757
- const size = `${props.theme.space.base * (props.isCompact ? 7 : 10)}px`;
758
- const spacing = `${props.theme.space.base * (props.isCompact ? 2 : 3)}px`;
759
- const fontSize = props.theme.fontSizes.md;
760
- const lineHeight = getLineHeight(props.theme.space.base * 5, fontSize);
761
- return `
762
- box-sizing: border-box;
763
- border: ${props.theme.borders.sm};
764
- border-radius: ${props.theme.borderRadii.md};
765
- padding: 0 ${spacing};
766
- height: ${size};
767
- line-height: ${lineHeight};
768
- font-size: ${fontSize};
769
-
770
- & > span {
771
- width: 100%;
772
- }
773
-
774
- & > ${StyledFileClose} {
775
- width: ${size};
776
- height: ${size};
777
- margin-${props.theme.rtl ? 'left' : 'right'}: -${spacing};
778
- }
779
- `;
780
- };
781
- const StyledFile = styled.div.attrs({
782
- 'data-garden-id': COMPONENT_ID$l,
783
- 'data-garden-version': '9.0.0-next.2'
784
- }).withConfig({
785
- displayName: "StyledFile",
786
- componentId: "sc-195lzp1-0"
787
- })(["display:flex;position:relative;flex-wrap:nowrap;align-items:center;transition:box-shadow 0.1s ease-in-out;", ";", ";& > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}& > [role='progressbar']{position:absolute;bottom:0;left:0;transition:opacity 0.2s ease-in-out;margin:0;border-top-left-radius:0;border-top-right-radius:0;width:100%;& > div{border-top-", "-radius:0;}}& > [role='progressbar'][aria-valuenow='0'],& > [role='progressbar'][aria-valuenow='100']{opacity:0;}", ";"], sizeStyles$a, colorStyles$6, props => props.theme.rtl ? 'right' : 'left', props => retrieveComponentStyles(COMPONENT_ID$l, props));
788
- StyledFile.defaultProps = {
789
- theme: DEFAULT_THEME
790
- };
791
-
792
- const COMPONENT_ID$k = 'forms.file.delete';
793
- const StyledFileDelete = styled(StyledFileClose).attrs({
794
- 'data-garden-id': COMPONENT_ID$k,
795
- 'data-garden-version': '9.0.0-next.2'
796
- }).withConfig({
797
- displayName: "StyledFileDelete",
798
- componentId: "sc-a8nnhx-0"
799
- })(["color:", ";", ";"], props => getColor('dangerHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID$k, props));
800
- StyledFileDelete.defaultProps = {
801
- theme: DEFAULT_THEME
802
- };
803
-
804
- const COMPONENT_ID$j = 'forms.file.icon';
805
- const StyledFileIcon = styled(_ref => {
806
- let {
807
- children,
808
- isCompact,
809
- theme,
810
- ...props
811
- } = _ref;
812
- return React__default.cloneElement(Children.only(children), props);
813
- }).attrs({
814
- 'data-garden-id': COMPONENT_ID$j,
815
- 'data-garden-version': '9.0.0-next.2'
816
- }).withConfig({
817
- displayName: "StyledFileIcon",
818
- componentId: "sc-7b3q0c-0"
819
- })(["flex-shrink:0;width:", ";margin-", ":", "px;", ";"], props => props.isCompact ? props.theme.iconSizes.sm : props.theme.iconSizes.md, props => props.theme.rtl ? 'left' : 'right', props => props.theme.space.base * 2, props => retrieveComponentStyles(COMPONENT_ID$j, props));
820
- StyledFileIcon.defaultProps = {
821
- theme: DEFAULT_THEME
822
- };
823
-
824
- const COMPONENT_ID$i = 'forms.file_list';
825
- const StyledFileList = styled.ul.attrs({
826
- 'data-garden-id': COMPONENT_ID$i,
827
- 'data-garden-version': '9.0.0-next.2'
828
- }).withConfig({
829
- displayName: "StyledFileList",
830
- componentId: "sc-gbahjg-0"
831
- })(["margin:0;padding:0;list-style:none;", ";"], props => retrieveComponentStyles(COMPONENT_ID$i, props));
832
- StyledFileList.defaultProps = {
833
- theme: DEFAULT_THEME
834
- };
835
-
836
- const COMPONENT_ID$h = 'forms.file_list.item';
837
- const StyledFileListItem = styled.li.attrs({
838
- 'data-garden-id': COMPONENT_ID$h,
839
- 'data-garden-version': '9.0.0-next.2'
840
- }).withConfig({
841
- displayName: "StyledFileListItem",
842
- componentId: "sc-1ova3lo-0"
843
- })(["&:not(:first-child),", " ~ ", " > &:first-child{margin-top:", "px;}", ";"], StyledFileUpload, StyledFileList, props => props.theme.space.base * 2, props => retrieveComponentStyles(COMPONENT_ID$h, props));
844
- StyledFileListItem.defaultProps = {
845
- theme: DEFAULT_THEME
846
- };
847
-
848
- var _circle$3;
849
- function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
850
- var SvgCircleSmFill$1 = function SvgCircleSmFill(props) {
851
- return /*#__PURE__*/React.createElement("svg", _extends$n({
852
- xmlns: "http://www.w3.org/2000/svg",
853
- width: 12,
854
- height: 12,
855
- focusable: "false",
856
- viewBox: "0 0 12 12",
857
- "aria-hidden": "true"
858
- }, props), _circle$3 || (_circle$3 = /*#__PURE__*/React.createElement("circle", {
859
- cx: 6,
860
- cy: 6,
861
- r: 2,
862
- fill: "currentColor"
863
- })));
864
- };
865
-
866
- const COMPONENT_ID$g = 'forms.radio_svg';
867
- const StyledRadioSvg = styled(SvgCircleSmFill$1).attrs({
868
- 'data-garden-id': COMPONENT_ID$g,
869
- 'data-garden-version': '9.0.0-next.2'
870
- }).withConfig({
871
- displayName: "StyledRadioSvg",
872
- componentId: "sc-1r1qtr1-0"
873
- })(["transition:opacity 0.25s ease-in-out;opacity:0;", ":checked ~ ", " > &{opacity:1;}", ";"], StyledRadioInput, StyledRadioLabel, props => retrieveComponentStyles(COMPONENT_ID$g, props));
874
- StyledRadioSvg.defaultProps = {
875
- theme: DEFAULT_THEME
876
- };
877
-
878
- const COMPONENT_ID$f = 'forms.toggle_label';
879
- const sizeStyles$9 = props => {
880
- const size = props.theme.space.base * 10;
881
- const padding = size + props.theme.space.base * 2;
882
- return css(["padding-", ":", "px;&[hidden]{padding-", ":", "px;}"], props.theme.rtl ? 'right' : 'left', padding, props.theme.rtl ? 'right' : 'left', size);
883
- };
884
- const StyledToggleLabel = styled(StyledCheckLabel).attrs({
885
- 'data-garden-id': COMPONENT_ID$f,
886
- 'data-garden-version': '9.0.0-next.2'
887
- }).withConfig({
888
- displayName: "StyledToggleLabel",
889
- componentId: "sc-e0asdk-0"
890
- })(["", ";", ";"], props => sizeStyles$9(props), props => retrieveComponentStyles(COMPONENT_ID$f, props));
891
- StyledToggleLabel.defaultProps = {
892
- theme: DEFAULT_THEME
893
- };
894
-
895
- const COMPONENT_ID$e = 'forms.toggle_hint';
896
- const StyledToggleHint = styled(StyledHint).attrs({
897
- 'data-garden-id': COMPONENT_ID$e,
898
- 'data-garden-version': '9.0.0-next.2'
899
- }).withConfig({
900
- displayName: "StyledToggleHint",
901
- componentId: "sc-nziggu-0"
902
- })(["padding-", ":", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => math(`${props.theme.space.base} * 12px`), props => retrieveComponentStyles(COMPONENT_ID$e, props));
903
- StyledToggleHint.defaultProps = {
904
- theme: DEFAULT_THEME
905
- };
906
-
907
- const COMPONENT_ID$d = 'forms.toggle';
908
- const colorStyles$5 = props => {
909
- const SHADE = 600;
910
- const backgroundColor = getColor('neutralHue', SHADE - 100, props.theme);
911
- const hoverBackgroundColor = getColor('neutralHue', SHADE, props.theme);
912
- const activeBackgroundColor = getColor('neutralHue', SHADE + 100, props.theme);
913
- return css(["& ~ ", "::before{background-color:", ";}&:enabled ~ ", ":hover::before{background-color:", ";}&:enabled ~ ", ":active::before{background-color:", ";}"], StyledToggleLabel, backgroundColor, StyledToggleLabel, hoverBackgroundColor, StyledToggleLabel, activeBackgroundColor);
914
- };
915
- const sizeStyles$8 = props => {
916
- const height = `${props.theme.space.base * 5}px`;
917
- const width = `${props.theme.space.base * 10}px`;
918
- const iconSize = props.theme.iconSizes.md;
919
- const iconPosition = math(`(${height} - ${iconSize}) / 2`);
920
- const checkedIconPosition = math(`${width} - ${iconSize} - ${iconPosition}`);
921
- return css(["top:0;width:", ";height:", ";& ~ ", "::before{width:", ";height:", ";}& ~ ", " > svg{top:", ";", ":", ";width:", ";height:", ";}&:checked ~ ", " > svg{", ":", ";}"], width, height, StyledToggleLabel, width, height, StyledToggleLabel, iconPosition, props.theme.rtl ? 'right' : 'left', iconPosition, iconSize, iconSize, StyledToggleLabel, props.theme.rtl ? 'right' : 'left', checkedIconPosition);
922
- };
923
- const StyledToggleInput = styled(StyledCheckInput).attrs({
924
- 'data-garden-id': COMPONENT_ID$d,
925
- 'data-garden-version': '9.0.0-next.2'
926
- }).withConfig({
927
- displayName: "StyledToggleInput",
928
- componentId: "sc-sgp47s-0"
929
- })(["& ~ ", "::before{top:0;transition:box-shadow .1s ease-in-out,background-color .15s ease-in-out,color .25s ease-in-out;border:none;border-radius:100px;}", ";", ";", ";"], StyledToggleLabel, props => sizeStyles$8(props), props => colorStyles$5(props), props => retrieveComponentStyles(COMPONENT_ID$d, props));
930
- StyledToggleInput.defaultProps = {
931
- theme: DEFAULT_THEME
932
- };
933
-
934
- const COMPONENT_ID$c = 'forms.toggle_message';
935
- const StyledToggleMessage = styled(StyledMessage).attrs({
936
- 'data-garden-id': COMPONENT_ID$c,
937
- 'data-garden-version': '9.0.0-next.2'
938
- }).withConfig({
939
- displayName: "StyledToggleMessage",
940
- componentId: "sc-13vuvl1-0"
941
- })(["padding-", ":", ";& ", "{", ":", ";}", ";"], props => props.theme.rtl ? 'right' : 'left', props => math(`${props.theme.space.base} * 12px`), StyledMessageIcon, props => props.theme.rtl ? 'right' : 'left', props => math(`${props.theme.space.base} * 10px - ${props.theme.iconSizes.md}`), props => retrieveComponentStyles(COMPONENT_ID$c, props));
942
- StyledToggleMessage.defaultProps = {
943
- theme: DEFAULT_THEME
944
- };
945
-
946
- var _circle$2;
947
- function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
948
- var SvgCircleSmFill = function SvgCircleSmFill(props) {
949
- return /*#__PURE__*/React.createElement("svg", _extends$m({
950
- xmlns: "http://www.w3.org/2000/svg",
951
- width: 16,
952
- height: 16,
953
- focusable: "false",
954
- viewBox: "0 0 16 16",
955
- "aria-hidden": "true"
956
- }, props), _circle$2 || (_circle$2 = /*#__PURE__*/React.createElement("circle", {
957
- cx: 8,
958
- cy: 8,
959
- r: 6,
960
- fill: "currentColor"
961
- })));
962
- };
963
-
964
- const COMPONENT_ID$b = 'forms.toggle_svg';
965
- const StyledToggleSvg = styled(SvgCircleSmFill).attrs({
966
- 'data-garden-id': COMPONENT_ID$b,
967
- 'data-garden-version': '9.0.0-next.2'
968
- }).withConfig({
969
- displayName: "StyledToggleSvg",
970
- componentId: "sc-162xbyx-0"
971
- })(["transition:all 0.15s ease-in-out;", ";"], props => retrieveComponentStyles(COMPONENT_ID$b, props));
972
- StyledToggleSvg.defaultProps = {
973
- theme: DEFAULT_THEME
974
- };
975
-
976
- const COMPONENT_ID$a = 'forms.select';
977
- const colorStyles$4 = props => {
978
- const color = getColor('neutralHue', 700, props.theme);
979
- return css(["&:hover + ", ",&:focus + ", ",&:focus-visible + ", ",&[data-garden-focus-visible='true'] + ", "{color:", ";}"], StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, color);
980
- };
981
- const sizeStyles$7 = props => {
982
- const padding = math(`${props.theme.iconSizes.md} + ${props.theme.space.base * 5}`);
983
- const iconVerticalPosition = `${props.theme.space.base * (props.isCompact ? 1.5 : 2.5) + 1}px`;
984
- const iconHorizontalPosition = `${props.theme.space.base * 3}px`;
985
- return css(["padding-", ":", ";& + ", "{top:", ";", ":", ";}"], props.theme.rtl ? 'left' : 'right', !props.isBare && padding, StyledTextMediaFigure, iconVerticalPosition, props.theme.rtl ? 'left' : 'right', iconHorizontalPosition);
986
- };
987
- const StyledSelect = styled(StyledTextInput).attrs({
988
- 'data-garden-id': COMPONENT_ID$a,
989
- 'data-garden-version': '9.0.0-next.2',
990
- as: 'select'
991
- }).withConfig({
992
- displayName: "StyledSelect",
993
- componentId: "sc-8xdxpt-0"
994
- })(["cursor:pointer;text-overflow:ellipsis;", ";", ";&::-ms-expand{display:none;}&::-ms-value{background-color:transparent;color:inherit;}&:-moz-focusring{transition:none;text-shadow:0 0 0 ", ";color:transparent;}& + ", "{position:absolute;pointer-events:none;}"], props => sizeStyles$7(props), props => colorStyles$4(props), props => props.theme.colors.foreground, StyledTextMediaFigure);
995
- StyledSelect.defaultProps = {
996
- theme: DEFAULT_THEME
997
- };
998
-
999
- const COMPONENT_ID$9 = 'forms.select_wrapper';
1000
- const StyledSelectWrapper = styled(StyledTextFauxInput).attrs({
1001
- 'data-garden-id': COMPONENT_ID$9,
1002
- 'data-garden-version': '9.0.0-next.2'
1003
- }).withConfig({
1004
- displayName: "StyledSelectWrapper",
1005
- componentId: "sc-i7b6hw-0"
1006
- })(["position:relative;padding:0;overflow:visible;& > ", "{border-color:transparent;background-color:transparent;", "{box-shadow:unset;}}"], StyledSelect, SELECTOR_FOCUS_VISIBLE);
1007
- StyledSelectWrapper.defaultProps = {
1008
- theme: DEFAULT_THEME
1009
- };
1010
-
1011
- const COMPONENT_ID$8 = 'forms.range';
1012
- const thumbStyles = function (styles) {
1013
- let modifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1014
- return `
1015
- &${modifier}::-moz-range-thumb {
1016
- ${styles}
1017
- }
1018
-
1019
- &${modifier}::-ms-thumb {
1020
- ${styles}
1021
- }
1022
-
1023
- &${modifier}::-webkit-slider-thumb {
1024
- ${styles}
1025
- }
1026
- `;
1027
- };
1028
- const trackStyles = function (styles) {
1029
- let modifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1030
- return `
1031
- &${modifier}::-moz-range-track {
1032
- ${styles}
1033
- }
1034
-
1035
- &${modifier}::-ms-track {
1036
- ${styles}
1037
- }
1038
-
1039
- &${modifier}::-webkit-slider-runnable-track {
1040
- ${styles}
1041
- }
1042
- `;
1043
- };
1044
- const trackLowerStyles = function (styles) {
1045
- let modifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1046
- return `
1047
- &${modifier}::-moz-range-progress {
1048
- ${styles}
1049
- }
1050
-
1051
- &${modifier}::-ms-fill-lower {
1052
- ${styles}
1053
- }
1054
- `;
1055
- };
1056
- const colorStyles$3 = props => {
1057
- const SHADE = 600;
1058
- const thumbBackgroundColor = getColor('primaryHue', SHADE, props.theme);
1059
- const thumbBorderColor = thumbBackgroundColor;
1060
- const thumbBoxShadow = props.theme.shadows.lg(math(`${props.theme.space.base} * 1px`), math(`${props.theme.space.base} * 2px`), getColor('neutralHue', SHADE + 200, props.theme, 0.24));
1061
- const thumbFocusBoxShadow = getFocusBoxShadow({
1062
- theme: props.theme
1063
- });
1064
- const thumbActiveBackgroundColor = getColor('primaryHue', SHADE + 100, props.theme);
1065
- const thumbActiveBorderColor = thumbBorderColor;
1066
- const thumbDisabledBackgroundColor = getColor('neutralHue', SHADE - 300, props.theme);
1067
- const thumbDisabledBorderColor = thumbDisabledBackgroundColor;
1068
- const thumbHoverBackgroundColor = thumbActiveBackgroundColor;
1069
- const thumbHoverBorderColor = thumbHoverBackgroundColor;
1070
- const trackBackgroundColor = getColor('neutralHue', SHADE - 400, props.theme);
1071
- const trackLowerBackgroundColor = props.hasLowerTrack ? thumbBackgroundColor : '';
1072
- const trackBackgroundImage = props.hasLowerTrack ? `linear-gradient(${trackLowerBackgroundColor}, ${trackLowerBackgroundColor})` : '';
1073
- const trackDisabledLowerBackgroundColor = props.hasLowerTrack ? thumbDisabledBackgroundColor : '';
1074
- const trackDisabledBackgroundImage = props.hasLowerTrack ? `linear-gradient(${trackDisabledLowerBackgroundColor}, ${trackDisabledLowerBackgroundColor})` : '';
1075
- return css(["", " ", " ", " ", " ", " ", " ", " ", " ", ""], trackStyles(`
1076
- background-color: ${trackBackgroundColor};
1077
- background-image: ${trackBackgroundImage}; /* provide means for styling lower range on WebKit */
1078
- `), thumbStyles(`
1079
- border-color: ${thumbBorderColor};
1080
- box-shadow: ${thumbBoxShadow};
1081
- background-color: ${thumbBackgroundColor};
1082
- `), trackLowerStyles(`
1083
- background-color: ${trackLowerBackgroundColor};
1084
- `), thumbStyles(`
1085
- transition:
1086
- border-color .25s ease-in-out,
1087
- background-color .25s ease-in-out;
1088
- border-color: ${thumbHoverBorderColor};
1089
- background-color: ${thumbHoverBackgroundColor};
1090
- `, ':hover'), thumbStyles(`
1091
- box-shadow: ${thumbFocusBoxShadow};
1092
- `, '[data-garden-focus-visible="true"]'), thumbStyles(`
1093
- border-color: ${thumbActiveBorderColor};
1094
- background-color: ${thumbActiveBackgroundColor};
1095
- `, ':active'), trackStyles(`
1096
- background-image: ${trackDisabledBackgroundImage};
1097
- `, ':disabled'), thumbStyles(`
1098
- border-color: ${thumbDisabledBorderColor};
1099
- box-shadow: none;
1100
- background-color: ${thumbDisabledBackgroundColor};
1101
- `, ':disabled'), trackLowerStyles(`
1102
- background-color: ${trackDisabledLowerBackgroundColor};
1103
- `, ':disabled'));
1104
- };
1105
- const sizeStyles$6 = props => {
1106
- const thumbSize = math(`${props.theme.space.base} * 5px`);
1107
- const trackHeight = math(`${props.theme.space.base} * 1.5px`);
1108
- const trackBorderRadius = trackHeight;
1109
- const trackMargin = math(`(${thumbSize} - ${trackHeight}) / 2 + ${props.theme.shadowWidths.md}`);
1110
- const thumbMargin = math(`(${trackHeight} - ${thumbSize}) / 2`);
1111
- return css(["", ":not([hidden]) + &,", " + &,", " + &,& + ", ",& + ", "{margin-top:", ";}", ";", " ", ""], StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, math(`${props.theme.space.base} * 2px`), trackStyles(`
1112
- margin: ${trackMargin} 0;
1113
- border-radius: ${trackBorderRadius};
1114
- height: ${trackHeight};
1115
- `), thumbStyles(`
1116
- margin: ${thumbMargin} 0; /* reset for IE */
1117
- width: ${thumbSize};
1118
- height: ${thumbSize};
1119
- `), trackLowerStyles(`
1120
- border-top-${props.theme.rtl ? 'right' : 'left'}-radius: ${trackBorderRadius};
1121
- border-bottom-${props.theme.rtl ? 'right' : 'left'}-radius: ${trackBorderRadius};
1122
- height: ${trackHeight};
1123
- `));
1124
- };
1125
- const StyledRangeInput = styled.input.attrs(props => ({
1126
- 'data-garden-id': COMPONENT_ID$8,
1127
- 'data-garden-version': '9.0.0-next.2',
1128
- type: 'range',
1129
- style: {
1130
- backgroundSize: props.hasLowerTrack && props.backgroundSize
1131
- }
1132
- })).withConfig({
1133
- displayName: "StyledRangeInput",
1134
- componentId: "sc-1iv2yqp-0"
1135
- })(["appearance:none;direction:", ";margin:0;background-color:inherit;cursor:pointer;padding:0;width:100%;vertical-align:middle;", " &::-webkit-slider-container,&::-webkit-slider-runnable-track{background-size:inherit;}", ";", " ", ";&::-moz-focus-outer{border:0;}&::-ms-tooltip{display:none;}&:focus{outline:none;}&:disabled{cursor:default;}", ";"], props => props.theme.rtl && 'rtl', props => trackStyles(`
1136
- appearance: none;
1137
- border-color: transparent; /* reset for IE */
1138
- background-repeat: repeat-y;
1139
- background-size: 0;
1140
- background-position: ${props.theme.rtl ? '100% 100%' : '0% 0%'};
1141
- width: 99.8%; /* fix for IE which cuts off the upper track's border radius */
1142
- color: transparent; /* reset for IE */
1143
- box-sizing: border-box; /* reset for IE */
1144
- `), props => sizeStyles$6(props), props => thumbStyles(`
1145
- appearance: none;
1146
- transition: box-shadow .1s ease-in-out;
1147
- border: ${props.theme.borders.md};
1148
- border-radius: 100%;
1149
- box-sizing: border-box;
1150
- `), props => colorStyles$3(props), props => retrieveComponentStyles(COMPONENT_ID$8, props));
1151
- StyledRangeInput.defaultProps = {
1152
- backgroundSize: '0%',
1153
- hasLowerTrack: true,
1154
- theme: DEFAULT_THEME
1155
- };
1156
-
1157
- const COMPONENT_ID$7 = 'forms.slider';
1158
- const StyledSlider = styled.div.attrs({
1159
- 'data-garden-id': COMPONENT_ID$7,
1160
- 'data-garden-version': '9.0.0-next.2'
1161
- }).withConfig({
1162
- displayName: "StyledSlider",
1163
- componentId: "sc-1di437a-0"
1164
- })(["display:block;position:relative;z-index:0;cursor:pointer;height:", ";&[aria-disabled='true']{cursor:default;}", ":not([hidden]) + &,", " + &,", " + &,& + ", ",& + ", "{margin-top:", ";}", ";"], props => math(`(${props.theme.space.base} * 5px) + (${props.theme.shadowWidths.md} * 2)`), StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, props => math(`${props.theme.space.base} * 2px`), props => retrieveComponentStyles(COMPONENT_ID$7, props));
1165
- StyledSlider.defaultProps = {
1166
- theme: DEFAULT_THEME
1167
- };
1168
-
1169
- const COMPONENT_ID$6 = 'forms.slider_thumb';
1170
- const colorStyles$2 = props => {
1171
- const SHADE = 600;
1172
- const backgroundColor = getColor('primaryHue', SHADE, props.theme);
1173
- const borderColor = backgroundColor;
1174
- const boxShadow = props.theme.shadows.lg(math(`${props.theme.space.base} * 1px`), math(`${props.theme.space.base} * 2px`), getColor('neutralHue', SHADE + 200, props.theme, 0.24));
1175
- const activeBackgroundColor = getColor('primaryHue', SHADE + 100, props.theme);
1176
- const activeBorderColor = borderColor;
1177
- const hoverBackgroundColor = activeBackgroundColor;
1178
- const hoverBorderColor = hoverBackgroundColor;
1179
- const disabledBackgroundColor = getColor('neutralHue', SHADE - 300, props.theme);
1180
- const disabledBorderColor = disabledBackgroundColor;
1181
- return css(["border-color:", ";box-shadow:", ";background-color:", ";&:hover,&[data-garden-hover='true']{border-color:", ";background-color:", ";}", " &:active,&[data-garden-active='true']{border-color:", ";background-color:", ";}&[aria-disabled='true']{border-color:", ";box-shadow:none;background-color:", ";}"], borderColor, boxShadow, backgroundColor, hoverBorderColor, hoverBackgroundColor, focusStyles({
1182
- theme: props.theme
1183
- }), activeBorderColor, activeBackgroundColor, disabledBorderColor, disabledBackgroundColor);
1184
- };
1185
- const sizeStyles$5 = props => {
1186
- const size = math(`${props.theme.space.base} * 5px`);
1187
- const marginTop = math(`${size} / -2`);
1188
- return css(["margin-top:", ";width:", ";height:", ";"], marginTop, size, size);
1189
- };
1190
- const StyledSliderThumb = styled.div.attrs(props => ({
1191
- 'data-garden-id': COMPONENT_ID$6,
1192
- 'data-garden-version': '9.0.0-next.2',
1193
- 'aria-disabled': props.isDisabled
1194
- })).withConfig({
1195
- displayName: "StyledSliderThumb",
1196
- componentId: "sc-yspbwa-0"
1197
- })(["appearance:none;position:absolute;top:50%;", ":", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out;z-index:1;border:", ";border-radius:100%;cursor:inherit;box-sizing:border-box;font-size:0;", ";", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => math(`${props.position} * 1px`), props => props.theme.borders.md, props => sizeStyles$5(props), props => colorStyles$2(props), props => retrieveComponentStyles(COMPONENT_ID$6, props));
1198
- StyledSliderThumb.defaultProps = {
1199
- position: 0,
1200
- theme: DEFAULT_THEME
1201
- };
1202
-
1203
- const COMPONENT_ID$5 = 'forms.slider_track';
1204
- const colorStyles$1 = props => {
1205
- const SHADE = 600;
1206
- const backgroundColor = getColor('neutralHue', SHADE - 400, props.theme);
1207
- const backgroundImageColor = getColor('primaryHue', SHADE, props.theme);
1208
- const disabledBackgroundColor = getColor('neutralHue', SHADE - 300, props.theme);
1209
- return css(["background-color:", ";background-image:linear-gradient(", ",", ");&[aria-disabled='true']{background-image:linear-gradient(", ",", ");}"], backgroundColor, backgroundImageColor, backgroundImageColor, disabledBackgroundColor, disabledBackgroundColor);
1210
- };
1211
- const sizeStyles$4 = props => {
1212
- const height = math(`${props.theme.space.base} * 1.5px`);
1213
- const backgroundPosition = math(`${props.backgroundPosition} * 1px`);
1214
- const backgroundSize = math(`${props.backgroundSize} * 1px`);
1215
- const borderRadius = height;
1216
- const marginTop = math(`${height} / -2`);
1217
- const padding = math(`${props.theme.space.base} * 2.5px`);
1218
- return css(["margin-top:", ";border-radius:", ";background-position:", ";background-size:", ";padding:0 ", ";"], marginTop, borderRadius, backgroundPosition, backgroundSize, padding);
1219
- };
1220
- const StyledSliderTrack = styled.div.attrs(props => ({
1221
- 'data-garden-id': COMPONENT_ID$5,
1222
- 'data-garden-version': '9.0.0-next.2',
1223
- 'aria-disabled': props.isDisabled
1224
- })).withConfig({
1225
- displayName: "StyledSliderTrack",
1226
- componentId: "sc-aw5m6g-0"
1227
- })(["position:absolute;top:50%;box-sizing:border-box;background-origin:content-box;background-repeat:repeat-y;width:100%;", ";", ";", ";"], props => sizeStyles$4(props), props => colorStyles$1(props), props => retrieveComponentStyles(COMPONENT_ID$5, props));
1228
- StyledSliderTrack.defaultProps = {
1229
- backgroundSize: 0,
1230
- backgroundPosition: 0,
1231
- theme: DEFAULT_THEME
1232
- };
1233
-
1234
- const COMPONENT_ID$4 = 'forms.slider_track_rail';
1235
- const sizeStyles$3 = props => {
1236
- const height = math(`${props.theme.space.base} * 1.5px`);
1237
- const margin = math(`${props.theme.space.base} * 2.5px`);
1238
- return css(["margin:0 ", " 0 ", ";height:", ";"], props.theme.rtl ? `-${margin}` : margin, props.theme.rtl ? margin : `-${margin}`, height);
1239
- };
1240
- const StyledSliderTrackRail = styled.div.attrs({
1241
- 'data-garden-id': COMPONENT_ID$4,
1242
- 'data-garden-version': '9.0.0-next.2'
1243
- }).withConfig({
1244
- displayName: "StyledSliderTrackRail",
1245
- componentId: "sc-1o5owbd-0"
1246
- })(["position:relative;", ";", ";"], props => sizeStyles$3(props), props => retrieveComponentStyles(COMPONENT_ID$4, props));
1247
- StyledSliderTrackRail.defaultProps = {
1248
- theme: DEFAULT_THEME
1249
- };
1250
-
1251
- const COMPONENT_ID$3 = 'forms.tile_icon';
1252
- const sizeStyles$2 = props => {
1253
- const iconSize = math(`${props.theme.iconSizes.md} * 2`);
1254
- let position;
1255
- let top;
1256
- let horizontalValue;
1257
- if (!props.isCentered) {
1258
- position = 'absolute';
1259
- top = `${props.theme.space.base * 6}px`;
1260
- horizontalValue = `left: ${props.theme.space.base * 5}px`;
1261
- if (props.theme.rtl) {
1262
- horizontalValue = `right: ${props.theme.space.base * 5}px`;
1263
- }
1264
- }
1265
- return css(["position:", ";top:", ";", ";& > *{width:", ";height:", ";}"], position, top, horizontalValue, iconSize, iconSize);
1266
- };
1267
- const StyledTileIcon = styled.span.attrs({
1268
- 'data-garden-id': COMPONENT_ID$3,
1269
- 'data-garden-version': '9.0.0-next.2'
1270
- }).withConfig({
1271
- displayName: "StyledTileIcon",
1272
- componentId: "sc-1wazhg4-0"
1273
- })(["display:block;transition:color 0.25s ease-in-out;text-align:center;line-height:0;", ";", ";"], props => sizeStyles$2(props), props => retrieveComponentStyles(COMPONENT_ID$3, props));
1274
- StyledTileIcon.defaultProps = {
1275
- theme: DEFAULT_THEME
1276
- };
1277
-
1278
- const COMPONENT_ID$2 = 'forms.tile';
1279
- const colorStyles = props => {
1280
- const SHADE = 600;
1281
- const iconColor = getColor('neutralHue', SHADE, props.theme);
1282
- const color = getColor('neutralHue', SHADE + 200, props.theme);
1283
- const borderColor = getColor('neutralHue', SHADE - 300, props.theme);
1284
- const hoverBackgroundColor = getColor('primaryHue', SHADE, props.theme, 0.08);
1285
- const hoverBorderColor = getColor('primaryHue', SHADE, props.theme);
1286
- const focusBorderColor = hoverBorderColor;
1287
- const activeBackgroundColor = getColor('primaryHue', SHADE, props.theme, 0.2);
1288
- const activeBorderColor = focusBorderColor;
1289
- const disabledBackgroundColor = getColor('neutralHue', SHADE - 500, props.theme);
1290
- const disabledBorderColor = getColor('neutralHue', SHADE - 400, props.theme);
1291
- const disabledColor = getColor('neutralHue', SHADE - 200, props.theme);
1292
- const selectedBorderColor = focusBorderColor;
1293
- const selectedBackgroundColor = selectedBorderColor;
1294
- const selectedHoverBorderColor = getColor('primaryHue', SHADE + 100, props.theme);
1295
- const selectedHoverBackgroundColor = selectedHoverBorderColor;
1296
- const selectedActiveBorderColor = getColor('primaryHue', SHADE + 200, props.theme);
1297
- const selectedActiveBackgroundColor = selectedActiveBorderColor;
1298
- const selectedDisabledBackgroundColor = disabledBorderColor;
1299
- return css(["border:", " ", ";border-color:", ";background-color:", ";color:", ";", "{color:", ";}&:hover:not([aria-disabled='true']){border-color:", ";background-color:", ";", "{color:", ";}}", " &:active:not([aria-disabled='true']){border-color:", ";background-color:", ";", "{color:", ";}}&[data-garden-selected='true']{border-color:", ";background-color:", ";color:", ";", "{color:", ";}}&[data-garden-selected='true']:not([aria-disabled='true']):hover{border-color:", ";background-color:", ";color:", ";", "{color:", ";}}&[data-garden-selected='true']:not([aria-disabled='true']):active{border-color:", ";background-color:", ";color:", ";", "{color:", ";}}&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";", "{color:", ";}}&[data-garden-selected='true'][aria-disabled='true']{background-color:", ";color:", ";", "{color:", ";}}"], props.theme.borders.sm, getColor('neutralHue', SHADE - 300, props.theme), borderColor, props.theme.colors.background, color, StyledTileIcon, iconColor, hoverBorderColor, hoverBackgroundColor, StyledTileIcon, color, focusStyles({
1300
- theme: props.theme,
1301
- hue: focusBorderColor,
1302
- styles: {
1303
- borderColor: focusBorderColor
1304
- },
1305
- selector: `&:focus-within`
1306
- }), activeBorderColor, activeBackgroundColor, StyledTileIcon, color, selectedBorderColor, selectedBackgroundColor, props.theme.colors.background, StyledTileIcon, props.theme.colors.background, selectedHoverBorderColor, selectedHoverBackgroundColor, props.theme.colors.background, StyledTileIcon, props.theme.colors.background, selectedActiveBorderColor, selectedActiveBackgroundColor, props.theme.colors.background, StyledTileIcon, props.theme.colors.background, disabledBorderColor, disabledBackgroundColor, disabledColor, StyledTileIcon, disabledColor, selectedDisabledBackgroundColor, disabledColor, StyledTileIcon, disabledColor);
1307
- };
1308
- const StyledTile = styled.label.attrs(props => ({
1309
- 'data-garden-id': COMPONENT_ID$2,
1310
- 'data-garden-version': '9.0.0-next.2',
1311
- 'data-garden-selected': props.isSelected
1312
- })).withConfig({
1313
- displayName: "StyledTile",
1314
- componentId: "sc-1jjvmxs-0"
1315
- })(["display:block;position:relative;transition:border-color .25s ease-in-out,box-shadow .1s ease-in-out,background-color .25s ease-in-out,color .25s ease-in-out;border-radius:", ";cursor:", ";padding:", "px;direction:", ";min-width:132px;word-break:break-word;", ";", ";"], props => props.theme.borderRadii.md, props => !props.isDisabled && 'pointer', props => props.theme.space.base * 5, props => props.theme.rtl && 'rtl', props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID$2, props));
1316
- StyledTile.defaultProps = {
1317
- theme: DEFAULT_THEME
1318
- };
1319
-
1320
- const COMPONENT_ID$1 = 'forms.tile_description';
1321
- const sizeStyles$1 = props => {
1322
- let marginDirection = 'left';
1323
- let marginValue;
1324
- if (props.theme.rtl) {
1325
- marginDirection = 'right';
1326
- }
1327
- if (!props.isCentered) {
1328
- marginValue = math(`(${props.theme.iconSizes.md} * 2) + ${props.theme.space.base * 5}px`);
1329
- }
1330
- return css(["margin-top:", "px;margin-", ":", ";"], props.theme.space.base, marginDirection, marginValue);
1331
- };
1332
- const StyledTileDescription = styled.span.attrs({
1333
- 'data-garden-id': COMPONENT_ID$1,
1334
- 'data-garden-version': '9.0.0-next.2'
1335
- }).withConfig({
1336
- displayName: "StyledTileDescription",
1337
- componentId: "sc-xfuu7u-0"
1338
- })(["display:block;text-align:", ";line-height:", ";font-size:", ";", ";", ";"], props => props.isCentered && 'center', props => getLineHeight(props.theme.space.base * 4, props.theme.fontSizes.sm), props => props.theme.fontSizes.sm, props => sizeStyles$1(props), props => retrieveComponentStyles(COMPONENT_ID$1, props));
1339
- StyledTileDescription.defaultProps = {
1340
- theme: DEFAULT_THEME
1341
- };
1342
-
1343
- const StyledTileInput = styled.input.withConfig({
1344
- displayName: "StyledTileInput",
1345
- componentId: "sc-1nq2m6q-0"
1346
- })(["position:absolute;border:0;clip:rect(1px,1px,1px,1px);padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
1347
- StyledTileInput.defaultProps = {
1348
- theme: DEFAULT_THEME
1349
- };
1350
-
1351
- const COMPONENT_ID = 'forms.tile_label';
1352
- const sizeStyles = props => {
1353
- let marginDirection = 'left';
1354
- let marginTop = `${props.theme.space.base * 2}px`;
1355
- let marginValue;
1356
- if (props.theme.rtl) {
1357
- marginDirection = 'right';
1358
- }
1359
- if (!props.isCentered) {
1360
- marginValue = math(`(${props.theme.iconSizes.md} * 2) + ${props.theme.space.base * 5}px`);
1361
- marginTop = '0';
1362
- }
1363
- return css(["margin-top:", ";margin-", ":", ";"], marginTop, marginDirection, marginValue);
1364
- };
1365
- const StyledTileLabel = styled.span.attrs({
1366
- 'data-garden-id': COMPONENT_ID,
1367
- 'data-garden-version': '9.0.0-next.2'
1368
- }).withConfig({
1369
- displayName: "StyledTileLabel",
1370
- componentId: "sc-1mypv27-0"
1371
- })(["display:block;text-align:", ";line-height:", ";font-size:", ";font-weight:", ";", ";", ";"], props => props.isCentered && 'center', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
1372
- StyledTileLabel.defaultProps = {
1373
- theme: DEFAULT_THEME
1374
- };
1375
-
1376
- const Field = React__default.forwardRef((props, ref) => {
1377
- const [hasHint, setHasHint] = useState(false);
1378
- const [hasMessage, setHasMessage] = useState(false);
1379
- const [isLabelActive, setIsLabelActive] = useState(false);
1380
- const [isLabelHovered, setIsLabelHovered] = useState(false);
1381
- const multiThumbRangeRef = useRef(null);
1382
- const {
1383
- getInputProps,
1384
- getMessageProps,
1385
- ...propGetters
1386
- } = useField({
1387
- idPrefix: props.id,
1388
- hasHint,
1389
- hasMessage
1390
- });
1391
- const fieldProps = useMemo(() => ({
1392
- ...propGetters,
1393
- getInputProps,
1394
- getMessageProps,
1395
- isLabelActive,
1396
- setIsLabelActive,
1397
- isLabelHovered,
1398
- setIsLabelHovered,
1399
- hasHint,
1400
- setHasHint,
1401
- hasMessage,
1402
- setHasMessage,
1403
- multiThumbRangeRef
1404
- }), [propGetters, getInputProps, getMessageProps, isLabelActive, isLabelHovered, hasHint, hasMessage]);
1405
- return React__default.createElement(FieldContext.Provider, {
1406
- value: fieldProps
1407
- }, React__default.createElement(StyledField, _extends$t({}, props, {
1408
- ref: ref
1409
- })));
1410
- });
1411
- Field.displayName = 'Field';
1412
-
1413
- const FieldsetContext = createContext(undefined);
1414
- const useFieldsetContext = () => {
1415
- const fieldsetContext = useContext(FieldsetContext);
1416
- return fieldsetContext;
1417
- };
1418
-
1419
- const LegendComponent = forwardRef((props, ref) => {
1420
- const fieldsetContext = useFieldsetContext();
1421
- return React__default.createElement(StyledLegend, _extends$t({}, props, fieldsetContext, {
1422
- ref: ref
1423
- }));
1424
- });
1425
- LegendComponent.displayName = 'Fieldset.Legend';
1426
- const Legend = LegendComponent;
1427
-
1428
- const FieldsetComponent = forwardRef((props, ref) => {
1429
- const fieldsetContext = useMemo(() => ({
1430
- isCompact: props.isCompact
1431
- }), [props.isCompact]);
1432
- return React__default.createElement(FieldsetContext.Provider, {
1433
- value: fieldsetContext
1434
- }, React__default.createElement(StyledFieldset, _extends$t({}, props, {
1435
- ref: ref
1436
- })));
1437
- });
1438
- FieldsetComponent.displayName = 'Fieldset';
1439
- FieldsetComponent.propTypes = {
1440
- isCompact: PropTypes.bool
1441
- };
1442
- const Fieldset = FieldsetComponent;
1443
- Fieldset.Legend = Legend;
1444
-
1445
- const InputContext = createContext(undefined);
1446
- const useInputContext = () => {
1447
- return useContext(InputContext);
1448
- };
1449
-
1450
- const Hint = React__default.forwardRef((props, ref) => {
1451
- const {
1452
- hasHint,
1453
- setHasHint,
1454
- getHintProps
1455
- } = useFieldContext() || {};
1456
- const type = useInputContext();
1457
- useEffect(() => {
1458
- if (!hasHint && setHasHint) {
1459
- setHasHint(true);
1460
- }
1461
- return () => {
1462
- if (hasHint && setHasHint) {
1463
- setHasHint(false);
1464
- }
1465
- };
1466
- }, [hasHint, setHasHint]);
1467
- let HintComponent;
1468
- if (type === 'checkbox') {
1469
- HintComponent = StyledCheckHint;
1470
- } else if (type === 'radio') {
1471
- HintComponent = StyledRadioHint;
1472
- } else if (type === 'toggle') {
1473
- HintComponent = StyledToggleHint;
1474
- } else {
1475
- HintComponent = StyledHint;
1476
- }
1477
- let combinedProps = props;
1478
- if (getHintProps) {
1479
- combinedProps = getHintProps(combinedProps);
1480
- }
1481
- return React__default.createElement(HintComponent, _extends$t({
1482
- ref: ref
1483
- }, combinedProps));
1484
- });
1485
- Hint.displayName = 'Hint';
1486
-
1487
- const Label$1 = React__default.forwardRef((props, ref) => {
1488
- const fieldContext = useFieldContext();
1489
- const fieldsetContext = useFieldsetContext();
1490
- const type = useInputContext();
1491
- let combinedProps = props;
1492
- if (fieldContext) {
1493
- combinedProps = fieldContext.getLabelProps(combinedProps);
1494
- if (type === undefined) {
1495
- const {
1496
- setIsLabelActive,
1497
- setIsLabelHovered,
1498
- multiThumbRangeRef
1499
- } = fieldContext;
1500
- combinedProps = {
1501
- ...combinedProps,
1502
- onMouseUp: composeEventHandlers(props.onMouseUp, () => {
1503
- setIsLabelActive(false);
1504
- }),
1505
- onMouseDown: composeEventHandlers(props.onMouseDown, () => {
1506
- setIsLabelActive(true);
1507
- }),
1508
- onMouseEnter: composeEventHandlers(props.onMouseEnter, () => {
1509
- setIsLabelHovered(true);
1510
- }),
1511
- onMouseLeave: composeEventHandlers(props.onMouseLeave, () => {
1512
- setIsLabelHovered(false);
1513
- }),
1514
- onClick: composeEventHandlers(props.onClick, () => {
1515
- multiThumbRangeRef.current && multiThumbRangeRef.current.focus();
1516
- })
1517
- };
1518
- }
1519
- }
1520
- if (fieldsetContext) {
1521
- combinedProps = {
1522
- ...combinedProps,
1523
- isRegular: combinedProps.isRegular === undefined ? true : combinedProps.isRegular
1524
- };
1525
- }
1526
- if (type === 'radio') {
1527
- return React__default.createElement(StyledRadioLabel, _extends$t({
1528
- ref: ref
1529
- }, combinedProps), React__default.createElement(StyledRadioSvg, null), props.children);
1530
- } else if (type === 'checkbox') {
1531
- const onLabelSelect = e => {
1532
- const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
1533
- if (fieldContext && isFirefox && e.target instanceof Element) {
1534
- const inputId = e.target.getAttribute('for');
1535
- if (!inputId) return;
1536
- const input = document.getElementById(inputId);
1537
- if (input && input.type === 'checkbox') {
1538
- if (e.shiftKey) {
1539
- input.click();
1540
- input.checked = true;
1541
- }
1542
- input.focus();
1543
- }
1544
- }
1545
- };
1546
- combinedProps = {
1547
- ...combinedProps,
1548
- onClick: composeEventHandlers(combinedProps.onClick, onLabelSelect)
1549
- };
1550
- return React__default.createElement(StyledCheckLabel, _extends$t({
1551
- ref: ref
1552
- }, combinedProps), React__default.createElement(StyledCheckSvg, null), React__default.createElement(StyledDashSvg, null), props.children);
1553
- } else if (type === 'toggle') {
1554
- return React__default.createElement(StyledToggleLabel, _extends$t({
1555
- ref: ref
1556
- }, combinedProps), React__default.createElement(StyledToggleSvg, null), props.children);
1557
- }
1558
- return React__default.createElement(StyledLabel, _extends$t({
1559
- ref: ref
1560
- }, combinedProps));
1561
- });
1562
- Label$1.displayName = 'Label';
1563
- Label$1.propTypes = {
1564
- isRegular: PropTypes.bool
1565
- };
1566
-
1567
- const VALIDATION = ['success', 'warning', 'error'];
1568
- const FILE_VALIDATION = ['success', 'error'];
1569
- const FILE_TYPE = ['pdf', 'zip', 'image', 'document', 'spreadsheet', 'presentation', 'generic'];
1570
-
1571
- const Message = React__default.forwardRef((_ref, ref) => {
1572
- let {
1573
- validation,
1574
- validationLabel,
1575
- children,
1576
- ...props
1577
- } = _ref;
1578
- const {
1579
- hasMessage,
1580
- setHasMessage,
1581
- getMessageProps
1582
- } = useFieldContext() || {};
1583
- const type = useInputContext();
1584
- useEffect(() => {
1585
- if (!hasMessage && setHasMessage) {
1586
- setHasMessage(true);
1587
- }
1588
- return () => {
1589
- if (hasMessage && setHasMessage) {
1590
- setHasMessage(false);
1591
- }
1592
- };
1593
- }, [hasMessage, setHasMessage]);
1594
- let MessageComponent;
1595
- if (type === 'checkbox') {
1596
- MessageComponent = StyledCheckMessage;
1597
- } else if (type === 'radio') {
1598
- MessageComponent = StyledRadioMessage;
1599
- } else if (type === 'toggle') {
1600
- MessageComponent = StyledToggleMessage;
1601
- } else {
1602
- MessageComponent = StyledMessage;
1603
- }
1604
- let combinedProps = {
1605
- validation,
1606
- validationLabel,
1607
- ...props
1608
- };
1609
- if (getMessageProps) {
1610
- combinedProps = getMessageProps(combinedProps);
1611
- }
1612
- const ariaLabel = useText(Message, combinedProps, 'validationLabel', validation, validation !== undefined);
1613
- return React__default.createElement(MessageComponent, _extends$t({
1614
- ref: ref
1615
- }, combinedProps), validation && React__default.createElement(StyledMessageIcon, {
1616
- validation: validation,
1617
- "aria-label": ariaLabel
1618
- }), children);
1619
- });
1620
- Message.displayName = 'Message';
1621
- Message.propTypes = {
1622
- validation: PropTypes.oneOf(VALIDATION),
1623
- validationLabel: PropTypes.string
1624
- };
1625
-
1626
- const Checkbox = React__default.forwardRef((_ref, ref) => {
1627
- let {
1628
- indeterminate,
1629
- children,
1630
- ...props
1631
- } = _ref;
1632
- const fieldsetContext = useFieldsetContext();
1633
- const fieldContext = useFieldContext();
1634
- const inputRef = inputElement => {
1635
- inputElement && (inputElement.indeterminate = indeterminate);
1636
- };
1637
- const combinedRef = inputElement => {
1638
- [inputRef, ref].forEach(targetRef => {
1639
- if (targetRef) {
1640
- if (typeof targetRef === 'function') {
1641
- targetRef(inputElement);
1642
- } else {
1643
- targetRef.current = inputElement;
1644
- }
1645
- }
1646
- });
1647
- };
1648
- let combinedProps = {
1649
- ref: combinedRef,
1650
- ...props,
1651
- ...fieldsetContext
1652
- };
1653
- if (fieldContext) {
1654
- combinedProps = fieldContext.getInputProps(combinedProps);
1655
- }
1656
- return React__default.createElement(InputContext.Provider, {
1657
- value: "checkbox"
1658
- }, React__default.createElement(StyledCheckInput, combinedProps), children);
1659
- });
1660
- Checkbox.displayName = 'Checkbox';
1661
- Checkbox.propTypes = {
1662
- isCompact: PropTypes.bool,
1663
- indeterminate: PropTypes.bool
1664
- };
1665
-
1666
- const InputGroupContext = createContext(undefined);
1667
- const useInputGroupContext = () => {
1668
- return useContext(InputGroupContext);
1669
- };
1670
-
1671
- const Input = React__default.forwardRef((_ref, ref) => {
1672
- let {
1673
- onSelect,
1674
- ...props
1675
- } = _ref;
1676
- const fieldContext = useFieldContext();
1677
- const inputGroupContext = useInputGroupContext();
1678
- const onSelectHandler = props.readOnly ? composeEventHandlers(onSelect, event => {
1679
- event.currentTarget.select();
1680
- }) : onSelect;
1681
- let combinedProps = {
1682
- ref,
1683
- onSelect: onSelectHandler,
1684
- ...props
1685
- };
1686
- if (inputGroupContext) {
1687
- combinedProps = {
1688
- ...combinedProps,
1689
- isCompact: inputGroupContext.isCompact || combinedProps.isCompact,
1690
- focusInset: props.focusInset === undefined ? true : props.focusInset
1691
- };
1692
- }
1693
- if (fieldContext) {
1694
- combinedProps = fieldContext.getInputProps(combinedProps);
1695
- }
1696
- return React__default.createElement(StyledTextInput, combinedProps);
1697
- });
1698
- Input.propTypes = {
1699
- isCompact: PropTypes.bool,
1700
- isBare: PropTypes.bool,
1701
- focusInset: PropTypes.bool,
1702
- validation: PropTypes.oneOf(VALIDATION)
1703
- };
1704
- Input.displayName = 'Input';
1705
-
1706
- const Radio = React__default.forwardRef((_ref, ref) => {
1707
- let {
1708
- children,
1709
- ...props
1710
- } = _ref;
1711
- const fieldsetContext = useFieldsetContext();
1712
- const fieldContext = useFieldContext();
1713
- let combinedProps = {
1714
- ref,
1715
- ...props,
1716
- ...fieldsetContext
1717
- };
1718
- if (fieldContext) {
1719
- combinedProps = fieldContext.getInputProps(combinedProps);
1720
- }
1721
- return React__default.createElement(InputContext.Provider, {
1722
- value: "radio"
1723
- }, React__default.createElement(StyledRadioInput, combinedProps), children);
1724
- });
1725
- Radio.displayName = 'Radio';
1726
- Radio.propTypes = {
1727
- isCompact: PropTypes.bool
1728
- };
1729
-
1730
- const Range = React__default.forwardRef((_ref, ref) => {
1731
- let {
1732
- hasLowerTrack,
1733
- min,
1734
- max,
1735
- step,
1736
- ...props
1737
- } = _ref;
1738
- const [backgroundSize, setBackgroundSize] = useState('0');
1739
- const rangeRef = useRef();
1740
- const fieldContext = useFieldContext();
1741
- const updateBackgroundWidthFromInput = useCallback(rangeTarget => {
1742
- let relativeMax = max;
1743
- const {
1744
- value
1745
- } = rangeTarget;
1746
- if (parseFloat(relativeMax) < parseFloat(min)) {
1747
- relativeMax = 100;
1748
- }
1749
- const percentage = 100 * (value - min) / (relativeMax - min);
1750
- setBackgroundSize(`${percentage}%`);
1751
- },
1752
- [max, min, step]);
1753
- useEffect(() => {
1754
- updateBackgroundWidthFromInput(rangeRef.current);
1755
- }, [rangeRef, updateBackgroundWidthFromInput, props.value]);
1756
- const onChange = hasLowerTrack ? composeEventHandlers(props.onChange, event => {
1757
- updateBackgroundWidthFromInput(event.target);
1758
- }) : props.onChange;
1759
- let combinedProps = {
1760
- ref: mergeRefs([rangeRef, ref]),
1761
- hasLowerTrack,
1762
- min,
1763
- max,
1764
- step,
1765
- backgroundSize,
1766
- ...props,
1767
- onChange
1768
- };
1769
- if (fieldContext) {
1770
- combinedProps = fieldContext.getInputProps(combinedProps);
1771
- }
1772
- return React__default.createElement(StyledRangeInput, combinedProps);
1773
- });
1774
- Range.defaultProps = {
1775
- hasLowerTrack: true,
1776
- min: 0,
1777
- max: 100,
1778
- step: 1
1779
- };
1780
- Range.displayName = 'Range';
1781
-
1782
- const parseStyleValue = value => {
1783
- return parseInt(value, 10) || 0;
1784
- };
1785
- const Textarea = React__default.forwardRef((_ref, ref) => {
1786
- let {
1787
- minRows,
1788
- maxRows,
1789
- style,
1790
- onChange,
1791
- onSelect,
1792
- ...props
1793
- } = _ref;
1794
- const fieldContext = useFieldContext();
1795
- const textAreaRef = useRef();
1796
- const shadowTextAreaRef = useRef(null);
1797
- const [state, setState] = useState({
1798
- overflow: false,
1799
- height: 0
1800
- });
1801
- const isControlled = props.value !== null && props.value !== undefined;
1802
- const isAutoResizable = (minRows !== undefined || maxRows !== undefined) && !props.isResizable;
1803
- const calculateHeight = useCallback(() => {
1804
- if (!isAutoResizable) {
1805
- return;
1806
- }
1807
- const textarea = textAreaRef.current;
1808
- const computedStyle = window.getComputedStyle(textarea);
1809
- const shadowTextArea = shadowTextAreaRef.current;
1810
- shadowTextArea.style.width = computedStyle.width;
1811
- shadowTextArea.value = textarea.value || textarea.placeholder || ' ';
1812
- const boxSizing = computedStyle.boxSizing;
1813
- const padding = parseStyleValue(computedStyle.paddingBottom) + parseStyleValue(computedStyle.paddingTop);
1814
- const border = parseStyleValue(computedStyle.borderTopWidth) + parseStyleValue(computedStyle.borderBottomWidth);
1815
- const innerHeight = shadowTextArea.scrollHeight - padding;
1816
- shadowTextArea.value = 'x';
1817
- const singleRowHeight = shadowTextArea.scrollHeight - padding;
1818
- let outerHeight = innerHeight;
1819
- if (minRows) {
1820
- outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight);
1821
- }
1822
- if (maxRows) {
1823
- outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight);
1824
- }
1825
- outerHeight = Math.max(outerHeight, singleRowHeight);
1826
- const updatedHeight = outerHeight + (boxSizing === 'border-box' ? padding + border : 0);
1827
- const overflow = Math.abs(outerHeight - innerHeight) <= 1;
1828
- setState(prevState => {
1829
- if (updatedHeight > 0 && Math.abs((prevState.height || 0) - updatedHeight) > 1 || prevState.overflow !== overflow) {
1830
- return {
1831
- overflow,
1832
- height: updatedHeight
1833
- };
1834
- }
1835
- return prevState;
1836
- });
1837
- }, [maxRows, minRows, textAreaRef, isAutoResizable]);
1838
- const onChangeHandler = useCallback(e => {
1839
- if (!isControlled) {
1840
- calculateHeight();
1841
- }
1842
- if (onChange) {
1843
- onChange(e);
1844
- }
1845
- }, [calculateHeight, isControlled, onChange]);
1846
- useLayoutEffect(() => {
1847
- calculateHeight();
1848
- });
1849
- const computedStyle = {};
1850
- if (isAutoResizable) {
1851
- computedStyle.height = state.height;
1852
- computedStyle.overflow = state.overflow ? 'hidden' : undefined;
1853
- }
1854
- const onSelectHandler = props.readOnly ? composeEventHandlers(onSelect, event => {
1855
- event.currentTarget.select();
1856
- }) : onSelect;
1857
- let combinedProps = {
1858
- ref: mergeRefs([textAreaRef, ref]),
1859
- rows: minRows,
1860
- onChange: onChangeHandler,
1861
- onSelect: onSelectHandler,
1862
- style: {
1863
- ...computedStyle,
1864
- ...style
1865
- },
1866
- ...props
1867
- };
1868
- if (fieldContext) {
1869
- combinedProps = fieldContext.getInputProps(combinedProps);
1870
- }
1871
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledTextarea, combinedProps), isAutoResizable && React__default.createElement(StyledTextarea, {
1872
- "aria-hidden": true,
1873
- readOnly: true,
1874
- isHidden: true,
1875
- className: props.className,
1876
- ref: shadowTextAreaRef,
1877
- tabIndex: -1,
1878
- isBare: props.isBare,
1879
- isCompact: props.isCompact,
1880
- style: style
1881
- }));
1882
- });
1883
- Textarea.propTypes = {
1884
- isCompact: PropTypes.bool,
1885
- isBare: PropTypes.bool,
1886
- focusInset: PropTypes.bool,
1887
- isResizable: PropTypes.bool,
1888
- minRows: PropTypes.number,
1889
- maxRows: PropTypes.number,
1890
- validation: PropTypes.oneOf(VALIDATION)
1891
- };
1892
- Textarea.displayName = 'Textarea';
1893
-
1894
- const Toggle = React__default.forwardRef((_ref, ref) => {
1895
- let {
1896
- children,
1897
- ...props
1898
- } = _ref;
1899
- const fieldsetContext = useFieldsetContext();
1900
- const fieldContext = useFieldContext();
1901
- let combinedProps = {
1902
- ref,
1903
- ...props,
1904
- ...fieldsetContext
1905
- };
1906
- if (fieldContext) {
1907
- combinedProps = fieldContext.getInputProps(combinedProps);
1908
- }
1909
- return React__default.createElement(InputContext.Provider, {
1910
- value: "toggle"
1911
- }, React__default.createElement(StyledToggleInput, combinedProps), children);
1912
- });
1913
- Toggle.displayName = 'Toggle';
1914
- Toggle.propTypes = {
1915
- isCompact: PropTypes.bool
1916
- };
1917
-
1918
- var _path$k;
1919
- function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
1920
- var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
1921
- return /*#__PURE__*/React.createElement("svg", _extends$l({
1922
- xmlns: "http://www.w3.org/2000/svg",
1923
- width: 16,
1924
- height: 16,
1925
- focusable: "false",
1926
- viewBox: "0 0 16 16",
1927
- "aria-hidden": "true"
1928
- }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
1929
- fill: "currentColor",
1930
- d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
1931
- })));
1932
- };
1933
-
1934
- const StartIconComponent = props => React__default.createElement(StyledTextMediaFigure, _extends$t({
1935
- position: "start"
1936
- }, props));
1937
- StartIconComponent.displayName = 'FauxInput.StartIcon';
1938
- const StartIcon = StartIconComponent;
1939
-
1940
- const EndIconComponent = props => React__default.createElement(StyledTextMediaFigure, _extends$t({
1941
- position: "end"
1942
- }, props));
1943
- EndIconComponent.displayName = 'FauxInput.EndIcon';
1944
- const EndIcon = EndIconComponent;
1945
-
1946
- const FauxInputComponent = forwardRef((_ref, ref) => {
1947
- let {
1948
- onFocus,
1949
- onBlur,
1950
- disabled,
1951
- readOnly,
1952
- isFocused: controlledIsFocused,
1953
- ...props
1954
- } = _ref;
1955
- const [isFocused, setIsFocused] = useState(false);
1956
- const onFocusHandler = composeEventHandlers(onFocus, () => {
1957
- setIsFocused(true);
1958
- });
1959
- const onBlurHandler = composeEventHandlers(onBlur, () => {
1960
- setIsFocused(false);
1961
- });
1962
- return React__default.createElement(StyledTextFauxInput, _extends$t({
1963
- onFocus: onFocusHandler,
1964
- onBlur: onBlurHandler,
1965
- isFocused: controlledIsFocused === undefined ? isFocused : controlledIsFocused,
1966
- isReadOnly: readOnly,
1967
- isDisabled: disabled,
1968
- tabIndex: disabled ? undefined : 0
1969
- }, props, {
1970
- ref: ref
1971
- }));
1972
- });
1973
- FauxInputComponent.displayName = 'FauxInput';
1974
- FauxInputComponent.propTypes = {
1975
- isCompact: PropTypes.bool,
1976
- isBare: PropTypes.bool,
1977
- focusInset: PropTypes.bool,
1978
- disabled: PropTypes.bool,
1979
- readOnly: PropTypes.bool,
1980
- validation: PropTypes.oneOf(VALIDATION),
1981
- isFocused: PropTypes.bool,
1982
- isHovered: PropTypes.bool
1983
- };
1984
- const FauxInput = FauxInputComponent;
1985
- FauxInput.EndIcon = EndIcon;
1986
- FauxInput.StartIcon = StartIcon;
1987
-
1988
- const Select = React__default.forwardRef((_ref, ref) => {
1989
- let {
1990
- disabled,
1991
- isCompact,
1992
- validation,
1993
- focusInset,
1994
- isBare,
1995
- ...props
1996
- } = _ref;
1997
- const fieldContext = useFieldContext();
1998
- let combinedProps = {
1999
- disabled,
2000
- isBare,
2001
- isCompact,
2002
- validation,
2003
- focusInset,
2004
- ref,
2005
- ...props
2006
- };
2007
- if (fieldContext) {
2008
- combinedProps = fieldContext.getInputProps(combinedProps);
2009
- }
2010
- return React__default.createElement(StyledSelectWrapper, {
2011
- isCompact: isCompact,
2012
- isBare: isBare,
2013
- validation: validation,
2014
- focusInset: focusInset
2015
- }, React__default.createElement(StyledSelect, combinedProps), !isBare && React__default.createElement(FauxInput.EndIcon, {
2016
- isDisabled: disabled
2017
- }, React__default.createElement(SvgChevronDownStroke, null)));
2018
- });
2019
- Select.propTypes = {
2020
- isCompact: PropTypes.bool,
2021
- isBare: PropTypes.bool,
2022
- focusInset: PropTypes.bool,
2023
- validation: PropTypes.oneOf(VALIDATION)
2024
- };
2025
- Select.displayName = 'Select';
2026
-
2027
- const MIN = 0;
2028
- const MAX = 100;
2029
- const MultiThumbRange = forwardRef((_ref, ref) => {
2030
- let {
2031
- min = MIN,
2032
- max = MAX,
2033
- minValue,
2034
- maxValue,
2035
- disabled,
2036
- step,
2037
- jump,
2038
- onChange,
2039
- onMouseDown,
2040
- ...props
2041
- } = _ref;
2042
- const theme = useContext(ThemeContext);
2043
- const environment = useDocument(theme);
2044
- const trackRailRef = useRef(null);
2045
- const minThumbRef = useRef(null);
2046
- const maxThumbRef = useRef(null);
2047
- const {
2048
- getTrackProps,
2049
- getMinThumbProps,
2050
- getMaxThumbProps,
2051
- trackRect,
2052
- minValue: updatedMinValue,
2053
- maxValue: updatedMaxValue
2054
- } = useSlider({
2055
- trackRef: trackRailRef,
2056
- minThumbRef,
2057
- maxThumbRef,
2058
- min,
2059
- max,
2060
- minValue,
2061
- maxValue,
2062
- onChange,
2063
- step,
2064
- jump,
2065
- disabled,
2066
- rtl: theme.rtl,
2067
- environment
2068
- });
2069
- const {
2070
- onMouseDown: onSliderMouseDown,
2071
- ...trackProps
2072
- } = getTrackProps({
2073
- onMouseDown
2074
- });
2075
- const fieldContext = useFieldContext();
2076
- const {
2077
- isLabelHovered,
2078
- isLabelActive,
2079
- multiThumbRangeRef
2080
- } = fieldContext || {};
2081
- useEffect(() => {
2082
- if (multiThumbRangeRef) {
2083
- multiThumbRangeRef.current = minThumbRef.current;
2084
- }
2085
- }, [multiThumbRangeRef]);
2086
- const minPosition = (updatedMinValue - min) / (max - min) * trackRect.width;
2087
- const maxPosition = (updatedMaxValue - min) / (max - min) * trackRect.width;
2088
- const sliderBackgroundSize = Math.abs(maxPosition) - Math.abs(minPosition);
2089
- return React__default.createElement(StyledSlider, _extends$t({
2090
- ref: ref,
2091
- onMouseDown: onSliderMouseDown
2092
- }, props), React__default.createElement(StyledSliderTrack, {
2093
- backgroundSize: sliderBackgroundSize,
2094
- backgroundPosition: theme.rtl ? trackRect.width - maxPosition : minPosition,
2095
- isDisabled: disabled
2096
- }, React__default.createElement(StyledSliderTrackRail, _extends$t({}, trackProps, {
2097
- ref: trackRailRef
2098
- }), React__default.createElement(StyledSliderThumb, _extends$t({}, getMinThumbProps({
2099
- 'aria-label': updatedMinValue
2100
- }), {
2101
- isDisabled: disabled,
2102
- position: minPosition,
2103
- ref: minThumbRef,
2104
- "data-garden-active": isLabelActive,
2105
- "data-garden-hover": isLabelHovered
2106
- })), React__default.createElement(StyledSliderThumb, _extends$t({}, getMaxThumbProps({
2107
- 'aria-label': updatedMaxValue
2108
- }), {
2109
- isDisabled: disabled,
2110
- position: maxPosition,
2111
- ref: maxThumbRef
2112
- })))));
2113
- });
2114
- MultiThumbRange.displayName = 'MultiThumbRange';
2115
- MultiThumbRange.propTypes = {
2116
- min: PropTypes.number,
2117
- max: PropTypes.number,
2118
- minValue: PropTypes.number,
2119
- maxValue: PropTypes.number,
2120
- step: PropTypes.number,
2121
- jump: PropTypes.number,
2122
- disabled: PropTypes.bool,
2123
- onChange: PropTypes.func
2124
- };
2125
- MultiThumbRange.defaultProps = {
2126
- min: MIN,
2127
- max: MAX,
2128
- step: 1
2129
- };
2130
-
2131
- const TilesContext = createContext(undefined);
2132
- const useTilesContext = () => {
2133
- return useContext(TilesContext);
2134
- };
2135
-
2136
- const TileComponent = React__default.forwardRef((_ref, ref) => {
2137
- let {
2138
- children,
2139
- value,
2140
- disabled,
2141
- ...props
2142
- } = _ref;
2143
- const tilesContext = useTilesContext();
2144
- const inputRef = useRef(null);
2145
- let inputProps;
2146
- if (tilesContext) {
2147
- inputProps = {
2148
- name: tilesContext.name,
2149
- checked: tilesContext.value === value,
2150
- onChange: tilesContext.onChange
2151
- };
2152
- }
2153
- return React__default.createElement(StyledTile, _extends$t({
2154
- ref: ref,
2155
- "aria-disabled": disabled,
2156
- isDisabled: disabled,
2157
- isSelected: tilesContext && tilesContext.value === value
2158
- }, props), children, React__default.createElement(StyledTileInput, _extends$t({}, inputProps, {
2159
- disabled: disabled,
2160
- value: value,
2161
- type: "radio",
2162
- ref: inputRef
2163
- })));
2164
- });
2165
- TileComponent.displayName = 'Tiles.Tile';
2166
- TileComponent.propTypes = {
2167
- value: PropTypes.string,
2168
- disabled: PropTypes.bool
2169
- };
2170
- const Tile = TileComponent;
2171
-
2172
- const DescriptionComponent = forwardRef((props, ref) => {
2173
- const tilesContext = useTilesContext();
2174
- return React__default.createElement(StyledTileDescription, _extends$t({
2175
- ref: ref,
2176
- isCentered: tilesContext && tilesContext.isCentered
2177
- }, props));
2178
- });
2179
- DescriptionComponent.displayName = 'Tiles.Description';
2180
- const Description = DescriptionComponent;
2181
-
2182
- const IconComponent = forwardRef((props, ref) => {
2183
- const tileContext = useTilesContext();
2184
- return React__default.createElement(StyledTileIcon, _extends$t({
2185
- ref: ref,
2186
- isCentered: tileContext && tileContext.isCentered
2187
- }, props));
2188
- });
2189
- IconComponent.displayName = 'Tiles.Icon';
2190
- const Icon = IconComponent;
2191
-
2192
- const LabelComponent = forwardRef((props, forwardedRef) => {
2193
- const [title, setTitle] = useState('');
2194
- const ref = useRef();
2195
- const tilesContext = useTilesContext();
2196
- useEffect(() => {
2197
- if (ref.current) {
2198
- setTitle(ref.current.textContent || undefined);
2199
- }
2200
- }, [ref]);
2201
- return React__default.createElement(StyledTileLabel, _extends$t({
2202
- ref: mergeRefs([ref, forwardedRef]),
2203
- title: title,
2204
- isCentered: tilesContext && tilesContext.isCentered
2205
- }, props));
2206
- });
2207
- LabelComponent.displayName = 'Tiles.Label';
2208
- const Label = LabelComponent;
2209
-
2210
- const TilesComponent = forwardRef((_ref, ref) => {
2211
- let {
2212
- onChange,
2213
- value: controlledValue,
2214
- name,
2215
- isCentered,
2216
- ...props
2217
- } = _ref;
2218
- const [value, setValue] = useState(controlledValue);
2219
- const handleOnChange = useCallback(function () {
2220
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2221
- args[_key] = arguments[_key];
2222
- }
2223
- setValue(args[0].target.value);
2224
- if (onChange) {
2225
- onChange(...args);
2226
- }
2227
- }, [onChange]);
2228
- const selectedValue = getControlledValue(controlledValue, value);
2229
- const tileContext = useMemo(() => ({
2230
- onChange: handleOnChange,
2231
- value: selectedValue,
2232
- name,
2233
- isCentered
2234
- }), [handleOnChange, selectedValue, name, isCentered]);
2235
- return React__default.createElement(TilesContext.Provider, {
2236
- value: tileContext
2237
- }, React__default.createElement("div", _extends$t({
2238
- ref: ref,
2239
- role: "radiogroup"
2240
- }, props)));
2241
- });
2242
- TilesComponent.displayName = 'Tiles';
2243
- TilesComponent.propTypes = {
2244
- value: PropTypes.string,
2245
- onChange: PropTypes.func,
2246
- name: PropTypes.string.isRequired,
2247
- isCentered: PropTypes.bool
2248
- };
2249
- TilesComponent.defaultProps = {
2250
- isCentered: true
2251
- };
2252
- const Tiles = TilesComponent;
2253
- Tiles.Description = Description;
2254
- Tiles.Icon = Icon;
2255
- Tiles.Label = Label;
2256
- Tiles.Tile = Tile;
2257
-
2258
- const InputGroup = React__default.forwardRef((_ref, ref) => {
2259
- let {
2260
- isCompact,
2261
- ...props
2262
- } = _ref;
2263
- const contextValue = useMemo(() => ({
2264
- isCompact
2265
- }), [isCompact]);
2266
- return React__default.createElement(InputGroupContext.Provider, {
2267
- value: contextValue
2268
- }, React__default.createElement(StyledInputGroup, _extends$t({
2269
- ref: ref,
2270
- isCompact: isCompact
2271
- }, props)));
2272
- });
2273
- InputGroup.displayName = 'InputGroup';
2274
- InputGroup.propTypes = {
2275
- isCompact: PropTypes.bool
2276
- };
2277
-
2278
- const FileUpload = React__default.forwardRef((_ref, ref) => {
2279
- let {
2280
- disabled,
2281
- ...props
2282
- } = _ref;
2283
- return (
2284
- React__default.createElement(StyledFileUpload, _extends$t({
2285
- ref: ref,
2286
- "aria-disabled": disabled
2287
- }, props, {
2288
- role: "button"
2289
- }))
2290
- );
2291
- });
2292
- FileUpload.propTypes = {
2293
- isDragging: PropTypes.bool,
2294
- isCompact: PropTypes.bool,
2295
- disabled: PropTypes.bool
2296
- };
2297
- FileUpload.displayName = 'FileUpload';
2298
-
2299
- const ItemComponent = forwardRef((_ref, ref) => {
2300
- let {
2301
- ...props
2302
- } = _ref;
2303
- return React__default.createElement(StyledFileListItem, _extends$t({}, props, {
2304
- ref: ref
2305
- }));
2306
- });
2307
- ItemComponent.displayName = 'FileList.Item';
2308
- const Item = ItemComponent;
2309
-
2310
- const FileListComponent = forwardRef((_ref, ref) => {
2311
- let {
2312
- ...props
2313
- } = _ref;
2314
- return React__default.createElement(StyledFileList, _extends$t({}, props, {
2315
- ref: ref
2316
- }));
2317
- });
2318
- FileListComponent.displayName = 'FileList';
2319
- const FileList = FileListComponent;
2320
- FileList.Item = Item;
2321
-
2322
- var _path$j;
2323
- function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
2324
- var SvgXStroke$1 = function SvgXStroke(props) {
2325
- return /*#__PURE__*/React.createElement("svg", _extends$k({
2326
- xmlns: "http://www.w3.org/2000/svg",
2327
- width: 12,
2328
- height: 12,
2329
- focusable: "false",
2330
- viewBox: "0 0 12 12",
2331
- "aria-hidden": "true"
2332
- }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
2333
- stroke: "currentColor",
2334
- strokeLinecap: "round",
2335
- d: "M3 9l6-6m0 6L3 3"
2336
- })));
2337
- };
2338
-
2339
- var _path$i;
2340
- function _extends$j() { _extends$j = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
2341
- var SvgXStroke = function SvgXStroke(props) {
2342
- return /*#__PURE__*/React.createElement("svg", _extends$j({
2343
- xmlns: "http://www.w3.org/2000/svg",
2344
- width: 16,
2345
- height: 16,
2346
- focusable: "false",
2347
- viewBox: "0 0 16 16",
2348
- "aria-hidden": "true"
2349
- }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
2350
- stroke: "currentColor",
2351
- strokeLinecap: "round",
2352
- d: "M3 13L13 3m0 10L3 3"
2353
- })));
2354
- };
2355
-
2356
- const FileContext = createContext(undefined);
2357
- const useFileContext = () => {
2358
- return useContext(FileContext);
2359
- };
2360
-
2361
- const CloseComponent = React__default.forwardRef((props, ref) => {
2362
- const fileContext = useFileContext();
2363
- const onMouseDown = composeEventHandlers(props.onMouseDown, event => event.preventDefault()
2364
- );
2365
- const ariaLabel = useText(CloseComponent, props, 'aria-label', 'Close');
2366
- return React__default.createElement(StyledFileClose, _extends$t({
2367
- ref: ref,
2368
- "aria-label": ariaLabel
2369
- }, props, {
2370
- type: "button",
2371
- tabIndex: -1,
2372
- onMouseDown: onMouseDown
2373
- }), fileContext && fileContext.isCompact ? React__default.createElement(SvgXStroke$1, null) : React__default.createElement(SvgXStroke, null));
2374
- });
2375
- CloseComponent.displayName = 'File.Close';
2376
- const Close = CloseComponent;
2377
-
2378
- var _path$h;
2379
- function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
2380
- var SvgTrashStroke$1 = function SvgTrashStroke(props) {
2381
- return /*#__PURE__*/React.createElement("svg", _extends$i({
2382
- xmlns: "http://www.w3.org/2000/svg",
2383
- width: 12,
2384
- height: 12,
2385
- focusable: "false",
2386
- viewBox: "0 0 12 12",
2387
- "aria-hidden": "true"
2388
- }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
2389
- fill: "none",
2390
- stroke: "currentColor",
2391
- strokeLinecap: "round",
2392
- d: "M4.5 2.5V1c0-.3.2-.5.5-.5h2c.3 0 .5.2.5.5v1.5M2 2.5h8m-5.5 7V5m3 4.5V5m-5-.5V11c0 .3.2.5.5.5h6c.3 0 .5-.2.5-.5V4.5"
2393
- })));
2394
- };
2395
-
2396
- var _path$g;
2397
- function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
2398
- var SvgTrashStroke = function SvgTrashStroke(props) {
2399
- return /*#__PURE__*/React.createElement("svg", _extends$h({
2400
- xmlns: "http://www.w3.org/2000/svg",
2401
- width: 16,
2402
- height: 16,
2403
- focusable: "false",
2404
- viewBox: "0 0 16 16",
2405
- "aria-hidden": "true"
2406
- }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
2407
- fill: "none",
2408
- stroke: "currentColor",
2409
- strokeLinecap: "round",
2410
- d: "M6.5 2.5V1c0-.3.2-.5.5-.5h2c.3 0 .5.2.5.5v1.5M3 2.5h10m-6.5 11v-8m3 8v-8m-6-1V15c0 .3.2.5.5.5h8c.3 0 .5-.2.5-.5V4.5"
2411
- })));
2412
- };
2413
-
2414
- const DeleteComponent = React__default.forwardRef((props, ref) => {
2415
- const fileContext = useFileContext();
2416
- const onMouseDown = composeEventHandlers(props.onMouseDown, event => event.preventDefault()
2417
- );
2418
- const ariaLabel = useText(DeleteComponent, props, 'aria-label', 'Delete');
2419
- return React__default.createElement(StyledFileDelete, _extends$t({
2420
- ref: ref,
2421
- "aria-label": ariaLabel
2422
- }, props, {
2423
- type: "button",
2424
- tabIndex: -1,
2425
- onMouseDown: onMouseDown
2426
- }), fileContext && fileContext.isCompact ? React__default.createElement(SvgTrashStroke$1, null) : React__default.createElement(SvgTrashStroke, null));
2427
- });
2428
- DeleteComponent.displayName = 'File.Delete';
2429
- const Delete = DeleteComponent;
2430
-
2431
- var _path$f, _rect$1;
2432
- function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
2433
- var SvgFilePdfStroke$1 = function SvgFilePdfStroke(props) {
2434
- return /*#__PURE__*/React.createElement("svg", _extends$g({
2435
- xmlns: "http://www.w3.org/2000/svg",
2436
- width: 12,
2437
- height: 12,
2438
- focusable: "false",
2439
- viewBox: "0 0 12 12",
2440
- "aria-hidden": "true"
2441
- }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
2442
- fill: "none",
2443
- stroke: "currentColor",
2444
- strokeLinecap: "round",
2445
- d: "M10.5 3.21V11a.5.5 0 01-.5.5H2a.5.5 0 01-.5-.5V1A.5.5 0 012 .5h5.79a.5.5 0 01.35.15l2.21 2.21a.5.5 0 01.15.35zM7.5.5V3a.5.5 0 00.5.5h2.5m-7 6h5"
2446
- })), _rect$1 || (_rect$1 = /*#__PURE__*/React.createElement("rect", {
2447
- width: 6,
2448
- height: 3,
2449
- x: 3,
2450
- y: 5,
2451
- fill: "currentColor",
2452
- rx: 0.5,
2453
- ry: 0.5
2454
- })));
2455
- };
2456
-
2457
- var _path$e;
2458
- function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
2459
- var SvgFileZipStroke$1 = function SvgFileZipStroke(props) {
2460
- return /*#__PURE__*/React.createElement("svg", _extends$f({
2461
- xmlns: "http://www.w3.org/2000/svg",
2462
- width: 12,
2463
- height: 12,
2464
- focusable: "false",
2465
- viewBox: "0 0 12 12",
2466
- "aria-hidden": "true"
2467
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
2468
- fill: "none",
2469
- stroke: "currentColor",
2470
- strokeLinecap: "round",
2471
- d: "M4.5.5v8m0-6h1m-2 1h1m0 1h1m-2 1h1m0 1h1m-2 1h1m6-4.29V11c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h5.79c.13 0 .26.05.35.15l2.21 2.21c.1.09.15.21.15.35zM7.5.5V3c0 .28.22.5.5.5h2.5"
2472
- })));
2473
- };
2474
-
2475
- var _path$d, _circle$1;
2476
- function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
2477
- var SvgFileImageStroke$1 = function SvgFileImageStroke(props) {
2478
- return /*#__PURE__*/React.createElement("svg", _extends$e({
2479
- xmlns: "http://www.w3.org/2000/svg",
2480
- width: 12,
2481
- height: 12,
2482
- focusable: "false",
2483
- viewBox: "0 0 12 12",
2484
- "aria-hidden": "true"
2485
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
2486
- fill: "none",
2487
- stroke: "currentColor",
2488
- strokeLinecap: "round",
2489
- strokeLinejoin: "round",
2490
- d: "M10.5 3.21V11c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h5.79c.13 0 .26.05.35.15l2.21 2.21c.1.09.15.21.15.35zM7.5.5V3c0 .28.22.5.5.5h2.5m-7 6L5 8l1.5 1.5 1-1 1 1"
2491
- })), _circle$1 || (_circle$1 = /*#__PURE__*/React.createElement("circle", {
2492
- cx: 8,
2493
- cy: 6,
2494
- r: 1,
2495
- fill: "currentColor"
2496
- })));
2497
- };
2498
-
2499
- var _path$c;
2500
- function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
2501
- var SvgFileDocumentStroke$1 = function SvgFileDocumentStroke(props) {
2502
- return /*#__PURE__*/React.createElement("svg", _extends$d({
2503
- xmlns: "http://www.w3.org/2000/svg",
2504
- width: 12,
2505
- height: 12,
2506
- focusable: "false",
2507
- viewBox: "0 0 12 12",
2508
- "aria-hidden": "true"
2509
- }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
2510
- fill: "none",
2511
- stroke: "currentColor",
2512
- strokeLinecap: "round",
2513
- d: "M3.5 5.5h5m-5 2h5m-5 2h5m2-6.29V11c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h5.79c.13 0 .26.05.35.15l2.21 2.21c.1.09.15.21.15.35zM7.5.5V3c0 .28.22.5.5.5h2.5"
2514
- })));
2515
- };
2516
-
2517
- var _path$b;
2518
- function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
2519
- var SvgFileSpreadsheetStroke$1 = function SvgFileSpreadsheetStroke(props) {
2520
- return /*#__PURE__*/React.createElement("svg", _extends$c({
2521
- xmlns: "http://www.w3.org/2000/svg",
2522
- width: 12,
2523
- height: 12,
2524
- focusable: "false",
2525
- viewBox: "0 0 12 12",
2526
- "aria-hidden": "true"
2527
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
2528
- fill: "none",
2529
- stroke: "currentColor",
2530
- strokeLinecap: "round",
2531
- d: "M3.5 5.5h1m-1 2h1m-1 2h1m2-4h2m-2 2h2m-2 2h2m2-6.29V11c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h5.79c.13 0 .26.05.35.15l2.21 2.21c.1.09.15.21.15.35zM7.5.5V3c0 .28.22.5.5.5h2.5"
2532
- })));
2533
- };
2534
-
2535
- var _path$a;
2536
- function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
2537
- var SvgFilePresentationStroke$1 = function SvgFilePresentationStroke(props) {
2538
- return /*#__PURE__*/React.createElement("svg", _extends$b({
2539
- xmlns: "http://www.w3.org/2000/svg",
2540
- width: 12,
2541
- height: 12,
2542
- focusable: "false",
2543
- viewBox: "0 0 12 12",
2544
- "aria-hidden": "true"
2545
- }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
2546
- fill: "none",
2547
- stroke: "currentColor",
2548
- d: "M10.5 3.21V11c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h5.79c.13 0 .26.05.35.15l2.21 2.21c.1.09.15.21.15.35zM6 9.5h2c.28 0 .5-.22.5-.5V8c0-.28-.22-.5-.5-.5H6c-.28 0-.5.22-.5.5v1c0 .28.22.5.5.5zm-2-2h2c.28 0 .5-.22.5-.5V6c0-.28-.22-.5-.5-.5H4c-.28 0-.5.22-.5.5v1c0 .28.22.5.5.5zm3.5-7V3c0 .28.22.5.5.5h2.5"
2549
- })));
2550
- };
2551
-
2552
- var _path$9;
2553
- function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
2554
- var SvgFileGenericStroke$1 = function SvgFileGenericStroke(props) {
2555
- return /*#__PURE__*/React.createElement("svg", _extends$a({
2556
- xmlns: "http://www.w3.org/2000/svg",
2557
- width: 12,
2558
- height: 12,
2559
- focusable: "false",
2560
- viewBox: "0 0 12 12",
2561
- "aria-hidden": "true"
2562
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
2563
- fill: "none",
2564
- stroke: "currentColor",
2565
- d: "M10.5 3.21V11c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h5.79c.13 0 .26.05.35.15l2.21 2.21c.1.09.15.21.15.35zM7.5.5V3c0 .28.22.5.5.5h2.5"
2566
- })));
2567
- };
2568
-
2569
- var _g;
2570
- function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
2571
- var SvgCheckCircleStroke = function SvgCheckCircleStroke(props) {
2572
- return /*#__PURE__*/React.createElement("svg", _extends$9({
2573
- xmlns: "http://www.w3.org/2000/svg",
2574
- width: 12,
2575
- height: 12,
2576
- focusable: "false",
2577
- viewBox: "0 0 12 12",
2578
- "aria-hidden": "true"
2579
- }, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
2580
- fill: "none",
2581
- stroke: "currentColor"
2582
- }, /*#__PURE__*/React.createElement("path", {
2583
- strokeLinecap: "round",
2584
- strokeLinejoin: "round",
2585
- d: "M3.5 6l2 2L9 4.5"
2586
- }), /*#__PURE__*/React.createElement("circle", {
2587
- cx: 6,
2588
- cy: 6,
2589
- r: 5.5
2590
- }))));
2591
- };
2592
-
2593
- var _path$8;
2594
- function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
2595
- var SvgFileErrorStroke$1 = function SvgFileErrorStroke(props) {
2596
- return /*#__PURE__*/React.createElement("svg", _extends$8({
2597
- xmlns: "http://www.w3.org/2000/svg",
2598
- width: 12,
2599
- height: 12,
2600
- focusable: "false",
2601
- viewBox: "0 0 12 12",
2602
- "aria-hidden": "true"
2603
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
2604
- fill: "none",
2605
- stroke: "currentColor",
2606
- strokeLinecap: "round",
2607
- d: "M10.5 3.21V11c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h5.79c.13 0 .26.05.35.15l2.21 2.21c.1.09.15.21.15.35zM7.5.5V3c0 .28.22.5.5.5h2.5M4 9.5l4-4m0 4l-4-4"
2608
- })));
2609
- };
2610
-
2611
- var _path$7, _rect;
2612
- function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
2613
- var SvgFilePdfStroke = function SvgFilePdfStroke(props) {
2614
- return /*#__PURE__*/React.createElement("svg", _extends$7({
2615
- xmlns: "http://www.w3.org/2000/svg",
2616
- width: 16,
2617
- height: 16,
2618
- focusable: "false",
2619
- viewBox: "0 0 16 16",
2620
- "aria-hidden": "true"
2621
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
2622
- fill: "none",
2623
- stroke: "currentColor",
2624
- strokeLinecap: "round",
2625
- d: "M14.5 4.2V15a.5.5 0 01-.5.5H2a.5.5 0 01-.5-.5V1A.5.5 0 012 .5h8.85a.5.5 0 01.36.15l3.15 3.2a.5.5 0 01.14.35zm-10 8.3h7m-7-2h7m-1-10V4a.5.5 0 00.5.5h3.5"
2626
- })), _rect || (_rect = /*#__PURE__*/React.createElement("rect", {
2627
- width: 8,
2628
- height: 2,
2629
- x: 4,
2630
- y: 7,
2631
- fill: "currentColor",
2632
- rx: 0.5,
2633
- ry: 0.5
2634
- })));
2635
- };
2636
-
2637
- var _path$6;
2638
- function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
2639
- var SvgFileZipStroke = function SvgFileZipStroke(props) {
2640
- return /*#__PURE__*/React.createElement("svg", _extends$6({
2641
- xmlns: "http://www.w3.org/2000/svg",
2642
- width: 16,
2643
- height: 16,
2644
- focusable: "false",
2645
- viewBox: "0 0 16 16",
2646
- "aria-hidden": "true"
2647
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
2648
- fill: "none",
2649
- stroke: "currentColor",
2650
- strokeLinecap: "round",
2651
- d: "M6.5.5v11M5 2.5h1.5m0 1H8m-3 1h1.5m0 1H8m-3 1h1.5m0 1H8m-3 1h1.5m0 1H8m-3 1h1.5m8-6.3V15c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h8.85c.13 0 .26.05.36.15l3.15 3.2c.09.1.14.22.14.35zm-4-3.7V4c0 .28.22.5.5.5h3.5"
2652
- })));
2653
- };
2654
-
2655
- var _path$5, _circle;
2656
- function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
2657
- var SvgFileImageStroke = function SvgFileImageStroke(props) {
2658
- return /*#__PURE__*/React.createElement("svg", _extends$5({
2659
- xmlns: "http://www.w3.org/2000/svg",
2660
- width: 16,
2661
- height: 16,
2662
- focusable: "false",
2663
- viewBox: "0 0 16 16",
2664
- "aria-hidden": "true"
2665
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
2666
- fill: "none",
2667
- stroke: "currentColor",
2668
- strokeLinecap: "round",
2669
- d: "M14.5 4.2V15c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h8.85c.13 0 .26.05.36.15l3.15 3.2c.09.1.14.22.14.35zm-4-3.7V4c0 .28.22.5.5.5h3.5m-11 9l2.65-2.65c.2-.2.51-.2.71 0l1.79 1.79c.2.2.51.2.71 0l.79-.79c.2-.2.51-.2.71 0l1.65 1.65"
2670
- })), _circle || (_circle = /*#__PURE__*/React.createElement("circle", {
2671
- cx: 10.5,
2672
- cy: 8.5,
2673
- r: 1.5,
2674
- fill: "currentColor"
2675
- })));
2676
- };
2677
-
2678
- var _path$4;
2679
- function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
2680
- var SvgFileDocumentStroke = function SvgFileDocumentStroke(props) {
2681
- return /*#__PURE__*/React.createElement("svg", _extends$4({
2682
- xmlns: "http://www.w3.org/2000/svg",
2683
- width: 16,
2684
- height: 16,
2685
- focusable: "false",
2686
- viewBox: "0 0 16 16",
2687
- "aria-hidden": "true"
2688
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
2689
- fill: "none",
2690
- stroke: "currentColor",
2691
- strokeLinecap: "round",
2692
- d: "M4.5 7.5h7m-7 1.97h7m-7 2h7m3-7.27V15c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h8.85c.13 0 .26.05.36.15l3.15 3.2c.09.1.14.22.14.35zm-4-3.7V4c0 .28.22.5.5.5h3.5"
2693
- })));
2694
- };
2695
-
2696
- var _path$3;
2697
- function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
2698
- var SvgFileSpreadsheetStroke = function SvgFileSpreadsheetStroke(props) {
2699
- return /*#__PURE__*/React.createElement("svg", _extends$3({
2700
- xmlns: "http://www.w3.org/2000/svg",
2701
- width: 16,
2702
- height: 16,
2703
- focusable: "false",
2704
- viewBox: "0 0 16 16",
2705
- "aria-hidden": "true"
2706
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
2707
- fill: "none",
2708
- stroke: "currentColor",
2709
- strokeLinecap: "round",
2710
- d: "M4.5 7.5h2m-2 2h2m-2 2h2m2-4h3m-3 2h3m-3 2h3m3-7.3V15c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h8.85c.13 0 .26.05.36.15l3.15 3.2c.09.1.14.22.14.35zm-4-3.7V4c0 .28.22.5.5.5h3.5"
2711
- })));
2712
- };
2713
-
2714
- var _path$2;
2715
- function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
2716
- var SvgFilePresentationStroke = function SvgFilePresentationStroke(props) {
2717
- return /*#__PURE__*/React.createElement("svg", _extends$2({
2718
- xmlns: "http://www.w3.org/2000/svg",
2719
- width: 16,
2720
- height: 16,
2721
- focusable: "false",
2722
- viewBox: "0 0 16 16",
2723
- "aria-hidden": "true"
2724
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
2725
- fill: "none",
2726
- stroke: "currentColor",
2727
- d: "M14.5 4.2V15c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h8.85c.13 0 .26.05.36.15l3.15 3.2c.09.1.14.22.14.35zm-4-3.7V4c0 .28.22.5.5.5h3.5M7 9.5h4c.28 0 .5.22.5.5v3c0 .28-.22.5-.5.5H7c-.28 0-.5-.22-.5-.5v-3c0-.28.22-.5.5-.5zm-.5 2H5c-.28 0-.5-.22-.5-.5V8c0-.28.22-.5.5-.5h4c.28 0 .5.22.5.5v1.5"
2728
- })));
2729
- };
2730
-
2731
- var _path$1;
2732
- function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
2733
- var SvgFileGenericStroke = function SvgFileGenericStroke(props) {
2734
- return /*#__PURE__*/React.createElement("svg", _extends$1({
2735
- xmlns: "http://www.w3.org/2000/svg",
2736
- width: 16,
2737
- height: 16,
2738
- focusable: "false",
2739
- viewBox: "0 0 16 16",
2740
- "aria-hidden": "true"
2741
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
2742
- fill: "none",
2743
- stroke: "currentColor",
2744
- d: "M14.5 4.2V15c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h8.85c.13 0 .26.05.36.15l3.15 3.2c.09.1.14.22.14.35zm-4-3.7V4c0 .28.22.5.5.5h3.5"
2745
- })));
2746
- };
2747
-
2748
- var _path;
2749
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2750
- var SvgFileErrorStroke = function SvgFileErrorStroke(props) {
2751
- return /*#__PURE__*/React.createElement("svg", _extends({
2752
- xmlns: "http://www.w3.org/2000/svg",
2753
- width: 16,
2754
- height: 16,
2755
- focusable: "false",
2756
- viewBox: "0 0 16 16",
2757
- "aria-hidden": "true"
2758
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
2759
- fill: "none",
2760
- stroke: "currentColor",
2761
- strokeLinecap: "round",
2762
- d: "M14.5 4.205V15a.5.5 0 01-.5.5H2a.5.5 0 01-.5-.5V1A.5.5 0 012 .5h8.853a.5.5 0 01.356.15l3.148 3.204a.5.5 0 01.143.35zM10.5.5V4a.5.5 0 00.5.5h3.5m-9 8l5-5m0 5l-5-5"
2763
- })));
2764
- };
2765
-
2766
- const fileIconsDefault = {
2767
- pdf: React__default.createElement(SvgFilePdfStroke, null),
2768
- zip: React__default.createElement(SvgFileZipStroke, null),
2769
- image: React__default.createElement(SvgFileImageStroke, null),
2770
- document: React__default.createElement(SvgFileDocumentStroke, null),
2771
- spreadsheet: React__default.createElement(SvgFileSpreadsheetStroke, null),
2772
- presentation: React__default.createElement(SvgFilePresentationStroke, null),
2773
- generic: React__default.createElement(SvgFileGenericStroke, null),
2774
- success: React__default.createElement(SvgCheckCircleStroke$1, null),
2775
- error: React__default.createElement(SvgFileErrorStroke, null)
2776
- };
2777
- const fileIconsCompact = {
2778
- pdf: React__default.createElement(SvgFilePdfStroke$1, null),
2779
- zip: React__default.createElement(SvgFileZipStroke$1, null),
2780
- image: React__default.createElement(SvgFileImageStroke$1, null),
2781
- document: React__default.createElement(SvgFileDocumentStroke$1, null),
2782
- spreadsheet: React__default.createElement(SvgFileSpreadsheetStroke$1, null),
2783
- presentation: React__default.createElement(SvgFilePresentationStroke$1, null),
2784
- generic: React__default.createElement(SvgFileGenericStroke$1, null),
2785
- success: React__default.createElement(SvgCheckCircleStroke, null),
2786
- error: React__default.createElement(SvgFileErrorStroke$1, null)
2787
- };
2788
-
2789
- const FileComponent = forwardRef((_ref, ref) => {
2790
- let {
2791
- children,
2792
- type,
2793
- isCompact,
2794
- focusInset,
2795
- validation,
2796
- ...props
2797
- } = _ref;
2798
- const fileContextValue = useMemo(() => ({
2799
- isCompact
2800
- }), [isCompact]);
2801
- const validationType = validation || type;
2802
- return React__default.createElement(FileContext.Provider, {
2803
- value: fileContextValue
2804
- }, React__default.createElement(StyledFile, _extends$t({}, props, {
2805
- isCompact: isCompact,
2806
- focusInset: focusInset,
2807
- validation: validation,
2808
- ref: ref
2809
- }), validationType && React__default.createElement(StyledFileIcon, {
2810
- isCompact: isCompact
2811
- }, isCompact ? fileIconsCompact[validationType] : fileIconsDefault[validationType]), Children.map(children, child => typeof child === 'string' ? React__default.createElement("span", null, child) : child)));
2812
- });
2813
- FileComponent.displayName = 'File';
2814
- FileComponent.propTypes = {
2815
- focusInset: PropTypes.bool,
2816
- isCompact: PropTypes.bool,
2817
- type: PropTypes.oneOf(FILE_TYPE),
2818
- validation: PropTypes.oneOf(FILE_VALIDATION)
2819
- };
2820
- const File = FileComponent;
2821
- File.Close = Close;
2822
- File.Delete = Delete;
2823
-
2824
- const MediaInput = React__default.forwardRef((_ref, ref) => {
2825
- let {
2826
- start,
2827
- end,
2828
- disabled,
2829
- isCompact,
2830
- isBare,
2831
- focusInset,
2832
- readOnly,
2833
- validation,
2834
- wrapperProps = {},
2835
- wrapperRef,
2836
- onSelect,
2837
- ...props
2838
- } = _ref;
2839
- const fieldContext = useFieldContext();
2840
- const inputRef = useRef();
2841
- const [isFocused, setIsFocused] = useState(false);
2842
- const [isHovered, setIsHovered] = useState(false);
2843
- const {
2844
- onClick,
2845
- onFocus,
2846
- onBlur,
2847
- onMouseOver,
2848
- onMouseOut,
2849
- ...otherWrapperProps
2850
- } = wrapperProps;
2851
- const onFauxInputClickHandler = composeEventHandlers(onClick, () => {
2852
- inputRef.current && inputRef.current.focus();
2853
- });
2854
- const onFauxInputFocusHandler = composeEventHandlers(onFocus, () => {
2855
- setIsFocused(true);
2856
- });
2857
- const onFauxInputBlurHandler = composeEventHandlers(onBlur, () => {
2858
- setIsFocused(false);
2859
- });
2860
- const onFauxInputMouseOverHandler = composeEventHandlers(onMouseOver, () => {
2861
- setIsHovered(true);
2862
- });
2863
- const onFauxInputMouseOutHandler = composeEventHandlers(onMouseOut, () => {
2864
- setIsHovered(false);
2865
- });
2866
- const onSelectHandler = readOnly ? composeEventHandlers(onSelect, event => {
2867
- event.currentTarget.select();
2868
- }) : onSelect;
2869
- let combinedProps = {
2870
- disabled,
2871
- readOnly,
2872
- ref: mergeRefs([inputRef, ref]),
2873
- onSelect: onSelectHandler,
2874
- ...props
2875
- };
2876
- let isLabelHovered;
2877
- if (fieldContext) {
2878
- combinedProps = fieldContext.getInputProps(combinedProps);
2879
- isLabelHovered = fieldContext.isLabelHovered;
2880
- }
2881
- return React__default.createElement(FauxInput, _extends$t({
2882
- tabIndex: null,
2883
- onClick: onFauxInputClickHandler,
2884
- onFocus: onFauxInputFocusHandler,
2885
- onBlur: onFauxInputBlurHandler,
2886
- onMouseOver: onFauxInputMouseOverHandler,
2887
- onMouseOut: onFauxInputMouseOutHandler,
2888
- disabled: disabled,
2889
- isFocused: isFocused,
2890
- isHovered: isHovered || isLabelHovered,
2891
- isCompact: isCompact,
2892
- isBare: isBare,
2893
- focusInset: focusInset,
2894
- readOnly: readOnly,
2895
- validation: validation,
2896
- mediaLayout: true
2897
- }, otherWrapperProps, {
2898
- ref: wrapperRef
2899
- }), start && React__default.createElement(FauxInput.StartIcon, {
2900
- isDisabled: disabled,
2901
- isFocused: isFocused,
2902
- isHovered: isHovered || isLabelHovered
2903
- }, start), React__default.createElement(StyledTextMediaInput, combinedProps), end && React__default.createElement(FauxInput.EndIcon, {
2904
- isDisabled: disabled,
2905
- isFocused: isFocused,
2906
- isHovered: isHovered || isLabelHovered
2907
- }, end));
2908
- });
2909
- MediaInput.propTypes = {
2910
- isCompact: PropTypes.bool,
2911
- isBare: PropTypes.bool,
2912
- focusInset: PropTypes.bool,
2913
- validation: PropTypes.oneOf(VALIDATION),
2914
- start: PropTypes.node,
2915
- end: PropTypes.node,
2916
- wrapperProps: PropTypes.object,
2917
- wrapperRef: PropTypes.any
2918
- };
2919
- MediaInput.displayName = 'MediaInput';
2920
-
2921
- export { Checkbox, FauxInput, Field, Fieldset, File, FileList, FileUpload, Hint, Input, InputGroup, Label$1 as Label, MediaInput, Message, MultiThumbRange, Radio, Range, Select, Textarea, Tiles, Toggle, VALIDATION };