@axzydev/axzy_ui_system 1.3.6 → 1.4.0

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.js CHANGED
@@ -7,6 +7,8 @@ var useClickOutside = (ref, callback) => {
7
7
  const clickedDialog = target?.closest("[data-it-dialog]");
8
8
  const currentDialog = ref.current?.closest("[data-it-dialog]");
9
9
  if (clickedDialog && clickedDialog !== currentDialog) return;
10
+ const clickedFloating = target?.closest("[data-it-floating]");
11
+ if (clickedFloating && !ref.current?.contains(clickedFloating)) return;
10
12
  if (ref.current && !ref.current.contains(event.target)) {
11
13
  callback();
12
14
  }
@@ -202,7 +204,7 @@ function useFloatingPanel(anchorRef, isOpen, {
202
204
  const spaceAbove = rect.top;
203
205
  const flipAbove = spaceBelow < panelHeight + offset && spaceAbove > spaceBelow;
204
206
  const width = matchWidth ? rect.width : void 0;
205
- const panelWidth = panelRef.current?.offsetWidth ?? width ?? 0;
207
+ const panelWidth = width ?? panelRef.current?.offsetWidth ?? 0;
206
208
  let left = align === "end" && panelWidth ? rect.right - panelWidth : rect.left;
207
209
  if (panelWidth) {
208
210
  left = Math.max(8, Math.min(left, viewportWidth - panelWidth - 8));
@@ -2449,6 +2451,7 @@ function ITDropdownMenu({
2449
2451
  "div",
2450
2452
  {
2451
2453
  ref: panelRef,
2454
+ "data-it-floating": "true",
2452
2455
  role: "menu",
2453
2456
  "aria-label": triggerLabel,
2454
2457
  style: panelStyle,
@@ -3434,6 +3437,7 @@ function ITMultiSelect({
3434
3437
  "div",
3435
3438
  {
3436
3439
  ref: panelRef,
3440
+ "data-it-floating": "true",
3437
3441
  role: "listbox",
3438
3442
  "aria-multiselectable": "true",
3439
3443
  style: panelStyle,
@@ -4103,6 +4107,7 @@ function ITSearchSelect({
4103
4107
  "div",
4104
4108
  {
4105
4109
  ref: panelRef,
4110
+ "data-it-floating": "true",
4106
4111
  style: panelStyle,
4107
4112
  className: "bg-white dark:bg-slate-900 border border-secondary-200 dark:border-slate-800 rounded-lg shadow-xl overflow-hidden animate-in fade-in zoom-in duration-200 origin-top",
4108
4113
  children: /* @__PURE__ */ jsx21("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => {
@@ -4348,6 +4353,7 @@ function ITDatePicker({
4348
4353
  "div",
4349
4354
  {
4350
4355
  ref: panelRef,
4356
+ "data-it-floating": "true",
4351
4357
  className: clsx22(
4352
4358
  calendarClassName,
4353
4359
  range ? "w-[320px]" : "w-[280px]"
@@ -5495,6 +5501,7 @@ function ITTimePicker({
5495
5501
  "div",
5496
5502
  {
5497
5503
  ref: dropdownRef,
5504
+ "data-it-floating": "true",
5498
5505
  className: "bg-white border border-secondary-100 shadow-xl rounded-xl w-64 overflow-hidden flex flex-col animate-in fade-in zoom-in-95 duration-200 origin-top it-timepicker-dropdown",
5499
5506
  style: panelStyle,
5500
5507
  children: [