@memobit/libs 3.0.0 → 3.1.1
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/components/Accordion/Accordion.css +1 -0
- package/dist/components/Accordion/Accordion2.js +79 -0
- package/dist/components/AlertDialog/AlertDialog.css +1 -0
- package/dist/components/AlertDialog/AlertDialog2.js +26 -0
- package/dist/components/AnalogClock/AnalogClock.css +1 -0
- package/dist/components/AnalogClock/AnalogClock2.js +293 -0
- package/dist/components/AngleSlider/AngleSlider.css +1 -0
- package/dist/components/AngleSlider/AngleSlider2.js +135 -0
- package/dist/components/AppHeader/AppHeader.css +1 -0
- package/dist/components/AppHeader/AppHeader2.js +44 -0
- package/dist/components/Auth/ChangePasswordModal/ChangePasswordModal.css +1 -0
- package/dist/components/Auth/ChangePasswordModal/ChangePasswordModal2.js +138 -0
- package/dist/components/Auth/Login/Login.css +1 -0
- package/dist/components/Auth/Login/Login2.js +155 -0
- package/dist/components/Auth/MfaSetupModal/MfaSetupModal.css +1 -0
- package/dist/components/Auth/MfaSetupModal/MfaSetupModal2.js +327 -0
- package/dist/components/AvatarInitials/AvatarInitials.css +1 -0
- package/dist/components/AvatarInitials/AvatarInitials2.js +73 -0
- package/dist/components/BMI/BMI.css +1 -0
- package/dist/components/BMI/BMI2.js +53 -0
- package/dist/components/BMI/bmiUtils.js +265 -0
- package/dist/components/Badge/Badge.css +1 -0
- package/dist/components/Badge/Badge2.js +30 -0
- package/dist/components/Banner/Banner.css +1 -0
- package/dist/components/Banner/Banner2.js +57 -0
- package/dist/components/Blockquote/Blockquote.css +1 -0
- package/dist/components/Blockquote/Blockquote2.js +55 -0
- package/dist/components/Breadcrumb/Breadcrumb.css +1 -0
- package/dist/components/Breadcrumb/Breadcrumb2.js +36 -0
- package/dist/components/BulkActionBar/BulkActionBar.css +1 -0
- package/dist/components/BulkActionBar/BulkActionBar2.js +39 -0
- package/dist/components/Button/Button.css +1 -0
- package/dist/components/Button/Button2.js +32 -0
- package/dist/components/Calendar/Calendar.css +1 -0
- package/dist/components/Calendar/Calendar2.js +279 -0
- package/dist/components/CalendarHeatmap/CalendarHeatmap.css +1 -0
- package/dist/components/CalendarHeatmap/CalendarHeatmap2.js +91 -0
- package/dist/components/Card/Card.css +1 -0
- package/dist/components/Card/Card2.js +47 -0
- package/dist/components/Checkbox/Checkbox.css +1 -0
- package/dist/components/Checkbox/Checkbox2.js +35 -0
- package/dist/components/Chip/Chip.css +1 -0
- package/dist/components/Chip/Chip2.js +31 -0
- package/dist/components/CollapsibleSection/CollapsibleSection.css +1 -0
- package/dist/components/CollapsibleSection/CollapsibleSection2.js +68 -0
- package/dist/components/ColorPicker/ColorPicker.css +1 -0
- package/dist/components/ColorPicker/ColorPicker2.js +257 -0
- package/dist/components/CommandPalette/CommandPalette.css +1 -0
- package/dist/components/CommandPalette/CommandPalette2.js +97 -0
- package/dist/components/Confetti/Confetti.css +1 -0
- package/dist/components/Confetti/Confetti2.js +175 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.css +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog2.js +37 -0
- package/dist/components/ConfirmPopover/ConfirmPopover.css +1 -0
- package/dist/components/ConfirmPopover/ConfirmPopover2.js +55 -0
- package/dist/components/ContextMenu/ContextMenu.css +1 -0
- package/dist/components/ContextMenu/ContextMenu2.js +53 -0
- package/dist/components/ContextToast/ContextToast.css +1 -0
- package/dist/components/ContextToast/ContextToast2.js +96 -0
- package/dist/components/ControlPanel/ControlPanel.css +1 -0
- package/dist/components/ControlPanel/ControlPanel.types.js +21 -0
- package/dist/components/ControlPanel/ControlPanel2.js +137 -0
- package/dist/components/ControlPanel/ControlPanelContext.js +31 -0
- package/dist/components/ControlPanel/ControlPanelFilter.js +386 -0
- package/dist/components/ControlPanel/ControlPanelNav.js +74 -0
- package/dist/components/ControlPanel/ControlPanelOptions.js +197 -0
- package/dist/components/CopyButton/CopyButton.css +1 -0
- package/dist/components/CopyButton/CopyButton2.js +48 -0
- package/dist/components/CountryWithFlag/CountryWithFlag.css +1 -0
- package/dist/components/CountryWithFlag/CountryWithFlag2.js +21 -0
- package/dist/components/DataView/DataView.CardView.js +189 -0
- package/dist/components/DataView/DataView.ColumnSelector.js +51 -0
- package/dist/components/DataView/DataView.MiniSort.js +25 -0
- package/dist/components/DataView/DataView.css +1 -0
- package/dist/components/DataView/DataView2.js +433 -0
- package/dist/components/DatePicker/DatePicker.css +1 -0
- package/dist/components/DatePicker/DatePicker2.js +151 -0
- package/dist/components/DateRangePicker/DateRangePicker.css +1 -0
- package/dist/components/DateRangePicker/DateRangePicker2.js +223 -0
- package/dist/components/DayAgenda/DayAgenda.css +1 -0
- package/dist/components/DayAgenda/DayAgenda2.js +120 -0
- package/dist/components/DiffViewer/DiffViewer.css +1 -0
- package/dist/components/DiffViewer/DiffViewer2.js +270 -0
- package/dist/components/Drawer/Drawer.css +1 -0
- package/dist/components/Drawer/Drawer2.js +119 -0
- package/dist/components/Dropdown/Dropdown.css +1 -0
- package/dist/components/Dropdown/Dropdown2.js +413 -0
- package/dist/components/EmojiPicker/EmojiPicker.css +1 -0
- package/dist/components/EmojiPicker/EmojiPicker2.js +789 -0
- package/dist/components/EmojiPicker/emojiKeywords/activities.js +508 -0
- package/dist/components/EmojiPicker/emojiKeywords/animals.js +501 -0
- package/dist/components/EmojiPicker/emojiKeywords/food.js +540 -0
- package/dist/components/EmojiPicker/emojiKeywords/index.js +21 -0
- package/dist/components/EmojiPicker/emojiKeywords/objects.js +652 -0
- package/dist/components/EmojiPicker/emojiKeywords/people.js +488 -0
- package/dist/components/EmojiPicker/emojiKeywords/smileys.js +538 -0
- package/dist/components/EmojiPicker/emojiKeywords/symbols.js +597 -0
- package/dist/components/EmojiPicker/emojiKeywords/travel.js +507 -0
- package/dist/components/EmptyState/EmptyState.css +1 -0
- package/dist/components/EmptyState/EmptyState2.js +47 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.css +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary2.js +37 -0
- package/dist/components/EventCalendar/EventCalendar.Chip.js +45 -0
- package/dist/components/EventCalendar/EventCalendar.Month.js +118 -0
- package/dist/components/EventCalendar/EventCalendar.Week.js +131 -0
- package/dist/components/EventCalendar/EventCalendar.css +1 -0
- package/dist/components/EventCalendar/EventCalendar.helpers.js +72 -0
- package/dist/components/EventCalendar/EventCalendar2.js +157 -0
- package/dist/components/FileDropzone/FileDropzone.css +1 -0
- package/dist/components/FileDropzone/FileDropzone2.js +71 -0
- package/dist/components/Flag/Flag.css +1 -0
- package/dist/components/Flag/Flag2.js +36 -0
- package/dist/components/FloatButton/FloatButton.css +1 -0
- package/dist/components/FloatButton/FloatButton2.js +68 -0
- package/dist/components/FloatingWindow/FloatingWindow.css +1 -0
- package/dist/components/FloatingWindow/FloatingWindow2.js +203 -0
- package/dist/components/FolderBrowserModal/FolderBrowserModal.css +1 -0
- package/dist/components/FolderBrowserModal/FolderBrowserModal2.js +144 -0
- package/dist/components/Grid/Col.js +17 -0
- package/dist/components/Grid/Grid.css +1 -0
- package/dist/components/Grid/Grid2.js +28 -0
- package/dist/components/Icon/Icon.css +1 -0
- package/dist/components/Icon/Icon2.js +23 -0
- package/dist/components/IconPicker/IconPicker.css +1 -0
- package/dist/components/IconPicker/IconPicker2.js +51 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.css +1 -0
- package/dist/components/InfiniteScroll/InfiniteScroll2.js +66 -0
- package/dist/components/InputDate/InputDate.css +1 -0
- package/dist/components/InputDate/InputDate2.js +87 -0
- package/dist/components/InputEmail/InputEmail.css +1 -0
- package/dist/components/InputEmail/InputEmail2.js +73 -0
- package/dist/components/InputFile/InputFile.css +1 -0
- package/dist/components/InputFile/InputFile2.js +41 -0
- package/dist/components/InputMask/InputMask.css +1 -0
- package/dist/components/InputMask/InputMask2.js +163 -0
- package/dist/components/InputNumber/InputNumber.css +1 -0
- package/dist/components/InputNumber/InputNumber2.js +60 -0
- package/dist/components/InputPIN/InputPIN.css +1 -0
- package/dist/components/InputPIN/InputPIN2.js +121 -0
- package/dist/components/InputPassword/InputPassword.css +1 -0
- package/dist/components/InputPassword/InputPassword2.js +47 -0
- package/dist/components/InputPhone/InputPhone.css +1 -0
- package/dist/components/InputPhone/InputPhone2.js +82 -0
- package/dist/components/InputSearch/InputSearch.css +1 -0
- package/dist/components/InputSearch/InputSearch2.js +53 -0
- package/dist/components/InputText/InputText.css +1 -0
- package/dist/components/InputText/InputText2.js +47 -0
- package/dist/components/InputTextarea/InputTextarea.css +1 -0
- package/dist/components/InputTextarea/InputTextarea2.js +46 -0
- package/dist/components/InputTime/InputTime.css +1 -0
- package/dist/components/InputTime/InputTime2.js +85 -0
- package/dist/components/InputUrl/InputUrl.css +1 -0
- package/dist/components/InputUrl/InputUrl2.js +65 -0
- package/dist/components/JourneyWizard/JourneyWizard.css +1 -0
- package/dist/components/JourneyWizard/JourneyWizard2.js +147 -0
- package/dist/components/List/List.css +1 -0
- package/dist/components/List/List2.js +28 -0
- package/dist/components/Loading/Loading.css +1 -0
- package/dist/components/Loading/Loading2.js +11 -0
- package/dist/components/MenuHamburger/MenuHamburger.css +1 -0
- package/dist/components/MenuHamburger/MenuHamburger2.js +65 -0
- package/dist/components/MiniSort/MiniSort.css +1 -0
- package/dist/components/MiniSort/MiniSort2.js +52 -0
- package/dist/components/MiniStatsCard/MiniStatsCard.css +1 -0
- package/dist/components/MiniStatsCard/MiniStatsCard2.js +67 -0
- package/dist/components/Minimap/Minimap.css +1 -0
- package/dist/components/Minimap/Minimap2.js +62 -0
- package/dist/components/Modal/Modal.css +1 -0
- package/dist/components/Modal/Modal2.js +87 -0
- package/dist/components/NavBar/NavBar.css +1 -0
- package/dist/components/NavBar/NavBar2.js +64 -0
- package/dist/components/NotificationPanel/NotificationPanel.css +1 -0
- package/dist/components/NotificationPanel/NotificationPanel2.js +66 -0
- package/dist/components/Pagination/Pagination.css +1 -0
- package/dist/components/Pagination/Pagination2.js +92 -0
- package/dist/components/PieChart/PieChart.css +1 -0
- package/dist/components/PieChart/PieChart2.js +142 -0
- package/dist/components/Popover/Popover.css +1 -0
- package/dist/components/Popover/Popover2.js +109 -0
- package/dist/components/Popover/hooks/Popover.hook.js +33 -0
- package/dist/components/ProgressBar/ProgressBar.css +1 -0
- package/dist/components/ProgressBar/ProgressBar2.js +48 -0
- package/dist/components/ProgressRing/ProgressRing.css +1 -0
- package/dist/components/ProgressRing/ProgressRing2.js +54 -0
- package/dist/components/QuantitySelector/QuantitySelector.css +1 -0
- package/dist/components/QuantitySelector/QuantitySelector2.js +94 -0
- package/dist/components/QuickAdd/QuickAdd.css +1 -0
- package/dist/components/QuickAdd/QuickAdd2.js +56 -0
- package/dist/components/QuickNumberUpdate/QuickNumberUpdate.css +1 -0
- package/dist/components/QuickNumberUpdate/QuickNumberUpdate2.js +52 -0
- package/dist/components/QuickOptionUpdate/QuickOptionUpdate.css +1 -0
- package/dist/components/QuickOptionUpdate/QuickOptionUpdate2.js +67 -0
- package/dist/components/Radio/Radio.css +1 -0
- package/dist/components/Radio/Radio2.js +36 -0
- package/dist/components/RangeSlider/RangeSlider.css +1 -0
- package/dist/components/RangeSlider/RangeSlider2.js +157 -0
- package/dist/components/Rating/Rating.css +1 -0
- package/dist/components/Rating/Rating2.js +148 -0
- package/dist/components/Rating/RatingIcon.js +102 -0
- package/dist/components/RichTextEditor/RichTextEditor.css +1 -0
- package/dist/components/RichTextEditor/RichTextEditor2.js +212 -0
- package/dist/components/RichTextEditor/RteLinkPrompt.js +42 -0
- package/dist/components/RichTextEditor/RteTableToolbar.js +95 -0
- package/dist/components/RichTextEditor/RteToolbar.js +106 -0
- package/dist/components/RichTextEditor/helpers.js +73 -0
- package/dist/components/RichTextEditor/hooks/useEditorHistory.js +39 -0
- package/dist/components/RichTextEditor/hooks/useLinkPrompt.js +61 -0
- package/dist/components/RichTextEditor/hooks/useTableOps.js +134 -0
- package/dist/components/RollingNumber/RollingNumber.css +1 -0
- package/dist/components/RollingNumber/RollingNumber2.js +71 -0
- package/dist/components/ScrollToTop/ScrollToTop.css +1 -0
- package/dist/components/ScrollToTop/ScrollToTop2.js +40 -0
- package/dist/components/Separator/Separator.css +1 -0
- package/dist/components/Separator/Separator2.js +39 -0
- package/dist/components/Sidebar/Sidebar.css +1 -0
- package/dist/components/Sidebar/Sidebar2.js +115 -0
- package/dist/components/Sidebar/SidebarContext.js +31 -0
- package/dist/components/SignalStrength/SignalStrength.css +1 -0
- package/dist/components/SignalStrength/SignalStrength2.js +56 -0
- package/dist/components/Skeleton/Skeleton.css +1 -0
- package/dist/components/Skeleton/Skeleton2.js +50 -0
- package/dist/components/Slider/Slider.css +1 -0
- package/dist/components/Slider/Slider2.js +39 -0
- package/dist/components/SplitPanel/SplitPanel.css +1 -0
- package/dist/components/SplitPanel/SplitPanel2.js +69 -0
- package/dist/components/Splitter/Splitter.css +1 -0
- package/dist/components/Splitter/Splitter2.js +89 -0
- package/dist/components/StackedBar/StackedBar.css +1 -0
- package/dist/components/StackedBar/StackedBar2.js +50 -0
- package/dist/components/Stats/Stats.css +1 -0
- package/dist/components/Stats/Stats2.js +26 -0
- package/dist/components/StickyBar/StickyBar.css +1 -0
- package/dist/components/StickyBar/StickyBar2.js +29 -0
- package/dist/components/SuggestionsList/SuggestionsList.css +1 -0
- package/dist/components/SuggestionsList/SuggestionsList2.js +121 -0
- package/dist/components/ThemeSettings/ThemeContext.js +140 -0
- package/dist/components/ThemeSettings/ThemeContextValue.js +5 -0
- package/dist/components/ThemeSettings/ThemeSettings.css +1 -0
- package/dist/components/ThemeSettings/ThemeSettings2.js +245 -0
- package/dist/components/ThemeSettings/themeConfig.js +7 -0
- package/dist/components/ThemeSettings/useTheme.js +10 -0
- package/dist/components/TimePicker/TimePicker.css +1 -0
- package/dist/components/TimePicker/TimePicker2.js +118 -0
- package/dist/components/TimePicker/TimeSpinner.js +59 -0
- package/dist/components/Timeline/Timeline.css +1 -0
- package/dist/components/Timeline/Timeline2.js +57 -0
- package/dist/components/TimelineMarkers/TimelineMarkers.css +1 -0
- package/dist/components/TimelineMarkers/TimelineMarkers2.js +73 -0
- package/dist/components/TipsOfTheDay/TipsOfTheDay.css +1 -0
- package/dist/components/TipsOfTheDay/TipsOfTheDay2.js +24 -0
- package/dist/components/Toast/Toast.css +1 -0
- package/dist/components/Toast/Toast2.js +39 -0
- package/dist/components/ToggleButtons/ToggleButtons.css +1 -0
- package/dist/components/ToggleButtons/ToggleButtons2.js +47 -0
- package/dist/components/ToggleSwitch/ToggleSwitch.css +1 -0
- package/dist/components/ToggleSwitch/ToggleSwitch2.js +27 -0
- package/dist/components/Toolbar/Toolbar.css +1 -0
- package/dist/components/Toolbar/Toolbar2.js +129 -0
- package/dist/components/Tooltip/Tooltip.css +1 -0
- package/dist/components/Tooltip/Tooltip2.js +93 -0
- package/dist/components/TourHud/TourHud.css +1 -0
- package/dist/components/TourHud/TourHud2.js +70 -0
- package/dist/components/Transition/Transition.css +1 -0
- package/dist/components/Transition/Transition2.js +68 -0
- package/dist/components/Tree/Tree.css +1 -0
- package/dist/components/Tree/Tree2.js +95 -0
- package/dist/components/VirtualList/VirtualList.css +1 -0
- package/dist/components/VirtualList/VirtualList2.js +64 -0
- package/dist/components/WHtR/WHtR.css +1 -0
- package/dist/components/WHtR/WHtR2.js +115 -0
- package/dist/contexts/AuthContext/AuthContext.js +113 -0
- package/dist/helpers/AppPersistenceStorage.js +50 -0
- package/dist/helpers/Datetime.js +114 -0
- package/dist/helpers/Format.js +21 -0
- package/dist/helpers/Highlight.js +36 -0
- package/dist/helpers/HtmlContent.js +118 -0
- package/dist/helpers/LogicalOperators.js +15 -0
- package/dist/helpers/Numbers.js +15 -0
- package/dist/helpers/Pagination.js +7 -0
- package/dist/helpers/Search.js +15 -0
- package/dist/helpers/Strings.js +10 -0
- package/dist/helpers/Urls.js +68 -0
- package/dist/helpers/VersionInfo.js +36 -0
- package/dist/hooks/useAppPersistence.js +51 -0
- package/dist/hooks/useAuth/useAuth.js +10 -0
- package/dist/hooks/useBodyScrollLock.js +31 -0
- package/dist/hooks/useBreakpoint.js +65 -0
- package/dist/hooks/useComponentEffect.js +8 -0
- package/dist/hooks/useSwipe.js +45 -0
- package/dist/index.css +1 -2
- package/dist/index.esm.js +1 -17211
- package/dist/index.js +348 -0
- package/dist/mfa.js +4 -0
- package/dist/node_modules/qrcode.react/lib/esm/index.js +979 -0
- package/dist/validators/Vin.js +69 -0
- package/dist/version.js +8 -0
- package/dist/version.json +4 -4
- package/package.json +8 -7
- package/dist/mfa.esm.js +0 -1293
- package/dist/useAuth-BBqdDG2z.js +0 -467
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import './ColorPicker.css';
|
|
2
|
+
import { Button as N } from "../Button/Button2.js";
|
|
3
|
+
import { InputNumber as b } from "../InputNumber/InputNumber2.js";
|
|
4
|
+
import { InputText as j } from "../InputText/InputText2.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { useEffect as B, useRef as R, useState as H } from "react";
|
|
7
|
+
import { jsx as m, jsxs as x } from "react/jsx-runtime";
|
|
8
|
+
var _ = (s, h, i) => Math.min(i, Math.max(h, s)), k = (s) => {
|
|
9
|
+
const h = s.replace("#", "").trim();
|
|
10
|
+
if (![3, 6].includes(h.length)) return null;
|
|
11
|
+
const i = h.length === 3 ? h.split("").map((o) => o + o).join("") : h, l = parseInt(i, 16);
|
|
12
|
+
return Number.isNaN(l) ? null : {
|
|
13
|
+
r: l >> 16 & 255,
|
|
14
|
+
g: l >> 8 & 255,
|
|
15
|
+
b: l & 255
|
|
16
|
+
};
|
|
17
|
+
}, L = ({ r: s, g: h, b: i }) => `#${[
|
|
18
|
+
s,
|
|
19
|
+
h,
|
|
20
|
+
i
|
|
21
|
+
].map((l) => _(Math.round(l), 0, 255).toString(16).padStart(2, "0")).join("")}`, g = ({ r: s, g: h, b: i }) => {
|
|
22
|
+
const l = s / 255, o = h / 255, t = i / 255, r = Math.max(l, o, t), c = r - Math.min(l, o, t);
|
|
23
|
+
let e = 0;
|
|
24
|
+
c !== 0 && (r === l ? e = (o - t) / c % 6 : r === o ? e = (t - l) / c + 2 : e = (l - o) / c + 4, e = Math.round(e * 60), e < 0 && (e += 360));
|
|
25
|
+
const a = r === 0 ? 0 : c / r, d = r;
|
|
26
|
+
return {
|
|
27
|
+
h: e,
|
|
28
|
+
s: Math.round(a * 100),
|
|
29
|
+
v: Math.round(d * 100)
|
|
30
|
+
};
|
|
31
|
+
}, T = ({ h: s, s: h, v: i }) => {
|
|
32
|
+
const l = h / 100, o = i / 100, t = o * l, r = t * (1 - Math.abs(s / 60 % 2 - 1)), c = o - t;
|
|
33
|
+
let e = 0, a = 0, d = 0;
|
|
34
|
+
return s < 60 ? (e = t, a = r) : s < 120 ? (e = r, a = t) : s < 180 ? (a = t, d = r) : s < 240 ? (a = r, d = t) : s < 300 ? (e = r, d = t) : (e = t, d = r), {
|
|
35
|
+
r: Math.round((e + c) * 255),
|
|
36
|
+
g: Math.round((a + c) * 255),
|
|
37
|
+
b: Math.round((d + c) * 255)
|
|
38
|
+
};
|
|
39
|
+
}, I = ({ r: s, g: h, b: i }) => {
|
|
40
|
+
const l = s / 255, o = h / 255, t = i / 255, r = Math.max(l, o, t), c = Math.min(l, o, t), e = r - c;
|
|
41
|
+
let a = 0;
|
|
42
|
+
e !== 0 && (r === l ? a = (o - t) / e % 6 : r === o ? a = (t - l) / e + 2 : a = (l - o) / e + 4, a = Math.round(a * 60), a < 0 && (a += 360));
|
|
43
|
+
const d = (r + c) / 2, p = e === 0 ? 0 : e / (1 - Math.abs(2 * d - 1));
|
|
44
|
+
return {
|
|
45
|
+
h: a,
|
|
46
|
+
s: Math.round(p * 100),
|
|
47
|
+
l: Math.round(d * 100)
|
|
48
|
+
};
|
|
49
|
+
}, w = ({ h: s, s: h, l: i }) => {
|
|
50
|
+
const l = h / 100, o = i / 100, t = (1 - Math.abs(2 * o - 1)) * l, r = t * (1 - Math.abs(s / 60 % 2 - 1)), c = o - t / 2;
|
|
51
|
+
let e = 0, a = 0, d = 0;
|
|
52
|
+
return s < 60 ? (e = t, a = r) : s < 120 ? (e = r, a = t) : s < 180 ? (a = t, d = r) : s < 240 ? (a = r, d = t) : s < 300 ? (e = r, d = t) : (e = t, d = r), {
|
|
53
|
+
r: Math.round((e + c) * 255),
|
|
54
|
+
g: Math.round((a + c) * 255),
|
|
55
|
+
b: Math.round((d + c) * 255)
|
|
56
|
+
};
|
|
57
|
+
}, F = ({ value: s = "#4e79a7", onChange: h }) => {
|
|
58
|
+
const [i, l] = H("hex"), [o, t] = H(() => {
|
|
59
|
+
const n = k(s) || {
|
|
60
|
+
r: 78,
|
|
61
|
+
g: 121,
|
|
62
|
+
b: 167
|
|
63
|
+
};
|
|
64
|
+
return g(n);
|
|
65
|
+
}), r = R(null), c = R(o);
|
|
66
|
+
c.current = o, B(() => {
|
|
67
|
+
const n = k(s);
|
|
68
|
+
n && t(g(n));
|
|
69
|
+
}, [s]);
|
|
70
|
+
const e = (n) => {
|
|
71
|
+
const v = {
|
|
72
|
+
h: _(n.h, 0, 360),
|
|
73
|
+
s: _(n.s, 0, 100),
|
|
74
|
+
v: _(n.v, 0, 100)
|
|
75
|
+
};
|
|
76
|
+
t(v);
|
|
77
|
+
const u = L(T(v));
|
|
78
|
+
h?.(u);
|
|
79
|
+
}, a = (n, v) => {
|
|
80
|
+
const u = r.current?.getBoundingClientRect();
|
|
81
|
+
if (!u) return;
|
|
82
|
+
const M = _(n - u.left, 0, u.width), y = _(v - u.top, 0, u.height), S = Math.round(M / u.width * 100), E = Math.round(100 - y / u.height * 100);
|
|
83
|
+
e({
|
|
84
|
+
h: c.current.h,
|
|
85
|
+
s: S,
|
|
86
|
+
v: E
|
|
87
|
+
});
|
|
88
|
+
}, d = (n) => {
|
|
89
|
+
n.preventDefault();
|
|
90
|
+
try {
|
|
91
|
+
n.currentTarget.setPointerCapture(n.pointerId);
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
a(n.clientX, n.clientY);
|
|
95
|
+
const v = (M) => a(M.clientX, M.clientY), u = () => {
|
|
96
|
+
window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", u), window.removeEventListener("pointercancel", u);
|
|
97
|
+
};
|
|
98
|
+
window.addEventListener("pointermove", v), window.addEventListener("pointerup", u), window.addEventListener("pointercancel", u);
|
|
99
|
+
}, p = T(o), C = L(p), f = I(p);
|
|
100
|
+
return /* @__PURE__ */ x("div", {
|
|
101
|
+
className: "color-picker",
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ m("div", {
|
|
104
|
+
className: "color-picker__preview",
|
|
105
|
+
style: { backgroundColor: C }
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ x("div", {
|
|
108
|
+
className: "color-picker__controls",
|
|
109
|
+
children: [/* @__PURE__ */ x("div", {
|
|
110
|
+
className: "color-picker__sv",
|
|
111
|
+
ref: r,
|
|
112
|
+
style: { backgroundColor: `hsl(${o.h}, 100%, 50%)` },
|
|
113
|
+
onPointerDown: d,
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ m("div", { className: "color-picker__sv-white" }),
|
|
116
|
+
/* @__PURE__ */ m("div", { className: "color-picker__sv-black" }),
|
|
117
|
+
/* @__PURE__ */ m("div", {
|
|
118
|
+
className: "color-picker__sv-handle",
|
|
119
|
+
style: {
|
|
120
|
+
left: `${o.s}%`,
|
|
121
|
+
top: `${100 - o.v}%`
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
}), /* @__PURE__ */ m("div", {
|
|
126
|
+
className: "color-picker__slider",
|
|
127
|
+
children: /* @__PURE__ */ m("input", {
|
|
128
|
+
type: "range",
|
|
129
|
+
min: 0,
|
|
130
|
+
max: 360,
|
|
131
|
+
value: o.h,
|
|
132
|
+
onChange: (n) => e({
|
|
133
|
+
...o,
|
|
134
|
+
h: Number(n.target.value)
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
})]
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ x("div", {
|
|
140
|
+
className: "color-picker__mode-toggle",
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ m(N, {
|
|
143
|
+
variant: "plain",
|
|
144
|
+
className: i === "hex" ? "is-active" : "",
|
|
145
|
+
onClick: () => l("hex"),
|
|
146
|
+
children: "Hex"
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ m(N, {
|
|
149
|
+
variant: "plain",
|
|
150
|
+
className: i === "rgb" ? "is-active" : "",
|
|
151
|
+
onClick: () => l("rgb"),
|
|
152
|
+
children: "RGB"
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ m(N, {
|
|
155
|
+
variant: "plain",
|
|
156
|
+
className: i === "hsl" ? "is-active" : "",
|
|
157
|
+
onClick: () => l("hsl"),
|
|
158
|
+
children: "HSL"
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
}),
|
|
162
|
+
i === "hex" && /* @__PURE__ */ m("div", {
|
|
163
|
+
className: "color-picker__fields color-picker__fields--hex",
|
|
164
|
+
children: /* @__PURE__ */ m(j, {
|
|
165
|
+
label: "Hex",
|
|
166
|
+
value: C,
|
|
167
|
+
onChange: (n) => {
|
|
168
|
+
const v = k(n);
|
|
169
|
+
v && e(g(v));
|
|
170
|
+
}
|
|
171
|
+
})
|
|
172
|
+
}),
|
|
173
|
+
i === "rgb" && /* @__PURE__ */ x("div", {
|
|
174
|
+
className: "color-picker__fields color-picker__fields--rgb",
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ m(b, {
|
|
177
|
+
label: "R",
|
|
178
|
+
min: 0,
|
|
179
|
+
max: 255,
|
|
180
|
+
value: p.r,
|
|
181
|
+
onChange: (n) => e(g({
|
|
182
|
+
...p,
|
|
183
|
+
r: n ?? 0
|
|
184
|
+
}))
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ m(b, {
|
|
187
|
+
label: "G",
|
|
188
|
+
min: 0,
|
|
189
|
+
max: 255,
|
|
190
|
+
value: p.g,
|
|
191
|
+
onChange: (n) => e(g({
|
|
192
|
+
...p,
|
|
193
|
+
g: n ?? 0
|
|
194
|
+
}))
|
|
195
|
+
}),
|
|
196
|
+
/* @__PURE__ */ m(b, {
|
|
197
|
+
label: "B",
|
|
198
|
+
min: 0,
|
|
199
|
+
max: 255,
|
|
200
|
+
value: p.b,
|
|
201
|
+
onChange: (n) => e(g({
|
|
202
|
+
...p,
|
|
203
|
+
b: n ?? 0
|
|
204
|
+
}))
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
}),
|
|
208
|
+
i === "hsl" && /* @__PURE__ */ x("div", {
|
|
209
|
+
className: "color-picker__fields color-picker__fields--hsl",
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ m(b, {
|
|
212
|
+
label: "H",
|
|
213
|
+
min: 0,
|
|
214
|
+
max: 360,
|
|
215
|
+
value: f.h,
|
|
216
|
+
onChange: (n) => {
|
|
217
|
+
const v = w({
|
|
218
|
+
...f,
|
|
219
|
+
h: n ?? 0
|
|
220
|
+
});
|
|
221
|
+
e(g(v));
|
|
222
|
+
}
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ m(b, {
|
|
225
|
+
label: "S",
|
|
226
|
+
min: 0,
|
|
227
|
+
max: 100,
|
|
228
|
+
value: f.s,
|
|
229
|
+
onChange: (n) => {
|
|
230
|
+
const v = w({
|
|
231
|
+
...f,
|
|
232
|
+
s: n ?? 0
|
|
233
|
+
});
|
|
234
|
+
e(g(v));
|
|
235
|
+
}
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ m(b, {
|
|
238
|
+
label: "L",
|
|
239
|
+
min: 0,
|
|
240
|
+
max: 100,
|
|
241
|
+
value: f.l,
|
|
242
|
+
onChange: (n) => {
|
|
243
|
+
const v = w({
|
|
244
|
+
...f,
|
|
245
|
+
l: n ?? 0
|
|
246
|
+
});
|
|
247
|
+
e(g(v));
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
export {
|
|
256
|
+
F as ColorPicker
|
|
257
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.command-palette{z-index:1000;position:fixed;inset:0}.command-palette__backdrop{background:#00000073;position:absolute;inset:0}.command-palette__panel{background:var(--card-background-color);border:1px solid var(--delimiter-color);border-radius:var(--radius);max-width:560px;padding:var(--spacing-16);box-shadow:var(--card-box-shadow);gap:var(--spacing-12);flex-direction:column;margin:12vh auto 0;display:flex;position:relative}.command-palette__input .input-text-wrapper,.command-palette__input .input-text{width:100%}.command-palette__list{gap:var(--spacing-12);flex-direction:column;max-height:320px;display:flex;overflow:auto}.command-palette__group-title{color:var(--body-color-muted);margin-bottom:6px;font-size:.8rem}.command-palette__item{justify-content:space-between;align-items:center;gap:var(--spacing-12);border-radius:var(--radius);background:var(--card-background-accent-color);cursor:pointer;text-align:left;border:1px solid #0000;width:100%;padding:8px 10px;display:flex}.command-palette__item:hover{border-color:var(--card-hover-border-color)}.command-palette__icon{margin-right:var(--spacing-8)}.command-palette__label{flex:1}.command-palette__shortcut{color:var(--body-color-muted);margin-left:var(--spacing-12);font-size:.75rem}.command-palette__empty{padding:var(--spacing-12);color:var(--body-color-muted)}.command-palette__footer{color:var(--body-color-muted);text-align:right;font-size:.75rem}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import './CommandPalette.css';
|
|
2
|
+
import { Button as k } from "../Button/Button2.js";
|
|
3
|
+
import { InputText as x } from "../InputText/InputText2.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { useEffect as h, useMemo as v, useState as N } from "react";
|
|
6
|
+
import { jsx as a, jsxs as n } from "react/jsx-runtime";
|
|
7
|
+
var K = ({ items: c, isOpen: r, onOpenChange: s, placeholder: w = "Search commands", enableHotkey: u = !0 }) => {
|
|
8
|
+
const [y, d] = N(!1), [m, p] = N(""), o = r ?? y;
|
|
9
|
+
h(() => {
|
|
10
|
+
if (!u) return;
|
|
11
|
+
const t = (e) => {
|
|
12
|
+
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "k") {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
const l = !o;
|
|
15
|
+
r === void 0 && d(l), s?.(l);
|
|
16
|
+
}
|
|
17
|
+
o && e.key === "Escape" && (r === void 0 && d(!1), s?.(!1));
|
|
18
|
+
};
|
|
19
|
+
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
20
|
+
}, [
|
|
21
|
+
u,
|
|
22
|
+
r,
|
|
23
|
+
s,
|
|
24
|
+
o
|
|
25
|
+
]), h(() => {
|
|
26
|
+
o || p("");
|
|
27
|
+
}, [o]);
|
|
28
|
+
const i = v(() => {
|
|
29
|
+
const t = m.trim().toLowerCase();
|
|
30
|
+
return t ? c.filter((e) => [e.label, ...e.keywords ?? []].join(" ").toLowerCase().includes(t)) : c;
|
|
31
|
+
}, [c, m]), f = v(() => i.reduce((t, e) => {
|
|
32
|
+
const l = e.group || "General";
|
|
33
|
+
return t[l] = t[l] ? [...t[l], e] : [e], t;
|
|
34
|
+
}, {}), [i]), _ = () => {
|
|
35
|
+
r === void 0 && d(!1), s?.(!1);
|
|
36
|
+
};
|
|
37
|
+
return o ? /* @__PURE__ */ n("div", {
|
|
38
|
+
className: "command-palette",
|
|
39
|
+
children: [/* @__PURE__ */ a("div", {
|
|
40
|
+
className: "command-palette__backdrop",
|
|
41
|
+
onClick: _
|
|
42
|
+
}), /* @__PURE__ */ n("div", {
|
|
43
|
+
className: "command-palette__panel",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ a("div", {
|
|
46
|
+
className: "command-palette__input",
|
|
47
|
+
children: /* @__PURE__ */ a(x, {
|
|
48
|
+
autoFocus: !0,
|
|
49
|
+
placeholder: w,
|
|
50
|
+
value: m,
|
|
51
|
+
onChange: p
|
|
52
|
+
})
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ n("div", {
|
|
55
|
+
className: "command-palette__list",
|
|
56
|
+
children: [Object.keys(f).map((t) => /* @__PURE__ */ n("div", {
|
|
57
|
+
className: "command-palette__group",
|
|
58
|
+
children: [/* @__PURE__ */ a("div", {
|
|
59
|
+
className: "command-palette__group-title",
|
|
60
|
+
children: t
|
|
61
|
+
}), f[t].map((e) => /* @__PURE__ */ n(k, {
|
|
62
|
+
variant: "plain",
|
|
63
|
+
className: "command-palette__item",
|
|
64
|
+
onClick: () => {
|
|
65
|
+
e.onSelect(), _();
|
|
66
|
+
},
|
|
67
|
+
children: [
|
|
68
|
+
e.icon && /* @__PURE__ */ a("span", {
|
|
69
|
+
className: "command-palette__icon",
|
|
70
|
+
children: e.icon
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ a("span", {
|
|
73
|
+
className: "command-palette__label",
|
|
74
|
+
children: e.label
|
|
75
|
+
}),
|
|
76
|
+
e.shortcut && /* @__PURE__ */ a("span", {
|
|
77
|
+
className: "command-palette__shortcut",
|
|
78
|
+
children: e.shortcut
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}, e.id))]
|
|
82
|
+
}, t)), i.length === 0 && /* @__PURE__ */ a("div", {
|
|
83
|
+
className: "command-palette__empty",
|
|
84
|
+
children: "No matching commands"
|
|
85
|
+
})]
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ a("div", {
|
|
88
|
+
className: "command-palette__footer",
|
|
89
|
+
children: "Press Ctrl+K to toggle"
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
})]
|
|
93
|
+
}) : null;
|
|
94
|
+
};
|
|
95
|
+
export {
|
|
96
|
+
K as CommandPalette
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.confetti-canvas{pointer-events:none}.confetti-canvas--fullscreen{z-index:9999;width:100vw;height:100vh;position:fixed;inset:0}.confetti-canvas--container{z-index:10;width:100%;height:100%;position:absolute;inset:0}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import './Confetti.css';
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { forwardRef as B, useCallback as E, useEffect as H, useImperativeHandle as L, useRef as v } from "react";
|
|
4
|
+
import { jsx as O } from "react/jsx-runtime";
|
|
5
|
+
var _ = [
|
|
6
|
+
"#0891b2",
|
|
7
|
+
"#06b6d4",
|
|
8
|
+
"#16a34a",
|
|
9
|
+
"#f59e0b",
|
|
10
|
+
"#dc2626",
|
|
11
|
+
"#8b5cf6",
|
|
12
|
+
"#ec4899",
|
|
13
|
+
"#f97316"
|
|
14
|
+
], j = (t) => {
|
|
15
|
+
if (t && t.length > 0) return t;
|
|
16
|
+
const a = getComputedStyle(document.documentElement), s = [
|
|
17
|
+
a.getPropertyValue("--body-accent-color").trim(),
|
|
18
|
+
a.getPropertyValue("--button-success-background-color").trim(),
|
|
19
|
+
a.getPropertyValue("--button-warning-background-color").trim(),
|
|
20
|
+
a.getPropertyValue("--body-danger-color").trim()
|
|
21
|
+
].filter(Boolean);
|
|
22
|
+
return s.length >= 2 ? [
|
|
23
|
+
...s,
|
|
24
|
+
"#8b5cf6",
|
|
25
|
+
"#ec4899",
|
|
26
|
+
"#f97316",
|
|
27
|
+
"#06b6d4"
|
|
28
|
+
] : _;
|
|
29
|
+
}, I = () => {
|
|
30
|
+
const t = Math.random();
|
|
31
|
+
return t < 0.5 ? "rect" : t < 0.8 ? "circle" : "star";
|
|
32
|
+
}, b = (t) => t[Math.floor(Math.random() * t.length)], S = (t, a, s) => ({
|
|
33
|
+
x: Math.random() * t,
|
|
34
|
+
y: -10 - Math.random() * 40,
|
|
35
|
+
vx: (Math.random() - 0.5) * 2,
|
|
36
|
+
vy: 2 + Math.random() * 4,
|
|
37
|
+
angle: Math.random() * Math.PI * 2,
|
|
38
|
+
spin: (Math.random() - 0.5) * 0.2,
|
|
39
|
+
size: 5 + Math.random() * 8,
|
|
40
|
+
color: b(s),
|
|
41
|
+
opacity: 1,
|
|
42
|
+
shape: I()
|
|
43
|
+
}), D = (t, a, s) => {
|
|
44
|
+
const o = Math.random() * Math.PI * 2, c = 3 + Math.random() * 10;
|
|
45
|
+
return {
|
|
46
|
+
x: t,
|
|
47
|
+
y: a,
|
|
48
|
+
vx: Math.cos(o) * c,
|
|
49
|
+
vy: Math.sin(o) * c,
|
|
50
|
+
angle: Math.random() * Math.PI * 2,
|
|
51
|
+
spin: (Math.random() - 0.5) * 0.3,
|
|
52
|
+
size: 4 + Math.random() * 8,
|
|
53
|
+
color: b(s),
|
|
54
|
+
opacity: 1,
|
|
55
|
+
shape: I()
|
|
56
|
+
};
|
|
57
|
+
}, F = (t, a, s) => ({
|
|
58
|
+
x: t * 0.2 + Math.random() * t * 0.6,
|
|
59
|
+
y: a + 20,
|
|
60
|
+
vx: (Math.random() - 0.5) * 1.5,
|
|
61
|
+
vy: -(12 + Math.random() * 6),
|
|
62
|
+
angle: 0,
|
|
63
|
+
spin: 0,
|
|
64
|
+
size: 3,
|
|
65
|
+
color: b(s),
|
|
66
|
+
opacity: 1,
|
|
67
|
+
shape: "circle",
|
|
68
|
+
trail: [],
|
|
69
|
+
exploded: !1,
|
|
70
|
+
children: []
|
|
71
|
+
}), N = (t, a, s) => {
|
|
72
|
+
const o = Math.random() * Math.PI * 2, c = 1 + Math.random() * 5;
|
|
73
|
+
return {
|
|
74
|
+
x: t,
|
|
75
|
+
y: a,
|
|
76
|
+
vx: Math.cos(o) * c,
|
|
77
|
+
vy: Math.sin(o) * c,
|
|
78
|
+
angle: Math.random() * Math.PI * 2,
|
|
79
|
+
spin: (Math.random() - 0.5) * 0.15,
|
|
80
|
+
size: 2 + Math.random() * 5,
|
|
81
|
+
color: b(s),
|
|
82
|
+
opacity: 1,
|
|
83
|
+
shape: I()
|
|
84
|
+
};
|
|
85
|
+
}, U = (t, a, s, o) => {
|
|
86
|
+
const P = o * 0.4;
|
|
87
|
+
t.beginPath();
|
|
88
|
+
for (let h = 0; h < 10; h++) {
|
|
89
|
+
const f = h % 2 === 0 ? o : P, d = h * Math.PI / 5 - Math.PI / 2;
|
|
90
|
+
h === 0 ? t.moveTo(a + f * Math.cos(d), s + f * Math.sin(d)) : t.lineTo(a + f * Math.cos(d), s + f * Math.sin(d));
|
|
91
|
+
}
|
|
92
|
+
t.closePath(), t.fill();
|
|
93
|
+
}, w = (t, a) => {
|
|
94
|
+
switch (t.save(), t.globalAlpha = Math.max(0, a.opacity), t.fillStyle = a.color, t.translate(a.x, a.y), t.rotate(a.angle), a.shape) {
|
|
95
|
+
case "rect":
|
|
96
|
+
t.fillRect(-a.size / 2, -a.size / 4, a.size, a.size / 2);
|
|
97
|
+
break;
|
|
98
|
+
case "circle":
|
|
99
|
+
t.beginPath(), t.arc(0, 0, a.size / 2, 0, Math.PI * 2), t.fill();
|
|
100
|
+
break;
|
|
101
|
+
case "star":
|
|
102
|
+
U(t, 0, 0, a.size / 2);
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
t.restore();
|
|
106
|
+
}, G = B(({ colors: t, duration: a = 3e3, scope: s = "fullscreen", variant: o = "confetti", particleCount: c }, P) => {
|
|
107
|
+
const h = v(null), f = v(0), d = v(0), M = v(!1), V = {
|
|
108
|
+
confetti: 150,
|
|
109
|
+
burst: 200,
|
|
110
|
+
fireworks: 8
|
|
111
|
+
}, R = E(() => {
|
|
112
|
+
M.current = !1, cancelAnimationFrame(f.current);
|
|
113
|
+
const i = h.current;
|
|
114
|
+
i && i.getContext("2d")?.clearRect(0, 0, i.width, i.height);
|
|
115
|
+
}, []), z = E(() => {
|
|
116
|
+
const i = h.current;
|
|
117
|
+
if (!i || M.current) return;
|
|
118
|
+
const r = i.getContext("2d");
|
|
119
|
+
if (!r) return;
|
|
120
|
+
i.width = i.offsetWidth, i.height = i.offsetHeight;
|
|
121
|
+
const u = i.width, m = i.height, y = j(t), x = c ?? V[o];
|
|
122
|
+
M.current = !0, d.current = performance.now();
|
|
123
|
+
let l = [];
|
|
124
|
+
if (o === "confetti") l = Array.from({ length: x }, () => S(u, m, y));
|
|
125
|
+
else if (o === "burst") {
|
|
126
|
+
const k = u / 2, A = m / 2;
|
|
127
|
+
l = Array.from({ length: x }, () => D(k, A, y));
|
|
128
|
+
} else o === "fireworks" && (l = Array.from({ length: x }, () => F(u, m, y)));
|
|
129
|
+
const C = (k) => {
|
|
130
|
+
if (!M.current) return;
|
|
131
|
+
const A = k - d.current, g = Math.min(A / a, 1);
|
|
132
|
+
if (r.clearRect(0, 0, u, m), o === "confetti" ? (g < 0.6 && Math.random() < 0.3 && l.push(S(u, m, y)), l = l.filter((e) => e.opacity > 0 && e.y < m + 20), l.forEach((e) => {
|
|
133
|
+
e.x += e.vx, e.y += e.vy, e.vy += 0.08, e.vx += (Math.random() - 0.5) * 0.1, e.angle += e.spin, g > 0.6 && (e.opacity -= 0.015), w(r, e);
|
|
134
|
+
})) : o === "burst" ? (l = l.filter((e) => e.opacity > 0), l.forEach((e) => {
|
|
135
|
+
e.x += e.vx, e.y += e.vy, e.vy += 0.15, e.vx *= 0.98, e.angle += e.spin, e.opacity -= 0.012, w(r, e);
|
|
136
|
+
})) : o === "fireworks" && (g < 0.85 && Math.random() < 0.04 && l.push(F(u, m, y)), l = l.filter((e) => e.exploded ? e.children?.some((n) => n.opacity > 0) ?? !1 : e.y > -m * 0.1), l.forEach((e) => {
|
|
137
|
+
if (e.exploded)
|
|
138
|
+
e.children?.forEach((n) => {
|
|
139
|
+
n.x += n.vx, n.y += n.vy, n.vy += 0.06, n.vx *= 0.97, n.angle += n.spin, n.opacity -= 0.014, w(r, n);
|
|
140
|
+
});
|
|
141
|
+
else if (e.trail?.push({
|
|
142
|
+
x: e.x,
|
|
143
|
+
y: e.y
|
|
144
|
+
}), (e.trail?.length ?? 0) > 12 && e.trail?.shift(), e.trail?.forEach((n, T) => {
|
|
145
|
+
const q = (T + 1) / (e.trail?.length ?? 1) * 0.6;
|
|
146
|
+
r.save(), r.globalAlpha = q, r.fillStyle = e.color, r.beginPath(), r.arc(n.x, n.y, 2, 0, Math.PI * 2), r.fill(), r.restore();
|
|
147
|
+
}), r.save(), r.globalAlpha = 1, r.fillStyle = e.color, r.beginPath(), r.arc(e.x, e.y, 3, 0, Math.PI * 2), r.fill(), r.restore(), e.x += e.vx, e.y += e.vy, e.vy += 0.18, e.vy >= 0) {
|
|
148
|
+
e.exploded = !0;
|
|
149
|
+
const n = 60 + Math.floor(Math.random() * 40);
|
|
150
|
+
e.children = Array.from({ length: n }, () => N(e.x, e.y, y)), r.save(), r.globalAlpha = 0.8, r.fillStyle = "#ffffff", r.beginPath(), r.arc(e.x, e.y, 12, 0, Math.PI * 2), r.fill(), r.restore();
|
|
151
|
+
}
|
|
152
|
+
})), g >= 1 || l.length === 0) {
|
|
153
|
+
R();
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
f.current = requestAnimationFrame(C);
|
|
157
|
+
};
|
|
158
|
+
f.current = requestAnimationFrame(C);
|
|
159
|
+
}, [
|
|
160
|
+
t,
|
|
161
|
+
a,
|
|
162
|
+
o,
|
|
163
|
+
c,
|
|
164
|
+
R
|
|
165
|
+
]);
|
|
166
|
+
return L(P, () => ({ trigger: z }), [z]), H(() => () => {
|
|
167
|
+
cancelAnimationFrame(f.current);
|
|
168
|
+
}, []), /* @__PURE__ */ O("canvas", {
|
|
169
|
+
ref: h,
|
|
170
|
+
className: `confetti-canvas confetti-canvas--${s}`
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
export {
|
|
174
|
+
G as Confetti
|
|
175
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.confirm-dialog__body{padding:var(--spacing-16) var(--spacing-24);color:var(--modal-body-color)}.confirm-dialog__body p{margin:0;line-height:1.5}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import './ConfirmDialog.css';
|
|
2
|
+
import { Modal as n } from "../Modal/Modal2.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
var p = ({ isOpen: r = !1, message: t, title: l, confirm: o, cancel: i, usePortal: e = !1 }) => {
|
|
7
|
+
const d = {
|
|
8
|
+
variant: i?.variant || "default",
|
|
9
|
+
icon: i?.icon || "clear",
|
|
10
|
+
onClick: i?.onClick,
|
|
11
|
+
disabled: i?.disabled,
|
|
12
|
+
text: i?.text || "Cancel"
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ a(n, {
|
|
15
|
+
isOpen: r,
|
|
16
|
+
title: l,
|
|
17
|
+
onClose: i?.onClick ? () => i.onClick() : void 0,
|
|
18
|
+
size: "small",
|
|
19
|
+
className: "confirm-dialog",
|
|
20
|
+
usePortal: e,
|
|
21
|
+
primary: {
|
|
22
|
+
variant: o?.variant || "danger",
|
|
23
|
+
icon: o?.icon || "checkmark",
|
|
24
|
+
onClick: o?.onClick,
|
|
25
|
+
disabled: o?.disabled,
|
|
26
|
+
text: o?.text || "Confirm"
|
|
27
|
+
},
|
|
28
|
+
secondary: d,
|
|
29
|
+
children: /* @__PURE__ */ a("div", {
|
|
30
|
+
className: "confirm-dialog__body",
|
|
31
|
+
children: /* @__PURE__ */ a("p", { children: t })
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
p as default
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.confirm-popover{gap:var(--spacing-8);flex-direction:column;min-width:180px;max-width:280px;display:flex}.confirm-popover__header{align-items:center;gap:var(--spacing-8);color:var(--body-color);display:flex}.confirm-popover__title{font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);line-height:var(--line-height-tight)}.confirm-popover__message{font-size:var(--font-size-sm);color:var(--body-color-muted);line-height:var(--line-height-normal)}.confirm-popover__actions{gap:var(--spacing-8);justify-content:flex-end;display:flex}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import './ConfirmPopover.css';
|
|
2
|
+
import { Icon as f } from "../Icon/Icon2.js";
|
|
3
|
+
import { Button as p } from "../Button/Button2.js";
|
|
4
|
+
import { Popover as _ } from "../Popover/Popover2.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
7
|
+
var j = ({ visible: t, onClose: n, anchorEl: s, title: a, message: c, icon: e, confirm: r, cancel: i, placement: d = "auto", offset: l }) => {
|
|
8
|
+
const v = () => {
|
|
9
|
+
r.onClick(), n();
|
|
10
|
+
}, h = () => {
|
|
11
|
+
i?.onClick?.(), n();
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ o(_, {
|
|
14
|
+
visible: t,
|
|
15
|
+
onClose: n,
|
|
16
|
+
anchorEl: s,
|
|
17
|
+
placement: d,
|
|
18
|
+
...l !== void 0 ? { offset: l } : {},
|
|
19
|
+
children: /* @__PURE__ */ m("div", {
|
|
20
|
+
className: "confirm-popover",
|
|
21
|
+
children: [
|
|
22
|
+
(a || e) && /* @__PURE__ */ m("div", {
|
|
23
|
+
className: "confirm-popover__header",
|
|
24
|
+
children: [e && /* @__PURE__ */ o(f, { name: e }), a && /* @__PURE__ */ o("span", {
|
|
25
|
+
className: "confirm-popover__title",
|
|
26
|
+
children: a
|
|
27
|
+
})]
|
|
28
|
+
}),
|
|
29
|
+
c && /* @__PURE__ */ o("div", {
|
|
30
|
+
className: "confirm-popover__message",
|
|
31
|
+
children: c
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ m("div", {
|
|
34
|
+
className: "confirm-popover__actions",
|
|
35
|
+
children: [/* @__PURE__ */ o(p, {
|
|
36
|
+
size: "small",
|
|
37
|
+
variant: i?.variant ?? "default",
|
|
38
|
+
icon: i?.icon,
|
|
39
|
+
onClick: h,
|
|
40
|
+
children: i?.text ?? "Cancel"
|
|
41
|
+
}), /* @__PURE__ */ o(p, {
|
|
42
|
+
size: "small",
|
|
43
|
+
variant: r.variant ?? "info",
|
|
44
|
+
icon: r.icon,
|
|
45
|
+
onClick: v,
|
|
46
|
+
children: r.text ?? "Confirm"
|
|
47
|
+
})]
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
j as ConfirmPopover
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.memobit-context-menu-back-drop{background-color:var(--backdrop-color);opacity:.2;animation:.2s contextMenuBackdropFadeIn}.memobit-context-menu{z-index:1191;color:var(--dropdown-options-color);background-color:var(--dropdown-options-background-color);border:1px solid var(--dropdown-border-color);border-radius:var(--spacing-4);box-shadow:var(--modal-box-shadow);padding:var(--spacing-4);box-sizing:border-box;opacity:0;max-width:calc(100vw - 16px);transition:opacity .2s,transform .2s;position:fixed;overflow:auto;transform:translateY(-10px)}.memobit-context-menu--visible{opacity:1;transform:translateY(0)}@keyframes contextMenuBackdropFadeIn{0%{opacity:0}to{opacity:.2}}
|