diditui 1.1.2 → 1.1.4

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/diditui.d.ts CHANGED
@@ -1,12 +1,19 @@
1
+ import { Aria } from 'react-modal';
2
+ import { Classes } from 'react-modal';
1
3
  import { ClassProp } from 'class-variance-authority/types';
2
4
  import { ClassValue } from 'clsx';
3
5
  import { ComponentProps } from 'react';
6
+ import { ComponentPropsWithRef } from 'react';
4
7
  import { default as default_2 } from 'react';
5
8
  import { FC } from 'react';
6
9
  import { JSX } from 'react/jsx-runtime';
7
10
  import { JSX as JSX_2 } from 'react';
11
+ import { KeyboardEvent as KeyboardEvent_2 } from 'react';
12
+ import { MouseEvent as MouseEvent_2 } from 'react';
8
13
  import { MutableRefObject } from 'react';
9
- import { Props as Props_2 } from 'react-modal';
14
+ import { OnAfterOpenCallback } from 'react-modal';
15
+ import { ReactElement } from 'react';
16
+ import { ReactNode } from 'react';
10
17
  import { SVGProps } from 'react';
11
18
  import { VariantProps } from 'class-variance-authority';
12
19
 
@@ -164,7 +171,7 @@ export declare const MediaQuery: {
164
171
  XXL: number;
165
172
  };
166
173
 
167
- export declare function Modal({ children, contentLabel, className, overlayClassName, withBorder, appElementId, onRequestClose, ...props }: Props): JSX.Element;
174
+ export declare function Modal({ children, className, overlayClassName, withBorder, appElementId, onRequestClose, ...props }: Props): JSX.Element;
168
175
 
169
176
  /**
170
177
  * A more sophisticated version of `InheritableElementProps` where
@@ -178,14 +185,38 @@ declare type PolymorphicComponentPropsWithRef<C extends default_2.ElementType, P
178
185
 
179
186
  declare type PolymorphicRef<C extends default_2.ElementType> = default_2.ComponentPropsWithRef<C>['ref'];
180
187
 
181
- declare interface Props extends Props_2 {
188
+ declare interface Props {
182
189
  withBorder?: boolean;
183
190
  appElementId?: string;
184
- contentLabel?: Props_2['contentLabel'];
185
- className?: Props_2['className'];
186
- overlayClassName?: Props_2['overlayClassName'];
187
- children?: Props_2['children'];
188
- onRequestClose?: Props_2['onRequestClose'];
191
+ testId?: string | undefined;
192
+ id?: string | undefined;
193
+ children?: ReactNode;
194
+ isOpen: boolean;
195
+ portalClassName?: string | undefined;
196
+ bodyOpenClassName?: string | null | undefined;
197
+ htmlOpenClassName?: string | null | undefined;
198
+ className?: string | Classes | undefined;
199
+ overlayClassName?: string | Classes | undefined;
200
+ appElement?: HTMLElement | HTMLElement[] | HTMLCollection | NodeList | undefined;
201
+ onAfterOpen?: OnAfterOpenCallback | undefined;
202
+ onAfterClose?(): void;
203
+ onRequestClose?(event: MouseEvent_2 | KeyboardEvent_2): void;
204
+ closeTimeoutMS?: number | undefined;
205
+ ariaHideApp?: boolean | undefined;
206
+ shouldFocusAfterRender?: boolean | undefined;
207
+ shouldCloseOnOverlayClick?: boolean | undefined;
208
+ shouldCloseOnEsc?: boolean | undefined;
209
+ shouldReturnFocusAfterClose?: boolean | undefined;
210
+ preventScroll?: boolean | undefined;
211
+ parentSelector?(): HTMLElement;
212
+ aria?: Aria | undefined;
213
+ data?: unknown;
214
+ role?: string | null | undefined;
215
+ contentLabel?: string | undefined;
216
+ contentRef?: ((instance: HTMLDivElement) => void) | undefined;
217
+ overlayRef?: ((instance: HTMLDivElement) => void) | undefined;
218
+ overlayElement?: ((props: ComponentPropsWithRef<'div'>, contentEl: ReactElement) => ReactElement) | undefined;
219
+ contentElement?: ((props: ComponentPropsWithRef<'div'>, children: ReactNode) => ReactElement) | undefined;
189
220
  }
190
221
 
191
222
  declare type PropsOf<C extends keyof JSX_2.IntrinsicElements | default_2.JSXElementConstructor<unknown>> = JSX_2.LibraryManagedAttributes<C, default_2.ComponentPropsWithoutRef<C>>;
package/dist/diditui.js CHANGED
@@ -4038,7 +4038,7 @@ function Cs({
4038
4038
  ) })
4039
4039
  ] })
4040
4040
  ] }),
4041
- /* @__PURE__ */ L.jsx(fe, { variant: "P3", as: "span", className: "text-error mt-1 pl-1", children: s })
4041
+ s && /* @__PURE__ */ L.jsx(fe, { variant: "P3", as: "span", className: "text-error mt-1 pl-1", children: s })
4042
4042
  ] });
4043
4043
  }
4044
4044
  var ot = { exports: {} }, je = {}, at = { exports: {} }, it = { exports: {} }, ie = {};
@@ -5693,47 +5693,45 @@ var Ci = pi();
5693
5693
  const J1 = /* @__PURE__ */ e1(Ci);
5694
5694
  function ms({
5695
5695
  children: e,
5696
- contentLabel: t = "modal",
5697
- className: n,
5698
- overlayClassName: r,
5699
- withBorder: i = !1,
5700
- appElementId: s = "#__next",
5701
- onRequestClose: l,
5702
- ...a
5696
+ className: t,
5697
+ overlayClassName: n,
5698
+ withBorder: r = !1,
5699
+ appElementId: i = "#__next",
5700
+ onRequestClose: s,
5701
+ ...l
5703
5702
  }) {
5704
5703
  Se(() => {
5705
- typeof window < "u" && J1.setAppElement(s);
5706
- }, [s]);
5707
- const c = Y([
5704
+ typeof window < "u" && J1.setAppElement(i);
5705
+ }, [i]);
5706
+ const a = Y([
5708
5707
  "fixed right-0 left-0 bottom-0 z-[1000] h-screen overflow-y-auto",
5709
5708
  "overflow-x-hidden md:inset-0 md:h-full bg-foreground/5 backdrop-blur-md",
5710
- r
5711
- ]), f = Y([
5709
+ n
5710
+ ]), c = Y([
5712
5711
  "font-inter size-full flex items-end justify-center md:items-center overflow-visible"
5713
- ]), u = Y([
5712
+ ]), f = Y([
5714
5713
  "relative max-h-[90%] overflow-hidden rounded-t-[32px]",
5715
5714
  "bg-background animate-slide-in shadow-card opacity-0 pt-6",
5716
5715
  "md:rounded-[32px] md:max-w-[90%]",
5717
- { "border border-surface-lo": i },
5718
- n
5716
+ { "border border-surface-lo": r },
5717
+ t
5719
5718
  ]);
5720
5719
  return /* @__PURE__ */ L.jsx(
5721
5720
  J1,
5722
5721
  {
5723
5722
  closeTimeoutMS: 300,
5724
- className: f,
5725
- overlayClassName: c,
5726
- contentLabel: t,
5727
- onRequestClose: l,
5728
- ...a,
5729
- children: /* @__PURE__ */ L.jsxs("div", { className: u, children: [
5723
+ className: c,
5724
+ overlayClassName: a,
5725
+ onRequestClose: s,
5726
+ ...l,
5727
+ children: /* @__PURE__ */ L.jsxs("div", { className: f, children: [
5730
5728
  /* @__PURE__ */ L.jsx(
5731
5729
  Ka,
5732
5730
  {
5733
5731
  className: "absolute right-6 top-6",
5734
5732
  icon: "close",
5735
5733
  size: "xs",
5736
- onClick: l
5734
+ onClick: s
5737
5735
  }
5738
5736
  ),
5739
5737
  e
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diditui",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/**/*",