@dubix/ui 0.10.0 → 0.11.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/README.md +436 -13
- package/dist/checkbox/Checkbox.d.ts +61 -0
- package/dist/checkbox/Checkbox.js +41 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/filter-bar/AppliedFilters.d.ts +41 -0
- package/dist/filter-bar/AppliedFilters.js +123 -0
- package/dist/filter-bar/FilterAmountRange.d.ts +27 -0
- package/dist/filter-bar/FilterAmountRange.js +86 -0
- package/dist/filter-bar/FilterBar.d.ts +32 -0
- package/dist/filter-bar/FilterBar.js +21 -0
- package/dist/filter-bar/FilterOptions.d.ts +71 -0
- package/dist/filter-bar/FilterOptions.js +181 -0
- package/dist/filter-bar/FilterPanel.d.ts +63 -0
- package/dist/filter-bar/FilterPanel.js +50 -0
- package/dist/filter-bar/FilterPeriod.d.ts +25 -0
- package/dist/filter-bar/FilterPeriod.js +71 -0
- package/dist/filter-bar/FilterSearch.d.ts +54 -0
- package/dist/filter-bar/FilterSearch.js +100 -0
- package/dist/filter-bar/FilterToggle.d.ts +16 -0
- package/dist/filter-bar/FilterToggle.js +24 -0
- package/dist/filter-bar/format.d.ts +53 -0
- package/dist/filter-bar/format.js +104 -0
- package/dist/filter-bar/index.d.ts +18 -0
- package/dist/filter-bar/index.js +9 -0
- package/dist/pagination/Pagination.d.ts +11 -8
- package/dist/pagination/Pagination.js +7 -2
- package/dist/popover/Popover.d.ts +65 -0
- package/dist/popover/Popover.js +87 -0
- package/dist/popover/index.d.ts +2 -0
- package/dist/popover/index.js +1 -0
- package/dist/select/Select.d.ts +5 -1
- package/dist/select/Select.js +2 -2
- package/dist/select/index.d.ts +1 -1
- package/dist/styles.css +918 -90
- package/dist/tooltip/Tooltip.d.ts +6 -1
- package/dist/tooltip/Tooltip.js +5 -4
- package/package.json +13 -1
|
@@ -16,6 +16,11 @@ export interface TooltipProps {
|
|
|
16
16
|
shortcut?: string | undefined;
|
|
17
17
|
/** Milisegundos de hover antes de abrir. Por defecto, el de TooltipProvider o 700 (el de Radix). El foco abre sin espera. */
|
|
18
18
|
delayDuration?: number | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Apagado: no abre (y si estaba abierto, se cierra) y no agrega `aria-describedby`. No cambia nada más: el disparador sigue
|
|
21
|
+
* envuelto igual, así que prenderlo o apagarlo no lo vuelve a montar (no pierde el foco ni lo que tenga abierto).
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean | undefined;
|
|
19
24
|
}
|
|
20
25
|
export interface TooltipProviderProps {
|
|
21
26
|
children: ReactNode;
|
|
@@ -31,4 +36,4 @@ export declare function TooltipProvider({ children, delayDuration, skipDelayDura
|
|
|
31
36
|
* salir o al hacer clic. Envuelve a un único hijo focalizable, que conserva su nombre accesible; el tooltip lo describe
|
|
32
37
|
* (`aria-describedby`) salvo que repita ese nombre. Funciona sin TooltipProvider.
|
|
33
38
|
*/
|
|
34
|
-
export declare function Tooltip({ content, children, side, align, shortcut, delayDuration }: TooltipProps): import("react").JSX.Element;
|
|
39
|
+
export declare function Tooltip({ content, children, side, align, shortcut, delayDuration, disabled }: TooltipProps): import("react").JSX.Element;
|
package/dist/tooltip/Tooltip.js
CHANGED
|
@@ -34,7 +34,7 @@ function TriggerSlot({ children, drop, add, 'aria-describedby': describedby, ...
|
|
|
34
34
|
* salir o al hacer clic. Envuelve a un único hijo focalizable, que conserva su nombre accesible; el tooltip lo describe
|
|
35
35
|
* (`aria-describedby`) salvo que repita ese nombre. Funciona sin TooltipProvider.
|
|
36
36
|
*/
|
|
37
|
-
export function Tooltip({ content, children, side = 'top', align = 'center', shortcut, delayDuration }) {
|
|
37
|
+
export function Tooltip({ content, children, side = 'top', align = 'center', shortcut, delayDuration, disabled = false }) {
|
|
38
38
|
if (!isValidElement(children))
|
|
39
39
|
throw new Error('Tooltip: children tiene que ser un único elemento focalizable (p. ej. un <button>).');
|
|
40
40
|
const inProvider = useContext(InProvider);
|
|
@@ -45,15 +45,16 @@ export function Tooltip({ content, children, side = 'top', align = 'center', sho
|
|
|
45
45
|
// El nombre y el tema se leen al abrir, del disparador ya montado: así valen también los aria-label que cambian.
|
|
46
46
|
const onOpenChange = (open) => {
|
|
47
47
|
const el = trigger.current;
|
|
48
|
-
if (!open || !el) {
|
|
48
|
+
if (!open || !el || disabled) {
|
|
49
49
|
setState((s) => ({ ...s, open: false }));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
const text = typeof content === 'string' || typeof content === 'number' ? normalize(String(content)) : null;
|
|
53
53
|
setState({ open: true, repeats: text !== null && text !== '' && text === normalize(accessibleName(el)), container: themeRoot(el) });
|
|
54
54
|
};
|
|
55
|
-
const {
|
|
55
|
+
const { repeats, container } = state;
|
|
56
|
+
const open = state.open && !disabled;
|
|
56
57
|
const hasShortcut = shortcut !== undefined && shortcut !== '';
|
|
57
|
-
const tooltip = (_jsxs(TooltipPrimitive.Root, { open: open, onOpenChange: onOpenChange, ...(delayDuration === undefined ? {} : { delayDuration }), children: [_jsx(TooltipPrimitive.Trigger, { asChild: true, ref: trigger, children: _jsx(TriggerSlot, { drop: repeats ? contentId : undefined, add: repeats && hasShortcut ? shortcutId : undefined, children: children }) }), _jsx(TooltipPrimitive.Portal, { container: container, children: _jsxs(TooltipPrimitive.Content, { className: "dx-tooltip", id: contentId, side: side, align: align, sideOffset: SIDE_OFFSET, collisionPadding: COLLISION_PADDING, "aria-hidden": repeats || undefined, children: [content, hasShortcut && _jsx("kbd", { className: "dx-tooltip__shortcut", id: shortcutId, children: shortcut })] }) })] }));
|
|
58
|
+
const tooltip = (_jsxs(TooltipPrimitive.Root, { open: open, onOpenChange: onOpenChange, ...(delayDuration === undefined ? {} : { delayDuration }), children: [_jsx(TooltipPrimitive.Trigger, { asChild: true, ref: trigger, children: _jsx(TriggerSlot, { drop: repeats ? contentId : undefined, add: !disabled && repeats && hasShortcut ? shortcutId : undefined, children: children }) }), _jsx(TooltipPrimitive.Portal, { container: container, children: _jsxs(TooltipPrimitive.Content, { className: "dx-tooltip", id: contentId, side: side, align: align, sideOffset: SIDE_OFFSET, collisionPadding: COLLISION_PADDING, "aria-hidden": repeats || undefined, children: [content, hasShortcut && _jsx("kbd", { className: "dx-tooltip__shortcut", id: shortcutId, children: shortcut })] }) })] }));
|
|
58
59
|
return inProvider ? tooltip : _jsx(TooltipPrimitive.Provider, { children: tooltip });
|
|
59
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dubix/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Componentes React 19 de Dubix (D2 · Tinta, referencia D2.1) con CSS propio sobre las variables --dx-* de @dubix/tokens.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
"types": "./dist/card/index.d.ts",
|
|
41
41
|
"default": "./dist/card/index.js"
|
|
42
42
|
},
|
|
43
|
+
"./checkbox": {
|
|
44
|
+
"types": "./dist/checkbox/index.d.ts",
|
|
45
|
+
"default": "./dist/checkbox/index.js"
|
|
46
|
+
},
|
|
43
47
|
"./confirm-dialog": {
|
|
44
48
|
"types": "./dist/confirm-dialog/index.d.ts",
|
|
45
49
|
"default": "./dist/confirm-dialog/index.js"
|
|
@@ -60,6 +64,10 @@
|
|
|
60
64
|
"types": "./dist/field/index.d.ts",
|
|
61
65
|
"default": "./dist/field/index.js"
|
|
62
66
|
},
|
|
67
|
+
"./filter-bar": {
|
|
68
|
+
"types": "./dist/filter-bar/index.d.ts",
|
|
69
|
+
"default": "./dist/filter-bar/index.js"
|
|
70
|
+
},
|
|
63
71
|
"./icon-button": {
|
|
64
72
|
"types": "./dist/icon-button/index.d.ts",
|
|
65
73
|
"default": "./dist/icon-button/index.js"
|
|
@@ -80,6 +88,10 @@
|
|
|
80
88
|
"types": "./dist/pagination/index.d.ts",
|
|
81
89
|
"default": "./dist/pagination/index.js"
|
|
82
90
|
},
|
|
91
|
+
"./popover": {
|
|
92
|
+
"types": "./dist/popover/index.d.ts",
|
|
93
|
+
"default": "./dist/popover/index.js"
|
|
94
|
+
},
|
|
83
95
|
"./product-mark": {
|
|
84
96
|
"types": "./dist/product-mark/index.d.ts",
|
|
85
97
|
"default": "./dist/product-mark/index.js"
|