@companycam/slab-web 2.2.2 → 2.3.0
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.js +206 -203
- package/index.mjs +1211 -1222
- package/lib/Card/Card.d.ts +16 -12
- package/lib/Table/Table.d.ts +1 -1
- package/lib/shared/types.d.ts +4 -0
- package/package.json +1 -1
- package/storybook/TokenDocs/utils.d.ts +1 -0
package/lib/Card/Card.d.ts
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export type CardProps =
|
|
4
|
-
children?: ReactNode;
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { OmitProps } from '../shared/types';
|
|
3
|
+
export type CardProps = OmitProps<'div', 'onClick' | 'title'> & {
|
|
5
4
|
/** Style hook for the _interior_ card container (border, background, etc.) */
|
|
6
5
|
containerStyle?: Readonly<CSSProperties>;
|
|
7
6
|
contentAction?: ReactNode;
|
|
8
7
|
contentBefore?: ReactNode;
|
|
9
8
|
contentAfter?: ReactNode;
|
|
10
9
|
contentThumbnail?: ReactNode;
|
|
11
|
-
/** Card renders as a link */
|
|
12
|
-
href?: string;
|
|
13
|
-
/** Card renders as a button */
|
|
14
|
-
onClick?: undefined | (() => void);
|
|
15
10
|
/** Card heading */
|
|
16
11
|
title?: ReactNode;
|
|
17
|
-
}
|
|
12
|
+
} & ((OmitProps<'a', 'onClick' | 'title'> & {
|
|
13
|
+
onClick?: never;
|
|
14
|
+
}) | (OmitProps<'button', 'title'> & {
|
|
15
|
+
href?: never;
|
|
16
|
+
}));
|
|
18
17
|
/**
|
|
19
18
|
* - Flexible and composable, offering four slots for different content.
|
|
20
|
-
* - Card is BYO-spacing-between-content, to keep it as flexible as possible.
|
|
19
|
+
* - Card is BYO-spacing-between-content, to keep it as flexible as possible.
|
|
20
|
+
* Don't forget [Text](/docs/text--docs) has a `ccMargin` prop!
|
|
21
21
|
* - Can render as a div, button, or link.
|
|
22
22
|
*
|
|
23
|
-
* >
|
|
23
|
+
* > [!IMPORTANT]
|
|
24
|
+
* > **It's invalid HTML to nest buttons or links inside buttons or links.** If
|
|
25
|
+
* > you're making the whole card clickable via `href` or `onClick`, the only
|
|
26
|
+
* > valid place you can add another button or link is in the `contentAction`
|
|
27
|
+
* > slot.
|
|
24
28
|
*/
|
|
25
|
-
export declare
|
|
29
|
+
export declare const Card: ({ children, className, containerStyle, contentAction, contentAfter, contentBefore, contentThumbnail, style, title, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
30
|
export default Card;
|
package/lib/Table/Table.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { CellContext, ColumnDef, ColumnSort, OnChangeFn, Row, SortingState } from '@tanstack/react-table';
|
|
3
3
|
import { CellSize } from '../shared/types';
|
|
4
4
|
export type TableProps<T> = ComponentPropsWithRef<'table'> & {
|
|
5
5
|
defaultData: readonly T[];
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -90,3 +90,7 @@ export type PolymorphicForwardRefComponent<DefaultElement extends ElementType, P
|
|
|
90
90
|
<C extends ElementType = DefaultElement>(props: PolymorphicComponentPropsWithRef<C, Props>): ReactElement | null;
|
|
91
91
|
displayName?: string;
|
|
92
92
|
};
|
|
93
|
+
/**
|
|
94
|
+
* {@linkcode ComponentPropsWithRef}, omitting the given `Props`.
|
|
95
|
+
*/
|
|
96
|
+
export type OmitProps<Element extends ElementType, Props extends keyof ComponentPropsWithRef<Element>> = Omit<ComponentPropsWithRef<Element>, Props>;
|
package/package.json
CHANGED