@sproutsocial/racine 22.1.1 → 22.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +3 -3
- package/__flow__/SegmentedControl/SegmentedControl.flow.js +2 -0
- package/commonjs/Drawer/Drawer.js +20 -5
- package/commonjs/Popout/Popout.js +12 -4
- package/commonjs/SegmentedControl/SegmentedControl.js +6 -3
- package/commonjs/SegmentedControl/styles.js +4 -2
- package/commonjs/Tooltip/Tooltip.js +6 -2
- package/commonjs/utils/system-props/index.js +4 -4
- package/dist/types/Drawer/Drawer.d.ts.map +1 -1
- package/dist/types/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/types/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/types/SegmentedControl/SegmentedControlTypes.d.ts +2 -0
- package/dist/types/SegmentedControl/SegmentedControlTypes.d.ts.map +1 -1
- package/dist/types/SegmentedControl/styles.d.ts +2 -2
- package/dist/types/SegmentedControl/styles.d.ts.map +1 -1
- package/dist/types/utils/system-props/index.d.ts +1 -1
- package/dist/types/utils/system-props/index.d.ts.map +1 -1
- package/lib/Drawer/Drawer.js +20 -5
- package/lib/Popout/Popout.js +12 -4
- package/lib/SegmentedControl/SegmentedControl.js +6 -3
- package/lib/SegmentedControl/styles.js +4 -2
- package/lib/Tooltip/Tooltip.js +6 -2
- package/lib/utils/system-props/index.js +1 -1
- package/package.json +2 -2
- package/commonjs/utils/system-props/gap.js +0 -21
- package/commonjs/utils/system-props/system-props.js +0 -33
- package/dist/types/utils/system-props/gap.d.ts +0 -2
- package/dist/types/utils/system-props/gap.d.ts.map +0 -1
- package/dist/types/utils/system-props/system-props.d.ts +0 -9
- package/dist/types/utils/system-props/system-props.d.ts.map +0 -1
- package/lib/utils/system-props/gap.js +0 -15
- package/lib/utils/system-props/system-props.js +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 22.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3dce611: Added a disabled prop to the Segmented Control Item component
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 24dc525: Attached document-level event handlers in capture phase to fix issues with React 17
|
|
12
|
+
- be826e8: Racine and Seeds React now share the same systemProps to avoid any current/future discrepancies regarding which components or props are being exported. Duplicate Racine systemProps have been deleted.
|
|
13
|
+
- Updated dependencies [24dc525]
|
|
14
|
+
- @sproutsocial/seeds-react-popout@1.0.2
|
|
15
|
+
|
|
3
16
|
## 22.1.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -104,9 +104,9 @@ And you can interact with Racine via the command line with these commands:
|
|
|
104
104
|
|
|
105
105
|
### **✅ Step 3: Make your changes**
|
|
106
106
|
|
|
107
|
-
Cut a feature branch off `
|
|
107
|
+
Cut a feature branch off `dev` and start coding! As updates are merged into `dev` by other developers over time you'll want to pull those updates into your branch, ideally via rebase, to avoid any conflicts when you open a pull request.
|
|
108
108
|
|
|
109
|
-
_Need to make an urgent update? Branch off `main` instead of `
|
|
109
|
+
_Need to make an urgent update? Branch off `main` instead of `dev`, and open your PR later against `main`. We consider this a hotfix and only support it for critical time-sensitive updates, so check with the Design Systems team prior to making this kind of contribution._
|
|
110
110
|
|
|
111
111
|
We use a [visual regression testing](https://racine.netlify.app/?path=/story/welcome-visual-regression-testing--page) suite to capture any unintended changes during development. After running `yarn build` you can run the suite locally with `yarn backstop-test`, which will open a report in your browser to show you what passed and what failed. If any fails are actually intentional visual changes you can run `yarn backstop-approve` to approve those changes as new reference images and include them in your PR.
|
|
112
112
|
|
|
@@ -128,7 +128,7 @@ The changeset CLI will also ask you to input a message detailing your changes. T
|
|
|
128
128
|
|
|
129
129
|
### **🗣 Step 4: Create a pull request**
|
|
130
130
|
|
|
131
|
-
Once you're ready to submit your changes for review, open a PR against the `
|
|
131
|
+
Once you're ready to submit your changes for review, open a PR against the `dev` branch (it's not the default branch, so you'll have to go find it). A few things will happen:
|
|
132
132
|
|
|
133
133
|
- The Design Systems team will be tagged to review your code. Feel free to additionally tag any specific individuals who you think should take a look.
|
|
134
134
|
- Visual regression testing will run against your PR, and the results can be found in the "Report" artifact on the summary page for the associated Github Action run. `html_report/index.html` in `Report.zip` will show you what passed and what failed.
|
|
@@ -5,6 +5,8 @@ export type TypeSegmentedControlItemProps = {
|
|
|
5
5
|
/** The value of this item. Should be unique among sibling items. */
|
|
6
6
|
value: string,
|
|
7
7
|
children: React.Node,
|
|
8
|
+
/** Disables user action and applies a disabled style on the component */
|
|
9
|
+
disabled?: boolean,
|
|
8
10
|
...
|
|
9
11
|
};
|
|
10
12
|
export type TypeSegmentedControlProps = {
|
|
@@ -121,21 +121,36 @@ var Drawer = function Drawer(_ref3) {
|
|
|
121
121
|
onClose();
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
documentBody
|
|
124
|
+
documentBody === null || documentBody === void 0 || documentBody.addEventListener("keydown", onEsc, {
|
|
125
|
+
capture: true
|
|
126
|
+
});
|
|
125
127
|
if (closeTargets) {
|
|
126
128
|
closeTargets.forEach(function (targetElement) {
|
|
127
|
-
return targetElement
|
|
129
|
+
return targetElement === null || targetElement === void 0 ? void 0 : targetElement.addEventListener("click", bodyClick, {
|
|
130
|
+
capture: true
|
|
131
|
+
});
|
|
128
132
|
});
|
|
129
133
|
} else {
|
|
130
|
-
|
|
134
|
+
var _documentBody$firstEl;
|
|
135
|
+
(_documentBody$firstEl = documentBody.firstElementChild) === null || _documentBody$firstEl === void 0 || _documentBody$firstEl.addEventListener("click", bodyClick, {
|
|
136
|
+
capture: true
|
|
137
|
+
});
|
|
131
138
|
}
|
|
132
139
|
return function () {
|
|
140
|
+
documentBody === null || documentBody === void 0 || documentBody.removeEventListener("keydown", onEsc, {
|
|
141
|
+
capture: true
|
|
142
|
+
});
|
|
133
143
|
if (closeTargets) {
|
|
134
144
|
closeTargets.forEach(function (targetElement) {
|
|
135
|
-
return targetElement
|
|
145
|
+
return targetElement === null || targetElement === void 0 ? void 0 : targetElement.removeEventListener("click", bodyClick, {
|
|
146
|
+
capture: true
|
|
147
|
+
});
|
|
136
148
|
});
|
|
137
149
|
} else {
|
|
138
|
-
|
|
150
|
+
var _documentBody$firstEl2;
|
|
151
|
+
(_documentBody$firstEl2 = documentBody.firstElementChild) === null || _documentBody$firstEl2 === void 0 || _documentBody$firstEl2.removeEventListener("click", bodyClick, {
|
|
152
|
+
capture: true
|
|
153
|
+
});
|
|
139
154
|
}
|
|
140
155
|
};
|
|
141
156
|
}, [onClose, disableCloseOnClickOutside, closeTargets]);
|
|
@@ -165,11 +165,19 @@ function Popout(_ref) {
|
|
|
165
165
|
setIsShown(false, e);
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
|
-
documentBody.addEventListener("click", bodyClick,
|
|
169
|
-
|
|
168
|
+
documentBody.addEventListener("click", bodyClick, {
|
|
169
|
+
capture: true
|
|
170
|
+
});
|
|
171
|
+
documentBody.addEventListener("keydown", onEsc, {
|
|
172
|
+
capture: true
|
|
173
|
+
});
|
|
170
174
|
return function () {
|
|
171
|
-
documentBody.removeEventListener("click", bodyClick,
|
|
172
|
-
|
|
175
|
+
documentBody.removeEventListener("click", bodyClick, {
|
|
176
|
+
capture: true
|
|
177
|
+
});
|
|
178
|
+
documentBody.removeEventListener("keydown", onEsc, {
|
|
179
|
+
capture: true
|
|
180
|
+
});
|
|
173
181
|
};
|
|
174
182
|
}
|
|
175
183
|
}, [isShown, setIsShown]);
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var React = _react;
|
|
10
10
|
var _Box = _interopRequireDefault(require("../Box"));
|
|
11
11
|
var _styles = require("./styles");
|
|
12
|
-
var _excluded = ["value", "children"],
|
|
12
|
+
var _excluded = ["value", "children", "disabled"],
|
|
13
13
|
_excluded2 = ["selectedValue", "label", "onChange", "children"];
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -29,6 +29,7 @@ var SegmentedControlContext = /*#__PURE__*/React.createContext(null);
|
|
|
29
29
|
var SegmentedControlItem = function SegmentedControlItem(_ref) {
|
|
30
30
|
var value = _ref.value,
|
|
31
31
|
children = _ref.children,
|
|
32
|
+
disabled = _ref.disabled,
|
|
32
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
34
|
var context = (0, _react.useContext)(SegmentedControlContext);
|
|
34
35
|
if (!context) {
|
|
@@ -46,14 +47,16 @@ var SegmentedControlItem = function SegmentedControlItem(_ref) {
|
|
|
46
47
|
return /*#__PURE__*/React.createElement(_styles.SegmentedControlItemContainer, _extends({
|
|
47
48
|
"data-segmentedcontrol-isactive": isChecked,
|
|
48
49
|
"data-qa-segmentedcontrol-item": value,
|
|
49
|
-
"data-qa-segmentedcontrol-ischecked": isChecked === true
|
|
50
|
+
"data-qa-segmentedcontrol-ischecked": isChecked === true,
|
|
51
|
+
disabled: disabled
|
|
50
52
|
}, rest), /*#__PURE__*/React.createElement("input", {
|
|
51
53
|
type: "radio",
|
|
52
54
|
id: id,
|
|
53
55
|
name: name,
|
|
54
56
|
value: value,
|
|
55
57
|
checked: isChecked,
|
|
56
|
-
onChange: onChange
|
|
58
|
+
onChange: onChange,
|
|
59
|
+
disabled: disabled
|
|
57
60
|
}), /*#__PURE__*/React.createElement(_styles.SegmentedControlLabel, {
|
|
58
61
|
as: "label",
|
|
59
62
|
htmlFor: id,
|
|
@@ -27,9 +27,11 @@ var SegmentedControlContainer = exports.SegmentedControlContainer = (0, _styledC
|
|
|
27
27
|
var SegmentedControlItemContainer = exports.SegmentedControlItemContainer = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
28
28
|
displayName: "styles__SegmentedControlItemContainer",
|
|
29
29
|
componentId: "sc-kx0lgh-1"
|
|
30
|
-
})(["flex:1 1 auto;display:flex;cursor:pointer;& + &{margin-left:", ";}&:focus-within label{", "}input{", "}"], function (props) {
|
|
30
|
+
})(["flex:1 1 auto;display:flex;cursor:pointer;& + &{margin-left:", ";}&:focus-within label{", "}input{", "}", ""], function (props) {
|
|
31
31
|
return props.theme.space[100];
|
|
32
|
-
}, _seedsReactMixins.focusRing, _seedsReactMixins.visuallyHidden)
|
|
32
|
+
}, _seedsReactMixins.focusRing, _seedsReactMixins.visuallyHidden, function (props) {
|
|
33
|
+
return props.disabled && _seedsReactMixins.disabled;
|
|
34
|
+
});
|
|
33
35
|
var SegmentedControlLabel = exports.SegmentedControlLabel = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
34
36
|
displayName: "styles__SegmentedControlLabel",
|
|
35
37
|
componentId: "sc-kx0lgh-2"
|
|
@@ -132,10 +132,14 @@ var Tooltip = function Tooltip(_ref2) {
|
|
|
132
132
|
|
|
133
133
|
// We only want listeners from the tooltip if its open in the first place
|
|
134
134
|
if (isOpen) {
|
|
135
|
-
documentBody.addEventListener("keydown", onEsc,
|
|
135
|
+
documentBody.addEventListener("keydown", onEsc, {
|
|
136
|
+
capture: true
|
|
137
|
+
});
|
|
136
138
|
}
|
|
137
139
|
return function () {
|
|
138
|
-
documentBody.removeEventListener("keydown", onEsc,
|
|
140
|
+
documentBody.removeEventListener("keydown", onEsc, {
|
|
141
|
+
capture: true
|
|
142
|
+
});
|
|
139
143
|
clearTimeout(timeout);
|
|
140
144
|
};
|
|
141
145
|
}, [isOpen, setShouldShow, shouldShow, enterDelay, exitDelay]);
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var
|
|
7
|
-
Object.keys(
|
|
6
|
+
var _seedsReactSystemProps = require("@sproutsocial/seeds-react-system-props");
|
|
7
|
+
Object.keys(_seedsReactSystemProps).forEach(function (key) {
|
|
8
8
|
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] ===
|
|
9
|
+
if (key in exports && exports[key] === _seedsReactSystemProps[key]) return;
|
|
10
10
|
Object.defineProperty(exports, key, {
|
|
11
11
|
enumerable: true,
|
|
12
12
|
get: function get() {
|
|
13
|
-
return
|
|
13
|
+
return _seedsReactSystemProps[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAEV,0BAA0B,EAC1B,qBAAqB,EACrB,eAAe,EAEf,sBAAsB,EACvB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAEV,0BAA0B,EAC1B,qBAAqB,EACrB,eAAe,EAEf,sBAAsB,EACvB,MAAM,eAAe,CAAC;AAkLvB,QAAA,MAAM,eAAe;+IAalB,eAAe;;mDAnJf,qBAAqB;;;;gCAmCsB,sBAAsB;;;;gBAjElC,0BAA0B;;;CAwN3D,CAAC;AAUF,eAAe,eAAe,CAAC"}
|
|
@@ -3,7 +3,7 @@ import type { TypeSegmentedControlProps, TypeSegmentedControlItemProps } from ".
|
|
|
3
3
|
declare const SegmentedControl: {
|
|
4
4
|
({ selectedValue, label, onChange, children, ...rest }: TypeSegmentedControlProps): JSX.Element;
|
|
5
5
|
Item: {
|
|
6
|
-
({ value, children, ...rest }: TypeSegmentedControlItemProps): JSX.Element | null;
|
|
6
|
+
({ value, children, disabled, ...rest }: TypeSegmentedControlItemProps): JSX.Element | null;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";AAQA,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";AAQA,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,yBAAyB,CAAC;AAyDjC,QAAA,MAAM,gBAAgB;4DAMnB,yBAAyB;;iDA3CzB,6BAA6B;;;CAiE/B,CAAC;AAKF,eAAe,gBAAgB,CAAC"}
|
|
@@ -4,6 +4,8 @@ export interface TypeSegmentedControlItemProps {
|
|
|
4
4
|
/** The value of this item. Should be unique among sibling items. */
|
|
5
5
|
value: string;
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
+
/** Disables user action and applies a disabled style on the component */
|
|
8
|
+
disabled?: boolean;
|
|
7
9
|
}
|
|
8
10
|
export interface TypeSegmentedControlProps extends TypeContainerProps {
|
|
9
11
|
/** The value of the currently selected item. Should match the value prop of one of the child items */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControlTypes.d.ts","sourceRoot":"","sources":["../../../src/SegmentedControl/SegmentedControlTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,6BAA6B;IAC5C,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SegmentedControlTypes.d.ts","sourceRoot":"","sources":["../../../src/SegmentedControl/SegmentedControlTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,6BAA6B;IAC5C,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE,sGAAsG;IACtG,aAAa,EAAE,MAAM,CAAC;IAEtB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IAEd,8HAA8H;IAC9H,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE9D,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TypeSegmentedControlProps } from "./SegmentedControlTypes";
|
|
2
|
+
import { TypeSegmentedControlProps, TypeSegmentedControlItemProps } from "./SegmentedControlTypes";
|
|
3
3
|
export declare const SegmentedControlContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("../Box").TypeBoxProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, Pick<TypeSegmentedControlProps, "disabled">, never>;
|
|
4
|
-
export declare const SegmentedControlItemContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("../Box").TypeBoxProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme,
|
|
4
|
+
export declare const SegmentedControlItemContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("../Box").TypeBoxProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, Pick<TypeSegmentedControlItemProps, "disabled">, never>;
|
|
5
5
|
interface TypeSegmentedControlState {
|
|
6
6
|
isActive: boolean;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/SegmentedControl/styles.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/SegmentedControl/styles.ts"],"names":[],"mappings":";AAQA,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,yBAAyB,oRAarC,CAAC;AAEF,eAAO,MAAM,6BAA6B,wRAoBzC,CAAC;AAEF,UAAU,yBAAyB;IACjC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;8EAsCjC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "@sproutsocial/seeds-react-system-props";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/system-props/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/system-props/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC"}
|
package/lib/Drawer/Drawer.js
CHANGED
|
@@ -113,21 +113,36 @@ var Drawer = function Drawer(_ref3) {
|
|
|
113
113
|
onClose();
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
-
documentBody
|
|
116
|
+
documentBody === null || documentBody === void 0 || documentBody.addEventListener("keydown", onEsc, {
|
|
117
|
+
capture: true
|
|
118
|
+
});
|
|
117
119
|
if (closeTargets) {
|
|
118
120
|
closeTargets.forEach(function (targetElement) {
|
|
119
|
-
return targetElement
|
|
121
|
+
return targetElement === null || targetElement === void 0 ? void 0 : targetElement.addEventListener("click", bodyClick, {
|
|
122
|
+
capture: true
|
|
123
|
+
});
|
|
120
124
|
});
|
|
121
125
|
} else {
|
|
122
|
-
|
|
126
|
+
var _documentBody$firstEl;
|
|
127
|
+
(_documentBody$firstEl = documentBody.firstElementChild) === null || _documentBody$firstEl === void 0 || _documentBody$firstEl.addEventListener("click", bodyClick, {
|
|
128
|
+
capture: true
|
|
129
|
+
});
|
|
123
130
|
}
|
|
124
131
|
return function () {
|
|
132
|
+
documentBody === null || documentBody === void 0 || documentBody.removeEventListener("keydown", onEsc, {
|
|
133
|
+
capture: true
|
|
134
|
+
});
|
|
125
135
|
if (closeTargets) {
|
|
126
136
|
closeTargets.forEach(function (targetElement) {
|
|
127
|
-
return targetElement
|
|
137
|
+
return targetElement === null || targetElement === void 0 ? void 0 : targetElement.removeEventListener("click", bodyClick, {
|
|
138
|
+
capture: true
|
|
139
|
+
});
|
|
128
140
|
});
|
|
129
141
|
} else {
|
|
130
|
-
|
|
142
|
+
var _documentBody$firstEl2;
|
|
143
|
+
(_documentBody$firstEl2 = documentBody.firstElementChild) === null || _documentBody$firstEl2 === void 0 || _documentBody$firstEl2.removeEventListener("click", bodyClick, {
|
|
144
|
+
capture: true
|
|
145
|
+
});
|
|
131
146
|
}
|
|
132
147
|
};
|
|
133
148
|
}, [onClose, disableCloseOnClickOutside, closeTargets]);
|
package/lib/Popout/Popout.js
CHANGED
|
@@ -155,11 +155,19 @@ export function Popout(_ref) {
|
|
|
155
155
|
setIsShown(false, e);
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
-
documentBody.addEventListener("click", bodyClick,
|
|
159
|
-
|
|
158
|
+
documentBody.addEventListener("click", bodyClick, {
|
|
159
|
+
capture: true
|
|
160
|
+
});
|
|
161
|
+
documentBody.addEventListener("keydown", onEsc, {
|
|
162
|
+
capture: true
|
|
163
|
+
});
|
|
160
164
|
return function () {
|
|
161
|
-
documentBody.removeEventListener("click", bodyClick,
|
|
162
|
-
|
|
165
|
+
documentBody.removeEventListener("click", bodyClick, {
|
|
166
|
+
capture: true
|
|
167
|
+
});
|
|
168
|
+
documentBody.removeEventListener("keydown", onEsc, {
|
|
169
|
+
capture: true
|
|
170
|
+
});
|
|
163
171
|
};
|
|
164
172
|
}
|
|
165
173
|
}, [isShown, setIsShown]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["value", "children"],
|
|
1
|
+
var _excluded = ["value", "children", "disabled"],
|
|
2
2
|
_excluded2 = ["selectedValue", "label", "onChange", "children"];
|
|
3
3
|
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); }
|
|
4
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -19,6 +19,7 @@ var SegmentedControlContext = /*#__PURE__*/React.createContext(null);
|
|
|
19
19
|
var SegmentedControlItem = function SegmentedControlItem(_ref) {
|
|
20
20
|
var value = _ref.value,
|
|
21
21
|
children = _ref.children,
|
|
22
|
+
disabled = _ref.disabled,
|
|
22
23
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
24
|
var context = useContext(SegmentedControlContext);
|
|
24
25
|
if (!context) {
|
|
@@ -36,14 +37,16 @@ var SegmentedControlItem = function SegmentedControlItem(_ref) {
|
|
|
36
37
|
return /*#__PURE__*/React.createElement(SegmentedControlItemContainer, _extends({
|
|
37
38
|
"data-segmentedcontrol-isactive": isChecked,
|
|
38
39
|
"data-qa-segmentedcontrol-item": value,
|
|
39
|
-
"data-qa-segmentedcontrol-ischecked": isChecked === true
|
|
40
|
+
"data-qa-segmentedcontrol-ischecked": isChecked === true,
|
|
41
|
+
disabled: disabled
|
|
40
42
|
}, rest), /*#__PURE__*/React.createElement("input", {
|
|
41
43
|
type: "radio",
|
|
42
44
|
id: id,
|
|
43
45
|
name: name,
|
|
44
46
|
value: value,
|
|
45
47
|
checked: isChecked,
|
|
46
|
-
onChange: onChange
|
|
48
|
+
onChange: onChange,
|
|
49
|
+
disabled: disabled
|
|
47
50
|
}), /*#__PURE__*/React.createElement(SegmentedControlLabel, {
|
|
48
51
|
as: "label",
|
|
49
52
|
htmlFor: id,
|
|
@@ -17,9 +17,11 @@ export var SegmentedControlContainer = styled(Box).withConfig({
|
|
|
17
17
|
export var SegmentedControlItemContainer = styled(Box).withConfig({
|
|
18
18
|
displayName: "styles__SegmentedControlItemContainer",
|
|
19
19
|
componentId: "sc-kx0lgh-1"
|
|
20
|
-
})(["flex:1 1 auto;display:flex;cursor:pointer;& + &{margin-left:", ";}&:focus-within label{", "}input{", "}"], function (props) {
|
|
20
|
+
})(["flex:1 1 auto;display:flex;cursor:pointer;& + &{margin-left:", ";}&:focus-within label{", "}input{", "}", ""], function (props) {
|
|
21
21
|
return props.theme.space[100];
|
|
22
|
-
}, focusRing, visuallyHidden)
|
|
22
|
+
}, focusRing, visuallyHidden, function (props) {
|
|
23
|
+
return props.disabled && disabled;
|
|
24
|
+
});
|
|
23
25
|
export var SegmentedControlLabel = styled(Text).withConfig({
|
|
24
26
|
displayName: "styles__SegmentedControlLabel",
|
|
25
27
|
componentId: "sc-kx0lgh-2"
|
package/lib/Tooltip/Tooltip.js
CHANGED
|
@@ -123,10 +123,14 @@ var Tooltip = function Tooltip(_ref2) {
|
|
|
123
123
|
|
|
124
124
|
// We only want listeners from the tooltip if its open in the first place
|
|
125
125
|
if (isOpen) {
|
|
126
|
-
documentBody.addEventListener("keydown", onEsc,
|
|
126
|
+
documentBody.addEventListener("keydown", onEsc, {
|
|
127
|
+
capture: true
|
|
128
|
+
});
|
|
127
129
|
}
|
|
128
130
|
return function () {
|
|
129
|
-
documentBody.removeEventListener("keydown", onEsc,
|
|
131
|
+
documentBody.removeEventListener("keydown", onEsc, {
|
|
132
|
+
capture: true
|
|
133
|
+
});
|
|
130
134
|
clearTimeout(timeout);
|
|
131
135
|
};
|
|
132
136
|
}, [isOpen, setShouldShow, shouldShow, enterDelay, exitDelay]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "@sproutsocial/seeds-react-system-props";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/racine",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"typescript": "^5.1.6",
|
|
192
192
|
"webpack": "^5.88.2",
|
|
193
193
|
"webpack-cli": "^5.1.4",
|
|
194
|
-
"webpack-dev-server": "^
|
|
194
|
+
"webpack-dev-server": "^5.0.4",
|
|
195
195
|
"ws": "^8.13.0"
|
|
196
196
|
},
|
|
197
197
|
"peerDependencies": {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.gap = void 0;
|
|
7
|
-
var _styledSystem = require("styled-system");
|
|
8
|
-
var gap = exports.gap = (0, _styledSystem.system)({
|
|
9
|
-
gap: {
|
|
10
|
-
property: "gap",
|
|
11
|
-
scale: "space"
|
|
12
|
-
},
|
|
13
|
-
rowGap: {
|
|
14
|
-
property: "rowGap",
|
|
15
|
-
scale: "space"
|
|
16
|
-
},
|
|
17
|
-
columnGap: {
|
|
18
|
-
property: "columnGap",
|
|
19
|
-
scale: "space"
|
|
20
|
-
}
|
|
21
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.TYPOGRAPHY = exports.POSITION = exports.LAYOUT = exports.GRID = exports.FLEXBOX = exports.COMMON = exports.BORDER = void 0;
|
|
8
|
-
var styles = _interopRequireWildcard(require("styled-system"));
|
|
9
|
-
var _gap = require("./gap");
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
13
|
-
|
|
14
|
-
var typeScale = styles.variant({
|
|
15
|
-
key: "typography",
|
|
16
|
-
prop: "typeScale"
|
|
17
|
-
});
|
|
18
|
-
var COMMON = exports.COMMON = styles.compose(styles.color, styles.space, styles.system({
|
|
19
|
-
cursor: true,
|
|
20
|
-
whiteSpace: true
|
|
21
|
-
}));
|
|
22
|
-
var BORDER = exports.BORDER = styles.compose(styles.border, styles.borderTop, styles.borderRight, styles.borderBottom, styles.borderLeft, styles.borderWidth, styles.borderStyle, styles.borderColor, styles.borderRadius,
|
|
23
|
-
// After reading the docs, these seem duplicate to styles.border
|
|
24
|
-
// styles.border.borderBottomLeftRadius,
|
|
25
|
-
// styles.border.borderBottomRightRadius,
|
|
26
|
-
// styles.border.borderTopLeftRadius,
|
|
27
|
-
// styles.border.borderTopRightRadius,
|
|
28
|
-
styles.boxShadow);
|
|
29
|
-
var TYPOGRAPHY = exports.TYPOGRAPHY = styles.compose(typeScale, styles.fontFamily, styles.fontStyle, styles.fontWeight, styles.lineHeight, styles.textAlign);
|
|
30
|
-
var LAYOUT = exports.LAYOUT = styles.compose(styles.display, styles.size, styles.width, styles.height, styles.minWidth, styles.minHeight, styles.maxWidth, styles.maxHeight, styles.overflow, styles.verticalAlign);
|
|
31
|
-
var POSITION = exports.POSITION = styles.compose(styles.position, styles.zIndex, styles.top, styles.right, styles.bottom, styles.left);
|
|
32
|
-
var FLEXBOX = exports.FLEXBOX = styles.compose(styles.flexBasis, styles.flexDirection, styles.flexWrap, styles.alignContent, styles.alignItems, styles.justifyContent, styles.justifyItems, styles.order, styles.flex, styles.flexShrink, styles.flexGrow, styles.justifySelf, styles.alignSelf, _gap.gap);
|
|
33
|
-
var GRID = exports.GRID = styles.grid;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gap.d.ts","sourceRoot":"","sources":["../../../../src/utils/system-props/gap.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,iCAad,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as styles from "styled-system";
|
|
2
|
-
export declare const COMMON: styles.styleFn;
|
|
3
|
-
export declare const BORDER: styles.styleFn;
|
|
4
|
-
export declare const TYPOGRAPHY: styles.styleFn;
|
|
5
|
-
export declare const LAYOUT: styles.styleFn;
|
|
6
|
-
export declare const POSITION: styles.styleFn;
|
|
7
|
-
export declare const FLEXBOX: styles.styleFn;
|
|
8
|
-
export declare const GRID: styles.styleFn;
|
|
9
|
-
//# sourceMappingURL=system-props.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system-props.d.ts","sourceRoot":"","sources":["../../../../src/utils/system-props/system-props.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAQxC,eAAO,MAAM,MAAM,gBAOlB,CAAC;AAEF,eAAO,MAAM,MAAM,gBAgBlB,CAAC;AAEF,eAAO,MAAM,UAAU,gBAOtB,CAAC;AAEF,eAAO,MAAM,MAAM,gBAWlB,CAAC;AAEF,eAAO,MAAM,QAAQ,gBAOpB,CAAC;AAEF,eAAO,MAAM,OAAO,gBAenB,CAAC;AAEF,eAAO,MAAM,IAAI,gBAAc,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
2
|
-
import * as styles from "styled-system";
|
|
3
|
-
import { gap } from "./gap";
|
|
4
|
-
var typeScale = styles.variant({
|
|
5
|
-
key: "typography",
|
|
6
|
-
prop: "typeScale"
|
|
7
|
-
});
|
|
8
|
-
export var COMMON = styles.compose(styles.color, styles.space, styles.system({
|
|
9
|
-
cursor: true,
|
|
10
|
-
whiteSpace: true
|
|
11
|
-
}));
|
|
12
|
-
export var BORDER = styles.compose(styles.border, styles.borderTop, styles.borderRight, styles.borderBottom, styles.borderLeft, styles.borderWidth, styles.borderStyle, styles.borderColor, styles.borderRadius,
|
|
13
|
-
// After reading the docs, these seem duplicate to styles.border
|
|
14
|
-
// styles.border.borderBottomLeftRadius,
|
|
15
|
-
// styles.border.borderBottomRightRadius,
|
|
16
|
-
// styles.border.borderTopLeftRadius,
|
|
17
|
-
// styles.border.borderTopRightRadius,
|
|
18
|
-
styles.boxShadow);
|
|
19
|
-
export var TYPOGRAPHY = styles.compose(typeScale, styles.fontFamily, styles.fontStyle, styles.fontWeight, styles.lineHeight, styles.textAlign);
|
|
20
|
-
export var LAYOUT = styles.compose(styles.display, styles.size, styles.width, styles.height, styles.minWidth, styles.minHeight, styles.maxWidth, styles.maxHeight, styles.overflow, styles.verticalAlign);
|
|
21
|
-
export var POSITION = styles.compose(styles.position, styles.zIndex, styles.top, styles.right, styles.bottom, styles.left);
|
|
22
|
-
export var FLEXBOX = styles.compose(styles.flexBasis, styles.flexDirection, styles.flexWrap, styles.alignContent, styles.alignItems, styles.justifyContent, styles.justifyItems, styles.order, styles.flex, styles.flexShrink, styles.flexGrow, styles.justifySelf, styles.alignSelf, gap);
|
|
23
|
-
export var GRID = styles.grid;
|