@automattic/vip-design-system 1.2.3 → 1.3.1

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 (232) hide show
  1. package/.eslintignore +2 -1
  2. package/.prettierignore +1 -0
  3. package/.storybook/decorators/withBoundingBox.tsx +30 -4
  4. package/.storybook/decorators/withColorMode.tsx +5 -5
  5. package/CONTRIBUTING.md +1 -1
  6. package/build/system/Accordion/Accordion.js +6 -6
  7. package/build/system/Accordion/Accordion.stories.js +1 -1
  8. package/build/system/Accordion/Accordion.test.js +7 -5
  9. package/build/system/Avatar/Avatar.js +3 -2
  10. package/build/system/Badge/Badge.js +1 -0
  11. package/build/system/Button/Button.d.ts +11 -0
  12. package/build/system/Button/Button.js +12 -1
  13. package/build/system/Button/Button.stories.d.ts +2 -1
  14. package/build/system/Button/Button.stories.js +1 -2
  15. package/build/system/Button/Button.test.js +72 -45
  16. package/build/system/Button/ButtonSubmit.d.ts +17 -1
  17. package/build/system/Button/ButtonSubmit.js +58 -65
  18. package/build/system/Button/ButtonSubmit.stories.d.ts +17 -37
  19. package/build/system/Button/ButtonSubmit.stories.js +52 -0
  20. package/build/system/Button/ButtonSubmit.test.js +55 -35
  21. package/build/system/Button/index.d.ts +7 -3
  22. package/build/system/Button/index.js +8 -7
  23. package/build/system/Dropdown/DropdownContent.js +1 -1
  24. package/build/system/Dropdown/DropdownItem.js +1 -1
  25. package/build/system/Dropdown/DropdownLabel.js +1 -1
  26. package/build/system/Form/Checkbox.d.ts +9 -9
  27. package/build/system/Form/Checkbox.js +56 -61
  28. package/build/system/Form/Checkbox.stories.d.ts +6 -6
  29. package/build/system/Form/Checkbox.stories.js +71 -0
  30. package/build/system/Form/Input.d.ts +14 -1
  31. package/build/system/Form/Input.js +59 -72
  32. package/build/system/Form/Input.stories.d.ts +6 -4
  33. package/build/system/Form/Input.stories.js +53 -0
  34. package/build/system/Form/Input.styles.d.ts +23 -14
  35. package/build/system/Form/Input.styles.js +40 -28
  36. package/build/system/Form/InputWithCopyButton.stories.jsx +7 -0
  37. package/build/system/Form/Label.d.ts +19 -8
  38. package/build/system/Form/Label.js +39 -43
  39. package/build/system/Form/Label.stories.d.ts +7 -5
  40. package/build/system/Form/Label.stories.js +32 -0
  41. package/build/system/Form/Radio.js +4 -4
  42. package/build/system/Form/Radio.stories.jsx +1 -1
  43. package/build/system/Form/RadioBoxGroup.js +1 -1
  44. package/build/system/Form/RequiredLabel.d.ts +2 -1
  45. package/build/system/Form/RequiredLabel.js +16 -7
  46. package/build/system/Form/Toggle.js +2 -2
  47. package/build/system/Form/Validation.d.ts +8 -13
  48. package/build/system/Form/Validation.js +39 -35
  49. package/build/system/Heading/Heading.stories.js +3 -0
  50. package/build/system/Link/Link.js +1 -1
  51. package/build/system/NewDialog/DialogClose.js +2 -2
  52. package/build/system/NewDialog/DialogContent.js +3 -3
  53. package/build/system/NewDialog/DialogTitle.js +3 -1
  54. package/build/system/NewDialog/NewDialog.stories.d.ts +0 -1
  55. package/build/system/NewDialog/NewDialog.stories.jsx +0 -27
  56. package/build/system/NewForm/Fieldset.d.ts +12 -1
  57. package/build/system/NewForm/Fieldset.js +38 -40
  58. package/build/system/NewForm/Form.d.ts +8 -1
  59. package/build/system/NewForm/Form.js +24 -23
  60. package/build/system/NewForm/FormAutocomplete.css +0 -11
  61. package/build/system/NewForm/FormAutocomplete.js +8 -8
  62. package/build/system/NewForm/FormAutocomplete.stories.jsx +1 -3
  63. package/build/system/NewForm/FormAutocompleteMultiselect.js +10 -10
  64. package/build/system/NewForm/FormSelect.js +1 -1
  65. package/build/system/NewForm/FormSelectArrow.js +1 -1
  66. package/build/system/NewForm/FormSelectInline.js +1 -1
  67. package/build/system/NewForm/FormSelectLoading.js +1 -1
  68. package/build/system/NewForm/FormSelectSearch.js +2 -2
  69. package/build/system/NewForm/Legend.d.ts +12 -1
  70. package/build/system/NewForm/Legend.js +32 -34
  71. package/build/system/NewForm/index.d.ts +1 -1
  72. package/build/system/OptionRow/OptionRow.js +1 -1
  73. package/build/system/Progress/Progress.d.ts +9 -2
  74. package/build/system/Progress/Progress.js +75 -70
  75. package/build/system/Progress/Progress.stories.d.ts +9 -7
  76. package/build/system/Progress/Progress.stories.js +34 -0
  77. package/build/system/Progress/Progress.test.d.ts +1 -0
  78. package/build/system/Progress/Progress.test.js +65 -0
  79. package/build/system/Progress/index.d.ts +4 -2
  80. package/build/system/Progress/index.js +5 -5
  81. package/build/system/ScreenReaderText/ScreenReaderText.js +1 -2
  82. package/build/system/Tabs/TabsTrigger.js +0 -1
  83. package/build/system/Text/Text.js +1 -1
  84. package/build/system/Text/Text.stories.js +36 -0
  85. package/build/system/Tooltip/Tooltip.css +6 -2
  86. package/build/system/Tooltip/Tooltip.stories.js +2 -2
  87. package/build/system/Wizard/Wizard.d.ts +14 -1
  88. package/build/system/Wizard/Wizard.js +62 -93
  89. package/build/system/Wizard/Wizard.stories.d.ts +11 -8
  90. package/build/system/Wizard/Wizard.stories.js +167 -0
  91. package/build/system/Wizard/WizardStep.d.ts +24 -1
  92. package/build/system/Wizard/WizardStep.js +180 -190
  93. package/build/system/Wizard/index.d.ts +4 -2
  94. package/build/system/Wizard/index.js +6 -7
  95. package/build/system/index.d.ts +2 -2
  96. package/build/system/index.js +2 -1
  97. package/build/system/theme/generated/valet-theme-dark.json +1219 -476
  98. package/build/system/theme/generated/valet-theme-light.json +1217 -474
  99. package/build/system/theme/{getColor.d.ts → getPropValue.d.ts} +2 -1
  100. package/{src/system/theme/getColor.js → build/system/theme/getPropValue.js} +36 -4
  101. package/build/system/theme/index.d.ts +20 -65
  102. package/build/system/theme/index.js +27 -57
  103. package/package.json +4 -4
  104. package/src/system/Accordion/Accordion.stories.tsx +1 -1
  105. package/src/system/Accordion/Accordion.test.tsx +3 -0
  106. package/src/system/Accordion/Accordion.tsx +6 -6
  107. package/src/system/Avatar/Avatar.tsx +3 -3
  108. package/src/system/Badge/Badge.tsx +1 -1
  109. package/src/system/Button/Button.stories.tsx +2 -3
  110. package/src/system/Button/{Button.test.js → Button.test.tsx} +2 -2
  111. package/src/system/Button/Button.tsx +12 -0
  112. package/src/system/Button/ButtonSubmit.stories.tsx +31 -0
  113. package/src/system/Button/{ButtonSubmit.test.js → ButtonSubmit.test.tsx} +4 -4
  114. package/src/system/Button/{ButtonSubmit.js → ButtonSubmit.tsx} +21 -27
  115. package/src/system/Button/index.ts +8 -0
  116. package/src/system/Dropdown/DropdownContent.js +1 -1
  117. package/src/system/Dropdown/DropdownItem.js +1 -1
  118. package/src/system/Dropdown/DropdownLabel.js +1 -1
  119. package/src/system/Form/{Checkbox.stories.jsx → Checkbox.stories.tsx} +3 -2
  120. package/src/system/Form/{Checkbox.js → Checkbox.tsx} +6 -10
  121. package/src/system/Form/{Input.stories.jsx → Input.stories.tsx} +1 -0
  122. package/src/system/Form/{Input.styles.js → Input.styles.ts} +14 -5
  123. package/src/system/Form/{Input.js → Input.tsx} +10 -19
  124. package/src/system/Form/InputWithCopyButton.stories.jsx +7 -0
  125. package/src/system/Form/{Label.js → Label.tsx} +8 -13
  126. package/src/system/Form/Radio.js +4 -4
  127. package/src/system/Form/Radio.stories.jsx +1 -1
  128. package/src/system/Form/RadioBoxGroup.js +1 -1
  129. package/src/system/Form/{RequiredLabel.js → RequiredLabel.tsx} +1 -3
  130. package/src/system/Form/Toggle.js +2 -2
  131. package/src/system/Form/{Validation.js → Validation.tsx} +11 -12
  132. package/src/system/Heading/Heading.stories.tsx +1 -0
  133. package/src/system/Link/Link.tsx +1 -1
  134. package/src/system/NewDialog/DialogClose.js +2 -2
  135. package/src/system/NewDialog/DialogContent.js +3 -3
  136. package/src/system/NewDialog/DialogTitle.js +3 -1
  137. package/src/system/NewDialog/NewDialog.stories.jsx +0 -27
  138. package/src/system/NewForm/Fieldset.tsx +46 -0
  139. package/src/system/NewForm/Form.tsx +23 -0
  140. package/src/system/NewForm/FormAutocomplete.css +0 -11
  141. package/src/system/NewForm/FormAutocomplete.js +8 -8
  142. package/src/system/NewForm/FormAutocomplete.stories.jsx +1 -3
  143. package/src/system/NewForm/FormAutocompleteMultiselect.js +10 -10
  144. package/src/system/NewForm/FormSelect.js +1 -1
  145. package/src/system/NewForm/FormSelectArrow.js +1 -1
  146. package/src/system/NewForm/FormSelectInline.js +1 -1
  147. package/src/system/NewForm/FormSelectLoading.js +1 -1
  148. package/src/system/NewForm/FormSelectSearch.js +2 -2
  149. package/src/system/NewForm/Legend.tsx +40 -0
  150. package/src/system/OptionRow/OptionRow.js +1 -1
  151. package/src/system/Progress/Progress.test.tsx +33 -0
  152. package/src/system/Progress/{Progress.js → Progress.tsx} +16 -19
  153. package/src/system/Progress/index.ts +4 -0
  154. package/src/system/ScreenReaderText/ScreenReaderText.tsx +0 -2
  155. package/src/system/Tabs/TabsTrigger.js +0 -1
  156. package/src/system/Text/Text.stories.tsx +7 -0
  157. package/src/system/Text/Text.tsx +1 -1
  158. package/src/system/Tooltip/Tooltip.css +6 -2
  159. package/src/system/Tooltip/Tooltip.stories.tsx +4 -4
  160. package/{build/system/Wizard/Wizard.stories.jsx → src/system/Wizard/Wizard.stories.tsx} +18 -23
  161. package/src/system/Wizard/Wizard.tsx +62 -0
  162. package/src/system/Wizard/{WizardStep.js → WizardStep.tsx} +38 -41
  163. package/src/system/Wizard/index.ts +7 -0
  164. package/src/system/index.js +2 -1
  165. package/src/system/theme/generated/valet-theme-dark.json +1219 -476
  166. package/src/system/theme/generated/valet-theme-light.json +1217 -474
  167. package/{build/system/theme/getColor.js → src/system/theme/getPropValue.js} +36 -4
  168. package/src/system/theme/index.js +27 -57
  169. package/tokens/utilities/colors/color output/blue.json +305 -0
  170. package/tokens/utilities/colors/color output/gold.json +305 -0
  171. package/tokens/utilities/colors/color output/gray.json +305 -0
  172. package/tokens/utilities/colors/color output/green.json +305 -0
  173. package/tokens/utilities/colors/color output/orange.json +305 -0
  174. package/tokens/utilities/colors/color output/pink.json +305 -0
  175. package/tokens/utilities/colors/color output/red.json +305 -0
  176. package/tokens/utilities/colors/color output/salmon.json +305 -0
  177. package/tokens/utilities/colors/color output/yellow.json +305 -0
  178. package/tokens/utilities/colors/colorOutput.json +4062 -0
  179. package/tokens/utilities/colors/color_3d_plot.js +43 -0
  180. package/tokens/utilities/colors/color_graph.js +31 -0
  181. package/tokens/utilities/colors/colors.json +1981 -0
  182. package/tokens/utilities/colors/index.js +118 -0
  183. package/tokens/utilities/colors/package-lock.json +6749 -0
  184. package/tokens/utilities/colors/package.json +21 -0
  185. package/tokens/utilities/figma-type-calculator/responsive-type.js +98 -0
  186. package/tokens/valet-core/$metadata.json +19 -15
  187. package/tokens/valet-core/$themes.json +3323 -419
  188. package/tokens/valet-core/{figma-parsely-expressive-type.json → figma-parsely-web-type.json} +128 -128
  189. package/tokens/valet-core/{figma-valet-expressive-type.json → figma-valet-web-type.json} +126 -126
  190. package/tokens/valet-core/figma-wpvip-services-web-type.json +1267 -0
  191. package/tokens/valet-core/{figma-wpvip-expressive-type.json → figma-wpvip-web-type.json} +162 -162
  192. package/tokens/valet-core/{parsely-expressive-color.json → parsely-web-color.json} +1 -1
  193. package/tokens/valet-core/{wpvip-expressive-core.json → parsely-web-core.json} +73 -23
  194. package/tokens/valet-core/{parsely-expressive-type.json → parsely-web-type.json} +21 -9
  195. package/tokens/valet-core/valet-core.json +331 -232
  196. package/tokens/valet-core/{valet-expressive-color.json → valet-web-color.json} +1 -1
  197. package/tokens/valet-core/{parsely-expressive-core.json → valet-web-core.json} +72 -22
  198. package/tokens/valet-core/{wpvip-productive-color.json → wpvip-product-core.json} +663 -7
  199. package/tokens/valet-core/{wpvip-productive-color-dark.json → wpvip-product-dark.json} +332 -10
  200. package/tokens/valet-core/{wpvip-expressive-color.json → wpvip-services-web-color.json} +1 -1
  201. package/tokens/valet-core/{valet-expressive-core.json → wpvip-services-web-core.json} +72 -22
  202. package/tokens/valet-core/wpvip-services-web-type.json +412 -0
  203. package/tokens/valet-core/{wpvip-expressive-color-dark.json → wpvip-web-color-dark.json} +1 -1
  204. package/tokens/valet-core/wpvip-web-color.json +730 -0
  205. package/tokens/valet-core/{wpvip-expressive-type.json → wpvip-web-type.json} +24 -12
  206. package/tokens/valet-core/wpvip-web.json +1310 -0
  207. package/tsconfig.json +2 -1
  208. package/build/system/Button/ButtonSubmit.stories.jsx +0 -40
  209. package/build/system/Button/variants.d.ts +0 -2
  210. package/build/system/Button/variants.js +0 -1
  211. package/build/system/Form/Checkbox.stories.jsx +0 -54
  212. package/build/system/Form/Input.stories.jsx +0 -38
  213. package/build/system/Wizard/WizardStepHorizontal.d.ts +0 -2
  214. package/build/system/Wizard/WizardStepHorizontal.js +0 -55
  215. package/build/system/theme/textStyles.d.ts +0 -71
  216. package/build/system/theme/textStyles.js +0 -46
  217. package/src/system/Button/ButtonSubmit.stories.jsx +0 -40
  218. package/src/system/Button/index.js +0 -8
  219. package/src/system/Button/variants.js +0 -1
  220. package/src/system/Form/Label.stories.jsx +0 -36
  221. package/src/system/NewForm/Fieldset.js +0 -47
  222. package/src/system/NewForm/Form.js +0 -26
  223. package/src/system/NewForm/Legend.js +0 -41
  224. package/src/system/Progress/Progress.stories.jsx +0 -25
  225. package/src/system/Progress/index.js +0 -6
  226. package/src/system/Wizard/Wizard.js +0 -103
  227. package/src/system/Wizard/Wizard.stories.jsx +0 -145
  228. package/src/system/Wizard/WizardStepHorizontal.js +0 -55
  229. package/src/system/Wizard/index.js +0 -8
  230. package/src/system/theme/textStyles.js +0 -46
  231. /package/{build/system/Form/Label.stories.jsx → src/system/Form/Label.stories.tsx} +0 -0
  232. /package/{build/system/Progress/Progress.stories.jsx → src/system/Progress/Progress.stories.tsx} +0 -0
@@ -1,39 +1,43 @@
1
- /** @jsxImportSource theme-ui */
1
+ "use strict";
2
2
 
3
+ exports.__esModule = true;
4
+ exports.Validation = void 0;
5
+ var _md = require("react-icons/md");
6
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
7
+ var _excluded = ["children", "isValid", "describedId"];
8
+ /** @jsxImportSource theme-ui */
3
9
  /**
4
10
  * External dependencies
5
11
  */
6
- import PropTypes from 'prop-types';
7
- import { MdErrorOutline, MdCheckCircle } from 'react-icons/md';
8
-
9
- const errorColor = 'texts.error';
10
- const helperColor = 'texts.helper';
11
-
12
- const Validation = ( { children, isValid, describedId = null, ...props } ) => {
13
- const Icon = isValid ? MdCheckCircle : MdErrorOutline;
14
-
15
- return (
16
- <p
17
- sx={ {
18
- color: isValid ? helperColor : errorColor,
19
- display: 'flex',
20
- alignItems: 'center',
21
- m: 0,
22
- fontSize: 1,
23
- } }
24
- id={ describedId ? `describe-${ describedId }-validation` : undefined }
25
- { ...props }
26
- >
27
- <Icon sx={ { mr: 1 } } aria-hidden="true" />
28
- { children }
29
- </p>
30
- );
31
- };
32
-
33
- Validation.propTypes = {
34
- children: PropTypes.node,
35
- isValid: PropTypes.bool,
36
- describedId: PropTypes.string,
37
- };
38
-
39
- export { Validation };
12
+ 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); }
13
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
+ var errorColor = 'texts.error';
15
+ var helperColor = 'texts.helper';
16
+ var Validation = exports.Validation = function Validation(_ref) {
17
+ var children = _ref.children,
18
+ isValid = _ref.isValid,
19
+ describedId = _ref.describedId,
20
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
21
+ return (0, _jsxRuntime.jsxs)("p", _extends({
22
+ sx: {
23
+ color: isValid ? helperColor : errorColor,
24
+ display: 'flex',
25
+ alignItems: 'center',
26
+ m: 0,
27
+ fontSize: 1
28
+ },
29
+ id: describedId ? "describe-" + describedId + "-validation" : undefined
30
+ }, props, {
31
+ children: [isValid ? (0, _jsxRuntime.jsx)(_md.MdCheckCircle, {
32
+ sx: {
33
+ mr: 1
34
+ },
35
+ "aria-hidden": "true"
36
+ }) : (0, _jsxRuntime.jsx)(_md.MdErrorOutline, {
37
+ sx: {
38
+ mr: 1
39
+ },
40
+ "aria-hidden": "true"
41
+ }), children]
42
+ }));
43
+ };
@@ -28,6 +28,9 @@ var Default = exports.Default = function Default() {
28
28
  }), (0, _jsxRuntime.jsx)(_.Heading, {
29
29
  variant: "h5",
30
30
  children: "Heading Five"
31
+ }), (0, _jsxRuntime.jsx)(_.Heading, {
32
+ variant: "h6",
33
+ children: "Heading Six"
31
34
  })]
32
35
  });
33
36
  };
@@ -19,7 +19,7 @@ var Link = exports.Link = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
19
19
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
20
20
  return (0, _jsxRuntime.jsx)(_themeUi.Link, _extends({
21
21
  sx: _extends({
22
- textDdecorationThickness: '0.1em',
22
+ textDecorationThickness: '0.1em',
23
23
  textUnderlineOffset: '0.1em',
24
24
  color: active ? 'links.active' : 'link',
25
25
  '&:visited': {
@@ -39,8 +39,8 @@ export const DialogCloseDefault = React.forwardRef( ( props, forwardedRef ) => (
39
39
  justifyContent: 'center',
40
40
  color: 'icon.primary',
41
41
  position: 'absolute',
42
- top: 10,
43
- right: 10,
42
+ top: 3,
43
+ right: 3,
44
44
 
45
45
  '&:hover': {
46
46
  backgroundColor: 'borders.2',
@@ -3,8 +3,8 @@
3
3
  export const contentStyles = {
4
4
  background: 'dialog',
5
5
  variant: 'dialog.modal',
6
- borderRadius: 10,
7
- boxShadow: 'hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px',
6
+ borderRadius: 2,
7
+ boxShadow: 'medium',
8
8
  position: 'fixed',
9
9
  top: '50%',
10
10
  left: '50%',
@@ -12,6 +12,6 @@ export const contentStyles = {
12
12
  width: '90vw',
13
13
  maxWidth: '640px',
14
14
  maxHeight: '85vh',
15
- padding: 32,
15
+ padding: 6,
16
16
  '> h1, > h2': { marginTop: '0 !important' },
17
17
  };
@@ -19,7 +19,9 @@ export const DialogTitle = ( { title, hidden = false } ) => {
19
19
  }
20
20
 
21
21
  return (
22
- <DialogPrimitive.Title sx={ { margin: 0, fontSize: 3, fontWeight: 500, color: 'heading' } }>
22
+ <DialogPrimitive.Title
23
+ sx={ { margin: 0, fontSize: 3, fontWeight: 'medium', color: 'heading' } }
24
+ >
23
25
  { titleNode }
24
26
  </DialogPrimitive.Title>
25
27
  );
@@ -30,7 +30,6 @@ declare namespace _default {
30
30
  }
31
31
  export default _default;
32
32
  export function Default(): import("react").JSX.Element;
33
- export function AutoOpen(): import("react").JSX.Element;
34
33
  export function HiddenHeadings(): import("react").JSX.Element;
35
34
  export function CustomStyling(): import("react").JSX.Element;
36
35
  export function CustomClose(): import("react").JSX.Element;
@@ -10,7 +10,6 @@ import { useState } from 'react';
10
10
  * Internal dependencies
11
11
  */
12
12
  import { Button, Text, Input, Label } from '../../system';
13
- import ScreenReaderText from '../ScreenReaderText';
14
13
  import * as NewDialog from '.';
15
14
 
16
15
  export default {
@@ -33,31 +32,6 @@ export const Default = () => (
33
32
  </>
34
33
  );
35
34
 
36
- export const AutoOpen = () => (
37
- <>
38
- <Text sx={ { fontSize: 3, mb: 3 } }>Auto Opens when rendered. Press escape to close it.</Text>
39
- <NewDialog.Root
40
- { ...defaultProps }
41
- defaultOpen={ true }
42
- content={
43
- <div>
44
- <h3>Test</h3>
45
- <p>
46
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
47
- has been the industry standard dummy text ever since the 1500s, when an unknown printer
48
- took a galley of type and scrambled it to make a type specimen book. It has survived not
49
- only five centuries, but also the leap into electronic typesetting, remaining
50
- essentially unchanged. It was popularised in the 1960s with the release of Letraset
51
- sheets containing Lorem Ipsum passages, and more recently with desktop publishing
52
- software like Aldus PageMaker including versions of Lorem Ipsum.
53
- </p>
54
- </div>
55
- }
56
- trigger={ <ScreenReaderText>hey</ScreenReaderText> }
57
- />
58
- </>
59
- );
60
-
61
35
  export const HiddenHeadings = () => (
62
36
  <>
63
37
  <Text sx={ { fontSize: 3, mb: 3 } }>
@@ -96,7 +70,6 @@ export const CustomStyling = () => (
96
70
 
97
71
  <NewDialog.Root
98
72
  { ...defaultProps }
99
- defaultOpen
100
73
  trigger={ <Button>Trigger Dialog</Button> }
101
74
  title="Custom dialog title"
102
75
  style={ {
@@ -1,2 +1,13 @@
1
- export const Fieldset: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
1
+ /** @jsxImportSource theme-ui */
2
+ /**
3
+ * External dependencies
4
+ */
2
5
  import React from 'react';
6
+ import { ThemeUIStyleObject } from 'theme-ui';
7
+ interface FieldsetProps {
8
+ children?: React.ReactNode;
9
+ sx?: ThemeUIStyleObject;
10
+ className?: string;
11
+ }
12
+ export declare const Fieldset: React.ForwardRefExoticComponent<FieldsetProps & React.RefAttributes<HTMLFieldSetElement>>;
13
+ export {};
@@ -1,47 +1,45 @@
1
- /** @jsxImportSource theme-ui */
1
+ "use strict";
2
2
 
3
+ exports.__esModule = true;
4
+ exports.Fieldset = void 0;
5
+ var _react = _interopRequireDefault(require("react"));
6
+ var _classnames = _interopRequireDefault(require("classnames"));
7
+ var _Input = require("../Form/Input.styles");
8
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
9
+ var _excluded = ["children", "className", "sx"];
10
+ /** @jsxImportSource theme-ui */
3
11
  /**
4
12
  * External dependencies
5
13
  */
6
- import React from 'react';
7
- import PropTypes from 'prop-types';
8
- import classNames from 'classnames';
9
-
10
14
  /**
11
15
  * Internal dependencies
12
16
  */
13
-
14
- import { baseControlBorderStyle, inputBaseBackground, inputBaseText } from '../Form/Input.styles';
15
-
16
- const Fieldset = React.forwardRef( ( { children, className, sx = {}, ...props }, forwardRef ) => (
17
- <fieldset
18
- ref={ forwardRef }
19
- className={ classNames( 'vip-form-fieldset-component', className ) }
20
- sx={ {
21
- all: 'unset',
22
- ...baseControlBorderStyle,
23
- backgroundColor: inputBaseBackground,
24
- color: inputBaseText,
25
- borderRadius: 1,
26
- display: 'block',
27
- pt: 1,
28
- pb: 2,
29
- px: 3,
30
- mb: 3,
31
- ...sx,
32
- } }
33
- { ...props }
34
- >
35
- { children }
36
- </fieldset>
37
- ) );
38
-
39
- Fieldset.propTypes = {
40
- children: PropTypes.any,
41
- sx: PropTypes.any,
42
- className: PropTypes.any,
43
- };
44
-
45
- Fieldset.displayName = 'Fieldset';
46
-
47
- export { Fieldset };
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
18
+ 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); }
19
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
+ var Fieldset = exports.Fieldset = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef) {
21
+ var children = _ref.children,
22
+ className = _ref.className,
23
+ _ref$sx = _ref.sx,
24
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
25
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
26
+ return (0, _jsxRuntime.jsx)("fieldset", _extends({
27
+ ref: forwardRef,
28
+ className: (0, _classnames["default"])('vip-form-fieldset-component', className),
29
+ sx: _extends({
30
+ all: 'unset'
31
+ }, _Input.baseControlBorderStyle, {
32
+ backgroundColor: _Input.inputBaseBackground,
33
+ color: _Input.inputBaseText,
34
+ borderRadius: 1,
35
+ display: 'block',
36
+ pt: 1,
37
+ pb: 2,
38
+ px: 3,
39
+ mb: 3
40
+ }, sx)
41
+ }, props, {
42
+ children: children
43
+ }));
44
+ });
45
+ Fieldset.displayName = 'Fieldset';
@@ -1,2 +1,9 @@
1
- export const Form: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
1
+ /**
2
+ * External dependencies
3
+ */
2
4
  import React from 'react';
5
+ export interface FormProps {
6
+ children?: React.ReactNode;
7
+ className?: string;
8
+ }
9
+ export declare const Form: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<HTMLFormElement>>;
@@ -1,26 +1,27 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.Form = void 0;
5
+ var _react = _interopRequireDefault(require("react"));
6
+ var _classnames = _interopRequireDefault(require("classnames"));
7
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
8
+ var _excluded = ["children", "className"];
1
9
  /**
2
10
  * External dependencies
3
11
  */
4
- import React from 'react';
5
- import PropTypes from 'prop-types';
6
- import classNames from 'classnames';
7
-
8
- const Form = React.forwardRef( ( { children, className, ...props }, forwardRef ) => (
9
- <form
10
- ref={ forwardRef }
11
- className={ classNames( 'vip-form-component', className ) }
12
- noValidate
13
- { ...props }
14
- >
15
- { children }
16
- </form>
17
- ) );
18
-
19
- Form.propTypes = {
20
- children: PropTypes.any,
21
- className: PropTypes.any,
22
- };
23
-
24
- Form.displayName = 'Form';
25
-
26
- export { Form };
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+ 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); }
14
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
+ var Form = exports.Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef) {
16
+ var children = _ref.children,
17
+ className = _ref.className,
18
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
19
+ return (0, _jsxRuntime.jsx)("form", _extends({
20
+ ref: forwardRef,
21
+ className: (0, _classnames["default"])('vip-form-component', className),
22
+ noValidate: true
23
+ }, props, {
24
+ children: children
25
+ }));
26
+ });
27
+ Form.displayName = 'Form';
@@ -38,17 +38,6 @@
38
38
  cursor: pointer;
39
39
  }
40
40
 
41
- /* .autocomplete__dropdown-arrow-down {
42
- z-index: -1;
43
- display: inline-block;
44
- position: absolute;
45
- right: 8px;
46
- width: 24px;
47
- height: 24px;
48
- top: 10px;
49
- pointer-events: none;
50
- } */
51
-
52
41
  .autocomplete__menu {
53
42
  background-color: #fff;
54
43
  border: 2px solid #0b0c0c;
@@ -17,12 +17,12 @@ import { FormSelectArrow } from './FormSelectArrow';
17
17
  import { Label } from '../Form/Label';
18
18
  import { FormSelectSearch } from './FormSelectSearch';
19
19
  import { FormSelectLoading } from './FormSelectLoading';
20
- import { baseControlBorderStyle, inputBaseBackground, inputBaseText } from '../Form/Input.styles';
20
+ import { baseControlBorderStyle, inputBaseText } from '../Form/Input.styles';
21
21
  import { Validation } from '../Form';
22
22
 
23
23
  const baseBorderTextColors = {
24
24
  ...baseControlBorderStyle,
25
- backgroundColor: inputBaseBackground,
25
+ backgroundColor: 'layer.2',
26
26
  color: inputBaseText,
27
27
  borderRadius: 1,
28
28
  };
@@ -51,7 +51,7 @@ const defaultStyles = {
51
51
  '&:focus-visible': { outlineWidth: 0, boxShadow: 'none' },
52
52
  '&:focus-within': { outlineWidth: 0, boxShadow: 'none' },
53
53
  '&.autocomplete__input--focused': { outlineWidth: 0, boxShadow: 'none' },
54
- '&.autocomplete__input--show-all-values': { paddingRight: '40px' },
54
+ '&.autocomplete__input--show-all-values': { paddingRight: 7 },
55
55
  },
56
56
  '& .autocomplete__menu': {
57
57
  ...baseBorderTextColors,
@@ -66,11 +66,11 @@ const defaultStyles = {
66
66
  borderColor: baseControlBorderStyle.borderColor,
67
67
  },
68
68
  '& .autocomplete__option--odd': {
69
- bg: 'backgroundSecondary',
69
+ bg: 'layer.1',
70
70
  },
71
71
  '& .autocomplete__option:hover, & .autocomplete__option--focused': {
72
- bg: 'midnight',
73
- borderColor: 'midnight',
72
+ bg: 'input.background.primary',
73
+ borderColor: 'input.background.primary',
74
74
  },
75
75
  '& .autocomplete__input--show-all-values': {
76
76
  paddingRight: 0,
@@ -89,7 +89,7 @@ const inlineStyles = {
89
89
 
90
90
  const searchIconStyles = {
91
91
  '& .autocomplete__input.autocomplete__input': {
92
- paddingLeft: 4,
92
+ paddingLeft: 6,
93
93
  },
94
94
  };
95
95
 
@@ -345,7 +345,7 @@ const FormAutocomplete = React.forwardRef(
345
345
  { ...props }
346
346
  />
347
347
 
348
- { loading && <FormSelectLoading sx={ { right: showAllValues ? 40 : 10 } } /> }
348
+ { loading && <FormSelectLoading sx={ { right: showAllValues ? 7 : 3 } } /> }
349
349
  </FormSelectContent>
350
350
  </div>
351
351
 
@@ -151,9 +151,7 @@ WithCustomArrow.args = {
151
151
  showAllValues: true,
152
152
  // eslint-disable-next-line react/display-name
153
153
  dropdownArrow: () => (
154
- <span sx={ { position: 'absolute', top: '2px', right: '10px', pointerEvents: 'none' } }>
155
- 👇
156
- </span>
154
+ <span sx={ { position: 'absolute', top: 1, right: 3, pointerEvents: 'none' } }>👇</span>
157
155
  ),
158
156
  };
159
157
  WithCustomArrow.displayName = 'WithCustomArrow';
@@ -16,14 +16,14 @@ import { FormSelectArrow } from './FormSelectArrow';
16
16
  import { Label } from '../Form/Label';
17
17
  import { FormSelectSearch } from './FormSelectSearch';
18
18
  import { FormSelectLoading } from './FormSelectLoading';
19
- import { baseControlBorderStyle, inputBaseBackground, inputBaseText } from '../Form/Input.styles';
19
+ import { baseControlBorderStyle, inputBaseText } from '../Form/Input.styles';
20
20
  import { Validation } from '../Form';
21
21
  import { Button, Flex } from '../';
22
22
  import { MdClose } from 'react-icons/md';
23
23
 
24
24
  const baseBorderTextColors = {
25
25
  ...baseControlBorderStyle,
26
- backgroundColor: inputBaseBackground,
26
+ backgroundColor: 'layer.2',
27
27
  color: inputBaseText,
28
28
  borderRadius: 1,
29
29
  };
@@ -41,7 +41,7 @@ const defaultStyles = {
41
41
  '&.autocomplete__input--focused': theme => theme.outline,
42
42
  '& .autocomplete__input': {
43
43
  width: '100%',
44
- paddingLeft: 3,
44
+ paddingLeft: 4,
45
45
  py: 0,
46
46
  borderWidth: 0,
47
47
  color: 'text',
@@ -51,7 +51,7 @@ const defaultStyles = {
51
51
  '&:focus-visible': { outlineWidth: 0, boxShadow: 'none' },
52
52
  '&:focus-within': { outlineWidth: 0, boxShadow: 'none' },
53
53
  '&.autocomplete__input--focused': { outlineWidth: 0, boxShadow: 'none' },
54
- '&.autocomplete__input--show-all-values': { paddingRight: '40px' },
54
+ '&.autocomplete__input--show-all-values': { paddingRight: 7 },
55
55
  '&::placeholder': {
56
56
  color: 'input.text.placeholder',
57
57
  opacity: 1,
@@ -70,18 +70,18 @@ const defaultStyles = {
70
70
  borderColor: baseControlBorderStyle.borderColor,
71
71
  },
72
72
  '& .autocomplete__option--odd': {
73
- bg: 'backgroundSecondary',
73
+ bg: 'layer.1',
74
74
  },
75
75
  '& .autocomplete__option:hover, & .autocomplete__option--focused': {
76
- bg: 'midnight',
77
- borderColor: 'midnight',
76
+ bg: 'input.background.primary',
77
+ borderColor: 'input.background.primary',
78
78
  },
79
79
  '& .autocomplete__input--show-all-values': {
80
80
  paddingRight: 0,
81
81
  },
82
82
  '& .autocomplete__hint': {
83
83
  border: 'none',
84
- paddingLeft: 3,
84
+ paddingLeft: 4,
85
85
  minHeight: '27px',
86
86
  lineHeight: '27px',
87
87
  },
@@ -93,7 +93,7 @@ const inlineStyles = {
93
93
 
94
94
  const searchIconStyles = {
95
95
  '& .autocomplete__input.autocomplete__input': {
96
- paddingLeft: 4,
96
+ paddingLeft: 6,
97
97
  },
98
98
  };
99
99
 
@@ -407,7 +407,7 @@ const FormAutocompleteMultiselect = React.forwardRef(
407
407
  { ...props }
408
408
  />
409
409
  { addStatus && <AddSelectionStatus status={ addStatus } /> }
410
- { loading && <FormSelectLoading sx={ { right: showAllValues ? 40 : 10 } } /> }
410
+ { loading && <FormSelectLoading sx={ { right: showAllValues ? 7 : 3 } } /> }
411
411
  </FormSelectContent>
412
412
  </div>
413
413
  <Flex sx={ { mt: 2, justifyContent: 'space-between' } }>
@@ -21,7 +21,7 @@ const isDev = process.env.NODE_ENV !== 'production';
21
21
  const defaultStyles = {
22
22
  ...baseControlStyle,
23
23
  paddingLeft: 3,
24
- paddingRight: 40, // 40px for the icon
24
+ paddingRight: 7,
25
25
  py: 0,
26
26
  appearance: 'none',
27
27
  minHeight: '36px',
@@ -22,7 +22,7 @@ export const FormSelectArrow = React.forwardRef( ( props, forwardRef ) => (
22
22
  borderLeftWidth: borderStyle.borderWidth,
23
23
  borderLeftStyle: borderStyle.borderStyle,
24
24
  borderLeftColor: borderStyle.borderColor,
25
- right: '10px',
25
+ right: 3,
26
26
  top: '7px',
27
27
  pointerEvents: 'none',
28
28
  svg: {
@@ -14,7 +14,7 @@ export const inlineStyles = {
14
14
  gridTemplateColumns: 'auto 1fr',
15
15
  position: 'relative',
16
16
  alignItems: 'center',
17
- backgroundColor: 'input.background',
17
+ backgroundColor: 'input.background.default',
18
18
  borderRadius: 1,
19
19
  ...baseControlBorderStyle,
20
20
  paddingRight: 0,
@@ -25,7 +25,7 @@ export const FormSelectLoading = React.forwardRef( ( { sx = {}, ...rest }, forwa
25
25
  size={ 18 }
26
26
  sx={ {
27
27
  position: 'absolute',
28
- right: 10,
28
+ right: 3,
29
29
  pointerEvents: 'none',
30
30
  animation: `${ kf } 1s infinite linear`,
31
31
  opacity: 0.5,
@@ -13,8 +13,8 @@ export const FormSelectSearch = React.forwardRef( ( props, forwardRef ) => (
13
13
  size={ 24 }
14
14
  sx={ {
15
15
  position: 'absolute',
16
- paddingRight: '10px',
17
- left: '10px',
16
+ pr: 2,
17
+ left: 3,
18
18
  pointerEvents: 'none',
19
19
  } }
20
20
  { ...props }
@@ -1,2 +1,13 @@
1
- export const Legend: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
1
+ /** @jsxImportSource theme-ui */
2
+ /**
3
+ * External dependencies
4
+ */
2
5
  import React from 'react';
6
+ import { ThemeUIStyleObject } from 'theme-ui';
7
+ interface LegendProps {
8
+ children?: React.ReactNode;
9
+ sx?: ThemeUIStyleObject;
10
+ className?: string;
11
+ }
12
+ export declare const Legend: React.ForwardRefExoticComponent<LegendProps & React.RefAttributes<HTMLLegendElement>>;
13
+ export {};