@studiolxd/brand 39.0.0 → 40.1.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/CHANGELOG.md +107 -0
- package/dist/_shared/brandmessagescontext.js +15 -0
- package/dist/_shared/calendargrid.js +42 -42
- package/dist/_shared/datepicker.js +41 -41
- package/dist/_shared/imagecropdialog.js +54 -54
- package/dist/_shared/tokens.js +1 -0
- package/dist/_types/messages/BrandMessages.d.ts +26 -0
- package/dist/_types/messages/BrandMessagesContext.d.ts +21 -0
- package/dist/_types/messages/BrandMessagesProvider.d.ts +46 -0
- package/dist/_types/messages/index.d.ts +5 -0
- package/dist/_types/molecules/Pagination/Pagination.d.ts +40 -23
- package/dist/_types/organisms/AnnotationThread/AnnotationThread.d.ts +27 -5
- package/dist/_types/organisms/DataTable/DataTable.d.ts +3 -2
- package/dist/accordion.js +26 -26
- package/dist/alert.js +26 -26
- package/dist/annotation-thread.css +1 -1
- package/dist/annotation-thread.js +37 -26
- package/dist/app-header.js +8 -8
- package/dist/app-launcher.js +34 -34
- package/dist/app-shell.js +14 -14
- package/dist/assistant-message.js +8 -8
- package/dist/async-multi-select-field.js +9 -9
- package/dist/async-multi-select.js +40 -40
- package/dist/async-select-field.js +9 -9
- package/dist/async-select.js +64 -64
- package/dist/avatar-upload.js +40 -40
- package/dist/avatar.js +5 -5
- package/dist/banner.js +9 -9
- package/dist/brand.css +2 -1
- package/dist/button.js +7 -7
- package/dist/calendar-planner.js +16 -16
- package/dist/calendar.js +38 -38
- package/dist/card.js +28 -28
- package/dist/carousel.js +19 -19
- package/dist/chart.js +137 -137
- package/dist/chat-shell.js +23 -23
- package/dist/checkbox-field.js +11 -11
- package/dist/checkbox.js +7 -7
- package/dist/close-button.js +6 -6
- package/dist/code-block.js +15 -15
- package/dist/code.js +5 -5
- package/dist/collapsible.js +1 -1
- package/dist/columns.js +7 -7
- package/dist/command-palette.js +14 -14
- package/dist/confirm-dialog.js +10 -10
- package/dist/connector-auth-shell.js +9 -9
- package/dist/consent.js +23 -23
- package/dist/container.js +6 -6
- package/dist/conversation-list.js +19 -19
- package/dist/conversation-thread.js +15 -15
- package/dist/copy-button.js +9 -9
- package/dist/copyable-value.js +17 -17
- package/dist/data-table.js +29 -29
- package/dist/date-picker-field.js +9 -9
- package/dist/date-time-field.js +12 -12
- package/dist/description-list.js +12 -12
- package/dist/docs-search.js +1 -1
- package/dist/dots-button.js +7 -7
- package/dist/dropdown-field.js +13 -13
- package/dist/email.js +44 -44
- package/dist/error-text.js +4 -4
- package/dist/field-row.js +20 -20
- package/dist/figure.js +8 -8
- package/dist/file-upload-field.js +9 -9
- package/dist/file-upload.js +29 -29
- package/dist/filter-bar.js +10 -10
- package/dist/floating-dock.js +17 -17
- package/dist/form-field.js +43 -43
- package/dist/form.js +14 -14
- package/dist/heading.js +5 -5
- package/dist/input-field.js +20 -20
- package/dist/input-phone-field.js +9 -9
- package/dist/input-phone.js +19 -19
- package/dist/input.js +5 -5
- package/dist/kbd.js +5 -5
- package/dist/label.js +5 -5
- package/dist/link.js +7 -7
- package/dist/list.js +7 -7
- package/dist/menu-button.js +7 -7
- package/dist/message-bubble.js +5 -5
- package/dist/message-composer.js +13 -13
- package/dist/messages.js +12 -0
- package/dist/multi-select-field.js +9 -9
- package/dist/multi-select.js +52 -52
- package/dist/notification-button.js +8 -8
- package/dist/notification-panel.js +25 -25
- package/dist/number-input-field.js +9 -9
- package/dist/number-input.js +11 -11
- package/dist/otp-field.js +9 -9
- package/dist/otp-input.js +48 -48
- package/dist/pagination.js +92 -89
- package/dist/paragraph.js +5 -5
- package/dist/password-field.js +15 -15
- package/dist/prose.js +4 -4
- package/dist/public-page-shell.js +11 -11
- package/dist/radio-field.js +11 -11
- package/dist/radio-group.js +5 -5
- package/dist/radio.js +5 -5
- package/dist/scroll-area.js +11 -11
- package/dist/search-form.js +8 -8
- package/dist/select-field.js +9 -9
- package/dist/select.js +85 -85
- package/dist/separator.js +6 -6
- package/dist/sidebar.js +16 -16
- package/dist/site-header.js +14 -14
- package/dist/site-shell.js +6 -6
- package/dist/sparkline.js +9 -9
- package/dist/star-rating.js +24 -24
- package/dist/stat-tile.js +12 -12
- package/dist/steps.js +32 -32
- package/dist/switcher-field.js +13 -13
- package/dist/switcher.js +8 -8
- package/dist/table-of-contents.js +14 -14
- package/dist/tag.js +5 -5
- package/dist/text.js +7 -7
- package/dist/textarea-field.js +11 -11
- package/dist/textarea.js +5 -5
- package/dist/time-field.js +9 -9
- package/dist/time-select.js +17 -17
- package/dist/toaster.js +16 -16
- package/dist/toggle-group.js +7 -7
- package/dist/toggle.js +5 -5
- package/dist/tokens.css +2 -1
- package/dist/tooltip.js +16 -16
- package/dist/tree-view.js +41 -41
- package/dist/uptime-bars.js +34 -34
- package/dist/user-message.js +8 -8
- package/dist/visually-hidden.js +5 -5
- package/package.json +5 -1
- package/src/tokens/molecules/annotation-thread.css +1 -0
- package/src/tokens/scss/molecules/_annotation-thread.scss +1 -0
- package/src/tokens/tokens.json +1 -0
|
@@ -3,8 +3,8 @@ import { Spinner as e } from "../spinner.js";
|
|
|
3
3
|
import { Button as t } from "../button.js";
|
|
4
4
|
import { Alert as n } from "../alert.js";
|
|
5
5
|
import { Modal as r } from "../modal.js";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import i, { PureComponent as a, createRef as o, useRef as s, useState as c } from "react";
|
|
7
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
8
|
//#region node_modules/.pnpm/react-image-crop@11.1.2_react@19.2.4/node_modules/react-image-crop/dist/index.js
|
|
9
9
|
var f = {
|
|
10
10
|
x: 0,
|
|
@@ -72,7 +72,7 @@ function x(e, t, n, r) {
|
|
|
72
72
|
var S = {
|
|
73
73
|
capture: !0,
|
|
74
74
|
passive: !1
|
|
75
|
-
}, C = 0, w = class e extends
|
|
75
|
+
}, C = 0, w = class e extends a {
|
|
76
76
|
static xOrds = ["e", "w"];
|
|
77
77
|
static yOrds = ["n", "s"];
|
|
78
78
|
static xyOrds = [
|
|
@@ -110,8 +110,8 @@ var S = {
|
|
|
110
110
|
clientY: 0,
|
|
111
111
|
isResize: !0
|
|
112
112
|
};
|
|
113
|
-
componentRef =
|
|
114
|
-
mediaRef =
|
|
113
|
+
componentRef = o();
|
|
114
|
+
mediaRef = o();
|
|
115
115
|
resizeObserver;
|
|
116
116
|
initChangeCalled = !1;
|
|
117
117
|
instanceId = `rc-${C++}`;
|
|
@@ -277,8 +277,8 @@ var S = {
|
|
|
277
277
|
return n || e.xyOrds.indexOf(u) > -1 ? c = h : e.xOrds.indexOf(u) > -1 ? (c.x = h.x, c.width = h.width) : e.yOrds.indexOf(u) > -1 && (c.y = h.y, c.height = h.height), c.x = p(c.x, 0, a.width - c.width), c.y = p(c.y, 0, a.height - c.height), c;
|
|
278
278
|
}
|
|
279
279
|
renderCropSelection() {
|
|
280
|
-
let { ariaLabels: t = e.defaultProps.ariaLabels, disabled: n, locked: r, renderSelectionAddon:
|
|
281
|
-
if (
|
|
280
|
+
let { ariaLabels: t = e.defaultProps.ariaLabels, disabled: n, locked: r, renderSelectionAddon: a, ruleOfThirds: o, crop: s } = this.props, c = this.getCropStyle();
|
|
281
|
+
if (s) return /* @__PURE__ */ i.createElement("div", {
|
|
282
282
|
style: c,
|
|
283
283
|
className: "ReactCrop__crop-selection",
|
|
284
284
|
onPointerDown: this.onCropPointerDown,
|
|
@@ -286,81 +286,81 @@ var S = {
|
|
|
286
286
|
tabIndex: 0,
|
|
287
287
|
onKeyDown: this.onComponentKeyDown,
|
|
288
288
|
role: "group"
|
|
289
|
-
}, !n && !r && /* @__PURE__ */
|
|
289
|
+
}, !n && !r && /* @__PURE__ */ i.createElement("div", {
|
|
290
290
|
className: "ReactCrop__drag-elements",
|
|
291
291
|
onFocus: this.onDragFocus
|
|
292
|
-
}, /* @__PURE__ */
|
|
292
|
+
}, /* @__PURE__ */ i.createElement("div", {
|
|
293
293
|
className: "ReactCrop__drag-bar ord-n",
|
|
294
294
|
"data-ord": "n"
|
|
295
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
296
296
|
className: "ReactCrop__drag-bar ord-e",
|
|
297
297
|
"data-ord": "e"
|
|
298
|
-
}), /* @__PURE__ */
|
|
298
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
299
299
|
className: "ReactCrop__drag-bar ord-s",
|
|
300
300
|
"data-ord": "s"
|
|
301
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
302
302
|
className: "ReactCrop__drag-bar ord-w",
|
|
303
303
|
"data-ord": "w"
|
|
304
|
-
}), /* @__PURE__ */
|
|
304
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
305
305
|
className: "ReactCrop__drag-handle ord-nw",
|
|
306
306
|
"data-ord": "nw",
|
|
307
307
|
tabIndex: 0,
|
|
308
308
|
"aria-label": t.nwDragHandle,
|
|
309
309
|
onKeyDown: (e) => this.onHandlerKeyDown(e, "nw"),
|
|
310
310
|
role: "button"
|
|
311
|
-
}), /* @__PURE__ */
|
|
311
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
312
312
|
className: "ReactCrop__drag-handle ord-n",
|
|
313
313
|
"data-ord": "n",
|
|
314
314
|
tabIndex: 0,
|
|
315
315
|
"aria-label": t.nDragHandle,
|
|
316
316
|
onKeyDown: (e) => this.onHandlerKeyDown(e, "n"),
|
|
317
317
|
role: "button"
|
|
318
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
319
319
|
className: "ReactCrop__drag-handle ord-ne",
|
|
320
320
|
"data-ord": "ne",
|
|
321
321
|
tabIndex: 0,
|
|
322
322
|
"aria-label": t.neDragHandle,
|
|
323
323
|
onKeyDown: (e) => this.onHandlerKeyDown(e, "ne"),
|
|
324
324
|
role: "button"
|
|
325
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
326
326
|
className: "ReactCrop__drag-handle ord-e",
|
|
327
327
|
"data-ord": "e",
|
|
328
328
|
tabIndex: 0,
|
|
329
329
|
"aria-label": t.eDragHandle,
|
|
330
330
|
onKeyDown: (e) => this.onHandlerKeyDown(e, "e"),
|
|
331
331
|
role: "button"
|
|
332
|
-
}), /* @__PURE__ */
|
|
332
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
333
333
|
className: "ReactCrop__drag-handle ord-se",
|
|
334
334
|
"data-ord": "se",
|
|
335
335
|
tabIndex: 0,
|
|
336
336
|
"aria-label": t.seDragHandle,
|
|
337
337
|
onKeyDown: (e) => this.onHandlerKeyDown(e, "se"),
|
|
338
338
|
role: "button"
|
|
339
|
-
}), /* @__PURE__ */
|
|
339
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
340
340
|
className: "ReactCrop__drag-handle ord-s",
|
|
341
341
|
"data-ord": "s",
|
|
342
342
|
tabIndex: 0,
|
|
343
343
|
"aria-label": t.sDragHandle,
|
|
344
344
|
onKeyDown: (e) => this.onHandlerKeyDown(e, "s"),
|
|
345
345
|
role: "button"
|
|
346
|
-
}), /* @__PURE__ */
|
|
346
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
347
347
|
className: "ReactCrop__drag-handle ord-sw",
|
|
348
348
|
"data-ord": "sw",
|
|
349
349
|
tabIndex: 0,
|
|
350
350
|
"aria-label": t.swDragHandle,
|
|
351
351
|
onKeyDown: (e) => this.onHandlerKeyDown(e, "sw"),
|
|
352
352
|
role: "button"
|
|
353
|
-
}), /* @__PURE__ */
|
|
353
|
+
}), /* @__PURE__ */ i.createElement("div", {
|
|
354
354
|
className: "ReactCrop__drag-handle ord-w",
|
|
355
355
|
"data-ord": "w",
|
|
356
356
|
tabIndex: 0,
|
|
357
357
|
"aria-label": t.wDragHandle,
|
|
358
358
|
onKeyDown: (e) => this.onHandlerKeyDown(e, "w"),
|
|
359
359
|
role: "button"
|
|
360
|
-
})),
|
|
360
|
+
})), a && /* @__PURE__ */ i.createElement("div", {
|
|
361
361
|
className: "ReactCrop__selection-addon",
|
|
362
362
|
onPointerDown: (e) => e.stopPropagation()
|
|
363
|
-
},
|
|
363
|
+
}, a(this.state)), o && /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("div", { className: "ReactCrop__rule-of-thirds-hz" }), /* @__PURE__ */ i.createElement("div", { className: "ReactCrop__rule-of-thirds-vt" })));
|
|
364
364
|
}
|
|
365
365
|
makePixelCrop(e) {
|
|
366
366
|
return y({
|
|
@@ -369,36 +369,36 @@ var S = {
|
|
|
369
369
|
}, e.width, e.height);
|
|
370
370
|
}
|
|
371
371
|
render() {
|
|
372
|
-
let { aspect: e, children: t, circularCrop: n, className: r, crop:
|
|
373
|
-
return /* @__PURE__ */
|
|
372
|
+
let { aspect: e, children: t, circularCrop: n, className: r, crop: a, disabled: o, locked: s, style: c, ruleOfThirds: l } = this.props, { cropIsActive: u, newCropIsBeingDrawn: d } = this.state, f = a ? this.renderCropSelection() : null, p = m("ReactCrop", r, u && "ReactCrop--active", o && "ReactCrop--disabled", s && "ReactCrop--locked", d && "ReactCrop--new-crop", a && e && "ReactCrop--fixed-aspect", a && n && "ReactCrop--circular-crop", a && l && "ReactCrop--rule-of-thirds", !this.dragStarted && a && !a.width && !a.height && "ReactCrop--invisible-crop", n && "ReactCrop--no-animate");
|
|
373
|
+
return /* @__PURE__ */ i.createElement("div", {
|
|
374
374
|
ref: this.componentRef,
|
|
375
375
|
className: p,
|
|
376
376
|
style: c
|
|
377
|
-
}, /* @__PURE__ */
|
|
377
|
+
}, /* @__PURE__ */ i.createElement("div", {
|
|
378
378
|
ref: this.mediaRef,
|
|
379
379
|
className: "ReactCrop__child-wrapper",
|
|
380
380
|
onPointerDown: this.onComponentPointerDown
|
|
381
|
-
}, t),
|
|
381
|
+
}, t), a ? /* @__PURE__ */ i.createElement("svg", {
|
|
382
382
|
className: "ReactCrop__crop-mask",
|
|
383
383
|
width: "100%",
|
|
384
384
|
height: "100%"
|
|
385
|
-
}, /* @__PURE__ */
|
|
385
|
+
}, /* @__PURE__ */ i.createElement("defs", null, /* @__PURE__ */ i.createElement("mask", { id: `hole-${this.instanceId}` }, /* @__PURE__ */ i.createElement("rect", {
|
|
386
386
|
width: "100%",
|
|
387
387
|
height: "100%",
|
|
388
388
|
fill: "white"
|
|
389
|
-
}), n ? /* @__PURE__ */
|
|
390
|
-
cx: `${
|
|
391
|
-
cy: `${
|
|
392
|
-
rx: `${
|
|
393
|
-
ry: `${
|
|
389
|
+
}), n ? /* @__PURE__ */ i.createElement("ellipse", {
|
|
390
|
+
cx: `${a.x + a.width / 2}${a.unit}`,
|
|
391
|
+
cy: `${a.y + a.height / 2}${a.unit}`,
|
|
392
|
+
rx: `${a.width / 2}${a.unit}`,
|
|
393
|
+
ry: `${a.height / 2}${a.unit}`,
|
|
394
394
|
fill: "black"
|
|
395
|
-
}) : /* @__PURE__ */
|
|
396
|
-
x: `${
|
|
397
|
-
y: `${
|
|
398
|
-
width: `${
|
|
399
|
-
height: `${
|
|
395
|
+
}) : /* @__PURE__ */ i.createElement("rect", {
|
|
396
|
+
x: `${a.x}${a.unit}`,
|
|
397
|
+
y: `${a.y}${a.unit}`,
|
|
398
|
+
width: `${a.width}${a.unit}`,
|
|
399
|
+
height: `${a.height}${a.unit}`,
|
|
400
400
|
fill: "black"
|
|
401
|
-
}))), /* @__PURE__ */
|
|
401
|
+
}))), /* @__PURE__ */ i.createElement("rect", {
|
|
402
402
|
fill: "black",
|
|
403
403
|
fillOpacity: .5,
|
|
404
404
|
width: "100%",
|
|
@@ -431,9 +431,9 @@ function E(e, t, n) {
|
|
|
431
431
|
}
|
|
432
432
|
//#endregion
|
|
433
433
|
//#region src/stories/molecules/ImageCropDialog/ImageCropDialog.tsx
|
|
434
|
-
function D({ sourceUrl:
|
|
435
|
-
let O =
|
|
436
|
-
|
|
434
|
+
function D({ sourceUrl: i, title: a, description: o, circularCrop: f = !1, aspect: p = 1, outputSize: m = 512, outputMimeType: h, busy: g = !1, cancelLabel: _, confirmLabel: v, closeLabel: y, loadingLabel: b = "Cargando imagen…", errorMessage: x = "No hemos podido cargar la imagen. Prueba con otro archivo.", onConfirm: S, onClose: C, className: D }) {
|
|
435
|
+
let O = s(null), [k, A] = c(), [j, M] = c(), [N, P] = c("loading"), [F, I] = c(i);
|
|
436
|
+
i !== F && (I(i), P("loading"), A(void 0), M(void 0));
|
|
437
437
|
let L = () => {
|
|
438
438
|
A(void 0), M(void 0), C();
|
|
439
439
|
}, R = async () => {
|
|
@@ -443,40 +443,40 @@ function D({ sourceUrl: s, title: c, description: l, circularCrop: f = !1, aspec
|
|
|
443
443
|
outputSize: m
|
|
444
444
|
})), L());
|
|
445
445
|
};
|
|
446
|
-
return /* @__PURE__ */
|
|
447
|
-
open:
|
|
446
|
+
return /* @__PURE__ */ u(r, {
|
|
447
|
+
open: i !== null,
|
|
448
448
|
onClose: () => {
|
|
449
449
|
g || L();
|
|
450
450
|
},
|
|
451
|
-
title:
|
|
451
|
+
title: a,
|
|
452
452
|
...y ? { closeLabel: y } : {},
|
|
453
|
-
...
|
|
453
|
+
...o == null ? {} : { description: o },
|
|
454
454
|
footerClassName: "image-crop-dialog__actions",
|
|
455
|
-
footer: /* @__PURE__ */
|
|
455
|
+
footer: /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(t, {
|
|
456
456
|
variant: "outline",
|
|
457
457
|
disabled: g,
|
|
458
458
|
onClick: L,
|
|
459
459
|
children: _
|
|
460
|
-
}), /* @__PURE__ */
|
|
460
|
+
}), /* @__PURE__ */ u(t, {
|
|
461
461
|
disabled: g || !j?.width,
|
|
462
462
|
onClick: R,
|
|
463
463
|
children: v
|
|
464
464
|
})] }),
|
|
465
|
-
children: /* @__PURE__ */
|
|
465
|
+
children: /* @__PURE__ */ u("div", {
|
|
466
466
|
className: ["image-crop-dialog", D].filter(Boolean).join(" "),
|
|
467
|
-
children: /* @__PURE__ */
|
|
467
|
+
children: /* @__PURE__ */ d("div", {
|
|
468
468
|
className: "image-crop-dialog__area",
|
|
469
469
|
children: [
|
|
470
|
-
N === "loading" && /* @__PURE__ */
|
|
470
|
+
N === "loading" && /* @__PURE__ */ u(e, {
|
|
471
471
|
size: "lg",
|
|
472
472
|
label: b
|
|
473
473
|
}),
|
|
474
|
-
N === "error" && /* @__PURE__ */
|
|
474
|
+
N === "error" && /* @__PURE__ */ u(n, {
|
|
475
475
|
variant: "error",
|
|
476
476
|
description: x,
|
|
477
477
|
className: "image-crop-dialog__error"
|
|
478
478
|
}),
|
|
479
|
-
|
|
479
|
+
i && N !== "error" && /* @__PURE__ */ u(w, {
|
|
480
480
|
crop: k,
|
|
481
481
|
onChange: (e, t) => A(t),
|
|
482
482
|
onComplete: (e) => M(e),
|
|
@@ -484,9 +484,9 @@ function D({ sourceUrl: s, title: c, description: l, circularCrop: f = !1, aspec
|
|
|
484
484
|
circularCrop: f,
|
|
485
485
|
minWidth: 64,
|
|
486
486
|
keepSelection: !0,
|
|
487
|
-
children: /* @__PURE__ */
|
|
487
|
+
children: /* @__PURE__ */ u("img", {
|
|
488
488
|
ref: O,
|
|
489
|
-
src:
|
|
489
|
+
src: i,
|
|
490
490
|
alt: "",
|
|
491
491
|
onLoad: (e) => {
|
|
492
492
|
let { width: t, height: n } = e.currentTarget;
|
package/dist/_shared/tokens.js
CHANGED
|
@@ -3104,6 +3104,7 @@ var e = {
|
|
|
3104
3104
|
"--annotation-thread-body-color": "#111e30",
|
|
3105
3105
|
"--annotation-thread-replies-label-font-size": "0.875rem",
|
|
3106
3106
|
"--annotation-thread-replies-label-color": "#4a4a4a",
|
|
3107
|
+
"--annotation-thread-acknowledged-opacity": "0.7",
|
|
3107
3108
|
"--annotation-thread-resolved-opacity": "0.4",
|
|
3108
3109
|
"--chart-series-1": "#1e7ff6",
|
|
3109
3110
|
"--chart-series-2": "#f16123",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PaginationMessages } from '../molecules/Pagination/Pagination';
|
|
2
|
+
/**
|
|
3
|
+
* El contrato de textos de la librería: un espacio por componente, y dentro
|
|
4
|
+
* de cada espacio **todas las claves obligatorias**.
|
|
5
|
+
*
|
|
6
|
+
* El tipo nace aquí, en el DS, y es el catálogo de la aplicación el que lo
|
|
7
|
+
* satisface — nunca al revés. Si el tipo se generase desde el JSON de una
|
|
8
|
+
* suite concreta, el DS pasaría a depender de un paquete de producto para
|
|
9
|
+
* declarar su propio contrato y dejaría de sostenerse solo.
|
|
10
|
+
*
|
|
11
|
+
* Anidado por componente, no plano: son 310 textos en 111 componentes, y una
|
|
12
|
+
* lista plana de claves sueltas (`paginationPrevious`, `modalClose`…) no se
|
|
13
|
+
* puede escribir ni revisar. Los espacios calcan además los que el catálogo
|
|
14
|
+
* de la suite ya tiene (`pagination`, `table`, `common`…), así que montar el
|
|
15
|
+
* proveedor es mapear namespaces, no inventarlos.
|
|
16
|
+
*
|
|
17
|
+
* Cada interfaz de espacio vive **junto a su componente** (como
|
|
18
|
+
* `RecoveryCodesLabels`), no aquí: aquí solo se ensamblan. Un componente que
|
|
19
|
+
* gana textos declara su interfaz al lado de sus props y añade una línea a
|
|
20
|
+
* este tipo; a partir de ese momento, una aplicación que no la rellene no
|
|
21
|
+
* compila.
|
|
22
|
+
*/
|
|
23
|
+
export interface BrandMessages {
|
|
24
|
+
pagination: PaginationMessages;
|
|
25
|
+
}
|
|
26
|
+
export type { PaginationMessages };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BrandMessages } from './BrandMessages';
|
|
2
|
+
/**
|
|
3
|
+
* El catálogo montado por la aplicación, o `null` si no hay proveedor. Lo
|
|
4
|
+
* pone `BrandMessagesProvider` y lo leen los componentes con
|
|
5
|
+
* `useBrandMessages`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const BrandMessagesContext: import("react").Context<BrandMessages | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Lee un texto del espacio de un componente: `t('previous')` devuelve el del
|
|
10
|
+
* proveedor, y `t('previous', previousLabel)` deja ganar a la prop cuando el
|
|
11
|
+
* consumidor la pasa.
|
|
12
|
+
*/
|
|
13
|
+
export interface BrandMessagesReader<K extends keyof BrandMessages> {
|
|
14
|
+
<N extends keyof BrandMessages[K]>(key: N, override?: BrandMessages[K][N]): BrandMessages[K][N];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* El lector del espacio de un componente. Se llama **en el punto donde el
|
|
18
|
+
* texto se pinta**, no al principio del render: así un componente que no
|
|
19
|
+
* enseña el selector de tamaño tampoco exige su texto.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useBrandMessages<K extends keyof BrandMessages>(namespace: K): BrandMessagesReader<K>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BrandMessages } from './BrandMessages';
|
|
3
|
+
export interface BrandMessagesProviderProps {
|
|
4
|
+
/**
|
|
5
|
+
* El catálogo entero, en el idioma vigente. Es `BrandMessages`, con todas
|
|
6
|
+
* sus claves: si falta una, no compila. Ese es el punto del proveedor —
|
|
7
|
+
* olvidar un texto tiene que ser un error de compilación y no un
|
|
8
|
+
* «Cancelar» castellano dentro de una página en francés.
|
|
9
|
+
*/
|
|
10
|
+
messages: BrandMessages;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Los textos que los componentes emiten por su cuenta, montado **una vez en
|
|
15
|
+
* la raíz de la aplicación** y alimentado desde el catálogo de la app (en la
|
|
16
|
+
* suite, `@slxd/messages`).
|
|
17
|
+
*
|
|
18
|
+
* El orden de resolución de cada texto es **prop → proveedor → error**, y no
|
|
19
|
+
* hay un cuarto escalón: ningún componente trae el castellano puesto. La prop
|
|
20
|
+
* suelta sigue existiendo como anulación puntual —el `ariaLabel` de un
|
|
21
|
+
* paginador concreto no es el de todos—, pero cuando no se pasa, el texto
|
|
22
|
+
* sale del proveedor o revienta con un mensaje que dice qué falta.
|
|
23
|
+
*
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // app/[locale]/layout.tsx
|
|
26
|
+
* const t = await getTranslations();
|
|
27
|
+
*
|
|
28
|
+
* <BrandMessagesProvider
|
|
29
|
+
* messages={{
|
|
30
|
+
* pagination: {
|
|
31
|
+
* label: t('pagination.label'),
|
|
32
|
+
* pagesGroup: t('pagination.pagesGroup'),
|
|
33
|
+
* previous: t('pagination.previous'),
|
|
34
|
+
* next: t('pagination.next'),
|
|
35
|
+
* goToPage: (page) => t('pagination.goToPage', { page }),
|
|
36
|
+
* perPage: t('pagination.perPage'),
|
|
37
|
+
* total: (count) => t('pagination.total', { count }),
|
|
38
|
+
* allOption: t('pagination.allOption'),
|
|
39
|
+
* },
|
|
40
|
+
* }}
|
|
41
|
+
* >
|
|
42
|
+
* {children}
|
|
43
|
+
* </BrandMessagesProvider>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function BrandMessagesProvider({ messages, children }: BrandMessagesProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BrandMessagesProvider } from './BrandMessagesProvider';
|
|
2
|
+
export type { BrandMessagesProviderProps } from './BrandMessagesProvider';
|
|
3
|
+
export { useBrandMessages } from './BrandMessagesContext';
|
|
4
|
+
export type { BrandMessagesReader } from './BrandMessagesContext';
|
|
5
|
+
export type { BrandMessages, PaginationMessages } from './BrandMessages';
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import type { SelectOption } from '../../atoms/Select/Select';
|
|
3
3
|
import './Pagination.css';
|
|
4
|
+
/**
|
|
5
|
+
* Los textos que el paginador emite por su cuenta. Los nombres calcan el
|
|
6
|
+
* espacio `pagination` del catálogo de la suite, así que montarlo es mapear
|
|
7
|
+
* clave a clave y no traducir de nuevo.
|
|
8
|
+
*
|
|
9
|
+
* Todas obligatorias: es el proveedor quien garantiza que ninguna falte, y
|
|
10
|
+
* quien las pinta ya no tiene un castellano por defecto donde caer.
|
|
11
|
+
*/
|
|
12
|
+
export interface PaginationMessages {
|
|
13
|
+
/** `aria-label` del `<nav>`. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** `aria-label` del `role="group"` que envuelve los controles de página. */
|
|
16
|
+
pagesGroup: string;
|
|
17
|
+
/** `aria-label` del control «anterior». */
|
|
18
|
+
previous: string;
|
|
19
|
+
/** `aria-label` del control «siguiente». */
|
|
20
|
+
next: string;
|
|
21
|
+
/** `aria-label` de cada botón/enlace de página, con su número. */
|
|
22
|
+
goToPage: (page: number) => string;
|
|
23
|
+
/** `aria-label` del selector de registros por página. */
|
|
24
|
+
perPage: string;
|
|
25
|
+
/** Sumario de `showTotal`, con el número de registros. */
|
|
26
|
+
total: (total: number) => string;
|
|
27
|
+
/** Rótulo de la opción «sin paginar» del selector de registros por página. */
|
|
28
|
+
allOption: string;
|
|
29
|
+
}
|
|
4
30
|
export interface PaginationProps {
|
|
5
31
|
/**
|
|
6
32
|
* Con páginas numeradas (`pages`, por defecto) o solo anterior/siguiente
|
|
@@ -36,7 +62,10 @@ export interface PaginationProps {
|
|
|
36
62
|
hrefBuilder?: (page: number) => string;
|
|
37
63
|
/** Si se pasa, aparece el selector de registros por página */
|
|
38
64
|
onPageSizeChange?: (size: string) => void;
|
|
39
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Opciones del selector. Sin ellas, 10/20/50/100 y la opción «sin paginar»,
|
|
67
|
+
* cuyo rótulo sale de `pagination.allOption` (las cifras no se traducen).
|
|
68
|
+
*/
|
|
40
69
|
pageSizeOptions?: SelectOption[];
|
|
41
70
|
/**
|
|
42
71
|
* Ranura a continuación del selector de registros por página, dentro del
|
|
@@ -55,37 +84,25 @@ export interface PaginationProps {
|
|
|
55
84
|
linkComponent?: ComponentType<any>;
|
|
56
85
|
/** Tamaño del componente. Default: "md" */
|
|
57
86
|
size?: 'sm' | 'md' | 'lg';
|
|
58
|
-
/** aria-label del <nav>. Default: «Paginación» (castellano). Una app multiidioma debe pasarlo traducido. */
|
|
59
|
-
ariaLabel?: string;
|
|
60
87
|
/**
|
|
61
|
-
* aria-label
|
|
62
|
-
*
|
|
88
|
+
* `aria-label` del `<nav>`. Sin default: cuando no se pasa, sale de
|
|
89
|
+
* `pagination.label` del `BrandMessagesProvider`.
|
|
63
90
|
*/
|
|
91
|
+
ariaLabel?: string;
|
|
92
|
+
/** `aria-label` de cada botón/enlace de página. Sin default: `pagination.goToPage`. */
|
|
64
93
|
pageLabel?: (page: number) => string;
|
|
65
|
-
/**
|
|
66
|
-
* aria-label del botón "anterior". Default: "Página anterior" (castellano).
|
|
67
|
-
* Una app multiidioma debe pasarla traducida.
|
|
68
|
-
*/
|
|
94
|
+
/** `aria-label` del botón «anterior». Sin default: `pagination.previous`. */
|
|
69
95
|
previousLabel?: string;
|
|
70
|
-
/**
|
|
71
|
-
* aria-label del botón "siguiente". Default: "Página siguiente" (castellano).
|
|
72
|
-
* Una app multiidioma debe pasarla traducida.
|
|
73
|
-
*/
|
|
96
|
+
/** `aria-label` del botón «siguiente». Sin default: `pagination.next`. */
|
|
74
97
|
nextLabel?: string;
|
|
75
98
|
/**
|
|
76
|
-
* aria-label del `role="group"` que envuelve los controles de página.
|
|
77
|
-
*
|
|
99
|
+
* `aria-label` del `role="group"` que envuelve los controles de página.
|
|
100
|
+
* Sin default: `pagination.pagesGroup`.
|
|
78
101
|
*/
|
|
79
102
|
pagesGroupLabel?: string;
|
|
80
|
-
/**
|
|
81
|
-
* aria-label del selector de registros por página.
|
|
82
|
-
* Default: "Registros por página" (castellano). Una app multiidioma debe pasarla traducida.
|
|
83
|
-
*/
|
|
103
|
+
/** `aria-label` del selector de registros por página. Sin default: `pagination.perPage`. */
|
|
84
104
|
pageSizeLabel?: string;
|
|
85
|
-
/**
|
|
86
|
-
* Texto del sumario que muestra `showTotal`. Default: `${total} resultados` (castellano).
|
|
87
|
-
* Una app multiidioma debe pasarla traducida.
|
|
88
|
-
*/
|
|
105
|
+
/** Texto del sumario que muestra `showTotal`. Sin default: `pagination.total`. */
|
|
89
106
|
totalLabel?: (total: number) => string;
|
|
90
107
|
className?: string;
|
|
91
108
|
}
|
|
@@ -13,16 +13,36 @@ export interface AnnotationEntry {
|
|
|
13
13
|
avatar?: ReactNode;
|
|
14
14
|
/** Se marca como editada junto a la fecha. */
|
|
15
15
|
edited?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Lo que el producto añade **a la fila de metadatos**, al lado de la fecha:
|
|
18
|
+
* la coordenada de la anotación —el enlace a la lección, al segmento, a la
|
|
19
|
+
* versión—, no una acción sobre ella (para eso está `actions`).
|
|
20
|
+
*
|
|
21
|
+
* Se añade DESPUÉS de la fecha y de la marca de editada: no las sustituye, y
|
|
22
|
+
* al estrecharse cae a su propia línea sin empujarlas fuera de la vista.
|
|
23
|
+
*/
|
|
24
|
+
meta?: ReactNode;
|
|
16
25
|
/** Acciones de **esta** anotación: editar, borrar, citar. */
|
|
17
26
|
actions?: ReactNode;
|
|
18
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Los tres estados del hilo, en orden de flujo. El nombre dice **dónde está el
|
|
30
|
+
* hilo**, no cómo lo llama cada producto: el rótulo es una prop, así que una
|
|
31
|
+
* revisión puede escribir «Verificada» sobre `acknowledged` sin que el sistema
|
|
32
|
+
* herede el vocabulario de un producto.
|
|
33
|
+
*/
|
|
34
|
+
export type AnnotationThreadStatus = 'open' | 'acknowledged' | 'resolved';
|
|
19
35
|
export interface AnnotationThreadProps extends React.ComponentPropsWithoutRef<'article'> {
|
|
20
36
|
/** La anotación que abre el hilo. */
|
|
21
37
|
annotation: AnnotationEntry;
|
|
22
38
|
/** Las respuestas, en orden. */
|
|
23
39
|
replies?: AnnotationEntry[];
|
|
24
|
-
/**
|
|
25
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Estado del hilo, en orden de flujo. `open` pide atención; `acknowledged`
|
|
42
|
+
* es el hilo que alguien ya ha mirado y da un paso atrás sin cerrarse;
|
|
43
|
+
* `resolved` se retira visualmente sin desaparecer.
|
|
44
|
+
*/
|
|
45
|
+
status?: AnnotationThreadStatus;
|
|
26
46
|
/** Acciones del hilo entero: resolver, reabrir, seguir. Van al pie. */
|
|
27
47
|
actions?: ReactNode;
|
|
28
48
|
/** Con qué se responde: un `MessageComposer`, un `TextareaField`, un `Button`. */
|
|
@@ -33,6 +53,8 @@ export interface AnnotationThreadProps extends React.ComponentPropsWithoutRef<'a
|
|
|
33
53
|
dateFormat?: Intl.DateTimeFormatOptions;
|
|
34
54
|
/** Rótulo del estado abierto. Por defecto, en castellano: «Abierta». */
|
|
35
55
|
openLabel?: string;
|
|
56
|
+
/** Rótulo del estado atendido. Por defecto, en castellano: «Atendida». */
|
|
57
|
+
acknowledgedLabel?: string;
|
|
36
58
|
/** Rótulo del estado resuelto. Por defecto, en castellano: «Resuelta». */
|
|
37
59
|
resolvedLabel?: string;
|
|
38
60
|
/** Marca de anotación editada. Por defecto, en castellano: «editada». */
|
|
@@ -50,12 +72,12 @@ export interface AnnotationThreadProps extends React.ComponentPropsWithoutRef<'a
|
|
|
50
72
|
/**
|
|
51
73
|
* Un hilo de anotaciones sobre algo: el comentario de revisión de una lección,
|
|
52
74
|
* la nota sobre un segmento de traducción. Cada anotación lleva **autor, fecha
|
|
53
|
-
* y sus propias acciones**, el hilo tiene **estado** (abierta o
|
|
54
|
-
* responde al pie.
|
|
75
|
+
* y sus propias acciones**, el hilo tiene **estado** (abierta, atendida o
|
|
76
|
+
* resuelta) y se responde al pie.
|
|
55
77
|
*
|
|
56
78
|
* No es `ConversationThread`: aquello es una conversación de usuario y
|
|
57
79
|
* asistente, con burbujas, orden de emisor y desplazamiento automático. Aquí
|
|
58
80
|
* todas las anotaciones son iguales, lo que importa es quién dijo qué y cuándo,
|
|
59
81
|
* y si el asunto sigue abierto.
|
|
60
82
|
*/
|
|
61
|
-
export declare function AnnotationThread({ annotation, replies, status, actions, reply, locale, dateFormat, openLabel, resolvedLabel, editedLabel, repliesLabel, label, className, ...rest }: AnnotationThreadProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export declare function AnnotationThread({ annotation, replies, status, actions, reply, locale, dateFormat, openLabel, acknowledgedLabel, resolvedLabel, editedLabel, repliesLabel, label, className, ...rest }: AnnotationThreadProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -94,7 +94,8 @@ export interface DataTableProps<TData, TValue> {
|
|
|
94
94
|
* paginación (en cliente o en servidor) sobre el `Table` y el `Pagination` del
|
|
95
95
|
* DS. El comportamiento lo aporta TanStack Table.
|
|
96
96
|
*
|
|
97
|
-
* Los textos accesibles llegan por props (el DS no habla de i18n):
|
|
98
|
-
* caen a
|
|
97
|
+
* Los textos accesibles llegan por props (el DS no habla de i18n): los de
|
|
98
|
+
* `Table` caen a sus castellanos por defecto, y los de `Pagination` —que ya no
|
|
99
|
+
* tiene ninguno— al `BrandMessagesProvider` que la aplicación monta en su raíz.
|
|
99
100
|
*/
|
|
100
101
|
export declare function DataTable<TData, TValue>({ columns, data, ariaLabel, ariaLabelledBy, searchColumnId, search, searchPlaceholder, searchClearLabel, toolbar, footerActions, pageSize, emptyMessage, isLoading, pagination, headerLabels, paginationLabels, className, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|