@deepnoid/ui 0.1.201 → 0.1.203
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/.turbo/turbo-build.log +147 -147
- package/dist/{chunk-YBXBTE5T.mjs → chunk-COGGK5Q6.mjs} +1 -1
- package/dist/{chunk-75ZDPLJ4.mjs → chunk-K2RW5KLO.mjs} +20 -0
- package/dist/{chunk-KYWCJIXI.mjs → chunk-W3V4SZV5.mjs} +24 -68
- package/dist/components/picker/index.js +17 -0
- package/dist/components/picker/index.mjs +2 -2
- package/dist/components/picker/timePicker.js +508 -60
- package/dist/components/picker/timePicker.mjs +10 -2
- package/dist/components/select/index.js +476 -28
- package/dist/components/select/index.mjs +9 -1
- package/dist/components/select/select.d.mts +1 -0
- package/dist/components/select/select.d.ts +1 -0
- package/dist/components/select/select.js +476 -28
- package/dist/components/select/select.mjs +9 -1
- package/dist/components/table/index.js +19 -63
- package/dist/components/table/index.mjs +1 -1
- package/dist/components/table/table-body.js +19 -63
- package/dist/components/table/table-body.mjs +1 -1
- package/dist/components/table/table-head.d.mts +1 -1
- package/dist/components/table/table-head.d.ts +1 -1
- package/dist/components/table/table-head.js +19 -63
- package/dist/components/table/table-head.mjs +1 -1
- package/dist/components/table/table.js +19 -63
- package/dist/components/table/table.mjs +1 -1
- package/dist/index.js +36 -63
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
|
@@ -106,7 +106,7 @@ __export(timePicker_exports, {
|
|
|
106
106
|
timePickerStyle: () => timePickerStyle
|
|
107
107
|
});
|
|
108
108
|
module.exports = __toCommonJS(timePicker_exports);
|
|
109
|
-
var
|
|
109
|
+
var import_react4 = require("react");
|
|
110
110
|
var import_react_dom2 = require("react-dom");
|
|
111
111
|
|
|
112
112
|
// src/utils/tailwind-variants.ts
|
|
@@ -5158,7 +5158,7 @@ var Icon = ({ name, size = "md", fill = false, className, onClick, ...props }) =
|
|
|
5158
5158
|
var Icon_default = Icon;
|
|
5159
5159
|
|
|
5160
5160
|
// src/components/select/select.tsx
|
|
5161
|
-
var
|
|
5161
|
+
var import_react3 = require("react");
|
|
5162
5162
|
var import_react_dom = require("react-dom");
|
|
5163
5163
|
|
|
5164
5164
|
// src/utils/clsx.ts
|
|
@@ -5201,10 +5201,441 @@ function toVal(mix) {
|
|
|
5201
5201
|
return str;
|
|
5202
5202
|
}
|
|
5203
5203
|
|
|
5204
|
-
// src/components/
|
|
5204
|
+
// src/components/ripple/ripple.tsx
|
|
5205
|
+
var import_framer_motion = require("framer-motion");
|
|
5205
5206
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
5207
|
+
var Ripple = (props) => {
|
|
5208
|
+
const { ripples = [], motionProps, color = "currentColor", style, onClear } = props;
|
|
5209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: ripples.map((ripple) => {
|
|
5210
|
+
const duration = (0, import_framer_motion.clamp)(ripple.size > 100 ? 0.75 : 0.5, 0.01 * ripple.size, 0.2);
|
|
5211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_framer_motion.LazyMotion, { features: import_framer_motion.domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_framer_motion.AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
5212
|
+
import_framer_motion.m.span,
|
|
5213
|
+
{
|
|
5214
|
+
animate: { transform: "scale(2)", opacity: 0 },
|
|
5215
|
+
className: "deepnoidui-ripple",
|
|
5216
|
+
exit: { opacity: 0 },
|
|
5217
|
+
initial: { transform: "scale(0)", opacity: 0.35 },
|
|
5218
|
+
style: {
|
|
5219
|
+
position: "absolute",
|
|
5220
|
+
backgroundColor: color,
|
|
5221
|
+
borderRadius: "100%",
|
|
5222
|
+
transformOrigin: "center",
|
|
5223
|
+
pointerEvents: "none",
|
|
5224
|
+
overflow: "hidden",
|
|
5225
|
+
inset: 0,
|
|
5226
|
+
zIndex: 0,
|
|
5227
|
+
top: ripple.y,
|
|
5228
|
+
left: ripple.x,
|
|
5229
|
+
width: `${ripple.size}px`,
|
|
5230
|
+
height: `${ripple.size}px`,
|
|
5231
|
+
...style
|
|
5232
|
+
},
|
|
5233
|
+
transition: { duration },
|
|
5234
|
+
onAnimationComplete: () => {
|
|
5235
|
+
onClear(ripple.key);
|
|
5236
|
+
},
|
|
5237
|
+
...motionProps
|
|
5238
|
+
}
|
|
5239
|
+
) }) }, ripple.key);
|
|
5240
|
+
}) });
|
|
5241
|
+
};
|
|
5242
|
+
Ripple.displayName = "HeroUI.Ripple";
|
|
5243
|
+
var ripple_default = Ripple;
|
|
5244
|
+
|
|
5245
|
+
// src/components/ripple/useRipple.ts
|
|
5246
|
+
var import_react = require("react");
|
|
5247
|
+
function useRipple(props = {}) {
|
|
5248
|
+
const [ripples, setRipples] = (0, import_react.useState)([]);
|
|
5249
|
+
const getUniqueID = (key) => `${key}-${Math.random().toString(36).substr(2, 9)}`;
|
|
5250
|
+
const onPress = (0, import_react.useCallback)((event) => {
|
|
5251
|
+
const trigger = event.currentTarget;
|
|
5252
|
+
const rect = trigger.getBoundingClientRect();
|
|
5253
|
+
const size = Math.max(trigger.clientWidth, trigger.clientHeight);
|
|
5254
|
+
setRipples((prevRipples) => [
|
|
5255
|
+
...prevRipples,
|
|
5256
|
+
{
|
|
5257
|
+
key: getUniqueID(prevRipples.length.toString()),
|
|
5258
|
+
size,
|
|
5259
|
+
x: event.clientX - rect.left - size / 2,
|
|
5260
|
+
y: event.clientY - rect.top - size / 2
|
|
5261
|
+
}
|
|
5262
|
+
]);
|
|
5263
|
+
}, []);
|
|
5264
|
+
const onClear = (0, import_react.useCallback)((key) => {
|
|
5265
|
+
setRipples((prevState) => prevState.filter((ripple) => ripple.key !== key));
|
|
5266
|
+
}, []);
|
|
5267
|
+
return { ripples, onClear, onPress, ...props };
|
|
5268
|
+
}
|
|
5269
|
+
|
|
5270
|
+
// src/components/button/icon-button.tsx
|
|
5271
|
+
var import_react2 = require("react");
|
|
5272
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
5273
|
+
var IconButton = (0, import_react2.forwardRef)((props, ref) => {
|
|
5274
|
+
const [localProps, variantProps] = mapPropsVariants(props, iconButtonStyle.variantKeys);
|
|
5275
|
+
const { classNames, name, disableRipple, disabled, isLoading, size, full, isInGroup, onMouseDown, ...buttonProps } = {
|
|
5276
|
+
...localProps,
|
|
5277
|
+
...variantProps
|
|
5278
|
+
};
|
|
5279
|
+
const slots = (0, import_react2.useMemo)(() => iconButtonStyle({ ...variantProps }), [variantProps]);
|
|
5280
|
+
const { onPress, onClear, ripples } = useRipple();
|
|
5281
|
+
const handleRipple = (0, import_react2.useCallback)(
|
|
5282
|
+
(e) => {
|
|
5283
|
+
if (!disableRipple && !disabled) {
|
|
5284
|
+
onPress(e);
|
|
5285
|
+
}
|
|
5286
|
+
},
|
|
5287
|
+
[disableRipple, disabled, onPress]
|
|
5288
|
+
);
|
|
5289
|
+
const handleMouseDown = (0, import_react2.useCallback)(
|
|
5290
|
+
(e) => {
|
|
5291
|
+
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
5292
|
+
handleRipple(e);
|
|
5293
|
+
},
|
|
5294
|
+
[onMouseDown, handleRipple]
|
|
5295
|
+
);
|
|
5296
|
+
const rippleProps = (0, import_react2.useMemo)(() => ({ ripples, onClear }), [ripples, onClear]);
|
|
5297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
5298
|
+
"button",
|
|
5299
|
+
{
|
|
5300
|
+
...buttonProps,
|
|
5301
|
+
onMouseDown: handleMouseDown,
|
|
5302
|
+
ref,
|
|
5303
|
+
disabled: disabled || isLoading,
|
|
5304
|
+
"data-loading": isLoading,
|
|
5305
|
+
className: slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
5306
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon_default, { name: "loading", size, className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
5307
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon_default, { name, size }),
|
|
5308
|
+
!disableRipple && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ripple_default, { ...rippleProps })
|
|
5309
|
+
] })
|
|
5310
|
+
}
|
|
5311
|
+
);
|
|
5312
|
+
});
|
|
5313
|
+
IconButton.displayName = "IconButton";
|
|
5314
|
+
var icon_button_default = IconButton;
|
|
5315
|
+
var iconButtonStyle = tv({
|
|
5316
|
+
slots: {
|
|
5317
|
+
base: [
|
|
5318
|
+
"relative",
|
|
5319
|
+
"flex",
|
|
5320
|
+
"items-center",
|
|
5321
|
+
"justify-center",
|
|
5322
|
+
"whitespace-nowrap",
|
|
5323
|
+
"transition",
|
|
5324
|
+
"duration-200",
|
|
5325
|
+
"select-none",
|
|
5326
|
+
"overflow-hidden",
|
|
5327
|
+
"box-border"
|
|
5328
|
+
]
|
|
5329
|
+
},
|
|
5330
|
+
variants: {
|
|
5331
|
+
variant: {
|
|
5332
|
+
solid: [],
|
|
5333
|
+
soft: [],
|
|
5334
|
+
outline: [],
|
|
5335
|
+
ghost: []
|
|
5336
|
+
},
|
|
5337
|
+
color: {
|
|
5338
|
+
primary: [],
|
|
5339
|
+
secondary: [],
|
|
5340
|
+
neutral: [],
|
|
5341
|
+
info: [],
|
|
5342
|
+
success: [],
|
|
5343
|
+
warning: [],
|
|
5344
|
+
danger: []
|
|
5345
|
+
},
|
|
5346
|
+
size: {
|
|
5347
|
+
sm: {
|
|
5348
|
+
base: ["w-[24px]", "h-[24px]", "rounded-sm"]
|
|
5349
|
+
},
|
|
5350
|
+
md: {
|
|
5351
|
+
base: ["w-[32px]", "h-[32px]", "rounded-md"]
|
|
5352
|
+
},
|
|
5353
|
+
lg: {
|
|
5354
|
+
base: ["w-[40px]", "h-[40px]", "rounded-lg"]
|
|
5355
|
+
},
|
|
5356
|
+
xl: {
|
|
5357
|
+
base: ["w-[50px]", "h-[50px]", "rounded-xl"]
|
|
5358
|
+
}
|
|
5359
|
+
},
|
|
5360
|
+
isLoading: {
|
|
5361
|
+
true: {}
|
|
5362
|
+
},
|
|
5363
|
+
disabled: {
|
|
5364
|
+
true: {
|
|
5365
|
+
base: ["!bg-neutral-soft", "!border-neutral-soft", "!text-neutral-light", "pointer-events-none"]
|
|
5366
|
+
}
|
|
5367
|
+
},
|
|
5368
|
+
isInGroup: {
|
|
5369
|
+
true: {
|
|
5370
|
+
base: [
|
|
5371
|
+
"[&:not(:first-child):not(:last-child)]:rounded-none",
|
|
5372
|
+
"first:rounded-r-none",
|
|
5373
|
+
"last:rounded-l-none",
|
|
5374
|
+
"[&:not(:first-child)]:border-l-0"
|
|
5375
|
+
]
|
|
5376
|
+
}
|
|
5377
|
+
}
|
|
5378
|
+
},
|
|
5379
|
+
compoundVariants: [
|
|
5380
|
+
{
|
|
5381
|
+
variant: "solid",
|
|
5382
|
+
color: "primary",
|
|
5383
|
+
class: {
|
|
5384
|
+
base: ["text-white", "bg-primary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5385
|
+
}
|
|
5386
|
+
},
|
|
5387
|
+
{
|
|
5388
|
+
variant: "solid",
|
|
5389
|
+
color: "secondary",
|
|
5390
|
+
class: {
|
|
5391
|
+
base: ["text-white", "bg-secondary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5392
|
+
}
|
|
5393
|
+
},
|
|
5394
|
+
{
|
|
5395
|
+
variant: "solid",
|
|
5396
|
+
color: "neutral",
|
|
5397
|
+
class: {
|
|
5398
|
+
base: ["text-white", "bg-neutral-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5399
|
+
}
|
|
5400
|
+
},
|
|
5401
|
+
{
|
|
5402
|
+
variant: "solid",
|
|
5403
|
+
color: "info",
|
|
5404
|
+
class: {
|
|
5405
|
+
base: ["text-white", "bg-info-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5406
|
+
}
|
|
5407
|
+
},
|
|
5408
|
+
{
|
|
5409
|
+
variant: "solid",
|
|
5410
|
+
color: "success",
|
|
5411
|
+
class: {
|
|
5412
|
+
base: ["text-white", "bg-success-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5413
|
+
}
|
|
5414
|
+
},
|
|
5415
|
+
{
|
|
5416
|
+
variant: "solid",
|
|
5417
|
+
color: "warning",
|
|
5418
|
+
class: {
|
|
5419
|
+
base: ["text-white", "bg-warning-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5420
|
+
}
|
|
5421
|
+
},
|
|
5422
|
+
{
|
|
5423
|
+
variant: "solid",
|
|
5424
|
+
color: "danger",
|
|
5425
|
+
class: {
|
|
5426
|
+
base: ["text-white", "bg-danger-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5427
|
+
}
|
|
5428
|
+
},
|
|
5429
|
+
// soft
|
|
5430
|
+
{
|
|
5431
|
+
variant: "soft",
|
|
5432
|
+
color: "primary",
|
|
5433
|
+
class: {
|
|
5434
|
+
base: ["text-primary-main", "bg-primary-soft", "!border-primary-soft", "hover:!border-primary-light"]
|
|
5435
|
+
}
|
|
5436
|
+
},
|
|
5437
|
+
{
|
|
5438
|
+
variant: "soft",
|
|
5439
|
+
color: "secondary",
|
|
5440
|
+
class: {
|
|
5441
|
+
base: ["text-secondary-main", "bg-secondary-soft", "!border-secondary-soft", "hover:!border-secondary-light"]
|
|
5442
|
+
}
|
|
5443
|
+
},
|
|
5444
|
+
{
|
|
5445
|
+
variant: "soft",
|
|
5446
|
+
color: "neutral",
|
|
5447
|
+
class: {
|
|
5448
|
+
base: ["text-neutral-main", "bg-neutral-soft", "!border-neutral-soft", "hover:!border-neutral-light"]
|
|
5449
|
+
}
|
|
5450
|
+
},
|
|
5451
|
+
{
|
|
5452
|
+
variant: "soft",
|
|
5453
|
+
color: "info",
|
|
5454
|
+
class: {
|
|
5455
|
+
base: ["text-info-main", "bg-info-soft", "!border-info-soft", "hover:!border-info-light"]
|
|
5456
|
+
}
|
|
5457
|
+
},
|
|
5458
|
+
{
|
|
5459
|
+
variant: "soft",
|
|
5460
|
+
color: "success",
|
|
5461
|
+
class: {
|
|
5462
|
+
base: ["text-success-main", "bg-success-soft", "!border-success-soft", "hover:!border-success-light"]
|
|
5463
|
+
}
|
|
5464
|
+
},
|
|
5465
|
+
{
|
|
5466
|
+
variant: "soft",
|
|
5467
|
+
color: "warning",
|
|
5468
|
+
class: {
|
|
5469
|
+
base: ["text-warning-main", "bg-warning-soft", "!border-warning-soft", "hover:!border-warning-light"]
|
|
5470
|
+
}
|
|
5471
|
+
},
|
|
5472
|
+
{
|
|
5473
|
+
variant: "soft",
|
|
5474
|
+
color: "danger",
|
|
5475
|
+
class: {
|
|
5476
|
+
base: ["text-danger-main", "bg-danger-soft", "!border-danger-soft", "hover:!border-danger-light"]
|
|
5477
|
+
}
|
|
5478
|
+
},
|
|
5479
|
+
// outline
|
|
5480
|
+
{
|
|
5481
|
+
variant: "outline",
|
|
5482
|
+
color: "primary",
|
|
5483
|
+
class: {
|
|
5484
|
+
base: ["bg-body-background", "!border-primary-main", "text-primary-main", "hover:bg-primary-soft"]
|
|
5485
|
+
}
|
|
5486
|
+
},
|
|
5487
|
+
{
|
|
5488
|
+
variant: "outline",
|
|
5489
|
+
color: "secondary",
|
|
5490
|
+
class: {
|
|
5491
|
+
base: ["bg-body-background", "!border-secondary-main", "text-secondary-main", "hover:bg-secondary-soft"]
|
|
5492
|
+
}
|
|
5493
|
+
},
|
|
5494
|
+
{
|
|
5495
|
+
variant: "outline",
|
|
5496
|
+
color: "neutral",
|
|
5497
|
+
class: {
|
|
5498
|
+
base: ["bg-body-background", "!border-neutral-light", "text-neutral-main", "hover:bg-neutral-soft"]
|
|
5499
|
+
}
|
|
5500
|
+
},
|
|
5501
|
+
{
|
|
5502
|
+
variant: "outline",
|
|
5503
|
+
color: "info",
|
|
5504
|
+
class: {
|
|
5505
|
+
base: ["bg-body-background", "!border-info-main", "text-info-main", "hover:bg-info-soft"]
|
|
5506
|
+
}
|
|
5507
|
+
},
|
|
5508
|
+
{
|
|
5509
|
+
variant: "outline",
|
|
5510
|
+
color: "success",
|
|
5511
|
+
class: {
|
|
5512
|
+
base: ["bg-body-background", "!border-success-main", "text-success-main", "hover:bg-success-soft"]
|
|
5513
|
+
}
|
|
5514
|
+
},
|
|
5515
|
+
{
|
|
5516
|
+
variant: "outline",
|
|
5517
|
+
color: "warning",
|
|
5518
|
+
class: {
|
|
5519
|
+
base: ["bg-body-background", "!border-warning-main", "text-warning-main", "hover:bg-warning-soft"]
|
|
5520
|
+
}
|
|
5521
|
+
},
|
|
5522
|
+
{
|
|
5523
|
+
variant: "outline",
|
|
5524
|
+
color: "danger",
|
|
5525
|
+
class: {
|
|
5526
|
+
base: ["bg-body-background", "!border-danger-main", "text-danger-main", "hover:bg-danger-soft"]
|
|
5527
|
+
}
|
|
5528
|
+
},
|
|
5529
|
+
// ghost
|
|
5530
|
+
{
|
|
5531
|
+
variant: "ghost",
|
|
5532
|
+
color: "primary",
|
|
5533
|
+
class: {
|
|
5534
|
+
base: ["text-primary-main", "border-transparent", "hover:bg-primary-soft"]
|
|
5535
|
+
}
|
|
5536
|
+
},
|
|
5537
|
+
{
|
|
5538
|
+
variant: "ghost",
|
|
5539
|
+
color: "secondary",
|
|
5540
|
+
class: {
|
|
5541
|
+
base: ["text-secondary-main", "border-transparent", "hover:bg-secondary-soft"]
|
|
5542
|
+
}
|
|
5543
|
+
},
|
|
5544
|
+
{
|
|
5545
|
+
variant: "ghost",
|
|
5546
|
+
color: "neutral",
|
|
5547
|
+
class: {
|
|
5548
|
+
base: ["text-neutral-main", "border-transparent", "hover:bg-neutral-soft"]
|
|
5549
|
+
}
|
|
5550
|
+
},
|
|
5551
|
+
{
|
|
5552
|
+
variant: "ghost",
|
|
5553
|
+
color: "info",
|
|
5554
|
+
class: {
|
|
5555
|
+
base: ["text-info-main", "border-transparent", "hover:bg-info-soft"]
|
|
5556
|
+
}
|
|
5557
|
+
},
|
|
5558
|
+
{
|
|
5559
|
+
variant: "ghost",
|
|
5560
|
+
color: "success",
|
|
5561
|
+
class: {
|
|
5562
|
+
base: ["text-success-main", "border-transparent", "hover:bg-success-soft"]
|
|
5563
|
+
}
|
|
5564
|
+
},
|
|
5565
|
+
{
|
|
5566
|
+
variant: "ghost",
|
|
5567
|
+
color: "warning",
|
|
5568
|
+
class: {
|
|
5569
|
+
base: ["text-warning-main", "border-transparent", "hover:bg-warning-soft"]
|
|
5570
|
+
}
|
|
5571
|
+
},
|
|
5572
|
+
{
|
|
5573
|
+
variant: "ghost",
|
|
5574
|
+
color: "danger",
|
|
5575
|
+
class: {
|
|
5576
|
+
base: ["text-danger-main", "border-transparent", "hover:bg-danger-soft"]
|
|
5577
|
+
}
|
|
5578
|
+
},
|
|
5579
|
+
// soft/outline + size
|
|
5580
|
+
{
|
|
5581
|
+
variant: ["soft", "outline"],
|
|
5582
|
+
size: "sm",
|
|
5583
|
+
class: {
|
|
5584
|
+
base: ["border-sm"]
|
|
5585
|
+
}
|
|
5586
|
+
},
|
|
5587
|
+
{
|
|
5588
|
+
variant: ["soft", "outline"],
|
|
5589
|
+
size: "md",
|
|
5590
|
+
class: {
|
|
5591
|
+
base: ["border-md"]
|
|
5592
|
+
}
|
|
5593
|
+
},
|
|
5594
|
+
{
|
|
5595
|
+
variant: ["soft", "outline"],
|
|
5596
|
+
size: "lg",
|
|
5597
|
+
class: {
|
|
5598
|
+
base: ["border-lg"]
|
|
5599
|
+
}
|
|
5600
|
+
},
|
|
5601
|
+
{
|
|
5602
|
+
variant: ["soft", "outline"],
|
|
5603
|
+
size: "xl",
|
|
5604
|
+
class: {
|
|
5605
|
+
base: ["border-xl"]
|
|
5606
|
+
}
|
|
5607
|
+
},
|
|
5608
|
+
// disabled + variant
|
|
5609
|
+
{
|
|
5610
|
+
variant: ["soft", "ghost"],
|
|
5611
|
+
disabled: true,
|
|
5612
|
+
class: {
|
|
5613
|
+
base: ["!border-neutral-soft"]
|
|
5614
|
+
}
|
|
5615
|
+
},
|
|
5616
|
+
{
|
|
5617
|
+
variant: ["outline"],
|
|
5618
|
+
disabled: true,
|
|
5619
|
+
class: {
|
|
5620
|
+
base: ["!border-neutral-light"]
|
|
5621
|
+
}
|
|
5622
|
+
}
|
|
5623
|
+
],
|
|
5624
|
+
defaultVariants: {
|
|
5625
|
+
size: "md",
|
|
5626
|
+
variant: "solid",
|
|
5627
|
+
color: "primary",
|
|
5628
|
+
full: false,
|
|
5629
|
+
disabled: false,
|
|
5630
|
+
isLoading: false,
|
|
5631
|
+
isInGroup: false
|
|
5632
|
+
}
|
|
5633
|
+
});
|
|
5634
|
+
|
|
5635
|
+
// src/components/select/select.tsx
|
|
5636
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
5206
5637
|
var ALL_OPTION_VALUE = "__ALL__";
|
|
5207
|
-
var Select = (0,
|
|
5638
|
+
var Select = (0, import_react3.forwardRef)((originalProps, ref) => {
|
|
5208
5639
|
var _a, _b, _c;
|
|
5209
5640
|
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
5210
5641
|
const {
|
|
@@ -5220,16 +5651,17 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5220
5651
|
dropdownIconName = "brace-up",
|
|
5221
5652
|
optionIconName,
|
|
5222
5653
|
optionIconPlacement,
|
|
5654
|
+
clearable,
|
|
5223
5655
|
...inputProps
|
|
5224
5656
|
} = props;
|
|
5225
|
-
const slots = (0,
|
|
5226
|
-
const [selectedOptions, setSelectedOptions] = (0,
|
|
5227
|
-
const [targetRect, setTargetRect] = (0,
|
|
5228
|
-
const [optionWrapperHeight, setOptionWrapperHeight] = (0,
|
|
5229
|
-
const [isVisible, setIsVisible] = (0,
|
|
5230
|
-
const [isOpen, setIsOpen] = (0,
|
|
5231
|
-
const selectWrapperRef = (0,
|
|
5232
|
-
const optionWrapperRef = (0,
|
|
5657
|
+
const slots = (0, import_react3.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
5658
|
+
const [selectedOptions, setSelectedOptions] = (0, import_react3.useState)(defaultSelectedOptions || []);
|
|
5659
|
+
const [targetRect, setTargetRect] = (0, import_react3.useState)(null);
|
|
5660
|
+
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react3.useState)(0);
|
|
5661
|
+
const [isVisible, setIsVisible] = (0, import_react3.useState)(false);
|
|
5662
|
+
const [isOpen, setIsOpen] = (0, import_react3.useState)(false);
|
|
5663
|
+
const selectWrapperRef = (0, import_react3.useRef)(null);
|
|
5664
|
+
const optionWrapperRef = (0, import_react3.useRef)(null);
|
|
5233
5665
|
const isControlled = originalProps.value !== void 0;
|
|
5234
5666
|
const openSelect = () => {
|
|
5235
5667
|
if (selectWrapperRef.current) {
|
|
@@ -5273,7 +5705,12 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5273
5705
|
setSelectedOptions(nextOptions);
|
|
5274
5706
|
onChange == null ? void 0 : onChange(nextOptions);
|
|
5275
5707
|
};
|
|
5276
|
-
|
|
5708
|
+
const handleClear = (e) => {
|
|
5709
|
+
e.stopPropagation();
|
|
5710
|
+
setSelectedOptions([]);
|
|
5711
|
+
onChange == null ? void 0 : onChange([]);
|
|
5712
|
+
};
|
|
5713
|
+
(0, import_react3.useEffect)(() => {
|
|
5277
5714
|
const handleClickOutside = (e) => {
|
|
5278
5715
|
var _a2;
|
|
5279
5716
|
const target = e.target;
|
|
@@ -5284,12 +5721,12 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5284
5721
|
window.addEventListener("mousedown", handleClickOutside);
|
|
5285
5722
|
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
5286
5723
|
}, []);
|
|
5287
|
-
(0,
|
|
5724
|
+
(0, import_react3.useEffect)(() => {
|
|
5288
5725
|
if (optionWrapperRef.current) {
|
|
5289
5726
|
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
5290
5727
|
}
|
|
5291
5728
|
}, [targetRect]);
|
|
5292
|
-
(0,
|
|
5729
|
+
(0, import_react3.useEffect)(() => {
|
|
5293
5730
|
if (isControlled) {
|
|
5294
5731
|
const valueArray = Array.isArray(originalProps.value) ? originalProps.value : [originalProps.value];
|
|
5295
5732
|
const matched = options.filter((opt) => valueArray.includes(opt.value));
|
|
@@ -5320,7 +5757,7 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5320
5757
|
renderedOptions.unshift({ label: allOptionValue, value: ALL_OPTION_VALUE });
|
|
5321
5758
|
}
|
|
5322
5759
|
return (0, import_react_dom.createPortal)(
|
|
5323
|
-
/* @__PURE__ */ (0,
|
|
5760
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5324
5761
|
"div",
|
|
5325
5762
|
{
|
|
5326
5763
|
ref: optionWrapperRef,
|
|
@@ -5338,7 +5775,7 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5338
5775
|
},
|
|
5339
5776
|
children: renderedOptions.map((option) => {
|
|
5340
5777
|
const isSelected = option.value === ALL_OPTION_VALUE ? selectedOptions.length === options.length : selectedOptions.some((o) => o.value === option.value);
|
|
5341
|
-
return /* @__PURE__ */ (0,
|
|
5778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5342
5779
|
"div",
|
|
5343
5780
|
{
|
|
5344
5781
|
role: "option",
|
|
@@ -5348,9 +5785,9 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5348
5785
|
optionIconPlacement === "end" ? "justify-between" : ""
|
|
5349
5786
|
),
|
|
5350
5787
|
children: [
|
|
5351
|
-
optionIconName && optionIconPlacement === "start" && /* @__PURE__ */ (0,
|
|
5788
|
+
optionIconName && optionIconPlacement === "start" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon_default, { name: optionIconName, size: originalProps.size }),
|
|
5352
5789
|
option.label,
|
|
5353
|
-
optionIconName && optionIconPlacement === "end" && /* @__PURE__ */ (0,
|
|
5790
|
+
optionIconName && optionIconPlacement === "end" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon_default, { name: optionIconName, size: originalProps.size })
|
|
5354
5791
|
]
|
|
5355
5792
|
},
|
|
5356
5793
|
option.value
|
|
@@ -5361,8 +5798,8 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5361
5798
|
document.body
|
|
5362
5799
|
);
|
|
5363
5800
|
};
|
|
5364
|
-
return /* @__PURE__ */ (0,
|
|
5365
|
-
/* @__PURE__ */ (0,
|
|
5801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
5802
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5366
5803
|
"div",
|
|
5367
5804
|
{
|
|
5368
5805
|
className: clsx(
|
|
@@ -5370,9 +5807,9 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5370
5807
|
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
5371
5808
|
),
|
|
5372
5809
|
children: [
|
|
5373
|
-
label && /* @__PURE__ */ (0,
|
|
5374
|
-
/* @__PURE__ */ (0,
|
|
5375
|
-
/* @__PURE__ */ (0,
|
|
5810
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
5811
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
5812
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5376
5813
|
"div",
|
|
5377
5814
|
{
|
|
5378
5815
|
"data-expanded": isOpen,
|
|
@@ -5383,7 +5820,7 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5383
5820
|
ref: selectWrapperRef,
|
|
5384
5821
|
onClick: handleToggleSelect,
|
|
5385
5822
|
children: [
|
|
5386
|
-
/* @__PURE__ */ (0,
|
|
5823
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5387
5824
|
"input",
|
|
5388
5825
|
{
|
|
5389
5826
|
...inputProps,
|
|
@@ -5398,8 +5835,19 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5398
5835
|
size: 0
|
|
5399
5836
|
}
|
|
5400
5837
|
),
|
|
5401
|
-
/* @__PURE__ */ (0,
|
|
5402
|
-
/* @__PURE__ */ (0,
|
|
5838
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { type: "hidden", name: inputProps.name, value: selectedValue }),
|
|
5839
|
+
clearable && selectedOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5840
|
+
icon_button_default,
|
|
5841
|
+
{
|
|
5842
|
+
name: "close",
|
|
5843
|
+
variant: "ghost",
|
|
5844
|
+
size: "sm",
|
|
5845
|
+
color: "neutral",
|
|
5846
|
+
onClick: handleClear,
|
|
5847
|
+
classNames: { base: "pr-[2px]" }
|
|
5848
|
+
}
|
|
5849
|
+
),
|
|
5850
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5403
5851
|
Icon_default,
|
|
5404
5852
|
{
|
|
5405
5853
|
name: dropdownIconName,
|
|
@@ -5410,8 +5858,8 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
|
5410
5858
|
]
|
|
5411
5859
|
}
|
|
5412
5860
|
),
|
|
5413
|
-
helperMessage && !errorMessage && /* @__PURE__ */ (0,
|
|
5414
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
5861
|
+
helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }), children: helperMessage }),
|
|
5862
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
|
|
5415
5863
|
] })
|
|
5416
5864
|
]
|
|
5417
5865
|
}
|
|
@@ -5676,8 +6124,8 @@ var select = tv({
|
|
|
5676
6124
|
});
|
|
5677
6125
|
|
|
5678
6126
|
// src/components/picker/timePicker.tsx
|
|
5679
|
-
var
|
|
5680
|
-
var TimePicker = (0,
|
|
6127
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
6128
|
+
var TimePicker = (0, import_react4.forwardRef)((originalProps, ref) => {
|
|
5681
6129
|
const [props, variantProps] = mapPropsVariants(originalProps, timePickerStyle.variantKeys);
|
|
5682
6130
|
const {
|
|
5683
6131
|
classNames,
|
|
@@ -5690,20 +6138,20 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5690
6138
|
placeholder = "",
|
|
5691
6139
|
...inputProps
|
|
5692
6140
|
} = props;
|
|
5693
|
-
const [selectedRange, setSelectedRange] = (0,
|
|
6141
|
+
const [selectedRange, setSelectedRange] = (0, import_react4.useState)(
|
|
5694
6142
|
valueRange || { start: "", end: "" }
|
|
5695
6143
|
);
|
|
5696
|
-
const [isPanelOpen, setIsPanelOpen] = (0,
|
|
5697
|
-
const inputWrapperRef = (0,
|
|
5698
|
-
const panelWrapperRef = (0,
|
|
5699
|
-
const [panelPos, setPanelPos] = (0,
|
|
5700
|
-
const displayValue = (0,
|
|
6144
|
+
const [isPanelOpen, setIsPanelOpen] = (0, import_react4.useState)(false);
|
|
6145
|
+
const inputWrapperRef = (0, import_react4.useRef)(null);
|
|
6146
|
+
const panelWrapperRef = (0, import_react4.useRef)(null);
|
|
6147
|
+
const [panelPos, setPanelPos] = (0, import_react4.useState)({ top: -9999, left: -9999 });
|
|
6148
|
+
const displayValue = (0, import_react4.useMemo)(() => {
|
|
5701
6149
|
if (selectedRange.start && selectedRange.end) {
|
|
5702
6150
|
return `${selectedRange.start} ~ ${selectedRange.end}`;
|
|
5703
6151
|
}
|
|
5704
6152
|
return "";
|
|
5705
6153
|
}, [selectedRange]);
|
|
5706
|
-
const calculatePosition = (0,
|
|
6154
|
+
const calculatePosition = (0, import_react4.useCallback)(() => {
|
|
5707
6155
|
if (inputWrapperRef.current) {
|
|
5708
6156
|
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
5709
6157
|
setPanelPos({ top: rect.bottom + window.scrollY + 6, left: rect.left + window.scrollX });
|
|
@@ -5725,7 +6173,7 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5725
6173
|
setIsPanelOpen(false);
|
|
5726
6174
|
}
|
|
5727
6175
|
};
|
|
5728
|
-
const slots = (0,
|
|
6176
|
+
const slots = (0, import_react4.useMemo)(() => timePickerStyle({ ...variantProps }), [variantProps]);
|
|
5729
6177
|
const renderHourOptions = () => {
|
|
5730
6178
|
return Array.from({ length: 24 }, (_, i) => {
|
|
5731
6179
|
const value = String(i).padStart(2, "0");
|
|
@@ -5770,12 +6218,12 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5770
6218
|
setSelectedRange(emptyRange);
|
|
5771
6219
|
onChangeRange == null ? void 0 : onChangeRange(emptyRange);
|
|
5772
6220
|
};
|
|
5773
|
-
return /* @__PURE__ */ (0,
|
|
5774
|
-
/* @__PURE__ */ (0,
|
|
5775
|
-
label && /* @__PURE__ */ (0,
|
|
5776
|
-
/* @__PURE__ */ (0,
|
|
5777
|
-
/* @__PURE__ */ (0,
|
|
5778
|
-
/* @__PURE__ */ (0,
|
|
6221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
6222
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
6223
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
6224
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
6225
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: inputWrapperRef, className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }), children: [
|
|
6226
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5779
6227
|
"input",
|
|
5780
6228
|
{
|
|
5781
6229
|
...inputProps,
|
|
@@ -5790,8 +6238,8 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5790
6238
|
onKeyDown: handleInputKeyDown
|
|
5791
6239
|
}
|
|
5792
6240
|
),
|
|
5793
|
-
/* @__PURE__ */ (0,
|
|
5794
|
-
displayValue && /* @__PURE__ */ (0,
|
|
6241
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }), children: [
|
|
6242
|
+
displayValue && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5795
6243
|
Icon_default,
|
|
5796
6244
|
{
|
|
5797
6245
|
name: "close",
|
|
@@ -5802,7 +6250,7 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5802
6250
|
}
|
|
5803
6251
|
}
|
|
5804
6252
|
),
|
|
5805
|
-
/* @__PURE__ */ (0,
|
|
6253
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5806
6254
|
Icon_default,
|
|
5807
6255
|
{
|
|
5808
6256
|
name: "clock",
|
|
@@ -5815,11 +6263,11 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5815
6263
|
)
|
|
5816
6264
|
] })
|
|
5817
6265
|
] }),
|
|
5818
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
6266
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
|
|
5819
6267
|
] })
|
|
5820
6268
|
] }),
|
|
5821
6269
|
isPanelOpen && (0, import_react_dom2.createPortal)(
|
|
5822
|
-
/* @__PURE__ */ (0,
|
|
6270
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5823
6271
|
"div",
|
|
5824
6272
|
{
|
|
5825
6273
|
ref: panelWrapperRef,
|
|
@@ -5831,9 +6279,9 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5831
6279
|
zIndex: 1e3
|
|
5832
6280
|
},
|
|
5833
6281
|
onMouseDown: (e) => e.preventDefault(),
|
|
5834
|
-
children: /* @__PURE__ */ (0,
|
|
5835
|
-
/* @__PURE__ */ (0,
|
|
5836
|
-
/* @__PURE__ */ (0,
|
|
6282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "bg-body-background text-neutral-main flex items-center gap-[5px] p-[10px]", children: [
|
|
6283
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-[5px]", children: [
|
|
6284
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5837
6285
|
select_default,
|
|
5838
6286
|
{
|
|
5839
6287
|
options: renderHourOptions(),
|
|
@@ -5844,8 +6292,8 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5844
6292
|
classNames: mergedSelectClassNames
|
|
5845
6293
|
}
|
|
5846
6294
|
),
|
|
5847
|
-
/* @__PURE__ */ (0,
|
|
5848
|
-
/* @__PURE__ */ (0,
|
|
6295
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: ":" }),
|
|
6296
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5849
6297
|
select_default,
|
|
5850
6298
|
{
|
|
5851
6299
|
options: renderMinuteOptions(),
|
|
@@ -5857,9 +6305,9 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5857
6305
|
}
|
|
5858
6306
|
)
|
|
5859
6307
|
] }),
|
|
5860
|
-
/* @__PURE__ */ (0,
|
|
5861
|
-
/* @__PURE__ */ (0,
|
|
5862
|
-
/* @__PURE__ */ (0,
|
|
6308
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "~" }),
|
|
6309
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-[5px]", children: [
|
|
6310
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5863
6311
|
select_default,
|
|
5864
6312
|
{
|
|
5865
6313
|
options: renderHourOptions(),
|
|
@@ -5870,8 +6318,8 @@ var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
5870
6318
|
classNames: mergedSelectClassNames
|
|
5871
6319
|
}
|
|
5872
6320
|
),
|
|
5873
|
-
/* @__PURE__ */ (0,
|
|
5874
|
-
/* @__PURE__ */ (0,
|
|
6321
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: ":" }),
|
|
6322
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5875
6323
|
select_default,
|
|
5876
6324
|
{
|
|
5877
6325
|
options: renderMinuteOptions(),
|