glints-aries 4.0.373 → 4.0.375
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/es/@next/Checkbox/CheckboxStyle.js +2 -2
- package/es/@next/IndexTable/IndexTable.d.ts +2 -1
- package/es/@next/IndexTable/IndexTable.js +4 -2
- package/lib/@next/Checkbox/CheckboxStyle.js +2 -2
- package/lib/@next/IndexTable/IndexTable.d.ts +2 -1
- package/lib/@next/IndexTable/IndexTable.js +4 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { space4 } from '../utilities/spacing';
|
|
|
6
6
|
export var StyledContainer = styled.div.withConfig({
|
|
7
7
|
displayName: "CheckboxStyle__StyledContainer",
|
|
8
8
|
componentId: "sc-a9bf1h-0"
|
|
9
|
-
})(["flex-direction:row;align-items:flex-start;gap:8px;color:", ";label{cursor:pointer;margin-top:-1px;}svg{border-radius:4px;position:absolute;height:20px;width:20px;top:0;left:0;opacity:0;pointer-events:none;fill:", ";}&[data-spacing='true']{padding:", " 0px;}&[aria-disabled='true'],&[aria-disabled='true'] .help-text{color:", ";}&[aria-disabled='true'] div[role='checkbox']{border-color:", ";background:", ";}&[aria-disabled='true'] svg{background:", ";fill:", ";}&[data-error='true'] svg{fill:", ";}"], Neutral.B18, Blue.S99, space4, Neutral.B68, Neutral.B85, Neutral.B95, Neutral.B68, Neutral.B95, Red.B93);
|
|
9
|
+
})(["flex-direction:row;align-items:flex-start;gap:8px;color:", ";label{cursor:pointer;margin-top:-1px;}svg{border-radius:4px;position:absolute;height:20px;width:20px;top:0;left:0;opacity:0;pointer-events:none;fill:", ";}&[data-spacing='true']{padding:", " 0px;}&[aria-disabled='true'],&[aria-disabled='true'] .help-text{color:", ";}&[aria-disabled='true'] div[role='checkbox']{border-color:", ";background:", ";cursor:not-allowed;}&[aria-disabled='true'] input{cursor:not-allowed;}&[aria-disabled='true'] svg{background:", ";fill:", ";}&[data-error='true'] svg{fill:", ";}"], Neutral.B18, Blue.S99, space4, Neutral.B68, Neutral.B85, Neutral.B95, Neutral.B68, Neutral.B95, Red.B93);
|
|
10
10
|
export var StyledCheckboxContainer = styled.div.withConfig({
|
|
11
11
|
displayName: "CheckboxStyle__StyledCheckboxContainer",
|
|
12
12
|
componentId: "sc-a9bf1h-1"
|
|
@@ -14,7 +14,7 @@ export var StyledCheckboxContainer = styled.div.withConfig({
|
|
|
14
14
|
export var StyledCheckbox = styled.div.withConfig({
|
|
15
15
|
displayName: "CheckboxStyle__StyledCheckbox",
|
|
16
16
|
componentId: "sc-a9bf1h-2"
|
|
17
|
-
})(["width:20px;height:20px;background:", ";border:2px solid;border-color:", ";cursor:pointer;border-radius:", "
|
|
17
|
+
})(["width:20px;height:20px;background:", ";border:2px solid;border-color:", ";cursor:pointer;border-radius:", ";position:relative;& input{opacity:0;cursor:pointer;width:24px;height:24px;margin:0;padding:0;position:absolute;top:-4px;left:-4px;}&[data-focus='true']{box-shadow:0px 0px 0px 1px ", ",0px 0px 0px 3px #6ac9ec;}&[aria-checked='true'] + svg,&[aria-checked='mixed'] + svg{opacity:1;}@media (max-width:", "){width:18px;height:18px;}"], Neutral.B100, function (_ref) {
|
|
18
18
|
var hasError = _ref.hasError;
|
|
19
19
|
return hasError ? Red.B93 : Neutral.B68;
|
|
20
20
|
}, borderRadius4, Neutral.B100, Breakpoints.large);
|
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { IndexTableProps as PolarisIndexTableProps } from 'polaris-glints';
|
|
3
3
|
declare type IndexTableProps = Omit<PolarisIndexTableProps, 'emptySearchTitle'> & {
|
|
4
4
|
height?: string;
|
|
5
|
+
selectableItemsCount?: number;
|
|
5
6
|
};
|
|
6
7
|
declare const IndexTable: {
|
|
7
|
-
({ bulkActions, children, height, itemCount, selectedItemsCount, loading, emptyState, ...props }: IndexTableProps): JSX.Element;
|
|
8
|
+
({ bulkActions, children, height, itemCount, selectedItemsCount, loading, emptyState, selectableItemsCount, ...props }: IndexTableProps): JSX.Element;
|
|
8
9
|
Cell: React.NamedExoticComponent<import("polaris-glints/build/ts/latest/src/components/IndexTable").CellProps>;
|
|
9
10
|
Row: ({ children, ...props }: import("polaris-glints").RowProps) => JSX.Element;
|
|
10
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["bulkActions", "children", "height", "itemCount", "selectedItemsCount", "loading", "emptyState"],
|
|
3
|
+
var _excluded = ["bulkActions", "children", "height", "itemCount", "selectedItemsCount", "loading", "emptyState", "selectableItemsCount"],
|
|
4
4
|
_excluded2 = ["checked", "onChange"];
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Cell, IndexTable as PolarisIndexTable } from 'polaris-glints';
|
|
@@ -17,6 +17,7 @@ var IndexTable = function IndexTable(_ref) {
|
|
|
17
17
|
selectedItemsCount = _ref.selectedItemsCount,
|
|
18
18
|
loading = _ref.loading,
|
|
19
19
|
emptyState = _ref.emptyState,
|
|
20
|
+
selectableItemsCount = _ref.selectableItemsCount,
|
|
20
21
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21
22
|
var renderCheckboxHeader = function renderCheckboxHeader(_ref2) {
|
|
22
23
|
var checked = _ref2.checked,
|
|
@@ -25,7 +26,8 @@ var IndexTable = function IndexTable(_ref) {
|
|
|
25
26
|
return /*#__PURE__*/React.createElement(CheckboxCellContentContainer, null, /*#__PURE__*/React.createElement(Checkbox, _extends({
|
|
26
27
|
onChange: onChange,
|
|
27
28
|
checked: checked,
|
|
28
|
-
isPadded: false
|
|
29
|
+
isPadded: false,
|
|
30
|
+
disabled: props.disabled || selectableItemsCount === 0
|
|
29
31
|
}, props)));
|
|
30
32
|
};
|
|
31
33
|
var checkbox = !loading && itemCount > 0 ? renderCheckboxHeader : undefined;
|
|
@@ -11,7 +11,7 @@ var _spacing = require("../utilities/spacing");
|
|
|
11
11
|
var StyledContainer = _styledComponents["default"].div.withConfig({
|
|
12
12
|
displayName: "CheckboxStyle__StyledContainer",
|
|
13
13
|
componentId: "sc-a9bf1h-0"
|
|
14
|
-
})(["flex-direction:row;align-items:flex-start;gap:8px;color:", ";label{cursor:pointer;margin-top:-1px;}svg{border-radius:4px;position:absolute;height:20px;width:20px;top:0;left:0;opacity:0;pointer-events:none;fill:", ";}&[data-spacing='true']{padding:", " 0px;}&[aria-disabled='true'],&[aria-disabled='true'] .help-text{color:", ";}&[aria-disabled='true'] div[role='checkbox']{border-color:", ";background:", ";}&[aria-disabled='true'] svg{background:", ";fill:", ";}&[data-error='true'] svg{fill:", ";}"], _colors.Neutral.B18, _colors.Blue.S99, _spacing.space4, _colors.Neutral.B68, _colors.Neutral.B85, _colors.Neutral.B95, _colors.Neutral.B68, _colors.Neutral.B95, _colors.Red.B93);
|
|
14
|
+
})(["flex-direction:row;align-items:flex-start;gap:8px;color:", ";label{cursor:pointer;margin-top:-1px;}svg{border-radius:4px;position:absolute;height:20px;width:20px;top:0;left:0;opacity:0;pointer-events:none;fill:", ";}&[data-spacing='true']{padding:", " 0px;}&[aria-disabled='true'],&[aria-disabled='true'] .help-text{color:", ";}&[aria-disabled='true'] div[role='checkbox']{border-color:", ";background:", ";cursor:not-allowed;}&[aria-disabled='true'] input{cursor:not-allowed;}&[aria-disabled='true'] svg{background:", ";fill:", ";}&[data-error='true'] svg{fill:", ";}"], _colors.Neutral.B18, _colors.Blue.S99, _spacing.space4, _colors.Neutral.B68, _colors.Neutral.B85, _colors.Neutral.B95, _colors.Neutral.B68, _colors.Neutral.B95, _colors.Red.B93);
|
|
15
15
|
exports.StyledContainer = StyledContainer;
|
|
16
16
|
var StyledCheckboxContainer = _styledComponents["default"].div.withConfig({
|
|
17
17
|
displayName: "CheckboxStyle__StyledCheckboxContainer",
|
|
@@ -21,7 +21,7 @@ exports.StyledCheckboxContainer = StyledCheckboxContainer;
|
|
|
21
21
|
var StyledCheckbox = _styledComponents["default"].div.withConfig({
|
|
22
22
|
displayName: "CheckboxStyle__StyledCheckbox",
|
|
23
23
|
componentId: "sc-a9bf1h-2"
|
|
24
|
-
})(["width:20px;height:20px;background:", ";border:2px solid;border-color:", ";cursor:pointer;border-radius:", "
|
|
24
|
+
})(["width:20px;height:20px;background:", ";border:2px solid;border-color:", ";cursor:pointer;border-radius:", ";position:relative;& input{opacity:0;cursor:pointer;width:24px;height:24px;margin:0;padding:0;position:absolute;top:-4px;left:-4px;}&[data-focus='true']{box-shadow:0px 0px 0px 1px ", ",0px 0px 0px 3px #6ac9ec;}&[aria-checked='true'] + svg,&[aria-checked='mixed'] + svg{opacity:1;}@media (max-width:", "){width:18px;height:18px;}"], _colors.Neutral.B100, function (_ref) {
|
|
25
25
|
var hasError = _ref.hasError;
|
|
26
26
|
return hasError ? _colors.Red.B93 : _colors.Neutral.B68;
|
|
27
27
|
}, _borderRadius.borderRadius4, _colors.Neutral.B100, _.Breakpoints.large);
|
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { IndexTableProps as PolarisIndexTableProps } from 'polaris-glints';
|
|
3
3
|
declare type IndexTableProps = Omit<PolarisIndexTableProps, 'emptySearchTitle'> & {
|
|
4
4
|
height?: string;
|
|
5
|
+
selectableItemsCount?: number;
|
|
5
6
|
};
|
|
6
7
|
declare const IndexTable: {
|
|
7
|
-
({ bulkActions, children, height, itemCount, selectedItemsCount, loading, emptyState, ...props }: IndexTableProps): JSX.Element;
|
|
8
|
+
({ bulkActions, children, height, itemCount, selectedItemsCount, loading, emptyState, selectableItemsCount, ...props }: IndexTableProps): JSX.Element;
|
|
8
9
|
Cell: React.NamedExoticComponent<import("polaris-glints/build/ts/latest/src/components/IndexTable").CellProps>;
|
|
9
10
|
Row: ({ children, ...props }: import("polaris-glints").RowProps) => JSX.Element;
|
|
10
11
|
};
|
|
@@ -13,7 +13,7 @@ var _Row = require("./components/Row/Row");
|
|
|
13
13
|
var _IndexTableStyle = require("./IndexTableStyle");
|
|
14
14
|
var _LoadingState = require("./components/LoadingState");
|
|
15
15
|
var _CheckboxStyle = require("./components/Checkbox/CheckboxStyle");
|
|
16
|
-
var _excluded = ["bulkActions", "children", "height", "itemCount", "selectedItemsCount", "loading", "emptyState"],
|
|
16
|
+
var _excluded = ["bulkActions", "children", "height", "itemCount", "selectedItemsCount", "loading", "emptyState", "selectableItemsCount"],
|
|
17
17
|
_excluded2 = ["checked", "onChange"];
|
|
18
18
|
var IndexTable = function IndexTable(_ref) {
|
|
19
19
|
var bulkActions = _ref.bulkActions,
|
|
@@ -23,6 +23,7 @@ var IndexTable = function IndexTable(_ref) {
|
|
|
23
23
|
selectedItemsCount = _ref.selectedItemsCount,
|
|
24
24
|
loading = _ref.loading,
|
|
25
25
|
emptyState = _ref.emptyState,
|
|
26
|
+
selectableItemsCount = _ref.selectableItemsCount,
|
|
26
27
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
27
28
|
var renderCheckboxHeader = function renderCheckboxHeader(_ref2) {
|
|
28
29
|
var checked = _ref2.checked,
|
|
@@ -31,7 +32,8 @@ var IndexTable = function IndexTable(_ref) {
|
|
|
31
32
|
return /*#__PURE__*/_react["default"].createElement(_CheckboxStyle.CheckboxCellContentContainer, null, /*#__PURE__*/_react["default"].createElement(_Checkbox.Checkbox, (0, _extends2["default"])({
|
|
32
33
|
onChange: onChange,
|
|
33
34
|
checked: checked,
|
|
34
|
-
isPadded: false
|
|
35
|
+
isPadded: false,
|
|
36
|
+
disabled: props.disabled || selectableItemsCount === 0
|
|
35
37
|
}, props)));
|
|
36
38
|
};
|
|
37
39
|
var checkbox = !loading && itemCount > 0 ? renderCheckboxHeader : undefined;
|