design-zystem 1.0.472 → 1.0.474

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.
@@ -608,6 +608,9 @@ interface SelectSharedProps {
608
608
  disabled?: boolean;
609
609
  /** Masque la barre de recherche — affichée par défaut. */
610
610
  hideSearchBar?: boolean;
611
+ searchPlaceholder?: string;
612
+ /** Appelé à chaque frappe dans la recherche, et avec '' à la fermeture. */
613
+ onSearchChange?: (term: string) => void;
611
614
  size?: 'm' | 's';
612
615
  className?: string;
613
616
  }
@@ -608,6 +608,9 @@ interface SelectSharedProps {
608
608
  disabled?: boolean;
609
609
  /** Masque la barre de recherche — affichée par défaut. */
610
610
  hideSearchBar?: boolean;
611
+ searchPlaceholder?: string;
612
+ /** Appelé à chaque frappe dans la recherche, et avec '' à la fermeture. */
613
+ onSearchChange?: (term: string) => void;
611
614
  size?: 'm' | 's';
612
615
  className?: string;
613
616
  }
package/dist/ui/index.js CHANGED
@@ -1383,6 +1383,9 @@ Image2.displayName = "Image";
1383
1383
  var import_react10 = require("react");
1384
1384
  var RadixTooltip = __toESM(require("@radix-ui/react-tooltip"));
1385
1385
 
1386
+ // src/ui/lib/hasContent.ts
1387
+ var hasContent = (content) => content !== void 0 && content !== null && content !== "";
1388
+
1386
1389
  // src/ui/components/ui/SamuCar.tsx
1387
1390
  var import_jsx_runtime14 = require("react/jsx-runtime");
1388
1391
  var wheelClassName = "[transform-box:fill-box] origin-center animate-[tooltip-wheel-spin_150ms_linear_2] motion-reduce:animate-none";
@@ -1472,7 +1475,7 @@ var import_jsx_runtime15 = require("react/jsx-runtime");
1472
1475
  var Tooltip = (0, import_react10.forwardRef)(
1473
1476
  (_a, ref) => {
1474
1477
  var _b = _a, { children, content, side = "top", align = "center", className } = _b, props = __objRest(_b, ["children", "content", "side", "align", "className"]);
1475
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RadixTooltip.Provider, { delayDuration: 200, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(RadixTooltip.Root, { children: [
1478
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RadixTooltip.Provider, { delayDuration: 200, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(RadixTooltip.Root, { open: hasContent(content) ? void 0 : false, children: [
1476
1479
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RadixTooltip.Trigger, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children })),
1477
1480
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RadixTooltip.Portal, { children: IS_EASTER_EGG_ENABLED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1478
1481
  RadixTooltip.Content,
@@ -3153,13 +3156,14 @@ var OptionHint = ({ hint }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("sp
3153
3156
  var SearchField = ({
3154
3157
  searchInputRef,
3155
3158
  searchTerm,
3156
- setSearchTerm
3159
+ setSearchTerm,
3160
+ placeholder = "Rechercher..."
3157
3161
  }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3158
3162
  "input",
3159
3163
  __spreadProps(__spreadValues({
3160
3164
  ref: searchInputRef,
3161
3165
  type: "text",
3162
- placeholder: "Rechercher..."
3166
+ placeholder
3163
3167
  }, noAutofillProps), {
3164
3168
  value: searchTerm,
3165
3169
  onChange: (e) => setSearchTerm(e.target.value),
@@ -3178,12 +3182,18 @@ var SelectField = (props) => {
3178
3182
  required,
3179
3183
  disabled,
3180
3184
  hideSearchBar = false,
3185
+ searchPlaceholder,
3186
+ onSearchChange,
3181
3187
  size = "m",
3182
3188
  className
3183
3189
  } = props;
3184
3190
  const triggerClass = cn(TRIGGER_CLASS, TRIGGER_SIZE_CLASS[size], className);
3185
3191
  const [open, setOpen] = (0, import_react26.useState)(false);
3186
- const [searchTerm, setSearchTerm] = (0, import_react26.useState)("");
3192
+ const [searchTerm, setSearchTermState] = (0, import_react26.useState)("");
3193
+ const setSearchTerm = (term) => {
3194
+ setSearchTermState(term);
3195
+ onSearchChange == null ? void 0 : onSearchChange(term);
3196
+ };
3187
3197
  const searchInputRef = (0, import_react26.useRef)(null);
3188
3198
  const sections = filterSelectItems(options, searchTerm);
3189
3199
  const isEmpty = sections.length === 0;
@@ -3254,7 +3264,8 @@ var SelectField = (props) => {
3254
3264
  {
3255
3265
  searchInputRef,
3256
3266
  searchTerm,
3257
- setSearchTerm
3267
+ setSearchTerm,
3268
+ placeholder: searchPlaceholder
3258
3269
  }
3259
3270
  ),
3260
3271
  /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "overflow-y-auto", children: [
@@ -3367,7 +3378,8 @@ var SelectField = (props) => {
3367
3378
  {
3368
3379
  searchInputRef,
3369
3380
  searchTerm,
3370
- setSearchTerm
3381
+ setSearchTerm,
3382
+ placeholder: searchPlaceholder
3371
3383
  }
3372
3384
  ),
3373
3385
  /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(RadixSelect2.Viewport, { children: [
package/dist/ui/index.mjs CHANGED
@@ -1151,6 +1151,9 @@ import {
1151
1151
  } from "react";
1152
1152
  import * as RadixTooltip from "@radix-ui/react-tooltip";
1153
1153
 
1154
+ // src/ui/lib/hasContent.ts
1155
+ var hasContent = (content) => content !== void 0 && content !== null && content !== "";
1156
+
1154
1157
  // src/ui/components/ui/SamuCar.tsx
1155
1158
  import { jsx as jsx14, jsxs as jsxs3 } from "react/jsx-runtime";
1156
1159
  var wheelClassName = "[transform-box:fill-box] origin-center animate-[tooltip-wheel-spin_150ms_linear_2] motion-reduce:animate-none";
@@ -1240,7 +1243,7 @@ import { jsx as jsx15, jsxs as jsxs4 } from "react/jsx-runtime";
1240
1243
  var Tooltip = forwardRef9(
1241
1244
  (_a, ref) => {
1242
1245
  var _b = _a, { children, content, side = "top", align = "center", className } = _b, props = __objRest(_b, ["children", "content", "side", "align", "className"]);
1243
- return /* @__PURE__ */ jsx15(RadixTooltip.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxs4(RadixTooltip.Root, { children: [
1246
+ return /* @__PURE__ */ jsx15(RadixTooltip.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxs4(RadixTooltip.Root, { open: hasContent(content) ? void 0 : false, children: [
1244
1247
  /* @__PURE__ */ jsx15(RadixTooltip.Trigger, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children })),
1245
1248
  /* @__PURE__ */ jsx15(RadixTooltip.Portal, { children: IS_EASTER_EGG_ENABLED ? /* @__PURE__ */ jsxs4(
1246
1249
  RadixTooltip.Content,
@@ -2931,13 +2934,14 @@ var OptionHint = ({ hint }) => /* @__PURE__ */ jsx35("span", { className: "ml-au
2931
2934
  var SearchField = ({
2932
2935
  searchInputRef,
2933
2936
  searchTerm,
2934
- setSearchTerm
2937
+ setSearchTerm,
2938
+ placeholder = "Rechercher..."
2935
2939
  }) => /* @__PURE__ */ jsx35(
2936
2940
  "input",
2937
2941
  __spreadProps(__spreadValues({
2938
2942
  ref: searchInputRef,
2939
2943
  type: "text",
2940
- placeholder: "Rechercher..."
2944
+ placeholder
2941
2945
  }, noAutofillProps), {
2942
2946
  value: searchTerm,
2943
2947
  onChange: (e) => setSearchTerm(e.target.value),
@@ -2956,12 +2960,18 @@ var SelectField = (props) => {
2956
2960
  required,
2957
2961
  disabled,
2958
2962
  hideSearchBar = false,
2963
+ searchPlaceholder,
2964
+ onSearchChange,
2959
2965
  size = "m",
2960
2966
  className
2961
2967
  } = props;
2962
2968
  const triggerClass = cn(TRIGGER_CLASS, TRIGGER_SIZE_CLASS[size], className);
2963
2969
  const [open, setOpen] = useState5(false);
2964
- const [searchTerm, setSearchTerm] = useState5("");
2970
+ const [searchTerm, setSearchTermState] = useState5("");
2971
+ const setSearchTerm = (term) => {
2972
+ setSearchTermState(term);
2973
+ onSearchChange == null ? void 0 : onSearchChange(term);
2974
+ };
2965
2975
  const searchInputRef = useRef5(null);
2966
2976
  const sections = filterSelectItems(options, searchTerm);
2967
2977
  const isEmpty = sections.length === 0;
@@ -3032,7 +3042,8 @@ var SelectField = (props) => {
3032
3042
  {
3033
3043
  searchInputRef,
3034
3044
  searchTerm,
3035
- setSearchTerm
3045
+ setSearchTerm,
3046
+ placeholder: searchPlaceholder
3036
3047
  }
3037
3048
  ),
3038
3049
  /* @__PURE__ */ jsxs17("div", { className: "overflow-y-auto", children: [
@@ -3145,7 +3156,8 @@ var SelectField = (props) => {
3145
3156
  {
3146
3157
  searchInputRef,
3147
3158
  searchTerm,
3148
- setSearchTerm
3159
+ setSearchTerm,
3160
+ placeholder: searchPlaceholder
3149
3161
  }
3150
3162
  ),
3151
3163
  /* @__PURE__ */ jsxs17(RadixSelect2.Viewport, { children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.472",
3
+ "version": "1.0.474",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",