@companycam/slab-web 2.1.0 → 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.
Files changed (4) hide show
  1. package/index.js +332 -336
  2. package/index.mjs +2147 -2147
  3. package/lib/Modal/Modal.d.ts +12 -9
  4. package/package.json +1 -1
@@ -1,6 +1,16 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  type AsProp = keyof HTMLElementTagNameMap;
3
- export type ModalProps = {
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companycam/slab-web",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "main": "./index.js",
5
5
  "module": "./index.mjs",
6
6
  "types": "./index.d.ts",