@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.
Files changed (254) hide show
  1. package/dist/Alert/Alert.d.ts +20 -0
  2. package/dist/Alert/index.d.ts +3 -0
  3. package/dist/Alert/index.js +16 -0
  4. package/dist/BolioUIProvider/index.js +7 -6
  5. package/dist/Button/index.js +3 -3
  6. package/dist/ButtonDropdown/index.js +3 -2
  7. package/dist/Calendar/index.js +2 -2
  8. package/dist/Chip/Chip.d.ts +17 -0
  9. package/dist/Chip/ChipContext.d.ts +11 -0
  10. package/dist/Chip/ChipGroup.d.ts +16 -0
  11. package/dist/Chip/index.d.ts +9 -0
  12. package/dist/Chip/index.js +15 -0
  13. package/dist/ColorInput/index.js +3 -2
  14. package/dist/Combobox/index.js +3 -2
  15. package/dist/Command/index.js +9 -8
  16. package/dist/ContextMenu/index.js +5 -4
  17. package/dist/CssBaseline/index.js +2 -2
  18. package/dist/DatePicker/index.js +4 -3
  19. package/dist/DateRangePicker/index.js +4 -3
  20. package/dist/Drawer/index.js +6 -5
  21. package/dist/Grid/Grid.d.ts +16 -16
  22. package/dist/Grid/GridContainer.d.ts +16 -16
  23. package/dist/ImageZoom/ImageZoom.d.ts +14 -0
  24. package/dist/ImageZoom/index.d.ts +3 -0
  25. package/dist/ImageZoom/index.js +17 -0
  26. package/dist/Mention/Mention.d.ts +25 -0
  27. package/dist/Mention/index.d.ts +3 -0
  28. package/dist/Mention/index.js +17 -0
  29. package/dist/Menu/index.js +4 -3
  30. package/dist/Modal/index.js +8 -7
  31. package/dist/Note/Note.d.ts +10 -0
  32. package/dist/Note/index.js +3 -2
  33. package/dist/Popover/index.js +4 -3
  34. package/dist/Select/index.js +7 -6
  35. package/dist/Splitter/Splitter.d.ts +14 -0
  36. package/dist/Splitter/SplitterContext.d.ts +6 -0
  37. package/dist/Splitter/SplitterPanel.d.ts +13 -0
  38. package/dist/Splitter/index.d.ts +9 -0
  39. package/dist/Splitter/index.js +14 -0
  40. package/dist/Table/Table.d.ts +11 -1
  41. package/dist/Table/TableBody.d.ts +8 -2
  42. package/dist/Table/TableColumn.d.ts +2 -0
  43. package/dist/Table/TableHead.d.ts +9 -1
  44. package/dist/Table/TableSelectBox.d.ts +9 -0
  45. package/dist/Table/TableTypes.d.ts +8 -0
  46. package/dist/Table/index.d.ts +1 -1
  47. package/dist/Table/index.js +3 -3
  48. package/dist/Toolbar/Toolbar.d.ts +11 -0
  49. package/dist/Toolbar/ToolbarSeparator.d.ts +4 -0
  50. package/dist/Toolbar/index.d.ts +9 -0
  51. package/dist/Toolbar/index.js +14 -0
  52. package/dist/Tooltip/index.js +3 -2
  53. package/dist/Tour/Tour.d.ts +26 -0
  54. package/dist/Tour/index.d.ts +3 -0
  55. package/dist/Tour/index.js +24 -0
  56. package/dist/{chunk-PGQYW6YF.js → chunk-25NFUHLR.js} +12 -8
  57. package/dist/{chunk-AFBCMW2I.js → chunk-26KDVRFS.js} +1 -3
  58. package/dist/{chunk-4ZGR7UMX.js → chunk-4DH6SOK4.js} +10 -6
  59. package/dist/chunk-CGS2MT3G.js +10 -0
  60. package/dist/{chunk-6ZBFUZSL.js → chunk-CU6SNPIM.js} +25 -22
  61. package/dist/chunk-CY5KTINE.js +107 -0
  62. package/dist/{chunk-IJGIEX5J.js → chunk-DEMQXB46.js} +6 -2
  63. package/dist/{chunk-AVO2SK2I.js → chunk-DYYSUJ35.js} +2 -2
  64. package/dist/chunk-EUYSKHRS.js +13 -0
  65. package/dist/chunk-FFEAKF3A.js +220 -0
  66. package/dist/{chunk-XLPOECCE.js → chunk-FLUNRVVG.js} +12 -7
  67. package/dist/chunk-FQWH4PDK.js +165 -0
  68. package/dist/chunk-FSO65ZAH.js +249 -0
  69. package/dist/{chunk-2EYJZXS4.js → chunk-ICACLCJR.js} +13 -8
  70. package/dist/{chunk-XF4TPE2W.js → chunk-IL7L3BEL.js} +7 -2
  71. package/dist/{chunk-MGHMAZRL.js → chunk-KRSISARC.js} +7 -3
  72. package/dist/{chunk-4QA7Z7VP.js → chunk-M64V32WO.js} +6 -3
  73. package/dist/chunk-Q3I54DUS.js +131 -0
  74. package/dist/chunk-REWKR7S3.js +109 -0
  75. package/dist/{chunk-SGWX6H4Y.js → chunk-RWRFOGCU.js} +6 -2
  76. package/dist/chunk-SJVWKNGY.js +236 -0
  77. package/dist/{chunk-P245HSVB.js → chunk-TLVSZCKU.js} +2 -1
  78. package/dist/{chunk-AG2NWQYL.js → chunk-WCTANCLG.js} +3 -1
  79. package/dist/{chunk-TDJGMSGT.js → chunk-WIIDIZYK.js} +3 -1
  80. package/dist/{chunk-DIMJQLWY.js → chunk-XUNC7RB7.js} +9 -5
  81. package/dist/{chunk-GGCVPMXO.js → chunk-Y432C24Z.js} +2 -2
  82. package/dist/{chunk-TKICX5R6.js → chunk-Y5CFWIGV.js} +227 -35
  83. package/dist/{chunk-GYFW5NLU.js → chunk-YLLPYRJH.js} +34 -11
  84. package/dist/css/Alert.css +53 -0
  85. package/dist/css/ButtonDropdown-ButtonDropdownItem.css +0 -1
  86. package/dist/css/ButtonGroup.css +0 -1
  87. package/dist/css/Calendar.css +0 -1
  88. package/dist/css/Carousel.css +0 -1
  89. package/dist/css/Chip-ChipGroup.css +8 -0
  90. package/dist/css/Chip.css +65 -0
  91. package/dist/css/ColorInput.css +7 -3
  92. package/dist/css/ColorPicker.css +5 -4
  93. package/dist/css/Combobox.css +1 -2
  94. package/dist/css/DatePicker.css +1 -3
  95. package/dist/css/DateRangePicker.css +7 -3
  96. package/dist/css/Dropzone.css +0 -3
  97. package/dist/css/Fieldset-FieldsetGroup.css +0 -1
  98. package/dist/css/ImageZoom.css +93 -0
  99. package/dist/css/Input.css +1 -1
  100. package/dist/css/Mention.css +93 -0
  101. package/dist/css/Menu-MenuList.css +0 -1
  102. package/dist/css/Modal-ModalAction.css +6 -1
  103. package/dist/css/Modal-ModalActions.css +9 -2
  104. package/dist/css/NumberInput.css +1 -1
  105. package/dist/css/PinInput.css +1 -1
  106. package/dist/css/Radio.css +0 -1
  107. package/dist/css/SegmentedControl.css +0 -1
  108. package/dist/css/Select-SelectDropdown.css +0 -1
  109. package/dist/css/Select-SelectOption.css +0 -1
  110. package/dist/css/Select.css +0 -1
  111. package/dist/css/Splitter.css +77 -0
  112. package/dist/css/Table-TableBody.css +10 -0
  113. package/dist/css/Table-TableHead.css +41 -0
  114. package/dist/css/Table-TableSelectBox.css +11 -0
  115. package/dist/css/TagsInput.css +1 -2
  116. package/dist/css/Textarea.css +1 -1
  117. package/dist/css/Toggle.css +0 -1
  118. package/dist/css/Toolbar.css +32 -0
  119. package/dist/css/Tour.css +81 -0
  120. package/dist/css/use-toasts-toast-item.css +0 -1
  121. package/dist/index.d.ts +15 -1
  122. package/dist/index.js +92 -62
  123. package/dist/styles.css +3571 -2997
  124. package/dist/utils/surface.d.ts +6 -0
  125. package/esm/Alert/Alert.d.ts +20 -0
  126. package/esm/Alert/index.d.ts +3 -0
  127. package/esm/Alert/index.js +16 -0
  128. package/esm/BolioUIProvider/index.js +6 -5
  129. package/esm/Button/index.js +2 -2
  130. package/esm/ButtonDropdown/index.js +2 -1
  131. package/esm/Calendar/index.js +1 -1
  132. package/esm/Chip/Chip.d.ts +17 -0
  133. package/esm/Chip/ChipContext.d.ts +11 -0
  134. package/esm/Chip/ChipGroup.d.ts +16 -0
  135. package/esm/Chip/index.d.ts +9 -0
  136. package/esm/Chip/index.js +15 -0
  137. package/esm/ColorInput/index.js +2 -1
  138. package/esm/Combobox/index.js +2 -1
  139. package/esm/Command/index.js +8 -7
  140. package/esm/ContextMenu/index.js +4 -3
  141. package/esm/CssBaseline/index.js +1 -1
  142. package/esm/DatePicker/index.js +3 -2
  143. package/esm/DateRangePicker/index.js +3 -2
  144. package/esm/Drawer/index.js +5 -4
  145. package/esm/Grid/Grid.d.ts +16 -16
  146. package/esm/Grid/GridContainer.d.ts +16 -16
  147. package/esm/ImageZoom/ImageZoom.d.ts +14 -0
  148. package/esm/ImageZoom/index.d.ts +3 -0
  149. package/esm/ImageZoom/index.js +17 -0
  150. package/esm/Mention/Mention.d.ts +25 -0
  151. package/esm/Mention/index.d.ts +3 -0
  152. package/esm/Mention/index.js +17 -0
  153. package/esm/Menu/index.js +3 -2
  154. package/esm/Modal/index.js +7 -6
  155. package/esm/Note/Note.d.ts +10 -0
  156. package/esm/Note/index.js +2 -1
  157. package/esm/Popover/index.js +3 -2
  158. package/esm/Select/index.js +6 -5
  159. package/esm/Splitter/Splitter.d.ts +14 -0
  160. package/esm/Splitter/SplitterContext.d.ts +6 -0
  161. package/esm/Splitter/SplitterPanel.d.ts +13 -0
  162. package/esm/Splitter/index.d.ts +9 -0
  163. package/esm/Splitter/index.js +14 -0
  164. package/esm/Table/Table.d.ts +11 -1
  165. package/esm/Table/TableBody.d.ts +8 -2
  166. package/esm/Table/TableColumn.d.ts +2 -0
  167. package/esm/Table/TableHead.d.ts +9 -1
  168. package/esm/Table/TableSelectBox.d.ts +9 -0
  169. package/esm/Table/TableTypes.d.ts +8 -0
  170. package/esm/Table/index.d.ts +1 -1
  171. package/esm/Table/index.js +2 -2
  172. package/esm/Toolbar/Toolbar.d.ts +11 -0
  173. package/esm/Toolbar/ToolbarSeparator.d.ts +4 -0
  174. package/esm/Toolbar/index.d.ts +9 -0
  175. package/esm/Toolbar/index.js +14 -0
  176. package/esm/Tooltip/index.js +2 -1
  177. package/esm/Tour/Tour.d.ts +26 -0
  178. package/esm/Tour/index.d.ts +3 -0
  179. package/esm/Tour/index.js +24 -0
  180. package/esm/{chunk-PGQYW6YF.js → chunk-25NFUHLR.js} +7 -3
  181. package/esm/{chunk-AFBCMW2I.js → chunk-26KDVRFS.js} +2 -4
  182. package/esm/{chunk-4ZGR7UMX.js → chunk-4DH6SOK4.js} +10 -6
  183. package/esm/chunk-CGS2MT3G.js +10 -0
  184. package/esm/{chunk-6ZBFUZSL.js → chunk-CU6SNPIM.js} +15 -12
  185. package/esm/chunk-CY5KTINE.js +107 -0
  186. package/esm/{chunk-IJGIEX5J.js → chunk-DEMQXB46.js} +6 -2
  187. package/esm/{chunk-AVO2SK2I.js → chunk-DYYSUJ35.js} +1 -1
  188. package/esm/chunk-EUYSKHRS.js +13 -0
  189. package/esm/chunk-FFEAKF3A.js +220 -0
  190. package/esm/{chunk-XLPOECCE.js → chunk-FLUNRVVG.js} +11 -6
  191. package/esm/chunk-FQWH4PDK.js +165 -0
  192. package/esm/chunk-FSO65ZAH.js +249 -0
  193. package/esm/{chunk-2EYJZXS4.js → chunk-ICACLCJR.js} +8 -3
  194. package/esm/{chunk-XF4TPE2W.js → chunk-IL7L3BEL.js} +7 -2
  195. package/esm/{chunk-MGHMAZRL.js → chunk-KRSISARC.js} +7 -3
  196. package/esm/{chunk-4QA7Z7VP.js → chunk-M64V32WO.js} +5 -2
  197. package/esm/chunk-Q3I54DUS.js +131 -0
  198. package/esm/chunk-REWKR7S3.js +109 -0
  199. package/esm/{chunk-SGWX6H4Y.js → chunk-RWRFOGCU.js} +6 -2
  200. package/esm/chunk-SJVWKNGY.js +236 -0
  201. package/esm/{chunk-P245HSVB.js → chunk-TLVSZCKU.js} +2 -1
  202. package/esm/{chunk-AG2NWQYL.js → chunk-WCTANCLG.js} +3 -1
  203. package/esm/{chunk-TDJGMSGT.js → chunk-WIIDIZYK.js} +3 -1
  204. package/esm/{chunk-DIMJQLWY.js → chunk-XUNC7RB7.js} +9 -5
  205. package/esm/{chunk-GGCVPMXO.js → chunk-Y432C24Z.js} +1 -1
  206. package/esm/chunk-Y5CFWIGV.js +543 -0
  207. package/esm/{chunk-GYFW5NLU.js → chunk-YLLPYRJH.js} +30 -7
  208. package/esm/css/Alert.css +53 -0
  209. package/esm/css/ButtonDropdown-ButtonDropdownItem.css +0 -1
  210. package/esm/css/ButtonGroup.css +0 -1
  211. package/esm/css/Calendar.css +0 -1
  212. package/esm/css/Carousel.css +0 -1
  213. package/esm/css/Chip-ChipGroup.css +8 -0
  214. package/esm/css/Chip.css +65 -0
  215. package/esm/css/ColorInput.css +7 -3
  216. package/esm/css/ColorPicker.css +5 -4
  217. package/esm/css/Combobox.css +1 -2
  218. package/esm/css/DatePicker.css +1 -3
  219. package/esm/css/DateRangePicker.css +7 -3
  220. package/esm/css/Dropzone.css +0 -3
  221. package/esm/css/Fieldset-FieldsetGroup.css +0 -1
  222. package/esm/css/ImageZoom.css +93 -0
  223. package/esm/css/Input.css +1 -1
  224. package/esm/css/Mention.css +93 -0
  225. package/esm/css/Menu-MenuList.css +0 -1
  226. package/esm/css/Modal-ModalAction.css +6 -1
  227. package/esm/css/Modal-ModalActions.css +9 -2
  228. package/esm/css/NumberInput.css +1 -1
  229. package/esm/css/PinInput.css +1 -1
  230. package/esm/css/Radio.css +0 -1
  231. package/esm/css/SegmentedControl.css +0 -1
  232. package/esm/css/Select-SelectDropdown.css +0 -1
  233. package/esm/css/Select-SelectOption.css +0 -1
  234. package/esm/css/Select.css +0 -1
  235. package/esm/css/Splitter.css +77 -0
  236. package/esm/css/Table-TableBody.css +10 -0
  237. package/esm/css/Table-TableHead.css +41 -0
  238. package/esm/css/Table-TableSelectBox.css +11 -0
  239. package/esm/css/TagsInput.css +1 -2
  240. package/esm/css/Textarea.css +1 -1
  241. package/esm/css/Toggle.css +0 -1
  242. package/esm/css/Toolbar.css +32 -0
  243. package/esm/css/Tour.css +81 -0
  244. package/esm/css/use-toasts-toast-item.css +0 -1
  245. package/esm/index.d.ts +15 -1
  246. package/esm/index.js +109 -79
  247. package/esm/styles.css +3206 -2632
  248. package/esm/utils/surface.d.ts +6 -0
  249. package/package.json +1 -1
  250. package/esm/chunk-TKICX5R6.js +0 -351
  251. package/dist/{chunk-DXHNQANX.js → chunk-TPZUTHTQ.js} +3 -3
  252. package/dist/{chunk-TKIUVNKP.js → chunk-XKJDF225.js} +2 -2
  253. package/esm/{chunk-DXHNQANX.js → chunk-TPZUTHTQ.js} +3 -3
  254. package/esm/{chunk-TKIUVNKP.js → chunk-XKJDF225.js} +3 -3
@@ -0,0 +1,249 @@
1
+ import {
2
+ getColors
3
+ } from "./chunk-KBZEYKCZ.js";
4
+ import {
5
+ getSurface
6
+ } from "./chunk-EUYSKHRS.js";
7
+ import {
8
+ use_scale_default,
9
+ with_scale_default
10
+ } from "./chunk-MAICNLTY.js";
11
+ import {
12
+ use_theme_default
13
+ } from "./chunk-V5I4ORQQ.js";
14
+ import {
15
+ joinClasses,
16
+ use_classes_default
17
+ } from "./chunk-5KUROAEP.js";
18
+
19
+ // core/Mention/Mention.tsx
20
+ import React, {
21
+ useEffect,
22
+ useId,
23
+ useLayoutEffect,
24
+ useMemo,
25
+ useRef,
26
+ useState
27
+ } from "react";
28
+
29
+ // css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Mention/Mention.module.css.bolio-css-module-source
30
+ var Mention_module_css_default = { "mention": "Mention-module_mention__R3-5t", "field": "Mention-module_field__U5FXf", "list": "Mention-module_list__QQ5RM", "empty": "Mention-module_empty__YkZOO", "option": "Mention-module_option__8CupI", "active": "Mention-module_active__8GmDl", "disabled": "Mention-module_disabled__4PL94" };
31
+
32
+ // core/Mention/Mention.tsx
33
+ import { jsx, jsxs } from "react/jsx-runtime";
34
+ var getLabel = (option) => {
35
+ var _a;
36
+ return (_a = option.label) != null ? _a : option.value;
37
+ };
38
+ var escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
39
+ var MentionComponent = React.forwardRef(
40
+ ({
41
+ options,
42
+ trigger = "@",
43
+ value: customValue,
44
+ initialValue = "",
45
+ onChange,
46
+ onSelect,
47
+ placeholder,
48
+ rows = 3,
49
+ disabled = false,
50
+ type = "default",
51
+ emptyText = "No results",
52
+ className = "",
53
+ onKeyDown,
54
+ onBlur,
55
+ style,
56
+ ...props
57
+ }, ref) => {
58
+ const theme = use_theme_default();
59
+ const surface = getSurface(theme);
60
+ const { SCALES } = use_scale_default();
61
+ const colors = getColors(theme.palette, type, disabled, {});
62
+ const baseId = useId();
63
+ const listId = `${baseId}-list`;
64
+ const optionId = (index) => `${baseId}-option-${index}`;
65
+ const field = useRef(null);
66
+ const setRef = (node) => {
67
+ field.current = node;
68
+ if (typeof ref === "function") ref(node);
69
+ else if (ref) ref.current = node;
70
+ };
71
+ const isControlled = customValue !== void 0;
72
+ const [selfValue, setSelfValue] = useState(initialValue);
73
+ const text = isControlled ? customValue : selfValue;
74
+ const [caret, setCaret] = useState(text.length);
75
+ const [dismissed, setDismissed] = useState(false);
76
+ const [activeIndex, setActiveIndex] = useState(-1);
77
+ const pendingCaret = useRef(null);
78
+ const token = useMemo(() => {
79
+ const t = escapeRegExp(trigger);
80
+ const match = new RegExp(`(^|\\s)${t}([^\\s${t}]*)$`).exec(
81
+ text.slice(0, caret)
82
+ );
83
+ return match ? { query: match[2], start: caret - match[2].length - trigger.length } : null;
84
+ }, [text, caret, trigger]);
85
+ const visible = useMemo(
86
+ () => token ? options.filter(
87
+ (option) => getLabel(option).toLowerCase().includes(token.query.toLowerCase())
88
+ ) : [],
89
+ [options, token]
90
+ );
91
+ const open = !!token && !dismissed && !disabled;
92
+ const expanded = open && visible.length > 0;
93
+ useEffect(() => {
94
+ setActiveIndex(
95
+ open ? visible.findIndex((option) => !option.disabled) : -1
96
+ );
97
+ }, [open, token == null ? void 0 : token.query]);
98
+ useEffect(() => {
99
+ var _a, _b;
100
+ if (activeIndex < 0) return;
101
+ (_b = (_a = document.getElementById(optionId(activeIndex))) == null ? void 0 : _a.scrollIntoView) == null ? void 0 : _b.call(_a, { block: "nearest" });
102
+ }, [activeIndex]);
103
+ useLayoutEffect(() => {
104
+ if (pendingCaret.current === null || !field.current) return;
105
+ field.current.setSelectionRange(
106
+ pendingCaret.current,
107
+ pendingCaret.current
108
+ );
109
+ pendingCaret.current = null;
110
+ }, [text]);
111
+ const update = (next) => {
112
+ if (!isControlled) setSelfValue(next);
113
+ if (onChange) onChange(next);
114
+ };
115
+ const choose = (option) => {
116
+ if (option.disabled || !token) return;
117
+ const inserted = `${trigger}${option.value} `;
118
+ const next = text.slice(0, token.start) + inserted + text.slice(caret);
119
+ const position = token.start + inserted.length;
120
+ pendingCaret.current = position;
121
+ setCaret(position);
122
+ update(next);
123
+ if (onSelect) onSelect(option);
124
+ };
125
+ const changeHandler = (event) => {
126
+ setCaret(event.target.selectionStart);
127
+ setDismissed(false);
128
+ update(event.target.value);
129
+ };
130
+ const move = (direction) => {
131
+ const count = visible.length;
132
+ let index = activeIndex;
133
+ for (let step = 0; step < count; step++) {
134
+ index = (index + direction + count) % count;
135
+ if (!visible[index].disabled) return setActiveIndex(index);
136
+ }
137
+ };
138
+ const keyDownHandler = (event) => {
139
+ if (onKeyDown) onKeyDown(event);
140
+ if (event.defaultPrevented || !expanded) return;
141
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
142
+ event.preventDefault();
143
+ move(event.key === "ArrowDown" ? 1 : -1);
144
+ } else if ((event.key === "Enter" || event.key === "Tab") && activeIndex >= 0) {
145
+ event.preventDefault();
146
+ choose(visible[activeIndex]);
147
+ } else if (event.key === "Escape") {
148
+ event.preventDefault();
149
+ setDismissed(true);
150
+ }
151
+ };
152
+ const syncCaret = (event) => {
153
+ const next = event.currentTarget.selectionStart;
154
+ if (next !== caret) {
155
+ setCaret(next);
156
+ setDismissed(false);
157
+ }
158
+ };
159
+ const blurHandler = (event) => {
160
+ if (onBlur) onBlur(event);
161
+ setDismissed(true);
162
+ };
163
+ const mentionStyle = {
164
+ "--mention-font-size": SCALES.font(0.875),
165
+ "--mention-width": SCALES.width(1, "100%"),
166
+ "--mention-height": SCALES.height(1, "auto"),
167
+ "--mention-margin-top": SCALES.mt(0),
168
+ "--mention-margin-right": SCALES.mr(0),
169
+ "--mention-margin-bottom": SCALES.mb(0),
170
+ "--mention-margin-left": SCALES.ml(0),
171
+ "--mention-text-color": theme.palette.foreground,
172
+ "--mention-bg": surface.bg,
173
+ "--mention-border-color": theme.palette.border,
174
+ "--mention-radius": theme.layout.radius,
175
+ "--mention-field-color": colors.color,
176
+ "--mention-field-bg": colors.bgColor,
177
+ "--mention-field-border": colors.borderColor,
178
+ "--mention-field-hover-bg": colors.hoverBgColor,
179
+ "--mention-field-hover-border": colors.hoverBorder,
180
+ "--mention-focus-border-color": colors.focusBorder,
181
+ "--mention-placeholder-color": colors.placeholderColor,
182
+ "--mention-shadow": surface.shadow,
183
+ "--mention-active-bg": surface.hover,
184
+ "--mention-empty-color": theme.palette.accents_5,
185
+ ...style
186
+ };
187
+ return /* @__PURE__ */ jsxs(
188
+ "div",
189
+ {
190
+ className: use_classes_default(Mention_module_css_default.mention, className),
191
+ style: mentionStyle,
192
+ children: [
193
+ /* @__PURE__ */ jsx(
194
+ "textarea",
195
+ {
196
+ ref: setRef,
197
+ "aria-autocomplete": "list",
198
+ "aria-controls": expanded ? listId : void 0,
199
+ "aria-activedescendant": expanded && activeIndex >= 0 ? optionId(activeIndex) : void 0,
200
+ value: text,
201
+ rows,
202
+ placeholder,
203
+ disabled,
204
+ onChange: changeHandler,
205
+ onKeyDown: keyDownHandler,
206
+ onKeyUp: syncCaret,
207
+ onClick: syncCaret,
208
+ onSelect: syncCaret,
209
+ onBlur: blurHandler,
210
+ className: Mention_module_css_default.field,
211
+ ...props
212
+ }
213
+ ),
214
+ expanded && /* @__PURE__ */ jsx("ul", { id: listId, role: "listbox", className: Mention_module_css_default.list, children: visible.map((option, index) => /* @__PURE__ */ jsx(
215
+ "li",
216
+ {
217
+ id: optionId(index),
218
+ role: "option",
219
+ "aria-selected": index === activeIndex,
220
+ "aria-disabled": option.disabled || void 0,
221
+ className: joinClasses(Mention_module_css_default.option, {
222
+ [Mention_module_css_default.active]: index === activeIndex,
223
+ [Mention_module_css_default.disabled]: option.disabled
224
+ }),
225
+ onMouseDown: (event) => {
226
+ event.preventDefault();
227
+ choose(option);
228
+ },
229
+ onMouseMove: () => !option.disabled && setActiveIndex(index),
230
+ children: getLabel(option)
231
+ },
232
+ option.value
233
+ )) }),
234
+ open && visible.length === 0 && /* @__PURE__ */ jsx("div", { className: Mention_module_css_default.empty, children: emptyText })
235
+ ]
236
+ }
237
+ );
238
+ }
239
+ );
240
+ MentionComponent.displayName = "BolioUIMention";
241
+ var Mention = with_scale_default(MentionComponent);
242
+ var Mention_default = Mention;
243
+
244
+ // core/Mention/index.ts
245
+ var Mention_default2 = Mention_default;
246
+
247
+ export {
248
+ Mention_default2 as Mention_default
249
+ };
@@ -6,10 +6,13 @@ import {
6
6
  fromISO,
7
7
  startOfDay,
8
8
  toISO
9
- } from "./chunk-P245HSVB.js";
9
+ } from "./chunk-TLVSZCKU.js";
10
10
  import {
11
11
  use_click_away_default
12
12
  } from "./chunk-DGXZP4VJ.js";
13
+ import {
14
+ getSurface
15
+ } from "./chunk-EUYSKHRS.js";
13
16
  import {
14
17
  use_scale_default,
15
18
  with_scale_default
@@ -52,6 +55,7 @@ var DatePickerComponent = React.forwardRef(
52
55
  ...props
53
56
  }, ref) => {
54
57
  const theme = use_theme_default();
58
+ const surface = getSurface(theme);
55
59
  const { SCALES } = use_scale_default();
56
60
  const colors = getColors(theme.palette, type, disabled, {
57
61
  filled,
@@ -117,7 +121,8 @@ var DatePickerComponent = React.forwardRef(
117
121
  "--datepicker-margin-bottom": SCALES.mb(0),
118
122
  "--datepicker-margin-left": SCALES.ml(0),
119
123
  "--datepicker-text-color": theme.palette.foreground,
120
- "--datepicker-bg": theme.palette.background,
124
+ "--datepicker-bg": surface.bg,
125
+ "--calendar-popup-hover": surface.hover,
121
126
  "--datepicker-border-color": theme.palette.border,
122
127
  "--datepicker-radius": rounded ? "25px" : theme.layout.radius,
123
128
  "--datepicker-popup-radius": theme.layout.radius,
@@ -131,7 +136,7 @@ var DatePickerComponent = React.forwardRef(
131
136
  "--datepicker-toggle-color": colors.iconColor,
132
137
  "--datepicker-toggle-hover-color": colors.color,
133
138
  "--datepicker-toggle-disabled-color": colors.iconColor,
134
- "--datepicker-shadow": theme.expressiveness.shadowMedium
139
+ "--datepicker-shadow": surface.shadow
135
140
  };
136
141
  return /* @__PURE__ */ jsxs(
137
142
  "div",
@@ -20,6 +20,9 @@ import {
20
20
  import {
21
21
  use_click_away_default
22
22
  } from "./chunk-DGXZP4VJ.js";
23
+ import {
24
+ getSurface
25
+ } from "./chunk-EUYSKHRS.js";
23
26
  import {
24
27
  use_scale_default,
25
28
  with_scale_default
@@ -319,6 +322,8 @@ var TooltipContent = ({
319
322
  [type, theme.palette, light, ghost, subtle]
320
323
  );
321
324
  const hasShadow = type === "default";
325
+ const surface = getSurface(theme);
326
+ const bgColor = hasShadow && colors.bgColor === theme.palette.background ? surface.bg : colors.bgColor;
322
327
  const classes = use_classes_default(
323
328
  "tooltip-content",
324
329
  TooltipContent_module_css_default.tooltipContent,
@@ -350,14 +355,14 @@ var TooltipContent = ({
350
355
  const contentStyle = {
351
356
  "--tooltip-icon-offset-x": iconOffset.x,
352
357
  "--tooltip-icon-offset-y": iconOffset.y,
353
- "--tooltip-content-bg": colors.bgColor,
358
+ "--tooltip-content-bg": bgColor,
354
359
  top: rect.top,
355
360
  left: rect.left,
356
361
  transform: rect.transform,
357
362
  color: colors.color,
358
363
  border: `1px solid ${colors.borderColor}`,
359
364
  borderRadius: theme.layout.radius,
360
- boxShadow: hasShadow ? theme.expressiveness.shadowMedium : "none",
365
+ boxShadow: hasShadow ? surface.shadow : "none",
361
366
  width: SCALES.width(1, "auto"),
362
367
  height: SCALES.height(1, "auto")
363
368
  };
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  getColors
3
3
  } from "./chunk-KBZEYKCZ.js";
4
+ import {
5
+ getSurface
6
+ } from "./chunk-EUYSKHRS.js";
4
7
  import {
5
8
  use_scale_default,
6
9
  with_scale_default
@@ -50,6 +53,7 @@ var ComboboxComponent = React.forwardRef(
50
53
  ...props
51
54
  }, ref) => {
52
55
  const theme = use_theme_default();
56
+ const surface = getSurface(theme);
53
57
  const { SCALES } = use_scale_default();
54
58
  const colors = getColors(theme.palette, type, disabled, {
55
59
  filled,
@@ -148,7 +152,7 @@ var ComboboxComponent = React.forwardRef(
148
152
  "--combobox-margin-bottom": SCALES.mb(0),
149
153
  "--combobox-margin-left": SCALES.ml(0),
150
154
  "--combobox-text-color": theme.palette.foreground,
151
- "--combobox-bg": theme.palette.background,
155
+ "--combobox-bg": surface.bg,
152
156
  "--combobox-border-color": theme.palette.border,
153
157
  "--combobox-radius": rounded ? "25px" : theme.layout.radius,
154
158
  "--combobox-popup-radius": theme.layout.radius,
@@ -160,8 +164,8 @@ var ComboboxComponent = React.forwardRef(
160
164
  "--combobox-focus-border-color": colors.focusBorder,
161
165
  "--combobox-placeholder-color": colors.placeholderColor,
162
166
  "--combobox-disabled-color": theme.palette.accents_4,
163
- "--combobox-shadow": theme.expressiveness.shadowMedium,
164
- "--combobox-active-bg": theme.palette.accents_2,
167
+ "--combobox-shadow": surface.shadow,
168
+ "--combobox-active-bg": surface.hover,
165
169
  "--combobox-empty-color": theme.palette.accents_5
166
170
  };
167
171
  return /* @__PURE__ */ jsxs(
@@ -1,9 +1,12 @@
1
1
  import {
2
2
  Modal_default
3
- } from "./chunk-6ZBFUZSL.js";
3
+ } from "./chunk-CU6SNPIM.js";
4
4
  import {
5
5
  Input_default
6
6
  } from "./chunk-NEG5UNM6.js";
7
+ import {
8
+ getSurface
9
+ } from "./chunk-EUYSKHRS.js";
7
10
  import {
8
11
  use_theme_default
9
12
  } from "./chunk-V5I4ORQQ.js";
@@ -97,7 +100,7 @@ var Command = ({
97
100
  "aria-selected": index === active,
98
101
  className: Command_module_css_default.item,
99
102
  style: {
100
- backgroundColor: index === active ? theme.palette.accents_2 : void 0
103
+ backgroundColor: index === active ? getSurface(theme).hover : void 0
101
104
  },
102
105
  onMouseEnter: () => setActive(index),
103
106
  onClick: () => select(item),
@@ -0,0 +1,131 @@
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
+ use_classes_default
10
+ } from "./chunk-5KUROAEP.js";
11
+
12
+ // core/Toolbar/Toolbar.tsx
13
+ import React, { useEffect, useRef } from "react";
14
+
15
+ // css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/Toolbar/Toolbar.module.css.bolio-css-module-source
16
+ var Toolbar_module_css_default = { "toolbar": "Toolbar-module_toolbar__GZv6U", "vertical": "Toolbar-module_vertical__bTAsV", "separator": "Toolbar-module_separator__Gs9-M" };
17
+
18
+ // core/Toolbar/Toolbar.tsx
19
+ import { jsx } from "react/jsx-runtime";
20
+ var ITEMS = "button, a[href], input, select, textarea";
21
+ var ToolbarComponent = React.forwardRef(
22
+ ({
23
+ orientation = "horizontal",
24
+ className = "",
25
+ children,
26
+ onKeyDown,
27
+ onFocus,
28
+ style,
29
+ ...props
30
+ }, innerRef) => {
31
+ const theme = use_theme_default();
32
+ const { SCALES } = use_scale_default();
33
+ const ref = useRef(null);
34
+ const current = useRef(null);
35
+ const getItems = () => {
36
+ var _a, _b;
37
+ return Array.from(
38
+ (_b = (_a = ref.current) == null ? void 0 : _a.querySelectorAll(ITEMS)) != null ? _b : []
39
+ ).filter(
40
+ (item) => !item.disabled && item.getAttribute("role") !== "separator"
41
+ );
42
+ };
43
+ useEffect(() => {
44
+ var _a;
45
+ const items = getItems();
46
+ const active = (_a = items.find((item) => item === current.current)) != null ? _a : items[0];
47
+ items.forEach(
48
+ (item) => item.setAttribute("tabindex", item === active ? "0" : "-1")
49
+ );
50
+ });
51
+ const setRef = (node) => {
52
+ ref.current = node;
53
+ if (typeof innerRef === "function") innerRef(node);
54
+ else if (innerRef) innerRef.current = node;
55
+ };
56
+ const focusHandler = (event) => {
57
+ if (onFocus) onFocus(event);
58
+ const items = getItems();
59
+ if (items.includes(event.target)) {
60
+ current.current = event.target;
61
+ items.forEach(
62
+ (item) => item.setAttribute("tabindex", item === event.target ? "0" : "-1")
63
+ );
64
+ }
65
+ };
66
+ const keyHandler = (event) => {
67
+ if (onKeyDown) onKeyDown(event);
68
+ if (event.defaultPrevented) return;
69
+ const vertical = orientation === "vertical";
70
+ const items = getItems();
71
+ const index = items.indexOf(event.target);
72
+ if (index === -1) return;
73
+ let next = -1;
74
+ if (event.key === (vertical ? "ArrowDown" : "ArrowRight"))
75
+ next = (index + 1) % items.length;
76
+ else if (event.key === (vertical ? "ArrowUp" : "ArrowLeft"))
77
+ next = (index - 1 + items.length) % items.length;
78
+ else if (event.key === "Home") next = 0;
79
+ else if (event.key === "End") next = items.length - 1;
80
+ if (next === -1) return;
81
+ event.preventDefault();
82
+ items[next].focus();
83
+ };
84
+ const toolbarStyle = {
85
+ margin: `${SCALES.mt(0)} ${SCALES.mr(0)} ${SCALES.mb(0)} ${SCALES.ml(0)}`,
86
+ "--toolbar-border": theme.palette.border,
87
+ "--toolbar-radius": theme.layout.radius,
88
+ ...style
89
+ };
90
+ return /* @__PURE__ */ jsx(
91
+ "div",
92
+ {
93
+ ref: setRef,
94
+ role: "toolbar",
95
+ "aria-orientation": orientation,
96
+ className: use_classes_default(Toolbar_module_css_default.toolbar, Toolbar_module_css_default[orientation], className),
97
+ onKeyDown: keyHandler,
98
+ onFocus: focusHandler,
99
+ ...props,
100
+ style: toolbarStyle,
101
+ children
102
+ }
103
+ );
104
+ }
105
+ );
106
+ ToolbarComponent.displayName = "BolioUIToolbar";
107
+ var Toolbar = with_scale_default(ToolbarComponent);
108
+ var Toolbar_default = Toolbar;
109
+
110
+ // core/Toolbar/ToolbarSeparator.tsx
111
+ import React2 from "react";
112
+ import { jsx as jsx2 } from "react/jsx-runtime";
113
+ var ToolbarSeparator = React2.forwardRef(({ className = "", ...props }, ref) => /* @__PURE__ */ jsx2(
114
+ "div",
115
+ {
116
+ ref,
117
+ role: "separator",
118
+ className: use_classes_default(Toolbar_module_css_default.separator, className),
119
+ ...props
120
+ }
121
+ ));
122
+ ToolbarSeparator.displayName = "BolioUIToolbarSeparator";
123
+ var ToolbarSeparator_default = ToolbarSeparator;
124
+
125
+ // core/Toolbar/index.ts
126
+ Toolbar_default.Separator = ToolbarSeparator_default;
127
+ var Toolbar_default2 = Toolbar_default;
128
+
129
+ export {
130
+ Toolbar_default2 as Toolbar_default
131
+ };
@@ -0,0 +1,109 @@
1
+ import {
2
+ Image_default
3
+ } from "./chunk-TWIOSRRP.js";
4
+ import {
5
+ use_classes_default
6
+ } from "./chunk-5KUROAEP.js";
7
+
8
+ // core/ImageZoom/ImageZoom.tsx
9
+ import React, { useEffect, useRef, useState } from "react";
10
+
11
+ // css-module-source:/Users/brunnoandrade/Desktop/BolioUI/bolio-ui/core/ImageZoom/ImageZoom.module.css.bolio-css-module-source
12
+ var ImageZoom_module_css_default = { "trigger": "ImageZoom-module_trigger__-42Bz", "dialog": "ImageZoom-module_dialog__TjA9E", "figure": "ImageZoom-module_figure__YIBq1", "zoomed": "ImageZoom-module_zoomed__7gfCP", "caption": "ImageZoom-module_caption__6SFRA", "close": "ImageZoom-module_close__iEiwJ" };
13
+
14
+ // core/ImageZoom/ImageZoom.tsx
15
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
16
+ var ImageZoom = React.forwardRef(
17
+ ({
18
+ src,
19
+ alt,
20
+ zoomSrc,
21
+ caption,
22
+ closeLabel = "Close",
23
+ className = "",
24
+ ...imageProps
25
+ }, ref) => {
26
+ const [open, setOpen] = useState(false);
27
+ const dialog = useRef(null);
28
+ useEffect(() => {
29
+ var _a;
30
+ if (open) (_a = dialog.current) == null ? void 0 : _a.showModal();
31
+ }, [open]);
32
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
33
+ /* @__PURE__ */ jsx(
34
+ "button",
35
+ {
36
+ ref,
37
+ type: "button",
38
+ className: use_classes_default(ImageZoom_module_css_default.trigger, className),
39
+ "aria-haspopup": "dialog",
40
+ onClick: () => setOpen(true),
41
+ children: /* @__PURE__ */ jsx(Image_default, { src, alt, ...imageProps })
42
+ }
43
+ ),
44
+ open && /* @__PURE__ */ jsxs(
45
+ "dialog",
46
+ {
47
+ ref: dialog,
48
+ "aria-label": alt,
49
+ className: ImageZoom_module_css_default.dialog,
50
+ onClose: () => setOpen(false),
51
+ onKeyDown: (event) => {
52
+ var _a;
53
+ if (event.key === "Escape") (_a = dialog.current) == null ? void 0 : _a.close();
54
+ },
55
+ onClick: (event) => {
56
+ var _a;
57
+ if (event.target === event.currentTarget) (_a = dialog.current) == null ? void 0 : _a.close();
58
+ },
59
+ children: [
60
+ /* @__PURE__ */ jsxs("figure", { className: ImageZoom_module_css_default.figure, children: [
61
+ /* @__PURE__ */ jsx("img", { src: zoomSrc || src, alt, className: ImageZoom_module_css_default.zoomed }),
62
+ caption && /* @__PURE__ */ jsx("figcaption", { className: ImageZoom_module_css_default.caption, children: caption })
63
+ ] }),
64
+ /* @__PURE__ */ jsx(
65
+ "button",
66
+ {
67
+ type: "button",
68
+ className: ImageZoom_module_css_default.close,
69
+ "aria-label": closeLabel,
70
+ onClick: () => {
71
+ var _a;
72
+ return (_a = dialog.current) == null ? void 0 : _a.close();
73
+ },
74
+ children: /* @__PURE__ */ jsx(
75
+ "svg",
76
+ {
77
+ viewBox: "0 0 24 24",
78
+ width: "1.5em",
79
+ height: "1.5em",
80
+ "aria-hidden": "true",
81
+ children: /* @__PURE__ */ jsx(
82
+ "path",
83
+ {
84
+ d: "M6 6l12 12M18 6L6 18",
85
+ fill: "none",
86
+ stroke: "currentColor",
87
+ strokeWidth: "2",
88
+ strokeLinecap: "round"
89
+ }
90
+ )
91
+ }
92
+ )
93
+ }
94
+ )
95
+ ]
96
+ }
97
+ )
98
+ ] });
99
+ }
100
+ );
101
+ ImageZoom.displayName = "BolioUIImageZoom";
102
+ var ImageZoom_default = ImageZoom;
103
+
104
+ // core/ImageZoom/index.ts
105
+ var ImageZoom_default2 = ImageZoom_default;
106
+
107
+ export {
108
+ ImageZoom_default2 as ImageZoom_default
109
+ };
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  use_click_away_default
3
3
  } from "./chunk-DGXZP4VJ.js";
4
+ import {
5
+ getSurface
6
+ } from "./chunk-EUYSKHRS.js";
4
7
  import {
5
8
  Loading_default
6
9
  } from "./chunk-LMDBE6T6.js";
@@ -231,6 +234,7 @@ var ButtonDropdownComponent = React3.forwardRef(
231
234
  const innerRef = useRef(null);
232
235
  useImperativeHandle(ref, () => innerRef.current);
233
236
  const theme = use_theme_default();
237
+ const surface = getSurface(theme);
234
238
  const colors = getColor(theme.palette, type);
235
239
  const itemChildren = pickChild(children, ButtonDropdownItem_default)[1];
236
240
  const [itemChildrenWithoutMain, mainItemChildren] = pickChildByProps(
@@ -328,9 +332,9 @@ var ButtonDropdownComponent = React3.forwardRef(
328
332
  {
329
333
  className: ButtonDropdown_module_css_default.content,
330
334
  style: {
331
- boxShadow: theme.expressiveness.shadowMedium,
335
+ boxShadow: surface.shadow,
332
336
  transform: "translateY(4px)",
333
- backgroundColor: type === "default" ? theme.palette.background : colors.bgColor
337
+ backgroundColor: type === "default" ? surface.bg : colors.bgColor
334
338
  },
335
339
  children: itemChildrenWithoutMain
336
340
  }