@js-empire/emperor-ui 1.3.0 → 1.3.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/README.md CHANGED
@@ -61,6 +61,29 @@ Import the library’s global styles in your app root (e.g. `layout.tsx` or `_ap
61
61
  import "@js-empire/emperor-ui/globals.css";
62
62
  ```
63
63
 
64
+ ### Next.js — avoiding "document is not defined"
65
+
66
+ Emperor UI uses HeroUI, which accesses browser APIs during module load. In Next.js (App Router), this can cause `document is not defined` when components are imported in server-rendered contexts (e.g. error boundaries, layouts, or barrel exports that load on the server).
67
+
68
+ **Fix:** Use dynamic import with `ssr: false` for Emperor UI components in files that may run on the server:
69
+
70
+ ```tsx
71
+ "use client";
72
+
73
+ import dynamic from "next/dynamic";
74
+
75
+ const ColorPicker = dynamic(
76
+ () =>
77
+ import("@js-empire/emperor-ui").then((m) => ({ default: m.ColorPicker })),
78
+ { ssr: false },
79
+ );
80
+
81
+ export { ColorPicker };
82
+ export type { ColorPickerProps } from "@js-empire/emperor-ui";
83
+ ```
84
+
85
+ Apply this pattern to any Emperor UI component used in error boundaries or other server-rendered modules. Ensure `HeroUIProvider` wraps your app as per [HeroUI's Next.js setup](https://heroui.com/docs/frameworks/nextjs).
86
+
64
87
  ---
65
88
 
66
89
  ## Components
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { j as r, P as t, F as i } from "./index-N24la87s.js";
3
+ function s({ ...e }) {
4
+ return e?.inputType === "preset" ? /* @__PURE__ */ r.jsx(t, { ...e }) : /* @__PURE__ */ r.jsx(i, { ...e });
5
+ }
6
+ export {
7
+ s as ColorPicker
8
+ };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { dB as a, dC as i, dD as o, dE as t, dF as r, dG as l, dH as d, dI as C, dJ as f, dK as n, dL as E, dM as I, dN as m, dO as _, dP as S, dQ as p, dR as c, dS as M, dT as T, dU as F, dV as g, dW as A, dX as O, dY as L, dZ as u, d_ as B, d$ as P, e0 as D, e1 as R, e2 as K, e3 as N, e4 as U, e5 as x, e6 as y, e7 as h, e8 as k, e9 as v, ea as W, eb as H, ec as G, ed as w, ee as V, ef as b, eg as Y, eh as z, ei as Q, ej as q, ek as J, el as X, em as Z, en as $, eo as j, ep as ee, eq as se, er as ae, es as ie, et as oe, eu as te, ev as re, ew as le, ex as de, ey as Ce, ez as fe, eA as ne, eB as Ee, eC as Ie, eD as me, eE as _e, eF as Se, eG as pe, eH as ce, eI as Me, eJ as Te, eK as Fe, eL as ge, eM as Ae, eN as Oe, eO as Le, eP as ue, eQ as Be, eR as Pe, eS as De, eT as Re, eU as Ke, eV as Ne, eW as Ue, eX as xe, eY as ye, eZ as he, e_ as ke, e$ as ve, f0 as We, f1 as He, f2 as Ge, f3 as we, f4 as Ve, f5 as be, f6 as Ye, f7 as ze, f8 as Qe, f9 as qe, fa as Je, fb as Xe, fc as Ze, fd as $e, fe as je, ff as es, fg as ss, fh as as, fi as is, fj as os, fk as ts, fl as rs, fm as ls, fn as ds, fo as Cs, fp as fs, fq as ns, fr as Es, fs as Is, ft as ms, fu as _s, fv as Ss, fw as ps, fx as cs, fy as Ms, fz as Ts, fA as Fs, fB as gs, fC as As, fD as Os, fE as Ls, fF as us, fG as Bs, fH as Ps, fI as Ds, fJ as Rs, fK as Ks, fL as Ns, fM as Us, fN as xs, fO as ys, fP as hs, fQ as ks, fR as vs, fS as Ws, fT as Hs, fU as Gs, fV as ws, fW as Vs, fX as bs, fY as Ys, fZ as zs, f_ as Qs, f$ as qs, g0 as Js } from "./index-DoF4sONu.js";
2
+ import { dE as a, dF as i, dG as o, dH as t, dI as r, dJ as l, dK as d, dL as f, dM as C, dN as n, dO as E, dP as I, dQ as m, dR as _, dS as S, dT as p, dU as c, dV as M, dW as T, dX as F, dY as g, dZ as A, d_ as O, d$ as L, e0 as u, e1 as P, e2 as B, e3 as R, e4 as D, e5 as K, F as N, e6 as U, e7 as x, e8 as y, e9 as h, ea as k, eb as v, ec as W, ed as H, ee as G, ef as w, eg as V, eh as b, ei as Y, ej as z, ek as Q, el as q, em as J, en as X, eo as Z, ep as $, eq as j, er as ee, es as se, et as ae, eu as ie, ev as oe, ew as te, ex as re, ey as le, ez as de, eA as fe, eB as Ce, eC as ne, eD as Ee, eE as Ie, eF as me, eG as _e, eH as Se, eI as pe, eJ as ce, eK as Me, eL as Te, eM as Fe, eN as ge, P as Ae, eO as Oe, eP as Le, eQ as ue, eR as Pe, eS as Be, eT as Re, eU as De, eV as Ke, eW as Ne, eX as Ue, eY as xe, eZ as ye, e_ as he, e$ as ke, f0 as ve, f1 as We, f2 as He, f3 as Ge, f4 as we, f5 as Ve, f6 as be, f7 as Ye, f8 as ze, f9 as Qe, fa as qe, fb as Je, fc as Xe, fd as Ze, fe as $e, ff as je, fg as es, fh as ss, fi as as, fj as is, fk as os, fl as ts, fm as rs, fn as ls, fo as ds, fp as fs, fq as Cs, fr as ns, fs as Es, ft as Is, fu as ms, fv as _s, fw as Ss, fx as ps, fy as cs, fz as Ms, fA as Ts, fB as Fs, fC as gs, fD as As, fE as Os, fF as Ls, fG as us, fH as Ps, fI as Bs, fJ as Rs, fK as Ds, fL as Ks, fM as Ns, fN as Us, fO as xs, fP as ys, fQ as hs, fR as ks, fS as vs, fT as Ws, fU as Hs, fV as Gs, fW as ws, fX as Vs, fY as bs, fZ as Ys, f_ as zs, f$ as Qs, g0 as qs, g1 as Js } from "./index-N24la87s.js";
3
3
  export {
4
4
  a as ALLOWED_DOC_TYPES,
5
5
  i as ALLOWED_IMAGES_TYPES,
@@ -8,8 +8,8 @@ export {
8
8
  r as AutocompleteFilter,
9
9
  l as AvatarLabel,
10
10
  d as Brand,
11
- C as CheckboxField,
12
- f as CheckboxFilter,
11
+ f as CheckboxField,
12
+ C as CheckboxFilter,
13
13
  n as CheckboxGroupFilter,
14
14
  E as ColorPicker,
15
15
  I as Column,
@@ -26,10 +26,10 @@ export {
26
26
  O as FAKE_PARAGRAPH,
27
27
  L as FAKE_SENTENCE,
28
28
  u as Field,
29
- B as Filter,
30
- P as Footer,
31
- D as FormBuilder,
32
- R as FormBuilderContext,
29
+ P as Filter,
30
+ B as Footer,
31
+ R as FormBuilder,
32
+ D as FormBuilderContext,
33
33
  K as FormBuilderProvider,
34
34
  N as FreeColorPicker,
35
35
  U as Header,
@@ -62,8 +62,8 @@ export {
62
62
  re as MOCK_ITEM_REVIEWS_3,
63
63
  le as MOCK_LISTINGS,
64
64
  de as MOCK_LISTING_DESCRIPTIONS,
65
- Ce as MOCK_LISTING_IMAGES,
66
- fe as MOCK_LISTING_TITLES,
65
+ fe as MOCK_LISTING_IMAGES,
66
+ Ce as MOCK_LISTING_TITLES,
67
67
  ne as MOCK_REVIEW_AUTHORS,
68
68
  Ee as MOCK_REVIEW_COMMENTS,
69
69
  Ie as NavBar,
@@ -80,10 +80,10 @@ export {
80
80
  Oe as QuickLinksBox,
81
81
  Le as RadioField,
82
82
  ue as RangeFilter,
83
- Be as Row,
84
- Pe as Scaffold,
85
- De as SearchFilter,
86
- Re as SelectField,
83
+ Pe as Row,
84
+ Be as Scaffold,
85
+ Re as SearchFilter,
86
+ De as SelectField,
87
87
  Ke as SelectFilter,
88
88
  Ne as SideBar,
89
89
  Ue as SocialLinksBox,
@@ -116,8 +116,8 @@ export {
116
116
  rs as fieldClasses,
117
117
  ls as fileTypesMapping,
118
118
  ds as filterClasses,
119
- Cs as getAllowedTypes,
120
- fs as getCardMotion,
119
+ fs as getAllowedTypes,
120
+ Cs as getCardMotion,
121
121
  ns as getListing,
122
122
  Es as getListings,
123
123
  Is as getStorybookDecorators,
@@ -134,10 +134,10 @@ export {
134
134
  Os as itemMainWrapperClasses,
135
135
  Ls as itemPriceClasses,
136
136
  us as itemTitleClasses,
137
- Bs as listingsClasses,
138
- Ps as listingsItemClasses,
139
- Ds as listingsPaginationClasses,
140
- Rs as listingsStyles,
137
+ Ps as listingsClasses,
138
+ Bs as listingsItemClasses,
139
+ Rs as listingsPaginationClasses,
140
+ Ds as listingsStyles,
141
141
  Ks as mapFileType,
142
142
  Ns as mergeLocales,
143
143
  Us as mergeUploaderLocale,