@tonyarbor/components 0.6.0 → 0.7.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/AvatarLogoLockup.d.mts +41 -0
- package/dist/AvatarLogoLockup.d.ts +41 -0
- package/dist/AvatarLogoLockup.js +344 -0
- package/dist/AvatarLogoLockup.js.map +1 -0
- package/dist/AvatarLogoLockup.mjs +9 -0
- package/dist/AvatarLogoLockup.mjs.map +1 -0
- package/dist/Button.d.mts +1 -1
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +56 -0
- package/dist/Button.js.map +1 -1
- package/dist/Button.mjs +1 -1
- package/dist/Modal.d.mts +73 -0
- package/dist/Modal.d.ts +73 -0
- package/dist/Modal.js +114 -0
- package/dist/Modal.js.map +1 -0
- package/dist/Modal.mjs +9 -0
- package/dist/Modal.mjs.map +1 -0
- package/dist/ModalFooter.d.mts +40 -0
- package/dist/ModalFooter.d.ts +40 -0
- package/dist/ModalFooter.js +73 -0
- package/dist/ModalFooter.js.map +1 -0
- package/dist/ModalFooter.mjs +7 -0
- package/dist/ModalFooter.mjs.map +1 -0
- package/dist/ModalHeader.d.mts +65 -0
- package/dist/ModalHeader.d.ts +65 -0
- package/dist/ModalHeader.js +257 -0
- package/dist/ModalHeader.js.map +1 -0
- package/dist/ModalHeader.mjs +8 -0
- package/dist/ModalHeader.mjs.map +1 -0
- package/dist/TopNavBar.d.mts +103 -0
- package/dist/TopNavBar.d.ts +103 -0
- package/dist/TopNavBar.js +994 -0
- package/dist/TopNavBar.js.map +1 -0
- package/dist/TopNavBar.mjs +13 -0
- package/dist/TopNavBar.mjs.map +1 -0
- package/dist/TopNavItem.d.mts +33 -0
- package/dist/TopNavItem.d.ts +33 -0
- package/dist/TopNavItem.js +108 -0
- package/dist/TopNavItem.js.map +1 -0
- package/dist/TopNavItem.mjs +7 -0
- package/dist/TopNavItem.mjs.map +1 -0
- package/dist/chunk-7JWINM2N.mjs +77 -0
- package/dist/chunk-7JWINM2N.mjs.map +1 -0
- package/dist/chunk-AVYGOALO.mjs +72 -0
- package/dist/chunk-AVYGOALO.mjs.map +1 -0
- package/dist/chunk-GIQDPHZQ.mjs +121 -0
- package/dist/chunk-GIQDPHZQ.mjs.map +1 -0
- package/dist/chunk-HG2ORLLW.mjs +116 -0
- package/dist/chunk-HG2ORLLW.mjs.map +1 -0
- package/dist/{chunk-ALEJXAZY.mjs → chunk-NOUFR6W2.mjs} +57 -1
- package/dist/chunk-NOUFR6W2.mjs.map +1 -0
- package/dist/chunk-P7RKUESQ.mjs +37 -0
- package/dist/chunk-P7RKUESQ.mjs.map +1 -0
- package/dist/chunk-YUXQQX7M.mjs +182 -0
- package/dist/chunk-YUXQQX7M.mjs.map +1 -0
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +628 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -2
- package/package.json +31 -1
- package/dist/chunk-ALEJXAZY.mjs.map +0 -1
package/dist/Modal.d.mts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ModalProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the modal (typically ModalHeader, content, and ModalFooter)
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Width of the modal
|
|
10
|
+
* @default 584
|
|
11
|
+
*/
|
|
12
|
+
width?: number | string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class name
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Additional inline styles
|
|
19
|
+
*/
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
interface ModalContentProps {
|
|
23
|
+
/**
|
|
24
|
+
* The content to display in the modal body
|
|
25
|
+
*/
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Additional CSS class name
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Additional inline styles
|
|
33
|
+
*/
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Modal component - Arbor Design System
|
|
38
|
+
*
|
|
39
|
+
* A modal dialog container that wraps ModalHeader, content, and ModalFooter.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Modal width={584}>
|
|
44
|
+
* <ModalHeader
|
|
45
|
+
* title="Delete postal address?"
|
|
46
|
+
* onClose={() => setIsOpen(false)}
|
|
47
|
+
* />
|
|
48
|
+
* <ModalContent>
|
|
49
|
+
* <p>This will delete the postal address. Are you sure?</p>
|
|
50
|
+
* </ModalContent>
|
|
51
|
+
* <ModalFooter>
|
|
52
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
53
|
+
* <Button variant="destructive-secondary">Confirm</Button>
|
|
54
|
+
* </ModalFooter>
|
|
55
|
+
* </Modal>
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
/**
|
|
60
|
+
* ModalContent component - Arbor Design System
|
|
61
|
+
*
|
|
62
|
+
* The content/body area of a modal dialog.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <ModalContent>
|
|
67
|
+
* <p>Your content here</p>
|
|
68
|
+
* </ModalContent>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
declare const ModalContent: React.ForwardRefExoticComponent<ModalContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
72
|
+
|
|
73
|
+
export { Modal, ModalContent, type ModalContentProps, type ModalProps };
|
package/dist/Modal.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ModalProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the modal (typically ModalHeader, content, and ModalFooter)
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Width of the modal
|
|
10
|
+
* @default 584
|
|
11
|
+
*/
|
|
12
|
+
width?: number | string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class name
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Additional inline styles
|
|
19
|
+
*/
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
interface ModalContentProps {
|
|
23
|
+
/**
|
|
24
|
+
* The content to display in the modal body
|
|
25
|
+
*/
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Additional CSS class name
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Additional inline styles
|
|
33
|
+
*/
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Modal component - Arbor Design System
|
|
38
|
+
*
|
|
39
|
+
* A modal dialog container that wraps ModalHeader, content, and ModalFooter.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Modal width={584}>
|
|
44
|
+
* <ModalHeader
|
|
45
|
+
* title="Delete postal address?"
|
|
46
|
+
* onClose={() => setIsOpen(false)}
|
|
47
|
+
* />
|
|
48
|
+
* <ModalContent>
|
|
49
|
+
* <p>This will delete the postal address. Are you sure?</p>
|
|
50
|
+
* </ModalContent>
|
|
51
|
+
* <ModalFooter>
|
|
52
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
53
|
+
* <Button variant="destructive-secondary">Confirm</Button>
|
|
54
|
+
* </ModalFooter>
|
|
55
|
+
* </Modal>
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
/**
|
|
60
|
+
* ModalContent component - Arbor Design System
|
|
61
|
+
*
|
|
62
|
+
* The content/body area of a modal dialog.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <ModalContent>
|
|
67
|
+
* <p>Your content here</p>
|
|
68
|
+
* </ModalContent>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
declare const ModalContent: React.ForwardRefExoticComponent<ModalContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
72
|
+
|
|
73
|
+
export { Modal, ModalContent, type ModalContentProps, type ModalProps };
|
package/dist/Modal.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/Modal/index.ts
|
|
31
|
+
var Modal_exports = {};
|
|
32
|
+
__export(Modal_exports, {
|
|
33
|
+
Modal: () => Modal,
|
|
34
|
+
ModalContent: () => ModalContent
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(Modal_exports);
|
|
37
|
+
|
|
38
|
+
// src/Modal/Modal.tsx
|
|
39
|
+
var React = __toESM(require("react"));
|
|
40
|
+
var import_clsx = require("clsx");
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
var modalStyles = {
|
|
43
|
+
container: {
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexDirection: "column",
|
|
46
|
+
alignItems: "flex-start",
|
|
47
|
+
backgroundColor: "#f8f8f8",
|
|
48
|
+
// grey-050
|
|
49
|
+
borderRadius: "8px",
|
|
50
|
+
boxShadow: "0px 8px 24px 0px rgba(32, 32, 32, 0.12)",
|
|
51
|
+
overflow: "hidden",
|
|
52
|
+
boxSizing: "border-box",
|
|
53
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
54
|
+
},
|
|
55
|
+
content: {
|
|
56
|
+
display: "flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: "center",
|
|
59
|
+
width: "100%",
|
|
60
|
+
padding: "32px 16px",
|
|
61
|
+
backgroundColor: "#f8f8f8",
|
|
62
|
+
// grey-050
|
|
63
|
+
boxSizing: "border-box"
|
|
64
|
+
},
|
|
65
|
+
contentText: {
|
|
66
|
+
flex: 1,
|
|
67
|
+
fontSize: "13px",
|
|
68
|
+
fontWeight: "400",
|
|
69
|
+
color: "#2f2f2f",
|
|
70
|
+
lineHeight: "1.5"
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var Modal = React.forwardRef(
|
|
74
|
+
({ children, width = 584, className, style, ...props }, ref) => {
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
className: (0, import_clsx.clsx)("arbor-modal", className),
|
|
80
|
+
style: {
|
|
81
|
+
...modalStyles.container,
|
|
82
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
83
|
+
...style
|
|
84
|
+
},
|
|
85
|
+
role: "dialog",
|
|
86
|
+
"aria-modal": "true",
|
|
87
|
+
...props,
|
|
88
|
+
children
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
Modal.displayName = "Modal";
|
|
94
|
+
var ModalContent = React.forwardRef(
|
|
95
|
+
({ children, className, style, ...props }, ref) => {
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
ref,
|
|
100
|
+
className: (0, import_clsx.clsx)("arbor-modal-content", className),
|
|
101
|
+
style: { ...modalStyles.content, ...style },
|
|
102
|
+
...props,
|
|
103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: modalStyles.contentText, children })
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
ModalContent.displayName = "ModalContent";
|
|
109
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
+
0 && (module.exports = {
|
|
111
|
+
Modal,
|
|
112
|
+
ModalContent
|
|
113
|
+
});
|
|
114
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Modal/index.ts","../src/Modal/Modal.tsx"],"sourcesContent":["export { Modal, ModalContent } from './Modal';\nexport type { ModalProps, ModalContentProps } from './Modal';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface ModalProps {\n /**\n * The content of the modal (typically ModalHeader, content, and ModalFooter)\n */\n children: React.ReactNode;\n /**\n * Width of the modal\n * @default 584\n */\n width?: number | string;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\nexport interface ModalContentProps {\n /**\n * The content to display in the modal body\n */\n children: React.ReactNode;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Arbor Design System modal styles\nconst modalStyles = {\n container: {\n display: 'flex',\n flexDirection: 'column' as const,\n alignItems: 'flex-start',\n backgroundColor: '#f8f8f8', // grey-050\n borderRadius: '8px',\n boxShadow: '0px 8px 24px 0px rgba(32, 32, 32, 0.12)',\n overflow: 'hidden',\n boxSizing: 'border-box' as const,\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n },\n content: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n padding: '32px 16px',\n backgroundColor: '#f8f8f8', // grey-050\n boxSizing: 'border-box' as const,\n },\n contentText: {\n flex: 1,\n fontSize: '13px',\n fontWeight: '400',\n color: '#2f2f2f',\n lineHeight: '1.5',\n },\n};\n\n/**\n * Modal component - Arbor Design System\n *\n * A modal dialog container that wraps ModalHeader, content, and ModalFooter.\n *\n * @example\n * ```tsx\n * <Modal width={584}>\n * <ModalHeader\n * title=\"Delete postal address?\"\n * onClose={() => setIsOpen(false)}\n * />\n * <ModalContent>\n * <p>This will delete the postal address. Are you sure?</p>\n * </ModalContent>\n * <ModalFooter>\n * <Button variant=\"tertiary\">Cancel</Button>\n * <Button variant=\"destructive-secondary\">Confirm</Button>\n * </ModalFooter>\n * </Modal>\n * ```\n */\nexport const Modal = React.forwardRef<HTMLDivElement, ModalProps>(\n ({ children, width = 584, className, style, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clsx('arbor-modal', className)}\n style={{\n ...modalStyles.container,\n width: typeof width === 'number' ? `${width}px` : width,\n ...style,\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nModal.displayName = 'Modal';\n\n/**\n * ModalContent component - Arbor Design System\n *\n * The content/body area of a modal dialog.\n *\n * @example\n * ```tsx\n * <ModalContent>\n * <p>Your content here</p>\n * </ModalContent>\n * ```\n */\nexport const ModalContent = React.forwardRef<HTMLDivElement, ModalContentProps>(\n ({ children, className, style, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clsx('arbor-modal-content', className)}\n style={{ ...modalStyles.content, ...style }}\n {...props}\n >\n <div style={modalStyles.contentText}>{children}</div>\n </div>\n );\n }\n);\n\nModalContent.displayName = 'ModalContent';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,kBAAqB;AA6Ff;AAvDN,IAAM,cAAc;AAAA,EAClB,WAAW;AAAA,IACT,SAAS;AAAA,IACT,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,iBAAiB;AAAA;AAAA,IACjB,cAAc;AAAA,IACd,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,iBAAiB;AAAA;AAAA,IACjB,WAAW;AAAA,EACb;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,EACd;AACF;AAwBO,IAAM,QAAc;AAAA,EACzB,CAAC,EAAE,UAAU,QAAQ,KAAK,WAAW,OAAO,GAAG,MAAM,GAAG,QAAQ;AAC9D,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAK,eAAe,SAAS;AAAA,QACxC,OAAO;AAAA,UACL,GAAG,YAAY;AAAA,UACf,OAAO,OAAO,UAAU,WAAW,GAAG,KAAK,OAAO;AAAA,UAClD,GAAG;AAAA,QACL;AAAA,QACA,MAAK;AAAA,QACL,cAAW;AAAA,QACV,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,MAAM,cAAc;AAcb,IAAM,eAAqB;AAAA,EAChC,CAAC,EAAE,UAAU,WAAW,OAAO,GAAG,MAAM,GAAG,QAAQ;AACjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAK,uBAAuB,SAAS;AAAA,QAChD,OAAO,EAAE,GAAG,YAAY,SAAS,GAAG,MAAM;AAAA,QACzC,GAAG;AAAA,QAEJ,sDAAC,SAAI,OAAO,YAAY,aAAc,UAAS;AAAA;AAAA,IACjD;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;","names":[]}
|
package/dist/Modal.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ModalFooterProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the footer, typically buttons
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class name
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Additional inline styles
|
|
14
|
+
*/
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ModalFooter component - Arbor Design System
|
|
19
|
+
*
|
|
20
|
+
* The footer part of a modal dialog, typically containing action buttons.
|
|
21
|
+
* Buttons are right-aligned by default.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Footer with two buttons
|
|
26
|
+
* <ModalFooter>
|
|
27
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
28
|
+
* <Button variant="primary">Save</Button>
|
|
29
|
+
* </ModalFooter>
|
|
30
|
+
*
|
|
31
|
+
* // Footer with destructive action
|
|
32
|
+
* <ModalFooter>
|
|
33
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
34
|
+
* <Button variant="destructive-secondary">Delete</Button>
|
|
35
|
+
* </ModalFooter>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare const ModalFooter: React.ForwardRefExoticComponent<ModalFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
|
|
40
|
+
export { ModalFooter, type ModalFooterProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ModalFooterProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the footer, typically buttons
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class name
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Additional inline styles
|
|
14
|
+
*/
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ModalFooter component - Arbor Design System
|
|
19
|
+
*
|
|
20
|
+
* The footer part of a modal dialog, typically containing action buttons.
|
|
21
|
+
* Buttons are right-aligned by default.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Footer with two buttons
|
|
26
|
+
* <ModalFooter>
|
|
27
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
28
|
+
* <Button variant="primary">Save</Button>
|
|
29
|
+
* </ModalFooter>
|
|
30
|
+
*
|
|
31
|
+
* // Footer with destructive action
|
|
32
|
+
* <ModalFooter>
|
|
33
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
34
|
+
* <Button variant="destructive-secondary">Delete</Button>
|
|
35
|
+
* </ModalFooter>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare const ModalFooter: React.ForwardRefExoticComponent<ModalFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
|
|
40
|
+
export { ModalFooter, type ModalFooterProps };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/ModalFooter/index.ts
|
|
31
|
+
var ModalFooter_exports = {};
|
|
32
|
+
__export(ModalFooter_exports, {
|
|
33
|
+
ModalFooter: () => ModalFooter
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(ModalFooter_exports);
|
|
36
|
+
|
|
37
|
+
// src/ModalFooter/ModalFooter.tsx
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_clsx = require("clsx");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var modalFooterStyles = {
|
|
42
|
+
container: {
|
|
43
|
+
display: "flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "flex-end",
|
|
46
|
+
gap: "16px",
|
|
47
|
+
width: "100%",
|
|
48
|
+
padding: "16px",
|
|
49
|
+
backgroundColor: "#ffffff",
|
|
50
|
+
boxSizing: "border-box",
|
|
51
|
+
maxHeight: "56px"
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var ModalFooter = React.forwardRef(
|
|
55
|
+
({ children, className, style, ...props }, ref) => {
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
ref,
|
|
60
|
+
className: (0, import_clsx.clsx)("arbor-modal-footer", className),
|
|
61
|
+
style: { ...modalFooterStyles.container, ...style },
|
|
62
|
+
...props,
|
|
63
|
+
children
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
ModalFooter.displayName = "ModalFooter";
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
ModalFooter
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=ModalFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ModalFooter/index.ts","../src/ModalFooter/ModalFooter.tsx"],"sourcesContent":["export { ModalFooter } from './ModalFooter';\nexport type { ModalFooterProps } from './ModalFooter';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface ModalFooterProps {\n /**\n * The content of the footer, typically buttons\n */\n children: React.ReactNode;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Arbor Design System modal footer styles\nconst modalFooterStyles = {\n container: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: '16px',\n width: '100%',\n padding: '16px',\n backgroundColor: '#ffffff',\n boxSizing: 'border-box' as const,\n maxHeight: '56px',\n },\n};\n\n/**\n * ModalFooter component - Arbor Design System\n *\n * The footer part of a modal dialog, typically containing action buttons.\n * Buttons are right-aligned by default.\n *\n * @example\n * ```tsx\n * // Footer with two buttons\n * <ModalFooter>\n * <Button variant=\"tertiary\">Cancel</Button>\n * <Button variant=\"primary\">Save</Button>\n * </ModalFooter>\n *\n * // Footer with destructive action\n * <ModalFooter>\n * <Button variant=\"tertiary\">Cancel</Button>\n * <Button variant=\"destructive-secondary\">Delete</Button>\n * </ModalFooter>\n * ```\n */\nexport const ModalFooter = React.forwardRef<HTMLDivElement, ModalFooterProps>(\n ({ children, className, style, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clsx('arbor-modal-footer', className)}\n style={{ ...modalFooterStyles.container, ...style }}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nModalFooter.displayName = 'ModalFooter';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,kBAAqB;AAwDf;AAtCN,IAAM,oBAAoB;AAAA,EACxB,WAAW;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;AAuBO,IAAM,cAAoB;AAAA,EAC/B,CAAC,EAAE,UAAU,WAAW,OAAO,GAAG,MAAM,GAAG,QAAQ;AACjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAK,sBAAsB,SAAS;AAAA,QAC/C,OAAO,EAAE,GAAG,kBAAkB,WAAW,GAAG,MAAM;AAAA,QACjD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SectionIconVariant } from './SectionIcon.mjs';
|
|
3
|
+
|
|
4
|
+
interface ModalHeaderProps {
|
|
5
|
+
/**
|
|
6
|
+
* The title text for the modal header
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional icon variant to display before the title
|
|
11
|
+
* Uses the SectionIcon component variants: 'warning', 'danger', 'info', 'success'
|
|
12
|
+
*/
|
|
13
|
+
icon?: SectionIconVariant;
|
|
14
|
+
/**
|
|
15
|
+
* Callback when close button is clicked
|
|
16
|
+
* If not provided, close button will not be shown
|
|
17
|
+
*/
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Additional CSS class name
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Additional inline styles
|
|
25
|
+
*/
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* ModalHeader component - Arbor Design System
|
|
30
|
+
*
|
|
31
|
+
* The header part of a modal dialog with title, optional icon, and close button.
|
|
32
|
+
* The icon uses SectionIcon variants (warning, danger, info, success).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Basic modal header with close button
|
|
37
|
+
* <ModalHeader
|
|
38
|
+
* title="What would you like to do?"
|
|
39
|
+
* onClose={() => setIsOpen(false)}
|
|
40
|
+
* />
|
|
41
|
+
*
|
|
42
|
+
* // Modal header with warning icon
|
|
43
|
+
* <ModalHeader
|
|
44
|
+
* title="Are you sure?"
|
|
45
|
+
* icon="warning"
|
|
46
|
+
* onClose={() => setIsOpen(false)}
|
|
47
|
+
* />
|
|
48
|
+
*
|
|
49
|
+
* // Modal header with danger icon (error state)
|
|
50
|
+
* <ModalHeader
|
|
51
|
+
* title="Sorry, we can't find this page"
|
|
52
|
+
* icon="danger"
|
|
53
|
+
* onClose={() => setIsOpen(false)}
|
|
54
|
+
* />
|
|
55
|
+
*
|
|
56
|
+
* // Modal header without close button
|
|
57
|
+
* <ModalHeader
|
|
58
|
+
* title="Processing..."
|
|
59
|
+
* icon="info"
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const ModalHeader: React.ForwardRefExoticComponent<ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
64
|
+
|
|
65
|
+
export { ModalHeader, type ModalHeaderProps };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SectionIconVariant } from './SectionIcon.js';
|
|
3
|
+
|
|
4
|
+
interface ModalHeaderProps {
|
|
5
|
+
/**
|
|
6
|
+
* The title text for the modal header
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional icon variant to display before the title
|
|
11
|
+
* Uses the SectionIcon component variants: 'warning', 'danger', 'info', 'success'
|
|
12
|
+
*/
|
|
13
|
+
icon?: SectionIconVariant;
|
|
14
|
+
/**
|
|
15
|
+
* Callback when close button is clicked
|
|
16
|
+
* If not provided, close button will not be shown
|
|
17
|
+
*/
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Additional CSS class name
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Additional inline styles
|
|
25
|
+
*/
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* ModalHeader component - Arbor Design System
|
|
30
|
+
*
|
|
31
|
+
* The header part of a modal dialog with title, optional icon, and close button.
|
|
32
|
+
* The icon uses SectionIcon variants (warning, danger, info, success).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Basic modal header with close button
|
|
37
|
+
* <ModalHeader
|
|
38
|
+
* title="What would you like to do?"
|
|
39
|
+
* onClose={() => setIsOpen(false)}
|
|
40
|
+
* />
|
|
41
|
+
*
|
|
42
|
+
* // Modal header with warning icon
|
|
43
|
+
* <ModalHeader
|
|
44
|
+
* title="Are you sure?"
|
|
45
|
+
* icon="warning"
|
|
46
|
+
* onClose={() => setIsOpen(false)}
|
|
47
|
+
* />
|
|
48
|
+
*
|
|
49
|
+
* // Modal header with danger icon (error state)
|
|
50
|
+
* <ModalHeader
|
|
51
|
+
* title="Sorry, we can't find this page"
|
|
52
|
+
* icon="danger"
|
|
53
|
+
* onClose={() => setIsOpen(false)}
|
|
54
|
+
* />
|
|
55
|
+
*
|
|
56
|
+
* // Modal header without close button
|
|
57
|
+
* <ModalHeader
|
|
58
|
+
* title="Processing..."
|
|
59
|
+
* icon="info"
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const ModalHeader: React.ForwardRefExoticComponent<ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
64
|
+
|
|
65
|
+
export { ModalHeader, type ModalHeaderProps };
|