softable-pixels-web 1.1.21 → 1.1.23
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/dist/{BasePopover-BVeMpuWR.js → BasePopover-CES18mzR.js} +3 -2
- package/dist/BasePopover-CES18mzR.js.map +1 -0
- package/dist/{ContextMenu-B94eRUm7.js → ContextMenu-D7lPQcw1.js} +16 -8
- package/dist/ContextMenu-D7lPQcw1.js.map +1 -0
- package/dist/{Popover-BDNQO09F.js → Popover-CNon8bZo.js} +183 -80
- package/dist/Popover-CNon8bZo.js.map +1 -0
- package/dist/{Select-Bad465DY.js → Select-CGWL6BOg.js} +217 -21
- package/dist/Select-CGWL6BOg.js.map +1 -0
- package/dist/base-popover.d.ts +3 -3
- package/dist/base-popover.js +4 -4
- package/dist/button.d.ts +1 -1
- package/dist/context-menu.js +5 -5
- package/dist/{index-DEKll7zF.d.ts → index-B6t8KE4A.d.ts} +2 -3
- package/dist/{index-modFVzpZ.d.ts → index-CK68mp8m.d.ts} +3 -3
- package/dist/{index-ClqTlRGD.d.ts → index-CPoGZ0_L.d.ts} +2 -2
- package/dist/{index-CyvNJW2l.d.ts → index-CYnINkUh.d.ts} +2 -2
- package/dist/{index-DVE8mV5m.d.ts → index-DUP_xS5q.d.ts} +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/popover.d.ts +2 -2
- package/dist/popover.js +3 -3
- package/dist/select.d.ts +2 -2
- package/dist/select.js +5 -5
- package/dist/tab-switch.d.ts +1 -1
- package/dist/{types-CRA-1_6O.d.ts → types-Bayf6NdC.d.ts} +5 -2
- package/dist/use-dismiss.d.ts +2 -0
- package/dist/use-dismiss.js +1 -1
- package/dist/use-floating.js +1 -1
- package/dist/{useDismiss-CAEk_GV-.js → useDismiss-DwQfMU11.js} +13 -6
- package/dist/useDismiss-DwQfMU11.js.map +1 -0
- package/dist/{useFloating-DRwB71jG.js → useFloating-DCxblHIR.js} +1 -2
- package/dist/{useFloating-DRwB71jG.js.map → useFloating-DCxblHIR.js.map} +1 -1
- package/package.json +1 -1
- package/dist/BasePopover-BVeMpuWR.js.map +0 -1
- package/dist/ContextMenu-B94eRUm7.js.map +0 -1
- package/dist/Popover-BDNQO09F.js.map +0 -1
- package/dist/Select-Bad465DY.js.map +0 -1
- package/dist/useDismiss-CAEk_GV-.js.map +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { n as styled, t as useThemedStyles } from "./useThemedStyles-CrarDyWc.js";
|
|
2
2
|
import { t as Icon } from "./Icon-KzwFJI_k.js";
|
|
3
|
-
import { t as BasePopover } from "./BasePopover-
|
|
3
|
+
import { t as BasePopover } from "./BasePopover-CES18mzR.js";
|
|
4
4
|
import { t as Label } from "./Label-BHq2knad.js";
|
|
5
|
-
import { useMemo, useState } from "react";
|
|
5
|
+
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
|
|
8
8
|
//#region src/components/commons/inputs/Select/components/OptionItem/styles.ts
|
|
9
|
-
function createOptionsStyles(
|
|
9
|
+
function createOptionsStyles(props) {
|
|
10
|
+
const { isSelected } = props;
|
|
11
|
+
const isActive = props["data-active"] === "true";
|
|
10
12
|
return styled({
|
|
11
13
|
container: {
|
|
12
14
|
width: "100%",
|
|
@@ -17,7 +19,7 @@ function createOptionsStyles({ isSelected }) {
|
|
|
17
19
|
padding: "0.5rem 0.75rem",
|
|
18
20
|
cursor: "pointer",
|
|
19
21
|
transition: "background-color 0.2s ease-out",
|
|
20
|
-
backgroundColor: isSelected ? "var(--px-background-card-hover)" : "transparent",
|
|
22
|
+
backgroundColor: isSelected || isActive ? "var(--px-background-card-hover)" : "transparent",
|
|
21
23
|
__rules: {
|
|
22
24
|
"&:hover": { backgroundColor: "var(--px-background-card-hover) !important" },
|
|
23
25
|
"&:focus": {
|
|
@@ -42,31 +44,206 @@ function createOptionsStyles({ isSelected }) {
|
|
|
42
44
|
|
|
43
45
|
//#endregion
|
|
44
46
|
//#region src/components/commons/inputs/Select/components/OptionItem/index.tsx
|
|
45
|
-
|
|
46
|
-
const OptionItem = (props) => {
|
|
47
|
+
const OptionItem = forwardRef((props, ref) => {
|
|
47
48
|
const { styles, classes } = useThemedStyles(props, createOptionsStyles);
|
|
48
|
-
|
|
49
|
-
props.onClick(props.option.value);
|
|
50
|
-
}
|
|
49
|
+
const { option, isSelected, onClick, ...rest } = props;
|
|
51
50
|
return /* @__PURE__ */ jsx("button", {
|
|
51
|
+
...rest,
|
|
52
|
+
ref,
|
|
52
53
|
type: "button",
|
|
53
54
|
role: "option",
|
|
54
55
|
style: styles.container,
|
|
55
56
|
className: classes.container,
|
|
56
|
-
"aria-label":
|
|
57
|
-
"aria-selected":
|
|
58
|
-
onClick:
|
|
57
|
+
"aria-label": option.label,
|
|
58
|
+
"aria-selected": isSelected,
|
|
59
|
+
onClick: () => onClick(option.value),
|
|
59
60
|
children: /* @__PURE__ */ jsx("span", {
|
|
60
61
|
style: styles.text,
|
|
61
|
-
children:
|
|
62
|
+
children: option.label
|
|
62
63
|
})
|
|
63
64
|
});
|
|
64
|
-
};
|
|
65
|
+
});
|
|
66
|
+
OptionItem.displayName = "OptionItem";
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/hooks/useCompositeListNavigation/index.ts
|
|
70
|
+
function findNextEnabled(start, dir, count, isDisabled) {
|
|
71
|
+
if (count <= 0) return 0;
|
|
72
|
+
let i = start;
|
|
73
|
+
for (let step = 0; step < count; step++) {
|
|
74
|
+
i = (i + dir + count) % count;
|
|
75
|
+
if (!isDisabled(i)) return i;
|
|
76
|
+
}
|
|
77
|
+
return start;
|
|
78
|
+
}
|
|
79
|
+
function findFirstEnabled(count, isDisabled) {
|
|
80
|
+
for (let i = 0; i < count; i++) if (!isDisabled(i)) return i;
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
function useCompositeListNavigation({ open, itemCount, initialIndex, setOpen, makeMeta, onCloseByTab }) {
|
|
84
|
+
const listRef = useRef(null);
|
|
85
|
+
const itemRefs = useRef([]);
|
|
86
|
+
const isDisabled = useCallback((i) => !!makeMeta(i).disabled, [makeMeta]);
|
|
87
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
88
|
+
const focusItem = useCallback((i) => {
|
|
89
|
+
const el = itemRefs.current[i];
|
|
90
|
+
if (!el) return;
|
|
91
|
+
el.focus({ preventScroll: true });
|
|
92
|
+
el.scrollIntoView({ block: "nearest" });
|
|
93
|
+
}, []);
|
|
94
|
+
const openAndFocus = useCallback((index) => {
|
|
95
|
+
setOpen(true);
|
|
96
|
+
const next = typeof index === "number" ? index : typeof initialIndex === "number" ? initialIndex : findFirstEnabled(itemCount, isDisabled);
|
|
97
|
+
setActiveIndex(next);
|
|
98
|
+
requestAnimationFrame(() => focusItem(next));
|
|
99
|
+
}, [
|
|
100
|
+
focusItem,
|
|
101
|
+
initialIndex,
|
|
102
|
+
isDisabled,
|
|
103
|
+
itemCount,
|
|
104
|
+
setOpen
|
|
105
|
+
]);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (!open) return;
|
|
108
|
+
requestAnimationFrame(() => focusItem(activeIndex));
|
|
109
|
+
}, [
|
|
110
|
+
open,
|
|
111
|
+
activeIndex,
|
|
112
|
+
focusItem
|
|
113
|
+
]);
|
|
114
|
+
const move = useCallback((dir) => {
|
|
115
|
+
const next = findNextEnabled(activeIndex, dir, itemCount, isDisabled);
|
|
116
|
+
setActiveIndex(next);
|
|
117
|
+
requestAnimationFrame(() => focusItem(next));
|
|
118
|
+
}, [
|
|
119
|
+
activeIndex,
|
|
120
|
+
itemCount,
|
|
121
|
+
isDisabled,
|
|
122
|
+
focusItem
|
|
123
|
+
]);
|
|
124
|
+
const activate = useCallback(() => {
|
|
125
|
+
const meta = makeMeta(activeIndex);
|
|
126
|
+
if (meta.disabled) return;
|
|
127
|
+
meta.onActivate?.();
|
|
128
|
+
}, [activeIndex, makeMeta]);
|
|
129
|
+
const onListKeyDown = useCallback((e) => {
|
|
130
|
+
if (!open) return;
|
|
131
|
+
switch (e.key) {
|
|
132
|
+
case "Tab":
|
|
133
|
+
onCloseByTab?.();
|
|
134
|
+
setOpen(false);
|
|
135
|
+
return;
|
|
136
|
+
case "ArrowDown":
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
move(1);
|
|
139
|
+
return;
|
|
140
|
+
case "ArrowUp":
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
move(-1);
|
|
143
|
+
return;
|
|
144
|
+
case "Home": {
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
const first = findFirstEnabled(itemCount, isDisabled);
|
|
147
|
+
setActiveIndex(first);
|
|
148
|
+
requestAnimationFrame(() => focusItem(first));
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
case "End": {
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
let last = itemCount - 1;
|
|
154
|
+
for (let i = itemCount - 1; i >= 0; i--) if (!isDisabled(i)) {
|
|
155
|
+
last = i;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
setActiveIndex(last);
|
|
159
|
+
requestAnimationFrame(() => focusItem(last));
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
case "Enter":
|
|
163
|
+
case " ":
|
|
164
|
+
e.preventDefault();
|
|
165
|
+
activate();
|
|
166
|
+
return;
|
|
167
|
+
case "Escape":
|
|
168
|
+
e.preventDefault();
|
|
169
|
+
setOpen(false);
|
|
170
|
+
return;
|
|
171
|
+
case "ArrowRight": {
|
|
172
|
+
e.preventDefault();
|
|
173
|
+
const meta = makeMeta(activeIndex);
|
|
174
|
+
if (meta.hasChildren) meta.onOpenChildren?.();
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
case "ArrowLeft":
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
makeMeta(activeIndex).onCloseChildren?.();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
}, [
|
|
183
|
+
open,
|
|
184
|
+
itemCount,
|
|
185
|
+
activeIndex,
|
|
186
|
+
move,
|
|
187
|
+
setOpen,
|
|
188
|
+
activate,
|
|
189
|
+
makeMeta,
|
|
190
|
+
focusItem,
|
|
191
|
+
isDisabled,
|
|
192
|
+
onCloseByTab
|
|
193
|
+
]);
|
|
194
|
+
const getTriggerProps = useCallback(() => {
|
|
195
|
+
return { onKeyDown: (e) => {
|
|
196
|
+
if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
if (!open) openAndFocus();
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (e.key === "ArrowUp") {
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
if (!open) openAndFocus(itemCount > 0 ? itemCount - 1 : 0);
|
|
204
|
+
}
|
|
205
|
+
} };
|
|
206
|
+
}, [
|
|
207
|
+
open,
|
|
208
|
+
openAndFocus,
|
|
209
|
+
itemCount
|
|
210
|
+
]);
|
|
211
|
+
return {
|
|
212
|
+
activeIndex,
|
|
213
|
+
getListProps: useCallback(() => {
|
|
214
|
+
return {
|
|
215
|
+
ref: (el) => {
|
|
216
|
+
listRef.current = el;
|
|
217
|
+
},
|
|
218
|
+
onKeyDown: onListKeyDown
|
|
219
|
+
};
|
|
220
|
+
}, [onListKeyDown]),
|
|
221
|
+
getItemProps: useCallback((index) => {
|
|
222
|
+
const isActive = index === activeIndex;
|
|
223
|
+
return {
|
|
224
|
+
ref: (el) => {
|
|
225
|
+
itemRefs.current[index] = el;
|
|
226
|
+
},
|
|
227
|
+
tabIndex: isActive ? 0 : -1,
|
|
228
|
+
"data-active": isActive ? "true" : "false"
|
|
229
|
+
};
|
|
230
|
+
}, [activeIndex]),
|
|
231
|
+
openAndFocus,
|
|
232
|
+
setActiveIndex,
|
|
233
|
+
getTriggerProps
|
|
234
|
+
};
|
|
235
|
+
}
|
|
65
236
|
|
|
66
237
|
//#endregion
|
|
67
238
|
//#region src/components/commons/inputs/Select/hooks/useSelect/index.ts
|
|
68
|
-
function useSelect({ value, multiple, canClear, onChange }) {
|
|
239
|
+
function useSelect({ value, options, multiple, disabled, canClear, onChange }) {
|
|
69
240
|
const [open, setOpen] = useState(false);
|
|
241
|
+
const nav = useCompositeListNavigation({
|
|
242
|
+
open,
|
|
243
|
+
itemCount: options.length,
|
|
244
|
+
setOpen: changeOpen,
|
|
245
|
+
makeMeta
|
|
246
|
+
});
|
|
70
247
|
function handleOptionClick(option) {
|
|
71
248
|
const isAlreadySelected = value.includes(option);
|
|
72
249
|
if (!multiple) {
|
|
@@ -81,14 +258,27 @@ function useSelect({ value, multiple, canClear, onChange }) {
|
|
|
81
258
|
} else onChange(value.filter((v) => v !== option));
|
|
82
259
|
else onChange([...value, option]);
|
|
83
260
|
}
|
|
261
|
+
function makeMeta(index) {
|
|
262
|
+
const opt = options[index];
|
|
263
|
+
return { onActivate: () => {
|
|
264
|
+
if (opt) handleOptionClick(opt.value);
|
|
265
|
+
} };
|
|
266
|
+
}
|
|
267
|
+
function changeOpen(value$1) {
|
|
268
|
+
setOpen(value$1);
|
|
269
|
+
}
|
|
84
270
|
function togglePanel() {
|
|
85
|
-
|
|
271
|
+
if (disabled) return;
|
|
272
|
+
if (!open) nav.openAndFocus();
|
|
86
273
|
}
|
|
87
274
|
function closePanel() {
|
|
88
275
|
setOpen(false);
|
|
89
276
|
}
|
|
90
277
|
return {
|
|
278
|
+
nav,
|
|
91
279
|
open,
|
|
280
|
+
makeMeta,
|
|
281
|
+
changeOpen,
|
|
92
282
|
togglePanel,
|
|
93
283
|
closePanel,
|
|
94
284
|
handleOptionClick
|
|
@@ -155,7 +345,7 @@ var types_exports = {};
|
|
|
155
345
|
//#endregion
|
|
156
346
|
//#region src/components/commons/inputs/Select/index.tsx
|
|
157
347
|
const Select = (props) => {
|
|
158
|
-
const { open,
|
|
348
|
+
const { nav, open, changeOpen, handleOptionClick } = useSelect(props);
|
|
159
349
|
const { styles, classes } = useThemedStyles(props, createSelectStyles, {
|
|
160
350
|
pick: (p) => [
|
|
161
351
|
p.disabled,
|
|
@@ -178,6 +368,7 @@ const Select = (props) => {
|
|
|
178
368
|
return result;
|
|
179
369
|
}
|
|
180
370
|
function renderTrigger({ ref, ariaExpanded, onClick }) {
|
|
371
|
+
const triggerKeyProps = nav.getTriggerProps();
|
|
181
372
|
return /* @__PURE__ */ jsxs("button", {
|
|
182
373
|
ref,
|
|
183
374
|
dir: "ltr",
|
|
@@ -188,6 +379,8 @@ const Select = (props) => {
|
|
|
188
379
|
"aria-label": props.label,
|
|
189
380
|
className: classes.content,
|
|
190
381
|
"aria-expanded": ariaExpanded,
|
|
382
|
+
disabled: props.disabled,
|
|
383
|
+
...triggerKeyProps,
|
|
191
384
|
onClick,
|
|
192
385
|
children: [
|
|
193
386
|
props.value.length ? props.startIcon : null,
|
|
@@ -222,13 +415,16 @@ const Select = (props) => {
|
|
|
222
415
|
scrollContainerId: props.scrollContainerId
|
|
223
416
|
},
|
|
224
417
|
trigger: renderTrigger,
|
|
225
|
-
onOpenChange:
|
|
418
|
+
onOpenChange: changeOpen,
|
|
226
419
|
children: /* @__PURE__ */ jsx("div", {
|
|
227
420
|
style: styles.panel,
|
|
228
|
-
|
|
421
|
+
role: "listbox",
|
|
422
|
+
...nav.getListProps(),
|
|
423
|
+
children: props.options.map((option, idx) => /* @__PURE__ */ jsx(OptionItem, {
|
|
229
424
|
option,
|
|
425
|
+
onClick: handleOptionClick,
|
|
230
426
|
isSelected: props.value.includes(option.value),
|
|
231
|
-
|
|
427
|
+
...nav.getItemProps(idx)
|
|
232
428
|
}, option.value))
|
|
233
429
|
})
|
|
234
430
|
}),
|
|
@@ -242,4 +438,4 @@ const Select = (props) => {
|
|
|
242
438
|
|
|
243
439
|
//#endregion
|
|
244
440
|
export { types_exports as n, Select as t };
|
|
245
|
-
//# sourceMappingURL=Select-
|
|
441
|
+
//# sourceMappingURL=Select-CGWL6BOg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select-CGWL6BOg.js","names":["value","Select: React.FC<SelectProps>"],"sources":["../src/components/commons/inputs/Select/components/OptionItem/styles.ts","../src/components/commons/inputs/Select/components/OptionItem/index.tsx","../src/hooks/useCompositeListNavigation/index.ts","../src/components/commons/inputs/Select/hooks/useSelect/index.ts","../src/components/commons/inputs/Select/styles.ts","../src/components/commons/inputs/Select/types.ts","../src/components/commons/inputs/Select/index.tsx"],"sourcesContent":["import type { OptionItemProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createOptionsStyles(\n props: OptionItemProps & { ['data-active']?: string }\n) {\n const { isSelected } = props\n const isActive = props['data-active'] === 'true'\n const highlighted = isSelected || isActive\n\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n alignItems: 'center',\n textAlign: 'left',\n\n borderRadius: '0.25rem',\n padding: '0.5rem 0.75rem',\n\n cursor: 'pointer',\n transition: 'background-color 0.2s ease-out',\n\n backgroundColor: highlighted\n ? 'var(--px-background-card-hover)'\n : 'transparent',\n\n __rules: {\n '&:hover': {\n backgroundColor: 'var(--px-background-card-hover) !important'\n },\n\n '&:focus': {\n outlineOffset: '-1px',\n outline: '2px solid var(--px-color-primary)'\n }\n }\n },\n\n text: {\n flex: 1,\n\n fontSize: '1rem',\n fontWeight: 500,\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-primary)',\n\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis'\n }\n })\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: It's a custom select component */\nimport type React from 'react'\nimport { forwardRef } from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { OptionItemProps } from './types'\n\n// Styles\nimport { createOptionsStyles } from './styles'\n\ntype NativeButtonProps = Omit<\n React.ComponentPropsWithoutRef<'button'>,\n 'onClick'\n>\n\nexport const OptionItem = forwardRef<\n HTMLButtonElement,\n OptionItemProps & NativeButtonProps\n>((props, ref) => {\n const { styles, classes } = useThemedStyles(props, createOptionsStyles)\n\n const { option, isSelected, onClick, ...rest } = props\n\n return (\n <button\n {...rest}\n ref={ref}\n type=\"button\"\n role=\"option\"\n style={styles.container}\n className={classes.container}\n aria-label={option.label}\n aria-selected={isSelected}\n onClick={() => onClick(option.value)}\n >\n <span style={styles.text}>{option.label}</span>\n </button>\n )\n})\n\nOptionItem.displayName = 'OptionItem'\n","// External Libraries\nimport { useCallback, useEffect, useRef, useState } from 'react'\n\nexport type CompositeItemMeta = {\n disabled?: boolean\n hasChildren?: boolean\n onActivate?: () => void\n onOpenChildren?: () => void\n onCloseChildren?: () => void\n}\n\ntype Params = {\n open: boolean\n itemCount: number\n initialIndex?: number\n onCloseByTab?: () => void\n setOpen: (v: boolean) => void\n makeMeta: (index: number) => CompositeItemMeta\n}\n\nfunction findNextEnabled(\n start: number,\n dir: 1 | -1,\n count: number,\n isDisabled: (i: number) => boolean\n) {\n if (count <= 0) return 0\n let i = start\n for (let step = 0; step < count; step++) {\n i = (i + dir + count) % count\n if (!isDisabled(i)) return i\n }\n return start\n}\n\nfunction findFirstEnabled(count: number, isDisabled: (i: number) => boolean) {\n for (let i = 0; i < count; i++) if (!isDisabled(i)) return i\n return 0\n}\n\nexport function useCompositeListNavigation({\n open,\n itemCount,\n initialIndex,\n setOpen,\n makeMeta,\n onCloseByTab\n}: Params) {\n const listRef = useRef<HTMLElement | null>(null)\n const itemRefs = useRef<Array<HTMLButtonElement | null>>([])\n\n const isDisabled = useCallback(\n (i: number) => !!makeMeta(i).disabled,\n [makeMeta]\n )\n\n const [activeIndex, setActiveIndex] = useState(0)\n\n const focusItem = useCallback((i: number) => {\n const el = itemRefs.current[i]\n if (!el) return\n el.focus({ preventScroll: true })\n el.scrollIntoView({ block: 'nearest' })\n }, [])\n\n const openAndFocus = useCallback(\n (index?: number) => {\n setOpen(true)\n\n const next =\n typeof index === 'number'\n ? index\n : typeof initialIndex === 'number'\n ? initialIndex\n : findFirstEnabled(itemCount, isDisabled)\n\n setActiveIndex(next)\n requestAnimationFrame(() => focusItem(next))\n },\n [focusItem, initialIndex, isDisabled, itemCount, setOpen]\n )\n\n useEffect(() => {\n if (!open) return\n requestAnimationFrame(() => focusItem(activeIndex))\n }, [open, activeIndex, focusItem])\n\n const move = useCallback(\n (dir: 1 | -1) => {\n const next = findNextEnabled(activeIndex, dir, itemCount, isDisabled)\n setActiveIndex(next)\n requestAnimationFrame(() => focusItem(next))\n },\n [activeIndex, itemCount, isDisabled, focusItem]\n )\n\n const activate = useCallback(() => {\n const meta = makeMeta(activeIndex)\n if (meta.disabled) return\n meta.onActivate?.()\n }, [activeIndex, makeMeta])\n\n const onListKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (!open) return\n\n switch (e.key) {\n case 'Tab': {\n // ✅ fecha e deixa o browser focar o próximo\n // (e NÃO restaura foco pro trigger)\n onCloseByTab?.()\n setOpen(false)\n return\n }\n\n case 'ArrowDown':\n e.preventDefault()\n move(+1)\n return\n\n case 'ArrowUp':\n e.preventDefault()\n move(-1)\n return\n\n case 'Home': {\n e.preventDefault()\n const first = findFirstEnabled(itemCount, isDisabled)\n setActiveIndex(first)\n requestAnimationFrame(() => focusItem(first))\n return\n }\n\n case 'End': {\n e.preventDefault()\n let last = itemCount - 1\n for (let i = itemCount - 1; i >= 0; i--) {\n if (!isDisabled(i)) {\n last = i\n break\n }\n }\n setActiveIndex(last)\n requestAnimationFrame(() => focusItem(last))\n return\n }\n\n case 'Enter':\n case ' ': {\n e.preventDefault()\n activate()\n return\n }\n\n case 'Escape':\n e.preventDefault()\n setOpen(false)\n return\n\n case 'ArrowRight': {\n e.preventDefault()\n const meta = makeMeta(activeIndex)\n if (meta.hasChildren) meta.onOpenChildren?.()\n return\n }\n\n case 'ArrowLeft': {\n e.preventDefault()\n const meta = makeMeta(activeIndex)\n meta.onCloseChildren?.()\n return\n }\n }\n },\n [\n open,\n itemCount,\n activeIndex,\n move,\n setOpen,\n activate,\n makeMeta,\n focusItem,\n isDisabled,\n onCloseByTab\n ]\n )\n\n const getTriggerProps = useCallback(() => {\n return {\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'ArrowDown') {\n e.preventDefault()\n if (!open) openAndFocus()\n return\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault()\n if (!open) openAndFocus(itemCount > 0 ? itemCount - 1 : 0)\n }\n }\n }\n }, [open, openAndFocus, itemCount])\n\n const getListProps = useCallback(() => {\n return {\n ref: (el: HTMLElement | null) => {\n listRef.current = el\n },\n onKeyDown: onListKeyDown\n }\n }, [onListKeyDown])\n\n const getItemProps = useCallback(\n (index: number) => {\n const isActive = index === activeIndex\n return {\n ref: (el: HTMLButtonElement | null) => {\n itemRefs.current[index] = el\n },\n tabIndex: isActive ? 0 : -1,\n 'data-active': isActive ? 'true' : 'false'\n } as const\n },\n [activeIndex]\n )\n\n return {\n activeIndex,\n getListProps,\n getItemProps,\n openAndFocus,\n setActiveIndex,\n getTriggerProps\n }\n}\n","// External Libraries\nimport { useState } from 'react'\n\n// Types\nimport type { SelectProps } from '../../types'\nimport { useCompositeListNavigation } from '@hooks/useCompositeListNavigation'\n\nexport function useSelect({\n value,\n options,\n multiple,\n disabled,\n canClear,\n onChange\n}: SelectProps) {\n // States\n const [open, setOpen] = useState(false)\n\n // Hooks\n const nav = useCompositeListNavigation({\n open,\n itemCount: options.length,\n setOpen: changeOpen,\n makeMeta: makeMeta\n })\n\n // Functions\n function handleOptionClick(option: string) {\n const isAlreadySelected = value.includes(option)\n\n if (!multiple) {\n if (isAlreadySelected) {\n if (canClear) onChange([])\n } else onChange([option])\n\n setOpen(false)\n return\n }\n\n if (isAlreadySelected) {\n if (value.length === 1) {\n if (canClear) onChange([])\n } else onChange(value.filter(v => v !== option))\n } else onChange([...value, option])\n }\n\n function makeMeta(index: number) {\n const opt = options[index]\n return {\n onActivate: () => {\n if (opt) handleOptionClick(opt.value)\n }\n }\n }\n\n function changeOpen(value: boolean) {\n setOpen(value)\n }\n\n function togglePanel() {\n if (disabled) return\n if (!open) nav.openAndFocus()\n }\n\n function closePanel() {\n setOpen(false)\n }\n\n return {\n nav,\n open,\n makeMeta,\n changeOpen,\n togglePanel,\n closePanel,\n handleOptionClick\n }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { SelectProps } from './types'\n\nexport function createSelectStyles(props: SelectProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n position: 'relative',\n\n rowGap: '0.375rem'\n },\n\n content: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n\n borderWidth: 1,\n columnGap: '0.25rem',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n\n opacity: props.disabled ? 0.5 : 1,\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n boxShadow: 'var(--px-shadow-default)',\n borderColor: props.errorMessage\n ? 'var(--px-color-error)'\n : 'var(--px-border-primary)',\n\n __rules: {\n '&:focus-within': {\n outlineOffset: '-1px !important',\n outline: `2px solid var(${props.errorMessage ? '--px-color-error' : '--px-color-primary'}) !important`\n }\n }\n },\n\n text: {\n flex: 1,\n\n textAlign: 'left',\n\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n\n fontSize: '1rem',\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n fontWeight: props.value.length ? 500 : 400,\n color: props.value.length\n ? 'var(--px-text-primary)'\n : 'var(--px-text-secondary)'\n },\n\n error: {\n display: 'block',\n fontWeight: 400,\n lineHeight: '1rem',\n fontSize: '0.75rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-error)'\n },\n\n panel: {\n width: '100%'\n }\n })\n}\n","import type {\n StylesOf,\n TextProps,\n LayoutProps,\n MarginProps\n} from '@hooks/useThemedStyles/types'\nimport type { createSelectStyles } from './styles'\nimport type { FloatingOptions } from '@hooks/useFloating/types'\nimport type { PopoverProps } from '@components/commons/toolkit/Popover/types'\n\nexport interface SelectProps extends LayoutProps, MarginProps {\n label: string\n value: string[]\n placeholder?: string\n options: SelectOption[]\n\n portalId?: PopoverProps['portalId']\n strategy?: FloatingOptions['strategy']\n scrollContainerId?: FloatingOptions['scrollContainerId']\n absoluteReference?: FloatingOptions['absoluteReference']\n\n canClear?: boolean\n multiple?: boolean\n required?: boolean\n disabled?: boolean\n hideLabel?: boolean\n errorMessage?: string\n maxVisibleItems?: number\n\n startIcon?: React.ReactNode\n styles?: StylesOf<typeof createSelectStyles>\n\n requiredColor?: string\n labelConfig?: TextProps\n\n onChange: (value: string[]) => void\n}\n\nexport interface SelectOption {\n label: string\n value: string\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: It's a custom select component */\n// External Libraries\nimport type React from 'react'\nimport { useMemo } from 'react'\n\n// Components\nimport { OptionItem } from './components/OptionItem'\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { Label } from '@components/commons/toolkit/Label'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\n\n// Hooks\nimport { useSelect } from './hooks/useSelect'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { SelectProps } from './types'\nimport type { PopoverTriggerRenderProps } from '@components/commons/toolkit/Popover/types'\n\n// Styles\nimport { createSelectStyles } from './styles'\n\nexport * as SelectTypes from './types'\n\nexport const Select: React.FC<SelectProps> = props => {\n const { nav, open, changeOpen, handleOptionClick } = useSelect(props)\n const { styles, classes } = useThemedStyles(props, createSelectStyles, {\n pick: p => [p.disabled, p.errorMessage, p.value],\n override: props.styles,\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n const maxVisible = props.maxVisibleItems ?? Infinity\n const optionsMap = useMemo(\n () => new Map(props.options.map(option => [option.value, option.label])),\n [props.options]\n )\n\n // Functions\n function renderContent() {\n if (!props.value?.length) return props.placeholder\n\n const resolvedValues = props.value.map(val => optionsMap.get(val) ?? val)\n const visibleItems = resolvedValues.slice(0, maxVisible)\n const hiddenCount = resolvedValues.length - visibleItems.length\n\n let result = visibleItems.join(', ')\n if (hiddenCount > 0) result += ` +${hiddenCount}`\n return result\n }\n\n function renderTrigger({\n ref,\n ariaExpanded,\n onClick\n }: PopoverTriggerRenderProps) {\n const triggerKeyProps = nav.getTriggerProps()\n\n return (\n <button\n ref={ref as any}\n dir=\"ltr\"\n type=\"button\"\n role=\"combobox\"\n style={styles.content}\n aria-autocomplete=\"none\"\n aria-label={props.label}\n className={classes.content}\n aria-expanded={ariaExpanded}\n disabled={props.disabled}\n {...triggerKeyProps}\n onClick={onClick}\n >\n {props.value.length ? props.startIcon : null}\n\n <span id=\"text-content\" style={styles.text}>\n {renderContent()}\n </span>\n\n <Icon size=\"sm\" name=\"chevrons-down\" />\n </button>\n )\n }\n\n return (\n <div style={styles.container}>\n {props.hideLabel ? null : (\n <Label\n label={props.label}\n required={props.required}\n requiredColor={props.requiredColor}\n {...props.labelConfig}\n />\n )}\n\n <BasePopover\n open={open}\n portalId={props.portalId}\n absoluteReference={props.absoluteReference}\n floatingOptions={{\n viewportMargin: 0,\n strategy: props.strategy,\n scrollContainerId: props.scrollContainerId\n }}\n trigger={renderTrigger}\n onOpenChange={changeOpen}\n >\n <div style={styles.panel} role=\"listbox\" {...nav.getListProps()}>\n {props.options.map((option, idx) => (\n <OptionItem\n key={option.value}\n option={option}\n onClick={handleOptionClick}\n isSelected={props.value.includes(option.value)}\n {...nav.getItemProps(idx)}\n />\n ))}\n </div>\n </BasePopover>\n\n {props.errorMessage ? (\n <span style={styles.error}>{props.errorMessage}</span>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAGA,SAAgB,oBACd,OACA;CACA,MAAM,EAAE,eAAe;CACvB,MAAM,WAAW,MAAM,mBAAmB;AAG1C,QAAO,OAAO;EACZ,WAAW;GACT,OAAO;GAEP,SAAS;GACT,YAAY;GACZ,WAAW;GAEX,cAAc;GACd,SAAS;GAET,QAAQ;GACR,YAAY;GAE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MAAM,kBAAkB,IAAI,iBAAiB;AAE7C,SACE,qBAAC;GACM;GACL,KAAI;GACJ,MAAK;GACL,MAAK;GACL,OAAO,OAAO;GACd,qBAAkB;GAClB,cAAY,MAAM;GAClB,WAAW,QAAQ;GACnB,iBAAe;GACf,UAAU,MAAM;GAChB,GAAI;GACK;;IAER,MAAM,MAAM,SAAS,MAAM,YAAY;IAExC,oBAAC;KAAK,IAAG;KAAe,OAAO,OAAO;eACnC,eAAe;MACX;IAEP,oBAAC;KAAK,MAAK;KAAK,MAAK;MAAkB;;IAChC;;AAIb,QACE,qBAAC;EAAI,OAAO,OAAO;;GAChB,MAAM,YAAY,OACjB,oBAAC;IACC,OAAO,MAAM;IACb,UAAU,MAAM;IAChB,eAAe,MAAM;IACrB,GAAI,MAAM;KACV;GAGJ,oBAAC;IACO;IACN,UAAU,MAAM;IAChB,mBAAmB,MAAM;IACzB,iBAAiB;KACf,gBAAgB;KAChB,UAAU,MAAM;KAChB,mBAAmB,MAAM;KAC1B;IACD,SAAS;IACT,cAAc;cAEd,oBAAC;KAAI,OAAO,OAAO;KAAO,MAAK;KAAU,GAAI,IAAI,cAAc;eAC5D,MAAM,QAAQ,KAAK,QAAQ,QAC1B,oBAAC;MAES;MACR,SAAS;MACT,YAAY,MAAM,MAAM,SAAS,OAAO,MAAM;MAC9C,GAAI,IAAI,aAAa,IAAI;QAJpB,OAAO,MAKZ,CACF;MACE;KACM;GAEb,MAAM,eACL,oBAAC;IAAK,OAAO,OAAO;cAAQ,MAAM;KAAoB,GACpD;;GACA"}
|
package/dist/base-popover.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { t as BasePopover } from "./index-
|
|
1
|
+
import "./types-Bayf6NdC.js";
|
|
2
|
+
import "./index-B6t8KE4A.js";
|
|
3
|
+
import { t as BasePopover } from "./index-CYnINkUh.js";
|
|
4
4
|
export { BasePopover };
|
package/dist/base-popover.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./useThemedStyles-CrarDyWc.js";
|
|
2
|
-
import "./useDismiss-
|
|
3
|
-
import "./useFloating-
|
|
4
|
-
import "./Popover-
|
|
5
|
-
import { t as BasePopover } from "./BasePopover-
|
|
2
|
+
import "./useDismiss-DwQfMU11.js";
|
|
3
|
+
import "./useFloating-DCxblHIR.js";
|
|
4
|
+
import "./Popover-CNon8bZo.js";
|
|
5
|
+
import { t as BasePopover } from "./BasePopover-CES18mzR.js";
|
|
6
6
|
|
|
7
7
|
export { BasePopover };
|
package/dist/button.d.ts
CHANGED
package/dist/context-menu.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./useThemedStyles-CrarDyWc.js";
|
|
2
2
|
import "./Switch-DJNZbvzy.js";
|
|
3
|
-
import "./useDismiss-
|
|
4
|
-
import "./useFloating-
|
|
5
|
-
import "./Popover-
|
|
3
|
+
import "./useDismiss-DwQfMU11.js";
|
|
4
|
+
import "./useFloating-DCxblHIR.js";
|
|
5
|
+
import "./Popover-CNon8bZo.js";
|
|
6
6
|
import "./Typography-BkFV7BhK.js";
|
|
7
|
-
import
|
|
8
|
-
import "./
|
|
7
|
+
import "./BasePopover-CES18mzR.js";
|
|
8
|
+
import { n as types_exports, t as ContextMenu } from "./ContextMenu-D7lPQcw1.js";
|
|
9
9
|
|
|
10
10
|
export { ContextMenu, types_exports as ContextMenuTypes };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { t as PopoverProps } from "./types-
|
|
1
|
+
import { t as PopoverProps } from "./types-Bayf6NdC.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/commons/toolkit/Popover/index.d.ts
|
|
5
|
-
|
|
6
5
|
declare const Popover: React.FC<PopoverProps>;
|
|
7
6
|
//#endregion
|
|
8
7
|
export { Popover as t };
|
|
9
|
-
//# sourceMappingURL=index-
|
|
8
|
+
//# sourceMappingURL=index-B6t8KE4A.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as CommonStyleProps } from "./styleProps-CWZn-ouw.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/commons/toolkit/TabSwitch/styles.d.ts
|
|
6
6
|
declare function createTabSwitchStyles<T>(props: TabSwitchProps<T>): {
|
|
@@ -41,7 +41,7 @@ interface TabSwitchProps<T> extends CommonStyleProps {
|
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/components/commons/toolkit/TabSwitch/index.d.ts
|
|
44
|
-
declare const TabSwitch: <T>(props: TabSwitchProps<T>) =>
|
|
44
|
+
declare const TabSwitch: <T>(props: TabSwitchProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { SwitchOption as n, TabSwitchProps as r, TabSwitch as t };
|
|
47
|
-
//# sourceMappingURL=index-
|
|
47
|
+
//# sourceMappingURL=index-CK68mp8m.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as TextProps, n as LayoutProps, r as MarginProps } from "./styleProps-CWZn-ouw.js";
|
|
2
2
|
import { n as StylesOf } from "./useThemedStyles-BUR6rDGs.js";
|
|
3
3
|
import { t as FloatingOptions } from "./types-BIJRqScJ.js";
|
|
4
|
-
import { t as PopoverProps } from "./types-
|
|
4
|
+
import { t as PopoverProps } from "./types-Bayf6NdC.js";
|
|
5
5
|
import React$1 from "react";
|
|
6
6
|
|
|
7
7
|
//#region src/components/commons/inputs/Select/styles.d.ts
|
|
@@ -91,4 +91,4 @@ interface SelectOption {
|
|
|
91
91
|
declare const Select: React$1.FC<SelectProps>;
|
|
92
92
|
//#endregion
|
|
93
93
|
export { types_d_exports as n, Select as t };
|
|
94
|
-
//# sourceMappingURL=index-
|
|
94
|
+
//# sourceMappingURL=index-CPoGZ0_L.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PopoverProps } from "./types-
|
|
1
|
+
import { t as PopoverProps } from "./types-Bayf6NdC.js";
|
|
2
2
|
import React, { PropsWithChildren } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/commons/structure/BasePopover/types.d.ts
|
|
@@ -19,4 +19,4 @@ interface BasePopoverProps extends Omit<PopoverProps, 'content' | 'hideShadow'>,
|
|
|
19
19
|
declare const BasePopover: React.FC<BasePopoverProps>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { BasePopover as t };
|
|
22
|
-
//# sourceMappingURL=index-
|
|
22
|
+
//# sourceMappingURL=index-CYnINkUh.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as PaddingProps } from "./styleProps-CWZn-ouw.js";
|
|
1
|
+
import { i as PaddingProps, n as LayoutProps } from "./styleProps-CWZn-ouw.js";
|
|
2
2
|
import { r as TypeStyles } from "./useThemedStyles-BUR6rDGs.js";
|
|
3
3
|
import { n as TypographyVariant } from "./types-BM6zJmu5.js";
|
|
4
4
|
import React, { MouseEvent, ReactNode } from "react";
|
|
@@ -52,7 +52,7 @@ type Align = 'center' | 'left' | 'right';
|
|
|
52
52
|
type ButtonType = 'button' | 'submit' | 'reset';
|
|
53
53
|
type ButtonVariant = 'filled' | 'outlined' | 'ghost';
|
|
54
54
|
type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
55
|
-
interface ButtonProps extends PaddingProps {
|
|
55
|
+
interface ButtonProps extends PaddingProps, LayoutProps {
|
|
56
56
|
/** Text label displayed inside the button */
|
|
57
57
|
label: string;
|
|
58
58
|
/** Text variant of the button label */
|
|
@@ -115,4 +115,4 @@ interface ButtonProps extends PaddingProps {
|
|
|
115
115
|
declare const Button: React.FC<ButtonProps>;
|
|
116
116
|
//#endregion
|
|
117
117
|
export { Button as t };
|
|
118
|
-
//# sourceMappingURL=index-
|
|
118
|
+
//# sourceMappingURL=index-DUP_xS5q.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import "./types-BM6zJmu5.js";
|
|
2
|
-
import { t as Button } from "./index-
|
|
2
|
+
import { t as Button } from "./index-DUP_xS5q.js";
|
|
3
3
|
import { t as IconButton } from "./index-Chi8TU12.js";
|
|
4
4
|
import { t as Input } from "./index-Dp4TTO2D.js";
|
|
5
|
-
import { n as types_d_exports$2, t as Select } from "./index-
|
|
6
|
-
import { n as types_d_exports$1 } from "./types-
|
|
5
|
+
import { n as types_d_exports$2, t as Select } from "./index-CPoGZ0_L.js";
|
|
6
|
+
import { n as types_d_exports$1 } from "./types-Bayf6NdC.js";
|
|
7
7
|
import { t as TextArea } from "./index-Cl2z9ftU.js";
|
|
8
|
-
import { t as Popover } from "./index-
|
|
9
|
-
import { t as BasePopover } from "./index-
|
|
8
|
+
import { t as Popover } from "./index-B6t8KE4A.js";
|
|
9
|
+
import { t as BasePopover } from "./index-CYnINkUh.js";
|
|
10
10
|
import { t as CheckItem } from "./index-BeZYjWoj.js";
|
|
11
11
|
import { t as Checkbox } from "./index-BhxcqGNw.js";
|
|
12
12
|
import { n as types_d_exports, t as ContextMenu } from "./index-BY84CAyh.js";
|
|
13
13
|
import { InfoSummary, InfoSummaryItem, InfoSummaryProps } from "./info-summary.js";
|
|
14
14
|
import { t as Switch } from "./index-CEk3W9fj.js";
|
|
15
|
-
import { n as SwitchOption, r as TabSwitchProps, t as TabSwitch } from "./index-
|
|
15
|
+
import { n as SwitchOption, r as TabSwitchProps, t as TabSwitch } from "./index-CK68mp8m.js";
|
|
16
16
|
import { Typography } from "./typography.js";
|
|
17
17
|
import { a as ThemeName, c as ThemeRegistry, i as ThemeMode, l as ThemeTokens, n as useTheme, o as ThemePersistence, r as ThemeContextData, s as ThemeProviderProps, t as ThemeProvider } from "./index-BNPyjNve.js";
|
|
18
18
|
import { useDismiss } from "./use-dismiss.js";
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./useThemedStyles-CrarDyWc.js";
|
|
2
2
|
import { t as Switch } from "./Switch-DJNZbvzy.js";
|
|
3
|
-
import { t as useDismiss } from "./useDismiss-
|
|
4
|
-
import { t as useFloating } from "./useFloating-
|
|
5
|
-
import { n as types_exports$1, t as Popover } from "./Popover-
|
|
3
|
+
import { t as useDismiss } from "./useDismiss-DwQfMU11.js";
|
|
4
|
+
import { t as useFloating } from "./useFloating-DCxblHIR.js";
|
|
5
|
+
import { n as types_exports$1, t as Popover } from "./Popover-CNon8bZo.js";
|
|
6
6
|
import "./Icon-KzwFJI_k.js";
|
|
7
7
|
import { t as Typography } from "./Typography-BkFV7BhK.js";
|
|
8
8
|
import { t as Checkbox } from "./Checkbox-j9ZnSxT7.js";
|
|
@@ -10,14 +10,14 @@ import { n as useTheme, t as ThemeProvider } from "./ThemeContext-DhXvmWKO.js";
|
|
|
10
10
|
import { t as TabSwitch } from "./TabSwitch-DlXdgLPc.js";
|
|
11
11
|
import { t as CheckItem } from "./CheckItem-CJqWCE1W.js";
|
|
12
12
|
import { t as InfoSummary } from "./InfoSummary-Cf2ein9V.js";
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
13
|
+
import { t as BasePopover } from "./BasePopover-CES18mzR.js";
|
|
14
|
+
import { n as types_exports, t as ContextMenu } from "./ContextMenu-D7lPQcw1.js";
|
|
15
15
|
import { t as Button } from "./Button-Cbt1knrt.js";
|
|
16
16
|
import { t as IconButton } from "./IconButton-B_yAoSQR.js";
|
|
17
17
|
import "./Label-BHq2knad.js";
|
|
18
18
|
import "./MaskModule-DBNrJACG.js";
|
|
19
19
|
import { t as Input } from "./Input-7z9sFjK3.js";
|
|
20
|
-
import { n as types_exports$2, t as Select } from "./Select-
|
|
20
|
+
import { n as types_exports$2, t as Select } from "./Select-CGWL6BOg.js";
|
|
21
21
|
import { t as TextArea } from "./TextArea-DHUTFFOU.js";
|
|
22
22
|
import { useVirtualAnchor } from "./use-virtual-anchor.js";
|
|
23
23
|
|
package/dist/popover.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as types_d_exports } from "./types-
|
|
2
|
-
import { t as Popover } from "./index-
|
|
1
|
+
import { n as types_d_exports } from "./types-Bayf6NdC.js";
|
|
2
|
+
import { t as Popover } from "./index-B6t8KE4A.js";
|
|
3
3
|
export { Popover, types_d_exports as PopoverTypes };
|
package/dist/popover.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./useThemedStyles-CrarDyWc.js";
|
|
2
|
-
import "./useDismiss-
|
|
3
|
-
import "./useFloating-
|
|
4
|
-
import { n as types_exports, t as Popover } from "./Popover-
|
|
2
|
+
import "./useDismiss-DwQfMU11.js";
|
|
3
|
+
import "./useFloating-DCxblHIR.js";
|
|
4
|
+
import { n as types_exports, t as Popover } from "./Popover-CNon8bZo.js";
|
|
5
5
|
|
|
6
6
|
export { Popover, types_exports as PopoverTypes };
|
package/dist/select.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as types_d_exports, t as Select } from "./index-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { n as types_d_exports, t as Select } from "./index-CPoGZ0_L.js";
|
|
2
|
+
import "./types-Bayf6NdC.js";
|
|
3
3
|
export { Select, types_d_exports as SelectTypes };
|
package/dist/select.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./useThemedStyles-CrarDyWc.js";
|
|
2
|
-
import "./useDismiss-
|
|
3
|
-
import "./useFloating-
|
|
4
|
-
import "./Popover-
|
|
2
|
+
import "./useDismiss-DwQfMU11.js";
|
|
3
|
+
import "./useFloating-DCxblHIR.js";
|
|
4
|
+
import "./Popover-CNon8bZo.js";
|
|
5
5
|
import "./Icon-KzwFJI_k.js";
|
|
6
6
|
import "./Typography-BkFV7BhK.js";
|
|
7
|
-
import "./BasePopover-
|
|
7
|
+
import "./BasePopover-CES18mzR.js";
|
|
8
8
|
import "./Label-BHq2knad.js";
|
|
9
|
-
import { n as types_exports, t as Select } from "./Select-
|
|
9
|
+
import { n as types_exports, t as Select } from "./Select-CGWL6BOg.js";
|
|
10
10
|
|
|
11
11
|
export { Select, types_exports as SelectTypes };
|
package/dist/tab-switch.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SwitchOption, r as TabSwitchProps, t as TabSwitch } from "./index-
|
|
1
|
+
import { n as SwitchOption, r as TabSwitchProps, t as TabSwitch } from "./index-CK68mp8m.js";
|
|
2
2
|
export { SwitchOption, TabSwitch, TabSwitchProps };
|
|
@@ -22,23 +22,26 @@ declare function createPopoverStyles({
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
declare namespace types_d_exports {
|
|
25
|
-
export { PopoverProps, PopoverTriggerRenderProps };
|
|
25
|
+
export { CloseReason, PopoverProps, PopoverTriggerRenderProps };
|
|
26
26
|
}
|
|
27
27
|
type PopoverTriggerRenderProps = {
|
|
28
28
|
ariaExpanded: boolean;
|
|
29
29
|
ref: RefObject<HTMLElement>;
|
|
30
30
|
onClick: () => void;
|
|
31
31
|
};
|
|
32
|
+
type CloseReason = 'outside' | 'escape' | 'tab' | 'programmatic';
|
|
32
33
|
interface PopoverProps extends PaddingProps {
|
|
33
34
|
open?: boolean;
|
|
34
35
|
portalId?: string;
|
|
35
36
|
containerId?: string;
|
|
36
37
|
hideShadow?: boolean;
|
|
38
|
+
dismissScope?: string;
|
|
37
39
|
closeOnEscape?: boolean;
|
|
38
40
|
closeOnOutsideClick?: boolean;
|
|
39
41
|
floatingOptions?: FloatingOptions;
|
|
40
42
|
anchorRef?: RefObject<HTMLElement>;
|
|
41
43
|
absoluteReference?: FloatingOptions['absoluteReference'];
|
|
44
|
+
restoreFocusOnClose?: boolean;
|
|
42
45
|
onOpenChange?: (v: boolean) => void;
|
|
43
46
|
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
|
|
44
47
|
onMouseLeave?: MouseEventHandler<HTMLDivElement>;
|
|
@@ -51,4 +54,4 @@ interface PopoverProps extends PaddingProps {
|
|
|
51
54
|
}
|
|
52
55
|
//#endregion
|
|
53
56
|
export { types_d_exports as n, PopoverProps as t };
|
|
54
|
-
//# sourceMappingURL=types-
|
|
57
|
+
//# sourceMappingURL=types-Bayf6NdC.d.ts.map
|