@bolio-ui/core 3.0.0-alpha.1 → 3.0.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/dist/Alert/Alert.d.ts +20 -0
- package/dist/Alert/index.d.ts +3 -0
- package/dist/Alert/index.js +16 -0
- package/dist/BolioUIProvider/index.js +7 -6
- package/dist/Button/index.js +3 -3
- package/dist/ButtonDropdown/index.js +3 -2
- package/dist/Calendar/index.js +2 -2
- package/dist/Chip/Chip.d.ts +17 -0
- package/dist/Chip/ChipContext.d.ts +11 -0
- package/dist/Chip/ChipGroup.d.ts +16 -0
- package/dist/Chip/index.d.ts +9 -0
- package/dist/Chip/index.js +15 -0
- package/dist/ColorInput/index.js +3 -2
- package/dist/Combobox/index.js +3 -2
- package/dist/Command/index.js +9 -8
- package/dist/ContextMenu/index.js +5 -4
- package/dist/CssBaseline/index.js +2 -2
- package/dist/DatePicker/index.js +4 -3
- package/dist/DateRangePicker/index.js +4 -3
- package/dist/Drawer/index.js +6 -5
- package/dist/Grid/Grid.d.ts +16 -16
- package/dist/Grid/GridContainer.d.ts +16 -16
- package/dist/ImageZoom/ImageZoom.d.ts +14 -0
- package/dist/ImageZoom/index.d.ts +3 -0
- package/dist/ImageZoom/index.js +17 -0
- package/dist/Mention/Mention.d.ts +25 -0
- package/dist/Mention/index.d.ts +3 -0
- package/dist/Mention/index.js +17 -0
- package/dist/Menu/index.js +4 -3
- package/dist/Modal/index.js +8 -7
- package/dist/Note/Note.d.ts +10 -0
- package/dist/Note/index.js +3 -2
- package/dist/Popover/index.js +4 -3
- package/dist/Select/index.js +7 -6
- package/dist/Splitter/Splitter.d.ts +14 -0
- package/dist/Splitter/SplitterContext.d.ts +6 -0
- package/dist/Splitter/SplitterPanel.d.ts +13 -0
- package/dist/Splitter/index.d.ts +9 -0
- package/dist/Splitter/index.js +14 -0
- package/dist/Table/Table.d.ts +11 -1
- package/dist/Table/TableBody.d.ts +8 -2
- package/dist/Table/TableColumn.d.ts +2 -0
- package/dist/Table/TableHead.d.ts +9 -1
- package/dist/Table/TableSelectBox.d.ts +9 -0
- package/dist/Table/TableTypes.d.ts +8 -0
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +3 -3
- package/dist/Toolbar/Toolbar.d.ts +11 -0
- package/dist/Toolbar/ToolbarSeparator.d.ts +4 -0
- package/dist/Toolbar/index.d.ts +9 -0
- package/dist/Toolbar/index.js +14 -0
- package/dist/Tooltip/index.js +3 -2
- package/dist/Tour/Tour.d.ts +26 -0
- package/dist/Tour/index.d.ts +3 -0
- package/dist/Tour/index.js +24 -0
- package/dist/{chunk-PGQYW6YF.js → chunk-25NFUHLR.js} +12 -8
- package/dist/{chunk-AFBCMW2I.js → chunk-26KDVRFS.js} +1 -3
- package/dist/{chunk-4ZGR7UMX.js → chunk-4DH6SOK4.js} +10 -6
- package/dist/chunk-CGS2MT3G.js +10 -0
- package/dist/{chunk-6ZBFUZSL.js → chunk-CU6SNPIM.js} +25 -22
- package/dist/chunk-CY5KTINE.js +107 -0
- package/dist/{chunk-IJGIEX5J.js → chunk-DEMQXB46.js} +6 -2
- package/dist/{chunk-AVO2SK2I.js → chunk-DYYSUJ35.js} +2 -2
- package/dist/chunk-EUYSKHRS.js +13 -0
- package/dist/chunk-FFEAKF3A.js +220 -0
- package/dist/{chunk-XLPOECCE.js → chunk-FLUNRVVG.js} +12 -7
- package/dist/chunk-FQWH4PDK.js +165 -0
- package/dist/chunk-FSO65ZAH.js +249 -0
- package/dist/{chunk-2EYJZXS4.js → chunk-ICACLCJR.js} +13 -8
- package/dist/{chunk-XF4TPE2W.js → chunk-IL7L3BEL.js} +7 -2
- package/dist/{chunk-MGHMAZRL.js → chunk-KRSISARC.js} +7 -3
- package/dist/{chunk-4QA7Z7VP.js → chunk-M64V32WO.js} +6 -3
- package/dist/chunk-Q3I54DUS.js +131 -0
- package/dist/chunk-REWKR7S3.js +109 -0
- package/dist/{chunk-SGWX6H4Y.js → chunk-RWRFOGCU.js} +6 -2
- package/dist/chunk-SJVWKNGY.js +236 -0
- package/dist/{chunk-P245HSVB.js → chunk-TLVSZCKU.js} +2 -1
- package/dist/{chunk-AG2NWQYL.js → chunk-WCTANCLG.js} +3 -1
- package/dist/{chunk-TDJGMSGT.js → chunk-WIIDIZYK.js} +3 -1
- package/dist/{chunk-DIMJQLWY.js → chunk-XUNC7RB7.js} +9 -5
- package/dist/{chunk-GGCVPMXO.js → chunk-Y432C24Z.js} +2 -2
- package/dist/{chunk-TKICX5R6.js → chunk-Y5CFWIGV.js} +227 -35
- package/dist/{chunk-GYFW5NLU.js → chunk-YLLPYRJH.js} +34 -11
- package/dist/css/Alert.css +53 -0
- package/dist/css/ButtonDropdown-ButtonDropdownItem.css +0 -1
- package/dist/css/ButtonGroup.css +0 -1
- package/dist/css/Calendar.css +0 -1
- package/dist/css/Carousel.css +0 -1
- package/dist/css/Chip-ChipGroup.css +8 -0
- package/dist/css/Chip.css +65 -0
- package/dist/css/ColorInput.css +7 -3
- package/dist/css/ColorPicker.css +5 -4
- package/dist/css/Combobox.css +1 -2
- package/dist/css/DatePicker.css +1 -3
- package/dist/css/DateRangePicker.css +7 -3
- package/dist/css/Dropzone.css +0 -3
- package/dist/css/Fieldset-FieldsetGroup.css +0 -1
- package/dist/css/ImageZoom.css +93 -0
- package/dist/css/Input.css +1 -1
- package/dist/css/Mention.css +93 -0
- package/dist/css/Menu-MenuList.css +0 -1
- package/dist/css/Modal-ModalAction.css +6 -1
- package/dist/css/Modal-ModalActions.css +9 -2
- package/dist/css/NumberInput.css +1 -1
- package/dist/css/PinInput.css +1 -1
- package/dist/css/Radio.css +0 -1
- package/dist/css/SegmentedControl.css +0 -1
- package/dist/css/Select-SelectDropdown.css +0 -1
- package/dist/css/Select-SelectOption.css +0 -1
- package/dist/css/Select.css +0 -1
- package/dist/css/Splitter.css +77 -0
- package/dist/css/Table-TableBody.css +10 -0
- package/dist/css/Table-TableHead.css +41 -0
- package/dist/css/Table-TableSelectBox.css +11 -0
- package/dist/css/TagsInput.css +1 -2
- package/dist/css/Textarea.css +1 -1
- package/dist/css/Toggle.css +0 -1
- package/dist/css/Toolbar.css +32 -0
- package/dist/css/Tour.css +81 -0
- package/dist/css/use-toasts-toast-item.css +0 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +92 -62
- package/dist/styles.css +3571 -2997
- package/dist/utils/surface.d.ts +6 -0
- package/esm/Alert/Alert.d.ts +20 -0
- package/esm/Alert/index.d.ts +3 -0
- package/esm/Alert/index.js +16 -0
- package/esm/BolioUIProvider/index.js +6 -5
- package/esm/Button/index.js +2 -2
- package/esm/ButtonDropdown/index.js +2 -1
- package/esm/Calendar/index.js +1 -1
- package/esm/Chip/Chip.d.ts +17 -0
- package/esm/Chip/ChipContext.d.ts +11 -0
- package/esm/Chip/ChipGroup.d.ts +16 -0
- package/esm/Chip/index.d.ts +9 -0
- package/esm/Chip/index.js +15 -0
- package/esm/ColorInput/index.js +2 -1
- package/esm/Combobox/index.js +2 -1
- package/esm/Command/index.js +8 -7
- package/esm/ContextMenu/index.js +4 -3
- package/esm/CssBaseline/index.js +1 -1
- package/esm/DatePicker/index.js +3 -2
- package/esm/DateRangePicker/index.js +3 -2
- package/esm/Drawer/index.js +5 -4
- package/esm/Grid/Grid.d.ts +16 -16
- package/esm/Grid/GridContainer.d.ts +16 -16
- package/esm/ImageZoom/ImageZoom.d.ts +14 -0
- package/esm/ImageZoom/index.d.ts +3 -0
- package/esm/ImageZoom/index.js +17 -0
- package/esm/Mention/Mention.d.ts +25 -0
- package/esm/Mention/index.d.ts +3 -0
- package/esm/Mention/index.js +17 -0
- package/esm/Menu/index.js +3 -2
- package/esm/Modal/index.js +7 -6
- package/esm/Note/Note.d.ts +10 -0
- package/esm/Note/index.js +2 -1
- package/esm/Popover/index.js +3 -2
- package/esm/Select/index.js +6 -5
- package/esm/Splitter/Splitter.d.ts +14 -0
- package/esm/Splitter/SplitterContext.d.ts +6 -0
- package/esm/Splitter/SplitterPanel.d.ts +13 -0
- package/esm/Splitter/index.d.ts +9 -0
- package/esm/Splitter/index.js +14 -0
- package/esm/Table/Table.d.ts +11 -1
- package/esm/Table/TableBody.d.ts +8 -2
- package/esm/Table/TableColumn.d.ts +2 -0
- package/esm/Table/TableHead.d.ts +9 -1
- package/esm/Table/TableSelectBox.d.ts +9 -0
- package/esm/Table/TableTypes.d.ts +8 -0
- package/esm/Table/index.d.ts +1 -1
- package/esm/Table/index.js +2 -2
- package/esm/Toolbar/Toolbar.d.ts +11 -0
- package/esm/Toolbar/ToolbarSeparator.d.ts +4 -0
- package/esm/Toolbar/index.d.ts +9 -0
- package/esm/Toolbar/index.js +14 -0
- package/esm/Tooltip/index.js +2 -1
- package/esm/Tour/Tour.d.ts +26 -0
- package/esm/Tour/index.d.ts +3 -0
- package/esm/Tour/index.js +24 -0
- package/esm/{chunk-PGQYW6YF.js → chunk-25NFUHLR.js} +7 -3
- package/esm/{chunk-AFBCMW2I.js → chunk-26KDVRFS.js} +2 -4
- package/esm/{chunk-4ZGR7UMX.js → chunk-4DH6SOK4.js} +10 -6
- package/esm/chunk-CGS2MT3G.js +10 -0
- package/esm/{chunk-6ZBFUZSL.js → chunk-CU6SNPIM.js} +15 -12
- package/esm/chunk-CY5KTINE.js +107 -0
- package/esm/{chunk-IJGIEX5J.js → chunk-DEMQXB46.js} +6 -2
- package/esm/{chunk-AVO2SK2I.js → chunk-DYYSUJ35.js} +1 -1
- package/esm/chunk-EUYSKHRS.js +13 -0
- package/esm/chunk-FFEAKF3A.js +220 -0
- package/esm/{chunk-XLPOECCE.js → chunk-FLUNRVVG.js} +11 -6
- package/esm/chunk-FQWH4PDK.js +165 -0
- package/esm/chunk-FSO65ZAH.js +249 -0
- package/esm/{chunk-2EYJZXS4.js → chunk-ICACLCJR.js} +8 -3
- package/esm/{chunk-XF4TPE2W.js → chunk-IL7L3BEL.js} +7 -2
- package/esm/{chunk-MGHMAZRL.js → chunk-KRSISARC.js} +7 -3
- package/esm/{chunk-4QA7Z7VP.js → chunk-M64V32WO.js} +5 -2
- package/esm/chunk-Q3I54DUS.js +131 -0
- package/esm/chunk-REWKR7S3.js +109 -0
- package/esm/{chunk-SGWX6H4Y.js → chunk-RWRFOGCU.js} +6 -2
- package/esm/chunk-SJVWKNGY.js +236 -0
- package/esm/{chunk-P245HSVB.js → chunk-TLVSZCKU.js} +2 -1
- package/esm/{chunk-AG2NWQYL.js → chunk-WCTANCLG.js} +3 -1
- package/esm/{chunk-TDJGMSGT.js → chunk-WIIDIZYK.js} +3 -1
- package/esm/{chunk-DIMJQLWY.js → chunk-XUNC7RB7.js} +9 -5
- package/esm/{chunk-GGCVPMXO.js → chunk-Y432C24Z.js} +1 -1
- package/esm/chunk-Y5CFWIGV.js +543 -0
- package/esm/{chunk-GYFW5NLU.js → chunk-YLLPYRJH.js} +30 -7
- package/esm/css/Alert.css +53 -0
- package/esm/css/ButtonDropdown-ButtonDropdownItem.css +0 -1
- package/esm/css/ButtonGroup.css +0 -1
- package/esm/css/Calendar.css +0 -1
- package/esm/css/Carousel.css +0 -1
- package/esm/css/Chip-ChipGroup.css +8 -0
- package/esm/css/Chip.css +65 -0
- package/esm/css/ColorInput.css +7 -3
- package/esm/css/ColorPicker.css +5 -4
- package/esm/css/Combobox.css +1 -2
- package/esm/css/DatePicker.css +1 -3
- package/esm/css/DateRangePicker.css +7 -3
- package/esm/css/Dropzone.css +0 -3
- package/esm/css/Fieldset-FieldsetGroup.css +0 -1
- package/esm/css/ImageZoom.css +93 -0
- package/esm/css/Input.css +1 -1
- package/esm/css/Mention.css +93 -0
- package/esm/css/Menu-MenuList.css +0 -1
- package/esm/css/Modal-ModalAction.css +6 -1
- package/esm/css/Modal-ModalActions.css +9 -2
- package/esm/css/NumberInput.css +1 -1
- package/esm/css/PinInput.css +1 -1
- package/esm/css/Radio.css +0 -1
- package/esm/css/SegmentedControl.css +0 -1
- package/esm/css/Select-SelectDropdown.css +0 -1
- package/esm/css/Select-SelectOption.css +0 -1
- package/esm/css/Select.css +0 -1
- package/esm/css/Splitter.css +77 -0
- package/esm/css/Table-TableBody.css +10 -0
- package/esm/css/Table-TableHead.css +41 -0
- package/esm/css/Table-TableSelectBox.css +11 -0
- package/esm/css/TagsInput.css +1 -2
- package/esm/css/Textarea.css +1 -1
- package/esm/css/Toggle.css +0 -1
- package/esm/css/Toolbar.css +32 -0
- package/esm/css/Tour.css +81 -0
- package/esm/css/use-toasts-toast-item.css +0 -1
- package/esm/index.d.ts +15 -1
- package/esm/index.js +109 -79
- package/esm/styles.css +3206 -2632
- package/esm/utils/surface.d.ts +6 -0
- package/package.json +1 -1
- package/esm/chunk-TKICX5R6.js +0 -351
- package/dist/{chunk-DXHNQANX.js → chunk-TPZUTHTQ.js} +3 -3
- package/dist/{chunk-TKIUVNKP.js → chunk-XKJDF225.js} +2 -2
- package/esm/{chunk-DXHNQANX.js → chunk-TPZUTHTQ.js} +3 -3
- package/esm/{chunk-TKIUVNKP.js → chunk-XKJDF225.js} +3 -3
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import {
|
|
2
|
+
log_warning_default
|
|
3
|
+
} from "./chunk-AXYDJGTN.js";
|
|
4
|
+
import {
|
|
5
|
+
use_portal_default
|
|
6
|
+
} from "./chunk-BXDUHMWS.js";
|
|
7
|
+
import {
|
|
8
|
+
use_latest_default
|
|
9
|
+
} from "./chunk-ZRORQ2WH.js";
|
|
10
|
+
import {
|
|
11
|
+
Button_default
|
|
12
|
+
} from "./chunk-TPZUTHTQ.js";
|
|
13
|
+
import {
|
|
14
|
+
getSurface
|
|
15
|
+
} from "./chunk-EUYSKHRS.js";
|
|
16
|
+
import {
|
|
17
|
+
use_theme_default
|
|
18
|
+
} from "./chunk-V5I4ORQQ.js";
|
|
19
|
+
import {
|
|
20
|
+
joinClasses
|
|
21
|
+
} from "./chunk-5KUROAEP.js";
|
|
22
|
+
|
|
23
|
+
// core/Tour/Tour.tsx
|
|
24
|
+
import React, { useEffect, useId, useRef, useState } from "react";
|
|
25
|
+
import { createPortal } from "react-dom";
|
|
26
|
+
|
|
27
|
+
// css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Tour/Tour.module.css.bolio-css-module-source
|
|
28
|
+
var Tour_module_css_default = { "tour": "Tour-module_tour__FLAxG", "spotlight": "Tour-module_spotlight__o7ukV", "dim": "Tour-module_dim__ZPmGZ", "card": "Tour-module_card__p9LCI", "centered": "Tour-module_centered__KJvbZ", "count": "Tour-module_count__2K7-G", "title": "Tour-module_title__Z-spV", "content": "Tour-module_content__qLvnb", "actions": "Tour-module_actions__HKbHi", "spacer": "Tour-module_spacer__dkdPy" };
|
|
29
|
+
|
|
30
|
+
// core/Tour/Tour.tsx
|
|
31
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
32
|
+
var CARD_WIDTH = 320;
|
|
33
|
+
var MARGIN = 8;
|
|
34
|
+
var GAP = 8;
|
|
35
|
+
var ROOM_BELOW = 240;
|
|
36
|
+
var resolve = (target) => !target ? null : typeof target === "string" ? document.querySelector(target) : typeof target === "function" ? target() : target;
|
|
37
|
+
var Tour = React.forwardRef(
|
|
38
|
+
({
|
|
39
|
+
steps,
|
|
40
|
+
open,
|
|
41
|
+
onClose,
|
|
42
|
+
current: customCurrent,
|
|
43
|
+
initialCurrent = 0,
|
|
44
|
+
onCurrentChange,
|
|
45
|
+
onFinish,
|
|
46
|
+
previousLabel = "Back",
|
|
47
|
+
nextLabel = "Next",
|
|
48
|
+
finishLabel = "Done",
|
|
49
|
+
skipLabel = "Skip",
|
|
50
|
+
stepLabel = (index, count) => `${index + 1} of ${count}`,
|
|
51
|
+
spotlightPadding = 6,
|
|
52
|
+
className = "",
|
|
53
|
+
style,
|
|
54
|
+
onKeyDown,
|
|
55
|
+
...props
|
|
56
|
+
}, ref) => {
|
|
57
|
+
const theme = use_theme_default();
|
|
58
|
+
const portal = use_portal_default("tour");
|
|
59
|
+
const id = useId();
|
|
60
|
+
const [selfCurrent, setSelfCurrent] = useState(initialCurrent);
|
|
61
|
+
const current = Math.max(
|
|
62
|
+
0,
|
|
63
|
+
Math.min(customCurrent != null ? customCurrent : selfCurrent, steps.length - 1)
|
|
64
|
+
);
|
|
65
|
+
const step = steps[current];
|
|
66
|
+
const last = current === steps.length - 1;
|
|
67
|
+
const [rect, setRect] = useState(null);
|
|
68
|
+
const card = useRef(null);
|
|
69
|
+
const previous = useRef(null);
|
|
70
|
+
const latestSteps = use_latest_default(steps);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
const target = (_a = latestSteps.current[current]) == null ? void 0 : _a.target;
|
|
74
|
+
if (!open) return;
|
|
75
|
+
const element = resolve(target);
|
|
76
|
+
if (!element) {
|
|
77
|
+
if (target) log_warning_default("The target of the step was not found.", "Tour");
|
|
78
|
+
setRect(null);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
(_b = element.scrollIntoView) == null ? void 0 : _b.call(element, { block: "center", inline: "nearest" });
|
|
82
|
+
const update = () => setRect(element.getBoundingClientRect());
|
|
83
|
+
update();
|
|
84
|
+
window.addEventListener("resize", update);
|
|
85
|
+
window.addEventListener("scroll", update, true);
|
|
86
|
+
return () => {
|
|
87
|
+
window.removeEventListener("resize", update);
|
|
88
|
+
window.removeEventListener("scroll", update, true);
|
|
89
|
+
};
|
|
90
|
+
}, [open, current, latestSteps]);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (!open) return;
|
|
93
|
+
previous.current = document.activeElement;
|
|
94
|
+
return () => {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
return (_b = (_a = previous.current) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
97
|
+
};
|
|
98
|
+
}, [open]);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
var _a;
|
|
101
|
+
if (open && portal) (_a = card.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
102
|
+
}, [open, current, portal]);
|
|
103
|
+
if (!open || !step || !portal) return null;
|
|
104
|
+
const go = (next) => {
|
|
105
|
+
if (customCurrent === void 0) setSelfCurrent(next);
|
|
106
|
+
if (onCurrentChange) onCurrentChange(next);
|
|
107
|
+
};
|
|
108
|
+
const finish = () => {
|
|
109
|
+
if (onFinish) onFinish();
|
|
110
|
+
onClose();
|
|
111
|
+
};
|
|
112
|
+
const keyDownHandler = (event) => {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
if (onKeyDown) onKeyDown(event);
|
|
115
|
+
if (event.key === "Escape") {
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
return onClose();
|
|
118
|
+
}
|
|
119
|
+
if (event.key !== "Tab") return;
|
|
120
|
+
const buttons = Array.from(
|
|
121
|
+
(_b = (_a = card.current) == null ? void 0 : _a.querySelectorAll("button")) != null ? _b : []
|
|
122
|
+
);
|
|
123
|
+
const [first, end] = [buttons[0], buttons[buttons.length - 1]];
|
|
124
|
+
const onCard = document.activeElement === card.current;
|
|
125
|
+
if (!first) return;
|
|
126
|
+
if (event.shiftKey && (onCard || document.activeElement === first)) {
|
|
127
|
+
event.preventDefault();
|
|
128
|
+
end.focus();
|
|
129
|
+
} else if (!event.shiftKey && (onCard || document.activeElement === end)) {
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
first.focus();
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const width = Math.min(CARD_WIDTH, window.innerWidth - 2 * MARGIN);
|
|
135
|
+
const room = rect ? window.innerHeight - rect.bottom : 0;
|
|
136
|
+
const above = Boolean(rect && room < ROOM_BELOW && rect.top > room);
|
|
137
|
+
const cardStyle = rect ? {
|
|
138
|
+
width,
|
|
139
|
+
left: Math.max(
|
|
140
|
+
MARGIN,
|
|
141
|
+
Math.min(rect.left, window.innerWidth - width - MARGIN)
|
|
142
|
+
),
|
|
143
|
+
...above ? { bottom: window.innerHeight - rect.top + spotlightPadding + GAP } : { top: rect.bottom + spotlightPadding + GAP }
|
|
144
|
+
} : { width };
|
|
145
|
+
const dark = theme.type === "dark";
|
|
146
|
+
const surface = getSurface(theme);
|
|
147
|
+
const tourStyle = {
|
|
148
|
+
"--tour-color": theme.palette.foreground,
|
|
149
|
+
"--tour-muted": theme.palette.accents_5,
|
|
150
|
+
"--tour-radius": theme.layout.radius,
|
|
151
|
+
"--tour-bg": surface.bg,
|
|
152
|
+
"--tour-shadow": surface.shadow,
|
|
153
|
+
"--tour-dim": dark ? "rgb(0 0 0 / 60%)" : "rgb(0 0 0 / 55%)",
|
|
154
|
+
...style
|
|
155
|
+
};
|
|
156
|
+
return createPortal(
|
|
157
|
+
/* @__PURE__ */ jsxs(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
ref,
|
|
161
|
+
className: joinClasses(Tour_module_css_default.tour, className),
|
|
162
|
+
...props,
|
|
163
|
+
style: tourStyle,
|
|
164
|
+
onKeyDown: keyDownHandler,
|
|
165
|
+
children: [
|
|
166
|
+
rect ? /* @__PURE__ */ jsx(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
className: Tour_module_css_default.spotlight,
|
|
170
|
+
style: {
|
|
171
|
+
left: rect.left - spotlightPadding,
|
|
172
|
+
top: rect.top - spotlightPadding,
|
|
173
|
+
width: rect.width + 2 * spotlightPadding,
|
|
174
|
+
height: rect.height + 2 * spotlightPadding
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
) : /* @__PURE__ */ jsx("div", { className: Tour_module_css_default.dim }),
|
|
178
|
+
/* @__PURE__ */ jsxs(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
ref: card,
|
|
182
|
+
role: "dialog",
|
|
183
|
+
"aria-modal": "true",
|
|
184
|
+
"aria-labelledby": `${id}-title`,
|
|
185
|
+
"aria-describedby": `${id}-content`,
|
|
186
|
+
tabIndex: -1,
|
|
187
|
+
className: joinClasses(Tour_module_css_default.card, { [Tour_module_css_default.centered]: !rect }),
|
|
188
|
+
style: cardStyle,
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ jsx("div", { className: Tour_module_css_default.count, children: stepLabel(current, steps.length) }),
|
|
191
|
+
/* @__PURE__ */ jsx("div", { id: `${id}-title`, className: Tour_module_css_default.title, children: step.title }),
|
|
192
|
+
/* @__PURE__ */ jsx("div", { id: `${id}-content`, className: Tour_module_css_default.content, children: step.content }),
|
|
193
|
+
/* @__PURE__ */ jsxs("div", { className: Tour_module_css_default.actions, children: [
|
|
194
|
+
!last && /* @__PURE__ */ jsx(Button_default, { auto: true, scale: 0.75, effect: false, onClick: onClose, children: skipLabel }),
|
|
195
|
+
/* @__PURE__ */ jsx("span", { className: Tour_module_css_default.spacer }),
|
|
196
|
+
current > 0 && /* @__PURE__ */ jsx(
|
|
197
|
+
Button_default,
|
|
198
|
+
{
|
|
199
|
+
auto: true,
|
|
200
|
+
scale: 0.75,
|
|
201
|
+
effect: false,
|
|
202
|
+
onClick: () => go(current - 1),
|
|
203
|
+
children: previousLabel
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ jsx(
|
|
207
|
+
Button_default,
|
|
208
|
+
{
|
|
209
|
+
auto: true,
|
|
210
|
+
scale: 0.75,
|
|
211
|
+
type: "primary",
|
|
212
|
+
effect: false,
|
|
213
|
+
onClick: last ? finish : () => go(current + 1),
|
|
214
|
+
children: last ? finishLabel : nextLabel
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
] })
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
portal
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
Tour.displayName = "BolioUITour";
|
|
229
|
+
var Tour_default = Tour;
|
|
230
|
+
|
|
231
|
+
// core/Tour/index.ts
|
|
232
|
+
var Tour_default2 = Tour_default;
|
|
233
|
+
|
|
234
|
+
export {
|
|
235
|
+
Tour_default2 as Tour_default
|
|
236
|
+
};
|
|
@@ -273,7 +273,8 @@ var CalendarComponent = React.forwardRef(
|
|
|
273
273
|
"--calendar-margin-left": SCALES.ml(0),
|
|
274
274
|
"--calendar-weekday-color": theme.palette.accents_5,
|
|
275
275
|
"--calendar-radius": theme.layout.radius,
|
|
276
|
-
|
|
276
|
+
// a popup around the calendar (DatePicker) sets its own, lighter hover
|
|
277
|
+
"--calendar-hover-bg": `var(--calendar-popup-hover, ${theme.palette.accents_2})`,
|
|
277
278
|
"--calendar-focus-outline": theme.palette.primary,
|
|
278
279
|
"--calendar-disabled-color": theme.palette.accents_3,
|
|
279
280
|
"--calendar-today-border": theme.palette.accents_4,
|
|
@@ -83,7 +83,9 @@ var Dropdown = React.memo(
|
|
|
83
83
|
width: nativeWidth,
|
|
84
84
|
elementTop
|
|
85
85
|
} = getRefRect(parent, getPopupContainer);
|
|
86
|
-
setRect(
|
|
86
|
+
setRect(
|
|
87
|
+
(prev) => prev.top === top && prev.left === left && prev.right === right && prev.width === nativeWidth && prev.elementTop === elementTop ? prev : { top, left, right, width: nativeWidth, elementTop }
|
|
88
|
+
);
|
|
87
89
|
};
|
|
88
90
|
use_resize_default(updateRect);
|
|
89
91
|
use_click_anywhere_default(() => {
|
|
@@ -26,6 +26,9 @@ var CssBaseline = ({
|
|
|
26
26
|
font-size: 16px;
|
|
27
27
|
--bolioui-icons-background: ${theme.palette.background};
|
|
28
28
|
box-sizing: border-box;
|
|
29
|
+
/* the native parts of the page follow the theme: the clock of a time
|
|
30
|
+
field, the scrollbars and the pickers of the browser */
|
|
31
|
+
color-scheme: ${theme.type};
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
body {
|
|
@@ -53,7 +56,6 @@ var CssBaseline = ({
|
|
|
53
56
|
*:before,
|
|
54
57
|
*:after {
|
|
55
58
|
box-sizing: inherit;
|
|
56
|
-
text-rendering: geometricPrecision;
|
|
57
59
|
-webkit-tap-highlight-color: transparent;
|
|
58
60
|
}
|
|
59
61
|
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Grid_default
|
|
3
3
|
} from "./chunk-JFNYQSEZ.js";
|
|
4
|
-
import {
|
|
5
|
-
dropdown_default
|
|
6
|
-
} from "./chunk-AG2NWQYL.js";
|
|
7
4
|
import {
|
|
8
5
|
getColors
|
|
9
6
|
} from "./chunk-KBZEYKCZ.js";
|
|
7
|
+
import {
|
|
8
|
+
dropdown_default
|
|
9
|
+
} from "./chunk-WCTANCLG.js";
|
|
10
10
|
import {
|
|
11
11
|
log_warning_default
|
|
12
12
|
} from "./chunk-AXYDJGTN.js";
|
|
13
13
|
import {
|
|
14
14
|
use_current_state_default
|
|
15
15
|
} from "./chunk-33BUV2RX.js";
|
|
16
|
+
import {
|
|
17
|
+
getSurface
|
|
18
|
+
} from "./chunk-EUYSKHRS.js";
|
|
16
19
|
import {
|
|
17
20
|
use_scale_default,
|
|
18
21
|
with_scale_default
|
|
@@ -93,6 +96,7 @@ var SelectDropdown = React3.forwardRef(
|
|
|
93
96
|
getPopupContainer
|
|
94
97
|
}, dropdownRef) => {
|
|
95
98
|
const theme = use_theme_default();
|
|
99
|
+
const surface = getSurface(theme);
|
|
96
100
|
const internalDropdownRef = useRef(null);
|
|
97
101
|
const { ref } = useSelectContext();
|
|
98
102
|
const classes = use_classes_default(SelectDropdown_module_css_default.selectDropdown, className);
|
|
@@ -114,8 +118,8 @@ var SelectDropdown = React3.forwardRef(
|
|
|
114
118
|
className: classes,
|
|
115
119
|
style: {
|
|
116
120
|
"--select-dropdown-radius": theme.layout.radius,
|
|
117
|
-
"--select-dropdown-shadow":
|
|
118
|
-
"--select-dropdown-bg": colors.bgColor,
|
|
121
|
+
"--select-dropdown-shadow": surface.shadow,
|
|
122
|
+
"--select-dropdown-bg": colors.bgColor === theme.palette.background ? surface.bg : colors.bgColor,
|
|
119
123
|
"--select-dropdown-border": colors.borderColor,
|
|
120
124
|
"--select-dropdown-color": colors.color,
|
|
121
125
|
...dropdownStyle
|