@iquji-web/web-component 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -16,7 +16,7 @@ JavaScript 构建显式使用生产环境的 JSX runtime,不依赖调用方 sh
16
16
 
17
17
  ## 通知与表单
18
18
 
19
- 应用在 `IqujiOverlayProvider` 内、路由外注册 `IqujiNotificationProvider`,传入 `closeLabel`,可通过 `label` 注入通知区域名称(默认“通知”)。`placement` 支持 `topLeft`、`topRight`、`bottomLeft`、`bottomRight`,默认右上;`duration` 单位为毫秒,默认 4500,`0` 表示常驻;`maxCount` 默认 3,超出时关闭最早的通知。悬停、键盘聚焦或窗口失焦期间暂停自动关闭。
19
+ 应用在 `IqujiOverlayProvider` 内、路由外注册 `IqujiNotificationProvider`,传入 `closeLabel`,可通过 `label` 注入通知区域名称(默认“通知”)。`placement` 支持 `topLeft`、`topRight`、`bottomLeft`、`bottomRight`,默认右上;`duration` 单位为毫秒,默认 5000,`0` 表示常驻;`maxCount` 默认 3,超出时关闭最早的通知。自动关闭通知显示剩余秒数与进度条;悬停、键盘聚焦或窗口失焦期间同步暂停自动关闭与视觉计时,重复 key 更新时重新计时。
20
20
 
21
21
  `useIqujiNotification()` 提供 `open({ key?, title, description?, tone?, duration?, actions?, onClose? })` 与 `close(key?)`。`open` 返回通知 key,重复 key 更新内容并重新计时;`tone` 沿用 `info | success | warning | danger`。不传 key 时创建独立通知,`close()` 关闭全部,`close(key)` 关闭指定通知。标题、正文与操作节点由应用提供;成功提交与实际执行结果须由应用准确区分,公共包不请求接口或宣称任务完成。
22
22
 
@@ -57,9 +57,10 @@ export interface IqujiPopoverProps {
57
57
  onOpenChange?: ComponentProps<typeof BasePopover.Root>["onOpenChange"];
58
58
  side?: "top" | "right" | "bottom" | "left" | undefined;
59
59
  align?: "start" | "center" | "end" | undefined;
60
+ sideOffset?: number | undefined;
60
61
  collisionBoundary?: ComponentProps<typeof BasePopover.Positioner>["collisionBoundary"];
61
62
  collisionPadding?: ComponentProps<typeof BasePopover.Positioner>["collisionPadding"];
62
63
  collisionAvoidance?: ComponentProps<typeof BasePopover.Positioner>["collisionAvoidance"];
63
64
  popupStyle?: CSSProperties | undefined;
64
65
  }
65
- export declare function IqujiPopover({ anchor, trigger, children, open, onOpenChange, side, align, collisionBoundary, collisionPadding, collisionAvoidance, popupStyle, finalFocus, }: IqujiPopoverProps): import("react/jsx-runtime").JSX.Element;
66
+ export declare function IqujiPopover({ anchor, trigger, children, open, onOpenChange, side, align, sideOffset, collisionBoundary, collisionPadding, collisionAvoidance, popupStyle, finalFocus, }: IqujiPopoverProps): import("react/jsx-runtime").JSX.Element;
package/dist/index.js CHANGED
@@ -557,6 +557,7 @@ function IqujiPopover({
557
557
  onOpenChange,
558
558
  side = "bottom",
559
559
  align,
560
+ sideOffset = 8,
560
561
  collisionBoundary,
561
562
  collisionPadding,
562
563
  collisionAvoidance,
@@ -580,7 +581,7 @@ function IqujiPopover({
580
581
  anchor,
581
582
  side,
582
583
  align,
583
- sideOffset: 8,
584
+ sideOffset,
584
585
  collisionBoundary,
585
586
  collisionPadding,
586
587
  collisionAvoidance,
@@ -2699,11 +2700,13 @@ function IqujiSegmentedControl({
2699
2700
  });
2700
2701
  }
2701
2702
  // src/multi-select.tsx
2702
- import { Fragment as Fragment6, useId as useId8, useMemo as useMemo4, useState as useState10 } from "react";
2703
+ import { useId as useId8, useMemo as useMemo4, useState as useState10 } from "react";
2704
+ import { IqujiIcon as IqujiIcon11 } from "@iquji-web/web-icons";
2703
2705
  import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
2704
2706
  function IqujiMultiSelect({
2705
2707
  className,
2706
2708
  clearLabel,
2709
+ clearOptionLabel,
2707
2710
  disabled = false,
2708
2711
  emptyLabel = "没有匹配项",
2709
2712
  label,
@@ -2713,7 +2716,8 @@ function IqujiMultiSelect({
2713
2716
  searchable = false,
2714
2717
  searchLabel = "搜索选项",
2715
2718
  selectAllLabel,
2716
- value
2719
+ value,
2720
+ variant = "select"
2717
2721
  }) {
2718
2722
  const labelId = useId8();
2719
2723
  const [open, setOpen] = useState10(false);
@@ -2746,6 +2750,9 @@ function IqujiMultiSelect({
2746
2750
  }
2747
2751
  onChange(options.filter((item) => next.has(item.value)).map((item) => item.value));
2748
2752
  };
2753
+ const isSelectVariant = variant === "select";
2754
+ const isTagsVariant = variant === "tags";
2755
+ const isCheckboxVariant = variant === "checkbox";
2749
2756
  return /* @__PURE__ */ jsxs20("div", {
2750
2757
  className: classNames("iquji-multi-select", className),
2751
2758
  children: [
@@ -2755,58 +2762,171 @@ function IqujiMultiSelect({
2755
2762
  children: label
2756
2763
  }),
2757
2764
  /* @__PURE__ */ jsx22(IqujiPopover, {
2765
+ align: "start",
2758
2766
  onOpenChange: setOpen,
2759
2767
  open,
2760
- trigger: /* @__PURE__ */ jsx22(IqujiButton, {
2768
+ sideOffset: 4,
2769
+ trigger: /* @__PURE__ */ jsxs20("button", {
2770
+ type: "button",
2761
2771
  "aria-expanded": open,
2762
2772
  "aria-haspopup": "listbox",
2763
2773
  "aria-labelledby": labelId,
2764
- className: "iquji-multi-select__trigger",
2774
+ className: classNames("iquji-select", "iquji-multi-select__trigger", open && "iquji-multi-select__trigger--open", selectedOptions.length === 0 && "iquji-multi-select__trigger--empty"),
2765
2775
  disabled,
2766
- variant: "secondary",
2767
- children: /* @__PURE__ */ jsx22("span", {
2768
- className: "iquji-multi-select__value",
2769
- children: selectedOptions.length ? selectedOptions.map((option, index) => /* @__PURE__ */ jsxs20(Fragment6, {
2770
- children: [
2771
- index > 0 ? "、" : null,
2772
- option.label
2773
- ]
2774
- }, option.value)) : placeholder
2775
- })
2776
+ children: [
2777
+ /* @__PURE__ */ jsx22("span", {
2778
+ className: "iquji-select__value iquji-multi-select__value",
2779
+ children: isTagsVariant ? selectedOptions.length > 0 ? /* @__PURE__ */ jsxs20("span", {
2780
+ className: "iquji-multi-select__tags",
2781
+ children: [
2782
+ selectedOptions.slice(0, 3).map((option) => /* @__PURE__ */ jsx22("span", {
2783
+ className: "iquji-multi-select__tag",
2784
+ children: option.label
2785
+ }, option.value)),
2786
+ selectedOptions.length > 3 ? /* @__PURE__ */ jsxs20("span", {
2787
+ className: "iquji-multi-select__tag iquji-multi-select__tag--count",
2788
+ children: [
2789
+ "+",
2790
+ selectedOptions.length - 3
2791
+ ]
2792
+ }) : null
2793
+ ]
2794
+ }) : /* @__PURE__ */ jsx22("span", {
2795
+ className: "iquji-multi-select__placeholder",
2796
+ children: placeholder
2797
+ }) : selectedOptions.length > 0 ? /* @__PURE__ */ jsx22("span", {
2798
+ className: "iquji-multi-select__text",
2799
+ children: selectedOptions.map((option) => option.label).join("、")
2800
+ }) : /* @__PURE__ */ jsx22("span", {
2801
+ className: "iquji-multi-select__placeholder",
2802
+ children: placeholder
2803
+ })
2804
+ }),
2805
+ /* @__PURE__ */ jsx22("span", {
2806
+ className: classNames("iquji-select__indicator", "iquji-multi-select__indicator", open && "iquji-multi-select__indicator--open"),
2807
+ "aria-hidden": "true",
2808
+ children: /* @__PURE__ */ jsx22(IqujiIcon11, {
2809
+ decorative: true,
2810
+ name: "chevron-down",
2811
+ size: 16
2812
+ })
2813
+ })
2814
+ ]
2776
2815
  }),
2777
2816
  children: /* @__PURE__ */ jsxs20("div", {
2778
2817
  className: "iquji-multi-select__popup",
2779
2818
  children: [
2780
- searchable ? /* @__PURE__ */ jsx22(IqujiInput, {
2781
- "aria-label": searchLabel,
2782
- onChange: (event) => setQuery(event.currentTarget.value),
2783
- placeholder: searchLabel,
2784
- value: query
2819
+ searchable ? /* @__PURE__ */ jsx22("div", {
2820
+ className: "iquji-multi-select__search",
2821
+ children: /* @__PURE__ */ jsx22(IqujiInput, {
2822
+ "aria-label": searchLabel,
2823
+ onChange: (event) => setQuery(event.currentTarget.value),
2824
+ placeholder: searchLabel,
2825
+ value: query
2826
+ })
2785
2827
  }) : null,
2786
2828
  /* @__PURE__ */ jsxs20("div", {
2787
2829
  "aria-label": label,
2788
- className: "iquji-multi-select__options",
2789
- role: "group",
2830
+ className: "iquji-select__list iquji-multi-select__options",
2831
+ role: "listbox",
2832
+ "aria-multiselectable": "true",
2790
2833
  children: [
2791
- visible.map((option) => /* @__PURE__ */ jsx22(IqujiCheckbox, {
2792
- checked: selected.has(option.value),
2793
- description: option.description,
2794
- disabled: disabled || option.disabled,
2795
- label: option.label,
2796
- onChange: (event) => toggle(option, event.currentTarget.checked)
2797
- }, option.value)),
2834
+ clearOptionLabel ? /* @__PURE__ */ jsxs20("div", {
2835
+ role: "option",
2836
+ "aria-selected": selected.size === 0,
2837
+ className: classNames("iquji-select__item", "iquji-multi-select__item", selected.size === 0 && "iquji-select__item--selected iquji-multi-select__item--selected"),
2838
+ onClick: () => {
2839
+ if (!disabled)
2840
+ onChange([]);
2841
+ },
2842
+ children: [
2843
+ isCheckboxVariant ? /* @__PURE__ */ jsx22("span", {
2844
+ className: classNames("iquji-multi-select__checkbox", selected.size === 0 && "iquji-multi-select__checkbox--checked"),
2845
+ "aria-hidden": "true",
2846
+ children: selected.size === 0 ? /* @__PURE__ */ jsx22(IqujiIcon11, {
2847
+ decorative: true,
2848
+ name: "check",
2849
+ size: 11,
2850
+ strokeWidth: 2.4
2851
+ }) : null
2852
+ }) : null,
2853
+ /* @__PURE__ */ jsx22("span", {
2854
+ className: "iquji-select__item-text iquji-multi-select__item-text",
2855
+ children: clearOptionLabel
2856
+ }),
2857
+ !isCheckboxVariant && selected.size === 0 ? /* @__PURE__ */ jsx22("span", {
2858
+ className: "iquji-select__item-indicator iquji-multi-select__item-indicator",
2859
+ "aria-hidden": "true",
2860
+ children: /* @__PURE__ */ jsx22(IqujiIcon11, {
2861
+ decorative: true,
2862
+ name: "check",
2863
+ size: 16
2864
+ })
2865
+ }) : null
2866
+ ]
2867
+ }) : null,
2868
+ visible.map((option) => {
2869
+ const isChecked = selected.has(option.value);
2870
+ const isOptionDisabled = disabled || option.disabled;
2871
+ return /* @__PURE__ */ jsxs20("div", {
2872
+ role: "option",
2873
+ "aria-selected": isChecked,
2874
+ "aria-disabled": isOptionDisabled,
2875
+ "data-disabled": isOptionDisabled || undefined,
2876
+ className: classNames("iquji-select__item", "iquji-multi-select__item", isChecked && "iquji-select__item--selected iquji-multi-select__item--selected", isOptionDisabled && "iquji-multi-select__item--disabled"),
2877
+ onClick: () => {
2878
+ if (!isOptionDisabled) {
2879
+ toggle(option, !isChecked);
2880
+ }
2881
+ },
2882
+ children: [
2883
+ isCheckboxVariant ? /* @__PURE__ */ jsx22("span", {
2884
+ className: classNames("iquji-multi-select__checkbox", isChecked && "iquji-multi-select__checkbox--checked"),
2885
+ "aria-hidden": "true",
2886
+ children: isChecked ? /* @__PURE__ */ jsx22(IqujiIcon11, {
2887
+ decorative: true,
2888
+ name: "check",
2889
+ size: 11,
2890
+ strokeWidth: 2.4
2891
+ }) : null
2892
+ }) : null,
2893
+ /* @__PURE__ */ jsxs20("div", {
2894
+ className: "iquji-multi-select__item-content",
2895
+ children: [
2896
+ /* @__PURE__ */ jsx22("span", {
2897
+ className: "iquji-select__item-text iquji-multi-select__item-text",
2898
+ children: option.label
2899
+ }),
2900
+ option.description ? /* @__PURE__ */ jsx22("span", {
2901
+ className: "iquji-multi-select__item-desc",
2902
+ children: option.description
2903
+ }) : null
2904
+ ]
2905
+ }),
2906
+ !isCheckboxVariant && isChecked ? /* @__PURE__ */ jsx22("span", {
2907
+ className: "iquji-select__item-indicator iquji-multi-select__item-indicator",
2908
+ "aria-hidden": "true",
2909
+ children: /* @__PURE__ */ jsx22(IqujiIcon11, {
2910
+ decorative: true,
2911
+ name: "check",
2912
+ size: 16
2913
+ })
2914
+ }) : null
2915
+ ]
2916
+ }, option.value);
2917
+ }),
2798
2918
  visible.length === 0 ? /* @__PURE__ */ jsx22("p", {
2799
2919
  className: "iquji-multi-select__empty",
2800
2920
  children: emptyLabel
2801
2921
  }) : null
2802
2922
  ]
2803
2923
  }),
2804
- /* @__PURE__ */ jsxs20("div", {
2924
+ selectAllLabel || clearLabel ? /* @__PURE__ */ jsxs20("div", {
2805
2925
  className: "iquji-multi-select__actions",
2806
2926
  children: [
2807
2927
  selectAllLabel ? /* @__PURE__ */ jsx22(IqujiButton, {
2808
2928
  compact: true,
2809
- disabled,
2929
+ disabled: disabled || selected.size === options.length,
2810
2930
  onClick: selectAll,
2811
2931
  variant: "ghost",
2812
2932
  children: selectAllLabel
@@ -2822,7 +2942,7 @@ function IqujiMultiSelect({
2822
2942
  children: clearLabel
2823
2943
  }) : null
2824
2944
  ]
2825
- })
2945
+ }) : null
2826
2946
  ]
2827
2947
  })
2828
2948
  })
@@ -2911,17 +3031,20 @@ function IqujiTabs({
2911
3031
  }
2912
3032
  // src/notification.tsx
2913
3033
  import { Toast } from "@base-ui/react/toast";
2914
- import { IqujiIcon as IqujiIcon11 } from "@iquji-web/web-icons";
3034
+ import { IqujiIcon as IqujiIcon12 } from "@iquji-web/web-icons";
2915
3035
  import {
2916
3036
  createContext as createContext3,
2917
3037
  useCallback as useCallback6,
2918
3038
  useContext as useContext3,
3039
+ useEffect as useEffect4,
2919
3040
  useId as useId10,
2920
3041
  useMemo as useMemo5,
2921
- useRef as useRef9
3042
+ useRef as useRef9,
3043
+ useState as useState11
2922
3044
  } from "react";
2923
- import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
3045
+ import { jsx as jsx24, jsxs as jsxs21, Fragment as Fragment6 } from "react/jsx-runtime";
2924
3046
  var Context2 = createContext3(null);
3047
+ var TimerPauseContext = createContext3(false);
2925
3048
  var icons = {
2926
3049
  info: "circle-info",
2927
3050
  success: "check-circle",
@@ -2933,7 +3056,7 @@ function IqujiNotificationProvider({
2933
3056
  closeLabel,
2934
3057
  label = "通知",
2935
3058
  placement = "topRight",
2936
- duration = 4500,
3059
+ duration = 5000,
2937
3060
  maxCount = 3
2938
3061
  }) {
2939
3062
  if (!closeLabel.trim())
@@ -2968,6 +3091,26 @@ function NotificationContent({
2968
3091
  const prefix = useId10();
2969
3092
  const sequence = useRef9(0);
2970
3093
  const active = useRef9(new Map);
3094
+ const [windowFocused, setWindowFocused] = useState11(true);
3095
+ useEffect4(() => {
3096
+ const win = document.defaultView;
3097
+ if (!win)
3098
+ return;
3099
+ const handleBlur = (event) => {
3100
+ if (event.target === win)
3101
+ setWindowFocused(false);
3102
+ };
3103
+ const handleFocus = (event) => {
3104
+ if (!event.relatedTarget && event.target !== win)
3105
+ setWindowFocused(true);
3106
+ };
3107
+ win.addEventListener("blur", handleBlur, true);
3108
+ win.addEventListener("focus", handleFocus, true);
3109
+ return () => {
3110
+ win.removeEventListener("blur", handleBlur, true);
3111
+ win.removeEventListener("focus", handleFocus, true);
3112
+ };
3113
+ }, []);
2971
3114
  const open = useCallback6((options) => {
2972
3115
  const timeout = options.duration ?? duration;
2973
3116
  if (!Number.isFinite(timeout) || timeout < 0)
@@ -2980,7 +3123,7 @@ function NotificationContent({
2980
3123
  description: options.description,
2981
3124
  type: options.tone ?? "info",
2982
3125
  timeout,
2983
- data: { actions: options.actions },
3126
+ data: { actions: options.actions, revision: ++sequence.current },
2984
3127
  onClose: () => {
2985
3128
  if (active.current.get(key) === id)
2986
3129
  active.current.delete(key);
@@ -3021,8 +3164,16 @@ function NotificationContent({
3021
3164
  "aria-label": label,
3022
3165
  className: "iquji-notification-viewport",
3023
3166
  "data-placement": placement,
3167
+ render: (props, state) => /* @__PURE__ */ jsx24("div", {
3168
+ ...props,
3169
+ children: /* @__PURE__ */ jsx24(TimerPauseContext.Provider, {
3170
+ value: state.expanded || !windowFocused,
3171
+ children: props.children
3172
+ })
3173
+ }),
3024
3174
  children: toasts.map((toast) => {
3025
3175
  const tone = toast.type ?? "info";
3176
+ const timeout = toast.timeout ?? duration;
3026
3177
  return /* @__PURE__ */ jsxs21(Toast.Root, {
3027
3178
  className: "iquji-notification",
3028
3179
  "data-tone": tone,
@@ -3034,11 +3185,14 @@ function NotificationContent({
3034
3185
  swipeDirection: [],
3035
3186
  toast,
3036
3187
  children: [
3037
- /* @__PURE__ */ jsx24(IqujiIcon11, {
3038
- className: "iquji-notification__icon",
3039
- decorative: true,
3040
- name: icons[tone],
3041
- size: 21
3188
+ /* @__PURE__ */ jsx24("span", {
3189
+ className: "iquji-notification__icon-badge",
3190
+ children: /* @__PURE__ */ jsx24(IqujiIcon12, {
3191
+ className: "iquji-notification__icon",
3192
+ decorative: true,
3193
+ name: icons[tone],
3194
+ size: 14
3195
+ })
3042
3196
  }),
3043
3197
  /* @__PURE__ */ jsxs21(Toast.Content, {
3044
3198
  className: "iquji-notification__content",
@@ -3055,18 +3209,10 @@ function NotificationContent({
3055
3209
  })
3056
3210
  ]
3057
3211
  }),
3058
- /* @__PURE__ */ jsx24(Toast.Close, {
3059
- render: /* @__PURE__ */ jsx24(IconButton, {
3060
- compact: true,
3061
- className: "iquji-notification__close",
3062
- icon: /* @__PURE__ */ jsx24(IqujiIcon11, {
3063
- decorative: true,
3064
- name: "close",
3065
- size: 16
3066
- }),
3067
- label: closeLabel
3068
- })
3069
- })
3212
+ /* @__PURE__ */ jsx24(NotificationTimer, {
3213
+ duration: timeout,
3214
+ closeLabel
3215
+ }, toast.data?.revision)
3070
3216
  ]
3071
3217
  }, toast.id);
3072
3218
  })
@@ -3075,6 +3221,68 @@ function NotificationContent({
3075
3221
  ]
3076
3222
  });
3077
3223
  }
3224
+ function NotificationTimer({
3225
+ duration,
3226
+ closeLabel
3227
+ }) {
3228
+ const paused = useContext3(TimerPauseContext);
3229
+ const remaining = useRef9(duration);
3230
+ const [seconds, setSeconds] = useState11(() => Math.ceil(duration / 1000));
3231
+ useEffect4(() => {
3232
+ if (duration <= 0 || paused)
3233
+ return;
3234
+ const started = Date.now();
3235
+ const initial = remaining.current;
3236
+ const update = () => {
3237
+ remaining.current = Math.max(0, initial - (Date.now() - started));
3238
+ setSeconds(Math.ceil(remaining.current / 1000));
3239
+ };
3240
+ const interval = setInterval(() => {
3241
+ update();
3242
+ }, 100);
3243
+ return () => {
3244
+ clearInterval(interval);
3245
+ remaining.current = Math.max(0, initial - (Date.now() - started));
3246
+ };
3247
+ }, [duration, paused]);
3248
+ return /* @__PURE__ */ jsxs21(Fragment6, {
3249
+ children: [
3250
+ /* @__PURE__ */ jsxs21("div", {
3251
+ className: "iquji-notification__side",
3252
+ children: [
3253
+ duration > 0 && /* @__PURE__ */ jsxs21("span", {
3254
+ "aria-hidden": "true",
3255
+ className: "iquji-notification__countdown",
3256
+ children: [
3257
+ seconds,
3258
+ "s"
3259
+ ]
3260
+ }),
3261
+ /* @__PURE__ */ jsx24(Toast.Close, {
3262
+ render: /* @__PURE__ */ jsx24(IconButton, {
3263
+ compact: true,
3264
+ className: "iquji-notification__close",
3265
+ icon: /* @__PURE__ */ jsx24(IqujiIcon12, {
3266
+ decorative: true,
3267
+ name: "close",
3268
+ size: 12
3269
+ }),
3270
+ label: closeLabel
3271
+ })
3272
+ })
3273
+ ]
3274
+ }),
3275
+ duration > 0 && /* @__PURE__ */ jsx24("span", {
3276
+ "aria-hidden": "true",
3277
+ className: "iquji-notification__progress",
3278
+ style: {
3279
+ animationDuration: `${duration}ms`,
3280
+ animationPlayState: paused ? "paused" : "running"
3281
+ }
3282
+ })
3283
+ ]
3284
+ });
3285
+ }
3078
3286
  function useIqujiNotification() {
3079
3287
  const value = useContext3(Context2);
3080
3288
  if (!value)
@@ -3221,13 +3429,13 @@ function IqujiScrollArea({
3221
3429
  });
3222
3430
  }
3223
3431
  // src/search-dialog.tsx
3224
- import { IqujiIcon as IqujiIcon12 } from "@iquji-web/web-icons";
3432
+ import { IqujiIcon as IqujiIcon13 } from "@iquji-web/web-icons";
3225
3433
  import {
3226
- useEffect as useEffect4,
3434
+ useEffect as useEffect5,
3227
3435
  useId as useId11,
3228
3436
  useMemo as useMemo6,
3229
3437
  useRef as useRef10,
3230
- useState as useState11
3438
+ useState as useState12
3231
3439
  } from "react";
3232
3440
  import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
3233
3441
  function IqujiSearchDialog({
@@ -3244,8 +3452,8 @@ function IqujiSearchDialog({
3244
3452
  const input = useRef10(null);
3245
3453
  const options = useRef10(new Map);
3246
3454
  const composing = useRef10(false);
3247
- const [query, setQuery] = useState11("");
3248
- const [activeId, setActiveId] = useState11(null);
3455
+ const [query, setQuery] = useState12("");
3456
+ const [activeId, setActiveId] = useState12(null);
3249
3457
  const filtered = useMemo6(() => {
3250
3458
  const term = query.trim().toLocaleLowerCase();
3251
3459
  return groups.flatMap((group) => {
@@ -3257,16 +3465,16 @@ function IqujiSearchDialog({
3257
3465
  const active = enabled.find((item) => item.id === activeId) ?? enabled[0];
3258
3466
  const selectedId = active?.id;
3259
3467
  const optionId = (itemId) => `${id}-option-${encodeURIComponent(itemId)}`;
3260
- useEffect4(() => {
3468
+ useEffect5(() => {
3261
3469
  setQuery("");
3262
3470
  setActiveId(null);
3263
3471
  composing.current = false;
3264
3472
  }, [open]);
3265
- useEffect4(() => {
3473
+ useEffect5(() => {
3266
3474
  if (activeId && !enabled.some((item) => item.id === activeId))
3267
3475
  setActiveId(null);
3268
3476
  }, [activeId, enabled]);
3269
- useEffect4(() => {
3477
+ useEffect5(() => {
3270
3478
  if (open && selectedId)
3271
3479
  options.current.get(selectedId)?.scrollIntoView?.({ block: "nearest" });
3272
3480
  }, [selectedId, open, query]);
@@ -3308,7 +3516,7 @@ function IqujiSearchDialog({
3308
3516
  /* @__PURE__ */ jsxs24("div", {
3309
3517
  className: "iquji-search-dialog__query",
3310
3518
  children: [
3311
- /* @__PURE__ */ jsx28(IqujiIcon12, {
3519
+ /* @__PURE__ */ jsx28(IqujiIcon13, {
3312
3520
  decorative: true,
3313
3521
  name: "search"
3314
3522
  }),
@@ -3549,7 +3757,7 @@ function IqujiSettingsSection({
3549
3757
  });
3550
3758
  }
3551
3759
  // src/settings-nav.tsx
3552
- import { IqujiIcon as IqujiIcon13 } from "@iquji-web/web-icons";
3760
+ import { IqujiIcon as IqujiIcon14 } from "@iquji-web/web-icons";
3553
3761
  import { useId as useId13 } from "react";
3554
3762
  import { jsx as jsx30, jsxs as jsxs26, Fragment as Fragment7 } from "react/jsx-runtime";
3555
3763
  function navItemContent(item) {
@@ -3599,7 +3807,7 @@ function IqujiSettingsNav({
3599
3807
  /* @__PURE__ */ jsx30("span", {
3600
3808
  "aria-hidden": "true",
3601
3809
  className: "iquji-settings-nav__search-icon",
3602
- children: /* @__PURE__ */ jsx30(IqujiIcon13, {
3810
+ children: /* @__PURE__ */ jsx30(IqujiIcon14, {
3603
3811
  decorative: true,
3604
3812
  name: "search",
3605
3813
  size: 15
@@ -3901,7 +4109,7 @@ import {
3901
4109
  useId as useId15,
3902
4110
  useLayoutEffect,
3903
4111
  useRef as useRef11,
3904
- useState as useState12
4112
+ useState as useState13
3905
4113
  } from "react";
3906
4114
  import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
3907
4115
  var DEFAULT_LEFT_WIDTH = 240;
@@ -3957,13 +4165,13 @@ function IqujiWorkbenchLayout({
3957
4165
  const rightRef = useRef11(null);
3958
4166
  const previousGeometry = useRef11(null);
3959
4167
  const dragRef = useRef11(null);
3960
- const [resizing, setResizing] = useState12(null);
4168
+ const [resizing, setResizing] = useState13(null);
3961
4169
  const leftBounds = widthBounds(leftMinWidth ?? DEFAULT_LEFT_MIN, leftMaxWidth ?? DEFAULT_LEFT_MAX);
3962
4170
  const rightBounds = widthBounds(rightMinWidth ?? DEFAULT_RIGHT_MIN, rightMaxWidth ?? DEFAULT_RIGHT_MAX);
3963
4171
  const leftDefault = clampWidth(numberOr(defaultLeftWidth, DEFAULT_LEFT_WIDTH), leftBounds.min, leftBounds.max);
3964
4172
  const rightDefault = clampWidth(numberOr(defaultRightWidth, DEFAULT_RIGHT_WIDTH), rightBounds.min, rightBounds.max);
3965
- const [internalLeftWidth, setInternalLeftWidth] = useState12(leftDefault);
3966
- const [internalRightWidth, setInternalRightWidth] = useState12(rightDefault);
4173
+ const [internalLeftWidth, setInternalLeftWidth] = useState13(leftDefault);
4174
+ const [internalRightWidth, setInternalRightWidth] = useState13(rightDefault);
3967
4175
  const leftValue = clampWidth(numberOr(leftWidth, internalLeftWidth), leftBounds.min, leftBounds.max);
3968
4176
  const rightValue = clampWidth(numberOr(rightWidth, internalRightWidth), rightBounds.min, rightBounds.max);
3969
4177
  const centerMin = Math.max(1, Math.round(numberOr(centerMinWidth, DEFAULT_CENTER_MIN)));
@@ -4151,11 +4359,11 @@ function IqujiWorkbenchLayout({
4151
4359
  });
4152
4360
  }
4153
4361
  // src/emoji-picker.tsx
4154
- import { useId as useId16, useMemo as useMemo7, useRef as useRef12, useState as useState13 } from "react";
4362
+ import { useId as useId16, useMemo as useMemo7, useRef as useRef12, useState as useState14 } from "react";
4155
4363
  import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
4156
4364
  function IqujiEmojiPicker({ value, options, onChange, label, searchLabel, emptyLabel, clearLabel, allLabel, disabled, variant = "primary" }) {
4157
- const [open, setOpen] = useState13(false), [search, setSearch] = useState13("");
4158
- const [category, setCategory] = useState13(null), [active, setActive] = useState13(0);
4365
+ const [open, setOpen] = useState14(false), [search, setSearch] = useState14("");
4366
+ const [category, setCategory] = useState14(null), [active, setActive] = useState14(0);
4159
4367
  const id = useId16(), buttons = useRef12(new Map);
4160
4368
  const categories = useMemo7(() => [...new Set(options.flatMap((option) => option.category ? [option.category] : []))], [options]);
4161
4369
  const filtered = useMemo7(() => options.filter((option) => (!category || option.category === category) && `${option.label} ${option.keywords ?? ""} ${option.value}`.toLocaleLowerCase().includes(search.trim().toLocaleLowerCase())), [options, search, category]);
@@ -17,6 +17,8 @@ export type IqujiMultiSelectProps<Value extends string> = {
17
17
  emptyLabel?: string;
18
18
  selectAllLabel?: string;
19
19
  clearLabel?: string;
20
+ clearOptionLabel?: string;
21
+ variant?: "select" | "tags" | "checkbox";
20
22
  className?: string;
21
23
  };
22
- export declare function IqujiMultiSelect<Value extends string>({ className, clearLabel, disabled, emptyLabel, label, onChange, options, placeholder, searchable, searchLabel, selectAllLabel, value, }: IqujiMultiSelectProps<Value>): import("react/jsx-runtime").JSX.Element;
24
+ export declare function IqujiMultiSelect<Value extends string>({ className, clearLabel, clearOptionLabel, disabled, emptyLabel, label, onChange, options, placeholder, searchable, searchLabel, selectAllLabel, value, variant, }: IqujiMultiSelectProps<Value>): import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ export type IqujiNotificationOptions = {
6
6
  title: ReactNode;
7
7
  description?: ReactNode;
8
8
  tone?: Exclude<IqujiTone, "neutral">;
9
- /** 自动关闭时间,单位毫秒;0 表示保持显示。 */
9
+ /** 自动关闭时间,单位毫秒;0 表示保持显示。默认 5000ms。 */
10
10
  duration?: number;
11
11
  actions?: ReactNode;
12
12
  onClose?: () => void;
package/dist/styles.css CHANGED
@@ -1334,10 +1334,10 @@
1334
1334
 
1335
1335
  /* src/notification.css */
1336
1336
  .iquji-notification-viewport {
1337
- --iquji-notification-offset: max(24px, env(safe-area-inset-top));
1337
+ --iquji-notification-offset: max(20px, env(safe-area-inset-top));
1338
1338
  box-sizing: border-box;
1339
1339
  display: flex;
1340
- gap: var(--iquji-space-3);
1340
+ gap: var(--iquji-space-2, 8px);
1341
1341
  outline: none;
1342
1342
  overflow-x: hidden;
1343
1343
  overflow-y: auto;
@@ -1347,9 +1347,9 @@
1347
1347
  top: var(--iquji-notification-offset);
1348
1348
  z-index: 2100;
1349
1349
  flex-direction: column;
1350
- width: min(392px, 100vw - 32px);
1350
+ width: min(340px, 100vw - 32px);
1351
1351
  max-height: calc(100dvh - 48px);
1352
- padding: 4px;
1352
+ padding: 6px;
1353
1353
  }
1354
1354
 
1355
1355
  .iquji-notification-viewport[data-placement$="Left"] {
@@ -1358,28 +1358,34 @@
1358
1358
  }
1359
1359
 
1360
1360
  .iquji-notification-viewport[data-placement^="bottom"] {
1361
- bottom: max(24px, env(safe-area-inset-bottom));
1361
+ bottom: max(20px, env(safe-area-inset-bottom));
1362
1362
  flex-direction: column-reverse;
1363
1363
  top: auto;
1364
1364
  }
1365
1365
 
1366
1366
  .iquji-notification {
1367
- background: var(--iquji-color-surface-raised);
1368
- border: 1px solid var(--iquji-color-border-strong);
1369
- border-radius: var(--iquji-radius-overlay);
1370
- box-shadow: var(--iquji-shadow-overlay);
1367
+ background: var(--iquji-color-surface-raised, #fff);
1368
+ border: 1px solid var(--iquji-color-border, #0000001f);
1369
+ border-radius: var(--iquji-radius-panel, 8px);
1371
1370
  box-sizing: border-box;
1372
1371
  color: var(--iquji-color-text);
1373
1372
  display: grid;
1374
- align-items: start;
1375
- gap: var(--iquji-space-3);
1376
- grid-template-columns: 21px minmax(0, 1fr) 24px;
1373
+ grid-template-columns: 24px minmax(0, 1fr) auto;
1377
1374
  opacity: 1;
1378
- padding: var(--iquji-space-4);
1375
+ overflow: hidden;
1379
1376
  pointer-events: auto;
1380
- transition: opacity var(--iquji-motion-overlay) var(--iquji-ease-standard), transform var(--iquji-motion-overlay) var(--iquji-ease-standard);
1377
+ position: relative;
1378
+ transition: opacity var(--iquji-motion-overlay, .18s) var(--iquji-ease-standard, ease), transform var(--iquji-motion-overlay, .18s) var(--iquji-ease-standard, ease);
1381
1379
  flex: none;
1380
+ align-items: flex-start;
1381
+ gap: 10px;
1382
+ padding: 10px 12px 12px;
1382
1383
  transform: translateX(0);
1384
+ box-shadow: none !important;
1385
+ }
1386
+
1387
+ .iquji-notification:hover {
1388
+ box-shadow: none !important;
1383
1389
  }
1384
1390
 
1385
1391
  .iquji-notification:focus-visible {
@@ -1389,19 +1395,19 @@
1389
1395
 
1390
1396
  .iquji-notification[data-starting-style], .iquji-notification[data-ending-style] {
1391
1397
  opacity: 0;
1392
- transform: translateX(12px);
1398
+ transform: translateX(12px)scale(.97);
1393
1399
  }
1394
1400
 
1395
1401
  .iquji-notification-viewport[data-placement$="Left"] .iquji-notification:-webkit-any([data-starting-style], [data-ending-style]) {
1396
- transform: translateX(-12px);
1402
+ transform: translateX(-12px)scale(.97);
1397
1403
  }
1398
1404
 
1399
1405
  .iquji-notification-viewport[data-placement$="Left"] .iquji-notification:-moz-any([data-starting-style], [data-ending-style]) {
1400
- transform: translateX(-12px);
1406
+ transform: translateX(-12px)scale(.97);
1401
1407
  }
1402
1408
 
1403
1409
  .iquji-notification-viewport[data-placement$="Left"] .iquji-notification:is([data-starting-style], [data-ending-style]) {
1404
- transform: translateX(-12px);
1410
+ transform: translateX(-12px)scale(.97);
1405
1411
  }
1406
1412
 
1407
1413
  .iquji-notification[data-ending-style], .iquji-notification[data-limited] {
@@ -1412,55 +1418,154 @@
1412
1418
  display: none;
1413
1419
  }
1414
1420
 
1415
- .iquji-notification__icon {
1416
- color: var(--iquji-color-info-text);
1421
+ .iquji-notification__icon-badge {
1422
+ background: var(--iquji-color-info-fill, #e7f0ff);
1423
+ display: flex;
1424
+ border-radius: 50%;
1425
+ flex-shrink: 0;
1426
+ justify-content: center;
1427
+ align-items: center;
1428
+ width: 24px;
1429
+ height: 24px;
1417
1430
  margin-top: 1px;
1418
1431
  }
1419
1432
 
1433
+ .iquji-notification__icon {
1434
+ color: var(--iquji-color-info-text, #174f9b);
1435
+ }
1436
+
1437
+ .iquji-notification[data-tone="success"] .iquji-notification__icon-badge {
1438
+ background: var(--iquji-color-positive-fill, #dff2e7);
1439
+ }
1440
+
1420
1441
  .iquji-notification[data-tone="success"] .iquji-notification__icon {
1421
- color: var(--iquji-color-positive-text);
1442
+ color: var(--iquji-color-positive-text, #17623c);
1443
+ }
1444
+
1445
+ .iquji-notification[data-tone="warning"] .iquji-notification__icon-badge {
1446
+ background: var(--iquji-color-warning-fill, #fff3d6);
1422
1447
  }
1423
1448
 
1424
1449
  .iquji-notification[data-tone="warning"] .iquji-notification__icon {
1425
- color: var(--iquji-color-warning-text);
1450
+ color: var(--iquji-color-warning-text, #755000);
1451
+ }
1452
+
1453
+ .iquji-notification[data-tone="danger"] .iquji-notification__icon-badge {
1454
+ background: var(--iquji-color-critical-fill, #ffe9e7);
1426
1455
  }
1427
1456
 
1428
1457
  .iquji-notification[data-tone="danger"] .iquji-notification__icon {
1429
- color: var(--iquji-color-critical-text);
1458
+ color: var(--iquji-color-critical-text, #8e2029);
1430
1459
  }
1431
1460
 
1432
1461
  .iquji-notification__content {
1433
- display: grid;
1434
- gap: var(--iquji-space-1);
1462
+ display: flex;
1435
1463
  overflow-wrap: anywhere;
1464
+ flex-direction: column;
1465
+ gap: 2px;
1436
1466
  min-width: 0;
1467
+ padding-top: 1px;
1437
1468
  }
1438
1469
 
1439
1470
  .iquji-notification__title {
1440
- font-size: var(--iquji-font-size-body-md);
1441
- font-weight: 650;
1442
- line-height: var(--iquji-line-height-body-md);
1471
+ color: var(--iquji-color-text);
1472
+ font-size: var(--iquji-font-size-body-sm, 13px);
1473
+ letter-spacing: -.01em;
1474
+ font-weight: 600;
1475
+ line-height: 18px;
1476
+ margin: 0 !important;
1477
+ padding: 0 !important;
1443
1478
  }
1444
1479
 
1445
1480
  .iquji-notification__description {
1446
- color: var(--iquji-color-muted);
1447
- font-size: var(--iquji-font-size-body-sm);
1448
- line-height: var(--iquji-line-height-body-sm);
1481
+ color: var(--iquji-color-text-muted, #686d76);
1482
+ font-size: var(--iquji-font-size-caption, 12px);
1483
+ font-weight: 400;
1484
+ line-height: 17px;
1485
+ margin: 0 !important;
1486
+ padding: 0 !important;
1449
1487
  }
1450
1488
 
1451
1489
  .iquji-notification__actions {
1452
1490
  display: flex;
1453
1491
  align-items: center;
1454
- gap: var(--iquji-space-2);
1455
- margin-top: var(--iquji-space-2);
1492
+ gap: var(--iquji-space-2, 8px);
1456
1493
  flex-wrap: wrap;
1494
+ margin-top: 6px;
1495
+ }
1496
+
1497
+ .iquji-notification__side {
1498
+ display: flex;
1499
+ align-items: center;
1500
+ gap: 6px;
1501
+ margin-top: 2px;
1502
+ }
1503
+
1504
+ .iquji-notification__countdown {
1505
+ color: var(--iquji-color-text-muted, #686d76);
1506
+ font-family: var(--iquji-font-mono, monospace);
1507
+ opacity: .75;
1508
+ user-select: none;
1509
+ font-size: 11px;
1510
+ line-height: 1;
1457
1511
  }
1458
1512
 
1459
1513
  .iquji-notification .iquji-notification__close {
1460
- width: 24px;
1461
- height: 24px;
1462
- min-height: 24px;
1463
- padding: 4px;
1514
+ border-radius: var(--iquji-radius-control, 4px);
1515
+ color: var(--iquji-color-text-muted);
1516
+ opacity: .6;
1517
+ width: 18px;
1518
+ height: 18px;
1519
+ min-height: 18px;
1520
+ padding: 2px;
1521
+ transition: opacity .12s, background .12s, color .12s;
1522
+ }
1523
+
1524
+ .iquji-notification:hover .iquji-notification__close {
1525
+ opacity: 1;
1526
+ }
1527
+
1528
+ .iquji-notification .iquji-notification__close:hover {
1529
+ background: var(--iquji-color-fill-secondary, #0000000f);
1530
+ color: var(--iquji-color-text);
1531
+ }
1532
+
1533
+ .iquji-notification__progress {
1534
+ animation: iquji-notification-progress linear forwards;
1535
+ opacity: .65;
1536
+ pointer-events: none;
1537
+ position: absolute;
1538
+ transform-origin: left center;
1539
+ width: 100%;
1540
+ height: 2px;
1541
+ bottom: 0;
1542
+ left: 0;
1543
+ }
1544
+
1545
+ @keyframes iquji-notification-progress {
1546
+ from {
1547
+ transform: scaleX(1);
1548
+ }
1549
+
1550
+ to {
1551
+ transform: scaleX(0);
1552
+ }
1553
+ }
1554
+
1555
+ .iquji-notification .iquji-notification__progress {
1556
+ background: var(--iquji-color-info-text, #174f9b);
1557
+ }
1558
+
1559
+ .iquji-notification[data-tone="success"] .iquji-notification__progress {
1560
+ background: var(--iquji-color-positive-text, #17623c);
1561
+ }
1562
+
1563
+ .iquji-notification[data-tone="warning"] .iquji-notification__progress {
1564
+ background: var(--iquji-color-warning-text, #755000);
1565
+ }
1566
+
1567
+ .iquji-notification[data-tone="danger"] .iquji-notification__progress {
1568
+ background: var(--iquji-color-critical-text, #8e2029);
1464
1569
  }
1465
1570
 
1466
1571
  /* src/content.css */
@@ -3797,21 +3902,37 @@
3797
3902
  .iquji-multi-select {
3798
3903
  display: grid;
3799
3904
  gap: var(--iquji-space-1);
3905
+ width: 100%;
3800
3906
  min-width: 0;
3801
3907
  }
3802
3908
 
3803
3909
  .iquji-multi-select__label {
3804
3910
  color: var(--iquji-color-text);
3911
+ display: flex;
3805
3912
  font-size: var(--iquji-font-size-body-sm);
3806
- font-weight: 600;
3913
+ align-items: baseline;
3914
+ gap: var(--iquji-space-1);
3915
+ font-weight: 550;
3916
+ line-height: var(--iquji-line-height-body-sm);
3807
3917
  }
3808
3918
 
3809
3919
  .iquji-multi-select__trigger {
3810
- justify-content: flex-start;
3920
+ box-sizing: border-box;
3921
+ display: grid;
3922
+ grid-template-columns: minmax(0, 1fr) 16px;
3923
+ align-items: center;
3811
3924
  width: 100%;
3812
3925
  min-width: 0;
3813
3926
  }
3814
3927
 
3928
+ .iquji-multi-select__indicator {
3929
+ transition: transform var(--iquji-motion-control) var(--iquji-ease-standard);
3930
+ }
3931
+
3932
+ .iquji-multi-select__indicator--open, .iquji-multi-select__trigger--open .iquji-multi-select__indicator {
3933
+ transform: rotate(180deg);
3934
+ }
3935
+
3815
3936
  .iquji-multi-select__value {
3816
3937
  overflow: hidden;
3817
3938
  text-align: left;
@@ -3820,20 +3941,192 @@
3820
3941
  min-width: 0;
3821
3942
  }
3822
3943
 
3944
+ .iquji-multi-select__text {
3945
+ overflow: hidden;
3946
+ text-overflow: ellipsis;
3947
+ white-space: nowrap;
3948
+ min-width: 0;
3949
+ }
3950
+
3951
+ .iquji-multi-select__placeholder {
3952
+ color: var(--iquji-color-subtle);
3953
+ overflow: hidden;
3954
+ text-overflow: ellipsis;
3955
+ white-space: nowrap;
3956
+ }
3957
+
3958
+ .iquji-multi-select__tags {
3959
+ display: flex;
3960
+ flex-wrap: wrap;
3961
+ align-items: center;
3962
+ gap: 4px;
3963
+ min-width: 0;
3964
+ }
3965
+
3966
+ .iquji-multi-select__tag {
3967
+ background: var(--iquji-color-surface-hover);
3968
+ border: 1px solid var(--iquji-color-border);
3969
+ color: var(--iquji-color-text);
3970
+ display: inline-flex;
3971
+ font-size: var(--iquji-font-size-caption);
3972
+ overflow: hidden;
3973
+ text-overflow: ellipsis;
3974
+ white-space: nowrap;
3975
+ border-radius: 4px;
3976
+ align-items: center;
3977
+ max-width: 140px;
3978
+ height: 22px;
3979
+ padding-inline-start: 6px;
3980
+ padding-inline-end: 6px;
3981
+ font-weight: 500;
3982
+ line-height: 1;
3983
+ }
3984
+
3985
+ .iquji-multi-select__tag--count {
3986
+ background: var(--iquji-color-surface-sunken);
3987
+ color: var(--iquji-color-muted);
3988
+ padding-inline-start: 5px;
3989
+ padding-inline-end: 5px;
3990
+ font-weight: 600;
3991
+ }
3992
+
3993
+ .iquji-floating-positioner:has(.iquji-multi-select__popup) {
3994
+ box-sizing: border-box;
3995
+ min-width: var(--anchor-width);
3996
+ width: var(--anchor-width);
3997
+ }
3998
+
3999
+ .iquji-popover-popup:has(.iquji-multi-select__popup) {
4000
+ backdrop-filter: var(--iquji-blur-md);
4001
+ background: var(--iquji-color-glass-surface-raised);
4002
+ border: 1px solid var(--iquji-color-border-strong);
4003
+ border-radius: var(--iquji-radius-overlay);
4004
+ box-shadow: var(--iquji-shadow-overlay);
4005
+ box-sizing: border-box;
4006
+ color: var(--iquji-color-text);
4007
+ max-height: min(320px, var(--available-height, 320px));
4008
+ min-width: var(--anchor-width);
4009
+ outline: 0;
4010
+ overflow: auto;
4011
+ padding: var(--iquji-space-1);
4012
+ width: var(--anchor-width);
4013
+ max-width: none;
4014
+ }
4015
+
3823
4016
  .iquji-multi-select__popup {
3824
- display: grid;
3825
- gap: var(--iquji-space-2);
3826
- min-width: 280px;
3827
- max-width: min(360px, 90vw);
4017
+ box-shadow: none;
4018
+ box-sizing: border-box;
4019
+ display: flex;
4020
+ outline: 0;
4021
+ background: none;
4022
+ border: none;
4023
+ flex-direction: column;
4024
+ width: 100%;
4025
+ margin: 0;
4026
+ padding: 0;
4027
+ }
4028
+
4029
+ .iquji-multi-select__search {
4030
+ padding: var(--iquji-space-1);
3828
4031
  }
3829
4032
 
3830
4033
  .iquji-multi-select__options {
4034
+ box-sizing: border-box;
4035
+ display: flex;
4036
+ outline: 0;
4037
+ flex-direction: column;
4038
+ gap: 1px;
4039
+ width: 100%;
4040
+ }
4041
+
4042
+ .iquji-multi-select__item {
4043
+ border-radius: calc(var(--iquji-radius-control) - 2px);
4044
+ box-sizing: border-box;
4045
+ cursor: pointer;
3831
4046
  display: grid;
3832
- gap: var(--iquji-space-1);
3833
- overflow-y: auto;
3834
- max-height: 260px;
3835
- padding-block-start: 2px;
3836
- padding-block-end: 2px;
4047
+ font-size: var(--iquji-font-size-body-md);
4048
+ align-items: center;
4049
+ gap: var(--iquji-space-3);
4050
+ grid-template-columns: minmax(0, 1fr) 16px;
4051
+ line-height: var(--iquji-line-height-body-md);
4052
+ min-height: var(--iquji-control-height-compact);
4053
+ outline: 0;
4054
+ padding: 7px var(--iquji-space-2);
4055
+ transition: background var(--iquji-motion-fast) var(--iquji-ease-standard);
4056
+ user-select: none;
4057
+ width: 100%;
4058
+ }
4059
+
4060
+ .iquji-multi-select__item:hover:not(.iquji-multi-select__item--disabled) {
4061
+ background: var(--iquji-color-surface-hover);
4062
+ }
4063
+
4064
+ .iquji-multi-select__item--selected {
4065
+ color: var(--iquji-color-accent-strong);
4066
+ font-weight: 650;
4067
+ }
4068
+
4069
+ .iquji-multi-select__item--disabled, .iquji-multi-select__item[data-disabled] {
4070
+ color: var(--iquji-color-disabled-text);
4071
+ cursor: not-allowed;
4072
+ opacity: .5;
4073
+ pointer-events: none;
4074
+ }
4075
+
4076
+ .iquji-multi-select__item-content {
4077
+ display: flex;
4078
+ flex-direction: column;
4079
+ min-width: 0;
4080
+ }
4081
+
4082
+ .iquji-multi-select__item-text {
4083
+ overflow: hidden;
4084
+ text-overflow: ellipsis;
4085
+ white-space: nowrap;
4086
+ min-width: 0;
4087
+ }
4088
+
4089
+ .iquji-multi-select__item-desc {
4090
+ color: var(--iquji-color-muted);
4091
+ font-size: var(--iquji-font-size-caption);
4092
+ line-height: var(--iquji-line-height-caption);
4093
+ overflow: hidden;
4094
+ text-overflow: ellipsis;
4095
+ white-space: nowrap;
4096
+ }
4097
+
4098
+ .iquji-multi-select__item-indicator {
4099
+ color: var(--iquji-color-accent-strong);
4100
+ display: inline-flex;
4101
+ flex: 0 0 16px;
4102
+ justify-content: center;
4103
+ align-items: center;
4104
+ width: 16px;
4105
+ height: 16px;
4106
+ }
4107
+
4108
+ .iquji-multi-select__item:has(.iquji-multi-select__checkbox) {
4109
+ grid-template-columns: 16px minmax(0, 1fr);
4110
+ }
4111
+
4112
+ .iquji-multi-select__checkbox {
4113
+ background: var(--iquji-color-surface);
4114
+ border: 1.5px solid var(--iquji-color-control-border);
4115
+ box-sizing: border-box;
4116
+ display: inline-flex;
4117
+ transition: background var(--iquji-motion-fast) var(--iquji-ease-standard), border-color var(--iquji-motion-fast) var(--iquji-ease-standard);
4118
+ border-radius: 4px;
4119
+ flex: 0 0 16px;
4120
+ justify-content: center;
4121
+ align-items: center;
4122
+ width: 16px;
4123
+ height: 16px;
4124
+ }
4125
+
4126
+ .iquji-multi-select__checkbox--checked {
4127
+ background: var(--iquji-color-accent-strong);
4128
+ border-color: var(--iquji-color-accent-strong);
4129
+ color: #fff;
3837
4130
  }
3838
4131
 
3839
4132
  .iquji-multi-select__empty {
@@ -3847,7 +4140,9 @@
3847
4140
  .iquji-multi-select__actions {
3848
4141
  border-top: 1px solid var(--iquji-color-border);
3849
4142
  display: flex;
4143
+ align-items: center;
3850
4144
  gap: var(--iquji-space-1);
4145
+ margin-top: var(--iquji-space-1);
3851
4146
  padding-top: var(--iquji-space-1);
3852
4147
  justify-content: flex-end;
3853
4148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iquji-web/web-component",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -24,8 +24,8 @@
24
24
  "react": "19.2.4"
25
25
  },
26
26
  "dependencies": {
27
- "@iquji-web/web-icons": "0.1.0",
28
- "@iquji-web/web-theme": "0.1.0",
27
+ "@iquji-web/web-icons": "0.1.2",
28
+ "@iquji-web/web-theme": "0.1.2",
29
29
  "@tanstack/react-table": "8.21.3"
30
30
  },
31
31
  "description": "React 通用交互组件与布局。",