sag_components 1.0.6 → 1.0.8
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/package.json +1 -1
- package/src/stories/components/InfoIcon.jsx +5 -1
- package/src/stories/components/OneColumnContainer.jsx +2 -2
- package/src/stories/components/SegmentedButton.jsx +1 -0
- package/storybook-static/256.47510a7e.iframe.bundle.js +1 -1
- package/storybook-static/256.47510a7e.iframe.bundle.js.LICENSE.txt +9 -9
- package/storybook-static/385.7e265f0d.iframe.bundle.js +401 -401
- package/storybook-static/385.7e265f0d.iframe.bundle.js.LICENSE.txt +53 -53
- package/storybook-static/463.60fe9b8e.iframe.bundle.js +43 -43
- package/storybook-static/537.29807a20.iframe.bundle.js +120 -120
- package/storybook-static/55.d0744d52.iframe.bundle.js +75 -75
- package/storybook-static/55.d0744d52.iframe.bundle.js.LICENSE.txt +26 -26
- package/storybook-static/Dropdown-stories.825dde1a.iframe.bundle.js +7 -7
- package/storybook-static/Introduction-mdx.f8264230.iframe.bundle.js +1 -1
- package/storybook-static/Introduction-mdx.f8264230.iframe.bundle.js.LICENSE.txt +9 -9
- package/storybook-static/OneColumnContainer-stories.65049871.iframe.bundle.js +35 -35
- package/storybook-static/OneColumnContainer-stories.65049871.iframe.bundle.js.LICENSE.txt +18 -18
- package/storybook-static/favicon.svg +6 -6
- package/storybook-static/iframe.html +354 -354
- package/storybook-static/index.html +138 -138
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +4 -4
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +13 -13
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +117 -117
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +18 -18
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +4 -4
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +4 -4
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +4 -4
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +4 -4
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js +31 -31
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js.LEGAL.txt +18 -18
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/links-0/manager-bundle.js +4 -4
- package/storybook-static/sb-addons/links-0/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/storybook-10/manager-bundle.js +4 -4
- package/storybook-static/sb-addons/storybook-10/manager-bundle.js.map +7 -7
- package/storybook-static/sb-addons/storysource-9/manager-bundle.js +23 -23
- package/storybook-static/sb-addons/storysource-9/manager-bundle.js.LEGAL.txt +14 -14
- package/storybook-static/sb-addons/storysource-9/manager-bundle.js.map +7 -7
- package/storybook-static/sb-common-assets/fonts.css +31 -31
- package/storybook-static/sb-manager/GlobalScrollAreaStyles-XIHNDKUY-F4JIPIHL.js +1 -1
- package/storybook-static/sb-manager/OverlayScrollbars-VAV6LJAB-K3TMPSMY.js +6 -6
- package/storybook-static/sb-manager/WithTooltip-FBT32F6Q-7QJ37TCY.js +1 -1
- package/storybook-static/sb-manager/chunk-3FAXWWKG.js +15 -15
- package/storybook-static/sb-manager/chunk-54KM6K5Z.js +7 -7
- package/storybook-static/sb-manager/chunk-AS2AMEUR.js +1 -1
- package/storybook-static/sb-manager/chunk-F3MVQVF6.js +207 -207
- package/storybook-static/sb-manager/chunk-FENICTK6.js +1 -1
- package/storybook-static/sb-manager/chunk-GQDEE62S.js +406 -406
- package/storybook-static/sb-manager/chunk-PUVLCKJJ.js +140 -140
- package/storybook-static/sb-manager/chunk-QPL63VNK.js +1 -1
- package/storybook-static/sb-manager/formatter-S4K5WUZV-4LPR5OBX.js +156 -156
- package/storybook-static/sb-manager/globals.js +1 -1
- package/storybook-static/sb-manager/index.js +1 -1
- package/storybook-static/sb-manager/runtime.js +1 -1
- package/storybook-static/sb-manager/syntaxhighlighter-QTQ2UBB4-F5YUFYAB.js +1 -1
- package/storybook-static/sb-preview/globals.js +1 -1
- package/storybook-static/sb-preview/runtime.js +105 -105
- package/storybook-static/stories.json +1 -1
- package/dist/App.js +0 -120
- package/dist/App.test.js +0 -10
- package/dist/index.js +0 -17
- package/dist/stories/Button.stories.js +0 -117
- package/dist/stories/Button.style.js +0 -14
- package/dist/stories/Dropdown.stories.js +0 -252
- package/dist/stories/Dropdown.style.js +0 -14
- package/dist/stories/InfoIcon.js +0 -34
- package/dist/stories/OneColumnContainer.stories.js +0 -22
- package/dist/stories/OneColumnContainer.style.js +0 -28
- package/dist/stories/SegmentedButton.stories.js +0 -187
- package/dist/stories/SegmentedButton.style.js +0 -39
- package/dist/stories/components/Button.js +0 -59
- package/dist/stories/components/Dropdown.js +0 -237
- package/dist/stories/components/InfoIcon.js +0 -34
- package/dist/stories/components/OneColumnContainer.js +0 -46
- package/dist/stories/components/SegmentedButton.js +0 -118
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = exports.SegmentedButton = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
12
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _SegmentedButtonStyle = require("../SegmentedButton.style.js");
|
|
14
|
-
var _excluded = ["name", "options", "segmentWidth", "segmentHeigth", "controlRadius", "segmentRadius", "fontSize", "backgroundColor", "selectedSegmentColor", "selectedTextColor", "unselectedTextColor", "defaultIndex", "onClick"];
|
|
15
|
-
var SegmentedButton = function SegmentedButton(_ref) {
|
|
16
|
-
var name = _ref.name,
|
|
17
|
-
options = _ref.options,
|
|
18
|
-
_ref$segmentWidth = _ref.segmentWidth,
|
|
19
|
-
segmentWidth = _ref$segmentWidth === void 0 ? 120 : _ref$segmentWidth,
|
|
20
|
-
_ref$segmentHeigth = _ref.segmentHeigth,
|
|
21
|
-
segmentHeigth = _ref$segmentHeigth === void 0 ? 41 : _ref$segmentHeigth,
|
|
22
|
-
_ref$controlRadius = _ref.controlRadius,
|
|
23
|
-
controlRadius = _ref$controlRadius === void 0 ? 8 : _ref$controlRadius,
|
|
24
|
-
_ref$segmentRadius = _ref.segmentRadius,
|
|
25
|
-
segmentRadius = _ref$segmentRadius === void 0 ? 8 : _ref$segmentRadius,
|
|
26
|
-
_ref$fontSize = _ref.fontSize,
|
|
27
|
-
fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize,
|
|
28
|
-
_ref$backgroundColor = _ref.backgroundColor,
|
|
29
|
-
backgroundColor = _ref$backgroundColor === void 0 ? "#ECF0FF" : _ref$backgroundColor,
|
|
30
|
-
_ref$selectedSegmentC = _ref.selectedSegmentColor,
|
|
31
|
-
selectedSegmentColor = _ref$selectedSegmentC === void 0 ? "#3a9df9" : _ref$selectedSegmentC,
|
|
32
|
-
_ref$selectedTextColo = _ref.selectedTextColor,
|
|
33
|
-
selectedTextColor = _ref$selectedTextColo === void 0 ? "white" : _ref$selectedTextColo,
|
|
34
|
-
_ref$unselectedTextCo = _ref.unselectedTextColor,
|
|
35
|
-
unselectedTextColor = _ref$unselectedTextCo === void 0 ? "black" : _ref$unselectedTextCo,
|
|
36
|
-
_ref$defaultIndex = _ref.defaultIndex,
|
|
37
|
-
defaultIndex = _ref$defaultIndex === void 0 ? 0 : _ref$defaultIndex,
|
|
38
|
-
onClick = _ref.onClick,
|
|
39
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
40
|
-
var _useState = (0, _react.useState)(defaultIndex),
|
|
41
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
|
-
activeIndex = _useState2[0],
|
|
43
|
-
setActiveIndex = _useState2[1];
|
|
44
|
-
var controlRef = (0, _react.useRef)();
|
|
45
|
-
var componentReady = (0, _react.useRef)();
|
|
46
|
-
var optionsRef = options.map(function (item, i) {
|
|
47
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
48
|
-
id: i,
|
|
49
|
-
ref: (0, _react.useRef)()
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// Determine when the component is "ready"
|
|
54
|
-
(0, _react.useEffect)(function () {
|
|
55
|
-
componentReady.current = true;
|
|
56
|
-
}, []);
|
|
57
|
-
(0, _react.useEffect)(function () {
|
|
58
|
-
if (defaultIndex >= 0 && defaultIndex < (options === null || options === void 0 ? void 0 : options.length)) {
|
|
59
|
-
setActiveIndex(defaultIndex);
|
|
60
|
-
}
|
|
61
|
-
}, [defaultIndex]);
|
|
62
|
-
(0, _react.useEffect)(function () {
|
|
63
|
-
var activeSegmentRef = optionsRef[activeIndex].ref;
|
|
64
|
-
var _activeSegmentRef$cur = activeSegmentRef.current,
|
|
65
|
-
offsetWidth = _activeSegmentRef$cur.offsetWidth,
|
|
66
|
-
offsetLeft = _activeSegmentRef$cur.offsetLeft;
|
|
67
|
-
var style = controlRef.current.style;
|
|
68
|
-
style.setProperty("--highlight-width", "".concat(offsetWidth, "px"));
|
|
69
|
-
style.setProperty("--highlight-x-pos", "".concat(offsetLeft, "px"));
|
|
70
|
-
}, [activeIndex, controlRef, optionsRef]);
|
|
71
|
-
var onInputChangeHandler = function onInputChangeHandler(value, index) {
|
|
72
|
-
setActiveIndex(index);
|
|
73
|
-
onClick({
|
|
74
|
-
index: index,
|
|
75
|
-
value: value
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
return /*#__PURE__*/_react.default.createElement(_SegmentedButtonStyle.ControlsContainer, {
|
|
79
|
-
fontSize: fontSize,
|
|
80
|
-
ref: controlRef
|
|
81
|
-
}, /*#__PURE__*/_react.default.createElement(_SegmentedButtonStyle.Controls, {
|
|
82
|
-
backgroundColor: backgroundColor,
|
|
83
|
-
selectedSegmentColor: selectedSegmentColor,
|
|
84
|
-
segmentRadius: segmentRadius,
|
|
85
|
-
controlRadius: controlRadius,
|
|
86
|
-
segmentWidth: segmentWidth,
|
|
87
|
-
className: "controls ".concat(componentReady.current ? "ready" : "idle")
|
|
88
|
-
}, optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.map(function (item, i) {
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement(_SegmentedButtonStyle.Segment, {
|
|
90
|
-
key: item.id,
|
|
91
|
-
backgroundColor: backgroundColor,
|
|
92
|
-
selectedSegmentColor: selectedSegmentColor,
|
|
93
|
-
segmentRadius: segmentRadius,
|
|
94
|
-
controlRadius: controlRadius,
|
|
95
|
-
segmentWidth: segmentWidth,
|
|
96
|
-
className: "".concat(activeIndex === i ? "active" : "inactive"),
|
|
97
|
-
ref: item.ref
|
|
98
|
-
}, /*#__PURE__*/_react.default.createElement(_SegmentedButtonStyle.ControlsInput, {
|
|
99
|
-
type: "radio",
|
|
100
|
-
value: item.value,
|
|
101
|
-
id: item.id,
|
|
102
|
-
name: name,
|
|
103
|
-
onChange: function onChange() {
|
|
104
|
-
return onInputChangeHandler(item.value, item.id);
|
|
105
|
-
},
|
|
106
|
-
checked: i === activeIndex
|
|
107
|
-
}), /*#__PURE__*/_react.default.createElement(_SegmentedButtonStyle.SegmentLabel, {
|
|
108
|
-
selectedTextColor: selectedTextColor,
|
|
109
|
-
unselectedTextColor: unselectedTextColor,
|
|
110
|
-
segmentHeigth: segmentHeigth / 5,
|
|
111
|
-
className: "".concat(activeIndex === i ? "active" : "inactive", " "),
|
|
112
|
-
htmlFor: item.value
|
|
113
|
-
}, item.value));
|
|
114
|
-
})));
|
|
115
|
-
};
|
|
116
|
-
exports.SegmentedButton = SegmentedButton;
|
|
117
|
-
var _default = SegmentedButton;
|
|
118
|
-
exports.default = _default;
|