@particle-academy/react-fancy 4.16.0 → 4.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +36 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +36 -23
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/dist/index.cjs
CHANGED
|
@@ -9351,6 +9351,7 @@ function BreadcrumbsItem({
|
|
|
9351
9351
|
children,
|
|
9352
9352
|
href,
|
|
9353
9353
|
active = false,
|
|
9354
|
+
onClick,
|
|
9354
9355
|
className
|
|
9355
9356
|
}) {
|
|
9356
9357
|
const baseClass = cn(
|
|
@@ -9361,6 +9362,18 @@ function BreadcrumbsItem({
|
|
|
9361
9362
|
if (href && !active) {
|
|
9362
9363
|
return /* @__PURE__ */ jsxRuntime.jsx("a", { "data-react-fancy-breadcrumbs-item": "", href, className: baseClass, children });
|
|
9363
9364
|
}
|
|
9365
|
+
if (onClick && !active) {
|
|
9366
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9367
|
+
"button",
|
|
9368
|
+
{
|
|
9369
|
+
type: "button",
|
|
9370
|
+
"data-react-fancy-breadcrumbs-item": "",
|
|
9371
|
+
onClick,
|
|
9372
|
+
className: cn(baseClass, "cursor-pointer border-0 bg-transparent p-0"),
|
|
9373
|
+
children
|
|
9374
|
+
}
|
|
9375
|
+
);
|
|
9376
|
+
}
|
|
9364
9377
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-react-fancy-breadcrumbs-item": "", className: baseClass, "aria-current": active ? "page" : void 0, children });
|
|
9365
9378
|
}
|
|
9366
9379
|
BreadcrumbsItem.displayName = "BreadcrumbsItem";
|
|
@@ -10240,6 +10253,29 @@ var TimePicker = react.forwardRef(
|
|
|
10240
10253
|
const { hours: h24, minutes } = parseTime(value);
|
|
10241
10254
|
const isPM = h24 >= 12;
|
|
10242
10255
|
const displayHour = format === "12h" ? h24 % 12 || 12 : h24;
|
|
10256
|
+
const updateTime = react.useCallback(
|
|
10257
|
+
(hours, mins) => {
|
|
10258
|
+
setValue(`${pad(hours)}:${pad(mins)}`);
|
|
10259
|
+
},
|
|
10260
|
+
[setValue]
|
|
10261
|
+
);
|
|
10262
|
+
const changeHour = react.useCallback(
|
|
10263
|
+
(delta) => {
|
|
10264
|
+
const newHour = (h24 + delta + 24) % 24;
|
|
10265
|
+
updateTime(newHour, minutes);
|
|
10266
|
+
},
|
|
10267
|
+
[h24, minutes, updateTime]
|
|
10268
|
+
);
|
|
10269
|
+
const changeMinute = react.useCallback(
|
|
10270
|
+
(delta) => {
|
|
10271
|
+
const newMin = (minutes + delta + 60) % 60;
|
|
10272
|
+
updateTime(h24, newMin);
|
|
10273
|
+
},
|
|
10274
|
+
[h24, minutes, updateTime]
|
|
10275
|
+
);
|
|
10276
|
+
const toggleAmPm = react.useCallback(() => {
|
|
10277
|
+
updateTime((h24 + 12) % 24, minutes);
|
|
10278
|
+
}, [h24, minutes, updateTime]);
|
|
10243
10279
|
if (!showControl) {
|
|
10244
10280
|
const formatted = format === "12h" ? `${pad(displayHour)}:${pad(minutes)} ${isPM ? "PM" : "AM"}` : `${pad(displayHour)}:${pad(minutes)}`;
|
|
10245
10281
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10267,29 +10303,6 @@ var TimePicker = react.forwardRef(
|
|
|
10267
10303
|
}
|
|
10268
10304
|
);
|
|
10269
10305
|
}
|
|
10270
|
-
const updateTime = react.useCallback(
|
|
10271
|
-
(hours, mins) => {
|
|
10272
|
-
setValue(`${pad(hours)}:${pad(mins)}`);
|
|
10273
|
-
},
|
|
10274
|
-
[setValue]
|
|
10275
|
-
);
|
|
10276
|
-
const changeHour = react.useCallback(
|
|
10277
|
-
(delta) => {
|
|
10278
|
-
const newHour = (h24 + delta + 24) % 24;
|
|
10279
|
-
updateTime(newHour, minutes);
|
|
10280
|
-
},
|
|
10281
|
-
[h24, minutes, updateTime]
|
|
10282
|
-
);
|
|
10283
|
-
const changeMinute = react.useCallback(
|
|
10284
|
-
(delta) => {
|
|
10285
|
-
const newMin = (minutes + delta + 60) % 60;
|
|
10286
|
-
updateTime(h24, newMin);
|
|
10287
|
-
},
|
|
10288
|
-
[h24, minutes, updateTime]
|
|
10289
|
-
);
|
|
10290
|
-
const toggleAmPm = react.useCallback(() => {
|
|
10291
|
-
updateTime((h24 + 12) % 24, minutes);
|
|
10292
|
-
}, [h24, minutes, updateTime]);
|
|
10293
10306
|
const spinBtnClass = "flex h-7 w-full items-center justify-center rounded text-zinc-400 transition-colors hover:bg-zinc-100 hover:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300 disabled:opacity-50";
|
|
10294
10307
|
const displayClass = "flex h-10 w-12 items-center justify-center text-lg font-medium tabular-nums";
|
|
10295
10308
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|