@primer/components 0.0.0-2021111193153 → 0.0.0-202111121740

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 (171) hide show
  1. package/CHANGELOG.md +2 -12
  2. package/dist/browser.esm.js +605 -587
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +222 -204
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/ActionList2/Divider.d.ts +2 -3
  7. package/lib/ActionList2/Divider.js +5 -10
  8. package/lib/ActionList2/Item.js +5 -21
  9. package/lib/ActionList2/List.js +1 -11
  10. package/lib/ActionList2/Selection.js +0 -11
  11. package/lib/ActionList2/index.d.ts +2 -1
  12. package/lib/Autocomplete/AutocompleteMenu.js +6 -13
  13. package/lib/Avatar.d.ts +2 -1
  14. package/lib/Avatar.js +1 -1
  15. package/lib/BranchName.d.ts +2 -1
  16. package/lib/BranchName.js +1 -1
  17. package/lib/Checkbox.d.ts +1 -1
  18. package/lib/CheckboxInputField.d.ts +11 -0
  19. package/lib/CheckboxInputField.js +73 -0
  20. package/lib/ChoiceFieldset/ChoiceFieldCaption.d.ts +3 -0
  21. package/lib/ChoiceFieldset/ChoiceFieldCaption.js +35 -0
  22. package/lib/ChoiceFieldset/ChoiceFieldLabel.d.ts +3 -0
  23. package/lib/ChoiceFieldset/ChoiceFieldLabel.js +35 -0
  24. package/lib/ChoiceFieldset/ChoiceFieldset.d.ts +63 -0
  25. package/lib/ChoiceFieldset/ChoiceFieldset.js +95 -0
  26. package/lib/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +3 -0
  27. package/lib/ChoiceFieldset/ChoiceFieldsetDescription.js +29 -0
  28. package/lib/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +6 -0
  29. package/lib/ChoiceFieldset/ChoiceFieldsetLegend.js +44 -0
  30. package/lib/ChoiceFieldset/ChoiceFieldsetList.d.ts +6 -0
  31. package/lib/ChoiceFieldset/ChoiceFieldsetList.js +80 -0
  32. package/lib/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +18 -0
  33. package/lib/ChoiceFieldset/ChoiceFieldsetListContext.js +15 -0
  34. package/lib/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +25 -0
  35. package/lib/ChoiceFieldset/ChoiceFieldsetListItem.js +74 -0
  36. package/lib/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +6 -0
  37. package/lib/ChoiceFieldset/ChoiceFieldsetValidation.js +17 -0
  38. package/lib/ChoiceFieldset/index.d.ts +3 -0
  39. package/lib/ChoiceFieldset/index.js +23 -0
  40. package/lib/Details.d.ts +2 -1
  41. package/lib/Details.js +3 -1
  42. package/lib/Dropdown.d.ts +66 -2
  43. package/lib/Heading.d.ts +2 -1
  44. package/lib/Heading.js +6 -1
  45. package/lib/ProgressBar.d.ts +11 -16
  46. package/lib/ProgressBar.js +10 -6
  47. package/lib/RadioInputField.d.ts +9 -0
  48. package/lib/RadioInputField.js +82 -0
  49. package/lib/Spinner.d.ts +2 -1
  50. package/lib/Spinner.js +3 -1
  51. package/lib/TextInputField.d.ts +581 -0
  52. package/lib/TextInputField.js +66 -0
  53. package/lib/_InputCaption.d.ts +13 -0
  54. package/lib/_InputCaption.js +27 -0
  55. package/lib/_InputField/InputField.d.ts +39 -0
  56. package/lib/_InputField/InputField.js +90 -0
  57. package/lib/_InputField/InputFieldCaption.d.ts +3 -0
  58. package/lib/_InputField/InputFieldCaption.js +30 -0
  59. package/lib/_InputField/InputFieldLabel.d.ts +9 -0
  60. package/lib/_InputField/InputFieldLabel.js +34 -0
  61. package/lib/_InputField/InputFieldValidation.d.ts +6 -0
  62. package/lib/{ActionList2/MenuContext.js → _InputField/InputFieldValidation.js} +6 -4
  63. package/lib/_InputField/ToggleInputField.d.ts +13 -0
  64. package/lib/_InputField/ToggleInputField.js +71 -0
  65. package/lib/_InputField/ToggleInputLeadingVisual.d.ts +3 -0
  66. package/lib/_InputField/ToggleInputLeadingVisual.js +22 -0
  67. package/lib/_InputField/ValidationAnimationContainer.d.ts +6 -0
  68. package/lib/_InputField/ValidationAnimationContainer.js +48 -0
  69. package/lib/_InputField/index.d.ts +1 -0
  70. package/lib/_InputField/index.js +15 -0
  71. package/lib/_InputField/slots.d.ts +13 -0
  72. package/lib/_InputField/slots.js +17 -0
  73. package/lib/_InputLabel.d.ts +8 -0
  74. package/lib/_InputLabel.js +44 -0
  75. package/lib/_InputValidation.d.ts +8 -0
  76. package/lib/_InputValidation.js +56 -0
  77. package/lib/_VisuallyHidden.d.ts +6 -0
  78. package/lib/_VisuallyHidden.js +39 -0
  79. package/lib/drafts.d.ts +0 -1
  80. package/lib/drafts.js +0 -13
  81. package/lib/index.d.ts +4 -0
  82. package/lib/index.js +38 -0
  83. package/lib/utils/types/FormValidationStatus.d.ts +1 -0
  84. package/lib/utils/types/FormValidationStatus.js +1 -0
  85. package/lib-esm/ActionList2/Divider.d.ts +2 -3
  86. package/lib-esm/ActionList2/Divider.js +5 -8
  87. package/lib-esm/ActionList2/Item.js +5 -19
  88. package/lib-esm/ActionList2/List.js +1 -9
  89. package/lib-esm/ActionList2/Selection.js +0 -9
  90. package/lib-esm/ActionList2/index.d.ts +2 -1
  91. package/lib-esm/Autocomplete/AutocompleteMenu.js +3 -13
  92. package/lib-esm/Avatar.d.ts +2 -1
  93. package/lib-esm/Avatar.js +2 -2
  94. package/lib-esm/BranchName.d.ts +2 -1
  95. package/lib-esm/BranchName.js +2 -2
  96. package/lib-esm/Checkbox.d.ts +1 -1
  97. package/lib-esm/CheckboxInputField.d.ts +11 -0
  98. package/lib-esm/CheckboxInputField.js +56 -0
  99. package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.d.ts +3 -0
  100. package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.js +20 -0
  101. package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.d.ts +3 -0
  102. package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.js +20 -0
  103. package/lib-esm/ChoiceFieldset/ChoiceFieldset.d.ts +63 -0
  104. package/lib-esm/ChoiceFieldset/ChoiceFieldset.js +72 -0
  105. package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +3 -0
  106. package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.js +17 -0
  107. package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +6 -0
  108. package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.js +31 -0
  109. package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.d.ts +6 -0
  110. package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.js +63 -0
  111. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +18 -0
  112. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.js +5 -0
  113. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +25 -0
  114. package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.js +50 -0
  115. package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +6 -0
  116. package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.js +7 -0
  117. package/lib-esm/ChoiceFieldset/index.d.ts +3 -0
  118. package/lib-esm/ChoiceFieldset/index.js +2 -0
  119. package/lib-esm/Details.d.ts +2 -1
  120. package/lib-esm/Details.js +2 -1
  121. package/lib-esm/Dropdown.d.ts +66 -2
  122. package/lib-esm/Heading.d.ts +2 -1
  123. package/lib-esm/Heading.js +6 -2
  124. package/lib-esm/ProgressBar.d.ts +11 -16
  125. package/lib-esm/ProgressBar.js +11 -7
  126. package/lib-esm/RadioInputField.d.ts +9 -0
  127. package/lib-esm/RadioInputField.js +65 -0
  128. package/lib-esm/Spinner.d.ts +2 -1
  129. package/lib-esm/Spinner.js +2 -1
  130. package/lib-esm/TextInputField.d.ts +581 -0
  131. package/lib-esm/TextInputField.js +50 -0
  132. package/lib-esm/_InputCaption.d.ts +13 -0
  133. package/lib-esm/_InputCaption.js +16 -0
  134. package/lib-esm/_InputField/InputField.d.ts +39 -0
  135. package/lib-esm/_InputField/InputField.js +70 -0
  136. package/lib-esm/_InputField/InputFieldCaption.d.ts +3 -0
  137. package/lib-esm/_InputField/InputFieldCaption.js +18 -0
  138. package/lib-esm/_InputField/InputFieldLabel.d.ts +9 -0
  139. package/lib-esm/_InputField/InputFieldLabel.js +22 -0
  140. package/lib-esm/_InputField/InputFieldValidation.d.ts +6 -0
  141. package/lib-esm/_InputField/InputFieldValidation.js +7 -0
  142. package/lib-esm/_InputField/ToggleInputField.d.ts +13 -0
  143. package/lib-esm/_InputField/ToggleInputField.js +54 -0
  144. package/lib-esm/_InputField/ToggleInputLeadingVisual.d.ts +3 -0
  145. package/lib-esm/_InputField/ToggleInputLeadingVisual.js +11 -0
  146. package/lib-esm/_InputField/ValidationAnimationContainer.d.ts +6 -0
  147. package/lib-esm/_InputField/ValidationAnimationContainer.js +33 -0
  148. package/lib-esm/_InputField/index.d.ts +1 -0
  149. package/lib-esm/_InputField/index.js +1 -0
  150. package/lib-esm/_InputField/slots.d.ts +13 -0
  151. package/lib-esm/_InputField/slots.js +5 -0
  152. package/lib-esm/_InputLabel.d.ts +8 -0
  153. package/lib-esm/_InputLabel.js +32 -0
  154. package/lib-esm/_InputValidation.d.ts +8 -0
  155. package/lib-esm/_InputValidation.js +43 -0
  156. package/lib-esm/_VisuallyHidden.d.ts +6 -0
  157. package/lib-esm/_VisuallyHidden.js +26 -0
  158. package/lib-esm/drafts.d.ts +0 -1
  159. package/lib-esm/drafts.js +1 -2
  160. package/lib-esm/index.d.ts +4 -0
  161. package/lib-esm/index.js +4 -0
  162. package/lib-esm/utils/types/FormValidationStatus.d.ts +1 -0
  163. package/lib-esm/utils/types/FormValidationStatus.js +1 -0
  164. package/package.json +2 -2
  165. package/lib/ActionList2/MenuContext.d.ts +0 -10
  166. package/lib/ActionMenu2.d.ts +0 -310
  167. package/lib/ActionMenu2.js +0 -91
  168. package/lib-esm/ActionList2/MenuContext.d.ts +0 -10
  169. package/lib-esm/ActionList2/MenuContext.js +0 -3
  170. package/lib-esm/ActionMenu2.d.ts +0 -310
  171. package/lib-esm/ActionMenu2.js +0 -67
@@ -0,0 +1,63 @@
1
+ import React, { ComponentProps } from 'react';
2
+ import { FormValidationStatus } from '../utils/types/FormValidationStatus';
3
+ export interface ChoiceFieldsetProps<T = Record<string, FormValidationStatus>> {
4
+ children?: React.ReactNode;
5
+ /**
6
+ * Whether the fieldset is ready for user input
7
+ */
8
+ disabled?: boolean;
9
+ /**
10
+ * The unique identifier for this fieldset. Used to associate the validation text and caption text with the fieldset
11
+ */
12
+ id?: string;
13
+ /**
14
+ * The unique identifier used to associate the inputs with eachother
15
+ */
16
+ name?: string;
17
+ /**
18
+ * The callback that is called when a user toggles a choice on or off
19
+ */
20
+ onSelect?: (selectedValues?: string[]) => void;
21
+ /**
22
+ * The selected values
23
+ */
24
+ selected?: string[];
25
+ /**
26
+ * Whether this field must have a value for the user to complete their task
27
+ */
28
+ required?: boolean;
29
+ /**
30
+ * A map of validation statuses and their associated validation keys. When one of the validation keys is passed to the `validationResult` prop,
31
+ * the associated validation message will be rendered in the correct style
32
+ */
33
+ validationMap?: T;
34
+ /**
35
+ * The key of the validation message to show
36
+ */
37
+ validationResult?: keyof T;
38
+ }
39
+ export interface ChoiceFieldsetContext extends ChoiceFieldsetProps {
40
+ validationMessageId: string;
41
+ }
42
+ declare const Slot: React.FC<{
43
+ name: "Description" | "ChoiceList" | "Legend" | "Validation";
44
+ children: React.ReactNode;
45
+ }>;
46
+ export { Slot };
47
+ declare const ChoiceFieldset: <T extends Record<string, FormValidationStatus>>({ children, disabled, id, name, onSelect, required, selected, validationMap, validationResult }: ChoiceFieldsetProps<T>) => JSX.Element;
48
+ export declare type InputFieldComponentProps = ComponentProps<typeof ChoiceFieldset>;
49
+ export type { ChoiceFieldsetListProps } from './ChoiceFieldsetList';
50
+ export type { ChoiceFieldsetLegendProps } from './ChoiceFieldsetLegend';
51
+ export type { ChoiceFieldProps } from './ChoiceFieldsetListItem';
52
+ declare const _default: (<T extends Record<string, FormValidationStatus>>({ children, disabled, id, name, onSelect, required, selected, validationMap, validationResult }: ChoiceFieldsetProps<T>) => JSX.Element) & {
53
+ Description: React.FC<{}>;
54
+ Item: React.FC<import("./ChoiceFieldsetListItem").ChoiceFieldProps> & {
55
+ Caption: React.FC<{}>;
56
+ Label: React.FC<{}>;
57
+ LeadingVisual: React.FC<{}>;
58
+ };
59
+ Legend: React.FC<import("./ChoiceFieldsetLegend").ChoiceFieldsetLegendProps>;
60
+ List: React.FC<import("./ChoiceFieldsetList").ChoiceFieldsetListProps>;
61
+ Validation: React.FC<import("./ChoiceFieldsetValidation").ChoiceFieldsetValidationProps>;
62
+ };
63
+ export default _default;
@@ -0,0 +1,72 @@
1
+ import React from 'react';
2
+ import { Box } from '..';
3
+ import createSlots from '../utils/create-slots';
4
+ import { uniqueId } from '../utils/uniqueId';
5
+ import ValidationAnimationContainer from '../_InputField/ValidationAnimationContainer';
6
+ import InputValidation from '../_InputValidation';
7
+ import ChoiceFieldsetListItem from './ChoiceFieldsetListItem';
8
+ import ChoiceFieldsetDescription from './ChoiceFieldsetDescription';
9
+ import ChoiceFieldsetLegend from './ChoiceFieldsetLegend';
10
+ import ChoiceFieldsetList from './ChoiceFieldsetList';
11
+ import ChoiceFieldsetValidation from './ChoiceFieldsetValidation';
12
+ const {
13
+ Slots,
14
+ Slot
15
+ } = createSlots(['Description', 'ChoiceList', 'Legend', 'Validation']);
16
+ export { Slot };
17
+
18
+ const ChoiceFieldset = ({
19
+ children,
20
+ disabled,
21
+ id,
22
+ name,
23
+ onSelect,
24
+ required,
25
+ selected,
26
+ validationMap,
27
+ validationResult
28
+ }) => {
29
+ var _React$Children$map;
30
+
31
+ const fieldsetId = id || uniqueId();
32
+ const validationChildren = (_React$Children$map = React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.type === ChoiceFieldsetValidation ? child : null)) === null || _React$Children$map === void 0 ? void 0 : _React$Children$map.filter(Boolean);
33
+ const validationChildToRender = validationChildren === null || validationChildren === void 0 ? void 0 : validationChildren.find(child => child.props.validationKey === validationResult);
34
+ const validationMessageId = validationChildToRender ? `${fieldsetId}-validationMsg` : undefined;
35
+ return /*#__PURE__*/React.createElement(Slots, {
36
+ context: {
37
+ disabled,
38
+ name,
39
+ onSelect,
40
+ required,
41
+ selected,
42
+ validationMessageId
43
+ }
44
+ }, slots => {
45
+ const isLegendVisible = /*#__PURE__*/React.isValidElement(slots.Legend) && slots.Legend.props.isVisible;
46
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Box, {
47
+ as: "fieldset",
48
+ border: "none",
49
+ margin: 0,
50
+ padding: 0,
51
+ "aria-describedby": [validationMessageId].filter(Boolean).join(' ')
52
+ }, React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && child.type !== ChoiceFieldsetValidation), /*#__PURE__*/React.createElement(Box, {
53
+ mb: isLegendVisible ? 3 : undefined
54
+ }, slots.Legend, slots.Description), slots.ChoiceList), validationChildToRender && /*#__PURE__*/React.createElement(Box, {
55
+ mt: 3
56
+ }, validationMap && validationResult && validationMessageId && /*#__PURE__*/React.createElement(ValidationAnimationContainer, {
57
+ show: true
58
+ }, /*#__PURE__*/React.createElement(InputValidation, {
59
+ validationStatus: validationMap[validationResult],
60
+ id: validationMessageId
61
+ }, validationChildToRender))));
62
+ });
63
+ };
64
+
65
+ ChoiceFieldset.displayName = "ChoiceFieldset";
66
+ export default Object.assign(ChoiceFieldset, {
67
+ Description: ChoiceFieldsetDescription,
68
+ Item: ChoiceFieldsetListItem,
69
+ Legend: ChoiceFieldsetLegend,
70
+ List: ChoiceFieldsetList,
71
+ Validation: ChoiceFieldsetValidation
72
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ChoiceFieldsetDescription: React.FC;
3
+ export default ChoiceFieldsetDescription;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Text } from '..';
3
+ import { Slot } from './ChoiceFieldset';
4
+
5
+ const ChoiceFieldsetDescription = ({
6
+ children
7
+ }) => /*#__PURE__*/React.createElement(Slot, {
8
+ name: "Description"
9
+ }, ({
10
+ disabled
11
+ }) => /*#__PURE__*/React.createElement(Text, {
12
+ color: disabled ? 'fg.muted' : 'fg.default',
13
+ fontSize: 1
14
+ }, children));
15
+
16
+ ChoiceFieldsetDescription.displayName = "ChoiceFieldsetDescription";
17
+ export default ChoiceFieldsetDescription;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface ChoiceFieldsetLegendProps {
3
+ visuallyHidden?: boolean;
4
+ }
5
+ declare const ChoiceFieldsetLegend: React.FC<ChoiceFieldsetLegendProps>;
6
+ export default ChoiceFieldsetLegend;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { Box } from '..';
3
+ import VisuallyHidden from '../_VisuallyHidden';
4
+ import { Slot } from './ChoiceFieldset';
5
+
6
+ const ChoiceFieldsetLegend = ({
7
+ children,
8
+ visuallyHidden
9
+ }) => /*#__PURE__*/React.createElement(Slot, {
10
+ name: "Legend"
11
+ }, ({
12
+ required,
13
+ disabled
14
+ }) => /*#__PURE__*/React.createElement(VisuallyHidden, {
15
+ as: "legend",
16
+ isVisible: !visuallyHidden,
17
+ title: required ? 'required field' : undefined,
18
+ sx: {
19
+ color: disabled ? 'fg.muted' : undefined,
20
+ fontSize: 2,
21
+ padding: 0
22
+ }
23
+ }, required ? /*#__PURE__*/React.createElement(Box, {
24
+ display: "flex",
25
+ as: "span"
26
+ }, /*#__PURE__*/React.createElement(Box, {
27
+ mr: 1
28
+ }, children), /*#__PURE__*/React.createElement("span", null, "*")) : children));
29
+
30
+ ChoiceFieldsetLegend.displayName = "ChoiceFieldsetLegend";
31
+ export default ChoiceFieldsetLegend;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface ChoiceFieldsetListProps {
3
+ selectionVariant?: 'single' | 'multiple';
4
+ }
5
+ declare const ChoiceFieldsetList: React.FC<ChoiceFieldsetListProps>;
6
+ export default ChoiceFieldsetList;
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { CheckboxInputField, RadioInputField } from '..';
4
+ import { get } from '../constants';
5
+ import { uniqueId } from '../utils/uniqueId';
6
+ import { Slot } from './ChoiceFieldset';
7
+ import ChoiceFieldsetListContext from './ChoiceFieldsetListContext';
8
+ const List = styled.ul.withConfig({
9
+ displayName: "ChoiceFieldsetList__List",
10
+ componentId: "sc-16da7ba-0"
11
+ })(["display:flex;flex-direction:column;list-style:none;margin:0;padding:0;> li + li{margin-top:", ";}"], get('space.2'));
12
+
13
+ const ChoiceFieldsetList = ({
14
+ selectionVariant,
15
+ children
16
+ }) => {
17
+ // generates a name to pass to radio inputs if one was not passed in ChoiceFieldset props
18
+ const getRadioGroupName = nameFromContext => {
19
+ if (nameFromContext || selectionVariant !== 'multiple') {
20
+ return nameFromContext;
21
+ }
22
+
23
+ const generatedName = uniqueId();
24
+ return generatedName;
25
+ };
26
+
27
+ return /*#__PURE__*/React.createElement(Slot, {
28
+ name: "ChoiceList"
29
+ }, ({
30
+ name,
31
+ onSelect,
32
+ disabled,
33
+ selected = []
34
+ }) => {
35
+ const getSelectedCheckboxes = (value, checked) => {
36
+ if (checked) {
37
+ return selectionVariant === 'multiple' ? [...selected, value] : [value];
38
+ }
39
+
40
+ return selected.filter(selectedValue => selectedValue !== value);
41
+ };
42
+
43
+ return /*#__PURE__*/React.createElement(ChoiceFieldsetListContext.Provider, {
44
+ value: {
45
+ disabled,
46
+ selected,
47
+ name: getRadioGroupName(name),
48
+ fieldComponent: selectionVariant === 'multiple' ? CheckboxInputField : RadioInputField,
49
+ onChange: e => {
50
+ onSelect && onSelect(getSelectedCheckboxes(e.currentTarget.value, e.currentTarget.checked));
51
+ }
52
+ }
53
+ }, /*#__PURE__*/React.createElement(List, null, React.Children.map(children, (child, i) => /*#__PURE__*/React.createElement("li", {
54
+ key: i
55
+ }, child))));
56
+ });
57
+ };
58
+
59
+ ChoiceFieldsetList.displayName = "ChoiceFieldsetList";
60
+ ChoiceFieldsetList.defaultProps = {
61
+ selectionVariant: 'single'
62
+ };
63
+ export default ChoiceFieldsetList;
@@ -0,0 +1,18 @@
1
+ import { ChangeEventHandler } from 'react';
2
+ import { CheckboxInputField, RadioInputField } from '..';
3
+ import { ComponentProps } from '../utils/types';
4
+ import InputField from '../_InputField';
5
+ import ToggleInputField, { ToggleInputFieldProps } from '../_InputField/ToggleInputField';
6
+ declare const ChoiceFieldsetListContext: import("react").Context<{
7
+ disabled?: boolean | undefined;
8
+ name?: string | undefined;
9
+ onChange: ChangeEventHandler<HTMLInputElement>;
10
+ fieldComponent: React.FC<ToggleInputFieldProps> & {
11
+ Input: React.FC<ComponentProps<typeof RadioInputField.Input>> | React.FC<ComponentProps<typeof CheckboxInputField.Input>>;
12
+ Caption: React.FC<ComponentProps<typeof InputField.Caption>>;
13
+ Label: React.FC<ComponentProps<typeof InputField.Label>>;
14
+ LeadingVisual: React.FC<ComponentProps<typeof ToggleInputField.LeadingVisual>>;
15
+ };
16
+ selected?: string[] | undefined;
17
+ } | null>;
18
+ export default ChoiceFieldsetListContext;
@@ -0,0 +1,5 @@
1
+ import { createContext } from 'react';
2
+ import { CheckboxInputField } from '..';
3
+ const ChoiceFieldsetListContext = /*#__PURE__*/createContext(null);
4
+ CheckboxInputField.Input;
5
+ export default ChoiceFieldsetListContext;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { ComponentProps } from '../utils/types';
3
+ export interface ChoiceFieldProps {
4
+ /**
5
+ * Whether the field is ready for user input
6
+ */
7
+ disabled?: boolean;
8
+ /**
9
+ * The unique identifier for this field. Used to associate the label, validation text, and caption text.
10
+ * If an ID is not provided, one will be automatically generated.
11
+ */
12
+ id?: string;
13
+ /**
14
+ * The value that is being selected
15
+ */
16
+ value: string;
17
+ }
18
+ declare const ChoiceFieldsetListItem: React.FC<ChoiceFieldProps>;
19
+ export declare type ChoiceFieldComponentProps = ComponentProps<typeof ChoiceFieldsetListItem>;
20
+ declare const _default: React.FC<ChoiceFieldProps> & {
21
+ Caption: React.FC<{}>;
22
+ Label: React.FC<{}>;
23
+ LeadingVisual: React.FC<{}>;
24
+ };
25
+ export default _default;
@@ -0,0 +1,50 @@
1
+ import React, { useContext } from 'react';
2
+ import { uniqueId } from '../utils/uniqueId';
3
+ import ToggleInputLeadingVisual from '../_InputField/ToggleInputLeadingVisual';
4
+ import ChoiceFieldCaption from './ChoiceFieldCaption';
5
+ import ChoiceFieldLabel from './ChoiceFieldLabel';
6
+ import ChoiceFieldsetListContext from './ChoiceFieldsetListContext';
7
+
8
+ const ChoiceFieldsetListItem = ({
9
+ children,
10
+ id,
11
+ disabled: disabledProp,
12
+ value
13
+ }) => {
14
+ const choiceFieldsetListContext = useContext(ChoiceFieldsetListContext);
15
+
16
+ if (choiceFieldsetListContext === null) {
17
+ throw new Error('ChoiceFieldsetListContext returned null');
18
+ }
19
+
20
+ const {
21
+ name,
22
+ onChange,
23
+ fieldComponent: FieldComponent,
24
+ selected,
25
+ disabled
26
+ } = choiceFieldsetListContext;
27
+ const fieldId = id || uniqueId();
28
+ const labelChild = React.Children.toArray(children).find(child => /*#__PURE__*/React.isValidElement(child) && child.type === ChoiceFieldLabel);
29
+ const otherValidChildren = React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && (child.type === ChoiceFieldCaption || child.type === ToggleInputLeadingVisual));
30
+ return /*#__PURE__*/React.createElement(FieldComponent, {
31
+ id: fieldId,
32
+ disabled: disabledProp || disabled
33
+ }, /*#__PURE__*/React.createElement(FieldComponent.Input, {
34
+ checked: selected === null || selected === void 0 ? void 0 : selected.includes(value),
35
+ value: value,
36
+ name: name,
37
+ onChange: onChange
38
+ }), labelChild ? // if <Item.Label> was passed, we can just render the children as-is
39
+ children :
40
+ /*#__PURE__*/
41
+ // if <Item.Label> was NOT passed, treat all the children except <Item.Caption> and <Item.LeadingVisual> as the label
42
+ React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FieldComponent.Label, null, children), otherValidChildren));
43
+ };
44
+
45
+ ChoiceFieldsetListItem.displayName = "ChoiceFieldsetListItem";
46
+ export default Object.assign(ChoiceFieldsetListItem, {
47
+ Caption: ChoiceFieldCaption,
48
+ Label: ChoiceFieldLabel,
49
+ LeadingVisual: ToggleInputLeadingVisual
50
+ });
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface ChoiceFieldsetValidationProps {
3
+ validationKey: string;
4
+ }
5
+ declare const ChoiceFieldsetValidation: React.FC<ChoiceFieldsetValidationProps>;
6
+ export default ChoiceFieldsetValidation;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+
3
+ const ChoiceFieldsetValidation = ({
4
+ children
5
+ }) => /*#__PURE__*/React.createElement(React.Fragment, null, children);
6
+
7
+ export default ChoiceFieldsetValidation;
@@ -0,0 +1,3 @@
1
+ export { default } from './ChoiceFieldset';
2
+ export { default as Item } from './ChoiceFieldsetListItem';
3
+ export type { ChoiceFieldsetProps } from './ChoiceFieldset';
@@ -0,0 +1,2 @@
1
+ export { default } from './ChoiceFieldset';
2
+ export { default as Item } from './ChoiceFieldsetListItem';
@@ -1,5 +1,6 @@
1
+ import { SystemCommonProps } from './constants';
1
2
  import { SxProp } from './sx';
2
3
  import { ComponentProps } from './utils/types';
3
- declare const Details: import("styled-components").StyledComponent<"details", any, SxProp, never>;
4
+ declare const Details: import("styled-components").StyledComponent<"details", any, SystemCommonProps & SxProp, never>;
4
5
  export declare type DetailsProps = ComponentProps<typeof Details>;
5
6
  export default Details;
@@ -1,8 +1,9 @@
1
1
  import styled from 'styled-components';
2
+ import { COMMON } from './constants';
2
3
  import sx from './sx';
3
4
  const Details = styled.details.withConfig({
4
5
  displayName: "Details",
5
6
  componentId: "ssy9qz-0"
6
- })(["& > summary{list-style:none;}& > summary::-webkit-details-marker{display:none;}", ";"], sx);
7
+ })(["& > summary{list-style:none;}& > summary::-webkit-details-marker{display:none;}", " ", ";"], COMMON, sx);
7
8
  Details.displayName = 'Details';
8
9
  export default Details;
@@ -15,14 +15,46 @@ export declare type DropdownMenuProps = ComponentProps<typeof DropdownMenu>;
15
15
  export declare type DropdownItemProps = ComponentProps<typeof DropdownItem>;
16
16
  declare const _default: {
17
17
  ({ children, className, ...rest }: {
18
- color?: string | undefined;
18
+ backgroundColor?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
19
+ color?: (string & import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>) | undefined;
20
+ display?: import("styled-system").ResponsiveValue<import("csstype").Property.Display, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
21
+ marginBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
22
+ marginLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
23
+ marginRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
24
+ marginTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
25
+ opacity?: import("styled-system").ResponsiveValue<import("csstype").Property.Opacity, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
26
+ paddingBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
27
+ paddingLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
28
+ paddingRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
29
+ paddingTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
19
30
  translate?: "yes" | "no" | undefined;
31
+ margin?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
32
+ padding?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
20
33
  hidden?: boolean | undefined;
21
34
  children?: React.ReactNode;
22
35
  ref?: ((instance: HTMLElement | null) => void) | React.RefObject<HTMLElement> | null | undefined;
36
+ p?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
23
37
  slot?: string | undefined;
24
38
  style?: React.CSSProperties | undefined;
25
39
  title?: string | undefined;
40
+ bg?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
41
+ m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
42
+ mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
43
+ mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
44
+ mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
45
+ ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
46
+ mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
47
+ marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
48
+ my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
49
+ marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
50
+ pt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
51
+ pr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
52
+ pb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
53
+ pl?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
54
+ px?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
55
+ paddingX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
56
+ py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
57
+ paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
26
58
  open?: boolean | undefined;
27
59
  role?: React.AriaRole | undefined;
28
60
  sx?: import("./sx").BetterSystemStyleObject | undefined;
@@ -281,14 +313,46 @@ declare const _default: {
281
313
  theme?: any;
282
314
  }): JSX.Element;
283
315
  defaultProps: Partial<{
284
- color?: string | undefined;
316
+ backgroundColor?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
317
+ color?: (string & import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>) | undefined;
318
+ display?: import("styled-system").ResponsiveValue<import("csstype").Property.Display, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
319
+ marginBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
320
+ marginLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
321
+ marginRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
322
+ marginTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
323
+ opacity?: import("styled-system").ResponsiveValue<import("csstype").Property.Opacity, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
324
+ paddingBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
325
+ paddingLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
326
+ paddingRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
327
+ paddingTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
285
328
  translate?: "yes" | "no" | undefined;
329
+ margin?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
330
+ padding?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
286
331
  hidden?: boolean | undefined;
287
332
  children?: React.ReactNode;
288
333
  ref?: ((instance: HTMLElement | null) => void) | React.RefObject<HTMLElement> | null | undefined;
334
+ p?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
289
335
  slot?: string | undefined;
290
336
  style?: React.CSSProperties | undefined;
291
337
  title?: string | undefined;
338
+ bg?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
339
+ m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
340
+ mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
341
+ mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
342
+ mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
343
+ ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
344
+ mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
345
+ marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
346
+ my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
347
+ marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
348
+ pt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
349
+ pr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
350
+ pb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
351
+ pl?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
352
+ px?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
353
+ paddingX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
354
+ py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
355
+ paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
292
356
  open?: boolean | undefined;
293
357
  role?: React.AriaRole | undefined;
294
358
  sx?: import("./sx").BetterSystemStyleObject | undefined;
@@ -1,5 +1,6 @@
1
+ import { SystemCommonProps, SystemTypographyProps } from './constants';
1
2
  import { SxProp } from './sx';
2
3
  import { ComponentProps } from './utils/types';
3
- declare const Heading: import("styled-components").StyledComponent<"h2", any, SxProp, never>;
4
+ declare const Heading: import("styled-components").StyledComponent<"h2", any, SystemTypographyProps & SystemCommonProps & SxProp, never>;
4
5
  export declare type HeadingProps = ComponentProps<typeof Heading>;
5
6
  export default Heading;
@@ -1,8 +1,12 @@
1
1
  import styled from 'styled-components';
2
- import { get } from './constants';
2
+ import { COMMON, get, TYPOGRAPHY } from './constants';
3
3
  import sx from './sx';
4
+ import theme from './theme';
4
5
  const Heading = styled.h2.withConfig({
5
6
  displayName: "Heading",
6
7
  componentId: "sc-1cjoo9h-0"
7
- })(["font-weight:", ";font-size:", ";margin:0;", ";"], get('fontWeights.bold'), get('fontSizes.5'), sx);
8
+ })(["font-weight:", ";font-size:", ";margin:0;", ";", ";", ";"], get('fontWeights.bold'), get('fontSizes.5'), TYPOGRAPHY, COMMON, sx);
9
+ Heading.defaultProps = {
10
+ theme
11
+ };
8
12
  export default Heading;
@@ -1,22 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  import { WidthProps } from 'styled-system';
3
+ import { SystemCommonProps } from './constants';
3
4
  import { SxProp } from './sx';
4
- declare type ProgressProp = {
5
- progress?: string | number;
6
- };
7
- declare const sizeMap: {
8
- small: string;
9
- large: string;
10
- default: string;
11
- };
12
- declare type StyledProgressContainerProps = {
13
- inline?: boolean;
14
- barSize?: keyof typeof sizeMap;
15
- } & WidthProps & SxProp;
16
- export declare type ProgressBarProps = {
17
- bg: string;
18
- } & StyledProgressContainerProps & ProgressProp;
19
- declare function ProgressBar({ progress, bg, ...rest }: ProgressBarProps): JSX.Element;
5
+ import { ComponentProps } from './utils/types';
6
+ declare const Bar: import("styled-components").StyledComponent<"span", any, {
7
+ progress?: string | number | undefined;
8
+ } & SystemCommonProps, never>;
9
+ declare const ProgressContainer: import("styled-components").StyledComponent<"span", any, {
10
+ inline?: boolean | undefined;
11
+ barSize?: "small" | "default" | "large" | undefined;
12
+ } & WidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>> & SystemCommonProps & SxProp, never>;
13
+ export declare type ProgressBarProps = ComponentProps<typeof ProgressContainer> & ComponentProps<typeof Bar>;
14
+ declare function ProgressBar({ progress, bg, theme, ...rest }: ProgressBarProps): JSX.Element;
20
15
  declare namespace ProgressBar {
21
16
  var defaultProps: {
22
17
  bg: string;
@@ -1,12 +1,14 @@
1
+ function _extends() { _extends = Object.assign || 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); }
2
+
1
3
  import React from 'react';
2
4
  import styled from 'styled-components';
3
5
  import { width } from 'styled-system';
4
- import { get } from './constants';
6
+ import { COMMON, get } from './constants';
5
7
  import sx from './sx';
6
8
  const Bar = styled.span.withConfig({
7
9
  displayName: "ProgressBar__Bar",
8
10
  componentId: "sc-1tiva13-0"
9
- })(["width:", ";", ";"], props => props.progress ? `${props.progress}%` : 0, sx);
11
+ })(["width:", ";", ""], props => props.progress ? `${props.progress}%` : 0, COMMON);
10
12
  const sizeMap = {
11
13
  small: '5px',
12
14
  large: '10px',
@@ -15,18 +17,20 @@ const sizeMap = {
15
17
  const ProgressContainer = styled.span.withConfig({
16
18
  displayName: "ProgressBar__ProgressContainer",
17
19
  componentId: "sc-1tiva13-1"
18
- })(["display:", ";overflow:hidden;background-color:", ";border-radius:", ";height:", ";", " ", ";"], props => props.inline ? 'inline-flex' : 'flex', get('colors.border.default'), get('radii.1'), props => sizeMap[props.barSize || 'default'], width, sx);
20
+ })(["display:", ";overflow:hidden;background-color:", ";border-radius:", ";height:", ";", " ", " ", ";"], props => props.inline ? 'inline-flex' : 'flex', get('colors.border.default'), get('radii.1'), props => sizeMap[props.barSize || 'default'], COMMON, width, sx);
19
21
 
20
22
  function ProgressBar({
21
23
  progress,
22
24
  bg,
25
+ theme,
23
26
  ...rest
24
27
  }) {
25
- return /*#__PURE__*/React.createElement(ProgressContainer, rest, /*#__PURE__*/React.createElement(Bar, {
28
+ return /*#__PURE__*/React.createElement(ProgressContainer, _extends({
29
+ theme: theme
30
+ }, rest), /*#__PURE__*/React.createElement(Bar, {
26
31
  progress: progress,
27
- sx: {
28
- bg
29
- }
32
+ bg: bg,
33
+ theme: theme
30
34
  }));
31
35
  }
32
36