@companycam/slab-web 2.0.7 → 2.1.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/index.js +352 -358
- package/index.mjs +2336 -2338
- package/lib/Modal/Modal.d.ts +12 -9
- package/lib/Text/Text.d.ts +0 -1
- package/lib/shared/styles.d.ts +1 -1
- package/package.json +1 -1
package/lib/Modal/Modal.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
type AsProp = keyof HTMLElementTagNameMap;
|
|
3
|
-
|
|
3
|
+
type ModalFooterProps = {
|
|
4
|
+
/** replace footer or pass `null` for no footer */
|
|
5
|
+
footerComponent?: ReactNode;
|
|
6
|
+
/** content slot for buttons in footer */
|
|
7
|
+
footerActions?: ReactNode;
|
|
8
|
+
/** content slot on left side of footer */
|
|
9
|
+
footerContentBefore?: ReactNode;
|
|
10
|
+
/** target footer container */
|
|
11
|
+
footerStyle?: CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
export type ModalProps = ModalFooterProps & {
|
|
4
14
|
isOpen: boolean;
|
|
5
15
|
onClose: () => void;
|
|
6
16
|
title: string;
|
|
@@ -16,18 +26,10 @@ export type ModalProps = {
|
|
|
16
26
|
bodyStyle?: CSSProperties;
|
|
17
27
|
/** target header container */
|
|
18
28
|
headerStyle?: CSSProperties;
|
|
19
|
-
/** target footer container */
|
|
20
|
-
footerStyle?: CSSProperties;
|
|
21
29
|
/** replace header or pass `null` for no header */
|
|
22
30
|
headerComponent?: ReactNode | null;
|
|
23
31
|
/** content slot below title in header */
|
|
24
32
|
headerContentAfter?: ReactNode;
|
|
25
|
-
/** replace footer or pass `null` for no footer */
|
|
26
|
-
footerComponent?: ReactNode | null;
|
|
27
|
-
/** content slot for buttons in footer */
|
|
28
|
-
footerActions?: ReactNode;
|
|
29
|
-
/** content slot on left side of footer */
|
|
30
|
-
footerContentBefore?: ReactNode;
|
|
31
33
|
/** `small (600)` | `medium (900)` | `large (full)` */
|
|
32
34
|
size?: 'small' | 'medium' | 'large';
|
|
33
35
|
};
|
|
@@ -35,6 +37,7 @@ export type ModalProps = {
|
|
|
35
37
|
* - `Modal` is a controlled component; you must manage the `isOpen` state and provide an `onClose` handler
|
|
36
38
|
* - `title` is required for accessibility. If you replace or provide no header via props, it will be read via `aria-label`
|
|
37
39
|
* - The modal body (main content area) has padding is scrollable by default. Overwrite via `bodyStyle`.
|
|
40
|
+
* - Use `design="outline"` for non-primary footer actions (e.g. Cancel) to visually distinguish them from the primary action.
|
|
38
41
|
*/
|
|
39
42
|
export declare function Modal({ isOpen, onClose, as, children, 'data-testid__close-button': dataTestIdCloseButton, bodyStyle, containerStyle, headerStyle, footerStyle, headerComponent, headerContentAfter, footerComponent, footerActions, footerContentBefore, size, title, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
40
43
|
export default Modal;
|
package/lib/Text/Text.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export type TextProps = {
|
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
- Sensible defaults based on size, with the flexibility to render as any HTML element.
|
|
20
|
-
- Automatically nudges sizes up 1px if heading font-family (Averta) is being used.
|
|
21
20
|
- Margins reset to 0 by default (we don't do a lot of long-form text in the app itself). Add margin when you need it via the `ccMargin` prop.
|
|
22
21
|
- Can be extended as a styled-component.
|
|
23
22
|
*/
|
package/lib/shared/styles.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Placement } from '@floating-ui/react';
|
|
2
2
|
import { GetStatusProps, ProgressProps } from './types';
|
|
3
|
-
export declare const systemFontFamily = "font-family: system-ui, -apple-system, BlinkMacSystemFont,\n'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;";
|
|
3
|
+
export declare const systemFontFamily = "font-family: 'Averta', system-ui, -apple-system, BlinkMacSystemFont,\n'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;";
|
|
4
4
|
export declare const headingFontFamily = "font-family: 'Averta', system-ui, -apple-system, BlinkMacSystemFont,\n'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;";
|
|
5
5
|
export declare const sharedFocusStyles: import('styled-components').RuleSet<object>;
|
|
6
6
|
export declare const disabledStyles: import('styled-components').RuleSet<object>;
|