@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.
@@ -105,7 +105,7 @@ __export(select_exports, {
105
105
  default: () => select_default
106
106
  });
107
107
  module.exports = __toCommonJS(select_exports);
108
- var import_react = require("react");
108
+ var import_react3 = require("react");
109
109
  var import_react_dom = require("react-dom");
110
110
 
111
111
  // src/utils/tailwind-variants.ts
@@ -5196,10 +5196,441 @@ function toVal(mix) {
5196
5196
  return str;
5197
5197
  }
5198
5198
 
5199
- // src/components/select/select.tsx
5199
+ // src/components/ripple/ripple.tsx
5200
+ var import_framer_motion = require("framer-motion");
5200
5201
  var import_jsx_runtime3 = require("react/jsx-runtime");
5202
+ var Ripple = (props) => {
5203
+ const { ripples = [], motionProps, color = "currentColor", style, onClear } = props;
5204
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: ripples.map((ripple) => {
5205
+ const duration = (0, import_framer_motion.clamp)(ripple.size > 100 ? 0.75 : 0.5, 0.01 * ripple.size, 0.2);
5206
+ 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)(
5207
+ import_framer_motion.m.span,
5208
+ {
5209
+ animate: { transform: "scale(2)", opacity: 0 },
5210
+ className: "deepnoidui-ripple",
5211
+ exit: { opacity: 0 },
5212
+ initial: { transform: "scale(0)", opacity: 0.35 },
5213
+ style: {
5214
+ position: "absolute",
5215
+ backgroundColor: color,
5216
+ borderRadius: "100%",
5217
+ transformOrigin: "center",
5218
+ pointerEvents: "none",
5219
+ overflow: "hidden",
5220
+ inset: 0,
5221
+ zIndex: 0,
5222
+ top: ripple.y,
5223
+ left: ripple.x,
5224
+ width: `${ripple.size}px`,
5225
+ height: `${ripple.size}px`,
5226
+ ...style
5227
+ },
5228
+ transition: { duration },
5229
+ onAnimationComplete: () => {
5230
+ onClear(ripple.key);
5231
+ },
5232
+ ...motionProps
5233
+ }
5234
+ ) }) }, ripple.key);
5235
+ }) });
5236
+ };
5237
+ Ripple.displayName = "HeroUI.Ripple";
5238
+ var ripple_default = Ripple;
5239
+
5240
+ // src/components/ripple/useRipple.ts
5241
+ var import_react = require("react");
5242
+ function useRipple(props = {}) {
5243
+ const [ripples, setRipples] = (0, import_react.useState)([]);
5244
+ const getUniqueID = (key) => `${key}-${Math.random().toString(36).substr(2, 9)}`;
5245
+ const onPress = (0, import_react.useCallback)((event) => {
5246
+ const trigger = event.currentTarget;
5247
+ const rect = trigger.getBoundingClientRect();
5248
+ const size = Math.max(trigger.clientWidth, trigger.clientHeight);
5249
+ setRipples((prevRipples) => [
5250
+ ...prevRipples,
5251
+ {
5252
+ key: getUniqueID(prevRipples.length.toString()),
5253
+ size,
5254
+ x: event.clientX - rect.left - size / 2,
5255
+ y: event.clientY - rect.top - size / 2
5256
+ }
5257
+ ]);
5258
+ }, []);
5259
+ const onClear = (0, import_react.useCallback)((key) => {
5260
+ setRipples((prevState) => prevState.filter((ripple) => ripple.key !== key));
5261
+ }, []);
5262
+ return { ripples, onClear, onPress, ...props };
5263
+ }
5264
+
5265
+ // src/components/button/icon-button.tsx
5266
+ var import_react2 = require("react");
5267
+ var import_jsx_runtime4 = require("react/jsx-runtime");
5268
+ var IconButton = (0, import_react2.forwardRef)((props, ref) => {
5269
+ const [localProps, variantProps] = mapPropsVariants(props, iconButtonStyle.variantKeys);
5270
+ const { classNames, name, disableRipple, disabled, isLoading, size, full, isInGroup, onMouseDown, ...buttonProps } = {
5271
+ ...localProps,
5272
+ ...variantProps
5273
+ };
5274
+ const slots = (0, import_react2.useMemo)(() => iconButtonStyle({ ...variantProps }), [variantProps]);
5275
+ const { onPress, onClear, ripples } = useRipple();
5276
+ const handleRipple = (0, import_react2.useCallback)(
5277
+ (e) => {
5278
+ if (!disableRipple && !disabled) {
5279
+ onPress(e);
5280
+ }
5281
+ },
5282
+ [disableRipple, disabled, onPress]
5283
+ );
5284
+ const handleMouseDown = (0, import_react2.useCallback)(
5285
+ (e) => {
5286
+ onMouseDown == null ? void 0 : onMouseDown(e);
5287
+ handleRipple(e);
5288
+ },
5289
+ [onMouseDown, handleRipple]
5290
+ );
5291
+ const rippleProps = (0, import_react2.useMemo)(() => ({ ripples, onClear }), [ripples, onClear]);
5292
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5293
+ "button",
5294
+ {
5295
+ ...buttonProps,
5296
+ onMouseDown: handleMouseDown,
5297
+ ref,
5298
+ disabled: disabled || isLoading,
5299
+ "data-loading": isLoading,
5300
+ className: slots.base({ class: classNames == null ? void 0 : classNames.base }),
5301
+ 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: [
5302
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon_default, { name, size }),
5303
+ !disableRipple && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ripple_default, { ...rippleProps })
5304
+ ] })
5305
+ }
5306
+ );
5307
+ });
5308
+ IconButton.displayName = "IconButton";
5309
+ var icon_button_default = IconButton;
5310
+ var iconButtonStyle = tv({
5311
+ slots: {
5312
+ base: [
5313
+ "relative",
5314
+ "flex",
5315
+ "items-center",
5316
+ "justify-center",
5317
+ "whitespace-nowrap",
5318
+ "transition",
5319
+ "duration-200",
5320
+ "select-none",
5321
+ "overflow-hidden",
5322
+ "box-border"
5323
+ ]
5324
+ },
5325
+ variants: {
5326
+ variant: {
5327
+ solid: [],
5328
+ soft: [],
5329
+ outline: [],
5330
+ ghost: []
5331
+ },
5332
+ color: {
5333
+ primary: [],
5334
+ secondary: [],
5335
+ neutral: [],
5336
+ info: [],
5337
+ success: [],
5338
+ warning: [],
5339
+ danger: []
5340
+ },
5341
+ size: {
5342
+ sm: {
5343
+ base: ["w-[24px]", "h-[24px]", "rounded-sm"]
5344
+ },
5345
+ md: {
5346
+ base: ["w-[32px]", "h-[32px]", "rounded-md"]
5347
+ },
5348
+ lg: {
5349
+ base: ["w-[40px]", "h-[40px]", "rounded-lg"]
5350
+ },
5351
+ xl: {
5352
+ base: ["w-[50px]", "h-[50px]", "rounded-xl"]
5353
+ }
5354
+ },
5355
+ isLoading: {
5356
+ true: {}
5357
+ },
5358
+ disabled: {
5359
+ true: {
5360
+ base: ["!bg-neutral-soft", "!border-neutral-soft", "!text-neutral-light", "pointer-events-none"]
5361
+ }
5362
+ },
5363
+ isInGroup: {
5364
+ true: {
5365
+ base: [
5366
+ "[&:not(:first-child):not(:last-child)]:rounded-none",
5367
+ "first:rounded-r-none",
5368
+ "last:rounded-l-none",
5369
+ "[&:not(:first-child)]:border-l-0"
5370
+ ]
5371
+ }
5372
+ }
5373
+ },
5374
+ compoundVariants: [
5375
+ {
5376
+ variant: "solid",
5377
+ color: "primary",
5378
+ class: {
5379
+ base: ["text-white", "bg-primary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
5380
+ }
5381
+ },
5382
+ {
5383
+ variant: "solid",
5384
+ color: "secondary",
5385
+ class: {
5386
+ base: ["text-white", "bg-secondary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
5387
+ }
5388
+ },
5389
+ {
5390
+ variant: "solid",
5391
+ color: "neutral",
5392
+ class: {
5393
+ base: ["text-white", "bg-neutral-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
5394
+ }
5395
+ },
5396
+ {
5397
+ variant: "solid",
5398
+ color: "info",
5399
+ class: {
5400
+ base: ["text-white", "bg-info-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
5401
+ }
5402
+ },
5403
+ {
5404
+ variant: "solid",
5405
+ color: "success",
5406
+ class: {
5407
+ base: ["text-white", "bg-success-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
5408
+ }
5409
+ },
5410
+ {
5411
+ variant: "solid",
5412
+ color: "warning",
5413
+ class: {
5414
+ base: ["text-white", "bg-warning-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
5415
+ }
5416
+ },
5417
+ {
5418
+ variant: "solid",
5419
+ color: "danger",
5420
+ class: {
5421
+ base: ["text-white", "bg-danger-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
5422
+ }
5423
+ },
5424
+ // soft
5425
+ {
5426
+ variant: "soft",
5427
+ color: "primary",
5428
+ class: {
5429
+ base: ["text-primary-main", "bg-primary-soft", "!border-primary-soft", "hover:!border-primary-light"]
5430
+ }
5431
+ },
5432
+ {
5433
+ variant: "soft",
5434
+ color: "secondary",
5435
+ class: {
5436
+ base: ["text-secondary-main", "bg-secondary-soft", "!border-secondary-soft", "hover:!border-secondary-light"]
5437
+ }
5438
+ },
5439
+ {
5440
+ variant: "soft",
5441
+ color: "neutral",
5442
+ class: {
5443
+ base: ["text-neutral-main", "bg-neutral-soft", "!border-neutral-soft", "hover:!border-neutral-light"]
5444
+ }
5445
+ },
5446
+ {
5447
+ variant: "soft",
5448
+ color: "info",
5449
+ class: {
5450
+ base: ["text-info-main", "bg-info-soft", "!border-info-soft", "hover:!border-info-light"]
5451
+ }
5452
+ },
5453
+ {
5454
+ variant: "soft",
5455
+ color: "success",
5456
+ class: {
5457
+ base: ["text-success-main", "bg-success-soft", "!border-success-soft", "hover:!border-success-light"]
5458
+ }
5459
+ },
5460
+ {
5461
+ variant: "soft",
5462
+ color: "warning",
5463
+ class: {
5464
+ base: ["text-warning-main", "bg-warning-soft", "!border-warning-soft", "hover:!border-warning-light"]
5465
+ }
5466
+ },
5467
+ {
5468
+ variant: "soft",
5469
+ color: "danger",
5470
+ class: {
5471
+ base: ["text-danger-main", "bg-danger-soft", "!border-danger-soft", "hover:!border-danger-light"]
5472
+ }
5473
+ },
5474
+ // outline
5475
+ {
5476
+ variant: "outline",
5477
+ color: "primary",
5478
+ class: {
5479
+ base: ["bg-body-background", "!border-primary-main", "text-primary-main", "hover:bg-primary-soft"]
5480
+ }
5481
+ },
5482
+ {
5483
+ variant: "outline",
5484
+ color: "secondary",
5485
+ class: {
5486
+ base: ["bg-body-background", "!border-secondary-main", "text-secondary-main", "hover:bg-secondary-soft"]
5487
+ }
5488
+ },
5489
+ {
5490
+ variant: "outline",
5491
+ color: "neutral",
5492
+ class: {
5493
+ base: ["bg-body-background", "!border-neutral-light", "text-neutral-main", "hover:bg-neutral-soft"]
5494
+ }
5495
+ },
5496
+ {
5497
+ variant: "outline",
5498
+ color: "info",
5499
+ class: {
5500
+ base: ["bg-body-background", "!border-info-main", "text-info-main", "hover:bg-info-soft"]
5501
+ }
5502
+ },
5503
+ {
5504
+ variant: "outline",
5505
+ color: "success",
5506
+ class: {
5507
+ base: ["bg-body-background", "!border-success-main", "text-success-main", "hover:bg-success-soft"]
5508
+ }
5509
+ },
5510
+ {
5511
+ variant: "outline",
5512
+ color: "warning",
5513
+ class: {
5514
+ base: ["bg-body-background", "!border-warning-main", "text-warning-main", "hover:bg-warning-soft"]
5515
+ }
5516
+ },
5517
+ {
5518
+ variant: "outline",
5519
+ color: "danger",
5520
+ class: {
5521
+ base: ["bg-body-background", "!border-danger-main", "text-danger-main", "hover:bg-danger-soft"]
5522
+ }
5523
+ },
5524
+ // ghost
5525
+ {
5526
+ variant: "ghost",
5527
+ color: "primary",
5528
+ class: {
5529
+ base: ["text-primary-main", "border-transparent", "hover:bg-primary-soft"]
5530
+ }
5531
+ },
5532
+ {
5533
+ variant: "ghost",
5534
+ color: "secondary",
5535
+ class: {
5536
+ base: ["text-secondary-main", "border-transparent", "hover:bg-secondary-soft"]
5537
+ }
5538
+ },
5539
+ {
5540
+ variant: "ghost",
5541
+ color: "neutral",
5542
+ class: {
5543
+ base: ["text-neutral-main", "border-transparent", "hover:bg-neutral-soft"]
5544
+ }
5545
+ },
5546
+ {
5547
+ variant: "ghost",
5548
+ color: "info",
5549
+ class: {
5550
+ base: ["text-info-main", "border-transparent", "hover:bg-info-soft"]
5551
+ }
5552
+ },
5553
+ {
5554
+ variant: "ghost",
5555
+ color: "success",
5556
+ class: {
5557
+ base: ["text-success-main", "border-transparent", "hover:bg-success-soft"]
5558
+ }
5559
+ },
5560
+ {
5561
+ variant: "ghost",
5562
+ color: "warning",
5563
+ class: {
5564
+ base: ["text-warning-main", "border-transparent", "hover:bg-warning-soft"]
5565
+ }
5566
+ },
5567
+ {
5568
+ variant: "ghost",
5569
+ color: "danger",
5570
+ class: {
5571
+ base: ["text-danger-main", "border-transparent", "hover:bg-danger-soft"]
5572
+ }
5573
+ },
5574
+ // soft/outline + size
5575
+ {
5576
+ variant: ["soft", "outline"],
5577
+ size: "sm",
5578
+ class: {
5579
+ base: ["border-sm"]
5580
+ }
5581
+ },
5582
+ {
5583
+ variant: ["soft", "outline"],
5584
+ size: "md",
5585
+ class: {
5586
+ base: ["border-md"]
5587
+ }
5588
+ },
5589
+ {
5590
+ variant: ["soft", "outline"],
5591
+ size: "lg",
5592
+ class: {
5593
+ base: ["border-lg"]
5594
+ }
5595
+ },
5596
+ {
5597
+ variant: ["soft", "outline"],
5598
+ size: "xl",
5599
+ class: {
5600
+ base: ["border-xl"]
5601
+ }
5602
+ },
5603
+ // disabled + variant
5604
+ {
5605
+ variant: ["soft", "ghost"],
5606
+ disabled: true,
5607
+ class: {
5608
+ base: ["!border-neutral-soft"]
5609
+ }
5610
+ },
5611
+ {
5612
+ variant: ["outline"],
5613
+ disabled: true,
5614
+ class: {
5615
+ base: ["!border-neutral-light"]
5616
+ }
5617
+ }
5618
+ ],
5619
+ defaultVariants: {
5620
+ size: "md",
5621
+ variant: "solid",
5622
+ color: "primary",
5623
+ full: false,
5624
+ disabled: false,
5625
+ isLoading: false,
5626
+ isInGroup: false
5627
+ }
5628
+ });
5629
+
5630
+ // src/components/select/select.tsx
5631
+ var import_jsx_runtime5 = require("react/jsx-runtime");
5201
5632
  var ALL_OPTION_VALUE = "__ALL__";
5202
- var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5633
+ var Select = (0, import_react3.forwardRef)((originalProps, ref) => {
5203
5634
  var _a, _b, _c;
5204
5635
  const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
5205
5636
  const {
@@ -5215,16 +5646,17 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5215
5646
  dropdownIconName = "brace-up",
5216
5647
  optionIconName,
5217
5648
  optionIconPlacement,
5649
+ clearable,
5218
5650
  ...inputProps
5219
5651
  } = props;
5220
- const slots = (0, import_react.useMemo)(() => select({ ...variantProps }), [variantProps]);
5221
- const [selectedOptions, setSelectedOptions] = (0, import_react.useState)(defaultSelectedOptions || []);
5222
- const [targetRect, setTargetRect] = (0, import_react.useState)(null);
5223
- const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react.useState)(0);
5224
- const [isVisible, setIsVisible] = (0, import_react.useState)(false);
5225
- const [isOpen, setIsOpen] = (0, import_react.useState)(false);
5226
- const selectWrapperRef = (0, import_react.useRef)(null);
5227
- const optionWrapperRef = (0, import_react.useRef)(null);
5652
+ const slots = (0, import_react3.useMemo)(() => select({ ...variantProps }), [variantProps]);
5653
+ const [selectedOptions, setSelectedOptions] = (0, import_react3.useState)(defaultSelectedOptions || []);
5654
+ const [targetRect, setTargetRect] = (0, import_react3.useState)(null);
5655
+ const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react3.useState)(0);
5656
+ const [isVisible, setIsVisible] = (0, import_react3.useState)(false);
5657
+ const [isOpen, setIsOpen] = (0, import_react3.useState)(false);
5658
+ const selectWrapperRef = (0, import_react3.useRef)(null);
5659
+ const optionWrapperRef = (0, import_react3.useRef)(null);
5228
5660
  const isControlled = originalProps.value !== void 0;
5229
5661
  const openSelect = () => {
5230
5662
  if (selectWrapperRef.current) {
@@ -5268,7 +5700,12 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5268
5700
  setSelectedOptions(nextOptions);
5269
5701
  onChange == null ? void 0 : onChange(nextOptions);
5270
5702
  };
5271
- (0, import_react.useEffect)(() => {
5703
+ const handleClear = (e) => {
5704
+ e.stopPropagation();
5705
+ setSelectedOptions([]);
5706
+ onChange == null ? void 0 : onChange([]);
5707
+ };
5708
+ (0, import_react3.useEffect)(() => {
5272
5709
  const handleClickOutside = (e) => {
5273
5710
  var _a2;
5274
5711
  const target = e.target;
@@ -5279,12 +5716,12 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5279
5716
  window.addEventListener("mousedown", handleClickOutside);
5280
5717
  return () => window.removeEventListener("mousedown", handleClickOutside);
5281
5718
  }, []);
5282
- (0, import_react.useEffect)(() => {
5719
+ (0, import_react3.useEffect)(() => {
5283
5720
  if (optionWrapperRef.current) {
5284
5721
  setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
5285
5722
  }
5286
5723
  }, [targetRect]);
5287
- (0, import_react.useEffect)(() => {
5724
+ (0, import_react3.useEffect)(() => {
5288
5725
  if (isControlled) {
5289
5726
  const valueArray = Array.isArray(originalProps.value) ? originalProps.value : [originalProps.value];
5290
5727
  const matched = options.filter((opt) => valueArray.includes(opt.value));
@@ -5315,7 +5752,7 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5315
5752
  renderedOptions.unshift({ label: allOptionValue, value: ALL_OPTION_VALUE });
5316
5753
  }
5317
5754
  return (0, import_react_dom.createPortal)(
5318
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
5755
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5319
5756
  "div",
5320
5757
  {
5321
5758
  ref: optionWrapperRef,
@@ -5333,7 +5770,7 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5333
5770
  },
5334
5771
  children: renderedOptions.map((option) => {
5335
5772
  const isSelected = option.value === ALL_OPTION_VALUE ? selectedOptions.length === options.length : selectedOptions.some((o) => o.value === option.value);
5336
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
5773
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5337
5774
  "div",
5338
5775
  {
5339
5776
  role: "option",
@@ -5343,9 +5780,9 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5343
5780
  optionIconPlacement === "end" ? "justify-between" : ""
5344
5781
  ),
5345
5782
  children: [
5346
- optionIconName && optionIconPlacement === "start" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: optionIconName, size: originalProps.size }),
5783
+ optionIconName && optionIconPlacement === "start" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon_default, { name: optionIconName, size: originalProps.size }),
5347
5784
  option.label,
5348
- optionIconName && optionIconPlacement === "end" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: optionIconName, size: originalProps.size })
5785
+ optionIconName && optionIconPlacement === "end" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon_default, { name: optionIconName, size: originalProps.size })
5349
5786
  ]
5350
5787
  },
5351
5788
  option.value
@@ -5356,8 +5793,8 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5356
5793
  document.body
5357
5794
  );
5358
5795
  };
5359
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
5360
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
5796
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
5797
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5361
5798
  "div",
5362
5799
  {
5363
5800
  className: clsx(
@@ -5365,9 +5802,9 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5365
5802
  variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
5366
5803
  ),
5367
5804
  children: [
5368
- label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
5369
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
5370
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
5805
+ label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
5806
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
5807
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5371
5808
  "div",
5372
5809
  {
5373
5810
  "data-expanded": isOpen,
@@ -5378,7 +5815,7 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5378
5815
  ref: selectWrapperRef,
5379
5816
  onClick: handleToggleSelect,
5380
5817
  children: [
5381
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
5818
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5382
5819
  "input",
5383
5820
  {
5384
5821
  ...inputProps,
@@ -5393,8 +5830,19 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5393
5830
  size: 0
5394
5831
  }
5395
5832
  ),
5396
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { type: "hidden", name: inputProps.name, value: selectedValue }),
5397
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
5833
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { type: "hidden", name: inputProps.name, value: selectedValue }),
5834
+ clearable && selectedOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5835
+ icon_button_default,
5836
+ {
5837
+ name: "close",
5838
+ variant: "ghost",
5839
+ size: "sm",
5840
+ color: "neutral",
5841
+ onClick: handleClear,
5842
+ classNames: { base: "pr-[2px]" }
5843
+ }
5844
+ ),
5845
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5398
5846
  Icon_default,
5399
5847
  {
5400
5848
  name: dropdownIconName,
@@ -5405,8 +5853,8 @@ var Select = (0, import_react.forwardRef)((originalProps, ref) => {
5405
5853
  ]
5406
5854
  }
5407
5855
  ),
5408
- helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }), children: helperMessage }),
5409
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
5856
+ helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }), children: helperMessage }),
5857
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
5410
5858
  ] })
5411
5859
  ]
5412
5860
  }
@@ -1,7 +1,15 @@
1
1
  "use client";
2
2
  import {
3
3
  select_default
4
- } from "../../chunk-75ZDPLJ4.mjs";
4
+ } from "../../chunk-K2RW5KLO.mjs";
5
+ import "../../chunk-MY5U63QO.mjs";
6
+ import "../../chunk-4LUASWAN.mjs";
7
+ import "../../chunk-5VTYO3RF.mjs";
8
+ import "../../chunk-FFUZAOFL.mjs";
9
+ import "../../chunk-TB2DOWSM.mjs";
10
+ import "../../chunk-6WSACUIB.mjs";
11
+ import "../../chunk-LXHUO6VM.mjs";
12
+ import "../../chunk-SZL743JC.mjs";
5
13
  import "../../chunk-ZYIIXWVY.mjs";
6
14
  import "../../chunk-YEYUS6DW.mjs";
7
15
  import "../../chunk-E3G5QXSH.mjs";