@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,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getStatusColor
|
|
3
|
+
} from "./chunk-26KDVRFS.js";
|
|
4
|
+
import {
|
|
5
|
+
use_scale_default,
|
|
6
|
+
with_scale_default
|
|
7
|
+
} from "./chunk-MAICNLTY.js";
|
|
8
|
+
import {
|
|
9
|
+
use_theme_default
|
|
10
|
+
} from "./chunk-V5I4ORQQ.js";
|
|
11
|
+
import {
|
|
12
|
+
use_classes_default
|
|
13
|
+
} from "./chunk-5KUROAEP.js";
|
|
14
|
+
|
|
15
|
+
// core/Alert/Alert.tsx
|
|
16
|
+
import React, { useMemo } from "react";
|
|
17
|
+
|
|
18
|
+
// css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Alert/Alert.module.css.bolio-css-module-source
|
|
19
|
+
var Alert_module_css_default = { "alert": "Alert-module_alert__Ghxl7", "icon": "Alert-module_icon__hcZdu", "body": "Alert-module_body__SuUYD", "title": "Alert-module_title__8yipK", "close": "Alert-module_close__ZPg5d" };
|
|
20
|
+
|
|
21
|
+
// core/Alert/Alert.tsx
|
|
22
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
var AlertComponent = React.forwardRef(
|
|
24
|
+
({
|
|
25
|
+
children,
|
|
26
|
+
type = "default",
|
|
27
|
+
title,
|
|
28
|
+
icon,
|
|
29
|
+
filled = false,
|
|
30
|
+
light = false,
|
|
31
|
+
subtle = false,
|
|
32
|
+
onClose,
|
|
33
|
+
closeLabel = "Close",
|
|
34
|
+
className = "",
|
|
35
|
+
style,
|
|
36
|
+
...props
|
|
37
|
+
}, ref) => {
|
|
38
|
+
const theme = use_theme_default();
|
|
39
|
+
const { SCALES } = use_scale_default();
|
|
40
|
+
const { color, borderColor, bgColor } = useMemo(
|
|
41
|
+
() => getStatusColor(type, { filled, light, subtle }, theme),
|
|
42
|
+
[type, filled, light, subtle, theme]
|
|
43
|
+
);
|
|
44
|
+
const alertStyle = {
|
|
45
|
+
border: `1px solid ${borderColor}`,
|
|
46
|
+
color,
|
|
47
|
+
backgroundColor: bgColor,
|
|
48
|
+
borderRadius: theme.layout.radius,
|
|
49
|
+
fontSize: SCALES.font(0.875),
|
|
50
|
+
width: SCALES.width(1, "auto"),
|
|
51
|
+
height: SCALES.height(1, "auto"),
|
|
52
|
+
padding: `${SCALES.pt(0.75)} ${SCALES.pr(1)} ${SCALES.pb(0.75)} ${SCALES.pl(1)}`,
|
|
53
|
+
margin: `${SCALES.mt(0)} ${SCALES.mr(0)} ${SCALES.mb(0)} ${SCALES.ml(0)}`,
|
|
54
|
+
...style
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
ref,
|
|
60
|
+
role: type === "error" || type === "warning" ? "alert" : "status",
|
|
61
|
+
className: use_classes_default(Alert_module_css_default.alert, className),
|
|
62
|
+
...props,
|
|
63
|
+
style: alertStyle,
|
|
64
|
+
children: [
|
|
65
|
+
icon && /* @__PURE__ */ jsx("span", { className: Alert_module_css_default.icon, "aria-hidden": "true", children: icon }),
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: Alert_module_css_default.body, children: [
|
|
67
|
+
title && /* @__PURE__ */ jsx("div", { className: Alert_module_css_default.title, children: title }),
|
|
68
|
+
children
|
|
69
|
+
] }),
|
|
70
|
+
onClose && /* @__PURE__ */ jsx(
|
|
71
|
+
"button",
|
|
72
|
+
{
|
|
73
|
+
type: "button",
|
|
74
|
+
className: Alert_module_css_default.close,
|
|
75
|
+
"aria-label": closeLabel,
|
|
76
|
+
onClick: onClose,
|
|
77
|
+
children: /* @__PURE__ */ jsx(
|
|
78
|
+
"svg",
|
|
79
|
+
{
|
|
80
|
+
viewBox: "0 0 24 24",
|
|
81
|
+
width: "16",
|
|
82
|
+
height: "16",
|
|
83
|
+
fill: "none",
|
|
84
|
+
stroke: "currentColor",
|
|
85
|
+
strokeWidth: "2",
|
|
86
|
+
strokeLinecap: "round",
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
AlertComponent.displayName = "BolioUIAlert";
|
|
99
|
+
var Alert = with_scale_default(AlertComponent);
|
|
100
|
+
var Alert_default = Alert;
|
|
101
|
+
|
|
102
|
+
// core/Alert/index.ts
|
|
103
|
+
var Alert_default2 = Alert_default;
|
|
104
|
+
|
|
105
|
+
export {
|
|
106
|
+
Alert_default2 as Alert_default
|
|
107
|
+
};
|
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
use_click_away_default
|
|
13
13
|
} from "./chunk-DGXZP4VJ.js";
|
|
14
|
+
import {
|
|
15
|
+
getSurface
|
|
16
|
+
} from "./chunk-EUYSKHRS.js";
|
|
14
17
|
import {
|
|
15
18
|
use_scale_default,
|
|
16
19
|
with_scale_default
|
|
@@ -57,6 +60,7 @@ var ColorInputComponent = React.forwardRef(
|
|
|
57
60
|
...props
|
|
58
61
|
}, ref) => {
|
|
59
62
|
const theme = use_theme_default();
|
|
63
|
+
const surface = getSurface(theme);
|
|
60
64
|
const { SCALES } = use_scale_default();
|
|
61
65
|
const generatedId = useId();
|
|
62
66
|
const inputId = props.id || generatedId;
|
|
@@ -122,9 +126,9 @@ var ColorInputComponent = React.forwardRef(
|
|
|
122
126
|
"--colorinput-focus-border": colors.focusBorder,
|
|
123
127
|
"--colorinput-placeholder": colors.placeholderColor,
|
|
124
128
|
"--colorinput-color": colors.color,
|
|
125
|
-
"--colorinput-popup-bg":
|
|
129
|
+
"--colorinput-popup-bg": surface.bg,
|
|
126
130
|
"--colorinput-popup-border": theme.palette.border,
|
|
127
|
-
"--colorinput-shadow":
|
|
131
|
+
"--colorinput-shadow": surface.shadow
|
|
128
132
|
};
|
|
129
133
|
return /* @__PURE__ */ jsxs(
|
|
130
134
|
"div",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// core/utils/surface.ts
|
|
2
|
+
var getSurface = (theme, shadow = theme.expressiveness.shadowMedium) => {
|
|
3
|
+
const dark = theme.type === "dark";
|
|
4
|
+
return {
|
|
5
|
+
bg: dark ? theme.palette.accents_3 : theme.palette.background,
|
|
6
|
+
hover: dark ? theme.palette.accents_4 : theme.palette.accents_2,
|
|
7
|
+
shadow: dark ? `0 2px 6px rgb(0 0 0 / 40%), ${shadow}` : shadow
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
getSurface
|
|
13
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {
|
|
2
|
+
use_scale_default,
|
|
3
|
+
with_scale_default
|
|
4
|
+
} from "./chunk-MAICNLTY.js";
|
|
5
|
+
import {
|
|
6
|
+
use_theme_default
|
|
7
|
+
} from "./chunk-V5I4ORQQ.js";
|
|
8
|
+
import {
|
|
9
|
+
joinClasses,
|
|
10
|
+
use_classes_default
|
|
11
|
+
} from "./chunk-5KUROAEP.js";
|
|
12
|
+
|
|
13
|
+
// core/Splitter/Splitter.tsx
|
|
14
|
+
import React2, { useId, useRef, useState } from "react";
|
|
15
|
+
|
|
16
|
+
// core/Splitter/SplitterContext.ts
|
|
17
|
+
import React from "react";
|
|
18
|
+
var SplitterPanelContext = React.createContext(null);
|
|
19
|
+
|
|
20
|
+
// css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Splitter/Splitter.module.css.bolio-css-module-source
|
|
21
|
+
var Splitter_module_css_default = { "splitter": "Splitter-module_splitter__ZxGeO", "horizontal": "Splitter-module_horizontal__1LuP6", "vertical": "Splitter-module_vertical__APNTT", "panel": "Splitter-module_panel__UyXwt", "handle": "Splitter-module_handle__zkBUq" };
|
|
22
|
+
|
|
23
|
+
// core/Splitter/Splitter.tsx
|
|
24
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
var initialSizes = (panels) => {
|
|
26
|
+
const given = panels.map((panel) => panel.props.defaultSize);
|
|
27
|
+
const used = given.reduce((sum, size) => sum + (size != null ? size : 0), 0);
|
|
28
|
+
const open = given.filter((size) => size === void 0).length;
|
|
29
|
+
return given.map(
|
|
30
|
+
(size) => size === void 0 ? Math.max(0, 100 - used) / open : size
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
var SplitterComponent = React2.forwardRef(
|
|
34
|
+
({
|
|
35
|
+
direction = "horizontal",
|
|
36
|
+
onResize,
|
|
37
|
+
handleLabel = "Resize",
|
|
38
|
+
className = "",
|
|
39
|
+
children,
|
|
40
|
+
style,
|
|
41
|
+
...props
|
|
42
|
+
}, ref) => {
|
|
43
|
+
const theme = use_theme_default();
|
|
44
|
+
const { SCALES } = use_scale_default();
|
|
45
|
+
const baseId = useId();
|
|
46
|
+
const panels = React2.Children.toArray(children).filter(
|
|
47
|
+
React2.isValidElement
|
|
48
|
+
);
|
|
49
|
+
const horizontal = direction === "horizontal";
|
|
50
|
+
const [sizes, setSizes] = useState(() => initialSizes(panels));
|
|
51
|
+
if (sizes.length !== panels.length) setSizes(initialSizes(panels));
|
|
52
|
+
const elements = useRef([]);
|
|
53
|
+
const drag = useRef(void 0);
|
|
54
|
+
const minOf = (index) => {
|
|
55
|
+
var _a;
|
|
56
|
+
return (_a = panels[index].props.minSize) != null ? _a : 0;
|
|
57
|
+
};
|
|
58
|
+
const maxOf = (index) => {
|
|
59
|
+
var _a;
|
|
60
|
+
return (_a = panels[index].props.maxSize) != null ? _a : 100;
|
|
61
|
+
};
|
|
62
|
+
const move = (index, delta, from) => {
|
|
63
|
+
const [a, b] = [from[index], from[index + 1]];
|
|
64
|
+
const low = Math.max(minOf(index) - a, b - maxOf(index + 1));
|
|
65
|
+
const high = Math.min(maxOf(index) - a, b - minOf(index + 1));
|
|
66
|
+
const applied = Math.min(Math.max(delta, low), high);
|
|
67
|
+
if (!applied && sizes[index] === a) return;
|
|
68
|
+
const next = [...from];
|
|
69
|
+
next[index] = a + applied;
|
|
70
|
+
next[index + 1] = b - applied;
|
|
71
|
+
setSizes(next);
|
|
72
|
+
if (onResize) onResize(next);
|
|
73
|
+
};
|
|
74
|
+
const pointerDown = (event) => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
(_b = (_a = event.currentTarget).setPointerCapture) == null ? void 0 : _b.call(_a, event.pointerId);
|
|
77
|
+
const room = elements.current.reduce((sum, element) => {
|
|
78
|
+
const rect = element == null ? void 0 : element.getBoundingClientRect();
|
|
79
|
+
return sum + (rect ? horizontal ? rect.width : rect.height : 0);
|
|
80
|
+
}, 0);
|
|
81
|
+
drag.current = {
|
|
82
|
+
from: horizontal ? event.clientX : event.clientY,
|
|
83
|
+
sizes: [...sizes],
|
|
84
|
+
room
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const pointerMove = (event, index) => {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
const start = drag.current;
|
|
90
|
+
if (!start || !start.room) return;
|
|
91
|
+
if (!((_b = (_a = event.currentTarget).hasPointerCapture) == null ? void 0 : _b.call(_a, event.pointerId))) return;
|
|
92
|
+
const travelled = (horizontal ? event.clientX : event.clientY) - start.from;
|
|
93
|
+
move(index, travelled / start.room * 100, start.sizes);
|
|
94
|
+
};
|
|
95
|
+
const keyDown = (event, index) => {
|
|
96
|
+
const step = event.shiftKey ? 10 : 1;
|
|
97
|
+
const [less, more] = horizontal ? ["ArrowLeft", "ArrowRight"] : ["ArrowUp", "ArrowDown"];
|
|
98
|
+
const deltas = {
|
|
99
|
+
[less]: -step,
|
|
100
|
+
[more]: step,
|
|
101
|
+
Home: -100,
|
|
102
|
+
End: 100
|
|
103
|
+
};
|
|
104
|
+
if (!(event.key in deltas)) return;
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
move(index, deltas[event.key], sizes);
|
|
107
|
+
};
|
|
108
|
+
const template = sizes.map((size) => `minmax(0, ${size}fr)`).join(" auto ");
|
|
109
|
+
const splitterStyle = {
|
|
110
|
+
"--splitter-template": template,
|
|
111
|
+
width: SCALES.width(1, "100%"),
|
|
112
|
+
height: SCALES.height(1, "100%"),
|
|
113
|
+
margin: `${SCALES.mt(0)} ${SCALES.mr(0)} ${SCALES.mb(0)} ${SCALES.ml(0)}`,
|
|
114
|
+
"--splitter-line": theme.palette.border,
|
|
115
|
+
"--splitter-active": theme.palette.primary,
|
|
116
|
+
...style
|
|
117
|
+
};
|
|
118
|
+
return /* @__PURE__ */ jsx(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
ref,
|
|
122
|
+
className: use_classes_default(Splitter_module_css_default.splitter, className, {
|
|
123
|
+
[Splitter_module_css_default.horizontal]: horizontal,
|
|
124
|
+
[Splitter_module_css_default.vertical]: !horizontal
|
|
125
|
+
}),
|
|
126
|
+
...props,
|
|
127
|
+
style: splitterStyle,
|
|
128
|
+
children: panels.map((panel, index) => {
|
|
129
|
+
var _a;
|
|
130
|
+
const [a, b] = [sizes[index], sizes[index + 1]];
|
|
131
|
+
return /* @__PURE__ */ jsxs(React2.Fragment, { children: [
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
SplitterPanelContext.Provider,
|
|
134
|
+
{
|
|
135
|
+
value: {
|
|
136
|
+
id: `${baseId}-panel-${index}`,
|
|
137
|
+
setElement: (element) => {
|
|
138
|
+
elements.current[index] = element;
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
children: panel
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
index < panels.length - 1 && /* @__PURE__ */ jsx(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
role: "separator",
|
|
148
|
+
tabIndex: 0,
|
|
149
|
+
"aria-label": handleLabel,
|
|
150
|
+
"aria-orientation": horizontal ? "vertical" : "horizontal",
|
|
151
|
+
"aria-controls": `${baseId}-panel-${index}`,
|
|
152
|
+
"aria-valuenow": Math.round(a),
|
|
153
|
+
"aria-valuemin": Math.round(
|
|
154
|
+
Math.max(minOf(index), a + b - maxOf(index + 1))
|
|
155
|
+
),
|
|
156
|
+
"aria-valuemax": Math.round(
|
|
157
|
+
Math.min(maxOf(index), a + b - minOf(index + 1))
|
|
158
|
+
),
|
|
159
|
+
className: joinClasses(Splitter_module_css_default.handle),
|
|
160
|
+
onPointerDown: pointerDown,
|
|
161
|
+
onPointerMove: (event) => pointerMove(event, index),
|
|
162
|
+
onPointerUp: () => drag.current = void 0,
|
|
163
|
+
onPointerCancel: () => drag.current = void 0,
|
|
164
|
+
onKeyDown: (event) => keyDown(event, index)
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] }, (_a = panel.key) != null ? _a : index);
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
SplitterComponent.displayName = "BolioUISplitter";
|
|
174
|
+
var Splitter = with_scale_default(SplitterComponent);
|
|
175
|
+
var Splitter_default = Splitter;
|
|
176
|
+
|
|
177
|
+
// core/Splitter/SplitterPanel.tsx
|
|
178
|
+
import React3, { useContext } from "react";
|
|
179
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
180
|
+
var SplitterPanel = React3.forwardRef(
|
|
181
|
+
({
|
|
182
|
+
// read by the Splitter
|
|
183
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
184
|
+
defaultSize,
|
|
185
|
+
minSize,
|
|
186
|
+
maxSize,
|
|
187
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
188
|
+
className = "",
|
|
189
|
+
children,
|
|
190
|
+
style,
|
|
191
|
+
...props
|
|
192
|
+
}, ref) => {
|
|
193
|
+
const config = useContext(SplitterPanelContext);
|
|
194
|
+
return /* @__PURE__ */ jsx2(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
ref: (element) => {
|
|
198
|
+
config == null ? void 0 : config.setElement(element);
|
|
199
|
+
if (typeof ref === "function") ref(element);
|
|
200
|
+
else if (ref) ref.current = element;
|
|
201
|
+
},
|
|
202
|
+
id: config == null ? void 0 : config.id,
|
|
203
|
+
className: use_classes_default(Splitter_module_css_default.panel, className),
|
|
204
|
+
...props,
|
|
205
|
+
style,
|
|
206
|
+
children
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
SplitterPanel.displayName = "BolioUISplitterPanel";
|
|
212
|
+
var SplitterPanel_default = SplitterPanel;
|
|
213
|
+
|
|
214
|
+
// core/Splitter/index.ts
|
|
215
|
+
Splitter_default.Panel = SplitterPanel_default;
|
|
216
|
+
var Splitter_default2 = Splitter_default;
|
|
217
|
+
|
|
218
|
+
export {
|
|
219
|
+
Splitter_default2 as Splitter_default
|
|
220
|
+
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dropdown_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WCTANCLG.js";
|
|
4
4
|
import {
|
|
5
5
|
use_click_away_default
|
|
6
6
|
} from "./chunk-DGXZP4VJ.js";
|
|
7
|
+
import {
|
|
8
|
+
getSurface
|
|
9
|
+
} from "./chunk-EUYSKHRS.js";
|
|
7
10
|
import {
|
|
8
11
|
use_scale_default,
|
|
9
12
|
with_scale_default
|
|
@@ -64,10 +67,11 @@ var MenuList = ({
|
|
|
64
67
|
};
|
|
65
68
|
useEffect(() => {
|
|
66
69
|
var _a, _b;
|
|
67
|
-
|
|
70
|
+
const options = { preventScroll: true };
|
|
71
|
+
if (focus === "list") return (_a = listRef.current) == null ? void 0 : _a.focus(options);
|
|
68
72
|
const items = getItems();
|
|
69
73
|
const target = focus === "first" ? items[0] : items[items.length - 1];
|
|
70
|
-
(_b = target != null ? target : listRef.current) == null ? void 0 : _b.focus();
|
|
74
|
+
(_b = target != null ? target : listRef.current) == null ? void 0 : _b.focus(options);
|
|
71
75
|
}, []);
|
|
72
76
|
const typeahead = (key, items, index) => {
|
|
73
77
|
const now = Date.now();
|
|
@@ -129,13 +133,14 @@ var MenuList = ({
|
|
|
129
133
|
const isCharacter = event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;
|
|
130
134
|
if (isCharacter) typeahead(event.key, items, index);
|
|
131
135
|
};
|
|
136
|
+
const surface = getSurface(theme);
|
|
132
137
|
const listStyle = {
|
|
133
138
|
"--menu-list-font-size": SCALES.font(0.875),
|
|
134
139
|
"--menu-list-color": theme.palette.foreground,
|
|
135
|
-
"--menu-list-bg":
|
|
140
|
+
"--menu-list-bg": surface.bg,
|
|
136
141
|
"--menu-list-border-color": theme.palette.border,
|
|
137
142
|
"--menu-list-radius": theme.layout.radius,
|
|
138
|
-
"--menu-list-shadow":
|
|
143
|
+
"--menu-list-shadow": surface.shadow
|
|
139
144
|
};
|
|
140
145
|
return /* @__PURE__ */ jsx(MenuListContext.Provider, { value: { openSub, setOpenSub }, children: /* @__PURE__ */ jsx(
|
|
141
146
|
"div",
|
|
@@ -320,7 +325,7 @@ var MenuItemBase = React4.forwardRef(
|
|
|
320
325
|
};
|
|
321
326
|
const itemStyle = {
|
|
322
327
|
"--menu-item-color": theme.palette.foreground,
|
|
323
|
-
"--menu-item-focus-bg": theme.
|
|
328
|
+
"--menu-item-focus-bg": getSurface(theme).hover,
|
|
324
329
|
"--menu-item-error-color": theme.palette.error,
|
|
325
330
|
"--menu-item-error-focus-bg": theme.palette.errorLight,
|
|
326
331
|
"--menu-item-error-focus-color": theme.palette.errorDark,
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getVariantColors
|
|
3
|
+
} from "./chunk-GJZT47MP.js";
|
|
4
|
+
import {
|
|
5
|
+
use_scale_default,
|
|
6
|
+
with_scale_default
|
|
7
|
+
} from "./chunk-MAICNLTY.js";
|
|
8
|
+
import {
|
|
9
|
+
use_theme_default
|
|
10
|
+
} from "./chunk-V5I4ORQQ.js";
|
|
11
|
+
import {
|
|
12
|
+
use_classes_default
|
|
13
|
+
} from "./chunk-5KUROAEP.js";
|
|
14
|
+
|
|
15
|
+
// core/Chip/Chip.tsx
|
|
16
|
+
import React2, { useState } from "react";
|
|
17
|
+
|
|
18
|
+
// core/Chip/ChipContext.ts
|
|
19
|
+
import React from "react";
|
|
20
|
+
var ChipContext = React.createContext(null);
|
|
21
|
+
var useChipContext = () => React.useContext(ChipContext);
|
|
22
|
+
|
|
23
|
+
// css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Chip/Chip.module.css.bolio-css-module-source
|
|
24
|
+
var Chip_module_css_default = { "chip": "Chip-module_chip__r494r", "input": "Chip-module_input__GhNGk", "text": "Chip-module_text__sYRMh" };
|
|
25
|
+
|
|
26
|
+
// core/Chip/Chip.tsx
|
|
27
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
+
var ChipComponent = React2.forwardRef(
|
|
29
|
+
({
|
|
30
|
+
value,
|
|
31
|
+
checked: customChecked,
|
|
32
|
+
initialChecked = false,
|
|
33
|
+
onChange,
|
|
34
|
+
type = "primary",
|
|
35
|
+
disabled = false,
|
|
36
|
+
className = "",
|
|
37
|
+
children,
|
|
38
|
+
style,
|
|
39
|
+
...props
|
|
40
|
+
}, ref) => {
|
|
41
|
+
const theme = use_theme_default();
|
|
42
|
+
const { SCALES } = use_scale_default();
|
|
43
|
+
const group = useChipContext();
|
|
44
|
+
const [selfChecked, setSelfChecked] = useState(initialChecked);
|
|
45
|
+
const checked = group ? group.value.includes(value) : customChecked !== void 0 ? customChecked : selfChecked;
|
|
46
|
+
const changeHandler = (event) => {
|
|
47
|
+
if (group) {
|
|
48
|
+
if (group.toggle) group.toggle(value);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
setSelfChecked(event.target.checked);
|
|
52
|
+
if (onChange) onChange(event.target.checked);
|
|
53
|
+
};
|
|
54
|
+
const { bg, color, border } = getVariantColors(theme.palette, type, "light");
|
|
55
|
+
const chipStyle = {
|
|
56
|
+
height: SCALES.height(2),
|
|
57
|
+
margin: `${SCALES.mt(0)} ${SCALES.mr(0)} ${SCALES.mb(0)} ${SCALES.ml(0)}`,
|
|
58
|
+
fontSize: SCALES.font(0.875),
|
|
59
|
+
"--chip-color": theme.palette.accents_6,
|
|
60
|
+
"--chip-border": theme.palette.accents_3,
|
|
61
|
+
"--chip-hover-bg": theme.palette.accents_1,
|
|
62
|
+
"--chip-checked-bg": bg,
|
|
63
|
+
"--chip-checked-color": color,
|
|
64
|
+
"--chip-checked-border": border,
|
|
65
|
+
"--chip-focus": theme.palette[type],
|
|
66
|
+
...style
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ jsxs("label", { className: use_classes_default(Chip_module_css_default.chip, className), style: chipStyle, children: [
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
"input",
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
type: group && !group.multiple ? "radio" : "checkbox",
|
|
74
|
+
className: Chip_module_css_default.input,
|
|
75
|
+
name: group == null ? void 0 : group.name,
|
|
76
|
+
value,
|
|
77
|
+
checked,
|
|
78
|
+
disabled: disabled || (group == null ? void 0 : group.disabled),
|
|
79
|
+
onChange: changeHandler,
|
|
80
|
+
...props
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsxs("span", { className: Chip_module_css_default.text, children: [
|
|
84
|
+
checked && /* @__PURE__ */ jsx(
|
|
85
|
+
"svg",
|
|
86
|
+
{
|
|
87
|
+
viewBox: "0 0 24 24",
|
|
88
|
+
width: "14",
|
|
89
|
+
height: "14",
|
|
90
|
+
fill: "none",
|
|
91
|
+
stroke: "currentColor",
|
|
92
|
+
strokeWidth: "3",
|
|
93
|
+
strokeLinecap: "round",
|
|
94
|
+
strokeLinejoin: "round",
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
children: /* @__PURE__ */ jsx("path", { d: "m5 12 5 5L20 7" })
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
children
|
|
100
|
+
] })
|
|
101
|
+
] });
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
ChipComponent.displayName = "BolioUIChip";
|
|
105
|
+
var Chip = with_scale_default(ChipComponent);
|
|
106
|
+
var Chip_default = Chip;
|
|
107
|
+
|
|
108
|
+
// core/Chip/ChipGroup.tsx
|
|
109
|
+
import React3, { useId, useMemo, useState as useState2 } from "react";
|
|
110
|
+
|
|
111
|
+
// css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Chip/ChipGroup.module.css.bolio-css-module-source
|
|
112
|
+
var ChipGroup_module_css_default = { "group": "ChipGroup-module_group__6ARIk" };
|
|
113
|
+
|
|
114
|
+
// core/Chip/ChipGroup.tsx
|
|
115
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
116
|
+
var ChipGroup = React3.forwardRef(
|
|
117
|
+
({
|
|
118
|
+
value: customValue,
|
|
119
|
+
initialValue = [],
|
|
120
|
+
onChange,
|
|
121
|
+
multiple = false,
|
|
122
|
+
disabled = false,
|
|
123
|
+
className = "",
|
|
124
|
+
children,
|
|
125
|
+
...props
|
|
126
|
+
}, ref) => {
|
|
127
|
+
const name = useId();
|
|
128
|
+
const [selfValue, setSelfValue] = useState2(initialValue);
|
|
129
|
+
const value = customValue !== void 0 ? customValue : selfValue;
|
|
130
|
+
const providerValue = useMemo(
|
|
131
|
+
() => ({
|
|
132
|
+
name,
|
|
133
|
+
multiple,
|
|
134
|
+
value,
|
|
135
|
+
disabled,
|
|
136
|
+
toggle: (chip) => {
|
|
137
|
+
const next = !multiple ? [chip] : value.includes(chip) ? value.filter((v) => v !== chip) : [...value, chip];
|
|
138
|
+
setSelfValue(next);
|
|
139
|
+
if (onChange) onChange(next);
|
|
140
|
+
}
|
|
141
|
+
}),
|
|
142
|
+
[name, multiple, value, disabled, onChange]
|
|
143
|
+
);
|
|
144
|
+
return /* @__PURE__ */ jsx2(ChipContext.Provider, { value: providerValue, children: /* @__PURE__ */ jsx2(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
ref,
|
|
148
|
+
role: multiple ? "group" : "radiogroup",
|
|
149
|
+
className: use_classes_default(ChipGroup_module_css_default.group, className),
|
|
150
|
+
...props,
|
|
151
|
+
children
|
|
152
|
+
}
|
|
153
|
+
) });
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
ChipGroup.displayName = "BolioUIChipGroup";
|
|
157
|
+
var ChipGroup_default = ChipGroup;
|
|
158
|
+
|
|
159
|
+
// core/Chip/index.ts
|
|
160
|
+
Chip_default.Group = ChipGroup_default;
|
|
161
|
+
var Chip_default2 = Chip_default;
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
Chip_default2 as Chip_default
|
|
165
|
+
};
|