@apify/ui-library 1.128.1 → 1.129.1
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/src/components/card_container.d.ts +5 -0
- package/dist/src/components/card_container.d.ts.map +1 -1
- package/dist/src/components/card_container.js +4 -4
- package/dist/src/components/card_container.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/card_container.stories.tsx +5 -2
- package/src/components/card_container.tsx +10 -7
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ValueOf } from '@apify-packages/types';
|
|
3
3
|
import { type BoxProps } from './box.js';
|
|
4
|
+
export declare const cardContainerClassNames: {
|
|
5
|
+
CONTENT: string;
|
|
6
|
+
HEADER: string;
|
|
7
|
+
};
|
|
4
8
|
declare const HEADER_PLACEMENT: {
|
|
5
9
|
readonly TOP: "TOP";
|
|
6
10
|
readonly BOTTOM: "BOTTOM";
|
|
@@ -11,6 +15,7 @@ export type CardContainerProps = BoxProps & {
|
|
|
11
15
|
/**
|
|
12
16
|
* If string is passed, the correct styles are applied automatically.
|
|
13
17
|
* In case of custom component, use `CardContainer.Heading` component to get the same styles.
|
|
18
|
+
* Pass `null` to render without a header section.
|
|
14
19
|
*/
|
|
15
20
|
header: React.ReactNode;
|
|
16
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card_container.d.ts","sourceRoot":"","sources":["../../../src/components/card_container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"card_container.d.ts","sourceRoot":"","sources":["../../../src/components/card_container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,uBAAuB;;;CAGnC,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;CAGZ,CAAC;AA8BX,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG;IACxC,wEAAwE;IACxE,eAAe,CAAC,EAAE,OAAO,CAAC,OAAO,gBAAgB,CAAC,CAAC;IACnD;;;;OAIG;IACH,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa;qDAKvB,kBAAkB;;CAWpB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { theme } from '../design_system/theme.js';
|
|
4
4
|
import { Box } from './box.js';
|
|
5
|
-
const
|
|
5
|
+
export const cardContainerClassNames = {
|
|
6
6
|
CONTENT: 'CardContainer-Content',
|
|
7
7
|
HEADER: 'CardContainer-Header',
|
|
8
8
|
};
|
|
@@ -19,7 +19,7 @@ const Wrapper = styled(Box) `
|
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: ${({ $headerPlacement }) => ($headerPlacement === HEADER_PLACEMENT.TOP ? 'column' : 'column-reverse')};
|
|
21
21
|
|
|
22
|
-
.${
|
|
22
|
+
.${cardContainerClassNames.CONTENT} {
|
|
23
23
|
/* Inner radius = outer radius - padding */
|
|
24
24
|
border-radius: calc(${theme.radius.radius12} - ${theme.space.space2});
|
|
25
25
|
background-color: ${theme.color.neutral.background};
|
|
@@ -28,7 +28,7 @@ const Wrapper = styled(Box) `
|
|
|
28
28
|
flex-grow: 1;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.${
|
|
31
|
+
.${cardContainerClassNames.HEADER} {
|
|
32
32
|
padding: ${theme.space.space4} ${theme.space.space8};
|
|
33
33
|
display: flex;
|
|
34
34
|
justify-content: space-between;
|
|
@@ -41,6 +41,6 @@ const CardContainerHeading = styled.span `${theme.typography.shared.desktop.body
|
|
|
41
41
|
*
|
|
42
42
|
* The header can be customized.
|
|
43
43
|
*/
|
|
44
|
-
export const CardContainer = ({ children, header, headerPlacement = HEADER_PLACEMENT.TOP, ...rest }) => (_jsxs(Wrapper, { ...rest, "$headerPlacement": headerPlacement, children: [_jsx("div", { className:
|
|
44
|
+
export const CardContainer = ({ children, header, headerPlacement = HEADER_PLACEMENT.TOP, ...rest }) => (_jsxs(Wrapper, { ...rest, "$headerPlacement": headerPlacement, children: [header != null && (_jsx("div", { className: cardContainerClassNames.HEADER, children: typeof header === 'string' ? _jsx(CardContainerHeading, { children: header }) : header })), _jsx("div", { className: cardContainerClassNames.CONTENT, children: children })] }));
|
|
45
45
|
CardContainer.Heading = CardContainerHeading;
|
|
46
46
|
//# sourceMappingURL=card_container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card_container.js","sourceRoot":"","sources":["../../../src/components/card_container.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAIvC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,GAAG,EAAiB,MAAM,UAAU,CAAC;AAE9C,MAAM,
|
|
1
|
+
{"version":3,"file":"card_container.js","sourceRoot":"","sources":["../../../src/components/card_container.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAIvC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,GAAG,EAAiB,MAAM,UAAU,CAAC;AAE9C,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,OAAO,EAAE,uBAAuB;IAChC,MAAM,EAAE,sBAAsB;CACjC,CAAC;AAEF,MAAM,gBAAgB,G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