@tonyarbor/components 0.1.0 → 0.2.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/Banner.d.mts +59 -0
- package/dist/Banner.d.ts +59 -0
- package/dist/Banner.js +222 -0
- package/dist/Banner.js.map +1 -0
- package/dist/Banner.mjs +7 -0
- package/dist/Banner.mjs.map +1 -0
- package/dist/Checkbox.d.mts +52 -0
- package/dist/Checkbox.d.ts +52 -0
- package/dist/Checkbox.js +194 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/Checkbox.mjs +7 -0
- package/dist/Checkbox.mjs.map +1 -0
- package/dist/Combobox.d.mts +67 -0
- package/dist/Combobox.d.ts +67 -0
- package/dist/Combobox.js +329 -0
- package/dist/Combobox.js.map +1 -0
- package/dist/Combobox.mjs +7 -0
- package/dist/Combobox.mjs.map +1 -0
- package/dist/DatePicker.d.mts +68 -0
- package/dist/DatePicker.d.ts +68 -0
- package/dist/DatePicker.js +490 -0
- package/dist/DatePicker.js.map +1 -0
- package/dist/DatePicker.mjs +7 -0
- package/dist/DatePicker.mjs.map +1 -0
- package/dist/NumericInput.d.mts +68 -0
- package/dist/NumericInput.d.ts +68 -0
- package/dist/NumericInput.js +319 -0
- package/dist/NumericInput.js.map +1 -0
- package/dist/NumericInput.mjs +7 -0
- package/dist/NumericInput.mjs.map +1 -0
- package/dist/Pagination.d.mts +36 -0
- package/dist/Pagination.d.ts +36 -0
- package/dist/Pagination.js +301 -0
- package/dist/Pagination.js.map +1 -0
- package/dist/Pagination.mjs +7 -0
- package/dist/Pagination.mjs.map +1 -0
- package/dist/Radio.d.mts +48 -0
- package/dist/Radio.d.ts +48 -0
- package/dist/Radio.js +194 -0
- package/dist/Radio.js.map +1 -0
- package/dist/Radio.mjs +7 -0
- package/dist/Radio.mjs.map +1 -0
- package/dist/Table.d.mts +80 -0
- package/dist/Table.d.ts +80 -0
- package/dist/Table.js +347 -0
- package/dist/Table.js.map +1 -0
- package/dist/Table.mjs +8 -0
- package/dist/Table.mjs.map +1 -0
- package/dist/TableControls.d.mts +76 -0
- package/dist/TableControls.d.ts +76 -0
- package/dist/TableControls.js +461 -0
- package/dist/TableControls.js.map +1 -0
- package/dist/TableControls.mjs +7 -0
- package/dist/TableControls.mjs.map +1 -0
- package/dist/TableFooterPagination.d.mts +56 -0
- package/dist/TableFooterPagination.d.ts +56 -0
- package/dist/TableFooterPagination.js +499 -0
- package/dist/TableFooterPagination.js.map +1 -0
- package/dist/TableFooterPagination.mjs +7 -0
- package/dist/TableFooterPagination.mjs.map +1 -0
- package/dist/Tabs.d.mts +50 -0
- package/dist/Tabs.d.ts +50 -0
- package/dist/Tabs.js +187 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tabs.mjs +7 -0
- package/dist/Tabs.mjs.map +1 -0
- package/dist/TextArea.d.mts +64 -0
- package/dist/TextArea.d.ts +64 -0
- package/dist/TextArea.js +171 -0
- package/dist/TextArea.js.map +1 -0
- package/dist/TextArea.mjs +7 -0
- package/dist/TextArea.mjs.map +1 -0
- package/dist/Toast.d.mts +48 -0
- package/dist/Toast.d.ts +48 -0
- package/dist/Toast.js +169 -0
- package/dist/Toast.js.map +1 -0
- package/dist/Toast.mjs +7 -0
- package/dist/Toast.mjs.map +1 -0
- package/dist/Toggle.d.mts +48 -0
- package/dist/Toggle.d.ts +48 -0
- package/dist/Toggle.js +291 -0
- package/dist/Toggle.js.map +1 -0
- package/dist/Toggle.mjs +7 -0
- package/dist/Toggle.mjs.map +1 -0
- package/dist/Tooltip.d.mts +32 -0
- package/dist/Tooltip.d.ts +32 -0
- package/dist/Tooltip.js +109 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/Tooltip.mjs +7 -0
- package/dist/Tooltip.mjs.map +1 -0
- package/dist/chunk-52TG3BFX.mjs +463 -0
- package/dist/chunk-52TG3BFX.mjs.map +1 -0
- package/dist/chunk-5BUXFTPW.mjs +283 -0
- package/dist/chunk-5BUXFTPW.mjs.map +1 -0
- package/dist/chunk-7OWLBYNM.mjs +293 -0
- package/dist/chunk-7OWLBYNM.mjs.map +1 -0
- package/dist/chunk-AI2U34CF.mjs +159 -0
- package/dist/chunk-AI2U34CF.mjs.map +1 -0
- package/dist/chunk-C25FFMRQ.mjs +255 -0
- package/dist/chunk-C25FFMRQ.mjs.map +1 -0
- package/dist/chunk-CUTYEIFE.mjs +158 -0
- package/dist/chunk-CUTYEIFE.mjs.map +1 -0
- package/dist/chunk-DULH2KRW.mjs +133 -0
- package/dist/chunk-DULH2KRW.mjs.map +1 -0
- package/dist/chunk-G5NVKF2G.mjs +434 -0
- package/dist/chunk-G5NVKF2G.mjs.map +1 -0
- package/dist/chunk-M6DVBEEL.mjs +158 -0
- package/dist/chunk-M6DVBEEL.mjs.map +1 -0
- package/dist/chunk-MBUMR2XJ.mjs +135 -0
- package/dist/chunk-MBUMR2XJ.mjs.map +1 -0
- package/dist/chunk-MNH2TGUX.mjs +73 -0
- package/dist/chunk-MNH2TGUX.mjs.map +1 -0
- package/dist/chunk-RRMG2SSZ.mjs +265 -0
- package/dist/chunk-RRMG2SSZ.mjs.map +1 -0
- package/dist/chunk-U4JXKZZG.mjs +186 -0
- package/dist/chunk-U4JXKZZG.mjs.map +1 -0
- package/dist/chunk-W55QJIAN.mjs +467 -0
- package/dist/chunk-W55QJIAN.mjs.map +1 -0
- package/dist/chunk-YV4OXFIM.mjs +151 -0
- package/dist/chunk-YV4OXFIM.mjs.map +1 -0
- package/dist/index.d.mts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +3559 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -1
- package/package.json +81 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type BannerVariant = 'warning' | 'destructive' | 'information' | 'neutral';
|
|
4
|
+
interface BannerProps {
|
|
5
|
+
/**
|
|
6
|
+
* Banner variant - determines color scheme
|
|
7
|
+
*/
|
|
8
|
+
variant?: BannerVariant;
|
|
9
|
+
/**
|
|
10
|
+
* Optional title text
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Main message/description text
|
|
15
|
+
*/
|
|
16
|
+
message: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional icon (pass false to hide default icon, or pass custom ReactNode)
|
|
19
|
+
*/
|
|
20
|
+
icon?: React.ReactNode | boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Optional action button label
|
|
23
|
+
*/
|
|
24
|
+
actionLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Action button click handler
|
|
27
|
+
*/
|
|
28
|
+
onAction?: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Optional close button
|
|
31
|
+
*/
|
|
32
|
+
onClose?: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Custom className
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Custom style
|
|
39
|
+
*/
|
|
40
|
+
style?: React.CSSProperties;
|
|
41
|
+
/**
|
|
42
|
+
* Test ID for testing
|
|
43
|
+
*/
|
|
44
|
+
'data-testid'?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Banner component - Arbor Design System
|
|
48
|
+
*
|
|
49
|
+
* Informational banners with 4 variants (warning, destructive, information, neutral)
|
|
50
|
+
* and optional title, icon, and action button.
|
|
51
|
+
*
|
|
52
|
+
* IMPORTANT: Banners are always displayed inline with page content (not overlays).
|
|
53
|
+
* They flow with the document layout and push other content down.
|
|
54
|
+
*
|
|
55
|
+
* For overlay notifications in the top-right corner, use the Toast component instead.
|
|
56
|
+
*/
|
|
57
|
+
declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
58
|
+
|
|
59
|
+
export { Banner, type BannerProps, type BannerVariant };
|
package/dist/Banner.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type BannerVariant = 'warning' | 'destructive' | 'information' | 'neutral';
|
|
4
|
+
interface BannerProps {
|
|
5
|
+
/**
|
|
6
|
+
* Banner variant - determines color scheme
|
|
7
|
+
*/
|
|
8
|
+
variant?: BannerVariant;
|
|
9
|
+
/**
|
|
10
|
+
* Optional title text
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Main message/description text
|
|
15
|
+
*/
|
|
16
|
+
message: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional icon (pass false to hide default icon, or pass custom ReactNode)
|
|
19
|
+
*/
|
|
20
|
+
icon?: React.ReactNode | boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Optional action button label
|
|
23
|
+
*/
|
|
24
|
+
actionLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Action button click handler
|
|
27
|
+
*/
|
|
28
|
+
onAction?: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Optional close button
|
|
31
|
+
*/
|
|
32
|
+
onClose?: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Custom className
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Custom style
|
|
39
|
+
*/
|
|
40
|
+
style?: React.CSSProperties;
|
|
41
|
+
/**
|
|
42
|
+
* Test ID for testing
|
|
43
|
+
*/
|
|
44
|
+
'data-testid'?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Banner component - Arbor Design System
|
|
48
|
+
*
|
|
49
|
+
* Informational banners with 4 variants (warning, destructive, information, neutral)
|
|
50
|
+
* and optional title, icon, and action button.
|
|
51
|
+
*
|
|
52
|
+
* IMPORTANT: Banners are always displayed inline with page content (not overlays).
|
|
53
|
+
* They flow with the document layout and push other content down.
|
|
54
|
+
*
|
|
55
|
+
* For overlay notifications in the top-right corner, use the Toast component instead.
|
|
56
|
+
*/
|
|
57
|
+
declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
58
|
+
|
|
59
|
+
export { Banner, type BannerProps, type BannerVariant };
|
package/dist/Banner.js
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
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/Banner/index.ts
|
|
31
|
+
var Banner_exports = {};
|
|
32
|
+
__export(Banner_exports, {
|
|
33
|
+
Banner: () => Banner
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Banner_exports);
|
|
36
|
+
|
|
37
|
+
// src/Banner/Banner.tsx
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_clsx = require("clsx");
|
|
40
|
+
var import_lucide_react = require("lucide-react");
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
var containerStyles = {
|
|
43
|
+
display: "flex",
|
|
44
|
+
alignItems: "flex-start",
|
|
45
|
+
padding: "16px",
|
|
46
|
+
borderRadius: "8px",
|
|
47
|
+
border: "1px solid",
|
|
48
|
+
width: "100%",
|
|
49
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
50
|
+
};
|
|
51
|
+
var iconContainerStyles = {
|
|
52
|
+
flexShrink: 0,
|
|
53
|
+
width: "24px",
|
|
54
|
+
height: "24px",
|
|
55
|
+
display: "flex",
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
justifyContent: "center"
|
|
58
|
+
};
|
|
59
|
+
var contentContainerStyles = {
|
|
60
|
+
flex: 1,
|
|
61
|
+
display: "flex",
|
|
62
|
+
flexDirection: "column",
|
|
63
|
+
minWidth: 0
|
|
64
|
+
};
|
|
65
|
+
var titleStyles = {
|
|
66
|
+
fontSize: "18px",
|
|
67
|
+
fontWeight: 600,
|
|
68
|
+
lineHeight: "1.25",
|
|
69
|
+
marginBottom: "8px"
|
|
70
|
+
};
|
|
71
|
+
var messageStyles = {
|
|
72
|
+
fontSize: "13px",
|
|
73
|
+
fontWeight: 400,
|
|
74
|
+
lineHeight: "1.5",
|
|
75
|
+
margin: 0
|
|
76
|
+
};
|
|
77
|
+
var actionContainerStyles = {
|
|
78
|
+
display: "flex",
|
|
79
|
+
flexDirection: "column",
|
|
80
|
+
justifyContent: "flex-end",
|
|
81
|
+
alignItems: "flex-end",
|
|
82
|
+
alignSelf: "stretch",
|
|
83
|
+
flexShrink: 0
|
|
84
|
+
};
|
|
85
|
+
var actionButtonStyles = {
|
|
86
|
+
background: "none",
|
|
87
|
+
border: "none",
|
|
88
|
+
padding: 0,
|
|
89
|
+
fontSize: "13px",
|
|
90
|
+
fontWeight: 600,
|
|
91
|
+
lineHeight: "1.5",
|
|
92
|
+
textDecoration: "underline",
|
|
93
|
+
textUnderlinePosition: "from-font",
|
|
94
|
+
cursor: "pointer",
|
|
95
|
+
fontFamily: "inherit"
|
|
96
|
+
};
|
|
97
|
+
var closeButtonStyles = {
|
|
98
|
+
background: "none",
|
|
99
|
+
border: "none",
|
|
100
|
+
padding: "4px",
|
|
101
|
+
cursor: "pointer",
|
|
102
|
+
display: "flex",
|
|
103
|
+
alignItems: "center",
|
|
104
|
+
justifyContent: "center",
|
|
105
|
+
flexShrink: 0,
|
|
106
|
+
marginLeft: "8px"
|
|
107
|
+
};
|
|
108
|
+
var variantConfig = {
|
|
109
|
+
warning: {
|
|
110
|
+
backgroundColor: "#fffaf5",
|
|
111
|
+
borderColor: "#e4720d",
|
|
112
|
+
textColor: "#611f00",
|
|
113
|
+
actionColor: "#a74102",
|
|
114
|
+
icon: import_lucide_react.AlertTriangle
|
|
115
|
+
},
|
|
116
|
+
destructive: {
|
|
117
|
+
backgroundColor: "#fff5f5",
|
|
118
|
+
borderColor: "#c93232",
|
|
119
|
+
textColor: "#610202",
|
|
120
|
+
actionColor: "#920a0a",
|
|
121
|
+
icon: import_lucide_react.AlertCircle
|
|
122
|
+
},
|
|
123
|
+
information: {
|
|
124
|
+
backgroundColor: "#f5fbff",
|
|
125
|
+
borderColor: "#2c8bca",
|
|
126
|
+
textColor: "#053a61",
|
|
127
|
+
actionColor: "#024f83",
|
|
128
|
+
icon: import_lucide_react.Info
|
|
129
|
+
},
|
|
130
|
+
neutral: {
|
|
131
|
+
backgroundColor: "transparent",
|
|
132
|
+
borderColor: "#b3b3b3",
|
|
133
|
+
textColor: "#2f2f2f",
|
|
134
|
+
actionColor: "#2f2f2f",
|
|
135
|
+
icon: import_lucide_react.Info
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
var Banner = React.forwardRef(
|
|
139
|
+
({
|
|
140
|
+
variant = "information",
|
|
141
|
+
title,
|
|
142
|
+
message,
|
|
143
|
+
icon = true,
|
|
144
|
+
actionLabel,
|
|
145
|
+
onAction,
|
|
146
|
+
onClose,
|
|
147
|
+
className,
|
|
148
|
+
style,
|
|
149
|
+
"data-testid": dataTestId
|
|
150
|
+
}, ref) => {
|
|
151
|
+
const config = variantConfig[variant];
|
|
152
|
+
const DefaultIcon = config.icon;
|
|
153
|
+
const showIcon = icon !== false;
|
|
154
|
+
const iconElement = icon === true || icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultIcon, { size: 20, strokeWidth: 2 }) : icon;
|
|
155
|
+
const containerStylesCombined = {
|
|
156
|
+
...containerStyles,
|
|
157
|
+
backgroundColor: config.backgroundColor,
|
|
158
|
+
borderColor: config.borderColor,
|
|
159
|
+
color: config.textColor,
|
|
160
|
+
gap: showIcon ? "16px" : "0px",
|
|
161
|
+
...style
|
|
162
|
+
};
|
|
163
|
+
const titleStylesCombined = {
|
|
164
|
+
...titleStyles,
|
|
165
|
+
color: config.textColor
|
|
166
|
+
};
|
|
167
|
+
const messageStylesCombined = {
|
|
168
|
+
...messageStyles,
|
|
169
|
+
color: config.textColor
|
|
170
|
+
};
|
|
171
|
+
const actionButtonStylesCombined = {
|
|
172
|
+
...actionButtonStyles,
|
|
173
|
+
color: config.actionColor
|
|
174
|
+
};
|
|
175
|
+
const closeButtonStylesCombined = {
|
|
176
|
+
...closeButtonStyles,
|
|
177
|
+
color: config.textColor
|
|
178
|
+
};
|
|
179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
180
|
+
"div",
|
|
181
|
+
{
|
|
182
|
+
ref,
|
|
183
|
+
className: (0, import_clsx.clsx)("arbor-banner", `arbor-banner--${variant}`, className),
|
|
184
|
+
style: containerStylesCombined,
|
|
185
|
+
"data-testid": dataTestId,
|
|
186
|
+
role: "alert",
|
|
187
|
+
children: [
|
|
188
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...iconContainerStyles, color: config.textColor }, children: iconElement }),
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: contentContainerStyles, children: [
|
|
190
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: titleStylesCombined, children: title }),
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: messageStylesCombined, children: message })
|
|
192
|
+
] }),
|
|
193
|
+
actionLabel && onAction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: actionContainerStyles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
194
|
+
"button",
|
|
195
|
+
{
|
|
196
|
+
type: "button",
|
|
197
|
+
onClick: onAction,
|
|
198
|
+
style: actionButtonStylesCombined,
|
|
199
|
+
children: actionLabel
|
|
200
|
+
}
|
|
201
|
+
) }),
|
|
202
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
203
|
+
"button",
|
|
204
|
+
{
|
|
205
|
+
type: "button",
|
|
206
|
+
onClick: onClose,
|
|
207
|
+
style: closeButtonStylesCombined,
|
|
208
|
+
"aria-label": "Close banner",
|
|
209
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { size: 20 })
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
Banner.displayName = "Banner";
|
|
218
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
219
|
+
0 && (module.exports = {
|
|
220
|
+
Banner
|
|
221
|
+
});
|
|
222
|
+
//# sourceMappingURL=Banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Banner/index.ts","../src/Banner/Banner.tsx"],"sourcesContent":["export { Banner } from './Banner';\nexport type { BannerProps, BannerVariant } from './Banner';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\nimport { AlertCircle, AlertTriangle, Info, X } from 'lucide-react';\n\nexport type BannerVariant = 'warning' | 'destructive' | 'information' | 'neutral';\n\nexport interface BannerProps {\n /**\n * Banner variant - determines color scheme\n */\n variant?: BannerVariant;\n /**\n * Optional title text\n */\n title?: string;\n /**\n * Main message/description text\n */\n message: string;\n /**\n * Optional icon (pass false to hide default icon, or pass custom ReactNode)\n */\n icon?: React.ReactNode | boolean;\n /**\n * Optional action button label\n */\n actionLabel?: string;\n /**\n * Action button click handler\n */\n onAction?: () => void;\n /**\n * Optional close button\n */\n onClose?: () => void;\n /**\n * Custom className\n */\n className?: string;\n /**\n * Custom style\n */\n style?: React.CSSProperties;\n /**\n * Test ID for testing\n */\n 'data-testid'?: string;\n}\n\nconst containerStyles: React.CSSProperties = {\n display: 'flex',\n alignItems: 'flex-start',\n padding: '16px',\n borderRadius: '8px',\n border: '1px solid',\n width: '100%',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n};\n\nconst iconContainerStyles: React.CSSProperties = {\n flexShrink: 0,\n width: '24px',\n height: '24px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst contentContainerStyles: React.CSSProperties = {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n};\n\nconst titleStyles: React.CSSProperties = {\n fontSize: '18px',\n fontWeight: 600,\n lineHeight: '1.25',\n marginBottom: '8px',\n};\n\nconst messageStyles: React.CSSProperties = {\n fontSize: '13px',\n fontWeight: 400,\n lineHeight: '1.5',\n margin: 0,\n};\n\nconst actionContainerStyles: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'flex-end',\n alignItems: 'flex-end',\n alignSelf: 'stretch',\n flexShrink: 0,\n};\n\nconst actionButtonStyles: React.CSSProperties = {\n background: 'none',\n border: 'none',\n padding: 0,\n fontSize: '13px',\n fontWeight: 600,\n lineHeight: '1.5',\n textDecoration: 'underline',\n textUnderlinePosition: 'from-font',\n cursor: 'pointer',\n fontFamily: 'inherit',\n};\n\nconst closeButtonStyles: React.CSSProperties = {\n background: 'none',\n border: 'none',\n padding: '4px',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n marginLeft: '8px',\n};\n\nconst variantConfig = {\n warning: {\n backgroundColor: '#fffaf5',\n borderColor: '#e4720d',\n textColor: '#611f00',\n actionColor: '#a74102',\n icon: AlertTriangle,\n },\n destructive: {\n backgroundColor: '#fff5f5',\n borderColor: '#c93232',\n textColor: '#610202',\n actionColor: '#920a0a',\n icon: AlertCircle,\n },\n information: {\n backgroundColor: '#f5fbff',\n borderColor: '#2c8bca',\n textColor: '#053a61',\n actionColor: '#024f83',\n icon: Info,\n },\n neutral: {\n backgroundColor: 'transparent',\n borderColor: '#b3b3b3',\n textColor: '#2f2f2f',\n actionColor: '#2f2f2f',\n icon: Info,\n },\n};\n\n/**\n * Banner component - Arbor Design System\n *\n * Informational banners with 4 variants (warning, destructive, information, neutral)\n * and optional title, icon, and action button.\n *\n * IMPORTANT: Banners are always displayed inline with page content (not overlays).\n * They flow with the document layout and push other content down.\n *\n * For overlay notifications in the top-right corner, use the Toast component instead.\n */\nexport const Banner = React.forwardRef<HTMLDivElement, BannerProps>(\n (\n {\n variant = 'information',\n title,\n message,\n icon = true,\n actionLabel,\n onAction,\n onClose,\n className,\n style,\n 'data-testid': dataTestId,\n },\n ref\n ) => {\n const config = variantConfig[variant];\n const DefaultIcon = config.icon;\n\n // Determine what icon to show\n const showIcon = icon !== false;\n const iconElement =\n icon === true || icon === undefined ? (\n <DefaultIcon size={20} strokeWidth={2} />\n ) : (\n icon\n );\n\n const containerStylesCombined: React.CSSProperties = {\n ...containerStyles,\n backgroundColor: config.backgroundColor,\n borderColor: config.borderColor,\n color: config.textColor,\n gap: showIcon ? '16px' : '0px',\n ...style,\n };\n\n const titleStylesCombined: React.CSSProperties = {\n ...titleStyles,\n color: config.textColor,\n };\n\n const messageStylesCombined: React.CSSProperties = {\n ...messageStyles,\n color: config.textColor,\n };\n\n const actionButtonStylesCombined: React.CSSProperties = {\n ...actionButtonStyles,\n color: config.actionColor,\n };\n\n const closeButtonStylesCombined: React.CSSProperties = {\n ...closeButtonStyles,\n color: config.textColor,\n };\n\n return (\n <div\n ref={ref}\n className={clsx('arbor-banner', `arbor-banner--${variant}`, className)}\n style={containerStylesCombined}\n data-testid={dataTestId}\n role=\"alert\"\n >\n {showIcon && (\n <div style={{ ...iconContainerStyles, color: config.textColor }}>\n {iconElement}\n </div>\n )}\n\n <div style={contentContainerStyles}>\n {title && <div style={titleStylesCombined}>{title}</div>}\n <p style={messageStylesCombined}>{message}</p>\n </div>\n\n {actionLabel && onAction && (\n <div style={actionContainerStyles}>\n <button\n type=\"button\"\n onClick={onAction}\n style={actionButtonStylesCombined}\n >\n {actionLabel}\n </button>\n </div>\n )}\n\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n style={closeButtonStylesCombined}\n aria-label=\"Close banner\"\n >\n <X size={20} />\n </button>\n )}\n </div>\n );\n }\n);\n\nBanner.displayName = 'Banner';\n"],"mappings":"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","names":[]}
|
package/dist/Banner.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface CheckboxProps {
|
|
4
|
+
/**
|
|
5
|
+
* The label for the checkbox
|
|
6
|
+
*/
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the checkbox is checked
|
|
10
|
+
*/
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Callback when checked state changes
|
|
14
|
+
*/
|
|
15
|
+
onChange?: (checked: boolean) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the checkbox is disabled
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Custom className
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Custom style
|
|
26
|
+
*/
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
/**
|
|
29
|
+
* Test ID for testing
|
|
30
|
+
*/
|
|
31
|
+
'data-testid'?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Name attribute for form submission
|
|
34
|
+
*/
|
|
35
|
+
name?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Value attribute for form submission
|
|
38
|
+
*/
|
|
39
|
+
value?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Indeterminate state (shows minus icon)
|
|
42
|
+
*/
|
|
43
|
+
indeterminate?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Checkbox component - Arbor Design System
|
|
47
|
+
*
|
|
48
|
+
* A checkbox input with label support.
|
|
49
|
+
*/
|
|
50
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
51
|
+
|
|
52
|
+
export { Checkbox, type CheckboxProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface CheckboxProps {
|
|
4
|
+
/**
|
|
5
|
+
* The label for the checkbox
|
|
6
|
+
*/
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the checkbox is checked
|
|
10
|
+
*/
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Callback when checked state changes
|
|
14
|
+
*/
|
|
15
|
+
onChange?: (checked: boolean) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the checkbox is disabled
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Custom className
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Custom style
|
|
26
|
+
*/
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
/**
|
|
29
|
+
* Test ID for testing
|
|
30
|
+
*/
|
|
31
|
+
'data-testid'?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Name attribute for form submission
|
|
34
|
+
*/
|
|
35
|
+
name?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Value attribute for form submission
|
|
38
|
+
*/
|
|
39
|
+
value?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Indeterminate state (shows minus icon)
|
|
42
|
+
*/
|
|
43
|
+
indeterminate?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Checkbox component - Arbor Design System
|
|
47
|
+
*
|
|
48
|
+
* A checkbox input with label support.
|
|
49
|
+
*/
|
|
50
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
51
|
+
|
|
52
|
+
export { Checkbox, type CheckboxProps };
|
package/dist/Checkbox.js
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
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/Checkbox/index.ts
|
|
31
|
+
var Checkbox_exports = {};
|
|
32
|
+
__export(Checkbox_exports, {
|
|
33
|
+
Checkbox: () => Checkbox
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Checkbox_exports);
|
|
36
|
+
|
|
37
|
+
// src/Checkbox/Checkbox.tsx
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_clsx = require("clsx");
|
|
40
|
+
var import_lucide_react = require("lucide-react");
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
var checkboxStyles = {
|
|
43
|
+
width: "16px",
|
|
44
|
+
height: "16px",
|
|
45
|
+
border: "1px solid #7e7e7e",
|
|
46
|
+
// grey-500
|
|
47
|
+
borderRadius: "4px",
|
|
48
|
+
display: "flex",
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
justifyContent: "center",
|
|
51
|
+
cursor: "pointer",
|
|
52
|
+
transition: "all 0.2s ease-in-out",
|
|
53
|
+
flexShrink: 0,
|
|
54
|
+
backgroundColor: "#ffffff"
|
|
55
|
+
};
|
|
56
|
+
var checkedStyles = {
|
|
57
|
+
backgroundColor: "#0e8a0e",
|
|
58
|
+
// brand-600
|
|
59
|
+
border: "1px solid #0e8a0e"
|
|
60
|
+
};
|
|
61
|
+
var checkedHoverStyles = {
|
|
62
|
+
backgroundColor: "#005700",
|
|
63
|
+
// brand-800
|
|
64
|
+
border: "1px solid #005700"
|
|
65
|
+
};
|
|
66
|
+
var uncheckedHoverStyles = {
|
|
67
|
+
border: "1px solid #474747"
|
|
68
|
+
// grey-700
|
|
69
|
+
};
|
|
70
|
+
var labelStyles = {
|
|
71
|
+
fontSize: "13px",
|
|
72
|
+
color: "#2f2f2f",
|
|
73
|
+
cursor: "pointer",
|
|
74
|
+
userSelect: "none",
|
|
75
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
76
|
+
};
|
|
77
|
+
var wrapperStyles = {
|
|
78
|
+
display: "flex",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
gap: "8px"
|
|
81
|
+
};
|
|
82
|
+
var Checkbox = React.forwardRef(
|
|
83
|
+
({
|
|
84
|
+
label,
|
|
85
|
+
checked = false,
|
|
86
|
+
onChange,
|
|
87
|
+
disabled = false,
|
|
88
|
+
className,
|
|
89
|
+
style,
|
|
90
|
+
"data-testid": dataTestId,
|
|
91
|
+
name,
|
|
92
|
+
value,
|
|
93
|
+
indeterminate = false
|
|
94
|
+
}, ref) => {
|
|
95
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
96
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
97
|
+
const checkboxId = React.useId();
|
|
98
|
+
const innerRef = React.useRef(null);
|
|
99
|
+
React.useEffect(() => {
|
|
100
|
+
const node = innerRef.current;
|
|
101
|
+
if (node) {
|
|
102
|
+
node.indeterminate = indeterminate;
|
|
103
|
+
if (typeof ref === "function") {
|
|
104
|
+
ref(node);
|
|
105
|
+
} else if (ref) {
|
|
106
|
+
ref.current = node;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, [indeterminate, ref]);
|
|
110
|
+
const handleChange = (e) => {
|
|
111
|
+
if (!disabled) {
|
|
112
|
+
onChange?.(e.target.checked);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const boxStyle = {
|
|
116
|
+
...checkboxStyles,
|
|
117
|
+
...(checked || indeterminate) && !disabled && checkedStyles,
|
|
118
|
+
...isHovered && !disabled && !(checked || indeterminate) && uncheckedHoverStyles,
|
|
119
|
+
...isHovered && !disabled && (checked || indeterminate) && checkedHoverStyles,
|
|
120
|
+
...disabled && !checked && !indeterminate && { backgroundColor: "#efefef", border: "1px solid #b3b3b3" },
|
|
121
|
+
...disabled && (checked || indeterminate) && { backgroundColor: "#b3b3b3", border: "1px solid #b3b3b3" },
|
|
122
|
+
...isFocused && !disabled && {
|
|
123
|
+
boxShadow: "0px 0px 0px 3px #3cad51"
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const checkmarkColor = "#ffffff";
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
className: (0, import_clsx.clsx)("arbor-checkbox-wrapper", className),
|
|
131
|
+
style: { ...wrapperStyles, ...style },
|
|
132
|
+
"data-testid": dataTestId,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
135
|
+
"input",
|
|
136
|
+
{
|
|
137
|
+
ref: innerRef,
|
|
138
|
+
id: checkboxId,
|
|
139
|
+
type: "checkbox",
|
|
140
|
+
checked,
|
|
141
|
+
onChange: handleChange,
|
|
142
|
+
onFocus: () => setIsFocused(true),
|
|
143
|
+
onBlur: () => setIsFocused(false),
|
|
144
|
+
disabled,
|
|
145
|
+
name,
|
|
146
|
+
value,
|
|
147
|
+
style: {
|
|
148
|
+
position: "absolute",
|
|
149
|
+
opacity: 0,
|
|
150
|
+
width: 0,
|
|
151
|
+
height: 0
|
|
152
|
+
},
|
|
153
|
+
"aria-checked": indeterminate ? "mixed" : checked
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
157
|
+
"label",
|
|
158
|
+
{
|
|
159
|
+
htmlFor: checkboxId,
|
|
160
|
+
onMouseEnter: () => !disabled && setIsHovered(true),
|
|
161
|
+
onMouseLeave: () => !disabled && setIsHovered(false),
|
|
162
|
+
style: {
|
|
163
|
+
display: "flex",
|
|
164
|
+
alignItems: "center",
|
|
165
|
+
gap: "8px",
|
|
166
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
167
|
+
},
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: boxStyle, children: (checked || indeterminate) && (indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Minus, { size: 12, color: checkmarkColor, strokeWidth: 3 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { size: 16, color: checkmarkColor, strokeWidth: 3 })) }),
|
|
170
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
171
|
+
"span",
|
|
172
|
+
{
|
|
173
|
+
style: {
|
|
174
|
+
...labelStyles,
|
|
175
|
+
color: disabled ? "#7e7e7e" : "#2f2f2f",
|
|
176
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
177
|
+
},
|
|
178
|
+
children: label
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
Checkbox.displayName = "Checkbox";
|
|
190
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
191
|
+
0 && (module.exports = {
|
|
192
|
+
Checkbox
|
|
193
|
+
});
|
|
194
|
+
//# sourceMappingURL=Checkbox.js.map
|