@memobit/libs 3.0.0 → 3.1.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/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 +138 -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,142 @@
|
|
|
1
|
+
import './PieChart.css';
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { useMemo as z } from "react";
|
|
4
|
+
import { Fragment as E, jsx as h, jsxs as A } from "react/jsx-runtime";
|
|
5
|
+
var F = {
|
|
6
|
+
small: 120,
|
|
7
|
+
medium: 180,
|
|
8
|
+
large: 240
|
|
9
|
+
}, N = {
|
|
10
|
+
default: "var(--progress-default-bar-fill-color)",
|
|
11
|
+
warning: "var(--progress-warning-bar-fill-color)",
|
|
12
|
+
danger: "var(--progress-danger-bar-fill-color)",
|
|
13
|
+
info: "var(--progress-info-bar-fill-color)",
|
|
14
|
+
success: "var(--progress-success-bar-fill-color)"
|
|
15
|
+
}, f = (r, n, l, o) => {
|
|
16
|
+
const s = (o - 90) * Math.PI / 180;
|
|
17
|
+
return {
|
|
18
|
+
x: r + l * Math.cos(s),
|
|
19
|
+
y: n + l * Math.sin(s)
|
|
20
|
+
};
|
|
21
|
+
}, G = (r, n, l, o) => {
|
|
22
|
+
const s = f(r, r, n, o), g = f(r, r, n, l), u = o - l <= 180 ? 0 : 1;
|
|
23
|
+
return [
|
|
24
|
+
"M",
|
|
25
|
+
r,
|
|
26
|
+
r,
|
|
27
|
+
"L",
|
|
28
|
+
s.x,
|
|
29
|
+
s.y,
|
|
30
|
+
"A",
|
|
31
|
+
n,
|
|
32
|
+
n,
|
|
33
|
+
0,
|
|
34
|
+
u,
|
|
35
|
+
0,
|
|
36
|
+
g.x,
|
|
37
|
+
g.y,
|
|
38
|
+
"Z"
|
|
39
|
+
].join(" ");
|
|
40
|
+
}, I = (r) => `hsl(${Math.round((r * 137.508 + 28) % 360)} 72% 52%)`, W = (r, n) => {
|
|
41
|
+
const l = r.variant ?? "default";
|
|
42
|
+
return l === "custom" ? r.customColor || N.default : l === "random" ? I(n) : N[l];
|
|
43
|
+
}, Z = ({ className: r = "", data: n = [], emptyLabel: l, gap: o = 1, size: s = "medium", valueFormatter: g, valuePosition: u = "inside" }) => {
|
|
44
|
+
const p = F[s], v = u === "outside" ? Math.round(p * 0.18) : 0, a = p / 2, i = Math.max(a - Math.max(o, 1), 1), S = `${-v} ${-v} ${p + v * 2} ${p + v * 2}`, m = z(() => {
|
|
45
|
+
const e = n.filter((t) => Number.isFinite(t.value) && t.value > 0), c = e.reduce((t, d) => t + d.value, 0);
|
|
46
|
+
if (c <= 0) return [];
|
|
47
|
+
let x = 0;
|
|
48
|
+
return e.map((t, d) => {
|
|
49
|
+
const j = t.value / c * 360, b = x, y = d === e.length - 1 ? 360 : x + j, k = b + (y - b) / 2;
|
|
50
|
+
return x = y, {
|
|
51
|
+
color: W(t, d),
|
|
52
|
+
endAngle: y,
|
|
53
|
+
index: d,
|
|
54
|
+
label: g ? g(t.value, t, d) : t.value,
|
|
55
|
+
midAngle: k,
|
|
56
|
+
path: G(a, i, b, y),
|
|
57
|
+
startAngle: b,
|
|
58
|
+
value: t.value
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}, [
|
|
62
|
+
a,
|
|
63
|
+
n,
|
|
64
|
+
i,
|
|
65
|
+
g
|
|
66
|
+
]), _ = m.length > 0, R = i * 0.58, C = i + v * 0.58, w = i + o / 2, B = i + v * 0.35, M = Math.max(0, o), $ = u !== "none";
|
|
67
|
+
return /* @__PURE__ */ h("div", {
|
|
68
|
+
className: `pie-chart pie-chart--${s} pie-chart--values-${u} ${r}`.trim(),
|
|
69
|
+
children: /* @__PURE__ */ A("svg", {
|
|
70
|
+
width: p,
|
|
71
|
+
height: p,
|
|
72
|
+
viewBox: S,
|
|
73
|
+
children: [
|
|
74
|
+
!_ && /* @__PURE__ */ A(E, { children: [/* @__PURE__ */ h("circle", {
|
|
75
|
+
className: "pie-chart__empty-circle",
|
|
76
|
+
cx: a,
|
|
77
|
+
cy: a,
|
|
78
|
+
r: i
|
|
79
|
+
}), $ && l && /* @__PURE__ */ h("text", {
|
|
80
|
+
className: "pie-chart__empty-label",
|
|
81
|
+
x: a,
|
|
82
|
+
y: a,
|
|
83
|
+
textAnchor: "middle",
|
|
84
|
+
dominantBaseline: "central",
|
|
85
|
+
children: l
|
|
86
|
+
})] }),
|
|
87
|
+
_ && (m.length === 1 ? /* @__PURE__ */ h("circle", {
|
|
88
|
+
className: "pie-chart__slice",
|
|
89
|
+
cx: a,
|
|
90
|
+
cy: a,
|
|
91
|
+
r: i,
|
|
92
|
+
fill: m[0].color,
|
|
93
|
+
strokeWidth: M
|
|
94
|
+
}) : m.map((e) => /* @__PURE__ */ h("path", {
|
|
95
|
+
className: "pie-chart__slice",
|
|
96
|
+
d: e.path,
|
|
97
|
+
fill: e.color,
|
|
98
|
+
strokeWidth: M
|
|
99
|
+
}, `${e.index}-${e.value}-${e.startAngle}`))),
|
|
100
|
+
_ && $ && u === "outside" && m.map((e) => {
|
|
101
|
+
const c = f(a, a, w, e.midAngle), x = f(a, a, B, e.midAngle), t = f(a, a, C, e.midAngle), d = t.x >= a;
|
|
102
|
+
return /* @__PURE__ */ A("g", {
|
|
103
|
+
className: "pie-chart__outside-label-group",
|
|
104
|
+
children: [/* @__PURE__ */ h("line", {
|
|
105
|
+
className: "pie-chart__leader-line",
|
|
106
|
+
x1: c.x,
|
|
107
|
+
y1: c.y,
|
|
108
|
+
x2: x.x,
|
|
109
|
+
y2: x.y,
|
|
110
|
+
stroke: e.color
|
|
111
|
+
}), /* @__PURE__ */ h("text", {
|
|
112
|
+
className: "pie-chart__value-label pie-chart__value-label--outside",
|
|
113
|
+
x: t.x,
|
|
114
|
+
y: t.y,
|
|
115
|
+
textAnchor: d ? "start" : "end",
|
|
116
|
+
dominantBaseline: "central",
|
|
117
|
+
fill: e.color,
|
|
118
|
+
children: e.label
|
|
119
|
+
})]
|
|
120
|
+
}, `outside-${e.index}-${e.value}`);
|
|
121
|
+
}),
|
|
122
|
+
_ && $ && u === "inside" && m.map((e) => {
|
|
123
|
+
const c = m.length === 1 ? {
|
|
124
|
+
x: a,
|
|
125
|
+
y: a
|
|
126
|
+
} : f(a, a, R, e.midAngle);
|
|
127
|
+
return /* @__PURE__ */ h("text", {
|
|
128
|
+
className: "pie-chart__value-label pie-chart__value-label--inside",
|
|
129
|
+
x: c.x,
|
|
130
|
+
y: c.y,
|
|
131
|
+
textAnchor: "middle",
|
|
132
|
+
dominantBaseline: "central",
|
|
133
|
+
children: e.label
|
|
134
|
+
}, `inside-${e.index}-${e.value}`);
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
export {
|
|
141
|
+
Z as PieChart
|
|
142
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.simple-popover{--popover-arrow-offset:var(--spacing-12);--popover-max-width:360px;background-color:var(--popover-background-color);border:var(--spacing-1) solid var(--popover-border-color);border-radius:var(--radius);box-sizing:border-box;box-shadow:0 var(--spacing-4) var(--spacing-4) #00000026;font-size:var(--font-size-sm);max-width:min(var(--popover-max-width), 100vw - var(--spacing-40));opacity:0;min-width:120px;animation:.2s ease-out forwards popover-appear;transform:scale(.95)}@keyframes popover-appear{to{opacity:1;transform:scale(1)}}.simple-popover__content{box-sizing:border-box;min-width:0;max-width:100%;padding:var(--spacing-12);color:var(--popover-color);overflow-wrap:anywhere;word-break:normal;white-space:normal;line-height:1.4}.simple-popover__content>*{max-width:100%}.simple-popover__arrow{border:var(--spacing-8) solid transparent;width:0;height:0;position:absolute}.simple-popover--bottom .simple-popover__arrow{top:calc(-1 * var(--popover-arrow-offset));left:var(--popover-arrow-position,50%);border-bottom-color:var(--popover-arrow-color);border-top:none;transform:translate(-50%)}.simple-popover--top .simple-popover__arrow{bottom:calc(-1 * var(--popover-arrow-offset));left:var(--popover-arrow-position,50%);border-top-color:var(--popover-arrow-color);border-bottom:none;transform:translate(-50%)}.simple-popover--left .simple-popover__arrow{right:calc(-1 * var(--popover-arrow-offset));top:var(--popover-arrow-position,50%);border-left-color:var(--popover-arrow-color);border-right:none;transform:translateY(-50%)}.simple-popover--right .simple-popover__arrow{left:calc(-1 * var(--popover-arrow-offset));top:var(--popover-arrow-position,50%);border-right-color:var(--popover-arrow-color);border-left:none;transform:translateY(-50%)}@media (width<=768px){.simple-popover{max-width:calc(100vw - var(--spacing-40));font-size:var(--font-size-xs)}.simple-popover__content{padding:var(--spacing-8)}}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import './Popover.css';
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { useCallback as I, useEffect as O, useRef as _, useState as N } from "react";
|
|
4
|
+
import { jsx as x, jsxs as M } from "react/jsx-runtime";
|
|
5
|
+
import { createPortal as z } from "react-dom";
|
|
6
|
+
var i = 20, P = 16, C = 8, j = ({ children: y, visible: h, onClose: g, anchorEl: f, offset: u = C, placement: a = "auto" }) => {
|
|
7
|
+
const m = _(null), v = _(null), [w, A] = N({
|
|
8
|
+
top: 0,
|
|
9
|
+
left: 0,
|
|
10
|
+
placement: "bottom",
|
|
11
|
+
arrowOffset: null
|
|
12
|
+
}), c = I(() => {
|
|
13
|
+
if (!f || !m.current || !h) return;
|
|
14
|
+
const t = f.getBoundingClientRect(), e = m.current.getBoundingClientRect(), n = {
|
|
15
|
+
width: window.innerWidth,
|
|
16
|
+
height: window.innerHeight
|
|
17
|
+
}, R = (p, d) => p >= i && d >= i && p + e.height <= n.height - i && d + e.width <= n.width - i, l = {
|
|
18
|
+
bottom: {
|
|
19
|
+
top: t.bottom + u,
|
|
20
|
+
left: t.left + (t.width - e.width) / 2
|
|
21
|
+
},
|
|
22
|
+
top: {
|
|
23
|
+
top: t.top - e.height - u,
|
|
24
|
+
left: t.left + (t.width - e.width) / 2
|
|
25
|
+
},
|
|
26
|
+
left: {
|
|
27
|
+
top: t.top + (t.height - e.height) / 2,
|
|
28
|
+
left: t.left - e.width - u
|
|
29
|
+
},
|
|
30
|
+
right: {
|
|
31
|
+
top: t.top + (t.height - e.height) / 2,
|
|
32
|
+
left: t.right + u
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
let o, { top: r, left: s } = l.bottom;
|
|
36
|
+
if (a === "auto")
|
|
37
|
+
o = [
|
|
38
|
+
"bottom",
|
|
39
|
+
"top",
|
|
40
|
+
"right",
|
|
41
|
+
"left"
|
|
42
|
+
].find((p) => {
|
|
43
|
+
const d = l[p];
|
|
44
|
+
return R(d.top, d.left);
|
|
45
|
+
}) || "bottom", { top: r, left: s } = l[o];
|
|
46
|
+
else {
|
|
47
|
+
const p = l[a];
|
|
48
|
+
R(p.top, p.left) ? (o = a, { top: r, left: s } = p) : (o = [
|
|
49
|
+
"bottom",
|
|
50
|
+
"top",
|
|
51
|
+
"right",
|
|
52
|
+
"left"
|
|
53
|
+
].filter((d) => d !== a).find((d) => {
|
|
54
|
+
const L = l[d];
|
|
55
|
+
return R(L.top, L.left);
|
|
56
|
+
}) || a, { top: r, left: s } = l[o]);
|
|
57
|
+
}
|
|
58
|
+
(o === "top" || o === "bottom") && (s < i && (s = i), s + e.width > n.width - i && (s = n.width - e.width - i)), (o === "left" || o === "right") && (r < i && (r = i), r + e.height > n.height - i && (r = n.height - e.height - i));
|
|
59
|
+
const E = o === "top" || o === "bottom", F = E ? t.left + t.width / 2 - s : t.top + t.height / 2 - r, b = E ? e.width : e.height, k = Math.min(Math.max(F, P), b - P);
|
|
60
|
+
A({
|
|
61
|
+
top: r,
|
|
62
|
+
left: s,
|
|
63
|
+
placement: o,
|
|
64
|
+
arrowOffset: k
|
|
65
|
+
});
|
|
66
|
+
}, [
|
|
67
|
+
f,
|
|
68
|
+
h,
|
|
69
|
+
u,
|
|
70
|
+
a
|
|
71
|
+
]);
|
|
72
|
+
return O(() => (h && (v.current = requestAnimationFrame(c)), () => {
|
|
73
|
+
v.current !== null && cancelAnimationFrame(v.current);
|
|
74
|
+
}), [h, c]), O(() => {
|
|
75
|
+
if (!h) return;
|
|
76
|
+
const t = (n) => {
|
|
77
|
+
m.current && f && !m.current.contains(n.target) && !f.contains(n.target) && g();
|
|
78
|
+
}, e = (n) => {
|
|
79
|
+
n.key === "Escape" && g();
|
|
80
|
+
};
|
|
81
|
+
return document.addEventListener("mousedown", t), document.addEventListener("keydown", e), window.addEventListener("resize", c), window.addEventListener("scroll", c, !0), () => {
|
|
82
|
+
document.removeEventListener("mousedown", t), document.removeEventListener("keydown", e), window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0);
|
|
83
|
+
};
|
|
84
|
+
}, [
|
|
85
|
+
h,
|
|
86
|
+
g,
|
|
87
|
+
f,
|
|
88
|
+
c
|
|
89
|
+
]), !h || !f ? null : z(/* @__PURE__ */ M("div", {
|
|
90
|
+
ref: m,
|
|
91
|
+
className: `simple-popover simple-popover--${w.placement}`,
|
|
92
|
+
style: {
|
|
93
|
+
position: "fixed",
|
|
94
|
+
top: w.top,
|
|
95
|
+
left: w.left,
|
|
96
|
+
zIndex: 9999
|
|
97
|
+
},
|
|
98
|
+
children: [/* @__PURE__ */ x("div", {
|
|
99
|
+
className: "simple-popover__arrow",
|
|
100
|
+
style: w.arrowOffset === null ? void 0 : { "--popover-arrow-position": `${w.arrowOffset}px` }
|
|
101
|
+
}), /* @__PURE__ */ x("div", {
|
|
102
|
+
className: "simple-popover__content",
|
|
103
|
+
children: y
|
|
104
|
+
})]
|
|
105
|
+
}), document.body);
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
j as Popover
|
|
109
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useState as c } from "react";
|
|
2
|
+
var E = () => {
|
|
3
|
+
const [s, o] = c({}), l = (e, t) => {
|
|
4
|
+
const r = t instanceof HTMLElement ? t : t.currentTarget;
|
|
5
|
+
o((i) => ({
|
|
6
|
+
...i,
|
|
7
|
+
[e]: {
|
|
8
|
+
visible: !0,
|
|
9
|
+
anchorEl: r
|
|
10
|
+
}
|
|
11
|
+
}));
|
|
12
|
+
}, n = (e) => {
|
|
13
|
+
o((t) => ({
|
|
14
|
+
...t,
|
|
15
|
+
[e]: {
|
|
16
|
+
visible: !1,
|
|
17
|
+
anchorEl: null
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
show: l,
|
|
23
|
+
hide: n,
|
|
24
|
+
toggle: (e, t) => {
|
|
25
|
+
s[e]?.visible ? n(e) : l(e, t);
|
|
26
|
+
},
|
|
27
|
+
isVisible: (e) => s[e]?.visible || !1,
|
|
28
|
+
getAnchorEl: (e) => s[e]?.anchorEl || null
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
E as usePopover
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.progress-bar{gap:var(--spacing-4);flex-direction:column;display:flex}.progress-bar--vertical{align-items:center}.progress-bar--vertical .progress-bar__track{width:var(--spacing-16);height:var(--spacing-200)}.progress-bar--vertical .progress-fill{width:calc(100% - var(--spacing-2));margin:0 auto;transition:height .3s;position:absolute;bottom:0;left:0;right:0}.progress-bar--vertical .progress-bar__inline-label{writing-mode:vertical-rl;padding:var(--spacing-8) 0;transform:rotate(180deg)}.progress-bar--vertical .progress-bar__inline-label.progress-bar__inline-label-left{justify-content:flex-end}.progress-bar--vertical .progress-bar__inline-label.progress-bar__inline-label-right{justify-content:flex-start}.progress-bar--vertical.progress-bar-inline{align-items:center}.progress-bar--vertical.progress-bar-inline .progress-bar__track{flex:none}.progress-bar--vertical.progress-bar-inline .progress-bar__label{min-width:auto}.progress-bar.progress-bar-inline{flex-direction:row;align-items:center}.progress-bar.progress-bar-inline .progress-bar__track{flex:1}.progress-bar.progress-bar-inline .progress-bar__label{text-align:left;min-width:10%;font-size:var(--font-size-xs)}.progress-bar.progress-bar-inline .progress-bar__label.progress-bar__label-left{text-align:left}.progress-bar.progress-bar-inline .progress-bar__label.progress-bar__label-center{text-align:center}.progress-bar.progress-bar-inline .progress-bar__label.progress-bar__label-right{text-align:right}.progress-bar__label{font-size:var(--font-size-xs);color:var(--body-color);font-weight:500}.progress-bar__label.progress-bar__label--success{color:var(--progress-success-bar-fill-color)}.progress-bar__label.progress-bar__label--warning{color:var(--progress-warning-bar-fill-color)}.progress-bar__label.progress-bar__label--danger{color:var(--progress-danger-bar-fill-color)}.progress-bar__label.progress-bar__label--info{color:var(--progress-info-bar-fill-color)}.progress-bar__track{height:var(--spacing-16);background-color:var(--progress-bar-background-color);border-radius:var(--spacing-4);font-weight:500;position:relative;overflow:hidden}.progress-bar__inline-label{z-index:1;padding:0 var(--spacing-8);font-size:var(--spacing-12);color:#fff;text-shadow:-1px -1px #000000a6,1px -1px #000000a6,-1px 1px #000000a6,1px 1px #000000a6,0 0 3px #0000008c;pointer-events:none;white-space:nowrap;align-items:center;font-weight:600;display:flex;position:absolute;inset:0}.progress-bar__inline-label.progress-bar__inline-label-left{justify-content:flex-start}.progress-bar__inline-label.progress-bar__inline-label-center{justify-content:center}.progress-bar__inline-label.progress-bar__inline-label-right{justify-content:flex-end}.progress-bar__track .progress-fill{height:calc(100% - var(--spacing-2));background-color:var(--progress-default-bar-fill-color);border:var(--spacing-1) solid var(--progress-default-bar-border-color);border-radius:var(--spacing-4);transition:width .3s}.progress-bar__track .progress-fill.progress-bar-success{background-color:var(--progress-success-bar-fill-color);border:var(--spacing-1) solid var(--progress-success-bar-border-color)}.progress-bar__track .progress-fill.progress-bar-warning{background-color:var(--progress-warning-bar-fill-color);border:var(--spacing-1) solid var(--progress-warning-bar-border-color)}.progress-bar__track .progress-fill.progress-bar-danger{background-color:var(--progress-danger-bar-fill-color);border:var(--spacing-1) solid var(--progress-danger-bar-border-color)}.progress-bar__track .progress-fill.progress-bar-info{background-color:var(--progress-info-bar-fill-color);border:var(--spacing-1) solid var(--progress-info-bar-border-color)}.progress-bar__track .progress-fill.progress-bar-striped{background-image:linear-gradient(45deg,#ffffff26 25%,#0000 25% 50%,#ffffff26 50% 75%,#0000 75%,#0000);background-size:1rem 1rem}.progress-bar__track .progress-fill.progress-bar-animated{animation:1s linear infinite progress-bar-stripes}.progress-bar--vertical .progress-bar__track .progress-fill{transition:height .3s}.progress-bar.progress-bar-thin .progress-bar__track{height:var(--spacing-6);border-radius:var(--spacing-24)}.progress-bar.progress-bar-thin .progress-bar__track .progress-fill{border-radius:var(--spacing-24)}.progress-bar--vertical.progress-bar-thin .progress-bar__track{width:var(--spacing-6);height:var(--spacing-200)}@keyframes progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import './ProgressBar.css';
|
|
2
|
+
import { format2Digits as j } from "../../helpers/Numbers.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { useMemo as u } from "react";
|
|
5
|
+
import { jsx as o, jsxs as _ } from "react/jsx-runtime";
|
|
6
|
+
var S = ({ animated: $ = !1, height: l, label: t, labelAfterValue: p = !1, labelAlign: i = "left", labelPosition: r = "inside", orientation: c = "horizontal", showPercentage: n = !0, state: f = "default", striped: d = !1, thin: h = !1, value: e = 0 }) => {
|
|
7
|
+
const N = [
|
|
8
|
+
"progress-fill",
|
|
9
|
+
`progress-bar-${f}`,
|
|
10
|
+
d && "progress-bar-striped",
|
|
11
|
+
$ && d && "progress-bar-animated"
|
|
12
|
+
].filter(Boolean).join(" "), m = `progress-bar__label progress-bar__label--${f} ${i ? `progress-bar__label-${i}` : ""}`, b = e > 100 ? 100 : e < 0 ? 0 : e, s = u(() => {
|
|
13
|
+
const a = [];
|
|
14
|
+
return n && a.push(`${j(e)}%`), t && a.push(t), (p ? a : a.reverse()).join(" - ");
|
|
15
|
+
}, [
|
|
16
|
+
n,
|
|
17
|
+
e,
|
|
18
|
+
t,
|
|
19
|
+
p
|
|
20
|
+
]), v = r === "inside" && !!s, g = c === "vertical", y = g && l ? { height: l } : void 0, x = g ? { height: `${b}%` } : { width: `${b}%` };
|
|
21
|
+
return /* @__PURE__ */ _("div", {
|
|
22
|
+
className: `progress-bar progress-bar--${c} ${r === "before" || r === "after" ? "progress-bar-inline" : ""} ${h ? "progress-bar-thin" : ""}`,
|
|
23
|
+
children: [
|
|
24
|
+
(r === "above" || r === "before") && s && /* @__PURE__ */ o("div", {
|
|
25
|
+
className: m,
|
|
26
|
+
children: s
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ _("div", {
|
|
29
|
+
className: "progress-bar__track",
|
|
30
|
+
style: y,
|
|
31
|
+
children: [/* @__PURE__ */ o("div", {
|
|
32
|
+
className: `${N} ${r === "after" ? "progress-bar__label-after" : ""} `,
|
|
33
|
+
style: x
|
|
34
|
+
}), v && /* @__PURE__ */ o("span", {
|
|
35
|
+
className: `progress-bar__inline-label progress-bar__inline-label-${i}`,
|
|
36
|
+
children: s
|
|
37
|
+
})]
|
|
38
|
+
}),
|
|
39
|
+
(r === "below" || r === "after") && s && /* @__PURE__ */ o("div", {
|
|
40
|
+
className: m,
|
|
41
|
+
children: s
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
S as ProgressBar
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.progress-ring{--progress-ring-color:var(--progress-default-bar-fill-color);--progress-ring-size:96px;align-items:center;gap:var(--spacing-8);color:var(--body-color);flex-direction:column;display:inline-flex}.progress-ring--success{--progress-ring-color:var(--progress-success-bar-fill-color)}.progress-ring--info{--progress-ring-color:var(--progress-info-bar-fill-color)}.progress-ring--warning{--progress-ring-color:var(--progress-warning-bar-fill-color)}.progress-ring--danger{--progress-ring-color:var(--progress-danger-bar-fill-color)}.progress-ring__frame{width:var(--progress-ring-size);height:var(--progress-ring-size);display:inline-flex;position:relative}.progress-ring__svg{width:100%;height:100%;transform:rotate(-90deg)}.progress-ring__track,.progress-ring__value{fill:none}.progress-ring__track{stroke:var(--progress-bar-background-color)}.progress-ring__value{stroke:var(--progress-ring-color);transition:stroke-dashoffset .3s,stroke .2s}.progress-ring__content{inset:var(--spacing-8);text-align:center;pointer-events:none;flex-direction:column;justify-content:center;align-items:center;min-width:0;display:flex;position:absolute}.progress-ring__value-text{color:var(--body-color-accent);font-size:var(--font-size-md);font-weight:var(--font-weight-semibold);line-height:var(--line-height-tight)}.progress-ring__label{max-width:var(--progress-ring-size);color:var(--body-color-muted);font-size:var(--font-size-xs);line-height:var(--line-height-tight);text-align:center}.progress-ring__label--inside{margin-top:var(--spacing-2);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import './ProgressRing.css';
|
|
2
|
+
import { format2Digits as M } from "../../helpers/Numbers.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { useMemo as $ } from "react";
|
|
5
|
+
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
var d = {
|
|
7
|
+
small: 64,
|
|
8
|
+
medium: 96,
|
|
9
|
+
large: 128
|
|
10
|
+
}, y = (s) => typeof s == "number" ? s : d[s], z = ({ children: s, className: u = "", label: e, labelPosition: n = "below", rounded: _ = !0, showPercentage: g = !0, size: h = "medium", state: f = "default", thickness: v, value: l }) => {
|
|
11
|
+
const t = Math.min(Math.max(Number.isFinite(l) ? l : 0, 0), 100), r = y(h), c = v ?? (r <= d.small ? 6 : 8), o = Math.max((r - c) / 2, 1), m = 2 * Math.PI * o, x = m - t / 100 * m, N = $(() => `${M(t)}%`, [t]), p = s || (g ? N : n === "inside" ? e : null), k = n === "inside" && e && g && !s;
|
|
12
|
+
return /* @__PURE__ */ i("div", {
|
|
13
|
+
className: `progress-ring progress-ring--${f} ${u}`,
|
|
14
|
+
style: { "--progress-ring-size": `${r}px` },
|
|
15
|
+
children: [/* @__PURE__ */ i("div", {
|
|
16
|
+
className: "progress-ring__frame",
|
|
17
|
+
children: [/* @__PURE__ */ i("svg", {
|
|
18
|
+
className: "progress-ring__svg",
|
|
19
|
+
viewBox: `0 0 ${r} ${r}`,
|
|
20
|
+
children: [/* @__PURE__ */ a("circle", {
|
|
21
|
+
className: "progress-ring__track",
|
|
22
|
+
cx: r / 2,
|
|
23
|
+
cy: r / 2,
|
|
24
|
+
r: o,
|
|
25
|
+
strokeWidth: c
|
|
26
|
+
}), /* @__PURE__ */ a("circle", {
|
|
27
|
+
className: "progress-ring__value",
|
|
28
|
+
cx: r / 2,
|
|
29
|
+
cy: r / 2,
|
|
30
|
+
r: o,
|
|
31
|
+
strokeDasharray: m,
|
|
32
|
+
strokeDashoffset: x,
|
|
33
|
+
strokeLinecap: _ ? "round" : "butt",
|
|
34
|
+
strokeWidth: c
|
|
35
|
+
})]
|
|
36
|
+
}), p && /* @__PURE__ */ i("div", {
|
|
37
|
+
className: "progress-ring__content",
|
|
38
|
+
children: [/* @__PURE__ */ a("span", {
|
|
39
|
+
className: "progress-ring__value-text",
|
|
40
|
+
children: p
|
|
41
|
+
}), k && /* @__PURE__ */ a("span", {
|
|
42
|
+
className: "progress-ring__label progress-ring__label--inside",
|
|
43
|
+
children: e
|
|
44
|
+
})]
|
|
45
|
+
})]
|
|
46
|
+
}), n === "below" && e && /* @__PURE__ */ a("div", {
|
|
47
|
+
className: "progress-ring__label",
|
|
48
|
+
children: e
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
z as ProgressRing
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.quantity-selector-wrapper{--digits:3;gap:var(--spacing-8);flex-direction:column;display:flex}.quantity-selector-wrapper .quantity-selector-label{color:var(--form-control-label-color,var(--form-control-color));font-size:var(--form-control-label-font-size,var(--font-size-sm));font-weight:var(--form-control-label-font-weight,var(--font-weight-medium));letter-spacing:var(--form-control-label-letter-spacing,normal);text-transform:var(--form-control-label-text-transform,none)}.quantity-selector-wrapper .quantity-selector-label .quantity-selector-required{color:var(--body-danger-color,#dc2626);margin-left:var(--spacing-2)}.quantity-selector-wrapper .quantity-selector{border:var(--spacing-1) solid var(--form-control-border-color);border-radius:var(--radius-sm);background-color:var(--form-control-background-color);cursor:default;align-items:stretch;display:inline-flex;overflow:hidden}.quantity-selector-wrapper .quantity-selector.quantity-selector-readonly .quantity-selector-input{pointer-events:none}.quantity-selector-wrapper .quantity-selector.quantity-selector-error{background-color:var(--form-control-error-background-color);border-color:var(--form-control-error-border-color)}.quantity-selector-wrapper .quantity-selector.quantity-selector-error .input-number{color:var(--form-control-error-color)}.quantity-selector-wrapper .quantity-selector.quantity-selector-success{background-color:var(--form-control-success-background-color);border-color:var(--form-control-success-border-color)}.quantity-selector-wrapper .quantity-selector.quantity-selector-success .input-number{color:var(--form-control-success-color)}.quantity-selector-wrapper .quantity-selector .quantity-selector-input{width:calc(var(--digits) * 1ch + var(--spacing-32));align-items:stretch;display:flex}.quantity-selector-wrapper .quantity-selector .quantity-selector-input .input-number-wrapper{flex:1;display:flex}.quantity-selector-wrapper .quantity-selector .quantity-selector-input .input-number-wrapper .input-number{text-align:center;padding:var(--spacing-8) var(--spacing-4);font-size:var(--font-size-sm);background:0 0;border:none;flex:1}.quantity-selector-wrapper .quantity-selector .quantity-selector-input .input-number-wrapper .input-number:focus{outline:none}.quantity-selector-wrapper .quantity-selector .quantity-selector-input .input-number-wrapper .input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.quantity-selector-wrapper .quantity-selector .quantity-selector-input .input-number-wrapper .input-number::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.quantity-selector-wrapper .quantity-selector .quantity-selector-input .input-number-wrapper .input-number[type=number]{appearance:textfield}.quantity-selector-wrapper .quantity-selector .quantity-selector-button{width:var(--spacing-32);min-width:var(--spacing-32);background-color:var(--button-default-background-color);font-size:var(--font-size-md);font-weight:var(--font-weight-bold);border:none;border-radius:0;flex-shrink:0;justify-content:center;padding:0}.quantity-selector-wrapper .quantity-selector .quantity-selector-button:not([disabled]):hover{background-color:var(--button-default-hover-background-color);transform:none}.quantity-selector-wrapper .quantity-selector .quantity-selector-button:active{transform:none}.quantity-selector-wrapper .quantity-selector .quantity-selector-button.quantity-selector-button-decrease{border-right:var(--spacing-1) solid var(--form-control-border-color)}.quantity-selector-wrapper .quantity-selector .quantity-selector-button.quantity-selector-button-increase{border-left:var(--spacing-1) solid var(--form-control-border-color)}.quantity-selector-wrapper .quantity-selector .quantity-selector-button:disabled{cursor:not-allowed}.quantity-selector-wrapper .quantity-selector-error-message{font-size:var(--font-size-xs);color:var(--form-control-error-color)}.quantity-selector-wrapper .quantity-selector-success-message{font-size:var(--font-size-xs);color:var(--form-control-success-color)}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import './QuantitySelector.css';
|
|
2
|
+
import { Button as h } from "../Button/Button2.js";
|
|
3
|
+
import { InputNumber as I } from "../InputNumber/InputNumber2.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { forwardRef as S } from "react";
|
|
6
|
+
import { jsx as s, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
var D = S(({ disabled: n = !1, error: l, id: d, inputWidth: f, label: y, max: t, min: r = 0, onChange: i, readOnlyInput: q = !1, required: p = !1, step: o = 1, success: a, value: c }, v) => {
|
|
8
|
+
const N = f || (t !== void 0 ? Math.max(String(t).length, String(r).length, 3) : 3), m = () => {
|
|
9
|
+
if (n) return;
|
|
10
|
+
const e = (c ?? 0) - o;
|
|
11
|
+
r !== void 0 && e < r || i?.(e);
|
|
12
|
+
}, b = () => {
|
|
13
|
+
if (n) return;
|
|
14
|
+
const e = (c ?? 0) + o;
|
|
15
|
+
t !== void 0 && e > t || i?.(e);
|
|
16
|
+
}, g = (e) => {
|
|
17
|
+
if (!q) {
|
|
18
|
+
if (e === void 0) {
|
|
19
|
+
i?.(void 0);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (r !== void 0 && e < r) {
|
|
23
|
+
i?.(r);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (t !== void 0 && e > t) {
|
|
27
|
+
i?.(t);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
i?.(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ u("div", {
|
|
34
|
+
className: "quantity-selector-wrapper",
|
|
35
|
+
children: [
|
|
36
|
+
y && /* @__PURE__ */ u("label", {
|
|
37
|
+
htmlFor: d,
|
|
38
|
+
className: "quantity-selector-label",
|
|
39
|
+
children: [y, p && /* @__PURE__ */ s("span", {
|
|
40
|
+
className: "quantity-selector-required",
|
|
41
|
+
children: "*"
|
|
42
|
+
})]
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ u("div", {
|
|
45
|
+
className: `quantity-selector${q ? " quantity-selector-readonly" : ""}${l ? " quantity-selector-error" : ""}${a ? " quantity-selector-success" : ""}`,
|
|
46
|
+
style: { "--digits": N },
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ s(h, {
|
|
49
|
+
className: "quantity-selector-button quantity-selector-button-decrease",
|
|
50
|
+
disabled: n || r !== void 0 && (c ?? 0) <= r,
|
|
51
|
+
onClick: m,
|
|
52
|
+
size: "small",
|
|
53
|
+
variant: "default",
|
|
54
|
+
type: "button",
|
|
55
|
+
children: "−"
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ s("div", {
|
|
58
|
+
className: "quantity-selector-input",
|
|
59
|
+
children: /* @__PURE__ */ s(I, {
|
|
60
|
+
disabled: n,
|
|
61
|
+
id: d,
|
|
62
|
+
max: t,
|
|
63
|
+
min: r,
|
|
64
|
+
onChange: g,
|
|
65
|
+
ref: v,
|
|
66
|
+
step: o,
|
|
67
|
+
value: c
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ s(h, {
|
|
71
|
+
className: "quantity-selector-button quantity-selector-button-increase",
|
|
72
|
+
disabled: n || t !== void 0 && (c ?? 0) >= t,
|
|
73
|
+
onClick: b,
|
|
74
|
+
size: "small",
|
|
75
|
+
variant: "default",
|
|
76
|
+
type: "button",
|
|
77
|
+
children: "+"
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
}),
|
|
81
|
+
l && /* @__PURE__ */ s("span", {
|
|
82
|
+
className: "quantity-selector-error-message",
|
|
83
|
+
children: l
|
|
84
|
+
}),
|
|
85
|
+
a && /* @__PURE__ */ s("span", {
|
|
86
|
+
className: "quantity-selector-success-message",
|
|
87
|
+
children: a
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
export {
|
|
93
|
+
D as QuantitySelector
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.quick-add .quick-add-input{padding:var(--spacing-16) var(--spacing-24)}.quick-add .error-message{color:var(--body-danger-color);font-size:var(--font-size-xs);margin-top:var(--spacing-4)}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import './QuickAdd.css';
|
|
2
|
+
import { Modal as y } from "../Modal/Modal2.js";
|
|
3
|
+
import { InputText as k } from "../InputText/InputText2.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { useEffect as p, useState as o } from "react";
|
|
6
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
7
|
+
var b = ({ isOpen: n = !1, onClose: a, placeholder: u, title: f, onSave: m, titleIcon: h, value: i = "", usePortal: v = !1 }) => {
|
|
8
|
+
const [c, s] = o(i), [r, d] = o(!1);
|
|
9
|
+
p(() => {
|
|
10
|
+
n && s(i);
|
|
11
|
+
}, [n, i]);
|
|
12
|
+
const l = async () => {
|
|
13
|
+
d(!0), await m(c), d(!1), a();
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ t("div", {
|
|
16
|
+
className: "quick-add",
|
|
17
|
+
children: /* @__PURE__ */ t(y, {
|
|
18
|
+
isOpen: n,
|
|
19
|
+
title: f,
|
|
20
|
+
titleIcon: h,
|
|
21
|
+
size: "small",
|
|
22
|
+
onClose: a,
|
|
23
|
+
onOverlayClick: a,
|
|
24
|
+
secondary: {
|
|
25
|
+
text: "Cancel",
|
|
26
|
+
variant: "default",
|
|
27
|
+
disabled: r,
|
|
28
|
+
onClick: a
|
|
29
|
+
},
|
|
30
|
+
primary: {
|
|
31
|
+
text: r ? "Saving..." : "Save",
|
|
32
|
+
variant: "success",
|
|
33
|
+
disabled: r,
|
|
34
|
+
onClick: l
|
|
35
|
+
},
|
|
36
|
+
usePortal: v,
|
|
37
|
+
children: /* @__PURE__ */ t("div", {
|
|
38
|
+
className: "quick-add-input",
|
|
39
|
+
children: /* @__PURE__ */ t(k, {
|
|
40
|
+
placeholder: u,
|
|
41
|
+
value: c,
|
|
42
|
+
onChange: (e) => {
|
|
43
|
+
s(e);
|
|
44
|
+
},
|
|
45
|
+
onKeyDown: (e) => {
|
|
46
|
+
e.key === "Enter" && l(), e.key === "Escape" && a();
|
|
47
|
+
},
|
|
48
|
+
autoFocus: !0
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
b as QuickAdd
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.quick-number-update{gap:var(--spacing-24);padding:var(--spacing-24);flex-direction:column;display:flex}.quick-number-update-content{align-items:center;gap:var(--spacing-16);justify-content:center;display:flex}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import './QuickNumberUpdate.css';
|
|
2
|
+
import { Modal as h } from "../Modal/Modal2.js";
|
|
3
|
+
import { InputNumber as k } from "../InputNumber/InputNumber2.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { useState as s } from "react";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
var N = ({ isOpen: l = !1, title: u, onClose: e, onSave: o, icon: d, value: m, min: v, max: p }) => {
|
|
8
|
+
const [r, f] = s(m), [t, i] = s(!1), c = async () => {
|
|
9
|
+
i(!0), await o(r), i(!1), e();
|
|
10
|
+
};
|
|
11
|
+
return /* @__PURE__ */ a(h, {
|
|
12
|
+
isOpen: l,
|
|
13
|
+
titleIcon: d,
|
|
14
|
+
title: u,
|
|
15
|
+
size: "small",
|
|
16
|
+
onClose: e,
|
|
17
|
+
onOverlayClick: e,
|
|
18
|
+
secondary: {
|
|
19
|
+
text: "Cancel",
|
|
20
|
+
variant: "default",
|
|
21
|
+
disabled: t,
|
|
22
|
+
onClick: e
|
|
23
|
+
},
|
|
24
|
+
primary: {
|
|
25
|
+
text: t ? "Saving..." : "Save",
|
|
26
|
+
variant: "success",
|
|
27
|
+
disabled: t,
|
|
28
|
+
onClick: c
|
|
29
|
+
},
|
|
30
|
+
children: /* @__PURE__ */ a("div", {
|
|
31
|
+
className: "quick-number-update",
|
|
32
|
+
children: /* @__PURE__ */ a("div", {
|
|
33
|
+
className: "quick-number-update-content",
|
|
34
|
+
children: /* @__PURE__ */ a(k, {
|
|
35
|
+
autoFocus: !0,
|
|
36
|
+
min: v,
|
|
37
|
+
max: p,
|
|
38
|
+
value: r,
|
|
39
|
+
onChange: (n) => {
|
|
40
|
+
f(n);
|
|
41
|
+
},
|
|
42
|
+
onKeyDown: (n) => {
|
|
43
|
+
n.key === "Enter" && c();
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
N as QuickNumberUpdate
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.quick-set .quick-set-list{padding:var(--spacing-16);row-gap:var(--spacing-16);flex-direction:column;display:flex}.quick-set .error-message{color:var(--body-danger-color);font-size:var(--font-size-xs);margin-top:var(--spacing-4)}
|