@activecollab/components 1.0.252 → 1.0.254
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/dist/cjs/components/Autocomplete/Autocomplete.js +8 -2
- package/dist/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/dist/cjs/components/Autocomplete/Styles.js +2 -11
- package/dist/cjs/components/Autocomplete/Styles.js.map +1 -1
- package/dist/cjs/components/Tables/Styles.js +15 -8
- package/dist/cjs/components/Tables/Styles.js.map +1 -1
- package/dist/cjs/components/Tables/Table.js +4 -1
- package/dist/cjs/components/Tables/Table.js.map +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +8 -2
- package/dist/esm/components/Autocomplete/Autocomplete.js.map +1 -1
- package/dist/esm/components/Autocomplete/Styles.d.ts +0 -1
- package/dist/esm/components/Autocomplete/Styles.d.ts.map +1 -1
- package/dist/esm/components/Autocomplete/Styles.js +1 -9
- package/dist/esm/components/Autocomplete/Styles.js.map +1 -1
- package/dist/esm/components/Tables/Styles.d.ts +3 -1
- package/dist/esm/components/Tables/Styles.d.ts.map +1 -1
- package/dist/esm/components/Tables/Styles.js +15 -8
- package/dist/esm/components/Tables/Styles.js.map +1 -1
- package/dist/esm/components/Tables/Table.d.ts +3 -1
- package/dist/esm/components/Tables/Table.d.ts.map +1 -1
- package/dist/esm/components/Tables/Table.js +4 -1
- package/dist/esm/components/Tables/Table.js.map +1 -1
- package/dist/index.js +25 -19
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const StyledTableHead: import("styled-components").StyledComponent<"thead", any, {
|
|
1
|
+
export declare const StyledTableHead: import("styled-components").StyledComponent<"thead", any, {
|
|
2
|
+
$headerVariant: "primary" | "secondary";
|
|
3
|
+
}, never>;
|
|
2
4
|
export declare const StyledTableBody: import("styled-components").StyledComponent<"tbody", any, {}, never>;
|
|
3
5
|
export declare const StyledTableWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
6
|
export declare const StyledTable: import("styled-components").StyledComponent<"table", any, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Tables/Styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Tables/Styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;oBACV,SAAS,GAAG,WAAW;SA6CxC,CAAC;AAGF,eAAO,MAAM,eAAe,sEAsB3B,CAAC;AAGF,eAAO,MAAM,kBAAkB,oEAY9B,CAAC;AAGF,eAAO,MAAM,WAAW;cACZ,OAAO;SAyBlB,CAAC;AAGF,eAAO,MAAM,eAAe,oEA8L3B,CAAC"}
|
|
@@ -4,20 +4,27 @@ import { FontStyle } from "../FontStyle";
|
|
|
4
4
|
export var StyledTableHead = styled.thead.withConfig({
|
|
5
5
|
displayName: "Styles__StyledTableHead",
|
|
6
6
|
componentId: "sc-e16t6w-0"
|
|
7
|
-
})(["", " ", " ", "
|
|
7
|
+
})(["", " ", " ", " ", " ", " ", ""], FontStyle, BoxSizingStyle, {
|
|
8
8
|
"textAlign": "left",
|
|
9
9
|
"textTransform": "uppercase"
|
|
10
10
|
}, {
|
|
11
|
-
"whiteSpace": "nowrap",
|
|
12
|
-
"paddingLeft": "1rem",
|
|
13
|
-
"paddingRight": "1rem",
|
|
14
|
-
"paddingBottom": "2rem",
|
|
15
|
-
"paddingTop": "0.5rem",
|
|
16
11
|
"color": "var(--color-theme-700)",
|
|
17
12
|
"fontWeight": "600",
|
|
18
13
|
"fontSize": "0.6875rem"
|
|
19
|
-
}, {
|
|
20
|
-
"
|
|
14
|
+
}, function (props) {
|
|
15
|
+
return props.$headerVariant && props.$headerVariant === "primary" && css(["th{", "}tr{td:first-child,th:first-child{", "}}"], {
|
|
16
|
+
"whiteSpace": "nowrap",
|
|
17
|
+
"paddingLeft": "1rem",
|
|
18
|
+
"paddingRight": "1rem",
|
|
19
|
+
"paddingBottom": "2rem",
|
|
20
|
+
"paddingTop": "0.5rem"
|
|
21
|
+
}, {
|
|
22
|
+
"paddingLeft": "1.5rem"
|
|
23
|
+
});
|
|
24
|
+
}, function (props) {
|
|
25
|
+
return props.$headerVariant && props.$headerVariant === "secondary" && css(["th{", "}tr{th{padding-bottom:8px;padding-left:16px;}}tr{th:last-child{padding-right:16px;}}"], {
|
|
26
|
+
"whiteSpace": "nowrap"
|
|
27
|
+
});
|
|
21
28
|
});
|
|
22
29
|
StyledTableHead.displayName = "StyledTableHead";
|
|
23
30
|
export var StyledTableBody = styled.tbody.withConfig({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","StyledTableHead","thead","displayName","StyledTableBody","tbody","StyledTableWrapper","div","StyledTable","table","
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","StyledTableHead","thead","props","$headerVariant","displayName","StyledTableBody","tbody","StyledTableWrapper","div","StyledTable","table","$striped","StyledDataTable"],"sources":["../../../../src/components/Tables/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const StyledTableHead = styled.thead<{\n $headerVariant: \"primary\" | \"secondary\";\n}>`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`tw-text-left tw-uppercase`}\n ${tw`tw-text-theme-700 tw-font-semibold tw-text-xxs`}\n\n ${(props) =>\n props.$headerVariant &&\n props.$headerVariant === \"primary\" &&\n css`\n th {\n ${tw`tw-whitespace-nowrap tw-pl-4 tw-pr-4 tw-pb-8 tw-pt-2`}\n }\n\n tr {\n td:first-child,\n th:first-child {\n ${tw`tw-pl-6`}\n }\n }\n `}\n\n ${(props) =>\n props.$headerVariant &&\n props.$headerVariant === \"secondary\" &&\n css`\n th {\n ${tw`tw-whitespace-nowrap`}\n }\n\n tr {\n th {\n padding-bottom: 8px;\n padding-left: 16px;\n }\n }\n\n tr {\n th:last-child {\n padding-right: 16px;\n }\n }\n `}\n`;\nStyledTableHead.displayName = \"StyledTableHead\";\n\nexport const StyledTableBody = styled.tbody`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`tw-truncate`}\n\n td {\n ${tw`tw-truncate`}\n }\n\n &:not(.c-table__grouped__head) {\n td {\n ${tw`tw-text-theme-700`}\n }\n }\n\n a {\n ${tw`tw-no-underline tw-text-primary`}\n &:hover {\n ${tw`tw-underline`}\n }\n }\n`;\nStyledTableBody.displayName = \"StyledTableBody\";\n\nexport const StyledTableWrapper = styled.div`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`tw-mt-8 tw-mx-4 tw-overflow-x-auto tw-overflow-y-hidden`}\n\n &:before {\n ${tw`tw-absolute tw-left-0 tw-right-0 tw-bottom-0 tw-bg-page-paper-main tw-rounded-lg tw-shadow-lg`}\n content: \"\";\n top: 39px;\n z-index: -1;\n }\n`;\nStyledTableWrapper.displayName = \"StyledTableWrapper\";\n\nexport const StyledTable = styled.table<{\n $striped: boolean;\n}>`\n ${tw`tw-w-full tw-p-0 tw-text-xs tw-pb-4`}\n border-spacing: 0;\n\n ${StyledTableHead} tr th,\n ${StyledTableBody} tr td {\n &:last-child {\n ${tw`tw-text-right`}\n }\n }\n\n td {\n ${tw`tw-py-3 tw-px-4`}\n }\n\n ${(props) =>\n props.$striped &&\n css`\n ${StyledTableBody}:not(.c-table__grouped__head) {\n tr:nth-child(odd) {\n ${tw`tw-bg-theme-200`}\n }\n }\n `}\n`;\nStyledTable.displayName = \"StyledTable\";\n\nexport const StyledDataTable = styled.div`\n ${FontStyle}\n ${BoxSizingStyle}\n\n &.c-table__collapsible {\n .c-table__head {\n tr {\n th {\n position: sticky;\n top: 0;\n z-index: 1;\n }\n }\n }\n }\n &.c-table__grouped {\n .c-table__head th {\n ${tw`tw-pb-4`}\n &:last-child {\n ${tw`tw-pr-0`}\n }\n }\n }\n &.c-data-table {\n position: relative;\n .c-table__head th {\n &:last-child {\n ${tw`tw-pr-0`}\n }\n }\n }\n .c-table__cell {\n ${tw`tw-relative`}\n &:hover {\n .c-table__icon {\n ${tw`tw-opacity-50`}\n }\n }\n }\n .c-table__overlay {\n ${tw`tw-absolute tw-w-full tw-left-0 tw-pointer-events-none`}\n top: 0px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n background: rgba(0, 0, 0, 0.02);\n .neon & {\n background: rgba(0, 0, 0, 0.1);\n }\n z-index: 5;\n }\n .c-table__icon-wrapper {\n ${tw`tw-inline-block tw-select-none`}\n }\n .c-table__label {\n ${tw`tw-border-0 tw-border-0 tw-border-transparent tw-border-solid`}\n }\n .c-table__icon {\n transform: translateY(1px);\n ${tw`tw-ml-1`}\n fill: var(--color-theme-900);\n\n &:hover {\n ${tw`tw-opacity-100`}\n }\n }\n .c-table__icon--inactive {\n ${tw`tw-opacity-0`}\n }\n .c-table__icon--active {\n ${tw`tw-opacity-100`}\n }\n .c-table__icon--desc {\n transform: rotate(-180deg) scale(-1, 1);\n }\n .c-table__grouped__head {\n ${tw`tw-font-bold`}\n > :first-child {\n ${tw`tw-text-theme-900`}\n }\n a:first-child {\n ${tw`tw-text-primary`}\n }\n }\n .c-table__head--hidden {\n ${tw`tw-pointer-events-none tw-opacity-0`}\n }\n .c-table__collapse_icon--expanded {\n transition-duration: 0.3s;\n ${tw`tw-cursor-pointer`}\n }\n .c-table__collapse_icon--collapsed {\n transform: rotate(180deg);\n transition-duration: 0.3s;\n ${tw`tw-cursor-pointer`}\n }\n .c-table__head__icon-wrapper__icon {\n ${tw`tw-absolute tw-cursor-pointer`}\n transform: translate(-24px, -5px);\n }\n &.c-table__collapsible {\n .c-table__group {\n .c-table__row:last-child .c-table__cell {\n border-bottom: 1px solid var(--border-primary);\n }\n &:last-child {\n .c-table__row:last-child .c-table__cell {\n border-bottom: 0;\n }\n }\n }\n .c-table__grouped__head {\n tr td {\n border-bottom: 1px solid var(--border-primary);\n }\n .c-table__body__collapse td {\n border-bottom: 0;\n }\n &.last {\n tr td {\n border-bottom: 0 !important;\n }\n }\n }\n .c-table__grouped__head--expanded {\n tr:last-child td {\n border-bottom: 0;\n }\n }\n }\n .c-table__collapse_body {\n tr {\n background-color: transparent !important;\n }\n td:last-child {\n ${tw`tw-border-0`}\n }\n ${tw`tw-absolute`}\n }\n .c-table__row {\n td:first-child {\n position: sticky;\n left: 0;\n z-index: 1;\n }\n &:nth-child(odd) {\n td {\n ${tw`tw-bg-theme-200`}\n }\n }\n &:nth-child(even) {\n td {\n ${tw`tw-bg-page-paper-main`}\n }\n }\n }\n .c-table__row {\n th:first-child {\n position: sticky;\n left: 0;\n z-index: 2 !important;\n }\n }\n &.c-table__collapsible .c-table__body {\n tr {\n td:first-child,\n th:first-child {\n ${tw`tw-pl-6`}\n }\n }\n }\n .c-table__body__icon {\n ${tw`tw-p-0`}\n padding-left: 0 !important;\n transform: translateY(8px);\n }\n &.padding-b-0 {\n ${tw`tw-pb-0`}\n }\n .cursor-pointer {\n ${tw`tw-cursor-pointer`}\n }\n .text-center {\n ${tw`tw-text-center`}\n }\n .opacity-75 {\n ${tw`tw-opacity-75`}\n }\n .hidden {\n ${tw`tw-hidden`}\n }\n`;\nStyledDataTable.displayName = \"StyledDataTable\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAExC,OAAO,IAAMC,eAAe,GAAGJ,MAAM,CAACK,KAAK;EAAA;EAAA;AAAA,sCAGvCF,SAAS,EACTD,cAAc,EAEZ;EAAA;EAAA;AAA0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K,CAACS,QAAQ,IACdd,GAAG,iEACCQ,eAAe,EAET;IAAA;EAAgB,CAAC,CAG1B;AAAA,EACJ;AACDI,WAAW,CAACL,WAAW,GAAG,aAAa;AAEvC,OAAO,IAAMQ,eAAe,GAAGhB,MAAM,CAACY,GAAG;EAAA;EAAA;AAAA,+7DACrCT,SAAS,EACTD,cAAc,EAeR;EAAA;AAAQ,CAAC,EAEP;EAAA;AAAQ,CAAC,EAQT;EAAA;AAAQ,CAAC,EAKb;EAAA;AAAY,CAAC,EAGT;EAAA;AAAc,CAAC,EAKnB;EAAA;EAAA;EAAA;EAAA;AAAuD,CAAC,EAWxD;EAAA;EAAA;AAA+B,CAAC,EAGhC;EAAA;EAAA;EAAA;AAA8D,CAAC,EAI/D;EAAA;AAAQ,CAAC,EAIP;EAAA;AAAe,CAAC,EAIlB;EAAA;AAAa,CAAC,EAGd;EAAA;AAAe,CAAC,EAMhB;EAAA;AAAa,CAAC,EAEZ;EAAA;AAAkB,CAAC,EAGnB;EAAA;AAAgB,CAAC,EAInB;EAAA;EAAA;AAAoC,CAAC,EAIrC;EAAA;AAAkB,CAAC,EAKnB;EAAA;AAAkB,CAAC,EAGnB;EAAA;EAAA;AAA8B,CAAC,EAsC7B;EAAA;AAAY,CAAC,EAEf;EAAA;AAAY,CAAC,EAUT;EAAA;AAAgB,CAAC,EAKjB;EAAA;AAAsB,CAAC,EAevB;EAAA;AAAQ,CAAC,EAKb;EAAA;AAAO,CAAC,EAKR;EAAA;AAAQ,CAAC,EAGT;EAAA;AAAkB,CAAC,EAGnB;EAAA;AAAe,CAAC,EAGhB;EAAA;AAAc,CAAC,EAGf;EAAA;AAAU,CAAC,CAElB;AACDc,eAAe,CAACR,WAAW,GAAG,iBAAiB"}
|
|
@@ -14,6 +14,8 @@ export interface ITableProps {
|
|
|
14
14
|
innerRef?: RefObject<HTMLTableElement>;
|
|
15
15
|
}
|
|
16
16
|
export declare const Table: FC<ITableProps & ITableWithChildren>;
|
|
17
|
-
export declare const Thead: FC<ITableWithChildren
|
|
17
|
+
export declare const Thead: FC<ITableWithChildren & {
|
|
18
|
+
headerVariant?: "primary" | "secondary";
|
|
19
|
+
}>;
|
|
18
20
|
export declare const Tbody: FC<ITableWithChildren>;
|
|
19
21
|
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/Tables/Table.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASxD,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,WAAW,GAAG,kBAAkB,CAiBtD,CAAC;AAIF,eAAO,MAAM,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/Tables/Table.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASxD,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,WAAW,GAAG,kBAAkB,CAiBtD,CAAC;AAIF,eAAO,MAAM,KAAK,EAAE,EAAE,CACpB,kBAAkB,GAAG;IAAE,aAAa,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,CAQjE,CAAC;AAIF,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAIxC,CAAC"}
|
|
@@ -18,8 +18,11 @@ export var Table = function Table(_ref) {
|
|
|
18
18
|
Table.displayName = "Table";
|
|
19
19
|
export var Thead = function Thead(_ref2) {
|
|
20
20
|
var children = _ref2.children,
|
|
21
|
-
className = _ref2.className
|
|
21
|
+
className = _ref2.className,
|
|
22
|
+
_ref2$headerVariant = _ref2.headerVariant,
|
|
23
|
+
headerVariant = _ref2$headerVariant === void 0 ? "primary" : _ref2$headerVariant;
|
|
22
24
|
return /*#__PURE__*/React.createElement(StyledTableHead, {
|
|
25
|
+
$headerVariant: headerVariant,
|
|
23
26
|
className: classNames("c-table__head", className)
|
|
24
27
|
}, children);
|
|
25
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","names":["React","classNames","StyledTableWrapper","StyledTable","StyledTableBody","StyledTableHead","Table","children","className","striped","innerRef","displayName","Thead","Tbody"],"sources":["../../../../src/components/Tables/Table.tsx"],"sourcesContent":["import React, { ReactNode, FC, RefObject } from \"react\";\nimport classNames from \"classnames\";\nimport {\n StyledTableWrapper,\n StyledTable,\n StyledTableBody,\n StyledTableHead,\n} from \"./Styles\";\n\nexport interface ITableWithChildren {\n /** Children prop can be ReactNode. */\n children: ReactNode;\n /** Classname prop for custom styling. */\n className?: string;\n}\n\nexport interface ITableProps {\n /** Darker color on odd column. */\n striped?: boolean;\n /** CSS classes. */\n className?: string;\n /** Ref object for table. */\n innerRef?: RefObject<HTMLTableElement>;\n}\n\nexport const Table: FC<ITableProps & ITableWithChildren> = ({\n children,\n className,\n striped = false,\n innerRef,\n}) => {\n return (\n <StyledTableWrapper className=\"c-table__wrap\">\n <StyledTable\n ref={innerRef}\n className={classNames(\"c-table\", className)}\n $striped={striped}\n >\n {children}\n </StyledTable>\n </StyledTableWrapper>\n );\n};\n\nTable.displayName = \"Table\";\n\nexport const Thead: FC
|
|
1
|
+
{"version":3,"file":"Table.js","names":["React","classNames","StyledTableWrapper","StyledTable","StyledTableBody","StyledTableHead","Table","children","className","striped","innerRef","displayName","Thead","headerVariant","Tbody"],"sources":["../../../../src/components/Tables/Table.tsx"],"sourcesContent":["import React, { ReactNode, FC, RefObject } from \"react\";\nimport classNames from \"classnames\";\nimport {\n StyledTableWrapper,\n StyledTable,\n StyledTableBody,\n StyledTableHead,\n} from \"./Styles\";\n\nexport interface ITableWithChildren {\n /** Children prop can be ReactNode. */\n children: ReactNode;\n /** Classname prop for custom styling. */\n className?: string;\n}\n\nexport interface ITableProps {\n /** Darker color on odd column. */\n striped?: boolean;\n /** CSS classes. */\n className?: string;\n /** Ref object for table. */\n innerRef?: RefObject<HTMLTableElement>;\n}\n\nexport const Table: FC<ITableProps & ITableWithChildren> = ({\n children,\n className,\n striped = false,\n innerRef,\n}) => {\n return (\n <StyledTableWrapper className=\"c-table__wrap\">\n <StyledTable\n ref={innerRef}\n className={classNames(\"c-table\", className)}\n $striped={striped}\n >\n {children}\n </StyledTable>\n </StyledTableWrapper>\n );\n};\n\nTable.displayName = \"Table\";\n\nexport const Thead: FC<\n ITableWithChildren & { headerVariant?: \"primary\" | \"secondary\" }\n> = ({ children, className, headerVariant = \"primary\" }) => (\n <StyledTableHead\n $headerVariant={headerVariant}\n className={classNames(\"c-table__head\", className)}\n >\n {children}\n </StyledTableHead>\n);\n\nThead.displayName = \"Thead\";\n\nexport const Tbody: FC<ITableWithChildren> = ({ children, className }) => (\n <StyledTableBody className={classNames(\"c-table__body\", className)}>\n {children}\n </StyledT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
|
@@ -8193,20 +8193,27 @@
|
|
|
8193
8193
|
var StyledTableHead = styled__default["default"].thead.withConfig({
|
|
8194
8194
|
displayName: "Styles__StyledTableHead",
|
|
8195
8195
|
componentId: "sc-e16t6w-0"
|
|
8196
|
-
})(["", " ", " ", "
|
|
8196
|
+
})(["", " ", " ", " ", " ", " ", ""], FontStyle, BoxSizingStyle, {
|
|
8197
8197
|
"textAlign": "left",
|
|
8198
8198
|
"textTransform": "uppercase"
|
|
8199
8199
|
}, {
|
|
8200
|
-
"whiteSpace": "nowrap",
|
|
8201
|
-
"paddingLeft": "1rem",
|
|
8202
|
-
"paddingRight": "1rem",
|
|
8203
|
-
"paddingBottom": "2rem",
|
|
8204
|
-
"paddingTop": "0.5rem",
|
|
8205
8200
|
"color": "var(--color-theme-700)",
|
|
8206
8201
|
"fontWeight": "600",
|
|
8207
8202
|
"fontSize": "0.6875rem"
|
|
8208
|
-
}, {
|
|
8209
|
-
"
|
|
8203
|
+
}, function (props) {
|
|
8204
|
+
return props.$headerVariant && props.$headerVariant === "primary" && styled.css(["th{", "}tr{td:first-child,th:first-child{", "}}"], {
|
|
8205
|
+
"whiteSpace": "nowrap",
|
|
8206
|
+
"paddingLeft": "1rem",
|
|
8207
|
+
"paddingRight": "1rem",
|
|
8208
|
+
"paddingBottom": "2rem",
|
|
8209
|
+
"paddingTop": "0.5rem"
|
|
8210
|
+
}, {
|
|
8211
|
+
"paddingLeft": "1.5rem"
|
|
8212
|
+
});
|
|
8213
|
+
}, function (props) {
|
|
8214
|
+
return props.$headerVariant && props.$headerVariant === "secondary" && styled.css(["th{", "}tr{th{padding-bottom:8px;padding-left:16px;}}tr{th:last-child{padding-right:16px;}}"], {
|
|
8215
|
+
"whiteSpace": "nowrap"
|
|
8216
|
+
});
|
|
8210
8217
|
});
|
|
8211
8218
|
StyledTableHead.displayName = "StyledTableHead";
|
|
8212
8219
|
var StyledTableBody = styled__default["default"].tbody.withConfig({
|
|
@@ -8362,8 +8369,11 @@
|
|
|
8362
8369
|
Table.displayName = "Table";
|
|
8363
8370
|
var Thead = function Thead(_ref2) {
|
|
8364
8371
|
var children = _ref2.children,
|
|
8365
|
-
className = _ref2.className
|
|
8372
|
+
className = _ref2.className,
|
|
8373
|
+
_ref2$headerVariant = _ref2.headerVariant,
|
|
8374
|
+
headerVariant = _ref2$headerVariant === void 0 ? "primary" : _ref2$headerVariant;
|
|
8366
8375
|
return /*#__PURE__*/React__default["default"].createElement(StyledTableHead, {
|
|
8376
|
+
$headerVariant: headerVariant,
|
|
8367
8377
|
className: classNames__default["default"]("c-table__head", className)
|
|
8368
8378
|
}, children);
|
|
8369
8379
|
};
|
|
@@ -9851,17 +9861,9 @@
|
|
|
9851
9861
|
componentId: "sc-1bc1vz9-1"
|
|
9852
9862
|
})(["max-height:340px;overflow:auto;margin-bottom:6px;"]);
|
|
9853
9863
|
StyledAutocompleteBody.displayName = "StyledAutocompleteBody";
|
|
9854
|
-
var StyledAutocompleteNoResult = styled__default["default"].li.withConfig({
|
|
9855
|
-
displayName: "Styles__StyledAutocompleteNoResult",
|
|
9856
|
-
componentId: "sc-1bc1vz9-2"
|
|
9857
|
-
})(["", ";padding:6px 16px;margin:4px 0;&:hover{background-color:var(--color-theme-200);}color:var(--color-theme-600);"], {
|
|
9858
|
-
"cursor": "pointer",
|
|
9859
|
-
"userSelect": "none"
|
|
9860
|
-
});
|
|
9861
|
-
StyledAutocompleteNoResult.displayName = "StyledAutocompleteNoResult";
|
|
9862
9864
|
var StyledAutocompleteNewItem = styled__default["default"](StyledOption).withConfig({
|
|
9863
9865
|
displayName: "Styles__StyledAutocompleteNewItem",
|
|
9864
|
-
componentId: "sc-1bc1vz9-
|
|
9866
|
+
componentId: "sc-1bc1vz9-2"
|
|
9865
9867
|
})(["", ";justify-content:start;&:before{content:\"+ \";margin-right:4px;}", ""], {
|
|
9866
9868
|
"cursor": "pointer",
|
|
9867
9869
|
"userSelect": "none"
|
|
@@ -10199,7 +10201,7 @@
|
|
|
10199
10201
|
return noResultText && !showAddNew && list.length < 1;
|
|
10200
10202
|
}, [list.length, noResultText, showAddNew]);
|
|
10201
10203
|
var renderNoResult = React.useMemo(function () {
|
|
10202
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
10204
|
+
return /*#__PURE__*/React__default["default"].createElement(_StyledStyledOption, null, noResultText);
|
|
10203
10205
|
}, [noResultText]);
|
|
10204
10206
|
return /*#__PURE__*/React__default["default"].createElement(StyledAutocompleteScrollShadow, {
|
|
10205
10207
|
className: AutocompleteClassName,
|
|
@@ -10240,6 +10242,10 @@
|
|
|
10240
10242
|
});
|
|
10241
10243
|
};
|
|
10242
10244
|
Autocomplete.displayName = "Autocomplete";
|
|
10245
|
+
var _StyledStyledOption = styled__default["default"](StyledOption).withConfig({
|
|
10246
|
+
displayName: "Autocomplete___StyledStyledOption",
|
|
10247
|
+
componentId: "sc-9x4q7e-0"
|
|
10248
|
+
})(["cursor:auto"]);
|
|
10243
10249
|
|
|
10244
10250
|
var StyledInputWrapper = styled__default["default"].div.withConfig({
|
|
10245
10251
|
displayName: "Styles__StyledInputWrapper",
|