@tonyarbor/components 0.2.1 → 0.4.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/dist/Avatar.d.mts +42 -0
- package/dist/Avatar.d.ts +42 -0
- package/dist/Avatar.js +158 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Avatar.mjs +7 -0
- package/dist/Avatar.mjs.map +1 -0
- package/dist/Breadcrumbs.d.mts +51 -0
- package/dist/Breadcrumbs.d.ts +51 -0
- package/dist/Breadcrumbs.js +276 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.mjs +7 -0
- package/dist/Breadcrumbs.mjs.map +1 -0
- package/dist/SearchGlobal.d.mts +45 -0
- package/dist/SearchGlobal.d.ts +45 -0
- package/dist/SearchGlobal.js +209 -0
- package/dist/SearchGlobal.js.map +1 -0
- package/dist/SearchGlobal.mjs +7 -0
- package/dist/SearchGlobal.mjs.map +1 -0
- package/dist/SearchOnPage.d.mts +45 -0
- package/dist/SearchOnPage.d.ts +45 -0
- package/dist/SearchOnPage.js +171 -0
- package/dist/SearchOnPage.js.map +1 -0
- package/dist/SearchOnPage.mjs +7 -0
- package/dist/SearchOnPage.mjs.map +1 -0
- package/dist/chunk-B7RX3TPX.mjs +135 -0
- package/dist/chunk-B7RX3TPX.mjs.map +1 -0
- package/dist/chunk-JSG27ZZS.mjs +122 -0
- package/dist/chunk-JSG27ZZS.mjs.map +1 -0
- package/dist/chunk-RQP6ZGD7.mjs +240 -0
- package/dist/chunk-RQP6ZGD7.mjs.map +1 -0
- package/dist/chunk-UPBHDBAK.mjs +173 -0
- package/dist/chunk-UPBHDBAK.mjs.map +1 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +662 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -0
- package/package.json +21 -1
package/dist/index.js
CHANGED
|
@@ -30,7 +30,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
+
Avatar: () => Avatar,
|
|
33
34
|
Banner: () => Banner,
|
|
35
|
+
Breadcrumbs: () => Breadcrumbs,
|
|
34
36
|
Button: () => Button,
|
|
35
37
|
Card: () => Card,
|
|
36
38
|
Checkbox: () => Checkbox,
|
|
@@ -40,6 +42,8 @@ __export(src_exports, {
|
|
|
40
42
|
NumericInput: () => NumericInput,
|
|
41
43
|
Pagination: () => Pagination,
|
|
42
44
|
Radio: () => Radio,
|
|
45
|
+
SearchGlobal: () => SearchGlobal,
|
|
46
|
+
SearchOnPage: () => SearchOnPage,
|
|
43
47
|
Table: () => Table,
|
|
44
48
|
TableControls: () => TableControls,
|
|
45
49
|
TableFooterPagination: () => TableFooterPagination,
|
|
@@ -4042,9 +4046,665 @@ var Table = React19.forwardRef(
|
|
|
4042
4046
|
}
|
|
4043
4047
|
);
|
|
4044
4048
|
Table.displayName = "Table";
|
|
4049
|
+
|
|
4050
|
+
// src/Avatar/Avatar.tsx
|
|
4051
|
+
var React20 = __toESM(require("react"));
|
|
4052
|
+
var import_lucide_react10 = require("lucide-react");
|
|
4053
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4054
|
+
var sizeConfig = {
|
|
4055
|
+
small: {
|
|
4056
|
+
size: 20,
|
|
4057
|
+
fontSize: 0,
|
|
4058
|
+
// Too small for initials
|
|
4059
|
+
fontWeight: 400,
|
|
4060
|
+
iconSize: 12,
|
|
4061
|
+
borderRadius: "99px"
|
|
4062
|
+
},
|
|
4063
|
+
medium: {
|
|
4064
|
+
size: 32,
|
|
4065
|
+
fontSize: 13,
|
|
4066
|
+
fontWeight: 400,
|
|
4067
|
+
iconSize: 16,
|
|
4068
|
+
borderRadius: "99px"
|
|
4069
|
+
},
|
|
4070
|
+
large: {
|
|
4071
|
+
size: 48,
|
|
4072
|
+
fontSize: 13,
|
|
4073
|
+
fontWeight: 400,
|
|
4074
|
+
iconSize: 24,
|
|
4075
|
+
borderRadius: "4px"
|
|
4076
|
+
},
|
|
4077
|
+
"extra-large": {
|
|
4078
|
+
size: 96,
|
|
4079
|
+
fontSize: 27,
|
|
4080
|
+
fontWeight: 600,
|
|
4081
|
+
iconSize: 48,
|
|
4082
|
+
borderRadius: "8px"
|
|
4083
|
+
}
|
|
4084
|
+
};
|
|
4085
|
+
var Avatar = React20.forwardRef(
|
|
4086
|
+
({
|
|
4087
|
+
size = "medium",
|
|
4088
|
+
src,
|
|
4089
|
+
initials,
|
|
4090
|
+
alt = "Avatar",
|
|
4091
|
+
className,
|
|
4092
|
+
style,
|
|
4093
|
+
"data-testid": dataTestId
|
|
4094
|
+
}, ref) => {
|
|
4095
|
+
const [isHovered, setIsHovered] = React20.useState(false);
|
|
4096
|
+
const [imageError, setImageError] = React20.useState(false);
|
|
4097
|
+
const config = sizeConfig[size];
|
|
4098
|
+
const hasHoverState = size === "small";
|
|
4099
|
+
const containerStyles6 = {
|
|
4100
|
+
width: `${config.size}px`,
|
|
4101
|
+
height: `${config.size}px`,
|
|
4102
|
+
borderRadius: config.borderRadius,
|
|
4103
|
+
border: "1px solid #efefef",
|
|
4104
|
+
overflow: "hidden",
|
|
4105
|
+
position: "relative",
|
|
4106
|
+
backgroundColor: "#f8f8f8",
|
|
4107
|
+
display: "flex",
|
|
4108
|
+
alignItems: "center",
|
|
4109
|
+
justifyContent: "center",
|
|
4110
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4111
|
+
cursor: "default",
|
|
4112
|
+
boxSizing: "border-box",
|
|
4113
|
+
...style
|
|
4114
|
+
};
|
|
4115
|
+
const hoverOverlayStyles = {
|
|
4116
|
+
position: "absolute",
|
|
4117
|
+
inset: 0,
|
|
4118
|
+
pointerEvents: "none",
|
|
4119
|
+
boxShadow: isHovered && hasHoverState ? "inset 0px 4px 100px 0px rgba(32, 32, 32, 0.3)" : "none",
|
|
4120
|
+
borderRadius: config.borderRadius,
|
|
4121
|
+
transition: "box-shadow 0.2s ease-in-out"
|
|
4122
|
+
};
|
|
4123
|
+
const imageStyles = {
|
|
4124
|
+
width: "100%",
|
|
4125
|
+
height: "100%",
|
|
4126
|
+
objectFit: "cover"
|
|
4127
|
+
};
|
|
4128
|
+
const initialsStyles = {
|
|
4129
|
+
fontSize: `${config.fontSize}px`,
|
|
4130
|
+
fontWeight: config.fontWeight,
|
|
4131
|
+
color: "#2f2f2f",
|
|
4132
|
+
lineHeight: 1.5,
|
|
4133
|
+
textAlign: "center",
|
|
4134
|
+
userSelect: "none"
|
|
4135
|
+
};
|
|
4136
|
+
const showImage = src && !imageError;
|
|
4137
|
+
const showInitials = !showImage && initials && size !== "small";
|
|
4138
|
+
const showPlaceholder = !showImage && !showInitials;
|
|
4139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
4140
|
+
"div",
|
|
4141
|
+
{
|
|
4142
|
+
ref,
|
|
4143
|
+
className,
|
|
4144
|
+
style: containerStyles6,
|
|
4145
|
+
onMouseEnter: () => setIsHovered(true),
|
|
4146
|
+
onMouseLeave: () => setIsHovered(false),
|
|
4147
|
+
"data-testid": dataTestId,
|
|
4148
|
+
children: [
|
|
4149
|
+
showImage && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4150
|
+
"img",
|
|
4151
|
+
{
|
|
4152
|
+
src,
|
|
4153
|
+
alt,
|
|
4154
|
+
style: imageStyles,
|
|
4155
|
+
onError: () => setImageError(true)
|
|
4156
|
+
}
|
|
4157
|
+
),
|
|
4158
|
+
showInitials && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: initialsStyles, children: initials.slice(0, 2).toUpperCase() }),
|
|
4159
|
+
showPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.User, { size: config.iconSize, color: "#d1d1d1", strokeWidth: 2 }),
|
|
4160
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: hoverOverlayStyles })
|
|
4161
|
+
]
|
|
4162
|
+
}
|
|
4163
|
+
);
|
|
4164
|
+
}
|
|
4165
|
+
);
|
|
4166
|
+
Avatar.displayName = "Avatar";
|
|
4167
|
+
|
|
4168
|
+
// src/SearchGlobal/SearchGlobal.tsx
|
|
4169
|
+
var React21 = __toESM(require("react"));
|
|
4170
|
+
var import_lucide_react11 = require("lucide-react");
|
|
4171
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4172
|
+
var SearchGlobal = React21.forwardRef(
|
|
4173
|
+
({
|
|
4174
|
+
value = "",
|
|
4175
|
+
onChange,
|
|
4176
|
+
onSubmit,
|
|
4177
|
+
onClear,
|
|
4178
|
+
placeholder = "Search",
|
|
4179
|
+
className,
|
|
4180
|
+
style,
|
|
4181
|
+
"data-testid": dataTestId
|
|
4182
|
+
}, ref) => {
|
|
4183
|
+
const [isFocused, setIsFocused] = React21.useState(false);
|
|
4184
|
+
const [isHovered, setIsHovered] = React21.useState(false);
|
|
4185
|
+
const inputRef = React21.useRef(null);
|
|
4186
|
+
React21.useImperativeHandle(ref, () => inputRef.current);
|
|
4187
|
+
const handleFocus = () => {
|
|
4188
|
+
setIsFocused(true);
|
|
4189
|
+
};
|
|
4190
|
+
const handleBlur = () => {
|
|
4191
|
+
setIsFocused(false);
|
|
4192
|
+
};
|
|
4193
|
+
const handleChange = (e) => {
|
|
4194
|
+
onChange?.(e.target.value);
|
|
4195
|
+
};
|
|
4196
|
+
const handleKeyDown = (e) => {
|
|
4197
|
+
if (e.key === "Enter") {
|
|
4198
|
+
onSubmit?.(value);
|
|
4199
|
+
}
|
|
4200
|
+
};
|
|
4201
|
+
const handleClear = () => {
|
|
4202
|
+
onChange?.("");
|
|
4203
|
+
onClear?.();
|
|
4204
|
+
inputRef.current?.focus();
|
|
4205
|
+
};
|
|
4206
|
+
const containerStyles6 = {
|
|
4207
|
+
position: "relative",
|
|
4208
|
+
width: isFocused ? "300px" : "160px",
|
|
4209
|
+
height: "32px",
|
|
4210
|
+
backgroundColor: isFocused ? "#ffffff" : isHovered ? "#efefef" : "#f8f8f8",
|
|
4211
|
+
borderRadius: "16px",
|
|
4212
|
+
padding: "8px 16px",
|
|
4213
|
+
display: "flex",
|
|
4214
|
+
alignItems: "center",
|
|
4215
|
+
gap: isFocused ? "8px" : "8px",
|
|
4216
|
+
cursor: "text",
|
|
4217
|
+
transition: "all 0.2s ease-in-out",
|
|
4218
|
+
boxSizing: "border-box",
|
|
4219
|
+
border: isFocused ? "1px solid #efefef" : "none",
|
|
4220
|
+
boxShadow: isFocused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
4221
|
+
marginLeft: isFocused ? "-140px" : "0",
|
|
4222
|
+
// Expand to the left
|
|
4223
|
+
...style
|
|
4224
|
+
};
|
|
4225
|
+
const iconContainerStyles2 = {
|
|
4226
|
+
display: "flex",
|
|
4227
|
+
alignItems: "center",
|
|
4228
|
+
justifyContent: "center",
|
|
4229
|
+
flexShrink: 0,
|
|
4230
|
+
padding: "2px"
|
|
4231
|
+
};
|
|
4232
|
+
const inputStyles5 = {
|
|
4233
|
+
border: "none",
|
|
4234
|
+
outline: "none",
|
|
4235
|
+
backgroundColor: "transparent",
|
|
4236
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4237
|
+
fontSize: "13px",
|
|
4238
|
+
fontWeight: 400,
|
|
4239
|
+
color: "#2f2f2f",
|
|
4240
|
+
lineHeight: "1.5",
|
|
4241
|
+
flex: 1,
|
|
4242
|
+
width: "100%",
|
|
4243
|
+
minWidth: 0
|
|
4244
|
+
};
|
|
4245
|
+
const keyboardShortcutStyles = {
|
|
4246
|
+
display: "flex",
|
|
4247
|
+
alignItems: "center",
|
|
4248
|
+
gap: "0px",
|
|
4249
|
+
flexShrink: 0
|
|
4250
|
+
};
|
|
4251
|
+
const keyStyles = {
|
|
4252
|
+
border: "1px solid #2f2f2f",
|
|
4253
|
+
borderRadius: "5px",
|
|
4254
|
+
padding: "0px 3px",
|
|
4255
|
+
height: "16px",
|
|
4256
|
+
display: "flex",
|
|
4257
|
+
alignItems: "center",
|
|
4258
|
+
justifyContent: "center",
|
|
4259
|
+
fontFamily: "'Work Sans', sans-serif",
|
|
4260
|
+
fontSize: "8px",
|
|
4261
|
+
fontWeight: 400,
|
|
4262
|
+
color: "#2f2f2f",
|
|
4263
|
+
letterSpacing: "-0.08px",
|
|
4264
|
+
lineHeight: "1.5",
|
|
4265
|
+
minWidth: "16px"
|
|
4266
|
+
};
|
|
4267
|
+
const plusStyles = {
|
|
4268
|
+
fontFamily: "'Work Sans', sans-serif",
|
|
4269
|
+
fontSize: "8px",
|
|
4270
|
+
fontWeight: 400,
|
|
4271
|
+
color: "#2f2f2f",
|
|
4272
|
+
letterSpacing: "-0.08px",
|
|
4273
|
+
lineHeight: "1.5",
|
|
4274
|
+
padding: "0 2px"
|
|
4275
|
+
};
|
|
4276
|
+
const clearButtonStyles = {
|
|
4277
|
+
display: "flex",
|
|
4278
|
+
alignItems: "center",
|
|
4279
|
+
justifyContent: "center",
|
|
4280
|
+
flexShrink: 0,
|
|
4281
|
+
width: "16px",
|
|
4282
|
+
height: "16px",
|
|
4283
|
+
cursor: "pointer",
|
|
4284
|
+
border: "none",
|
|
4285
|
+
background: "none",
|
|
4286
|
+
padding: 0
|
|
4287
|
+
};
|
|
4288
|
+
const showKeyboardShortcut = isHovered && !isFocused;
|
|
4289
|
+
const showClearButton = isFocused;
|
|
4290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4291
|
+
"div",
|
|
4292
|
+
{
|
|
4293
|
+
className,
|
|
4294
|
+
style: containerStyles6,
|
|
4295
|
+
onMouseEnter: () => setIsHovered(true),
|
|
4296
|
+
onMouseLeave: () => setIsHovered(false),
|
|
4297
|
+
onClick: () => inputRef.current?.focus(),
|
|
4298
|
+
"data-testid": dataTestId,
|
|
4299
|
+
children: [
|
|
4300
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: iconContainerStyles2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.Search, { size: 12, color: "#2f2f2f", strokeWidth: 2 }) }),
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4302
|
+
"input",
|
|
4303
|
+
{
|
|
4304
|
+
ref: inputRef,
|
|
4305
|
+
type: "text",
|
|
4306
|
+
value,
|
|
4307
|
+
onChange: handleChange,
|
|
4308
|
+
onFocus: handleFocus,
|
|
4309
|
+
onBlur: handleBlur,
|
|
4310
|
+
onKeyDown: handleKeyDown,
|
|
4311
|
+
placeholder: isFocused ? "" : placeholder,
|
|
4312
|
+
style: inputStyles5
|
|
4313
|
+
}
|
|
4314
|
+
),
|
|
4315
|
+
showKeyboardShortcut && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: keyboardShortcutStyles, children: [
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: keyStyles, children: "\u2318" }),
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: plusStyles, children: "+" }),
|
|
4318
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: keyStyles, children: "K" })
|
|
4319
|
+
] }),
|
|
4320
|
+
showClearButton && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4321
|
+
"button",
|
|
4322
|
+
{
|
|
4323
|
+
type: "button",
|
|
4324
|
+
onClick: handleClear,
|
|
4325
|
+
style: clearButtonStyles,
|
|
4326
|
+
"aria-label": "Clear search",
|
|
4327
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.X, { size: 13.333, color: "#2f2f2f", strokeWidth: 2 })
|
|
4328
|
+
}
|
|
4329
|
+
)
|
|
4330
|
+
]
|
|
4331
|
+
}
|
|
4332
|
+
);
|
|
4333
|
+
}
|
|
4334
|
+
);
|
|
4335
|
+
SearchGlobal.displayName = "SearchGlobal";
|
|
4336
|
+
|
|
4337
|
+
// src/SearchOnPage/SearchOnPage.tsx
|
|
4338
|
+
var React22 = __toESM(require("react"));
|
|
4339
|
+
var import_lucide_react12 = require("lucide-react");
|
|
4340
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4341
|
+
var SearchOnPage = React22.forwardRef(
|
|
4342
|
+
({
|
|
4343
|
+
value = "",
|
|
4344
|
+
onChange,
|
|
4345
|
+
onSubmit,
|
|
4346
|
+
onClear,
|
|
4347
|
+
placeholder = "Search Reports",
|
|
4348
|
+
className,
|
|
4349
|
+
style,
|
|
4350
|
+
"data-testid": dataTestId
|
|
4351
|
+
}, ref) => {
|
|
4352
|
+
const [isFocused, setIsFocused] = React22.useState(false);
|
|
4353
|
+
const [isHovered, setIsHovered] = React22.useState(false);
|
|
4354
|
+
const inputRef = React22.useRef(null);
|
|
4355
|
+
React22.useImperativeHandle(ref, () => inputRef.current);
|
|
4356
|
+
const handleFocus = () => {
|
|
4357
|
+
setIsFocused(true);
|
|
4358
|
+
};
|
|
4359
|
+
const handleBlur = () => {
|
|
4360
|
+
setIsFocused(false);
|
|
4361
|
+
};
|
|
4362
|
+
const handleChange = (e) => {
|
|
4363
|
+
onChange?.(e.target.value);
|
|
4364
|
+
};
|
|
4365
|
+
const handleKeyDown = (e) => {
|
|
4366
|
+
if (e.key === "Enter") {
|
|
4367
|
+
onSubmit?.(value);
|
|
4368
|
+
}
|
|
4369
|
+
};
|
|
4370
|
+
const handleClear = () => {
|
|
4371
|
+
onChange?.("");
|
|
4372
|
+
onClear?.();
|
|
4373
|
+
inputRef.current?.focus();
|
|
4374
|
+
};
|
|
4375
|
+
const containerStyles6 = {
|
|
4376
|
+
position: "relative",
|
|
4377
|
+
width: "200px",
|
|
4378
|
+
height: "32px",
|
|
4379
|
+
backgroundColor: isFocused ? "#ffffff" : isHovered ? "#efefef" : "#ffffff",
|
|
4380
|
+
borderRadius: "16px",
|
|
4381
|
+
padding: "8px 16px",
|
|
4382
|
+
display: "flex",
|
|
4383
|
+
alignItems: "center",
|
|
4384
|
+
gap: "8px",
|
|
4385
|
+
cursor: "text",
|
|
4386
|
+
transition: "all 0.2s ease-in-out",
|
|
4387
|
+
boxSizing: "border-box",
|
|
4388
|
+
border: isFocused ? "1px solid #efefef" : "none",
|
|
4389
|
+
boxShadow: isFocused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
4390
|
+
...style
|
|
4391
|
+
};
|
|
4392
|
+
const iconContainerStyles2 = {
|
|
4393
|
+
display: "flex",
|
|
4394
|
+
alignItems: "center",
|
|
4395
|
+
justifyContent: "center",
|
|
4396
|
+
flexShrink: 0,
|
|
4397
|
+
padding: "2px"
|
|
4398
|
+
};
|
|
4399
|
+
const inputStyles5 = {
|
|
4400
|
+
border: "none",
|
|
4401
|
+
outline: "none",
|
|
4402
|
+
backgroundColor: "transparent",
|
|
4403
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4404
|
+
fontSize: "13px",
|
|
4405
|
+
fontWeight: 400,
|
|
4406
|
+
color: "#2f2f2f",
|
|
4407
|
+
lineHeight: "1.5",
|
|
4408
|
+
flex: 1,
|
|
4409
|
+
width: "100%",
|
|
4410
|
+
minWidth: 0
|
|
4411
|
+
};
|
|
4412
|
+
const clearButtonStyles = {
|
|
4413
|
+
display: "flex",
|
|
4414
|
+
alignItems: "center",
|
|
4415
|
+
justifyContent: "center",
|
|
4416
|
+
flexShrink: 0,
|
|
4417
|
+
width: "16px",
|
|
4418
|
+
height: "16px",
|
|
4419
|
+
cursor: "pointer",
|
|
4420
|
+
border: "none",
|
|
4421
|
+
background: "none",
|
|
4422
|
+
padding: 0
|
|
4423
|
+
};
|
|
4424
|
+
const showClearButton = isFocused && value.length > 0;
|
|
4425
|
+
const iconColor = isFocused || isHovered ? "#2f2f2f" : "#595959";
|
|
4426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4427
|
+
"div",
|
|
4428
|
+
{
|
|
4429
|
+
className,
|
|
4430
|
+
style: containerStyles6,
|
|
4431
|
+
onMouseEnter: () => setIsHovered(true),
|
|
4432
|
+
onMouseLeave: () => setIsHovered(false),
|
|
4433
|
+
onClick: () => inputRef.current?.focus(),
|
|
4434
|
+
"data-testid": dataTestId,
|
|
4435
|
+
children: [
|
|
4436
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: iconContainerStyles2, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.Search, { size: 12, color: iconColor, strokeWidth: 2 }) }),
|
|
4437
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4438
|
+
"input",
|
|
4439
|
+
{
|
|
4440
|
+
ref: inputRef,
|
|
4441
|
+
type: "text",
|
|
4442
|
+
value,
|
|
4443
|
+
onChange: handleChange,
|
|
4444
|
+
onFocus: handleFocus,
|
|
4445
|
+
onBlur: handleBlur,
|
|
4446
|
+
onKeyDown: handleKeyDown,
|
|
4447
|
+
placeholder: isFocused ? "" : placeholder,
|
|
4448
|
+
style: inputStyles5
|
|
4449
|
+
}
|
|
4450
|
+
),
|
|
4451
|
+
showClearButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4452
|
+
"button",
|
|
4453
|
+
{
|
|
4454
|
+
type: "button",
|
|
4455
|
+
onClick: handleClear,
|
|
4456
|
+
style: clearButtonStyles,
|
|
4457
|
+
"aria-label": "Clear search",
|
|
4458
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.X, { size: 13.333, color: "#2f2f2f", strokeWidth: 2 })
|
|
4459
|
+
}
|
|
4460
|
+
)
|
|
4461
|
+
]
|
|
4462
|
+
}
|
|
4463
|
+
);
|
|
4464
|
+
}
|
|
4465
|
+
);
|
|
4466
|
+
SearchOnPage.displayName = "SearchOnPage";
|
|
4467
|
+
|
|
4468
|
+
// src/Breadcrumbs/Breadcrumbs.tsx
|
|
4469
|
+
var React23 = __toESM(require("react"));
|
|
4470
|
+
var import_lucide_react13 = require("lucide-react");
|
|
4471
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4472
|
+
var Breadcrumbs = React23.forwardRef(
|
|
4473
|
+
({
|
|
4474
|
+
items,
|
|
4475
|
+
onCopy,
|
|
4476
|
+
className,
|
|
4477
|
+
style,
|
|
4478
|
+
"data-testid": dataTestId
|
|
4479
|
+
}, ref) => {
|
|
4480
|
+
const [hoveredIndex, setHoveredIndex] = React23.useState(null);
|
|
4481
|
+
const [focusedIndex, setFocusedIndex] = React23.useState(null);
|
|
4482
|
+
const [showCopyTooltip, setShowCopyTooltip] = React23.useState(false);
|
|
4483
|
+
const [ellipsisFocused, setEllipsisFocused] = React23.useState(false);
|
|
4484
|
+
const [ellipsisHovered, setEllipsisHovered] = React23.useState(false);
|
|
4485
|
+
const displayItems = React23.useMemo(() => {
|
|
4486
|
+
if (items.length > 6) {
|
|
4487
|
+
return [items[0], { label: "...", isEllipsis: true }, items[items.length - 1]];
|
|
4488
|
+
}
|
|
4489
|
+
return items;
|
|
4490
|
+
}, [items]);
|
|
4491
|
+
const handleCopy = () => {
|
|
4492
|
+
onCopy?.();
|
|
4493
|
+
const trail = items.map((item) => item.label).join(" / ");
|
|
4494
|
+
navigator.clipboard.writeText(trail);
|
|
4495
|
+
};
|
|
4496
|
+
const containerStyles6 = {
|
|
4497
|
+
display: "flex",
|
|
4498
|
+
alignItems: "center",
|
|
4499
|
+
gap: "8px",
|
|
4500
|
+
...style
|
|
4501
|
+
};
|
|
4502
|
+
const breadcrumbItemStyles = (index, isActive, isEllipsis) => {
|
|
4503
|
+
const isFocused = focusedIndex === index;
|
|
4504
|
+
if (isEllipsis) {
|
|
4505
|
+
return {
|
|
4506
|
+
display: "flex",
|
|
4507
|
+
alignItems: "center",
|
|
4508
|
+
gap: "4px",
|
|
4509
|
+
height: "24px",
|
|
4510
|
+
overflow: "hidden"
|
|
4511
|
+
};
|
|
4512
|
+
}
|
|
4513
|
+
return {
|
|
4514
|
+
display: "flex",
|
|
4515
|
+
alignItems: "center",
|
|
4516
|
+
gap: "4px",
|
|
4517
|
+
height: "24px",
|
|
4518
|
+
overflow: "hidden",
|
|
4519
|
+
backgroundColor: isFocused ? "rgba(255, 255, 255, 0.01)" : "transparent",
|
|
4520
|
+
borderRadius: "99px",
|
|
4521
|
+
boxShadow: isFocused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
4522
|
+
padding: isFocused ? "0 6px" : "0 2px",
|
|
4523
|
+
margin: isFocused ? "0" : "0 4px",
|
|
4524
|
+
cursor: isActive ? "default" : "pointer",
|
|
4525
|
+
textDecoration: "none"
|
|
4526
|
+
};
|
|
4527
|
+
};
|
|
4528
|
+
const linkStyles = (isActive, isHovered) => ({
|
|
4529
|
+
fontFamily: isActive ? "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" : "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4530
|
+
fontSize: "13px",
|
|
4531
|
+
fontWeight: isActive ? 600 : 400,
|
|
4532
|
+
color: isActive ? isHovered ? "#0e8a0e" : "#2f2f2f" : isHovered ? "#0e8a0e" : "#595959",
|
|
4533
|
+
lineHeight: "1.5",
|
|
4534
|
+
whiteSpace: "nowrap"
|
|
4535
|
+
});
|
|
4536
|
+
const dividerStyles = {
|
|
4537
|
+
fontFamily: "'PT Sans', sans-serif",
|
|
4538
|
+
fontSize: "14px",
|
|
4539
|
+
color: "#595959",
|
|
4540
|
+
lineHeight: "normal",
|
|
4541
|
+
whiteSpace: "nowrap"
|
|
4542
|
+
};
|
|
4543
|
+
const ellipsisButtonStyles = {
|
|
4544
|
+
display: "flex",
|
|
4545
|
+
alignItems: "center",
|
|
4546
|
+
justifyContent: "center",
|
|
4547
|
+
width: "24px",
|
|
4548
|
+
height: "24px",
|
|
4549
|
+
borderRadius: "99px",
|
|
4550
|
+
border: "none",
|
|
4551
|
+
background: "transparent",
|
|
4552
|
+
cursor: "pointer",
|
|
4553
|
+
backgroundColor: ellipsisFocused ? "rgba(255, 255, 255, 0.01)" : ellipsisHovered ? "#efefef" : "transparent",
|
|
4554
|
+
boxShadow: ellipsisFocused ? "0px 0px 0px 3px #3cad51" : "none"
|
|
4555
|
+
};
|
|
4556
|
+
const copyButtonStyles = {
|
|
4557
|
+
display: "flex",
|
|
4558
|
+
alignItems: "center",
|
|
4559
|
+
justifyContent: "center",
|
|
4560
|
+
width: "24px",
|
|
4561
|
+
height: "24px",
|
|
4562
|
+
borderRadius: "99px",
|
|
4563
|
+
border: "none",
|
|
4564
|
+
background: showCopyTooltip ? "#efefef" : "transparent",
|
|
4565
|
+
cursor: "pointer",
|
|
4566
|
+
position: "relative"
|
|
4567
|
+
};
|
|
4568
|
+
const tooltipStyles2 = {
|
|
4569
|
+
position: "absolute",
|
|
4570
|
+
top: "100%",
|
|
4571
|
+
left: "50%",
|
|
4572
|
+
transform: "translateX(-50%)",
|
|
4573
|
+
marginTop: "8px",
|
|
4574
|
+
backgroundColor: "#2f2f2f",
|
|
4575
|
+
color: "white",
|
|
4576
|
+
padding: "12px",
|
|
4577
|
+
borderRadius: "8px",
|
|
4578
|
+
fontSize: "13px",
|
|
4579
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4580
|
+
fontWeight: 400,
|
|
4581
|
+
lineHeight: "1.5",
|
|
4582
|
+
whiteSpace: "nowrap",
|
|
4583
|
+
boxShadow: "0px 4px 12px rgba(32, 32, 32, 0.08)",
|
|
4584
|
+
zIndex: 1e3
|
|
4585
|
+
};
|
|
4586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4587
|
+
"div",
|
|
4588
|
+
{
|
|
4589
|
+
ref,
|
|
4590
|
+
className,
|
|
4591
|
+
style: containerStyles6,
|
|
4592
|
+
"data-testid": dataTestId,
|
|
4593
|
+
children: displayItems.map((item, index) => {
|
|
4594
|
+
const isActive = index === displayItems.length - 1;
|
|
4595
|
+
const isEllipsis = "isEllipsis" in item && item.isEllipsis;
|
|
4596
|
+
if (isEllipsis) {
|
|
4597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(React23.Fragment, { children: [
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4599
|
+
"button",
|
|
4600
|
+
{
|
|
4601
|
+
style: ellipsisButtonStyles,
|
|
4602
|
+
onFocus: () => setEllipsisFocused(true),
|
|
4603
|
+
onBlur: () => setEllipsisFocused(false),
|
|
4604
|
+
onMouseEnter: () => setEllipsisHovered(true),
|
|
4605
|
+
onMouseLeave: () => setEllipsisHovered(false),
|
|
4606
|
+
"aria-label": "More breadcrumbs",
|
|
4607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4608
|
+
import_lucide_react13.MoreHorizontal,
|
|
4609
|
+
{
|
|
4610
|
+
size: 12,
|
|
4611
|
+
color: "#2f2f2f",
|
|
4612
|
+
strokeWidth: 2,
|
|
4613
|
+
style: { display: "block", flexShrink: 0 }
|
|
4614
|
+
}
|
|
4615
|
+
)
|
|
4616
|
+
}
|
|
4617
|
+
),
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: dividerStyles, children: " /" })
|
|
4619
|
+
] }, `ellipsis-${index}`);
|
|
4620
|
+
}
|
|
4621
|
+
const breadcrumbItem = item;
|
|
4622
|
+
if (isActive) {
|
|
4623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(React23.Fragment, { children: [
|
|
4624
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4625
|
+
"div",
|
|
4626
|
+
{
|
|
4627
|
+
style: breadcrumbItemStyles(index, true),
|
|
4628
|
+
onMouseEnter: () => setHoveredIndex(index),
|
|
4629
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
4630
|
+
onFocus: () => setFocusedIndex(index),
|
|
4631
|
+
onBlur: () => setFocusedIndex(null),
|
|
4632
|
+
tabIndex: 0,
|
|
4633
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: linkStyles(true, hoveredIndex === index), children: breadcrumbItem.label })
|
|
4634
|
+
}
|
|
4635
|
+
),
|
|
4636
|
+
onCopy && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4637
|
+
"button",
|
|
4638
|
+
{
|
|
4639
|
+
style: copyButtonStyles,
|
|
4640
|
+
onClick: handleCopy,
|
|
4641
|
+
onMouseEnter: () => setShowCopyTooltip(true),
|
|
4642
|
+
onMouseLeave: () => setShowCopyTooltip(false),
|
|
4643
|
+
"aria-label": "Copy breadcrumb trail",
|
|
4644
|
+
children: [
|
|
4645
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4646
|
+
import_lucide_react13.Link,
|
|
4647
|
+
{
|
|
4648
|
+
size: 12,
|
|
4649
|
+
color: "#2f2f2f",
|
|
4650
|
+
strokeWidth: 2,
|
|
4651
|
+
style: { display: "block", flexShrink: 0 }
|
|
4652
|
+
}
|
|
4653
|
+
),
|
|
4654
|
+
showCopyTooltip && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: tooltipStyles2, children: "Copy breadcrumb trail" })
|
|
4655
|
+
]
|
|
4656
|
+
}
|
|
4657
|
+
)
|
|
4658
|
+
] }, index);
|
|
4659
|
+
}
|
|
4660
|
+
const Element = breadcrumbItem.href ? "a" : "button";
|
|
4661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(React23.Fragment, { children: [
|
|
4662
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4663
|
+
Element,
|
|
4664
|
+
{
|
|
4665
|
+
...breadcrumbItem.href ? { href: breadcrumbItem.href } : {},
|
|
4666
|
+
style: {
|
|
4667
|
+
...breadcrumbItemStyles(index, false),
|
|
4668
|
+
border: "none",
|
|
4669
|
+
background: "transparent"
|
|
4670
|
+
},
|
|
4671
|
+
onClick: (e) => {
|
|
4672
|
+
if (!breadcrumbItem.href && breadcrumbItem.onClick) {
|
|
4673
|
+
e.preventDefault();
|
|
4674
|
+
breadcrumbItem.onClick();
|
|
4675
|
+
}
|
|
4676
|
+
},
|
|
4677
|
+
onMouseEnter: () => setHoveredIndex(index),
|
|
4678
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
4679
|
+
onFocus: () => setFocusedIndex(index),
|
|
4680
|
+
onBlur: () => setFocusedIndex(null),
|
|
4681
|
+
children: [
|
|
4682
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: linkStyles(false, hoveredIndex === index), children: breadcrumbItem.label }),
|
|
4683
|
+
breadcrumbItem.hasDropdown && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4684
|
+
import_lucide_react13.ChevronDown,
|
|
4685
|
+
{
|
|
4686
|
+
size: 12,
|
|
4687
|
+
color: hoveredIndex === index ? "#0e8a0e" : "#595959",
|
|
4688
|
+
strokeWidth: 2,
|
|
4689
|
+
style: { marginLeft: "2px", display: "inline-block", flexShrink: 0 }
|
|
4690
|
+
}
|
|
4691
|
+
)
|
|
4692
|
+
]
|
|
4693
|
+
}
|
|
4694
|
+
),
|
|
4695
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: dividerStyles, children: " /" })
|
|
4696
|
+
] }, index);
|
|
4697
|
+
})
|
|
4698
|
+
}
|
|
4699
|
+
);
|
|
4700
|
+
}
|
|
4701
|
+
);
|
|
4702
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
4045
4703
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4046
4704
|
0 && (module.exports = {
|
|
4705
|
+
Avatar,
|
|
4047
4706
|
Banner,
|
|
4707
|
+
Breadcrumbs,
|
|
4048
4708
|
Button,
|
|
4049
4709
|
Card,
|
|
4050
4710
|
Checkbox,
|
|
@@ -4054,6 +4714,8 @@ Table.displayName = "Table";
|
|
|
4054
4714
|
NumericInput,
|
|
4055
4715
|
Pagination,
|
|
4056
4716
|
Radio,
|
|
4717
|
+
SearchGlobal,
|
|
4718
|
+
SearchOnPage,
|
|
4057
4719
|
Table,
|
|
4058
4720
|
TableControls,
|
|
4059
4721
|
TableFooterPagination,
|