@fiscalisto/react 0.1.83 → 0.1.84

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.
Files changed (2) hide show
  1. package/dist/index.js +32 -19
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -128,6 +128,19 @@ export function FiscalistoDialog({ open, onClose, heading, title = "Facturación
128
128
  wide: embed.preview === false ? false : (content?.wide ?? true),
129
129
  heading: !!heading,
130
130
  });
131
+ const closeButton = (_jsx("button", { ref: close, type: "button", "aria-label": "Cerrar", onClick: onClose, style: {
132
+ ...(heading
133
+ ? { flex: "none" }
134
+ : { position: "absolute", top: 10, right: 10, zIndex: 1 }),
135
+ width: 32,
136
+ height: 32,
137
+ border: 0,
138
+ borderRadius: 999,
139
+ background: dark ? "rgba(255,255,255,.1)" : "rgba(0,0,0,.06)",
140
+ color: dark ? "#e6efee" : "#333",
141
+ font: "20px/32px system-ui, sans-serif",
142
+ cursor: "pointer",
143
+ }, children: "\u00D7" }));
131
144
  return (_jsx("div", { role: "dialog", "aria-modal": "true", "aria-label": title, onClick: (e) => {
132
145
  if (e.target === e.currentTarget)
133
146
  onClose();
@@ -149,28 +162,28 @@ export function FiscalistoDialog({ open, onClose, heading, title = "Facturación
149
162
  height: box.full ? "100dvh" : undefined,
150
163
  borderRadius: box.full ? 0 : 16,
151
164
  overflow: "hidden",
152
- background: dark ? "#071615" : "#fbfcfc",
165
+ // The portal page's own background, so a heading bar and the page read as one.
166
+ background: dark ? "#0d0d0f" : "#ffffff",
153
167
  boxShadow: box.full ? "none" : "0 24px 60px rgba(0,0,0,.25)",
154
168
  transition: "width .15s ease",
155
- }, children: [_jsx("button", { ref: close, type: "button", "aria-label": "Cerrar", onClick: onClose, style: {
156
- position: "absolute",
157
- top: 10,
158
- right: 10,
159
- zIndex: 1,
160
- width: 32,
161
- height: 32,
162
- border: 0,
163
- borderRadius: 999,
164
- background: dark ? "rgba(255,255,255,.1)" : "rgba(0,0,0,.06)",
165
- color: dark ? "#e6efee" : "#333",
166
- font: "20px/32px system-ui, sans-serif",
167
- cursor: "pointer",
168
- }, children: "\u00D7" }), heading && (_jsx("div", { style: {
169
+ }, children: [heading ? (_jsxs("div", { style: {
169
170
  flex: "none",
170
- padding: "16px 48px 0 20px",
171
- font: "600 16px system-ui, sans-serif",
171
+ display: "flex",
172
+ alignItems: "center",
173
+ gap: 12,
174
+ height: 56,
175
+ // The title lines up with the page's content: 16 px on a phone, 20 in a box.
176
+ padding: box.full ? "0 12px 0 16px" : "0 12px 0 20px",
177
+ borderBottom: `1px solid ${dark ? "rgba(255,255,255,.075)" : "rgba(13,43,41,.09)"}`,
178
+ font: "600 16px/1.3 system-ui, sans-serif",
172
179
  color: dark ? "#e6efee" : "#111",
173
- }, children: heading })), _jsx(Frame, { title: title, ...embed, style: box.full ? { flex: 1, minHeight: 0 } : undefined, sized: { height: box.full ? "auto" : box.height, onSize } })] }) }));
180
+ }, children: [_jsx("div", { style: {
181
+ flex: 1,
182
+ minWidth: 0,
183
+ overflow: "hidden",
184
+ textOverflow: "ellipsis",
185
+ whiteSpace: "nowrap",
186
+ }, children: heading }), closeButton] })) : (closeButton), _jsx(Frame, { title: title, ...embed, style: box.full ? { flex: 1, minHeight: 0 } : undefined, sized: { height: box.full ? "auto" : box.height, onSize } })] }) }));
174
187
  }
175
188
  /** The window's size while the dialog is open, kept current when it turns or resizes. */
176
189
  function useScreen(open) {
@@ -198,7 +211,7 @@ export function dialogBox(screen, content = {}) {
198
211
  if (screen.width < 640 || screen.height < 520)
199
212
  return { full: true };
200
213
  const side = content.wide !== false && screen.width >= 1024;
201
- const room = screen.height - 48 - (content.heading ? 40 : 0);
214
+ const room = screen.height - 48 - (content.heading ? 56 : 0);
202
215
  const height = Math.min(room, side ? 760 : 820, Math.max(360, content.height ?? 640));
203
216
  return { full: false, width: side ? Math.min(960, screen.width - 48) : 520, height };
204
217
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiscalisto/react",
3
- "version": "0.1.83",
3
+ "version": "0.1.84",
4
4
  "description": "Componentes de React para mostrar en su página la autofactura de Fiscalisto y la liga de datos fiscales de un cliente.",
5
5
  "keywords": [
6
6
  "cfdi",