@lax-wp/design-system 0.3.95 → 0.3.96

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.
@@ -0,0 +1 @@
1
+ export declare const FloatingElementWrapper: ({ children, showAsModal, ...props }: any) => import("react/jsx-runtime").JSX.Element;
@@ -82,4 +82,4 @@ export type FileUploadDraggerProps = {
82
82
  /** Custom drag and drop text */
83
83
  dragAndDropText?: string;
84
84
  };
85
- export declare const FileUploadDragger: FC<FileUploadDraggerProps>;
85
+ export declare const FileUpload: FC<FileUploadDraggerProps>;
package/dist/index.d.ts CHANGED
@@ -56,6 +56,7 @@ export { Card } from "./components/data-display/card/Card";
56
56
  export type { CardProps } from "./components/data-display/card/Card";
57
57
  export { Modal } from "./components/data-display/modal/Modal";
58
58
  export type { ModalProps, } from "./components/data-display/modal/Modal";
59
+ export { FloatingElementWrapper } from "./components/data-display/floating-element-wrapper/floating-element-dragger";
59
60
  export { Tag } from "./components/data-display/tag/Tag";
60
61
  export type { TagProps, TagSize, TagColor, ThemeMode, UploadHandler, } from "./components/data-display/tag/Tag";
61
62
  export { LabelValue } from "./components/data-display/label-value/LabelValue";
@@ -183,8 +184,8 @@ export { NameInitialLogo } from "./components/user-avatar";
183
184
  export type { NameInitialLogoProps } from "./components/user-avatar";
184
185
  export { UserProfilePic } from "./components/user-avatar";
185
186
  export type { UserProfilePicProps } from "./components/user-avatar";
186
- export { FileUploadDragger } from "./components/forms/file-upload-dragger/FileUploadDragger";
187
- export type { FileUploadDraggerProps, } from "./components/forms/file-upload-dragger/FileUploadDragger";
187
+ export { FileUpload } from "./components/forms/file-upload-dragger/FileUpload";
188
+ export type { FileUploadDraggerProps, } from "./components/forms/file-upload-dragger/FileUpload";
188
189
  export { LottieAnimation } from "./components/data-display/lottie-animation/LottieAnimation";
189
190
  export type { LottieAnimationProps } from "./components/data-display/lottie-animation/LottieAnimation";
190
191
  export { DataTypeIcon } from "./components/data-display/datatype-icon/DataTypeIcon";
package/dist/index.es.js CHANGED
@@ -35298,7 +35298,86 @@ const Card = ({
35298
35298
  )
35299
35299
  ] });
35300
35300
  Card.displayName = "Card";
35301
- const formatBooleanValue = (e) => e === 1 || e === "1" || typeof e == "string" && e.toLowerCase() === "yes" || typeof e == "string" && e.toLowerCase() === "true" ? "Yes" : e === 0 || e === "0" || typeof e == "string" && e.toLowerCase() === "no" || typeof e == "string" && e.toLowerCase() === "false" ? "No" : e?.toString() || "-", formatCurrency = (e, t = "USD") => {
35301
+ const Drawer = ({
35302
+ id: e,
35303
+ children: t,
35304
+ onClose: n,
35305
+ open: a,
35306
+ title: s,
35307
+ parentContainer: o = "full-screen-container",
35308
+ resizable: V,
35309
+ width: W = 400,
35310
+ placement: G = "right",
35311
+ closable: U = !1,
35312
+ mask: J,
35313
+ classNames: K,
35314
+ styles: oe,
35315
+ getContainer: ce,
35316
+ zIndex: pe,
35317
+ footer: ue,
35318
+ ...xe
35319
+ }) => {
35320
+ const me = useRef(!1), [ve, ge] = useState(W);
35321
+ useEffect(() => {
35322
+ ge(W);
35323
+ }, [a, W]);
35324
+ const ye = useCallback(
35325
+ (Te) => {
35326
+ if (me.current)
35327
+ if (G === "right") {
35328
+ const ke = document.body.offsetWidth - (Te.clientX - document.body.offsetLeft);
35329
+ ke > 256 && ge(ke);
35330
+ } else
35331
+ Te.clientX > 256 && ge(Te.clientX);
35332
+ },
35333
+ [G, ge]
35334
+ ), _e = useCallback(() => {
35335
+ me.current && (me.current = !1);
35336
+ }, []);
35337
+ useEffect(() => (document.addEventListener("mousemove", ye), document.addEventListener("mouseup", _e), () => {
35338
+ document.removeEventListener("mousemove", ye), document.removeEventListener("mouseup", _e);
35339
+ }), [ye, _e]);
35340
+ const Re = typeof window < "u" ? document.getElementById(o) || document.body : null;
35341
+ return Re ? createPortal(
35342
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
35343
+ Drawer$1,
35344
+ {
35345
+ id: e || "",
35346
+ closable: U,
35347
+ title: s,
35348
+ onClose: n,
35349
+ open: a,
35350
+ width: ve,
35351
+ getContainer: ce !== void 0 ? ce : !1,
35352
+ placement: G,
35353
+ mask: J,
35354
+ classNames: K,
35355
+ styles: oe,
35356
+ zIndex: pe,
35357
+ footer: ue,
35358
+ ...xe,
35359
+ children: [
35360
+ V && /* @__PURE__ */ jsxRuntimeExports.jsx(
35361
+ "div",
35362
+ {
35363
+ className: "cursor-ew-resize w-1 pl-[2px] absolute top-0 bottom-0 z-[2100] bg-transparent dark:bg-black-600 hover:bg-neutral-200 dark:hover:bg-black-700",
35364
+ onMouseDown: () => {
35365
+ me.current = !0;
35366
+ },
35367
+ style: G === "right" ? { left: 0 } : {
35368
+ right: 0
35369
+ }
35370
+ }
35371
+ ),
35372
+ t
35373
+ ]
35374
+ }
35375
+ ),
35376
+ Re
35377
+ ) : null;
35378
+ };
35379
+ Drawer.displayName = "Drawer";
35380
+ const FloatingElementWrapper = ({ children: e, showAsModal: t, ...n }) => t ? /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { onCancel: n.onClose, ...n, children: e }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Drawer, { ...n, children: e }), formatBooleanValue = (e) => e === 1 || e === "1" || typeof e == "string" && e.toLowerCase() === "yes" || typeof e == "string" && e.toLowerCase() === "true" ? "Yes" : e === 0 || e === "0" || typeof e == "string" && e.toLowerCase() === "no" || typeof e == "string" && e.toLowerCase() === "false" ? "No" : e?.toString() || "-", formatCurrency = (e, t = "USD") => {
35302
35381
  try {
35303
35382
  if (e == null) return "";
35304
35383
  const n = Number(e);
@@ -50147,85 +50226,6 @@ const Stepper = ({
50147
50226
  ] });
50148
50227
  };
50149
50228
  Stepper.displayName = "Stepper";
50150
- const Drawer = ({
50151
- id: e,
50152
- children: t,
50153
- onClose: n,
50154
- open: a,
50155
- title: s,
50156
- parentContainer: o = "full-screen-container",
50157
- resizable: V,
50158
- width: W = 400,
50159
- placement: G = "right",
50160
- closable: U = !1,
50161
- mask: J,
50162
- classNames: K,
50163
- styles: oe,
50164
- getContainer: ce,
50165
- zIndex: pe,
50166
- footer: ue,
50167
- ...xe
50168
- }) => {
50169
- const me = useRef(!1), [ve, ge] = useState(W);
50170
- useEffect(() => {
50171
- ge(W);
50172
- }, [a, W]);
50173
- const ye = useCallback(
50174
- (Te) => {
50175
- if (me.current)
50176
- if (G === "right") {
50177
- const ke = document.body.offsetWidth - (Te.clientX - document.body.offsetLeft);
50178
- ke > 256 && ge(ke);
50179
- } else
50180
- Te.clientX > 256 && ge(Te.clientX);
50181
- },
50182
- [G, ge]
50183
- ), _e = useCallback(() => {
50184
- me.current && (me.current = !1);
50185
- }, []);
50186
- useEffect(() => (document.addEventListener("mousemove", ye), document.addEventListener("mouseup", _e), () => {
50187
- document.removeEventListener("mousemove", ye), document.removeEventListener("mouseup", _e);
50188
- }), [ye, _e]);
50189
- const Re = typeof window < "u" ? document.getElementById(o) || document.body : null;
50190
- return Re ? createPortal(
50191
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
50192
- Drawer$1,
50193
- {
50194
- id: e || "",
50195
- closable: U,
50196
- title: s,
50197
- onClose: n,
50198
- open: a,
50199
- width: ve,
50200
- getContainer: ce !== void 0 ? ce : !1,
50201
- placement: G,
50202
- mask: J,
50203
- classNames: K,
50204
- styles: oe,
50205
- zIndex: pe,
50206
- footer: ue,
50207
- ...xe,
50208
- children: [
50209
- V && /* @__PURE__ */ jsxRuntimeExports.jsx(
50210
- "div",
50211
- {
50212
- className: "cursor-ew-resize w-1 pl-[2px] absolute top-0 bottom-0 z-[2100] bg-transparent dark:bg-black-600 hover:bg-neutral-200 dark:hover:bg-black-700",
50213
- onMouseDown: () => {
50214
- me.current = !0;
50215
- },
50216
- style: G === "right" ? { left: 0 } : {
50217
- right: 0
50218
- }
50219
- }
50220
- ),
50221
- t
50222
- ]
50223
- }
50224
- ),
50225
- Re
50226
- ) : null;
50227
- };
50228
- Drawer.displayName = "Drawer";
50229
50229
  const ConfirmPopUp = ({
50230
50230
  children: e,
50231
50231
  onCancel: t,
@@ -53939,7 +53939,7 @@ const TrashOutlineIcon = ({ fill: e = "currentColor", size: t = 20, ...n }) => /
53939
53939
  }
53940
53940
  )
53941
53941
  }
53942
- ), { Dragger } = Upload, DEFAULT_MAX_SIZE = 200 * 1024 * 1024, FileUploadDragger = ({
53942
+ ), { Dragger } = Upload, DEFAULT_MAX_SIZE = 200 * 1024 * 1024, FileUpload = ({
53943
53943
  getFile: e,
53944
53944
  id: t,
53945
53945
  description: n,
@@ -63333,8 +63333,9 @@ export {
63333
63333
  DynamicItemsCell,
63334
63334
  EditIcon,
63335
63335
  ErrorModal,
63336
- FileUploadDragger,
63336
+ FileUpload,
63337
63337
  FloatingBar,
63338
+ FloatingElementWrapper,
63338
63339
  Helmet,
63339
63340
  HelmetTitle,
63340
63341
  IconButton,