@redsift/design-system 9.0.0-alpha.6 → 9.0.0-alpha.7
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/index.d.ts +8 -1
- package/index.js +31 -3
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1964,8 +1964,15 @@ declare function useFocusOnList(): UseFocusGroupProps;
|
|
|
1964
1964
|
* Component props.
|
|
1965
1965
|
*/
|
|
1966
1966
|
interface GridProps extends ComponentProps<'div'>, StylingProps, InternalSpacingProps, GridLayoutProps {
|
|
1967
|
+
/** Whether the grid has divider or not. The number of pixels defining the gap between columns and rows is mandatory. This replaces the grid gap property. */
|
|
1968
|
+
divider?: {
|
|
1969
|
+
colGap: number;
|
|
1970
|
+
rowGap: number;
|
|
1971
|
+
};
|
|
1967
1972
|
}
|
|
1968
|
-
type StyledGridProps = GridProps
|
|
1973
|
+
type StyledGridProps = GridProps & {
|
|
1974
|
+
$divider: GridProps['divider'];
|
|
1975
|
+
};
|
|
1969
1976
|
|
|
1970
1977
|
/**
|
|
1971
1978
|
* Component props.
|
package/index.js
CHANGED
|
@@ -10300,10 +10300,34 @@ const StyledGrid = styled.div`
|
|
|
10300
10300
|
} = _ref;
|
|
10301
10301
|
return inline ? 'inline-grid' : 'grid';
|
|
10302
10302
|
}};
|
|
10303
|
+
flex: 1;
|
|
10303
10304
|
|
|
10304
10305
|
${baseStyling}
|
|
10305
10306
|
${baseInternalSpacing}
|
|
10306
10307
|
${baseGrid}
|
|
10308
|
+
|
|
10309
|
+
${_ref2 => {
|
|
10310
|
+
let {
|
|
10311
|
+
$divider
|
|
10312
|
+
} = _ref2;
|
|
10313
|
+
return $divider ? css`
|
|
10314
|
+
overflow: hidden;
|
|
10315
|
+
.redsift-grid-item {
|
|
10316
|
+
margin: ${$divider.rowGap / 2}px 0 ${$divider.rowGap / 2}px -1px;
|
|
10317
|
+
padding: 0 ${$divider.colGap / 2}px;
|
|
10318
|
+
border-left: 1px solid var(--redsift-color-neutral-lightgrey);
|
|
10319
|
+
|
|
10320
|
+
::after {
|
|
10321
|
+
content: '';
|
|
10322
|
+
background-color: var(--redsift-color-neutral-lightgrey);
|
|
10323
|
+
width: calc(100% + ${$divider.colGap}px);
|
|
10324
|
+
height: 1px;
|
|
10325
|
+
margin-left: -${$divider.colGap / 2}px;
|
|
10326
|
+
margin-top: ${$divider.rowGap / 2}px;
|
|
10327
|
+
}
|
|
10328
|
+
}
|
|
10329
|
+
` : '';
|
|
10330
|
+
}}
|
|
10307
10331
|
`;
|
|
10308
10332
|
|
|
10309
10333
|
/**
|
|
@@ -10339,7 +10363,7 @@ GridItem.className = CLASSNAME$b;
|
|
|
10339
10363
|
GridItem.defaultProps = DEFAULT_PROPS$b;
|
|
10340
10364
|
GridItem.displayName = COMPONENT_NAME$b;
|
|
10341
10365
|
|
|
10342
|
-
const _excluded$c = ["children", "className"];
|
|
10366
|
+
const _excluded$c = ["children", "className", "divider", "gap"];
|
|
10343
10367
|
const COMPONENT_NAME$a = 'Grid';
|
|
10344
10368
|
const CLASSNAME$a = 'redsift-grid';
|
|
10345
10369
|
const DEFAULT_PROPS$a = {};
|
|
@@ -10350,12 +10374,16 @@ const DEFAULT_PROPS$a = {};
|
|
|
10350
10374
|
const BaseGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
10351
10375
|
const {
|
|
10352
10376
|
children,
|
|
10353
|
-
className
|
|
10377
|
+
className,
|
|
10378
|
+
divider,
|
|
10379
|
+
gap
|
|
10354
10380
|
} = props,
|
|
10355
10381
|
forwardedProps = _objectWithoutProperties(props, _excluded$c);
|
|
10356
10382
|
return /*#__PURE__*/React__default.createElement(StyledGrid, _extends$1({}, forwardedProps, {
|
|
10383
|
+
gap: divider ? undefined : gap,
|
|
10357
10384
|
className: classNames(BaseGrid.className, className),
|
|
10358
|
-
ref: ref
|
|
10385
|
+
ref: ref,
|
|
10386
|
+
$divider: divider
|
|
10359
10387
|
}), children);
|
|
10360
10388
|
});
|
|
10361
10389
|
BaseGrid.className = CLASSNAME$a;
|