@sproutsocial/racine 20.13.0 → 20.13.5
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 +30 -0
- package/README.md +1 -0
- package/__flow__/types/theme.colors.flow.js +1 -0
- package/commonjs/Avatar/Avatar.flow.js +2 -2
- package/commonjs/Avatar/Avatar.js +10 -12
- package/commonjs/Avatar/constants.flow.js +2 -3
- package/commonjs/Avatar/constants.js +2 -3
- package/commonjs/Avatar/index.js +1 -2
- package/commonjs/Badge/Badge.flow.js +2 -2
- package/commonjs/Badge/Badge.js +3 -4
- package/commonjs/Badge/constants.flow.js +2 -3
- package/commonjs/Badge/constants.js +3 -5
- package/commonjs/Badge/index.js +1 -2
- package/commonjs/Badge/styles.js +1 -2
- package/commonjs/Banner/Banner.flow.js +2 -2
- package/commonjs/Banner/Banner.js +3 -4
- package/commonjs/Banner/index.js +1 -2
- package/commonjs/Banner/styles.js +5 -7
- package/commonjs/Box/Box.flow.js +2 -2
- package/commonjs/Box/Box.js +3 -4
- package/commonjs/Box/index.js +1 -2
- package/commonjs/Box/styles.js +1 -2
- package/commonjs/Breadcrumb/Breadcrumb.flow.js +2 -2
- package/commonjs/Breadcrumb/Breadcrumb.js +5 -6
- package/commonjs/Breadcrumb/index.js +1 -2
- package/commonjs/Breadcrumb/styles.js +1 -2
- package/commonjs/Button/Button.flow.js +2 -2
- package/commonjs/Button/Button.js +1 -2
- package/commonjs/Button/index.js +1 -2
- package/commonjs/Button/styles.js +4 -8
- package/commonjs/Card/Card.flow.js +2 -2
- package/commonjs/Card/Card.js +3 -4
- package/commonjs/Card/CardTypes.flow.js +2 -2
- package/commonjs/Card/index.js +1 -2
- package/commonjs/Card/styles.js +9 -17
- package/commonjs/Card/subComponents.js +9 -15
- package/commonjs/Card/utils.js +4 -7
- package/commonjs/CharacterCounter/CharacterCounter.flow.js +2 -2
- package/commonjs/CharacterCounter/CharacterCounter.js +10 -12
- package/commonjs/CharacterCounter/index.js +1 -2
- package/commonjs/CharacterCounter/styles.js +3 -4
- package/commonjs/ChartLegend/ChartLegend.flow.js +2 -2
- package/commonjs/ChartLegend/ChartLegend.js +3 -4
- package/commonjs/ChartLegend/index.js +1 -2
- package/commonjs/ChartLegend/styles.js +5 -8
- package/commonjs/ChartLegend/useChartLabels.js +2 -3
- package/commonjs/Checkbox/Checkbox.flow.js +2 -2
- package/commonjs/Checkbox/Checkbox.js +11 -13
- package/commonjs/Checkbox/index.js +1 -2
- package/commonjs/Checkbox/styles.js +9 -16
- package/commonjs/Collapsible/Collapsible.flow.js +2 -2
- package/commonjs/Collapsible/Collapsible.js +13 -13
- package/commonjs/Collapsible/index.js +1 -2
- package/commonjs/Collapsible/styles.js +2 -3
- package/commonjs/DatePicker/DateRangePicker/DateRangePicker.flow.js +2 -2
- package/commonjs/DatePicker/DateRangePicker/DateRangePicker.js +3 -4
- package/commonjs/DatePicker/DateRangePicker/StatefulDateRangePicker.flow.js +2 -2
- package/commonjs/DatePicker/DateRangePicker/StatefulDateRangePicker.js +4 -5
- package/commonjs/DatePicker/DateRangePicker/index.js +1 -2
- package/commonjs/DatePicker/SingleDatePicker/SingleDatePicker.flow.js +2 -2
- package/commonjs/DatePicker/SingleDatePicker/SingleDatePicker.js +3 -4
- package/commonjs/DatePicker/SingleDatePicker/StatefulSingleDatePicker.flow.js +2 -2
- package/commonjs/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +4 -5
- package/commonjs/DatePicker/SingleDatePicker/index.js +1 -2
- package/commonjs/DatePicker/common.js +9 -15
- package/commonjs/DatePicker/index.flow.js +2 -2
- package/commonjs/DatePicker/styles.js +5 -7
- package/commonjs/Drawer/Drawer.flow.js +2 -2
- package/commonjs/Drawer/Drawer.js +11 -11
- package/commonjs/Drawer/SlideTransition.js +4 -5
- package/commonjs/Drawer/index.js +1 -2
- package/commonjs/Drawer/styles.js +4 -6
- package/commonjs/EmptyState/EmptyState.flow.js +2 -2
- package/commonjs/EmptyState/EmptyState.js +3 -4
- package/commonjs/EmptyState/index.js +1 -2
- package/commonjs/Fieldset/Fieldset.flow.js +2 -2
- package/commonjs/Fieldset/Fieldset.js +3 -4
- package/commonjs/Fieldset/index.js +1 -2
- package/commonjs/Fieldset/styles.js +4 -5
- package/commonjs/FormField/FormField.flow.js +2 -2
- package/commonjs/FormField/FormField.js +5 -6
- package/commonjs/FormField/index.js +1 -2
- package/commonjs/Icon/Icon.flow.js +2 -2
- package/commonjs/Icon/Icon.js +5 -6
- package/commonjs/Icon/index.flow.js +2 -2
- package/commonjs/Icon/index.js +1 -2
- package/commonjs/Icon/styles.js +3 -4
- package/commonjs/Image/Image.flow.js +2 -2
- package/commonjs/Image/Image.js +11 -13
- package/commonjs/Image/index.js +1 -2
- package/commonjs/Image/styles.js +3 -4
- package/commonjs/Indicator/Indicator.flow.js +2 -2
- package/commonjs/Indicator/Indicator.js +10 -12
- package/commonjs/Indicator/index.js +1 -2
- package/commonjs/Indicator/styles.js +1 -2
- package/commonjs/Input/Input.flow.js +2 -2
- package/commonjs/Input/Input.js +12 -13
- package/commonjs/Input/index.js +1 -2
- package/commonjs/Input/styles.js +4 -6
- package/commonjs/KeyboardKey/KeyboardKey.flow.js +2 -2
- package/commonjs/KeyboardKey/KeyboardKey.js +11 -13
- package/commonjs/KeyboardKey/index.js +1 -2
- package/commonjs/KeyboardKey/styles.js +1 -2
- package/commonjs/Label/Label.flow.js +2 -2
- package/commonjs/Label/Label.js +11 -13
- package/commonjs/Label/index.js +1 -2
- package/commonjs/Link/Link.flow.js +2 -2
- package/commonjs/Link/Link.js +3 -4
- package/commonjs/Link/constants.js +1 -2
- package/commonjs/Link/index.js +1 -2
- package/commonjs/Link/styles.js +3 -4
- package/commonjs/Listbox/Listbox.flow.js +2 -2
- package/commonjs/Listbox/Listbox.js +8 -12
- package/commonjs/Listbox/index.js +3 -4
- package/commonjs/Loader/Loader.flow.js +2 -2
- package/commonjs/Loader/Loader.js +10 -12
- package/commonjs/Loader/index.js +1 -2
- package/commonjs/Loader/styles.js +4 -6
- package/commonjs/LoaderButton/LoaderButton.flow.js +2 -2
- package/commonjs/LoaderButton/LoaderButton.js +4 -6
- package/commonjs/LoaderButton/index.js +1 -2
- package/commonjs/Menu/Menu.flow.js +2 -2
- package/commonjs/Menu/Menu.js +42 -50
- package/commonjs/Menu/index.js +3 -4
- package/commonjs/Menu/styles.js +5 -7
- package/commonjs/Menu/utils/constants.flow.js +3 -5
- package/commonjs/Menu/utils/constants.js +3 -5
- package/commonjs/Menu/utils/descendants.js +17 -16
- package/commonjs/Menu/utils/hooks.js +3 -6
- package/commonjs/Message/Message.flow.js +3 -4
- package/commonjs/Message/Message.js +3 -4
- package/commonjs/Message/constants.js +2 -3
- package/commonjs/Message/index.js +1 -2
- package/commonjs/Message/styles.js +5 -10
- package/commonjs/Modal/Modal.flow.js +2 -2
- package/commonjs/Modal/Modal.js +7 -7
- package/commonjs/Modal/index.js +1 -2
- package/commonjs/Modal/styles.js +8 -14
- package/commonjs/Numeral/Numeral.flow.js +2 -2
- package/commonjs/Numeral/Numeral.js +3 -4
- package/commonjs/Numeral/constants.js +7 -13
- package/commonjs/Numeral/index.js +1 -2
- package/commonjs/Numeral/styles.js +3 -5
- package/commonjs/PartnerLogo/PartnerLogo.flow.js +2 -2
- package/commonjs/PartnerLogo/PartnerLogo.js +1 -2
- package/commonjs/PartnerLogo/PartnerLogoTypes.js +4 -6
- package/commonjs/PartnerLogo/index.js +1 -2
- package/commonjs/PartnerLogo/styles.js +3 -4
- package/commonjs/Popout/Popout.flow.js +2 -2
- package/commonjs/Popout/Popout.js +21 -22
- package/commonjs/Popout/index.js +1 -2
- package/commonjs/Popout/styles.js +2 -3
- package/commonjs/Portal/Portal.flow.js +2 -2
- package/commonjs/Portal/Portal.js +11 -13
- package/commonjs/Portal/index.js +1 -2
- package/commonjs/Radio/Radio.flow.js +2 -2
- package/commonjs/Radio/Radio.js +11 -13
- package/commonjs/Radio/index.js +1 -2
- package/commonjs/Radio/styles.js +6 -10
- package/commonjs/SegmentedControl/SegmentedControl.flow.js +2 -2
- package/commonjs/SegmentedControl/SegmentedControl.js +8 -8
- package/commonjs/SegmentedControl/index.js +1 -2
- package/commonjs/SegmentedControl/styles.js +6 -9
- package/commonjs/Select/Select.flow.js +2 -2
- package/commonjs/Select/Select.js +11 -13
- package/commonjs/Select/index.js +1 -2
- package/commonjs/Select/styles.js +4 -6
- package/commonjs/Skeleton/Skeleton.js +1 -2
- package/commonjs/Skeleton/index.js +1 -2
- package/commonjs/SpotIllustration/SpotIllustration.flow.js +2 -2
- package/commonjs/SpotIllustration/SpotIllustration.js +3 -4
- package/commonjs/SpotIllustration/illustrationNames.js +1 -2
- package/commonjs/SpotIllustration/index.js +1 -2
- package/commonjs/Stack/Stack.flow.js +2 -2
- package/commonjs/Stack/Stack.js +6 -6
- package/commonjs/Stack/index.js +1 -2
- package/commonjs/Switch/Switch.flow.js +2 -2
- package/commonjs/Switch/Switch.js +3 -4
- package/commonjs/Switch/index.js +1 -2
- package/commonjs/Switch/styles.js +4 -5
- package/commonjs/Table/Table.flow.js +2 -2
- package/commonjs/Table/Table.js +7 -12
- package/commonjs/Table/index.js +1 -2
- package/commonjs/Table/styles.js +1 -2
- package/commonjs/TableCell/TableCell.flow.js +2 -2
- package/commonjs/TableCell/TableCell.js +11 -14
- package/commonjs/TableCell/index.js +1 -2
- package/commonjs/TableCell/styles.js +1 -2
- package/commonjs/TableHeaderCell/TableHeaderCell.flow.js +4 -5
- package/commonjs/TableHeaderCell/TableHeaderCell.js +12 -15
- package/commonjs/TableHeaderCell/constants.js +2 -3
- package/commonjs/TableHeaderCell/index.js +1 -2
- package/commonjs/TableHeaderCell/styles.js +5 -8
- package/commonjs/TableRowAccordion/TableRowAccordion.flow.js +2 -2
- package/commonjs/TableRowAccordion/TableRowAccordion.js +12 -14
- package/commonjs/TableRowAccordion/index.js +1 -2
- package/commonjs/TableRowAccordion/styles.js +5 -8
- package/commonjs/Tabs/Tabs.flow.js +2 -2
- package/commonjs/Tabs/Tabs.js +12 -15
- package/commonjs/Tabs/index.js +1 -2
- package/commonjs/Tabs/styles.js +5 -8
- package/commonjs/Text/Text.flow.js +2 -2
- package/commonjs/Text/Text.js +3 -4
- package/commonjs/Text/index.js +1 -2
- package/commonjs/Text/styles.js +3 -4
- package/commonjs/Textarea/Textarea.flow.js +2 -2
- package/commonjs/Textarea/Textarea.js +11 -13
- package/commonjs/Textarea/index.js +1 -2
- package/commonjs/Textarea/styles.js +4 -6
- package/commonjs/ThemeProvider/index.flow.js +2 -2
- package/commonjs/ThemeProvider/index.js +3 -4
- package/commonjs/Toast/Toast.flow.js +2 -2
- package/commonjs/Toast/Toast.js +3 -4
- package/commonjs/Toast/index.js +3 -4
- package/commonjs/Toast/styles.js +6 -8
- package/commonjs/ToggleHint/ToggleHint.flow.js +2 -2
- package/commonjs/ToggleHint/ToggleHint.js +11 -13
- package/commonjs/ToggleHint/index.js +1 -2
- package/commonjs/ToggleHint/styles.js +4 -6
- package/commonjs/Token/Token.flow.js +2 -2
- package/commonjs/Token/Token.js +3 -4
- package/commonjs/Token/index.js +3 -4
- package/commonjs/Token/styles.js +3 -4
- package/commonjs/TokenInput/TokenInput.flow.js +2 -2
- package/commonjs/TokenInput/TokenInput.js +12 -14
- package/commonjs/TokenInput/TokenScreenReaderStatus.js +4 -5
- package/commonjs/TokenInput/index.js +1 -2
- package/commonjs/TokenInput/styles.js +3 -4
- package/commonjs/TokenInput/util.js +3 -5
- package/commonjs/Tooltip/Tooltip.flow.js +2 -2
- package/commonjs/Tooltip/Tooltip.js +11 -11
- package/commonjs/Tooltip/index.js +1 -2
- package/commonjs/Tooltip/styles.js +2 -3
- package/commonjs/VisuallyHidden/VisuallyHidden.flow.js +2 -2
- package/commonjs/VisuallyHidden/VisuallyHidden.js +2 -3
- package/commonjs/illustrationNames.js +1 -2
- package/commonjs/index.flow.js +2 -2
- package/commonjs/logoNames.js +1 -2
- package/commonjs/systemProps/background.flow.js +1 -2
- package/commonjs/systemProps/border.flow.js +1 -2
- package/commonjs/systemProps/color.flow.js +1 -2
- package/commonjs/systemProps/custom.flow.js +2 -3
- package/commonjs/systemProps/flexbox.flow.js +1 -2
- package/commonjs/systemProps/grid.flow.js +1 -2
- package/commonjs/systemProps/index.js +5 -7
- package/commonjs/systemProps/layout.flow.js +1 -2
- package/commonjs/systemProps/position.flow.js +1 -2
- package/commonjs/systemProps/shadow.flow.js +1 -2
- package/commonjs/systemProps/space.flow.js +1 -2
- package/commonjs/systemProps/systemProps.flow.js +1 -2
- package/commonjs/systemProps/typography.flow.js +1 -2
- package/commonjs/systemProps/variant.flow.js +2 -3
- package/commonjs/themes/dark/dataviz-palette.js +2 -3
- package/commonjs/themes/dark/decorative-palettes.js +12 -23
- package/commonjs/themes/dark/theme.js +5 -6
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.flow.js +1 -2
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +9 -16
- package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +9 -16
- package/commonjs/themes/light/dataviz-palette.js +2 -3
- package/commonjs/themes/light/decorative-palettes.js +12 -23
- package/commonjs/themes/light/literal-colors.js +1 -2
- package/commonjs/themes/light/theme.js +20 -33
- package/commonjs/types/shared.flow.js +2 -2
- package/commonjs/types/styled-components.flow.js +2 -2
- package/commonjs/utils/a11yTest.js +2 -3
- package/commonjs/utils/chartColors.js +5 -9
- package/commonjs/utils/constants.js +1 -2
- package/commonjs/utils/dataQaLabelQueries.js +2 -3
- package/commonjs/utils/hooks.flow.js +1 -0
- package/commonjs/utils/hooks.js +4 -6
- package/commonjs/utils/index.js +2 -4
- package/commonjs/utils/innerText.flow.js +2 -2
- package/commonjs/utils/innerText.js +1 -2
- package/commonjs/utils/mixins.js +5 -10
- package/commonjs/utils/react-testing-library.flow.js +2 -2
- package/commonjs/utils/react-testing-library.js +5 -8
- package/commonjs/utils/responsiveProps/index.js +2 -3
- package/commonjs/utils/system-props/gap.js +2 -3
- package/commonjs/utils/system-props/system-props.js +9 -16
- package/commonjs/utils/useInteractiveColor.js +2 -3
- package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +2 -1
- package/dist/themes/light/theme.scss +2 -1
- package/dist/types/Button/styles.d.ts.map +1 -1
- package/dist/types/themes/dark/theme.d.ts +18 -18
- package/dist/types/themes/light/theme.d.ts +28 -27
- package/dist/types/themes/light/theme.d.ts.map +1 -1
- package/dist/types/types/theme.colors.d.ts +1 -0
- package/dist/types/types/theme.colors.d.ts.map +1 -1
- package/lib/Breadcrumb/Breadcrumb.js +2 -2
- package/lib/Button/styles.js +1 -4
- package/lib/CharacterCounter/CharacterCounter.js +7 -8
- package/lib/Checkbox/Checkbox.js +8 -9
- package/lib/Collapsible/Collapsible.js +2 -2
- package/lib/Drawer/Drawer.js +2 -2
- package/lib/FormField/FormField.js +2 -2
- package/lib/Icon/Icon.js +2 -2
- package/lib/Image/Image.js +8 -9
- package/lib/Indicator/Indicator.js +7 -8
- package/lib/Input/Input.js +9 -9
- package/lib/KeyboardKey/KeyboardKey.js +7 -8
- package/lib/Label/Label.js +7 -8
- package/lib/Listbox/Listbox.js +2 -2
- package/lib/Loader/Loader.js +7 -8
- package/lib/Menu/Menu.js +2 -2
- package/lib/Menu/utils/descendants.js +2 -2
- package/lib/Popout/Popout.js +2 -2
- package/lib/Portal/Portal.js +8 -9
- package/lib/Radio/Radio.js +8 -9
- package/lib/Select/Select.js +8 -9
- package/lib/TableCell/TableCell.js +7 -8
- package/lib/TableHeaderCell/TableHeaderCell.js +8 -9
- package/lib/TableRowAccordion/TableRowAccordion.js +8 -9
- package/lib/Tabs/Tabs.js +9 -11
- package/lib/Textarea/Textarea.js +8 -9
- package/lib/ToggleHint/ToggleHint.js +8 -9
- package/lib/TokenInput/TokenInput.js +8 -9
- package/lib/Tooltip/Tooltip.js +2 -2
- package/lib/systemProps/space.flow.js +14 -0
- package/lib/themes/dark/theme.js +2 -2
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +2 -2
- package/lib/themes/extendedThemes/sproutTheme/light/theme.js +2 -2
- package/lib/themes/light/theme.js +5 -3
- package/lib/utils/hooks.flow.js +1 -0
- package/lib/utils/hooks.js +2 -2
- package/lib/utils/react-testing-library.js +2 -2
- package/package.json +16 -24
|
@@ -14,17 +14,17 @@ var _Menu = _interopRequireWildcard(require("../Menu"));
|
|
|
14
14
|
var _excluded = ["role", "children"],
|
|
15
15
|
_excluded2 = ["children"];
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
function _getRequireWildcardCache(
|
|
18
|
-
function _interopRequireWildcard(
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
21
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
-
function _toPropertyKey(
|
|
23
|
-
function _toPrimitive(
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
24
|
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); }
|
|
25
25
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
26
26
|
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; }
|
|
27
|
-
var Listbox = function Listbox(_ref) {
|
|
27
|
+
var Listbox = exports.Listbox = function Listbox(_ref) {
|
|
28
28
|
var _ref$role = _ref.role,
|
|
29
29
|
role = _ref$role === void 0 ? _constants.MENU_ROLES.LISTBOX : _ref$role,
|
|
30
30
|
children = _ref.children,
|
|
@@ -38,8 +38,7 @@ var Listbox = function Listbox(_ref) {
|
|
|
38
38
|
* These styles are copied from @sproutsocial/racine/commonjs/Select/styles and applied at the root element since
|
|
39
39
|
* the Listbox component doesn't render a select.
|
|
40
40
|
*/
|
|
41
|
-
exports.
|
|
42
|
-
var ListboxButtonContainer = (0, _styledComponents.default)(_Menu.MenuButton).withConfig({
|
|
41
|
+
var ListboxButtonContainer = exports.ListboxButtonContainer = (0, _styledComponents.default)(_Menu.MenuButton).withConfig({
|
|
43
42
|
displayName: "Listbox__ListboxButtonContainer",
|
|
44
43
|
componentId: "sc-5frpmh-0"
|
|
45
44
|
})(["position:relative;width:100%;border:1px solid ", ";border-radius:", ";background-color:", ";color:", ";cursor:", ";outline:none;appearance:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";text-align:left;margin:0;&:active{transform:none;}padding:", ";font-size:", ";", ""], function (props) {
|
|
@@ -90,8 +89,7 @@ var ListboxButtonContainer = (0, _styledComponents.default)(_Menu.MenuButton).wi
|
|
|
90
89
|
return props.theme.colors.icon.error;
|
|
91
90
|
});
|
|
92
91
|
});
|
|
93
|
-
exports.
|
|
94
|
-
var ListboxButton = function ListboxButton(_ref2) {
|
|
92
|
+
var ListboxButton = exports.ListboxButton = function ListboxButton(_ref2) {
|
|
95
93
|
var children = _ref2.children,
|
|
96
94
|
restProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
97
95
|
return /*#__PURE__*/React.createElement(ListboxButtonContainer, _extends({}, restProps, {
|
|
@@ -106,7 +104,6 @@ var ListboxButton = function ListboxButton(_ref2) {
|
|
|
106
104
|
"aria-hidden": true
|
|
107
105
|
})));
|
|
108
106
|
};
|
|
109
|
-
exports.ListboxButton = ListboxButton;
|
|
110
107
|
Listbox.Option = Listbox.Item = _Menu.default.Item;
|
|
111
108
|
Listbox.Checkbox = _Menu.default.Checkbox;
|
|
112
109
|
Listbox.Radio = _Menu.default.Radio;
|
|
@@ -114,5 +111,4 @@ Listbox.Switch = _Menu.default.Switch;
|
|
|
114
111
|
Listbox.Group = _Menu.default.Group;
|
|
115
112
|
Listbox.Divider = _Menu.default.Divider;
|
|
116
113
|
Listbox.FilterInput = _Menu.default.FilterInput;
|
|
117
|
-
var _default = Listbox;
|
|
118
|
-
exports.default = _default;
|
|
114
|
+
var _default = exports.default = Listbox;
|
|
@@ -34,7 +34,6 @@ Object.keys(_ListboxTypes).forEach(function (key) {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
-
function _getRequireWildcardCache(
|
|
38
|
-
function _interopRequireWildcard(
|
|
39
|
-
var _default = _Listbox.default;
|
|
40
|
-
exports.default = _default;
|
|
37
|
+
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); }
|
|
38
|
+
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; }
|
|
39
|
+
var _default = exports.default = _Listbox.default;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
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
4
|
var React = _interopRequireWildcard(require("react"));
|
|
5
|
-
function _getRequireWildcardCache(
|
|
6
|
-
function _interopRequireWildcard(
|
|
5
|
+
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); }
|
|
6
|
+
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; }
|
|
@@ -7,8 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _styles = _interopRequireWildcard(require("./styles"));
|
|
9
9
|
var _excluded = ["text", "size", "delay", "color", "qa"];
|
|
10
|
-
function _getRequireWildcardCache(
|
|
11
|
-
function _interopRequireWildcard(
|
|
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
12
|
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); }
|
|
13
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
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -16,22 +16,21 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
16
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
17
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
18
18
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
-
function
|
|
20
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
19
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
22
20
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
23
21
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
|
-
function _isNativeReflectConstruct() {
|
|
22
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
23
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
26
26
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
-
function _toPropertyKey(
|
|
28
|
-
function _toPrimitive(
|
|
29
|
-
var Loader = /*#__PURE__*/function (_React$Component) {
|
|
27
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
28
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
29
|
+
var Loader = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
30
30
|
_inherits(Loader, _React$Component);
|
|
31
|
-
var _super = _createSuper(Loader);
|
|
32
31
|
function Loader() {
|
|
33
32
|
_classCallCheck(this, Loader);
|
|
34
|
-
return
|
|
33
|
+
return _callSuper(this, Loader, arguments);
|
|
35
34
|
}
|
|
36
35
|
_createClass(Loader, [{
|
|
37
36
|
key: "render",
|
|
@@ -53,7 +52,6 @@ var Loader = /*#__PURE__*/function (_React$Component) {
|
|
|
53
52
|
}]);
|
|
54
53
|
return Loader;
|
|
55
54
|
}(React.Component);
|
|
56
|
-
exports.default = Loader;
|
|
57
55
|
_defineProperty(Loader, "defaultProps", {
|
|
58
56
|
size: 'large',
|
|
59
57
|
text: '',
|
package/commonjs/Loader/index.js
CHANGED
|
@@ -27,5 +27,4 @@ Object.keys(_LoaderTypes).forEach(function (key) {
|
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
|
-
var _default = _Loader.default;
|
|
31
|
-
exports.default = _default;
|
|
30
|
+
var _default = exports.default = _Loader.default;
|
|
@@ -8,8 +8,8 @@ exports.default = exports.Text = void 0;
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
var _mixins = require("../utils/mixins");
|
|
10
10
|
var _systemProps = require("../utils/system-props");
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
13
|
var getSize = function getSize(size) {
|
|
14
14
|
var spinnerSize = Math.round(size * 1);
|
|
15
15
|
var borderWidth = Math.round(size * 0.1);
|
|
@@ -35,10 +35,8 @@ var Container = _styledComponents.default.div.attrs({
|
|
|
35
35
|
}, function (props) {
|
|
36
36
|
return props.small ? getSize(20) : getSize(40);
|
|
37
37
|
}, _systemProps.COMMON);
|
|
38
|
-
var Text = _styledComponents.default.div.withConfig({
|
|
38
|
+
var Text = exports.Text = _styledComponents.default.div.withConfig({
|
|
39
39
|
displayName: "styles__Text",
|
|
40
40
|
componentId: "sc-1edimrk-1"
|
|
41
41
|
})(["", ""], _mixins.visuallyHidden);
|
|
42
|
-
exports.
|
|
43
|
-
var _default = Container;
|
|
44
|
-
exports.default = _default;
|
|
42
|
+
var _default = exports.default = Container;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
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
4
|
var React = _interopRequireWildcard(require("react"));
|
|
5
|
-
function _getRequireWildcardCache(
|
|
6
|
-
function _interopRequireWildcard(
|
|
5
|
+
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); }
|
|
6
|
+
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,8 +12,8 @@ var _Button = _interopRequireDefault(require("../Button"));
|
|
|
12
12
|
var _Loader = _interopRequireDefault(require("../Loader"));
|
|
13
13
|
var _excluded = ["isLoading", "disabled", "loaderLabel", "children", "appearance"];
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
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); }
|
|
16
|
+
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; }
|
|
17
17
|
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); }
|
|
18
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
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; }
|
|
@@ -34,7 +34,7 @@ var StyledLoaderButton = (0, _styledComponents.default)(_Button.default).withCon
|
|
|
34
34
|
var disabled = _ref2.disabled;
|
|
35
35
|
return disabled && 'opacity: 1;';
|
|
36
36
|
});
|
|
37
|
-
var LoaderButton = function LoaderButton(_ref3) {
|
|
37
|
+
var LoaderButton = exports.LoaderButton = function LoaderButton(_ref3) {
|
|
38
38
|
var _ref3$isLoading = _ref3.isLoading,
|
|
39
39
|
isLoading = _ref3$isLoading === void 0 ? false : _ref3$isLoading,
|
|
40
40
|
disabled = _ref3.disabled,
|
|
@@ -64,6 +64,4 @@ var LoaderButton = function LoaderButton(_ref3) {
|
|
|
64
64
|
delay: false
|
|
65
65
|
}))));
|
|
66
66
|
};
|
|
67
|
-
exports.
|
|
68
|
-
var _default = LoaderButton;
|
|
69
|
-
exports.default = _default;
|
|
67
|
+
var _default = exports.default = LoaderButton;
|
|
@@ -27,5 +27,4 @@ Object.keys(_LoaderButtonTypes).forEach(function (key) {
|
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
|
-
var _default = _LoaderButton.default;
|
|
31
|
-
exports.default = _default;
|
|
30
|
+
var _default = exports.default = _LoaderButton.default;
|
|
@@ -7,5 +7,5 @@ var _index2 = _interopRequireDefault(require("../Button/index.flow"));
|
|
|
7
7
|
var _index3 = _interopRequireDefault(require("../Popout/index.flow"));
|
|
8
8
|
var _constantsFlow = require("./utils/constants.flow.js");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function _getRequireWildcardCache(
|
|
11
|
-
function _interopRequireWildcard(
|
|
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; }
|
package/commonjs/Menu/Menu.js
CHANGED
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.MenuSwitch = exports.MenuRadio = exports.MenuItem = exports.MenuGroup = exports.MenuDivider = exports.MenuCheckbox = exports.MenuButton = exports.Menu = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
var
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var React = _react;
|
|
10
11
|
var _lodash = _interopRequireDefault(require("lodash.uniqueid"));
|
|
11
12
|
var _hooks = require("../utils/hooks");
|
|
12
13
|
var _innerText = _interopRequireDefault(require("../utils/innerText"));
|
|
@@ -29,14 +30,14 @@ var _excluded = ["id", "index", "as", "children", "role", "elemBefore", "elemAft
|
|
|
29
30
|
_excluded5 = ["children", "role", "multiselect", "innerRef"],
|
|
30
31
|
_excluded6 = ["role", "children", "onChange", "value", "multiselect", "innerRef", "footerContent"],
|
|
31
32
|
_excluded7 = ["content", "popoutProps", "children", "onClick", "closeOnItemClick", "id", "placement", "isOpen", "setIsOpen"];
|
|
32
|
-
function _getRequireWildcardCache(
|
|
33
|
-
function _interopRequireWildcard(
|
|
33
|
+
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); }
|
|
34
|
+
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; }
|
|
34
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
36
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
37
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
38
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
38
|
-
function _toPropertyKey(
|
|
39
|
-
function _toPrimitive(
|
|
39
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
40
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
40
41
|
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); }
|
|
41
42
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
42
43
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -68,7 +69,7 @@ function isValueSelected(menuValue, value) {
|
|
|
68
69
|
}
|
|
69
70
|
return false;
|
|
70
71
|
}
|
|
71
|
-
var MenuItem = function MenuItem(_ref) {
|
|
72
|
+
var MenuItem = exports.MenuItem = function MenuItem(_ref) {
|
|
72
73
|
var idProp = _ref.id,
|
|
73
74
|
indexProp = _ref.index,
|
|
74
75
|
as = _ref.as,
|
|
@@ -84,7 +85,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
84
85
|
indeterminate = _ref.indeterminate,
|
|
85
86
|
labelProp = _ref.label,
|
|
86
87
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
87
|
-
var _useContext = (0,
|
|
88
|
+
var _useContext = (0, _react.useContext)(_utils.MenuContext),
|
|
88
89
|
menuRole = _useContext.role,
|
|
89
90
|
onChange = _useContext.onChange,
|
|
90
91
|
value = _useContext.value,
|
|
@@ -94,20 +95,20 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
94
95
|
menuRef = _useContext.menuRef;
|
|
95
96
|
var selectionIndex = menuState.selectionIndex,
|
|
96
97
|
filteredItems = menuState.filteredItems;
|
|
97
|
-
var _useContext2 = (0,
|
|
98
|
+
var _useContext2 = (0, _react.useContext)(_utils.MenuButtonContext),
|
|
98
99
|
closePopout = _useContext2.closePopout,
|
|
99
100
|
closeOnItemClick = _useContext2.closeOnItemClick;
|
|
100
101
|
var isSelected = selected || isValueSelected(value, valueProp);
|
|
101
102
|
var shouldClosePopout = closeOnItemClick && !multiselect;
|
|
102
103
|
var itemRole = roleProp || getMenuItemRole(menuRole);
|
|
103
|
-
var id = (0,
|
|
104
|
+
var id = (0, _react.useMemo)(function () {
|
|
104
105
|
return idProp || (0, _lodash.default)('MenuItem-');
|
|
105
106
|
}, [idProp]);
|
|
106
107
|
var textContent = (0, _hooks.useTextContent)('');
|
|
107
108
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
108
109
|
// @ts-ignore
|
|
109
110
|
var label = labelProp || textContent.current;
|
|
110
|
-
var ref = (0,
|
|
111
|
+
var ref = (0, _react.useRef)(null);
|
|
111
112
|
var index = (0, _utils.useDescendant)({
|
|
112
113
|
context: _utils.MenuDescendantContext,
|
|
113
114
|
element: ref.current,
|
|
@@ -119,7 +120,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
119
120
|
var isHidden = filteredItems && !filteredItems.includes(index);
|
|
120
121
|
var isFocused = index === selectionIndex;
|
|
121
122
|
selectCallbacks.current[index] = onClick;
|
|
122
|
-
var _useState = (0,
|
|
123
|
+
var _useState = (0, _react.useState)(false),
|
|
123
124
|
_useState2 = _slicedToArray(_useState, 2),
|
|
124
125
|
keyPressed = _useState2[0],
|
|
125
126
|
setKeyPressed = _useState2[1];
|
|
@@ -135,7 +136,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
135
136
|
* to remove it from the tab order. Resulting to DOM manipulation as a last resort. We can remove this if Checkbox
|
|
136
137
|
* exposes this prop in the future.
|
|
137
138
|
*/
|
|
138
|
-
(0,
|
|
139
|
+
(0, _react.useEffect)(function () {
|
|
139
140
|
if (isCheckboxOrRadio && ref.current) {
|
|
140
141
|
var input = ref.current.querySelector('input');
|
|
141
142
|
if (input) {
|
|
@@ -143,14 +144,14 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
}, [ref, isCheckboxOrRadio]);
|
|
146
|
-
(0,
|
|
147
|
+
(0, _react.useEffect)(function () {
|
|
147
148
|
if (filteredItems) {
|
|
148
149
|
setKeyPressed(true);
|
|
149
150
|
} else if (selectionIndex !== 0) {
|
|
150
151
|
setKeyPressed(true);
|
|
151
152
|
}
|
|
152
153
|
}, [selectionIndex, filteredItems]);
|
|
153
|
-
var handleClick = (0,
|
|
154
|
+
var handleClick = (0, _react.useCallback)(function (e) {
|
|
154
155
|
var _menuRef$current;
|
|
155
156
|
(_menuRef$current = menuRef.current) === null || _menuRef$current === void 0 || _menuRef$current.focus();
|
|
156
157
|
if (onChange && itemRole !== _utils.MENU_ITEM_ROLES.LISTITEM) {
|
|
@@ -160,7 +161,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
160
161
|
shouldClosePopout && closePopout && closePopout();
|
|
161
162
|
onClick && onClick(e);
|
|
162
163
|
}, [menuRef, onChange, itemRole, shouldClosePopout, closePopout, onClick, valueProp, label]);
|
|
163
|
-
var before = (0,
|
|
164
|
+
var before = (0, _react.useMemo)(function () {
|
|
164
165
|
if (elemBefore) return elemBefore;
|
|
165
166
|
if (itemRole === _utils.MENU_ITEM_ROLES.CHECKBOX) {
|
|
166
167
|
return /*#__PURE__*/React.createElement(_Checkbox.default, {
|
|
@@ -182,7 +183,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
182
183
|
});
|
|
183
184
|
}
|
|
184
185
|
}, [elemBefore, id, indeterminate, isSelected, itemRole]);
|
|
185
|
-
var after = (0,
|
|
186
|
+
var after = (0, _react.useMemo)(function () {
|
|
186
187
|
if (elemAfter) return elemAfter;
|
|
187
188
|
if (isSelected && !isCheckboxOrRadio) {
|
|
188
189
|
return /*#__PURE__*/React.createElement(_Icon.default, {
|
|
@@ -236,21 +237,18 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
236
237
|
ref: textContent
|
|
237
238
|
}, children), after));
|
|
238
239
|
};
|
|
239
|
-
exports.
|
|
240
|
-
var MenuCheckbox = function MenuCheckbox(props) {
|
|
240
|
+
var MenuCheckbox = exports.MenuCheckbox = function MenuCheckbox(props) {
|
|
241
241
|
return /*#__PURE__*/React.createElement(MenuItem, _extends({
|
|
242
242
|
role: _utils.MENU_ITEM_ROLES.CHECKBOX
|
|
243
243
|
}, props));
|
|
244
244
|
};
|
|
245
|
-
exports.
|
|
246
|
-
var MenuRadio = function MenuRadio(props) {
|
|
245
|
+
var MenuRadio = exports.MenuRadio = function MenuRadio(props) {
|
|
247
246
|
return /*#__PURE__*/React.createElement(MenuItem, _extends({
|
|
248
247
|
role: _utils.MENU_ITEM_ROLES.RADIO
|
|
249
248
|
}, props));
|
|
250
249
|
};
|
|
251
|
-
exports.
|
|
252
|
-
var
|
|
253
|
-
var _useContext3 = (0, React.useContext)(_utils.MenuContext),
|
|
250
|
+
var MenuSwitch = exports.MenuSwitch = function MenuSwitch(props) {
|
|
251
|
+
var _useContext3 = (0, _react.useContext)(_utils.MenuContext),
|
|
254
252
|
menuValue = _useContext3.value;
|
|
255
253
|
var placement = props.placement,
|
|
256
254
|
_props$labelProps = props.labelProps,
|
|
@@ -261,7 +259,7 @@ var MenuSwitch = function MenuSwitch(props) {
|
|
|
261
259
|
id = props.id,
|
|
262
260
|
label = props.label,
|
|
263
261
|
rest = _objectWithoutProperties(props, _excluded2);
|
|
264
|
-
var menuItemId = (0,
|
|
262
|
+
var menuItemId = (0, _react.useMemo)(function () {
|
|
265
263
|
return id || (0, _lodash.default)('MenuItem-');
|
|
266
264
|
}, [id]);
|
|
267
265
|
var labelId = "".concat(menuItemId, "-label");
|
|
@@ -294,7 +292,6 @@ var MenuSwitch = function MenuSwitch(props) {
|
|
|
294
292
|
children: children || label
|
|
295
293
|
})));
|
|
296
294
|
};
|
|
297
|
-
exports.MenuSwitch = MenuSwitch;
|
|
298
295
|
var MenuTitle = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
299
296
|
displayName: "Menu__MenuTitle",
|
|
300
297
|
componentId: "sc-1jmjosz-0"
|
|
@@ -317,14 +314,14 @@ var _StyledMenuTitle = (0, _styledComponents.default)(MenuTitle).withConfig({
|
|
|
317
314
|
})(["", ""], function (p) {
|
|
318
315
|
return p.$_css;
|
|
319
316
|
});
|
|
320
|
-
var MenuGroup = function MenuGroup(_ref6) {
|
|
317
|
+
var MenuGroup = exports.MenuGroup = function MenuGroup(_ref6) {
|
|
321
318
|
var children = _ref6.children,
|
|
322
319
|
title = _ref6.title,
|
|
323
320
|
titleAs = _ref6.titleAs,
|
|
324
321
|
_ref6$disabled = _ref6.disabled,
|
|
325
322
|
isDisabled = _ref6$disabled === void 0 ? false : _ref6$disabled,
|
|
326
323
|
props = _objectWithoutProperties(_ref6, _excluded3);
|
|
327
|
-
var menuTitleId = (0,
|
|
324
|
+
var menuTitleId = (0, _react.useMemo)(function () {
|
|
328
325
|
return (0, _lodash.default)('menu-title-');
|
|
329
326
|
}, []);
|
|
330
327
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Box.default, _extends({
|
|
@@ -341,8 +338,7 @@ var MenuGroup = function MenuGroup(_ref6) {
|
|
|
341
338
|
$_css: isDisabled ? _mixins.disabled : undefined
|
|
342
339
|
}, title), children));
|
|
343
340
|
};
|
|
344
|
-
exports.
|
|
345
|
-
var MenuDivider = function MenuDivider(props) {
|
|
341
|
+
var MenuDivider = exports.MenuDivider = function MenuDivider(props) {
|
|
346
342
|
return /*#__PURE__*/React.createElement(_Box.default, _extends({
|
|
347
343
|
as: "li",
|
|
348
344
|
role: "separator",
|
|
@@ -350,7 +346,6 @@ var MenuDivider = function MenuDivider(props) {
|
|
|
350
346
|
borderColor: "container.border.base"
|
|
351
347
|
}, props));
|
|
352
348
|
};
|
|
353
|
-
exports.MenuDivider = MenuDivider;
|
|
354
349
|
var MenuFilterInput = function MenuFilterInput(_ref7) {
|
|
355
350
|
var _ref7$type = _ref7.type,
|
|
356
351
|
type = _ref7$type === void 0 ? 'search' : _ref7$type,
|
|
@@ -358,22 +353,22 @@ var MenuFilterInput = function MenuFilterInput(_ref7) {
|
|
|
358
353
|
var onChange = props.onChange,
|
|
359
354
|
onFocus = props.onFocus,
|
|
360
355
|
onBlur = props.onBlur;
|
|
361
|
-
var _useContext4 = (0,
|
|
356
|
+
var _useContext4 = (0, _react.useContext)(_utils.MenuContext),
|
|
362
357
|
state = _useContext4.state,
|
|
363
358
|
setState = _useContext4.setState;
|
|
364
|
-
var handleOnChange = (0,
|
|
359
|
+
var handleOnChange = (0, _react.useCallback)(function (event, value) {
|
|
365
360
|
onChange && onChange(event, value);
|
|
366
361
|
setState({
|
|
367
362
|
filterQuery: value
|
|
368
363
|
});
|
|
369
364
|
}, [setState, onChange]);
|
|
370
|
-
var handleOnFocus = (0,
|
|
365
|
+
var handleOnFocus = (0, _react.useCallback)(function (event) {
|
|
371
366
|
onFocus && onFocus(event);
|
|
372
367
|
setState({
|
|
373
368
|
isFilterInputFocused: true
|
|
374
369
|
});
|
|
375
370
|
}, [setState, onFocus]);
|
|
376
|
-
var handleOnBlur = (0,
|
|
371
|
+
var handleOnBlur = (0, _react.useCallback)(function (event) {
|
|
377
372
|
onBlur && onBlur(event);
|
|
378
373
|
setState({
|
|
379
374
|
isFilterInputFocused: false
|
|
@@ -414,14 +409,14 @@ var MenuItems = function MenuItems(_ref8) {
|
|
|
414
409
|
};
|
|
415
410
|
var MenuFooter = function MenuFooter(_ref9) {
|
|
416
411
|
var children = _ref9.children;
|
|
417
|
-
var _useContext5 = (0,
|
|
412
|
+
var _useContext5 = (0, _react.useContext)(_utils.MenuContext),
|
|
418
413
|
setState = _useContext5.setState;
|
|
419
|
-
var handleOnBlur = (0,
|
|
414
|
+
var handleOnBlur = (0, _react.useCallback)(function () {
|
|
420
415
|
setState({
|
|
421
416
|
isFooterFocused: false
|
|
422
417
|
});
|
|
423
418
|
}, [setState]);
|
|
424
|
-
var handleOnFocus = (0,
|
|
419
|
+
var handleOnFocus = (0, _react.useCallback)(function () {
|
|
425
420
|
setState({
|
|
426
421
|
isFooterFocused: true
|
|
427
422
|
});
|
|
@@ -431,7 +426,7 @@ var MenuFooter = function MenuFooter(_ref9) {
|
|
|
431
426
|
onFocus: handleOnFocus
|
|
432
427
|
}, children);
|
|
433
428
|
};
|
|
434
|
-
var Menu = function Menu(_ref10) {
|
|
429
|
+
var Menu = exports.Menu = function Menu(_ref10) {
|
|
435
430
|
var _ref10$role = _ref10.role,
|
|
436
431
|
role = _ref10$role === void 0 ? _utils.MENU_ROLES.MENU : _ref10$role,
|
|
437
432
|
children = _ref10.children,
|
|
@@ -445,7 +440,7 @@ var Menu = function Menu(_ref10) {
|
|
|
445
440
|
_useDescendants2 = _slicedToArray(_useDescendants, 2),
|
|
446
441
|
descendants = _useDescendants2[0],
|
|
447
442
|
setDescendants = _useDescendants2[1];
|
|
448
|
-
var _useState3 = (0,
|
|
443
|
+
var _useState3 = (0, _react.useState)({
|
|
449
444
|
selectionIndex: 0,
|
|
450
445
|
filterQuery: '',
|
|
451
446
|
filteredItems: null,
|
|
@@ -455,9 +450,9 @@ var Menu = function Menu(_ref10) {
|
|
|
455
450
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
456
451
|
state = _useState4[0],
|
|
457
452
|
setState = _useState4[1];
|
|
458
|
-
var selectCallbacks = (0,
|
|
459
|
-
var menuRef = (0,
|
|
460
|
-
var setContextState = (0,
|
|
453
|
+
var selectCallbacks = (0, _react.useRef)([]);
|
|
454
|
+
var menuRef = (0, _react.useRef)(null);
|
|
455
|
+
var setContextState = (0, _react.useCallback)(function (newState) {
|
|
461
456
|
setState(_objectSpread(_objectSpread({}, state), newState));
|
|
462
457
|
}, [state]);
|
|
463
458
|
return /*#__PURE__*/React.createElement(_utils.DescendantProvider, {
|
|
@@ -483,7 +478,6 @@ var Menu = function Menu(_ref10) {
|
|
|
483
478
|
innerRef: menuRef
|
|
484
479
|
}), children), footerContent ? /*#__PURE__*/React.createElement(MenuFooter, null, footerContent) : null));
|
|
485
480
|
};
|
|
486
|
-
exports.Menu = Menu;
|
|
487
481
|
MenuGroup.displayName = 'Menu.Group';
|
|
488
482
|
MenuItem.displayName = 'Menu.Item';
|
|
489
483
|
MenuCheckbox.displayName = 'Menu.Checkbox';
|
|
@@ -503,7 +497,7 @@ var CustomPopoutContent = (0, _styledComponents.default)(_Popout.default.Content
|
|
|
503
497
|
displayName: "Menu__CustomPopoutContent",
|
|
504
498
|
componentId: "sc-1jmjosz-2"
|
|
505
499
|
})(["padding:0;margin-left:0;margin-right:0;"]);
|
|
506
|
-
var MenuButton = function MenuButton(_ref11) {
|
|
500
|
+
var MenuButton = exports.MenuButton = function MenuButton(_ref11) {
|
|
507
501
|
var content = _ref11.content,
|
|
508
502
|
popoutProps = _ref11.popoutProps,
|
|
509
503
|
children = _ref11.children,
|
|
@@ -517,18 +511,18 @@ var MenuButton = function MenuButton(_ref11) {
|
|
|
517
511
|
isOpen = _ref11.isOpen,
|
|
518
512
|
setIsOpen = _ref11.setIsOpen,
|
|
519
513
|
props = _objectWithoutProperties(_ref11, _excluded7);
|
|
520
|
-
var _useState5 = (0,
|
|
514
|
+
var _useState5 = (0, _react.useState)(false),
|
|
521
515
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
522
516
|
isInternalShown = _useState6[0],
|
|
523
517
|
setIsInternalShown = _useState6[1];
|
|
524
518
|
var isControlled = typeof isOpen === 'boolean';
|
|
525
519
|
var isShown = isControlled ? isOpen : isInternalShown;
|
|
526
|
-
var setIsShown = (0,
|
|
520
|
+
var setIsShown = (0, _react.useMemo)(function () {
|
|
527
521
|
return isControlled && setIsOpen ? setIsOpen : function (nextIsShown) {
|
|
528
522
|
return setIsInternalShown(nextIsShown);
|
|
529
523
|
};
|
|
530
524
|
}, [isControlled, setIsOpen]);
|
|
531
|
-
var closePopout = (0,
|
|
525
|
+
var closePopout = (0, _react.useCallback)(function () {
|
|
532
526
|
return setIsShown(false);
|
|
533
527
|
}, [setIsShown]);
|
|
534
528
|
var ariaLabelledBy = props['aria-labelledby'] ? "".concat(props['aria-labelledby'], " ").concat(id) : undefined;
|
|
@@ -563,6 +557,4 @@ var MenuButton = function MenuButton(_ref11) {
|
|
|
563
557
|
}
|
|
564
558
|
}), children)));
|
|
565
559
|
};
|
|
566
|
-
exports.
|
|
567
|
-
var _default = Menu;
|
|
568
|
-
exports.default = _default;
|
|
560
|
+
var _default = exports.default = Menu;
|