Skip to content

Commit

Permalink
Styling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ianvexler committed Feb 13, 2024
1 parent a05fa3e commit fbd775a
Show file tree
Hide file tree
Showing 19 changed files with 81 additions and 53 deletions.
4 changes: 2 additions & 2 deletions dist/components/list/List.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ interface ListProps extends React.HTMLProps<HTMLDivElement> {
declare const List: {
({ children, ...rest }: ListProps): React.JSX.Element;
Head: ({ className, children, ...rest }: import("./components/ListHead").ListHeadProps) => React.JSX.Element;
Cell: ({ className, children, ...rest }: import("./components/ListCell").ListCellProps) => React.JSX.Element;
Cell: ({ borderStart, className, children, ...rest }: import("./components/ListCell").ListCellProps) => React.JSX.Element;
Row: ({ children, ...rest }: import("./components/ListRow").ListRowProps) => React.JSX.Element;
Col: ({ borderStart, className, children, ...rest }: import("./components/ListCol").ListColProps) => React.JSX.Element;
Col: ({ className, children, ...rest }: import("./components/ListCol").ListColProps) => React.JSX.Element;
Body: ({ children, ...rest }: import("./components/ListBody").ListBodyProps) => React.JSX.Element;
};
export default List;
Expand Down
3 changes: 2 additions & 1 deletion dist/components/list/components/ListCell.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
export interface ListCellProps extends React.HTMLProps<HTMLDivElement> {
borderStart?: boolean;
}
declare const ListCell: ({ className, children, ...rest }: ListCellProps) => React.JSX.Element;
declare const ListCell: ({ borderStart, className, children, ...rest }: ListCellProps) => React.JSX.Element;
export default ListCell;
//# sourceMappingURL=ListCell.d.ts.map
2 changes: 1 addition & 1 deletion dist/components/list/components/ListCell.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions dist/components/list/components/ListCol.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import { ColProps } from 'react-bootstrap';
export interface ListColProps extends ColProps {
borderStart?: boolean;
}
declare const ListCol: ({ borderStart, className, children, ...rest }: ListColProps) => React.JSX.Element;
declare const ListCol: ({ className, children, ...rest }: ListColProps) => React.JSX.Element;
export default ListCol;
//# sourceMappingURL=ListCol.d.ts.map
2 changes: 1 addition & 1 deletion dist/components/list/components/ListCol.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/components/list/components/ListRow.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions dist/components/nav/components/NavItem.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
export interface NavItemProps {
route: string;
label: string;
icon: string;
}
declare const NavItem: ({ route, label, icon }: NavItemProps) => React.JSX.Element;
export default NavItem;
//# sourceMappingURL=NavItem.d.ts.map
1 change: 1 addition & 0 deletions dist/components/nav/components/NavItem.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.es.js.map

Large diffs are not rendered by default.

24 changes: 16 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22862,7 +22862,7 @@ var Card = function (_a) {

var Chip = function (_a) {
var label = _a.label, color = _a.color, rest = __rest(_a, ["label", "color"]);
return (React.createElement("h5", null,
return (React.createElement("h5", { className: "mb-0" },
React.createElement("span", __assign$1({ style: {
backgroundColor: color,
padding: '10px 15px',
Expand All @@ -22887,29 +22887,37 @@ var ListHead = function (_a) {

var ListRow = function (_a) {
var children = _a.children, rest = __rest(_a, ["children"]);
return (React.createElement(Row$1, __assign$1({ className: "text-center mt-3" }, rest), children));
var childrenArray = React.Children.toArray(children);
return (React.createElement(Row$1, __assign$1({ className: "text-center mt-3" }, rest), childrenArray.map(function (child, index) {
var childElement = child;
return React.cloneElement(childElement, {
key: index,
borderStart: index !== 0,
});
})));
};

var ListCell = function (_a) {
var className = _a.className, children = _a.children, rest = __rest(_a, ["className", "children"]);
var borderStart = _a.borderStart, className = _a.className, children = _a.children, rest = __rest(_a, ["borderStart", "className", "children"]);
var section = React.useContext(ListSectionContext);
var border = borderStart ? 'border-start' : undefined;
switch (section) {
case ListSection.HEAD:
return (React.createElement("div", __assign$1({ className: "col ".concat(className) }, rest), children));
case ListSection.BODY:
case ListSection.NONE:
default:
return (React.createElement("div", __assign$1({ className: "h-100 d-flex align-items-center ".concat(className) }, rest),
React.createElement(Card$2, { className: "h-100 w-100" },
React.createElement(Card$2.Body, { className: "d-flex justify-content-center align-items-center" },
React.createElement(Card$2, { className: "h-100 w-100 py-3" },
React.createElement(Card$2.Body, { className: "d-flex justify-content-center align-items-center py-0 ".concat(border) },
React.createElement("div", { className: "w-100" }, children)))));
}
};

var ListCol = function (_a) {
var borderStart = _a.borderStart, className = _a.className, children = _a.children, rest = __rest(_a, ["borderStart", "className", "children"]);
var border = borderStart ? 'border-start' : undefined;
return (React.createElement(Col$1, __assign$1({ className: "px-0 ".concat(border, " ").concat(className) }, rest), children));
var className = _a.className, children = _a.children, rest = __rest(_a, ["className", "children"]);
return (React.createElement(Col$1, __assign$1({ className: "px-0 ".concat(className) }, rest),
React.createElement("div", { className: "h-100 pt-3" }, children)));
};

var ListBody = function (_a) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.min.js.map

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions example/pages/ListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ const ListPage = () => {
</List.Cell>
</List.Col>

<List.Col borderStart>
<List.Cell>
<List.Col>
<List.Cell borderStart>
<Chip label="Test" color="#B8F1A6"/>
</List.Cell>
</List.Col>

<List.Col borderStart>
<List.Cell>
<List.Col>
<List.Cell borderStart>
<ProgressBar percentage={40}/>
</List.Cell>
</List.Col>

<List.Col borderStart>
<List.Cell>
<List.Col>
<List.Cell borderStart>
<p className="m-0">Test</p>
</List.Cell>
</List.Col>
Expand All @@ -84,20 +84,20 @@ const ListPage = () => {
</List.Cell>
</List.Col>

<List.Col borderStart>
<List.Cell>
<List.Col>
<List.Cell borderStart>
<Chip label="Test" color="#B8F1A6"/>
</List.Cell>
</List.Col>

<List.Col borderStart>
<List.Cell>
<List.Col>
<List.Cell borderStart>
<p className="m-0">Test</p>
</List.Cell>
</List.Col>

<List.Col borderStart>
<List.Cell>
<List.Col>
<List.Cell borderStart>
<p className="m-0">Test</p>
</List.Cell>
</List.Col>
Expand Down
2 changes: 1 addition & 1 deletion src/components/chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface ChipProps extends React.HTMLProps<HTMLSpanElement> {
}
const Chip = ({ label, color, ...rest }: ChipProps) => {
return (
<h5>
<h5 className="mb-0">
<span
style={{
backgroundColor: color,
Expand Down
18 changes: 14 additions & 4 deletions src/components/list/components/ListCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ import React, { useContext } from 'react';
import ListSectionContext, { ListSection } from '../ListSectionContext';
import { Card } from 'react-bootstrap';

export interface ListCellProps extends React.HTMLProps<HTMLDivElement> {}
export interface ListCellProps extends React.HTMLProps<HTMLDivElement> {
borderStart?: boolean;
}

const ListCell = ({ className, children, ...rest }: ListCellProps) => {
const ListCell = ({
borderStart,
className,
children,
...rest
}: ListCellProps) => {
const section = useContext(ListSectionContext);
const border = borderStart ? 'border-start' : undefined;

switch (section) {
case ListSection.HEAD:
Expand All @@ -22,8 +30,10 @@ const ListCell = ({ className, children, ...rest }: ListCellProps) => {
className={`h-100 d-flex align-items-center ${className}`}
{...rest}
>
<Card className="h-100 w-100">
<Card.Body className="d-flex justify-content-center align-items-center">
<Card className="h-100 w-100 py-3">
<Card.Body
className={`d-flex justify-content-center align-items-center py-0 ${border}`}
>
<div className="w-100">{children}</div>
</Card.Body>
</Card>
Expand Down
17 changes: 4 additions & 13 deletions src/components/list/components/ListCol.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
import React from 'react';
import { ColProps, Col } from 'react-bootstrap';

export interface ListColProps extends ColProps {
borderStart?: boolean;
}

const ListCol = ({
borderStart,
className,
children,
...rest
}: ListColProps) => {
const border = borderStart ? 'border-start' : undefined;
export interface ListColProps extends ColProps {}

const ListCol = ({ className, children, ...rest }: ListColProps) => {
return (
<Col className={`px-0 ${border} ${className}`} {...rest}>
{children}
<Col className={`px-0 ${className}`} {...rest}>
<div className={`h-100 pt-3`}>{children}</div>
</Col>
);
};
Expand Down
11 changes: 10 additions & 1 deletion src/components/list/components/ListRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@ import { RowProps, Row } from 'react-bootstrap';
export interface ListRowProps extends RowProps {}

const ListRow = ({ children, ...rest }: ListRowProps) => {
const childrenArray = React.Children.toArray(children);

return (
<Row className="text-center mt-3" {...rest}>
{children}
{childrenArray.map((child, index) => {
const childElement = child as React.ReactElement;

return React.cloneElement(childElement, {
key: index,
borderStart: index !== 0,
});
})}
</Row>
);
};
Expand Down

0 comments on commit fbd775a

Please sign in to comment.