@stfrigerio/sito-template 0.1.36 → 0.1.37
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/__tests__/setup.d.ts +2 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/components/atoms/AllAtoms.stories.d.ts +1 -1
- package/dist/components/atoms/AllAtoms.stories.d.ts.map +1 -1
- package/dist/components/atoms/Button/Button.stories.d.ts +2 -14
- package/dist/components/atoms/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/atoms/Card/Card.stories.d.ts +4 -23
- package/dist/components/atoms/Card/Card.stories.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.stories.d.ts +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/atoms/DateInput/DateInput.d.ts +1 -1
- package/dist/components/atoms/DateInput/DateInput.d.ts.map +1 -1
- package/dist/components/atoms/DateInput/DateInput.stories.d.ts +1 -1
- package/dist/components/atoms/DateInput/DateInput.stories.d.ts.map +1 -1
- package/dist/components/atoms/DecryptedText/DecryptedText.d.ts +50 -0
- package/dist/components/atoms/DecryptedText/DecryptedText.d.ts.map +1 -0
- package/dist/components/atoms/DecryptedText/index.d.ts +3 -0
- package/dist/components/atoms/DecryptedText/index.d.ts.map +1 -0
- package/dist/components/atoms/LoadingSpinner/LoadingSpinner.d.ts.map +1 -1
- package/dist/components/atoms/LoadingSpinner/LoadingSpinner.stories.d.ts +1 -1
- package/dist/components/atoms/LoadingSpinner/LoadingSpinner.stories.d.ts.map +1 -1
- package/dist/components/atoms/NumberStepper/NumberStepper.d.ts.map +1 -1
- package/dist/components/atoms/NumberStepper/NumberStepper.stories.d.ts +1 -1
- package/dist/components/atoms/NumberStepper/NumberStepper.stories.d.ts.map +1 -1
- package/dist/components/atoms/SearchableDropdown/SearchableDropdown.stories.d.ts +1 -1
- package/dist/components/atoms/SearchableDropdown/SearchableDropdown.stories.d.ts.map +1 -1
- package/dist/components/atoms/SelectInput/SelectInput.d.ts +4 -2
- package/dist/components/atoms/SelectInput/SelectInput.d.ts.map +1 -1
- package/dist/components/atoms/Slider/Slider.stories.d.ts +2 -10
- package/dist/components/atoms/Slider/Slider.stories.d.ts.map +1 -1
- package/dist/components/atoms/SoundDemo/SoundDemo.d.ts +11 -0
- package/dist/components/atoms/SoundDemo/SoundDemo.d.ts.map +1 -0
- package/dist/components/atoms/SoundDemo/SoundDemo.stories.d.ts +1 -1
- package/dist/components/atoms/SoundDemo/SoundDemo.stories.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/TextArea.stories.d.ts +1 -1
- package/dist/components/atoms/TextArea/TextArea.stories.d.ts.map +1 -1
- package/dist/components/atoms/TextInput/TextInput.d.ts +1 -1
- package/dist/components/atoms/TextInput/TextInput.d.ts.map +1 -1
- package/dist/components/atoms/TextInput/TextInput.stories.d.ts +1 -4
- package/dist/components/atoms/TextInput/TextInput.stories.d.ts.map +1 -1
- package/dist/components/atoms/Toggle/Toggle.d.ts +5 -4
- package/dist/components/atoms/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/atoms/Toggle/Toggle.stories.d.ts +1 -1
- package/dist/components/atoms/Toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/atoms/ToggleButton/ToggleButton.stories.d.ts +1 -1
- package/dist/components/atoms/ToggleButton/ToggleButton.stories.d.ts.map +1 -1
- package/dist/components/atoms/index.d.ts +2 -0
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/molecules/ArrayInput/ArrayInput.d.ts +3 -3
- package/dist/components/molecules/ArrayInput/ArrayInput.d.ts.map +1 -1
- package/dist/components/molecules/ArrayInput/ArrayInput.stories.d.ts +1 -1
- package/dist/components/molecules/ArrayInput/ArrayInput.stories.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumb/Breadcrumb.d.ts +28 -0
- package/dist/components/molecules/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/molecules/Breadcrumb/index.d.ts +3 -0
- package/dist/components/molecules/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/molecules/EditFAB/EditFAB.stories.d.ts +1 -1
- package/dist/components/molecules/EditFAB/EditFAB.stories.d.ts.map +1 -1
- package/dist/components/molecules/LiquidButton/LiquidButton.d.ts +33 -0
- package/dist/components/molecules/LiquidButton/LiquidButton.d.ts.map +1 -0
- package/dist/components/molecules/LiquidButton/index.d.ts +3 -0
- package/dist/components/molecules/LiquidButton/index.d.ts.map +1 -0
- package/dist/components/molecules/SearchBar/SearchBar.stories.d.ts +1 -1
- package/dist/components/molecules/SearchBar/SearchBar.stories.d.ts.map +1 -1
- package/dist/components/molecules/Tabs/Tabs.d.ts +1 -1
- package/dist/components/molecules/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/molecules/Tabs/Tabs.stories.d.ts +1 -1
- package/dist/components/molecules/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/molecules/ThemeSwitcher/ThemeSwitcher.d.ts +4 -3
- package/dist/components/molecules/ThemeSwitcher/ThemeSwitcher.d.ts.map +1 -1
- package/dist/components/molecules/ThemeSwitcher/ThemeSwitcher.stories.d.ts +1 -1
- package/dist/components/molecules/ThemeSwitcher/ThemeSwitcher.stories.d.ts.map +1 -1
- package/dist/components/molecules/TimeInput/TimeInput.stories.d.ts +1 -1
- package/dist/components/molecules/TimeInput/TimeInput.stories.d.ts.map +1 -1
- package/dist/components/molecules/Toast/Toast.d.ts +16 -0
- package/dist/components/molecules/Toast/Toast.d.ts.map +1 -0
- package/dist/components/molecules/Toast/index.d.ts +3 -0
- package/dist/components/molecules/Toast/index.d.ts.map +1 -0
- package/dist/components/molecules/index.d.ts +6 -0
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/Calendar.d.ts +1 -1
- package/dist/components/organisms/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/Calendar.stories.d.ts +1 -1
- package/dist/components/organisms/Calendar/Calendar.stories.d.ts.map +1 -1
- package/dist/components/organisms/ConfirmationModal/ConfirmationModal.d.ts +30 -0
- package/dist/components/organisms/ConfirmationModal/ConfirmationModal.d.ts.map +1 -0
- package/dist/components/organisms/ConfirmationModal/index.d.ts +3 -0
- package/dist/components/organisms/ConfirmationModal/index.d.ts.map +1 -0
- package/dist/components/organisms/ImageSlideshow/ImageSlideshow.d.ts +1 -1
- package/dist/components/organisms/ImageSlideshow/ImageSlideshow.d.ts.map +1 -1
- package/dist/components/organisms/ImageSlideshow/ImageSlideshow.stories.d.ts +1 -6
- package/dist/components/organisms/ImageSlideshow/ImageSlideshow.stories.d.ts.map +1 -1
- package/dist/components/organisms/Navbar/Navbar.d.ts +3 -2
- package/dist/components/organisms/Navbar/Navbar.d.ts.map +1 -1
- package/dist/components/organisms/Navbar/Navbar.stories.d.ts +1 -1
- package/dist/components/organisms/Navbar/Navbar.stories.d.ts.map +1 -1
- package/dist/components/organisms/Table/Table.d.ts +6 -6
- package/dist/components/organisms/Table/Table.d.ts.map +1 -1
- package/dist/components/organisms/Table/Table.stories.d.ts +26 -14
- package/dist/components/organisms/Table/Table.stories.d.ts.map +1 -1
- package/dist/components/organisms/ThemeProvider/ThemeProvider.d.ts +3 -1
- package/dist/components/organisms/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/components/organisms/charts/BooleansHeatmap/BooleansHeatmap.d.ts.map +1 -1
- package/dist/components/organisms/charts/BooleansHeatmap/BooleansHeatmap.stories.d.ts +1 -1
- package/dist/components/organisms/charts/BooleansHeatmap/BooleansHeatmap.stories.d.ts.map +1 -1
- package/dist/components/organisms/charts/MoodChart/MoodChart.stories.d.ts +1 -1
- package/dist/components/organisms/charts/MoodChart/MoodChart.stories.d.ts.map +1 -1
- package/dist/components/organisms/charts/PieChart/PieChart.d.ts.map +1 -1
- package/dist/components/organisms/charts/PieChart/PieChart.stories.d.ts +1 -1
- package/dist/components/organisms/charts/PieChart/PieChart.stories.d.ts.map +1 -1
- package/dist/components/organisms/charts/QuantifiableHabitsChart/QuantifiableHabitsChart.d.ts +2 -0
- package/dist/components/organisms/charts/QuantifiableHabitsChart/QuantifiableHabitsChart.d.ts.map +1 -1
- package/dist/components/organisms/charts/QuantifiableHabitsChart/QuantifiableHabitsChart.stories.d.ts +1 -1
- package/dist/components/organisms/charts/QuantifiableHabitsChart/QuantifiableHabitsChart.stories.d.ts.map +1 -1
- package/dist/components/organisms/charts/SleepChart/SleepChart.stories.d.ts +1 -1
- package/dist/components/organisms/charts/SleepChart/SleepChart.stories.d.ts.map +1 -1
- package/dist/components/organisms/charts/SunburstChart/SunburstChart.d.ts.map +1 -1
- package/dist/components/organisms/charts/SunburstChart/SunburstChart.stories.d.ts +1 -1
- package/dist/components/organisms/charts/SunburstChart/SunburstChart.stories.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +3 -1
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +716 -473
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +734 -485
- package/dist/index.js.map +1 -1
- package/dist/stories/utils.d.ts +2 -2
- package/dist/stories/utils.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/themes/default.css +47 -0
- package/dist/themes/dmood.css +46 -0
- package/dist/themes/globals.css +110 -0
- package/dist/themes/lossito.css +52 -0
- package/dist/tokens/tokens.css +79 -0
- package/dist/utils/formUtils.d.ts +0 -5
- package/dist/utils/formUtils.d.ts.map +1 -1
- package/package.json +32 -10
- package/storybook-static/addon-visual-tests-assets/visual-test-illustration.mp4 +0 -0
- package/storybook-static/assets/AllAtoms.stories-DBoQZmq-.js +109 -0
- package/storybook-static/assets/AnimationPlayer-UXJjBKtF.css +1 -0
- package/storybook-static/assets/AnimationPlayer.stories-yXQ8fqUT.js +379 -0
- package/storybook-static/assets/ArrayInput-CkUpk1TR.css +1 -0
- package/storybook-static/assets/ArrayInput.stories-CRqKExgm.js +221 -0
- package/storybook-static/assets/BooleansHeatmap-BV4VTyo6.css +1 -0
- package/storybook-static/assets/BooleansHeatmap.stories-2u4SThph.js +123 -0
- package/storybook-static/assets/Button-O-w2-ag3.css +1 -0
- package/storybook-static/assets/Button-VfdDKp2T.js +37 -0
- package/storybook-static/assets/Button.stories-BeeBKHoX.js +117 -0
- package/storybook-static/assets/Calendar-BTQfDDfP.css +1 -0
- package/storybook-static/assets/Calendar.stories-CKOG4XAn.js +545 -0
- package/storybook-static/assets/Card-Bc7TyfBx.css +1 -0
- package/storybook-static/assets/Card-D-kcaQHV.js +49 -0
- package/storybook-static/assets/Card.stories-CpcboxKs.js +130 -0
- package/storybook-static/assets/Checkbox-BHwlDfRP.js +33 -0
- package/storybook-static/assets/Checkbox-DMUHtq9s.css +1 -0
- package/storybook-static/assets/Checkbox.stories-DxTQrFgm.js +83 -0
- package/storybook-static/assets/Color-AVL7NMMY-BzNNgCT5.js +1 -0
- package/storybook-static/assets/DateInput-C4-Rlnpy.css +1 -0
- package/storybook-static/assets/DateInput-Cu3PZYc0.js +33 -0
- package/storybook-static/assets/DateInput.stories-BGB5zJBm.js +119 -0
- package/storybook-static/assets/DocsRenderer-PQXLIZUC-q9kcQxfH.js +1243 -0
- package/storybook-static/assets/EditFAB-CntUhqRB.css +1 -0
- package/storybook-static/assets/EditFAB.stories-CmfJxWns.js +408 -0
- package/storybook-static/assets/MoodChart-2hr_Y2GI.css +1 -0
- package/storybook-static/assets/MoodChart.stories-V-wKOSu-.js +40 -0
- package/storybook-static/assets/Navbar-B8vEvGnB.css +1 -0
- package/storybook-static/assets/Navbar.stories-Dkf77idX.js +235 -0
- package/storybook-static/assets/NumberStepper-BVHPJutJ.css +1 -0
- package/storybook-static/assets/NumberStepper-BZGlrWCN.js +30 -0
- package/storybook-static/assets/NumberStepper.stories-NZw7r4Oh.js +127 -0
- package/storybook-static/assets/PieChart-OfDGlJ4g.css +1 -0
- package/storybook-static/assets/PieChart.stories-BkfNODjW.js +199 -0
- package/storybook-static/assets/QuantifiableHabitsChart-BEfzqND4.css +1 -0
- package/storybook-static/assets/QuantifiableHabitsChart.stories-Df6rcrdD.js +105 -0
- package/storybook-static/assets/SearchBar-CYhuHFt7.css +1 -0
- package/storybook-static/assets/SearchBar.stories-DmHIaDZB.js +154 -0
- package/storybook-static/assets/SearchableDropdown-ByAXm1md.js +38 -0
- package/storybook-static/assets/SearchableDropdown-CLYLzeoj.css +1 -0
- package/storybook-static/assets/SearchableDropdown.stories-ByZj6lJu.js +282 -0
- package/storybook-static/assets/SelectInput-BTPptV1H.css +1 -0
- package/storybook-static/assets/SelectInput-D-AwfWVz.js +31 -0
- package/storybook-static/assets/SelectInput.stories-MyE-GqOw.js +112 -0
- package/storybook-static/assets/SleepChart-yGsG5RlQ.css +1 -0
- package/storybook-static/assets/SleepChart.stories-Dsz1U6F9.js +58 -0
- package/storybook-static/assets/SunburstChart-ChXvU9py.css +1 -0
- package/storybook-static/assets/SunburstChart.stories-CphfyDsR.js +285 -0
- package/storybook-static/assets/Tabs-BfJ7skOE.css +1 -0
- package/storybook-static/assets/Tabs.stories-c24Ffu3K.js +49 -0
- package/storybook-static/assets/TextArea-B2UrQsuf.css +1 -0
- package/storybook-static/assets/TextArea-B_sATPlw.js +28 -0
- package/storybook-static/assets/TextArea.stories-CCqRRpwq.js +145 -0
- package/storybook-static/assets/TextInput-BjVJQEYN.css +1 -0
- package/storybook-static/assets/TextInput-ZGg8LTL_.js +28 -0
- package/storybook-static/assets/TextInput.stories-CtvOb60q.js +203 -0
- package/storybook-static/assets/ThemeSwitcher-XCVQ6hhy.css +1 -0
- package/storybook-static/assets/ThemeSwitcher.stories-BvkX1SDm.js +62 -0
- package/storybook-static/assets/TimeInput-C3enPYoV.css +1 -0
- package/storybook-static/assets/TimeInput.stories-BchhRfKo.js +50 -0
- package/storybook-static/assets/Toggle-BQ2KHBDr.js +39 -0
- package/storybook-static/assets/Toggle-DhKq5lh5.css +1 -0
- package/storybook-static/assets/Toggle.stories-BUSZc6m3.js +194 -0
- package/storybook-static/assets/ToggleButton-Dl6hvkJv.js +32 -0
- package/storybook-static/assets/ToggleButton-gfPoPxTQ.css +1 -0
- package/storybook-static/assets/ToggleButton.stories-BKN4zU3N.js +143 -0
- package/storybook-static/assets/arc-DgcIQOLP.js +1 -0
- package/storybook-static/assets/array-BKyUJesY.js +1 -0
- package/storybook-static/assets/defaultLocale-DJ2q5QjE.js +1 -0
- package/storybook-static/assets/iframe-BOc1hSA-.css +1 -0
- package/storybook-static/assets/iframe-BUaP2gIF.js +1087 -0
- package/storybook-static/assets/index-5bdJXrkD.js +1 -0
- package/storybook-static/assets/index-CBmvvqzc.js +1 -0
- package/storybook-static/assets/index-CZs7_DA6.js +9 -0
- package/storybook-static/assets/linear-4t_RuQok.js +1 -0
- package/storybook-static/assets/monotone-BYG7Mesf.js +1 -0
- package/storybook-static/assets/path-CbwjOpE9.js +1 -0
- package/storybook-static/assets/preload-helper-C1FmrZbK.js +1 -0
- package/storybook-static/assets/proxy-9Y4F2rF8.js +1 -0
- package/storybook-static/assets/react-18-D4c-_GAk.js +24 -0
- package/storybook-static/assets/transform-NloTqvdv.js +1 -0
- package/storybook-static/favicon-wrapper.svg +46 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +726 -0
- package/storybook-static/index.html +164 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-4/manager-bundle.js +356 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-4/manager-bundle.js.LEGAL.txt +40 -0
- package/storybook-static/sb-addons/docs-2/manager-bundle.js +151 -0
- package/storybook-static/sb-addons/links-3/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/onboarding-1/manager-bundle.js +127 -0
- package/storybook-static/sb-addons/storybook-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +971 -0
- package/storybook-static/sb-common-assets/favicon-wrapper.svg +46 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +797 -0
- package/storybook-static/sb-manager/globals-runtime.js +69653 -0
- package/storybook-static/sb-manager/globals.js +34 -0
- package/storybook-static/sb-manager/runtime.js +13181 -0
- package/storybook-static/vite-inject-mocker-entry.js +18 -0
package/dist/index.esm.js
CHANGED
|
@@ -1,37 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { createContext, useContext, useState, useEffect, useRef, useCallback, useMemo, memo } from 'react';
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
2
|
import { motion, AnimatePresence, LayoutGroup } from 'framer-motion';
|
|
3
|
+
import React, { useRef, useEffect, useCallback, useState, createContext, useContext, useMemo, memo } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
|
-
import { X, Check, Edit } from 'lucide-react';
|
|
5
|
+
import { X, Calendar as Calendar$1, ChevronDown, Search, Check, Edit, Folder, Users, Book, MessageSquare, UserPlus, Clock, Sun, Moon, Info, Github, SquareKanban, ChevronRight, Plus, Menu, ChevronLeft, Maximize, Download, Share2, Pause, Play } from 'lucide-react';
|
|
6
6
|
import * as d3 from 'd3';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const useTheme$1 = () => {
|
|
10
|
-
const context = useContext(ThemeContext$1);
|
|
11
|
-
if (!context) {
|
|
12
|
-
throw new Error('useTheme must be used within a ThemeProvider');
|
|
13
|
-
}
|
|
14
|
-
return context;
|
|
15
|
-
};
|
|
16
|
-
const ThemeProvider = ({ children, defaultTheme = 'light' }) => {
|
|
17
|
-
const [theme, setTheme] = useState(defaultTheme);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
const savedTheme = localStorage.getItem('theme');
|
|
20
|
-
if (savedTheme) {
|
|
21
|
-
setTheme(savedTheme);
|
|
22
|
-
}
|
|
23
|
-
}, []);
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
document.documentElement.setAttribute('data-theme', theme);
|
|
26
|
-
localStorage.setItem('theme', theme);
|
|
27
|
-
}, [theme]);
|
|
28
|
-
const toggleTheme = () => {
|
|
29
|
-
setTheme(prevTheme => prevTheme === 'light' ? 'dark' : 'light');
|
|
30
|
-
};
|
|
31
|
-
return (jsx(ThemeContext$1.Provider, { value: { theme, toggleTheme, setTheme }, children: children }));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
var styles$u = {"button":"Button-module_button__c6nkW","primary":"Button-module_primary__pMqAs","secondary":"Button-module_secondary__mBWx9","outline":"Button-module_outline__NGGGN","ghost":"Button-module_ghost__u2QBF","danger":"Button-module_danger__2ewhr","small":"Button-module_small__ZI9RX","medium":"Button-module_medium__Wnf9t","large":"Button-module_large__cQCpA","fullWidth":"Button-module_fullWidth__N8vYg","loading":"Button-module_loading__hcSI4","spinner":"Button-module_spinner__HtM96","spin":"Button-module_spin__jblrj","iconLeft":"Button-module_iconLeft__Fpz-y","iconRight":"Button-module_iconRight__kTfjS"};
|
|
8
|
+
var styles$z = {"button":"Button-module_button__c6nkW","primary":"Button-module_primary__pMqAs","secondary":"Button-module_secondary__mBWx9","outline":"Button-module_outline__NGGGN","ghost":"Button-module_ghost__u2QBF","danger":"Button-module_danger__2ewhr","small":"Button-module_small__ZI9RX","medium":"Button-module_medium__Wnf9t","large":"Button-module_large__cQCpA","fullWidth":"Button-module_fullWidth__N8vYg","loading":"Button-module_loading__hcSI4","spinner":"Button-module_spinner__HtM96","spin":"Button-module_spin__jblrj","iconLeft":"Button-module_iconLeft__Fpz-y","iconRight":"Button-module_iconRight__kTfjS"};
|
|
35
9
|
|
|
36
10
|
const SOUND_PACKS = {
|
|
37
11
|
digital: {
|
|
@@ -596,11 +570,11 @@ function useComponentSound(config, options) {
|
|
|
596
570
|
const Button = ({ variant = 'primary', size = 'medium', fullWidth = false, loading = false, iconLeft, iconRight, children, className = '', disabled, motionProps, soundConfig, onClick, onMouseEnter, onFocus, ...rest }) => {
|
|
597
571
|
const { handlers } = useComponentSound(soundConfig);
|
|
598
572
|
const buttonClasses = [
|
|
599
|
-
styles$
|
|
600
|
-
styles$
|
|
601
|
-
styles$
|
|
602
|
-
fullWidth && styles$
|
|
603
|
-
loading && styles$
|
|
573
|
+
styles$z.button,
|
|
574
|
+
styles$z[variant],
|
|
575
|
+
styles$z[size],
|
|
576
|
+
fullWidth && styles$z.fullWidth,
|
|
577
|
+
loading && styles$z.loading,
|
|
604
578
|
className
|
|
605
579
|
].filter(Boolean).join(' ');
|
|
606
580
|
const handleClick = (e) => {
|
|
@@ -611,10 +585,10 @@ const Button = ({ variant = 'primary', size = 'medium', fullWidth = false, loadi
|
|
|
611
585
|
handlers.onMouseEnter?.();
|
|
612
586
|
onMouseEnter?.(e);
|
|
613
587
|
};
|
|
614
|
-
return (jsxs(motion.button, { className: buttonClasses, disabled: disabled || loading, whileHover: { scale: disabled || loading ? 1 : 1.02 }, whileTap: { scale: disabled || loading ? 1 : 0.98 }, transition: { type: "spring", stiffness: 400, damping: 17 }, onClick: handleClick, onMouseEnter: handleMouseEnter, onFocus: onFocus, ...motionProps, ...rest, children: [loading && jsx("span", { className: styles$
|
|
588
|
+
return (jsxs(motion.button, { className: buttonClasses, disabled: disabled || loading, whileHover: { scale: disabled || loading ? 1 : 1.02 }, whileTap: { scale: disabled || loading ? 1 : 0.98 }, transition: { type: "spring", stiffness: 400, damping: 17 }, onClick: handleClick, onMouseEnter: handleMouseEnter, onFocus: onFocus, ...motionProps, ...rest, children: [loading && jsx("span", { className: styles$z.spinner }), iconLeft && jsx("span", { className: styles$z.iconLeft, children: iconLeft }), children, iconRight && jsx("span", { className: styles$z.iconRight, children: iconRight })] }));
|
|
615
589
|
};
|
|
616
590
|
|
|
617
|
-
var styles$
|
|
591
|
+
var styles$y = {"card":"Card-module_card__r2DB2","hoverable":"Card-module_hoverable__X3OpS","elevated":"Card-module_elevated__hGV6-","outlined":"Card-module_outlined__ngRag","flat":"Card-module_flat__xy-xt","glass":"Card-module_glass__Sv-Vs","imageContainer":"Card-module_imageContainer__L4ma6","image":"Card-module_image__bQBt6","header":"Card-module_header__0dtj3","headerContent":"Card-module_headerContent__W7-jD","expandButton":"Card-module_expandButton__I7f49","expandIcon":"Card-module_expandIcon__Lu-OY","expandableContent":"Card-module_expandableContent__BFgO5","expandable":"Card-module_expandable__GMXzo","body":"Card-module_body__K7eL3","footer":"Card-module_footer__L5wO-","title":"Card-module_title__pW9g8","subtitle":"Card-module_subtitle__gejH4","clickable":"Card-module_clickable__Y6fm8","padding":"Card-module_padding__wtyDo","noPadding":"Card-module_noPadding__r5Qq0","loading":"Card-module_loading__S4Wng","loadingShimmer":"Card-module_loadingShimmer__Q1Osr","loadingPulse":"Card-module_loadingPulse__bXQmC"};
|
|
618
592
|
|
|
619
593
|
/**
|
|
620
594
|
* Card Component
|
|
@@ -679,28 +653,28 @@ const Card = ({ variant = 'elevated', hoverable = false, clickable = false, padd
|
|
|
679
653
|
onExpandChange?.(newExpanded);
|
|
680
654
|
};
|
|
681
655
|
const cardClasses = [
|
|
682
|
-
styles$
|
|
683
|
-
styles$
|
|
684
|
-
hoverable && styles$
|
|
685
|
-
clickable && styles$
|
|
686
|
-
!padding && styles$
|
|
687
|
-
expandable && styles$
|
|
656
|
+
styles$y.card,
|
|
657
|
+
styles$y[variant],
|
|
658
|
+
hoverable && styles$y.hoverable,
|
|
659
|
+
clickable && styles$y.clickable,
|
|
660
|
+
!padding && styles$y.noPadding,
|
|
661
|
+
expandable && styles$y.expandable,
|
|
688
662
|
className
|
|
689
663
|
].filter(Boolean).join(' ');
|
|
690
664
|
const renderHeader = () => {
|
|
691
665
|
if (header) {
|
|
692
|
-
return (jsxs("div", { className: styles$
|
|
666
|
+
return (jsxs("div", { className: styles$y.header, children: [jsx("div", { className: styles$y.headerContent, children: header }), expandable && (jsx("button", { className: styles$y.expandButton, onClick: handleToggleExpand, "aria-label": isExpanded ? 'Collapse card' : 'Expand card', children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: styles$y.expandIcon, style: { transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)' }, children: jsx("path", { d: "M6 9l6 6 6-6" }) }) }))] }));
|
|
693
667
|
}
|
|
694
668
|
if (title || subtitle) {
|
|
695
|
-
return (jsxs("div", { className: styles$
|
|
669
|
+
return (jsxs("div", { className: styles$y.header, children: [jsxs("div", { className: styles$y.headerContent, children: [title && jsx("h3", { className: styles$y.title, children: title }), subtitle && jsx("p", { className: styles$y.subtitle, children: subtitle })] }), expandable && (jsx("button", { className: styles$y.expandButton, onClick: handleToggleExpand, "aria-label": isExpanded ? 'Collapse card' : 'Expand card', children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: styles$y.expandIcon, style: { transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)' }, children: jsx("path", { d: "M6 9l6 6 6-6" }) }) }))] }));
|
|
696
670
|
}
|
|
697
671
|
return null;
|
|
698
672
|
};
|
|
699
|
-
const cardContent = (jsxs(Fragment, { children: [image && (jsx("div", { className: styles$
|
|
673
|
+
const cardContent = (jsxs(Fragment, { children: [image && (jsx("div", { className: styles$y.imageContainer, children: jsx("img", { src: image, alt: imageAlt, className: styles$y.image }) })), renderHeader(), jsx(AnimatePresence, { initial: false, children: (!expandable || isExpanded) && (jsxs(motion.div, { initial: expandable ? { height: 0, opacity: 0 } : undefined, animate: expandable ? { height: 'auto', opacity: 1 } : undefined, exit: expandable ? { height: 0, opacity: 0 } : undefined, transition: { duration: 0.3, ease: "easeInOut" }, className: styles$y.expandableContent, children: [children && (jsx("div", { className: padding ? styles$y.body : undefined, children: children })), footer && jsx("div", { className: styles$y.footer, children: footer })] }, "content")) })] }));
|
|
700
674
|
return (jsx(motion.div, { className: cardClasses, onClick: clickable ? onClick : undefined, whileHover: hoverable ? { y: -4 } : undefined, transition: { type: "spring", stiffness: 400, damping: 17 }, ...motionProps, ...rest, children: cardContent }));
|
|
701
675
|
};
|
|
702
676
|
|
|
703
|
-
var styles$
|
|
677
|
+
var styles$x = {"wrapper":"EmptyState-module_wrapper__h3Y2E","compact":"EmptyState-module_compact__HdYu1","default":"EmptyState-module_default__ACAbn","large":"EmptyState-module_large__H3ELo","icon":"EmptyState-module_icon__i7-3M","title":"EmptyState-module_title__xCyfH","message":"EmptyState-module_message__Bc5xK","action":"EmptyState-module_action__UpnvZ"};
|
|
704
678
|
|
|
705
679
|
/**
|
|
706
680
|
* EmptyState Component
|
|
@@ -737,11 +711,11 @@ var styles$s = {"wrapper":"EmptyState-module_wrapper__h3Y2E","compact":"EmptySta
|
|
|
737
711
|
* @returns {JSX.Element} The rendered EmptyState component
|
|
738
712
|
*/
|
|
739
713
|
const EmptyState = ({ icon, title, message, action, size = 'default', }) => {
|
|
740
|
-
const wrapperClass = [styles$
|
|
741
|
-
return (jsxs("div", { className: wrapperClass, children: [icon && jsx("div", { className: styles$
|
|
714
|
+
const wrapperClass = [styles$x.wrapper, styles$x[size]].filter(Boolean).join(' ');
|
|
715
|
+
return (jsxs("div", { className: wrapperClass, children: [icon && jsx("div", { className: styles$x.icon, children: icon }), title && jsx("h3", { className: styles$x.title, children: title }), jsx("p", { className: styles$x.message, children: message }), action && jsx("div", { className: styles$x.action, children: action })] }));
|
|
742
716
|
};
|
|
743
717
|
|
|
744
|
-
var styles$
|
|
718
|
+
var styles$w = {"backdrop":"Modal-module_backdrop__yOx-a","dialog":"Modal-module_dialog__yEXTq","dialogCompact":"Modal-module_dialogCompact__z1Wxp","dialogWide":"Modal-module_dialogWide__9PTXK","header":"Modal-module_header__NHHKd","title":"Modal-module_title__i3R0x","headerActions":"Modal-module_headerActions__g28UN","closeButton":"Modal-module_closeButton__siC-1","body":"Modal-module_body__U7jvM","bodyFlush":"Modal-module_bodyFlush__wtk3q"};
|
|
745
719
|
|
|
746
720
|
/**
|
|
747
721
|
* Modal Component
|
|
@@ -795,16 +769,16 @@ const Modal = ({ open, title, onClose, children, size = 'default', actions, padd
|
|
|
795
769
|
if (typeof document === 'undefined')
|
|
796
770
|
return null;
|
|
797
771
|
const dialogClass = [
|
|
798
|
-
styles$
|
|
799
|
-
size === 'compact' && styles$
|
|
800
|
-
size === 'wide' && styles$
|
|
772
|
+
styles$w.dialog,
|
|
773
|
+
size === 'compact' && styles$w.dialogCompact,
|
|
774
|
+
size === 'wide' && styles$w.dialogWide,
|
|
801
775
|
]
|
|
802
776
|
.filter(Boolean)
|
|
803
777
|
.join(' ');
|
|
804
|
-
return createPortal(jsx(AnimatePresence, { children: open && (jsx(motion.div, { className: styles$
|
|
778
|
+
return createPortal(jsx(AnimatePresence, { children: open && (jsx(motion.div, { className: styles$w.backdrop, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.15 }, onClick: onClose, "aria-hidden": "true", children: jsxs(motion.div, { className: dialogClass, role: "dialog", "aria-modal": "true", "aria-label": title, initial: { opacity: 0, scale: 0.96, y: 8 }, animate: { opacity: 1, scale: 1, y: 0 }, exit: { opacity: 0, scale: 0.96, y: 8 }, transition: { duration: 0.15, ease: 'easeOut' }, onClick: (e) => e.stopPropagation(), children: [jsxs("div", { className: styles$w.header, children: [jsx("span", { className: styles$w.title, children: title }), actions && jsx("div", { className: styles$w.headerActions, children: actions }), jsx("button", { className: styles$w.closeButton, onClick: onClose, "aria-label": "Close modal", type: "button", children: jsx(X, { size: 16 }) })] }), jsx("div", { className: padding ? styles$w.body : styles$w.bodyFlush, children: children })] }) })) }), document.body);
|
|
805
779
|
};
|
|
806
780
|
|
|
807
|
-
var styles$
|
|
781
|
+
var styles$v = {"checkboxLabel":"Checkbox-module_checkboxLabel__4tBVg","checkbox":"Checkbox-module_checkbox__BbJul","checkboxText":"Checkbox-module_checkboxText__oJsc9"};
|
|
808
782
|
|
|
809
783
|
/**
|
|
810
784
|
* Checkbox component - Modern interactive checkbox with animations
|
|
@@ -843,126 +817,20 @@ var styles$q = {"checkboxLabel":"Checkbox-module_checkboxLabel__4tBVg","checkbox
|
|
|
843
817
|
*/
|
|
844
818
|
const Checkbox = ({ checked, onChange, label, disabled = false, indeterminate = false, id, name, value, soundConfig }) => {
|
|
845
819
|
const checkboxRef = useRef(null);
|
|
846
|
-
const {
|
|
820
|
+
const { playSound } = useComponentSound(soundConfig);
|
|
847
821
|
useEffect(() => {
|
|
848
822
|
if (checkboxRef.current) {
|
|
849
823
|
checkboxRef.current.indeterminate = indeterminate;
|
|
850
824
|
}
|
|
851
825
|
}, [indeterminate]);
|
|
852
|
-
return (jsxs("label", { className: styles$
|
|
826
|
+
return (jsxs("label", { className: styles$v.checkboxLabel, children: [jsx("input", { ref: checkboxRef, type: "checkbox", checked: checked, onChange: (e) => {
|
|
853
827
|
const isChecked = e.target.checked;
|
|
854
828
|
onChange(isChecked);
|
|
855
829
|
if (soundConfig?.onClick !== false) {
|
|
856
830
|
playSound('toggle');
|
|
857
831
|
}
|
|
858
|
-
}, className: styles$
|
|
859
|
-
};
|
|
860
|
-
|
|
861
|
-
var DefaultContext = {
|
|
862
|
-
color: undefined,
|
|
863
|
-
size: undefined,
|
|
864
|
-
className: undefined,
|
|
865
|
-
style: undefined,
|
|
866
|
-
attr: undefined
|
|
832
|
+
}, className: styles$v.checkbox, disabled: disabled, id: id, name: name, value: value, "aria-checked": indeterminate ? 'mixed' : checked }), label && jsx("span", { className: styles$v.checkboxText, children: label })] }));
|
|
867
833
|
};
|
|
868
|
-
var IconContext = React.createContext && /*#__PURE__*/React.createContext(DefaultContext);
|
|
869
|
-
|
|
870
|
-
var _excluded = ["attr", "size", "title"];
|
|
871
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
872
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
|
873
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
874
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
875
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
876
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
877
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
878
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
879
|
-
function Tree2Element(tree) {
|
|
880
|
-
return tree && tree.map((node, i) => /*#__PURE__*/React.createElement(node.tag, _objectSpread({
|
|
881
|
-
key: i
|
|
882
|
-
}, node.attr), Tree2Element(node.child)));
|
|
883
|
-
}
|
|
884
|
-
function GenIcon(data) {
|
|
885
|
-
return props => /*#__PURE__*/React.createElement(IconBase, _extends({
|
|
886
|
-
attr: _objectSpread({}, data.attr)
|
|
887
|
-
}, props), Tree2Element(data.child));
|
|
888
|
-
}
|
|
889
|
-
function IconBase(props) {
|
|
890
|
-
var elem = conf => {
|
|
891
|
-
var {
|
|
892
|
-
attr,
|
|
893
|
-
size,
|
|
894
|
-
title
|
|
895
|
-
} = props,
|
|
896
|
-
svgProps = _objectWithoutProperties(props, _excluded);
|
|
897
|
-
var computedSize = size || conf.size || "1em";
|
|
898
|
-
var className;
|
|
899
|
-
if (conf.className) className = conf.className;
|
|
900
|
-
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
901
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
902
|
-
stroke: "currentColor",
|
|
903
|
-
fill: "currentColor",
|
|
904
|
-
strokeWidth: "0"
|
|
905
|
-
}, conf.attr, attr, svgProps, {
|
|
906
|
-
className: className,
|
|
907
|
-
style: _objectSpread(_objectSpread({
|
|
908
|
-
color: props.color || conf.color
|
|
909
|
-
}, conf.style), props.style),
|
|
910
|
-
height: computedSize,
|
|
911
|
-
width: computedSize,
|
|
912
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
913
|
-
}), title && /*#__PURE__*/React.createElement("title", null, title), props.children);
|
|
914
|
-
};
|
|
915
|
-
return IconContext !== undefined ? /*#__PURE__*/React.createElement(IconContext.Consumer, null, conf => elem(conf)) : elem(DefaultContext);
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
// THIS FILE IS AUTO GENERATED
|
|
919
|
-
function FiBook (props) {
|
|
920
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"},"child":[]},{"tag":"path","attr":{"d":"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"},"child":[]}]})(props);
|
|
921
|
-
}function FiCalendar (props) {
|
|
922
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"rect","attr":{"x":"3","y":"4","width":"18","height":"18","rx":"2","ry":"2"},"child":[]},{"tag":"line","attr":{"x1":"16","y1":"2","x2":"16","y2":"6"},"child":[]},{"tag":"line","attr":{"x1":"8","y1":"2","x2":"8","y2":"6"},"child":[]},{"tag":"line","attr":{"x1":"3","y1":"10","x2":"21","y2":"10"},"child":[]}]})(props);
|
|
923
|
-
}function FiCheck (props) {
|
|
924
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"polyline","attr":{"points":"20 6 9 17 4 12"},"child":[]}]})(props);
|
|
925
|
-
}function FiChevronDown (props) {
|
|
926
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"polyline","attr":{"points":"6 9 12 15 18 9"},"child":[]}]})(props);
|
|
927
|
-
}function FiChevronLeft (props) {
|
|
928
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"polyline","attr":{"points":"15 18 9 12 15 6"},"child":[]}]})(props);
|
|
929
|
-
}function FiChevronRight (props) {
|
|
930
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"polyline","attr":{"points":"9 18 15 12 9 6"},"child":[]}]})(props);
|
|
931
|
-
}function FiClock (props) {
|
|
932
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"circle","attr":{"cx":"12","cy":"12","r":"10"},"child":[]},{"tag":"polyline","attr":{"points":"12 6 12 12 16 14"},"child":[]}]})(props);
|
|
933
|
-
}function FiDownload (props) {
|
|
934
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},"child":[]},{"tag":"polyline","attr":{"points":"7 10 12 15 17 10"},"child":[]},{"tag":"line","attr":{"x1":"12","y1":"15","x2":"12","y2":"3"},"child":[]}]})(props);
|
|
935
|
-
}function FiFolder (props) {
|
|
936
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"},"child":[]}]})(props);
|
|
937
|
-
}function FiGithub (props) {
|
|
938
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"},"child":[]}]})(props);
|
|
939
|
-
}function FiInfo (props) {
|
|
940
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"circle","attr":{"cx":"12","cy":"12","r":"10"},"child":[]},{"tag":"line","attr":{"x1":"12","y1":"16","x2":"12","y2":"12"},"child":[]},{"tag":"line","attr":{"x1":"12","y1":"8","x2":"12.01","y2":"8"},"child":[]}]})(props);
|
|
941
|
-
}function FiMaximize (props) {
|
|
942
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},"child":[]}]})(props);
|
|
943
|
-
}function FiMenu (props) {
|
|
944
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"line","attr":{"x1":"3","y1":"12","x2":"21","y2":"12"},"child":[]},{"tag":"line","attr":{"x1":"3","y1":"6","x2":"21","y2":"6"},"child":[]},{"tag":"line","attr":{"x1":"3","y1":"18","x2":"21","y2":"18"},"child":[]}]})(props);
|
|
945
|
-
}function FiMessageSquare (props) {
|
|
946
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"},"child":[]}]})(props);
|
|
947
|
-
}function FiMoon (props) {
|
|
948
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"},"child":[]}]})(props);
|
|
949
|
-
}function FiPause (props) {
|
|
950
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"rect","attr":{"x":"6","y":"4","width":"4","height":"16"},"child":[]},{"tag":"rect","attr":{"x":"14","y":"4","width":"4","height":"16"},"child":[]}]})(props);
|
|
951
|
-
}function FiPlay (props) {
|
|
952
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"polygon","attr":{"points":"5 3 19 12 5 21 5 3"},"child":[]}]})(props);
|
|
953
|
-
}function FiSearch (props) {
|
|
954
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"circle","attr":{"cx":"11","cy":"11","r":"8"},"child":[]},{"tag":"line","attr":{"x1":"21","y1":"21","x2":"16.65","y2":"16.65"},"child":[]}]})(props);
|
|
955
|
-
}function FiShare2 (props) {
|
|
956
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"circle","attr":{"cx":"18","cy":"5","r":"3"},"child":[]},{"tag":"circle","attr":{"cx":"6","cy":"12","r":"3"},"child":[]},{"tag":"circle","attr":{"cx":"18","cy":"19","r":"3"},"child":[]},{"tag":"line","attr":{"x1":"8.59","y1":"13.51","x2":"15.42","y2":"17.49"},"child":[]},{"tag":"line","attr":{"x1":"15.41","y1":"6.51","x2":"8.59","y2":"10.49"},"child":[]}]})(props);
|
|
957
|
-
}function FiSun (props) {
|
|
958
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"circle","attr":{"cx":"12","cy":"12","r":"5"},"child":[]},{"tag":"line","attr":{"x1":"12","y1":"1","x2":"12","y2":"3"},"child":[]},{"tag":"line","attr":{"x1":"12","y1":"21","x2":"12","y2":"23"},"child":[]},{"tag":"line","attr":{"x1":"4.22","y1":"4.22","x2":"5.64","y2":"5.64"},"child":[]},{"tag":"line","attr":{"x1":"18.36","y1":"18.36","x2":"19.78","y2":"19.78"},"child":[]},{"tag":"line","attr":{"x1":"1","y1":"12","x2":"3","y2":"12"},"child":[]},{"tag":"line","attr":{"x1":"21","y1":"12","x2":"23","y2":"12"},"child":[]},{"tag":"line","attr":{"x1":"4.22","y1":"19.78","x2":"5.64","y2":"18.36"},"child":[]},{"tag":"line","attr":{"x1":"18.36","y1":"5.64","x2":"19.78","y2":"4.22"},"child":[]}]})(props);
|
|
959
|
-
}function FiUserPlus (props) {
|
|
960
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"},"child":[]},{"tag":"circle","attr":{"cx":"8.5","cy":"7","r":"4"},"child":[]},{"tag":"line","attr":{"x1":"20","y1":"8","x2":"20","y2":"14"},"child":[]},{"tag":"line","attr":{"x1":"23","y1":"11","x2":"17","y2":"11"},"child":[]}]})(props);
|
|
961
|
-
}function FiUsers (props) {
|
|
962
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"},"child":[]},{"tag":"circle","attr":{"cx":"9","cy":"7","r":"4"},"child":[]},{"tag":"path","attr":{"d":"M23 21v-2a4 4 0 0 0-3-3.87"},"child":[]},{"tag":"path","attr":{"d":"M16 3.13a4 4 0 0 1 0 7.75"},"child":[]}]})(props);
|
|
963
|
-
}function FiX (props) {
|
|
964
|
-
return GenIcon({"attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"line","attr":{"x1":"18","y1":"6","x2":"6","y2":"18"},"child":[]},{"tag":"line","attr":{"x1":"6","y1":"6","x2":"18","y2":"18"},"child":[]}]})(props);
|
|
965
|
-
}
|
|
966
834
|
|
|
967
835
|
const formatDateToEuropean = (date) => {
|
|
968
836
|
if (!date)
|
|
@@ -992,7 +860,7 @@ const parseEuropeanDate = (dateString) => {
|
|
|
992
860
|
return '';
|
|
993
861
|
};
|
|
994
862
|
|
|
995
|
-
var styles$
|
|
863
|
+
var styles$u = {"dateInput":"DateInput-module_dateInput__54VPD","label":"DateInput-module_label__yDdUw","inputWrapper":"DateInput-module_inputWrapper__x-r1d","textInput":"DateInput-module_textInput__ToOSX","calendarButton":"DateInput-module_calendarButton__JzDGD","hiddenDateInput":"DateInput-module_hiddenDateInput__IWNg3","error":"DateInput-module_error__ieuPO","success":"DateInput-module_success__rPA93","loading":"DateInput-module_loading__1DAmD"};
|
|
996
864
|
|
|
997
865
|
/**
|
|
998
866
|
* DateInput component - European format date picker with manual input support
|
|
@@ -1081,19 +949,19 @@ function DateInput({ label, value, onChange, placeholder = "25/12/2024", onFocus
|
|
|
1081
949
|
}
|
|
1082
950
|
};
|
|
1083
951
|
const getClassName = () => {
|
|
1084
|
-
const classes = [styles$
|
|
952
|
+
const classes = [styles$u.dateInput];
|
|
1085
953
|
if (error)
|
|
1086
|
-
classes.push(styles$
|
|
954
|
+
classes.push(styles$u.error);
|
|
1087
955
|
if (success)
|
|
1088
|
-
classes.push(styles$
|
|
956
|
+
classes.push(styles$u.success);
|
|
1089
957
|
if (loading)
|
|
1090
|
-
classes.push(styles$
|
|
958
|
+
classes.push(styles$u.loading);
|
|
1091
959
|
return classes.join(' ');
|
|
1092
960
|
};
|
|
1093
|
-
return (jsxs("div", { className: getClassName(), children: [jsx("label", { className: styles$
|
|
961
|
+
return (jsxs("div", { className: getClassName(), children: [jsx("label", { className: styles$u.label, children: label }), jsxs("div", { className: styles$u.inputWrapper, children: [jsx("input", { type: "text", value: value.includes('-') ? formatDateToEuropean(value) : value, onChange: (e) => handleTextChange(e.target.value), onFocus: onFocus, onBlur: onBlur, placeholder: placeholder, className: styles$u.textInput, disabled: disabled || loading, ...handlers }), jsx("button", { type: "button", onClick: handleCalendarClick, className: styles$u.calendarButton, title: "Select date from calendar", disabled: disabled || loading, children: jsx(Calendar$1, {}) }), jsx("input", { ref: hiddenDateInputRef, type: "date", onChange: handleCalendarChange, className: styles$u.hiddenDateInput, tabIndex: -1, disabled: disabled || loading })] })] }));
|
|
1094
962
|
}
|
|
1095
963
|
|
|
1096
|
-
var styles$
|
|
964
|
+
var styles$t = {"searchableDropdown":"SearchableDropdown-module_searchableDropdown__S2Nh5","dropdownTrigger":"SearchableDropdown-module_dropdownTrigger__dihdr","open":"SearchableDropdown-module_open__P7mRt","dropdownValue":"SearchableDropdown-module_dropdownValue__ydrc2","placeholder":"SearchableDropdown-module_placeholder__BwM2W","dropdownArrow":"SearchableDropdown-module_dropdownArrow__yd5fp","dropdownMenu":"SearchableDropdown-module_dropdownMenu__2Z5cc","dropdownSearch":"SearchableDropdown-module_dropdownSearch__NRk7j","searchInput":"SearchableDropdown-module_searchInput__VS2Hw","searchIcon":"SearchableDropdown-module_searchIcon__2vKFF","dropdownOptions":"SearchableDropdown-module_dropdownOptions__6YXqF","dropdownOption":"SearchableDropdown-module_dropdownOption__YwDr-","selected":"SearchableDropdown-module_selected__31JeB","highlighted":"SearchableDropdown-module_highlighted__P0bBq","checkIcon":"SearchableDropdown-module_checkIcon__YxowK","dropdownNoResults":"SearchableDropdown-module_dropdownNoResults__WW-Da","loading":"SearchableDropdown-module_loading__xlYf0"};
|
|
1097
965
|
|
|
1098
966
|
/**
|
|
1099
967
|
* SearchableDropdown component - Modern filterable dropdown with animations
|
|
@@ -1198,23 +1066,23 @@ function SearchableDropdown({ label, value, onChange, options, placeholder = "Se
|
|
|
1198
1066
|
}
|
|
1199
1067
|
};
|
|
1200
1068
|
const getTriggerClassName = () => {
|
|
1201
|
-
const classes = [styles$
|
|
1069
|
+
const classes = [styles$t.dropdownTrigger];
|
|
1202
1070
|
if (isOpen)
|
|
1203
|
-
classes.push(styles$
|
|
1071
|
+
classes.push(styles$t.open);
|
|
1204
1072
|
if (loading)
|
|
1205
|
-
classes.push(styles$
|
|
1073
|
+
classes.push(styles$t.loading);
|
|
1206
1074
|
if (error)
|
|
1207
|
-
classes.push(styles$
|
|
1075
|
+
classes.push(styles$t.error);
|
|
1208
1076
|
return classes.join(' ');
|
|
1209
1077
|
};
|
|
1210
|
-
return (jsxs("div", { className: styles$
|
|
1078
|
+
return (jsxs("div", { className: styles$t.searchableDropdown, ref: dropdownRef, onKeyDown: handleKeyDown, children: [jsx("label", { children: label }), jsxs(motion.button, { type: "button", className: getTriggerClassName(), onClick: () => !disabled && !loading && setIsOpen(!isOpen), whileTap: { scale: disabled ? 1 : 0.98 }, style: { willChange: 'transform' }, disabled: disabled, children: [jsx("span", { className: `${styles$t.dropdownValue} ${!displayValue ? styles$t.placeholder : ''}`, children: displayValue || placeholder }), jsx(ChevronDown, { className: styles$t.dropdownArrow })] }), jsx(AnimatePresence, { children: isOpen && (jsxs(motion.div, { className: styles$t.dropdownMenu, initial: { opacity: 0, y: -10, scale: 0.95 }, animate: { opacity: 1, y: 0, scale: 1 }, exit: { opacity: 0, y: -10, scale: 0.95 }, transition: { duration: 0.2, ease: "easeOut" }, children: [jsxs("div", { className: styles$t.dropdownSearch, children: [jsx(Search, { className: styles$t.searchIcon }), jsx("input", { ref: inputRef, type: "text", className: styles$t.searchInput, placeholder: "Cerca...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), onClick: (e) => e.stopPropagation() })] }), jsxs("div", { className: styles$t.dropdownOptions, children: [allOptions.map((opt, index) => {
|
|
1211
1079
|
const isSelected = value === opt.value;
|
|
1212
1080
|
const isHighlighted = highlightedIndex === index;
|
|
1213
|
-
return (jsxs(motion.button, { type: "button", className: `${styles$
|
|
1214
|
-
}), allOptions.length === 0 && (jsx(motion.div, { className: styles$
|
|
1081
|
+
return (jsxs(motion.button, { type: "button", className: `${styles$t.dropdownOption} ${isSelected ? styles$t.selected : ''} ${isHighlighted ? styles$t.highlighted : ''}`, onClick: () => handleSelect(opt.value), onMouseEnter: () => setHighlightedIndex(index), initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, transition: { delay: index * 0.02 }, whileTap: { scale: 0.98 }, style: { willChange: 'transform' }, children: [jsx("span", { children: opt.label }), isSelected && jsx(Check, { className: styles$t.checkIcon })] }, `${opt.value}-${index}`));
|
|
1082
|
+
}), allOptions.length === 0 && (jsx(motion.div, { className: styles$t.dropdownNoResults, initial: { opacity: 0 }, animate: { opacity: 1 }, children: "No results found" }))] })] })) })] }));
|
|
1215
1083
|
}
|
|
1216
1084
|
|
|
1217
|
-
var styles$
|
|
1085
|
+
var styles$s = {"selectInput":"SelectInput-module_selectInput__s6zEg","selectWrapper":"SelectInput-module_selectWrapper__Qr4pl","selectIcon":"SelectInput-module_selectIcon__9pjhf","error":"SelectInput-module_error__3WNJc","success":"SelectInput-module_success__WJ5ga","loading":"SelectInput-module_loading__n35N9"};
|
|
1218
1086
|
|
|
1219
1087
|
/**
|
|
1220
1088
|
* SelectInput component - Styled dropdown selector with flexible option format
|
|
@@ -1249,29 +1117,29 @@ var styles$n = {"selectInput":"SelectInput-module_selectInput__s6zEg","selectWra
|
|
|
1249
1117
|
* ]}
|
|
1250
1118
|
* />
|
|
1251
1119
|
*/
|
|
1252
|
-
function SelectInput({ label, value, onChange, options, placeholder = "Select...", disabled = false, error = false, success = false, loading = false, required = false, soundConfig }) {
|
|
1120
|
+
function SelectInput({ label, value, onChange, options, placeholder = "Select...", disabled = false, error = false, success = false, loading = false, required = false, soundConfig, className }) {
|
|
1253
1121
|
const { handlers, playSound } = useComponentSound(soundConfig);
|
|
1254
1122
|
const getClassName = () => {
|
|
1255
|
-
const classes = [styles$
|
|
1123
|
+
const classes = [styles$s.selectInput];
|
|
1256
1124
|
if (error)
|
|
1257
|
-
classes.push(styles$
|
|
1125
|
+
classes.push(styles$s.error);
|
|
1258
1126
|
if (success)
|
|
1259
|
-
classes.push(styles$
|
|
1127
|
+
classes.push(styles$s.success);
|
|
1260
1128
|
if (loading)
|
|
1261
|
-
classes.push(styles$
|
|
1129
|
+
classes.push(styles$s.loading);
|
|
1262
1130
|
return classes.join(' ');
|
|
1263
1131
|
};
|
|
1264
|
-
return (jsxs("div", { className: getClassName()
|
|
1132
|
+
return (jsxs("div", { className: `${getClassName()}${className ? ` ${className}` : ''}`, children: [jsxs("label", { children: [label, required && jsx("span", { style: { color: 'var(--color-error)' }, children: " *" })] }), jsxs("div", { className: styles$s.selectWrapper, children: [jsxs("select", { value: value, onChange: e => {
|
|
1265
1133
|
playSound('click');
|
|
1266
1134
|
onChange(e.target.value);
|
|
1267
1135
|
}, disabled: disabled || loading, required: required, ...handlers, children: [jsx("option", { value: "", children: placeholder }), options.map(opt => {
|
|
1268
1136
|
const optionValue = typeof opt === 'string' ? opt : opt.value;
|
|
1269
1137
|
const optionLabel = typeof opt === 'string' ? opt : opt.label;
|
|
1270
1138
|
return (jsx("option", { value: optionValue, children: optionLabel }, optionValue));
|
|
1271
|
-
})] }), jsx(
|
|
1139
|
+
})] }), jsx(ChevronDown, { className: styles$s.selectIcon })] })] }));
|
|
1272
1140
|
}
|
|
1273
1141
|
|
|
1274
|
-
var styles$
|
|
1142
|
+
var styles$r = {"textareaContainer":"TextArea-module_textareaContainer__AquFj","compact":"TextArea-module_compact__U5lPn","textareaLabel":"TextArea-module_textareaLabel__7Vmyx","requiredIndicator":"TextArea-module_requiredIndicator__3Fxyy","textareaInput":"TextArea-module_textareaInput__VCDZA","characterCount":"TextArea-module_characterCount__9FO5N","nearLimit":"TextArea-module_nearLimit__cUdnw","atLimit":"TextArea-module_atLimit__GoWCC","error":"TextArea-module_error__ciHgb","success":"TextArea-module_success__a0-xD","loading":"TextArea-module_loading__CSFBR","focusMode":"TextArea-module_focusMode__9A8U-"};
|
|
1275
1143
|
|
|
1276
1144
|
/**
|
|
1277
1145
|
* TextArea component - Multi-line text input with character counting
|
|
@@ -1306,38 +1174,38 @@ var styles$m = {"textareaContainer":"TextArea-module_textareaContainer__AquFj","
|
|
|
1306
1174
|
function TextArea({ label, value, onChange, rows = 5, placeholder = "", required = false, maxLength, disabled = false, error = false, success = false, loading = false, focusMode = false, compact = false, className = "" }) {
|
|
1307
1175
|
const textareaId = `textarea-${Math.random().toString(36).substr(2, 9)}`;
|
|
1308
1176
|
const getContainerClassName = () => {
|
|
1309
|
-
const classes = [styles$
|
|
1177
|
+
const classes = [styles$r.textareaContainer];
|
|
1310
1178
|
if (error)
|
|
1311
|
-
classes.push(styles$
|
|
1179
|
+
classes.push(styles$r.error);
|
|
1312
1180
|
if (success)
|
|
1313
|
-
classes.push(styles$
|
|
1181
|
+
classes.push(styles$r.success);
|
|
1314
1182
|
if (loading)
|
|
1315
|
-
classes.push(styles$
|
|
1183
|
+
classes.push(styles$r.loading);
|
|
1316
1184
|
if (focusMode)
|
|
1317
|
-
classes.push(styles$
|
|
1185
|
+
classes.push(styles$r.focusMode);
|
|
1318
1186
|
if (compact)
|
|
1319
|
-
classes.push(styles$
|
|
1187
|
+
classes.push(styles$r.compact);
|
|
1320
1188
|
if (className)
|
|
1321
1189
|
classes.push(className);
|
|
1322
1190
|
return classes.join(' ');
|
|
1323
1191
|
};
|
|
1324
1192
|
const getCharCountClassName = () => {
|
|
1325
1193
|
if (!maxLength)
|
|
1326
|
-
return styles$
|
|
1327
|
-
const classes = [styles$
|
|
1194
|
+
return styles$r.characterCount;
|
|
1195
|
+
const classes = [styles$r.characterCount];
|
|
1328
1196
|
const percentage = (value.length / maxLength) * 100;
|
|
1329
1197
|
if (percentage >= 100) {
|
|
1330
|
-
classes.push(styles$
|
|
1198
|
+
classes.push(styles$r.atLimit);
|
|
1331
1199
|
}
|
|
1332
1200
|
else if (percentage >= 80) {
|
|
1333
|
-
classes.push(styles$
|
|
1201
|
+
classes.push(styles$r.nearLimit);
|
|
1334
1202
|
}
|
|
1335
1203
|
return classes.join(' ');
|
|
1336
1204
|
};
|
|
1337
|
-
return (jsxs("div", { className: getContainerClassName(), children: [label && (jsxs("label", { htmlFor: textareaId, className: styles$
|
|
1205
|
+
return (jsxs("div", { className: getContainerClassName(), children: [label && (jsxs("label", { htmlFor: textareaId, className: styles$r.textareaLabel, children: [label, required && jsx("span", { className: styles$r.requiredIndicator, children: "*" })] })), jsx("textarea", { id: textareaId, value: value, onChange: (e) => onChange(e.target.value), rows: rows, placeholder: placeholder, maxLength: maxLength, className: styles$r.textareaInput, "aria-required": required, disabled: disabled || loading, "aria-invalid": error }), maxLength && (jsxs("div", { className: getCharCountClassName(), children: [jsx("span", { children: value.length }), jsx("span", { style: { opacity: 0.7 }, children: " / " }), jsx("span", { children: maxLength })] }))] }));
|
|
1338
1206
|
}
|
|
1339
1207
|
|
|
1340
|
-
var styles$
|
|
1208
|
+
var styles$q = {"textInput":"TextInput-module_textInput__b2LVM","required":"TextInput-module_required__7uLiM","inputError":"TextInput-module_inputError__QD0a-","errorMessage":"TextInput-module_errorMessage__nIDoQ","success":"TextInput-module_success__KbSS3","loading":"TextInput-module_loading__qXaca","withIcon":"TextInput-module_withIcon__-8swm","inputIcon":"TextInput-module_inputIcon__B4czN","withAction":"TextInput-module_withAction__JD3ku","actionButton":"TextInput-module_actionButton__zFJel"};
|
|
1341
1209
|
|
|
1342
1210
|
/**
|
|
1343
1211
|
* TextInput component - A versatile text input field with label and error handling
|
|
@@ -1374,21 +1242,21 @@ function TextInput({ label, value, onChange, type = "text", onBlur, placeholder,
|
|
|
1374
1242
|
const { handlers, playSound } = useComponentSound(soundConfig);
|
|
1375
1243
|
const prevValueRef = React.useRef(value);
|
|
1376
1244
|
const getContainerClassName = () => {
|
|
1377
|
-
const classes = [styles$
|
|
1245
|
+
const classes = [styles$q.textInput];
|
|
1378
1246
|
if (success)
|
|
1379
|
-
classes.push(styles$
|
|
1247
|
+
classes.push(styles$q.success);
|
|
1380
1248
|
if (loading)
|
|
1381
|
-
classes.push(styles$
|
|
1249
|
+
classes.push(styles$q.loading);
|
|
1382
1250
|
if (icon)
|
|
1383
|
-
classes.push(styles$
|
|
1251
|
+
classes.push(styles$q.withIcon);
|
|
1384
1252
|
if (actionButton)
|
|
1385
|
-
classes.push(styles$
|
|
1253
|
+
classes.push(styles$q.withAction);
|
|
1386
1254
|
return classes.join(' ');
|
|
1387
1255
|
};
|
|
1388
1256
|
React.useEffect(() => {
|
|
1389
1257
|
prevValueRef.current = value;
|
|
1390
1258
|
}, [value]);
|
|
1391
|
-
return (jsxs("div", { className: getContainerClassName(), children: [jsxs("label", { htmlFor: inputId, children: [label, required && jsx("span", { className: styles$
|
|
1259
|
+
return (jsxs("div", { className: getContainerClassName(), children: [jsxs("label", { htmlFor: inputId, children: [label, required && jsx("span", { className: styles$q.required, children: "*" })] }), jsxs("div", { style: { position: 'relative' }, children: [icon && jsx("div", { className: styles$q.inputIcon, children: icon }), jsx("input", { id: inputId, type: type, value: value, onChange: (e) => {
|
|
1392
1260
|
const newValue = e.target.value;
|
|
1393
1261
|
const oldValue = prevValueRef.current;
|
|
1394
1262
|
onChange(newValue);
|
|
@@ -1404,13 +1272,13 @@ function TextInput({ label, value, onChange, type = "text", onBlur, placeholder,
|
|
|
1404
1272
|
if (error && soundConfig?.onError) {
|
|
1405
1273
|
playSound(typeof soundConfig.onError === 'string' ? soundConfig.onError : 'error');
|
|
1406
1274
|
}
|
|
1407
|
-
}, onBlur: onBlur, placeholder: placeholder, className: error ? styles$
|
|
1275
|
+
}, onBlur: onBlur, placeholder: placeholder, className: error ? styles$q.inputError : '', "aria-invalid": !!error, "aria-describedby": error ? `${inputId}-error` : undefined, disabled: disabled || loading, maxLength: maxLength, autoComplete: autoComplete }), actionButton && (jsx("button", { type: "button", className: styles$q.actionButton, onClick: () => {
|
|
1408
1276
|
handlers.onClick?.();
|
|
1409
1277
|
actionButton.onClick();
|
|
1410
|
-
}, disabled: disabled || loading, children: actionButton.label }))] }), error && (jsx("span", { id: `${inputId}-error`, className: styles$
|
|
1278
|
+
}, disabled: disabled || loading, children: actionButton.label }))] }), error && (jsx("span", { id: `${inputId}-error`, className: styles$q.errorMessage, children: error }))] }));
|
|
1411
1279
|
}
|
|
1412
1280
|
|
|
1413
|
-
var styles$
|
|
1281
|
+
var styles$p = {"toggleContainer":"Toggle-module_toggleContainer__QxqQb","toggleButton":"Toggle-module_toggleButton__WUUf-","active":"Toggle-module_active__fX6Io"};
|
|
1414
1282
|
|
|
1415
1283
|
/**
|
|
1416
1284
|
* Toggle Component
|
|
@@ -1428,7 +1296,7 @@ var styles$k = {"toggleContainer":"Toggle-module_toggleContainer__QxqQb","toggle
|
|
|
1428
1296
|
* onToggle={setDarkMode}
|
|
1429
1297
|
* leftLabel="Light"
|
|
1430
1298
|
* rightLabel="Dark"
|
|
1431
|
-
* soundTheme="
|
|
1299
|
+
* soundTheme="digital"
|
|
1432
1300
|
* enableCelebration={true}
|
|
1433
1301
|
* />
|
|
1434
1302
|
*
|
|
@@ -1456,14 +1324,14 @@ var styles$k = {"toggleContainer":"Toggle-module_toggleContainer__QxqQb","toggle
|
|
|
1456
1324
|
* @returns {JSX.Element} The rendered Toggle component
|
|
1457
1325
|
*/
|
|
1458
1326
|
function Toggle(props) {
|
|
1459
|
-
const { isOn, onToggle, leftLabel, rightLabel, leftIcon, rightIcon, className, style, soundConfig,
|
|
1327
|
+
const { isOn, onToggle, leftLabel, rightLabel, leftIcon, rightIcon, className, style, soundConfig, enableCelebration = false } = props;
|
|
1460
1328
|
const leftButtonRef = useRef(null);
|
|
1461
1329
|
const rightButtonRef = useRef(null);
|
|
1462
|
-
const { handlers, playSound
|
|
1330
|
+
const { handlers, playSound } = useComponentSound({
|
|
1463
1331
|
...soundConfig,
|
|
1464
|
-
|
|
1332
|
+
onClick: soundConfig?.onClick ?? 'toggle',
|
|
1465
1333
|
onHover: soundConfig?.onHover ?? 'hover'
|
|
1466
|
-
}
|
|
1334
|
+
});
|
|
1467
1335
|
// Ensure content stays centered by merging styles
|
|
1468
1336
|
const buttonStyle = {
|
|
1469
1337
|
display: 'flex',
|
|
@@ -1471,42 +1339,40 @@ function Toggle(props) {
|
|
|
1471
1339
|
justifyContent: 'center',
|
|
1472
1340
|
...style
|
|
1473
1341
|
};
|
|
1474
|
-
return (jsxs("div", { className: `${styles$
|
|
1475
|
-
const element = leftButtonRef.current;
|
|
1342
|
+
return (jsxs("div", { className: `${styles$p.toggleContainer} ${className || ''}`, children: [jsxs(motion.button, { ref: leftButtonRef, className: `${styles$p.toggleButton} ${!isOn ? styles$p.active : ''}`, whileHover: { scale: 1.05 }, whileTap: { scale: 0.95 }, transition: { type: "spring", stiffness: 400, damping: 17 }, onClick: () => {
|
|
1476
1343
|
if (!isOn) {
|
|
1477
|
-
// Already on left
|
|
1344
|
+
// Already on left
|
|
1478
1345
|
if (enableCelebration) {
|
|
1479
|
-
|
|
1346
|
+
playSound('success');
|
|
1480
1347
|
}
|
|
1481
1348
|
else {
|
|
1482
|
-
playSound('
|
|
1349
|
+
playSound('click');
|
|
1483
1350
|
}
|
|
1484
1351
|
}
|
|
1485
1352
|
else {
|
|
1486
1353
|
// Switching to left
|
|
1487
|
-
playSound('toggle'
|
|
1354
|
+
playSound('toggle');
|
|
1488
1355
|
}
|
|
1489
1356
|
onToggle(false);
|
|
1490
|
-
}, onMouseEnter: () => handlers.onMouseEnter?.(
|
|
1491
|
-
const element = rightButtonRef.current;
|
|
1357
|
+
}, onMouseEnter: () => handlers.onMouseEnter?.(), style: buttonStyle, children: [jsx(motion.div, { animate: { scale: !isOn ? 1.1 : 1, rotate: !isOn ? [0, -5, 5, 0] : 0 }, transition: { duration: 0.3 }, children: leftIcon }), leftLabel] }), jsxs(motion.button, { ref: rightButtonRef, className: `${styles$p.toggleButton} ${isOn ? styles$p.active : ''}`, whileHover: { scale: 1.05 }, whileTap: { scale: 0.95 }, transition: { type: "spring", stiffness: 400, damping: 17 }, onClick: () => {
|
|
1492
1358
|
if (isOn) {
|
|
1493
|
-
// Already on right
|
|
1359
|
+
// Already on right
|
|
1494
1360
|
if (enableCelebration) {
|
|
1495
|
-
|
|
1361
|
+
playSound('success');
|
|
1496
1362
|
}
|
|
1497
1363
|
else {
|
|
1498
|
-
playSound('
|
|
1364
|
+
playSound('click');
|
|
1499
1365
|
}
|
|
1500
1366
|
}
|
|
1501
1367
|
else {
|
|
1502
|
-
// Switching to right
|
|
1503
|
-
playSound('success'
|
|
1368
|
+
// Switching to right
|
|
1369
|
+
playSound('success');
|
|
1504
1370
|
}
|
|
1505
1371
|
onToggle(true);
|
|
1506
|
-
}, onMouseEnter: () => handlers.onMouseEnter?.(
|
|
1372
|
+
}, onMouseEnter: () => handlers.onMouseEnter?.(), style: buttonStyle, children: [jsx(motion.div, { animate: { scale: isOn ? 1.1 : 1, rotate: isOn ? [0, 5, -5, 0] : 0 }, transition: { duration: 0.3 }, children: rightIcon }), rightLabel] })] }));
|
|
1507
1373
|
}
|
|
1508
1374
|
|
|
1509
|
-
var styles$
|
|
1375
|
+
var styles$o = {"container":"NumberStepper-module_container__WSGlU","header":"NumberStepper-module_header__qXI1Y","icon":"NumberStepper-module_icon__vHgsw","label":"NumberStepper-module_label__AYr3g","stepper":"NumberStepper-module_stepper__oQhTp","disabled":"NumberStepper-module_disabled__kGB-g","button":"NumberStepper-module_button__YcjRt","buttonIcon":"NumberStepper-module_buttonIcon__odXec","valueContainer":"NumberStepper-module_valueContainer__87w2D","valueWrapper":"NumberStepper-module_valueWrapper__TH65N","value":"NumberStepper-module_value__BxJeD","limits":"NumberStepper-module_limits__-UrRE","limit":"NumberStepper-module_limit__7nbIP","small":"NumberStepper-module_small__P-k96","large":"NumberStepper-module_large__Lz6lk","outlined":"NumberStepper-module_outlined__CIXv7","filled":"NumberStepper-module_filled__IxOg-","minimal":"NumberStepper-module_minimal__y47-W","custom":"NumberStepper-module_custom__XGSVg","vertical":"NumberStepper-module_vertical__nBcL7","pulse":"NumberStepper-module_pulse__51oUo"};
|
|
1510
1376
|
|
|
1511
1377
|
/**
|
|
1512
1378
|
* NumberStepper Component
|
|
@@ -1643,16 +1509,18 @@ const NumberStepper = ({ value, onChange, min = -Infinity, max = Infinity, step
|
|
|
1643
1509
|
e.preventDefault();
|
|
1644
1510
|
handleDecrement();
|
|
1645
1511
|
break;
|
|
1646
|
-
case 'PageUp':
|
|
1512
|
+
case 'PageUp': {
|
|
1647
1513
|
e.preventDefault();
|
|
1648
1514
|
const bigIncrease = Math.min(value + (step * 10), max);
|
|
1649
1515
|
onChange(bigIncrease);
|
|
1650
1516
|
break;
|
|
1651
|
-
|
|
1517
|
+
}
|
|
1518
|
+
case 'PageDown': {
|
|
1652
1519
|
e.preventDefault();
|
|
1653
1520
|
const bigDecrease = Math.max(value - (step * 10), min);
|
|
1654
1521
|
onChange(bigDecrease);
|
|
1655
1522
|
break;
|
|
1523
|
+
}
|
|
1656
1524
|
case 'Home':
|
|
1657
1525
|
e.preventDefault();
|
|
1658
1526
|
if (min !== -Infinity)
|
|
@@ -1691,32 +1559,32 @@ const NumberStepper = ({ value, onChange, min = -Infinity, max = Infinity, step
|
|
|
1691
1559
|
setDisplayValue(finalValue);
|
|
1692
1560
|
}, [displayValue, min, max, step, onChange]);
|
|
1693
1561
|
const containerClasses = [
|
|
1694
|
-
styles$
|
|
1695
|
-
styles$
|
|
1696
|
-
styles$
|
|
1697
|
-
layout === 'vertical' && styles$
|
|
1698
|
-
disabled && styles$
|
|
1562
|
+
styles$o.container,
|
|
1563
|
+
styles$o[size],
|
|
1564
|
+
styles$o[variant],
|
|
1565
|
+
layout === 'vertical' && styles$o.vertical,
|
|
1566
|
+
disabled && styles$o.disabled,
|
|
1699
1567
|
className
|
|
1700
1568
|
].filter(Boolean).join(' ');
|
|
1701
1569
|
// Merge custom styles with hover states
|
|
1702
1570
|
const [isButtonHovered, setIsButtonHovered] = useState(null);
|
|
1703
1571
|
const isDecrementDisabled = disabled || value <= min;
|
|
1704
1572
|
const isIncrementDisabled = disabled || value >= max;
|
|
1705
|
-
const stepperContent = (jsxs("div", { className: styles$
|
|
1573
|
+
const stepperContent = (jsxs("div", { className: styles$o.stepper, style: customStyles.stepper, onKeyDown: handleKeyDown, tabIndex: disabled ? -1 : 0, ...handlers, children: [jsx(motion.button, { className: styles$o.button, style: {
|
|
1706
1574
|
...customStyles.button,
|
|
1707
1575
|
...(isButtonHovered === 'decrement' && customStyles.buttonHover)
|
|
1708
|
-
}, onMouseEnter: () => setIsButtonHovered('decrement'), onMouseLeave: () => setIsButtonHovered(null), onClick: handleDecrement, disabled: isDecrementDisabled, whileTap: !isDecrementDisabled ? { scale: 0.9 } : undefined, animate: isDecrementing ? { scale: [1, 1.2, 1] } : undefined, transition: { duration: 0.2 }, "aria-label": "Decrease value", children: customButtons.decrement || (showPlusMinus ? (jsx("span", { className: styles$
|
|
1576
|
+
}, onMouseEnter: () => setIsButtonHovered('decrement'), onMouseLeave: () => setIsButtonHovered(null), onClick: handleDecrement, disabled: isDecrementDisabled, whileTap: !isDecrementDisabled ? { scale: 0.9 } : undefined, animate: isDecrementing ? { scale: [1, 1.2, 1] } : undefined, transition: { duration: 0.2 }, "aria-label": "Decrease value", children: customButtons.decrement || (showPlusMinus ? (jsx("span", { className: styles$o.buttonIcon, style: customStyles.buttonIcon, children: "\u2212" })) : (jsx("svg", { className: styles$o.buttonIcon, style: customStyles.buttonIcon, viewBox: "0 0 24 24", fill: "none", children: jsx("path", { d: "M15 18L9 12L15 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }))) }), jsx("div", { className: styles$o.valueContainer, style: customStyles.valueContainer, children: jsx(AnimatePresence, { mode: "wait", children: jsx(motion.div, { initial: { y: isIncrementing ? 10 : isDecrementing ? -10 : 0, opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: isIncrementing ? -10 : isDecrementing ? 10 : 0, opacity: 0 }, transition: { duration: 0.15 }, className: styles$o.valueWrapper, children: jsx("input", { type: "text", className: styles$o.value, style: customStyles.value, value: displayValue, onChange: handleInputChange, onBlur: handleInputBlur, disabled: disabled, "aria-label": label || "Number input", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value }) }, value) }) }), jsx(motion.button, { className: styles$o.button, style: {
|
|
1709
1577
|
...customStyles.button,
|
|
1710
1578
|
...(isButtonHovered === 'increment' && customStyles.buttonHover)
|
|
1711
|
-
}, onMouseEnter: () => setIsButtonHovered('increment'), onMouseLeave: () => setIsButtonHovered(null), onClick: handleIncrement, disabled: isIncrementDisabled, whileTap: !isIncrementDisabled ? { scale: 0.9 } : undefined, animate: isIncrementing ? { scale: [1, 1.2, 1] } : undefined, transition: { duration: 0.2 }, "aria-label": "Increase value", children: customButtons.increment || (showPlusMinus ? (jsx("span", { className: styles$
|
|
1579
|
+
}, onMouseEnter: () => setIsButtonHovered('increment'), onMouseLeave: () => setIsButtonHovered(null), onClick: handleIncrement, disabled: isIncrementDisabled, whileTap: !isIncrementDisabled ? { scale: 0.9 } : undefined, animate: isIncrementing ? { scale: [1, 1.2, 1] } : undefined, transition: { duration: 0.2 }, "aria-label": "Increase value", children: customButtons.increment || (showPlusMinus ? (jsx("span", { className: styles$o.buttonIcon, style: customStyles.buttonIcon, children: "+" })) : (jsx("svg", { className: styles$o.buttonIcon, style: customStyles.buttonIcon, viewBox: "0 0 24 24", fill: "none", children: jsx("path", { d: "M9 18L15 12L9 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }))) })] }));
|
|
1712
1580
|
// For custom variant with horizontal layout, render differently
|
|
1713
1581
|
if (variant === 'custom' && (label || icon)) {
|
|
1714
|
-
return (jsxs("div", { className: containerClasses, style: { ...customStyles.container, display: 'flex', alignItems: 'center' }, children: [jsxs("div", { className: styles$
|
|
1582
|
+
return (jsxs("div", { className: containerClasses, style: { ...customStyles.container, display: 'flex', alignItems: 'center' }, children: [jsxs("div", { className: styles$o.header, style: { ...customStyles.header, flex: 1, marginBottom: 0 }, children: [icon && jsx("span", { className: styles$o.icon, style: customStyles.icon, children: icon }), label && jsx("label", { className: styles$o.label, style: customStyles.label, children: label })] }), stepperContent, !hideLimits && (min !== -Infinity || max !== Infinity) && (jsxs("div", { className: styles$o.limits, style: customStyles.limits, children: [jsx("span", { className: styles$o.limit, children: min !== -Infinity && `Min: ${min}` }), jsx("span", { className: styles$o.limit, children: max !== Infinity && `Max: ${max}` })] }))] }));
|
|
1715
1583
|
}
|
|
1716
|
-
return (jsxs("div", { className: containerClasses, style: customStyles.container, children: [(label || icon) && (jsxs("div", { className: styles$
|
|
1584
|
+
return (jsxs("div", { className: containerClasses, style: customStyles.container, children: [(label || icon) && (jsxs("div", { className: styles$o.header, style: customStyles.header, children: [icon && jsx("span", { className: styles$o.icon, style: customStyles.icon, children: icon }), label && jsx("label", { className: styles$o.label, style: customStyles.label, children: label })] })), stepperContent, !hideLimits && (min !== -Infinity || max !== Infinity) && (jsxs("div", { className: styles$o.limits, style: customStyles.limits, children: [jsx("span", { className: styles$o.limit, children: min !== -Infinity && `Min: ${min}` }), jsx("span", { className: styles$o.limit, children: max !== Infinity && `Max: ${max}` })] }))] }));
|
|
1717
1585
|
};
|
|
1718
1586
|
|
|
1719
|
-
var styles$
|
|
1587
|
+
var styles$n = {"button":"ToggleButton-module_button__DTuyY","background":"ToggleButton-module_background__NwfTp","content":"ToggleButton-module_content__NHqIN","iconWrapper":"ToggleButton-module_iconWrapper__yN4sP","icon":"ToggleButton-module_icon__r8juX","label":"ToggleButton-module_label__4mPJP","hideMobile":"ToggleButton-module_hideMobile__GFAc3","checkmark":"ToggleButton-module_checkmark__ZJwf-","ripple":"ToggleButton-module_ripple__2-faB","small":"ToggleButton-module_small__MhfoN","large":"ToggleButton-module_large__A3naL","default":"ToggleButton-module_default__q8QaZ","active":"ToggleButton-module_active__4DjlR","outlined":"ToggleButton-module_outlined__OtqJB","filled":"ToggleButton-module_filled__LySNn","ghost":"ToggleButton-module_ghost__9KXcb","active-primary":"ToggleButton-module_active-primary__vXMP7","active-secondary":"ToggleButton-module_active-secondary__9Ttdx","active-success":"ToggleButton-module_active-success__oi0rr","active-danger":"ToggleButton-module_active-danger__VUdxr","active-warning":"ToggleButton-module_active-warning__77nSu","animation-scale":"ToggleButton-module_animation-scale__j-3mJ","scaleAnimation":"ToggleButton-module_scaleAnimation__Ms1j2","animation-rotate":"ToggleButton-module_animation-rotate__pBmfc","rotateAnimation":"ToggleButton-module_rotateAnimation__xWZJ5","animation-flip":"ToggleButton-module_animation-flip__ErAbm","flipAnimation":"ToggleButton-module_flipAnimation__qwDTb","disabled":"ToggleButton-module_disabled__Gv5ji"};
|
|
1720
1588
|
|
|
1721
1589
|
/**
|
|
1722
1590
|
* ToggleButton Component
|
|
@@ -1755,18 +1623,18 @@ var styles$i = {"button":"ToggleButton-module_button__DTuyY","background":"Toggl
|
|
|
1755
1623
|
const ToggleButton = ({ active, onClick, icon, label, disabled = false, size = 'medium', variant = 'default', activeColor = 'primary', showCheckmark = false, animation = 'scale', className = '', style = {}, color, tooltip, hideLabelOnMobile = false, soundConfig }) => {
|
|
1756
1624
|
const { handlers, playSound } = useComponentSound(soundConfig);
|
|
1757
1625
|
const buttonClasses = [
|
|
1758
|
-
styles$
|
|
1759
|
-
styles$
|
|
1760
|
-
styles$
|
|
1761
|
-
active && styles$
|
|
1762
|
-
active && styles$
|
|
1763
|
-
disabled && styles$
|
|
1764
|
-
animation !== 'none' && styles$
|
|
1626
|
+
styles$n.button,
|
|
1627
|
+
styles$n[size],
|
|
1628
|
+
styles$n[variant],
|
|
1629
|
+
active && styles$n.active,
|
|
1630
|
+
active && styles$n[`active-${activeColor}`],
|
|
1631
|
+
disabled && styles$n.disabled,
|
|
1632
|
+
animation !== 'none' && styles$n[`animation-${animation}`],
|
|
1765
1633
|
className
|
|
1766
1634
|
].filter(Boolean).join(' ');
|
|
1767
1635
|
const labelClasses = [
|
|
1768
|
-
styles$
|
|
1769
|
-
hideLabelOnMobile && styles$
|
|
1636
|
+
styles$n.label,
|
|
1637
|
+
hideLabelOnMobile && styles$n.hideMobile
|
|
1770
1638
|
].filter(Boolean).join(' ');
|
|
1771
1639
|
const iconVariants = {
|
|
1772
1640
|
scale: {
|
|
@@ -1830,10 +1698,10 @@ const ToggleButton = ({ active, onClick, icon, label, disabled = false, size = '
|
|
|
1830
1698
|
return (jsxs(motion.button, { className: buttonClasses, style: dynamicStyle, onClick: () => {
|
|
1831
1699
|
playSound('toggle');
|
|
1832
1700
|
onClick();
|
|
1833
|
-
}, disabled: disabled, whileHover: !disabled ? { scale: 1.05 } : undefined, whileTap: !disabled ? { scale: 0.95 } : undefined, title: tooltip, "aria-pressed": active, "aria-label": label, ...handlers, children: [jsx(motion.div, { className: styles$
|
|
1701
|
+
}, disabled: disabled, whileHover: !disabled ? { scale: 1.05 } : undefined, whileTap: !disabled ? { scale: 0.95 } : undefined, title: tooltip, "aria-pressed": active, "aria-label": label, ...handlers, children: [jsx(motion.div, { className: styles$n.background, variants: backgroundVariants, initial: "inactive", animate: active ? "active" : "inactive" }), jsxs("div", { className: styles$n.content, children: [icon && (jsx(motion.div, { className: styles$n.iconWrapper, variants: iconVariants[animation], initial: "inactive", animate: active ? "active" : "inactive", transition: { duration: 0.3 }, children: typeof icon === 'string' ? (jsx("span", { className: styles$n.icon, children: icon })) : (jsx("div", { className: styles$n.icon, children: icon })) })), label && jsx("span", { className: labelClasses, children: label }), jsx(AnimatePresence, { children: showCheckmark && active && (jsx(motion.div, { className: styles$n.checkmark, variants: checkmarkVariants, initial: "hidden", animate: "visible", exit: "hidden", children: jsx("svg", { viewBox: "0 0 24 24", fill: "none", children: jsx("path", { d: "M20 6L9 17L4 12", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }) }) })) })] }), jsx(AnimatePresence, { children: active && (jsx(motion.div, { className: styles$n.ripple, initial: { scale: 0, opacity: 0.5 }, animate: { scale: 2, opacity: 0 }, exit: { scale: 0, opacity: 0 }, transition: { duration: 0.6 } })) })] }));
|
|
1834
1702
|
};
|
|
1835
1703
|
|
|
1836
|
-
var styles$
|
|
1704
|
+
var styles$m = {"slider":"Slider-module_slider__RD4G7","label":"Slider-module_label__j4H8M","sliderContainer":"Slider-module_sliderContainer__kQICC","track":"Slider-module_track__fQ-oP","fill":"Slider-module_fill__AYR4-","shimmer":"Slider-module_shimmer__271tL","input":"Slider-module_input__fqY-G","thumb":"Slider-module_thumb__yQJho","ripple":"Slider-module_ripple__gVS04","tooltip":"Slider-module_tooltip__ZubHR","tooltipArrow":"Slider-module_tooltipArrow__1aV9s","valueDisplay":"Slider-module_valueDisplay__V6caL","labelsContainer":"Slider-module_labelsContainer__F6ojF","labelItem":"Slider-module_labelItem__FuEaY","size-sm":"Slider-module_size-sm__Y2bmS","size-lg":"Slider-module_size-lg__RSnPf","disabled":"Slider-module_disabled__gxYoH","loading":"Slider-module_loading__6FkKb","loadingTrack":"Slider-module_loadingTrack__8ItT2","loadingIndicator":"Slider-module_loadingIndicator__Elydq"};
|
|
1837
1705
|
|
|
1838
1706
|
/**
|
|
1839
1707
|
* Slider component - A beautiful, animated range input
|
|
@@ -1921,16 +1789,16 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1921
1789
|
setShowTooltipState(false);
|
|
1922
1790
|
};
|
|
1923
1791
|
const dynamicColor = getDynamicColor();
|
|
1924
|
-
const sizeClass = styles$
|
|
1925
|
-
const stateClass = disabled ? styles$
|
|
1792
|
+
const sizeClass = styles$m[`size-${size}`];
|
|
1793
|
+
const stateClass = disabled ? styles$m.disabled : loading ? styles$m.loading : '';
|
|
1926
1794
|
if (loading) {
|
|
1927
|
-
return (jsxs("div", { className: `${styles$
|
|
1795
|
+
return (jsxs("div", { className: `${styles$m.slider} ${sizeClass} ${styles$m.loading} ${className}`, style: style, children: [label && jsx("label", { className: styles$m.label, children: label }), jsx("div", { className: styles$m.loadingTrack, children: jsx(motion.div, { className: styles$m.loadingIndicator, animate: { x: ['-100%', '200%'] }, transition: {
|
|
1928
1796
|
repeat: Infinity,
|
|
1929
1797
|
duration: 1.5,
|
|
1930
1798
|
ease: "easeInOut"
|
|
1931
1799
|
} }) })] }));
|
|
1932
1800
|
}
|
|
1933
|
-
return (jsxs("div", { className: `${styles$
|
|
1801
|
+
return (jsxs("div", { className: `${styles$m.slider} ${sizeClass} ${stateClass} ${className}`, style: style, children: [label && (jsx(motion.label, { className: styles$m.label, initial: { opacity: 0, y: -10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3 }, children: label })), jsxs(motion.div, { className: styles$m.sliderContainer, ref: sliderRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, whileHover: { scale: 1.02 }, transition: { duration: 0.1 }, children: [jsx(motion.div, { className: styles$m.track, whileHover: { height: 8, marginTop: -1 }, transition: { duration: 0.1 }, children: jsx(motion.div, { className: styles$m.fill, style: {
|
|
1934
1802
|
width: `${percentage}%`,
|
|
1935
1803
|
backgroundColor: dynamicColor
|
|
1936
1804
|
}, initial: { width: 0 }, animate: { width: `${percentage}%` }, transition: {
|
|
@@ -1940,7 +1808,7 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1940
1808
|
damping: 30
|
|
1941
1809
|
}, whileHover: {
|
|
1942
1810
|
boxShadow: `inset 0 0 0 1px rgba(255,255,255,0.2)`
|
|
1943
|
-
} }) }), jsx("input", { type: "range", min: min, max: max, step: step, value: value, onChange: handleChange, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, ...handlers, className: styles$
|
|
1811
|
+
} }) }), jsx("input", { type: "range", min: min, max: max, step: step, value: value, onChange: handleChange, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, ...handlers, className: styles$m.input, disabled: disabled, "aria-label": label }), jsx(motion.div, { className: styles$m.thumb, style: {
|
|
1944
1812
|
left: `${percentage}%`,
|
|
1945
1813
|
backgroundColor: dynamicColor,
|
|
1946
1814
|
borderColor: colors.thumb || dynamicColor
|
|
@@ -1957,14 +1825,14 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1957
1825
|
}, whileHover: {
|
|
1958
1826
|
scale: 1.1,
|
|
1959
1827
|
transition: { duration: 0.1 }
|
|
1960
|
-
}, children: isDragging && (jsx(motion.div, { className: styles$
|
|
1828
|
+
}, children: isDragging && (jsx(motion.div, { className: styles$m.ripple, initial: { scale: 0, opacity: 0.6 }, animate: { scale: 2, opacity: 0 }, transition: { duration: 0.5 } })) }), jsx(AnimatePresence, { children: showTooltipState && (jsxs(motion.div, { className: styles$m.tooltip, style: {
|
|
1961
1829
|
left: `${percentage}%`,
|
|
1962
1830
|
backgroundColor: dynamicColor
|
|
1963
|
-
}, initial: { opacity: 0, y: 10, scale: 0.8 }, animate: { opacity: 1, y: 0, scale: 1 }, exit: { opacity: 0, y: 10, scale: 0.8 }, transition: { duration: 0.2 }, children: [tooltipContent ? tooltipContent(value) : formatValue(value), jsx("div", { className: styles$
|
|
1831
|
+
}, initial: { opacity: 0, y: 10, scale: 0.8 }, animate: { opacity: 1, y: 0, scale: 1 }, exit: { opacity: 0, y: 10, scale: 0.8 }, transition: { duration: 0.2 }, children: [tooltipContent ? tooltipContent(value) : formatValue(value), jsx("div", { className: styles$m.tooltipArrow, style: { borderTopColor: dynamicColor } })] })) })] }), showValue && (jsx(motion.div, { className: styles$m.valueDisplay, style: { color: dynamicColor }, initial: { scale: 0.8 }, animate: { scale: 1 }, transition: {
|
|
1964
1832
|
duration: 0.2,
|
|
1965
1833
|
type: "spring",
|
|
1966
1834
|
stiffness: 300
|
|
1967
|
-
}, children: formatValue(value) }, value)), labels.length > 0 && (jsx("div", { className: styles$
|
|
1835
|
+
}, children: formatValue(value) }, value)), labels.length > 0 && (jsx("div", { className: styles$m.labelsContainer, children: labels.map((labelConfig, index) => {
|
|
1968
1836
|
let position = 0;
|
|
1969
1837
|
if (labelConfig.position === 'start')
|
|
1970
1838
|
position = 0;
|
|
@@ -1972,7 +1840,7 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1972
1840
|
position = 100;
|
|
1973
1841
|
else if (typeof labelConfig.position === 'number')
|
|
1974
1842
|
position = labelConfig.position;
|
|
1975
|
-
return (jsx(motion.div, { className: styles$
|
|
1843
|
+
return (jsx(motion.div, { className: styles$m.labelItem, style: {
|
|
1976
1844
|
left: `${position}%`,
|
|
1977
1845
|
color: labelConfig.color
|
|
1978
1846
|
}, initial: { opacity: 0, y: 5 }, animate: { opacity: 1, y: 0 }, transition: {
|
|
@@ -1985,7 +1853,7 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1985
1853
|
}) }))] }));
|
|
1986
1854
|
}
|
|
1987
1855
|
|
|
1988
|
-
var styles$
|
|
1856
|
+
var styles$l = {"loadingContainer":"LoadingSpinner-module_loadingContainer__m5u51","fullScreen":"LoadingSpinner-module_fullScreen__TuAem","overlay":"LoadingSpinner-module_overlay__X7FTa","shimmer":"LoadingSpinner-module_shimmer__xw4AH","small":"LoadingSpinner-module_small__nq8A3","loadingText":"LoadingSpinner-module_loadingText__wWwna","medium":"LoadingSpinner-module_medium__3JC1S","large":"LoadingSpinner-module_large__4MvAc","dotsSpinner":"LoadingSpinner-module_dotsSpinner__PXtfs","dot1":"LoadingSpinner-module_dot1__5YKSi","dot2":"LoadingSpinner-module_dot2__l6Rbu","dot3":"LoadingSpinner-module_dot3__b9YPW","circleSpinner":"LoadingSpinner-module_circleSpinner__ZmmWs","pulseSpinner":"LoadingSpinner-module_pulseSpinner__wTtDJ","textGradient":"LoadingSpinner-module_textGradient__QDrTY","sparkleContainer":"LoadingSpinner-module_sparkleContainer__9XLJG","sparkle":"LoadingSpinner-module_sparkle__LtFFf"};
|
|
1989
1857
|
|
|
1990
1858
|
const defaultMessages = [
|
|
1991
1859
|
'Loading your content...',
|
|
@@ -2061,6 +1929,7 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2061
1929
|
}, messageRotationInterval);
|
|
2062
1930
|
return () => clearInterval(interval);
|
|
2063
1931
|
}
|
|
1932
|
+
return undefined;
|
|
2064
1933
|
}, [message, showMessage, messagesToUse.length, messageRotationInterval]);
|
|
2065
1934
|
useEffect(() => {
|
|
2066
1935
|
if (!message && showMessage) {
|
|
@@ -2068,22 +1937,22 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2068
1937
|
}
|
|
2069
1938
|
}, [currentMessageIndex, message, messagesToUse, showMessage]);
|
|
2070
1939
|
const containerClasses = [
|
|
2071
|
-
styles$
|
|
2072
|
-
styles$
|
|
2073
|
-
styles$
|
|
2074
|
-
fullScreen && styles$
|
|
2075
|
-
overlay && styles$
|
|
1940
|
+
styles$l.loadingContainer,
|
|
1941
|
+
styles$l[size],
|
|
1942
|
+
styles$l[variant],
|
|
1943
|
+
fullScreen && styles$l.fullScreen,
|
|
1944
|
+
overlay && styles$l.overlay,
|
|
2076
1945
|
className
|
|
2077
1946
|
].filter(Boolean).join(' ');
|
|
2078
1947
|
const customStyle = {
|
|
2079
1948
|
...(color && { '--spinner-color': color }),
|
|
2080
1949
|
...(backgroundColor && { '--spinner-background': backgroundColor }),
|
|
2081
1950
|
};
|
|
2082
|
-
const renderDots = () => (jsxs(motion.div, { className: styles$
|
|
1951
|
+
const renderDots = () => (jsxs(motion.div, { className: styles$l.dotsSpinner, animate: { rotate: 360 }, transition: {
|
|
2083
1952
|
duration: 2,
|
|
2084
1953
|
repeat: Infinity,
|
|
2085
1954
|
ease: 'linear'
|
|
2086
|
-
}, children: [jsx(motion.div, { className: styles$
|
|
1955
|
+
}, children: [jsx(motion.div, { className: styles$l.dot1, animate: {
|
|
2087
1956
|
scale: [1, 1.3, 1],
|
|
2088
1957
|
y: [0, -6, 0]
|
|
2089
1958
|
}, transition: {
|
|
@@ -2091,7 +1960,7 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2091
1960
|
repeat: Infinity,
|
|
2092
1961
|
ease: 'easeInOut',
|
|
2093
1962
|
delay: 0
|
|
2094
|
-
} }), jsx(motion.div, { className: styles$
|
|
1963
|
+
} }), jsx(motion.div, { className: styles$l.dot2, animate: {
|
|
2095
1964
|
scale: [1, 1.3, 1],
|
|
2096
1965
|
y: [0, -6, 0]
|
|
2097
1966
|
}, transition: {
|
|
@@ -2099,7 +1968,7 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2099
1968
|
repeat: Infinity,
|
|
2100
1969
|
ease: 'easeInOut',
|
|
2101
1970
|
delay: 0.5
|
|
2102
|
-
} }), jsx(motion.div, { className: styles$
|
|
1971
|
+
} }), jsx(motion.div, { className: styles$l.dot3, animate: {
|
|
2103
1972
|
scale: [1, 1.3, 1],
|
|
2104
1973
|
y: [0, -6, 0]
|
|
2105
1974
|
}, transition: {
|
|
@@ -2108,12 +1977,12 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2108
1977
|
ease: 'easeInOut',
|
|
2109
1978
|
delay: 1
|
|
2110
1979
|
} })] }));
|
|
2111
|
-
const renderSpinner = () => (jsx(motion.div, { className: styles$
|
|
1980
|
+
const renderSpinner = () => (jsx(motion.div, { className: styles$l.circleSpinner, animate: { rotate: 360 }, transition: {
|
|
2112
1981
|
duration: 1,
|
|
2113
1982
|
repeat: Infinity,
|
|
2114
1983
|
ease: 'linear'
|
|
2115
1984
|
} }));
|
|
2116
|
-
const renderPulse = () => (jsx(motion.div, { className: styles$
|
|
1985
|
+
const renderPulse = () => (jsx(motion.div, { className: styles$l.pulseSpinner, animate: {
|
|
2117
1986
|
scale: [1, 1.2, 1],
|
|
2118
1987
|
opacity: [1, 0.7, 1]
|
|
2119
1988
|
}, transition: {
|
|
@@ -2132,10 +2001,10 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2132
2001
|
return renderDots();
|
|
2133
2002
|
}
|
|
2134
2003
|
};
|
|
2135
|
-
return (jsxs("div", { className: containerClasses, style: customStyle, children: [renderSpinnerVariant(), showMessage && (jsx(AnimatePresence, { mode: "wait", children: jsx(motion.p, { className: styles$
|
|
2004
|
+
return (jsxs("div", { className: containerClasses, style: customStyle, children: [renderSpinnerVariant(), showMessage && (jsx(AnimatePresence, { mode: "wait", children: jsx(motion.p, { className: styles$l.loadingText, initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -10 }, transition: {
|
|
2136
2005
|
duration: 0.4,
|
|
2137
2006
|
ease: 'easeOut'
|
|
2138
|
-
}, children: currentMessage }, currentMessage) })), showSparkles && (jsx("div", { className: styles$
|
|
2007
|
+
}, children: currentMessage }, currentMessage) })), showSparkles && (jsx("div", { className: styles$l.sparkleContainer, children: [...Array(4)].map((_, i) => (jsx(motion.div, { className: styles$l.sparkle, animate: {
|
|
2139
2008
|
opacity: [0, 1, 0],
|
|
2140
2009
|
scale: [0.5, 1, 0.5],
|
|
2141
2010
|
rotate: [0, 180, 360]
|
|
@@ -2150,7 +2019,197 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2150
2019
|
} }, i))) }))] }));
|
|
2151
2020
|
};
|
|
2152
2021
|
|
|
2153
|
-
var styles$
|
|
2022
|
+
var styles$k = {"wrapper":"DecryptedText-module_wrapper__tuLvf","srOnly":"DecryptedText-module_srOnly__A-K2T"};
|
|
2023
|
+
|
|
2024
|
+
/**
|
|
2025
|
+
* DecryptedText Component
|
|
2026
|
+
*
|
|
2027
|
+
* Creates an animated text reveal effect where characters progressively
|
|
2028
|
+
* decrypt from scrambled characters to the final text.
|
|
2029
|
+
*
|
|
2030
|
+
* @example
|
|
2031
|
+
* // Basic usage - animates on hover
|
|
2032
|
+
* <DecryptedText text="Hello World" />
|
|
2033
|
+
*
|
|
2034
|
+
* @example
|
|
2035
|
+
* // Animate when scrolled into view
|
|
2036
|
+
* <DecryptedText text="Welcome" animateOn="view" />
|
|
2037
|
+
*
|
|
2038
|
+
* @example
|
|
2039
|
+
* // Sequential reveal from center
|
|
2040
|
+
* <DecryptedText
|
|
2041
|
+
* text="Decrypt Me"
|
|
2042
|
+
* sequential
|
|
2043
|
+
* revealDirection="center"
|
|
2044
|
+
* speed={30}
|
|
2045
|
+
* />
|
|
2046
|
+
*/
|
|
2047
|
+
const DecryptedText = ({ text, speed = 50, maxIterations = 10, sequential = false, revealDirection = 'start', useOriginalCharsOnly = false, characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', className = '', parentClassName = '', encryptedClassName = '', animateOn = 'hover', ...props }) => {
|
|
2048
|
+
const [displayText, setDisplayText] = useState(text);
|
|
2049
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
2050
|
+
const [isScrambling, setIsScrambling] = useState(false);
|
|
2051
|
+
const [revealedIndices, setRevealedIndices] = useState(new Set());
|
|
2052
|
+
const [hasAnimated, setHasAnimated] = useState(false);
|
|
2053
|
+
const containerRef = useRef(null);
|
|
2054
|
+
useEffect(() => {
|
|
2055
|
+
let interval;
|
|
2056
|
+
let currentIteration = 0;
|
|
2057
|
+
const getNextIndex = (revealedSet) => {
|
|
2058
|
+
const textLength = text.length;
|
|
2059
|
+
switch (revealDirection) {
|
|
2060
|
+
case 'start':
|
|
2061
|
+
return revealedSet.size;
|
|
2062
|
+
case 'end':
|
|
2063
|
+
return textLength - 1 - revealedSet.size;
|
|
2064
|
+
case 'center': {
|
|
2065
|
+
const middle = Math.floor(textLength / 2);
|
|
2066
|
+
const offset = Math.floor(revealedSet.size / 2);
|
|
2067
|
+
const nextIndex = revealedSet.size % 2 === 0 ? middle + offset : middle - offset - 1;
|
|
2068
|
+
if (nextIndex >= 0 && nextIndex < textLength && !revealedSet.has(nextIndex)) {
|
|
2069
|
+
return nextIndex;
|
|
2070
|
+
}
|
|
2071
|
+
for (let i = 0; i < textLength; i++) {
|
|
2072
|
+
if (!revealedSet.has(i))
|
|
2073
|
+
return i;
|
|
2074
|
+
}
|
|
2075
|
+
return 0;
|
|
2076
|
+
}
|
|
2077
|
+
default:
|
|
2078
|
+
return revealedSet.size;
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
const availableChars = useOriginalCharsOnly
|
|
2082
|
+
? Array.from(new Set(text.split(''))).filter((char) => char !== ' ')
|
|
2083
|
+
: characters.split('');
|
|
2084
|
+
const shuffleText = (originalText, currentRevealed) => {
|
|
2085
|
+
if (useOriginalCharsOnly) {
|
|
2086
|
+
const positions = originalText.split('').map((char, i) => ({
|
|
2087
|
+
char,
|
|
2088
|
+
isSpace: char === ' ',
|
|
2089
|
+
index: i,
|
|
2090
|
+
isRevealed: currentRevealed.has(i),
|
|
2091
|
+
}));
|
|
2092
|
+
const nonSpaceChars = positions
|
|
2093
|
+
.filter((p) => !p.isSpace && !p.isRevealed)
|
|
2094
|
+
.map((p) => p.char);
|
|
2095
|
+
for (let i = nonSpaceChars.length - 1; i > 0; i--) {
|
|
2096
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
2097
|
+
[nonSpaceChars[i], nonSpaceChars[j]] = [nonSpaceChars[j], nonSpaceChars[i]];
|
|
2098
|
+
}
|
|
2099
|
+
let charIndex = 0;
|
|
2100
|
+
return positions
|
|
2101
|
+
.map((p) => {
|
|
2102
|
+
if (p.isSpace)
|
|
2103
|
+
return ' ';
|
|
2104
|
+
if (p.isRevealed)
|
|
2105
|
+
return originalText[p.index];
|
|
2106
|
+
return nonSpaceChars[charIndex++];
|
|
2107
|
+
})
|
|
2108
|
+
.join('');
|
|
2109
|
+
}
|
|
2110
|
+
else {
|
|
2111
|
+
return originalText
|
|
2112
|
+
.split('')
|
|
2113
|
+
.map((char, i) => {
|
|
2114
|
+
if (char === ' ')
|
|
2115
|
+
return ' ';
|
|
2116
|
+
if (currentRevealed.has(i))
|
|
2117
|
+
return originalText[i];
|
|
2118
|
+
return availableChars[Math.floor(Math.random() * availableChars.length)];
|
|
2119
|
+
})
|
|
2120
|
+
.join('');
|
|
2121
|
+
}
|
|
2122
|
+
};
|
|
2123
|
+
if (isHovering) {
|
|
2124
|
+
setIsScrambling(true);
|
|
2125
|
+
interval = setInterval(() => {
|
|
2126
|
+
setRevealedIndices((prevRevealed) => {
|
|
2127
|
+
if (sequential) {
|
|
2128
|
+
if (prevRevealed.size < text.length) {
|
|
2129
|
+
const nextIndex = getNextIndex(prevRevealed);
|
|
2130
|
+
const newRevealed = new Set(prevRevealed);
|
|
2131
|
+
newRevealed.add(nextIndex);
|
|
2132
|
+
setDisplayText(shuffleText(text, newRevealed));
|
|
2133
|
+
return newRevealed;
|
|
2134
|
+
}
|
|
2135
|
+
else {
|
|
2136
|
+
clearInterval(interval);
|
|
2137
|
+
setIsScrambling(false);
|
|
2138
|
+
return prevRevealed;
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
else {
|
|
2142
|
+
setDisplayText(shuffleText(text, prevRevealed));
|
|
2143
|
+
currentIteration++;
|
|
2144
|
+
if (currentIteration >= maxIterations) {
|
|
2145
|
+
clearInterval(interval);
|
|
2146
|
+
setIsScrambling(false);
|
|
2147
|
+
setDisplayText(text);
|
|
2148
|
+
}
|
|
2149
|
+
return prevRevealed;
|
|
2150
|
+
}
|
|
2151
|
+
});
|
|
2152
|
+
}, speed);
|
|
2153
|
+
}
|
|
2154
|
+
else {
|
|
2155
|
+
setDisplayText(text);
|
|
2156
|
+
setRevealedIndices(new Set());
|
|
2157
|
+
setIsScrambling(false);
|
|
2158
|
+
}
|
|
2159
|
+
return () => {
|
|
2160
|
+
if (interval)
|
|
2161
|
+
clearInterval(interval);
|
|
2162
|
+
};
|
|
2163
|
+
}, [
|
|
2164
|
+
isHovering,
|
|
2165
|
+
text,
|
|
2166
|
+
speed,
|
|
2167
|
+
maxIterations,
|
|
2168
|
+
sequential,
|
|
2169
|
+
revealDirection,
|
|
2170
|
+
characters,
|
|
2171
|
+
useOriginalCharsOnly,
|
|
2172
|
+
]);
|
|
2173
|
+
useEffect(() => {
|
|
2174
|
+
if (animateOn !== 'view' && animateOn !== 'both')
|
|
2175
|
+
return;
|
|
2176
|
+
const observerCallback = (entries) => {
|
|
2177
|
+
entries.forEach((entry) => {
|
|
2178
|
+
if (entry.isIntersecting && !hasAnimated) {
|
|
2179
|
+
setIsHovering(true);
|
|
2180
|
+
setHasAnimated(true);
|
|
2181
|
+
}
|
|
2182
|
+
});
|
|
2183
|
+
};
|
|
2184
|
+
const observerOptions = {
|
|
2185
|
+
root: null,
|
|
2186
|
+
rootMargin: '0px',
|
|
2187
|
+
threshold: 0.1,
|
|
2188
|
+
};
|
|
2189
|
+
const observer = new IntersectionObserver(observerCallback, observerOptions);
|
|
2190
|
+
const currentRef = containerRef.current;
|
|
2191
|
+
if (currentRef) {
|
|
2192
|
+
observer.observe(currentRef);
|
|
2193
|
+
}
|
|
2194
|
+
return () => {
|
|
2195
|
+
if (currentRef) {
|
|
2196
|
+
observer.unobserve(currentRef);
|
|
2197
|
+
}
|
|
2198
|
+
};
|
|
2199
|
+
}, [animateOn, hasAnimated]);
|
|
2200
|
+
const hoverProps = animateOn === 'hover' || animateOn === 'both'
|
|
2201
|
+
? {
|
|
2202
|
+
onMouseEnter: () => setIsHovering(true),
|
|
2203
|
+
onMouseLeave: () => setIsHovering(false),
|
|
2204
|
+
}
|
|
2205
|
+
: {};
|
|
2206
|
+
return (jsxs(motion.span, { className: `${styles$k.wrapper} ${parentClassName}`, ref: containerRef, ...hoverProps, ...props, children: [jsx("span", { className: styles$k.srOnly, children: displayText }), jsx("span", { "aria-hidden": "true", children: displayText.split('').map((char, index) => {
|
|
2207
|
+
const isRevealedOrDone = revealedIndices.has(index) || !isScrambling || !isHovering;
|
|
2208
|
+
return (jsx("span", { className: isRevealedOrDone ? className : encryptedClassName, children: char }, index));
|
|
2209
|
+
}) })] }));
|
|
2210
|
+
};
|
|
2211
|
+
|
|
2212
|
+
var styles$j = {"arrayInput":"ArrayInput-module_arrayInput__q1x7A","arrayInputLabel":"ArrayInput-module_arrayInputLabel__HyUC7","arrayInputItem":"ArrayInput-module_arrayInputItem__bFtgl","inputWrapper":"ArrayInput-module_inputWrapper__ajhbW","input":"ArrayInput-module_input__1uywi","complexItem":"ArrayInput-module_complexItem__zr-Q-","fieldsWrapper":"ArrayInput-module_fieldsWrapper__7BVPa","removeButton":"ArrayInput-module_removeButton__gYf8Y","addButton":"ArrayInput-module_addButton__mia29"};
|
|
2154
2213
|
|
|
2155
2214
|
/**
|
|
2156
2215
|
* ArrayInput component - Versatile dynamic list manager
|
|
@@ -2217,11 +2276,11 @@ function SimpleArrayInput({ label, values, onChange, placeholder, itemStyle, inp
|
|
|
2217
2276
|
itemIdsRef.current.splice(index, 1);
|
|
2218
2277
|
onChange(newValues);
|
|
2219
2278
|
};
|
|
2220
|
-
return (jsxs("div", { className: styles$
|
|
2279
|
+
return (jsxs("div", { className: styles$j.arrayInput, children: [jsx("h3", { className: styles$j.arrayInputLabel, children: label }), jsx("div", { children: jsx(AnimatePresence, { children: values.map((value, index) => (jsxs(motion.div, { className: styles$j.arrayInputItem, style: itemStyle, initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0 }, transition: {
|
|
2221
2280
|
duration: 0.3,
|
|
2222
2281
|
ease: "easeInOut",
|
|
2223
2282
|
layout: { duration: 0.2 }
|
|
2224
|
-
}, children: [jsx("div", { className: styles$
|
|
2283
|
+
}, children: [jsx("div", { className: styles$j.inputWrapper, children: multiline ? (jsx("div", { style: inputStyle, children: jsx(TextArea, { label: "", value: value, onChange: (newValue) => handleChange(index, newValue), placeholder: placeholder, rows: rows, compact: true }) })) : (jsx("input", { type: "text", value: value, onChange: (e) => handleChange(index, e.target.value), placeholder: placeholder, className: styles$j.input, style: inputStyle })) }), jsx(Button, { variant: "ghost", size: "small", onClick: () => handleRemove(index), "aria-label": "Remove item", className: styles$j.removeButton, children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: jsx("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }) }) })] }, itemIdsRef.current[index]))) }) }), jsx(Button, { variant: buttonVariant, size: "small", onClick: handleAdd, className: styles$j.addButton, children: label })] }));
|
|
2225
2284
|
}
|
|
2226
2285
|
// Complex object array implementation
|
|
2227
2286
|
function ComplexArrayInput({ label, values, onChange, fields, getKey, itemStyle, inputStyle, buttonVariant = 'primary' }) {
|
|
@@ -2246,14 +2305,14 @@ function ComplexArrayInput({ label, values, onChange, fields, getKey, itemStyle,
|
|
|
2246
2305
|
// Generate key from all field values
|
|
2247
2306
|
return fields.map(f => item[f.name] || '').join('-') + `-${index}`;
|
|
2248
2307
|
};
|
|
2249
|
-
return (jsxs("div", { className: styles$
|
|
2308
|
+
return (jsxs("div", { className: styles$j.arrayInput, children: [jsx("h3", { className: styles$j.arrayInputLabel, children: label }), jsx("div", { children: jsx(AnimatePresence, { children: values.map((value, index) => (jsxs(motion.div, { className: `${styles$j.arrayInputItem} ${fields.length > 1 ? styles$j.complexItem : ''}`, style: itemStyle, initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0 }, transition: {
|
|
2250
2309
|
duration: 0.3,
|
|
2251
2310
|
ease: "easeInOut",
|
|
2252
2311
|
layout: { duration: 0.2 }
|
|
2253
|
-
}, children: [jsx("div", { className: styles$
|
|
2312
|
+
}, children: [jsx("div", { className: styles$j.fieldsWrapper, children: fields.map((field) => (jsx("div", { style: inputStyle, children: field.multiline ? (jsx(TextArea, { value: value[field.name] || '', onChange: (newValue) => handleChange(index, field.name, newValue), label: field.label, placeholder: field.placeholder, rows: field.rows, compact: true })) : (jsx(TextInput, { value: value[field.name] || '', onChange: (newValue) => handleChange(index, field.name, newValue), label: field.label, type: field.type, placeholder: field.placeholder })) }, field.name))) }), jsx(Button, { variant: "ghost", size: "small", onClick: () => handleRemove(index), "aria-label": "Remove item", className: styles$j.removeButton, children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: jsx("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }) }) })] }, generateKey(value, index)))) }) }), jsxs(Button, { variant: buttonVariant, size: "small", onClick: handleAdd, className: styles$j.addButton, children: ["Add ", label] })] }));
|
|
2254
2313
|
}
|
|
2255
2314
|
|
|
2256
|
-
var styles$
|
|
2315
|
+
var styles$i = {"fab":"EditFAB-module_fab__nSrTJ","primary":"EditFAB-module_primary__zbA9n","secondary":"EditFAB-module_secondary__BnXs0","success":"EditFAB-module_success__kcLg3","loader":"EditFAB-module_loader__TaJOm","draggable":"EditFAB-module_draggable__eE2vE","dragging":"EditFAB-module_dragging__btRJe"};
|
|
2257
2316
|
|
|
2258
2317
|
const EditFAB = ({ canEdit, isEditMode, hasUnsavedChanges = false, isSaving = false, onEnterEditMode, onExitEditMode, position = { bottom: 32, right: 32 } }) => {
|
|
2259
2318
|
const [isMobile, setIsMobile] = useState(false);
|
|
@@ -2338,15 +2397,15 @@ const EditFAB = ({ canEdit, isEditMode, hasUnsavedChanges = false, isSaving = fa
|
|
|
2338
2397
|
};
|
|
2339
2398
|
const getVariantClass = () => {
|
|
2340
2399
|
if (isSaving)
|
|
2341
|
-
return styles$
|
|
2400
|
+
return styles$i.primary;
|
|
2342
2401
|
if (isEditMode) {
|
|
2343
|
-
return hasUnsavedChanges ? styles$
|
|
2402
|
+
return hasUnsavedChanges ? styles$i.success : styles$i.secondary;
|
|
2344
2403
|
}
|
|
2345
|
-
return styles$
|
|
2404
|
+
return styles$i.primary;
|
|
2346
2405
|
};
|
|
2347
2406
|
const getIcon = () => {
|
|
2348
2407
|
if (isSaving) {
|
|
2349
|
-
return jsx("div", { className: styles$
|
|
2408
|
+
return jsx("div", { className: styles$i.loader });
|
|
2350
2409
|
}
|
|
2351
2410
|
if (isEditMode) {
|
|
2352
2411
|
return hasUnsavedChanges ? jsx(Check, { size: 24 }) : jsx(X, { size: 24 });
|
|
@@ -2361,30 +2420,30 @@ const EditFAB = ({ canEdit, isEditMode, hasUnsavedChanges = false, isSaving = fa
|
|
|
2361
2420
|
}
|
|
2362
2421
|
return "Enter edit mode";
|
|
2363
2422
|
};
|
|
2364
|
-
return (jsx(motion.button, { ref: fabRef, className: `${styles$
|
|
2423
|
+
return (jsx(motion.button, { ref: fabRef, className: `${styles$i.fab} ${getVariantClass()} ${isMobile ? styles$i.draggable : ''} ${isDragging ? styles$i.dragging : ''}`, style: getPositionStyles(), onClick: handleClick, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, disabled: isSaving, "aria-label": getAriaLabel(), initial: { scale: 0, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0, opacity: 0 }, whileHover: !isSaving && !isDragging ? { scale: 1.1 } : {}, whileTap: !isSaving && !isDragging ? { scale: 0.9 } : {}, transition: {
|
|
2365
2424
|
type: "spring",
|
|
2366
2425
|
stiffness: 260,
|
|
2367
2426
|
damping: 20
|
|
2368
2427
|
}, children: getIcon() }));
|
|
2369
2428
|
};
|
|
2370
2429
|
|
|
2371
|
-
var styles$
|
|
2430
|
+
var styles$h = {"searchContainer":"SearchBar-module_searchContainer__TdM1w","searchInputWrapper":"SearchBar-module_searchInputWrapper__kCZLU","searchIcon":"SearchBar-module_searchIcon__IIxEu","searchInput":"SearchBar-module_searchInput__V4gkE","clearButton":"SearchBar-module_clearButton__7fNIY","filterSelect":"SearchBar-module_filterSelect__xIVE4","resultsDropdown":"SearchBar-module_resultsDropdown__yh6NF","loadingState":"SearchBar-module_loadingState__4gidK","emptyState":"SearchBar-module_emptyState__RbI4s","spinner":"SearchBar-module_spinner__PMc6-","resultsGroups":"SearchBar-module_resultsGroups__U24DC","resultGroup":"SearchBar-module_resultGroup__SoTQH","groupHeader":"SearchBar-module_groupHeader__bFRHA","groupIcon":"SearchBar-module_groupIcon__9ENM-","groupTitle":"SearchBar-module_groupTitle__ZekZs","groupCount":"SearchBar-module_groupCount__PQIqw","groupResults":"SearchBar-module_groupResults__xTF52","resultItem":"SearchBar-module_resultItem__VaKKy","highlighted":"SearchBar-module_highlighted__Q-3sH","resultTitle":"SearchBar-module_resultTitle__i1uqL","resultSubtitle":"SearchBar-module_resultSubtitle__LQOJ1","resultMeta":"SearchBar-module_resultMeta__Kmkrn","resultContent":"SearchBar-module_resultContent__TzVzL","highlight":"SearchBar-module_highlight__Q3PSP"};
|
|
2372
2431
|
|
|
2373
2432
|
// Default filter options for backwards compatibility
|
|
2374
2433
|
const defaultFilterOptions = [
|
|
2375
|
-
{ value: 'all', label: 'All', icon:
|
|
2376
|
-
{ value: 'projects', label: 'Projects', icon:
|
|
2377
|
-
{ value: 'clients', label: 'Clients', icon:
|
|
2378
|
-
{ value: 'contacts', label: 'Contacts', icon:
|
|
2379
|
-
{ value: 'interactions', label: 'Interactions', icon:
|
|
2380
|
-
{ value: 'team', label: 'Team', icon:
|
|
2434
|
+
{ value: 'all', label: 'All', icon: Search },
|
|
2435
|
+
{ value: 'projects', label: 'Projects', icon: Folder },
|
|
2436
|
+
{ value: 'clients', label: 'Clients', icon: Users },
|
|
2437
|
+
{ value: 'contacts', label: 'Contacts', icon: Book },
|
|
2438
|
+
{ value: 'interactions', label: 'Interactions', icon: MessageSquare },
|
|
2439
|
+
{ value: 'team', label: 'Team', icon: UserPlus },
|
|
2381
2440
|
];
|
|
2382
2441
|
const defaultEntityIcons = {
|
|
2383
|
-
projects:
|
|
2384
|
-
clients:
|
|
2385
|
-
contacts:
|
|
2386
|
-
interactions:
|
|
2387
|
-
team:
|
|
2442
|
+
projects: Folder,
|
|
2443
|
+
clients: Users,
|
|
2444
|
+
contacts: Book,
|
|
2445
|
+
interactions: MessageSquare,
|
|
2446
|
+
team: UserPlus,
|
|
2388
2447
|
};
|
|
2389
2448
|
const SearchBar = ({ className, placeholder = "Search (Ctrl+Space)...", onSearch, onResultClick, onClear, debounceDelay = 300, minSearchLength = 2, showFilter = true, enableKeyboardShortcut = true, filterOptions: customFilterOptions, entityIcons: customEntityIcons }) => {
|
|
2390
2449
|
const filterOptions = customFilterOptions ?? defaultFilterOptions;
|
|
@@ -2561,18 +2620,18 @@ const SearchBar = ({ className, placeholder = "Search (Ctrl+Space)...", onSearch
|
|
|
2561
2620
|
return text || '';
|
|
2562
2621
|
const regex = new RegExp(`(${highlight.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})`, 'gi');
|
|
2563
2622
|
const parts = text.split(regex);
|
|
2564
|
-
return parts.map((part, index) => regex.test(part) ? (jsx("mark", { className: styles$
|
|
2623
|
+
return parts.map((part, index) => regex.test(part) ? (jsx("mark", { className: styles$h.highlight, children: part }, index)) : (part));
|
|
2565
2624
|
};
|
|
2566
|
-
return (jsxs("div", { ref: searchRef, className: `${styles$
|
|
2625
|
+
return (jsxs("div", { ref: searchRef, className: `${styles$h.searchContainer} ${className || ''}`, children: [jsxs("div", { className: styles$h.searchInputWrapper, children: [jsx(Search, { className: styles$h.searchIcon }), jsx("input", { ref: inputRef, type: "text", value: query, onChange: (e) => setQuery(e.target.value), onKeyDown: handleKeyDown, onFocus: () => query.trim() && results.length > 0 && setIsDropdownOpen(true), placeholder: placeholder, className: styles$h.searchInput, "aria-label": "Search", "aria-expanded": isDropdownOpen, "aria-controls": "search-results", "aria-autocomplete": "list" }), query && (jsx(motion.button, { className: styles$h.clearButton, onClick: handleClear, whileHover: { scale: 1.1 }, whileTap: { scale: 0.9 }, initial: { opacity: 0, scale: 0.8 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.8 }, children: jsx(X, {}) })), showFilter && (jsx("select", { value: filter, onChange: (e) => setFilter(e.target.value), className: styles$h.filterSelect, "aria-label": "Filter search results", children: filterOptions.map(option => (jsx("option", { value: option.value, children: option.label }, option.value))) }))] }), jsx(AnimatePresence, { children: isDropdownOpen && (jsx(motion.div, { ref: resultsRef, id: "search-results", className: styles$h.resultsDropdown, initial: { opacity: 0, y: -10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -10 }, transition: { duration: 0.2 }, children: isLoading ? (jsxs("div", { className: styles$h.loadingState, children: [jsx("div", { className: styles$h.spinner }), jsx("span", { children: "Searching..." })] })) : results.length === 0 ? (jsxs("div", { className: styles$h.emptyState, children: ["No results found for \"", query, "\""] })) : (jsx("div", { className: styles$h.resultsGroups, children: Object.entries(groupedResults).map(([type, groupResults]) => {
|
|
2567
2626
|
const Icon = entityIcons[type];
|
|
2568
|
-
return (jsxs("div", { className: styles$
|
|
2627
|
+
return (jsxs("div", { className: styles$h.resultGroup, children: [jsxs("div", { className: styles$h.groupHeader, children: [Icon && jsx(Icon, { className: styles$h.groupIcon }), jsx("span", { className: styles$h.groupTitle, children: type.charAt(0).toUpperCase() + type.slice(1) }), jsx("span", { className: styles$h.groupCount, children: groupResults.length })] }), jsx("div", { className: styles$h.groupResults, children: groupResults.map((result) => {
|
|
2569
2628
|
const globalIndex = results.indexOf(result);
|
|
2570
|
-
return (jsxs(motion.button, { "data-result-index": globalIndex, className: `${styles$
|
|
2629
|
+
return (jsxs(motion.button, { "data-result-index": globalIndex, className: `${styles$h.resultItem} ${highlightedIndex === globalIndex ? styles$h.highlighted : ''}`, onClick: () => handleResultClick(result), whileHover: { x: 4 }, onMouseEnter: () => setHighlightedIndex(globalIndex), children: [jsxs("div", { className: styles$h.resultContent, children: [jsx("div", { className: styles$h.resultTitle, children: highlightMatch(result.title || 'Untitled', query) }), result.subtitle && (jsx("div", { className: styles$h.resultSubtitle, children: highlightMatch(result.subtitle, query) }))] }), result.meta && (jsx("div", { className: styles$h.resultMeta, children: result.meta }))] }, `${result.type}-${result.id}`));
|
|
2571
2630
|
}) })] }, type));
|
|
2572
2631
|
}) })) })) })] }));
|
|
2573
2632
|
};
|
|
2574
2633
|
|
|
2575
|
-
var styles$
|
|
2634
|
+
var styles$g = {"modalOverlay":"TimePickerModal-module_modalOverlay__Cbq5-","modalContent":"TimePickerModal-module_modalContent__e6py2","modalHeader":"TimePickerModal-module_modalHeader__XhTgK","closeButton":"TimePickerModal-module_closeButton__qsRAG","timeDisplay":"TimePickerModal-module_timeDisplay__voGP4","pickerContainer":"TimePickerModal-module_pickerContainer__4qn3r","pickerColumn":"TimePickerModal-module_pickerColumn__0-kWf","pickerLabel":"TimePickerModal-module_pickerLabel__e7zQ2","pickerScroll":"TimePickerModal-module_pickerScroll__5Dcvw","pickerItem":"TimePickerModal-module_pickerItem__n8sC2","selected":"TimePickerModal-module_selected__oQA8Z","pickerDivider":"TimePickerModal-module_pickerDivider__eg83F","modalActions":"TimePickerModal-module_modalActions__eJRWU","cancelButton":"TimePickerModal-module_cancelButton__zri81","confirmButton":"TimePickerModal-module_confirmButton__q2p3Q"};
|
|
2576
2635
|
|
|
2577
2636
|
function TimePickerModal({ isOpen, onClose, value, onChange }) {
|
|
2578
2637
|
const [hours, minutes] = value ? value.split(':').map(Number) : [12, 0];
|
|
@@ -2593,10 +2652,10 @@ function TimePickerModal({ isOpen, onClose, value, onChange }) {
|
|
|
2593
2652
|
};
|
|
2594
2653
|
if (!isOpen)
|
|
2595
2654
|
return null;
|
|
2596
|
-
return (jsx("div", { className: styles$
|
|
2655
|
+
return (jsx("div", { className: styles$g.modalOverlay, onClick: onClose, children: jsxs("div", { className: styles$g.modalContent, onClick: (e) => e.stopPropagation(), children: [jsxs("div", { className: styles$g.modalHeader, children: [jsx("h3", { children: "Select Time" }), jsx("button", { className: styles$g.closeButton, onClick: onClose, "aria-label": "Close", children: jsx(X, {}) })] }), jsxs("div", { className: styles$g.timeDisplay, children: [selectedHour.toString().padStart(2, '0'), ":", selectedMinute.toString().padStart(2, '0')] }), jsxs("div", { className: styles$g.pickerContainer, children: [jsxs("div", { className: styles$g.pickerColumn, children: [jsx("div", { className: styles$g.pickerLabel, children: "Hours" }), jsx("div", { className: styles$g.pickerScroll, children: Array.from({ length: 24 }, (_, i) => (jsx("button", { className: `${styles$g.pickerItem} ${selectedHour === i ? styles$g.selected : ''}`, onClick: () => setSelectedHour(i), children: i.toString().padStart(2, '0') }, i))) })] }), jsx("div", { className: styles$g.pickerDivider, children: ":" }), jsxs("div", { className: styles$g.pickerColumn, children: [jsx("div", { className: styles$g.pickerLabel, children: "Minutes" }), jsx("div", { className: styles$g.pickerScroll, children: Array.from({ length: 60 }, (_, i) => (jsx("button", { className: `${styles$g.pickerItem} ${selectedMinute === i ? styles$g.selected : ''}`, onClick: () => setSelectedMinute(i), children: i.toString().padStart(2, '0') }, i))) })] })] }), jsxs("div", { className: styles$g.modalActions, children: [jsx("button", { className: styles$g.cancelButton, onClick: onClose, children: "Cancel" }), jsx("button", { className: styles$g.confirmButton, onClick: handleConfirm, children: "Confirm" })] })] }) }));
|
|
2597
2656
|
}
|
|
2598
2657
|
|
|
2599
|
-
var styles$
|
|
2658
|
+
var styles$f = {"timeInput":"TimeInput-module_timeInput__h1DpT","label":"TimeInput-module_label__d4rZw","required":"TimeInput-module_required__rc1vq","inputWrapper":"TimeInput-module_inputWrapper__4RPAn","textInput":"TimeInput-module_textInput__M3eBZ","clockButton":"TimeInput-module_clockButton__3qoub","error":"TimeInput-module_error__gJnpk","success":"TimeInput-module_success__np-lF","loading":"TimeInput-module_loading__Wb1DC","disabled":"TimeInput-module_disabled__wxiZ-"};
|
|
2600
2659
|
|
|
2601
2660
|
function TimeInput({ label, value, onChange, placeholder = "14:30", onFocus, onBlur, error = false, success = false, loading = false, disabled = false, required = false, className = "" }) {
|
|
2602
2661
|
const [showPicker, setShowPicker] = useState(false);
|
|
@@ -2649,20 +2708,20 @@ function TimeInput({ label, value, onChange, placeholder = "14:30", onFocus, onB
|
|
|
2649
2708
|
}
|
|
2650
2709
|
};
|
|
2651
2710
|
const getContainerClassName = () => {
|
|
2652
|
-
const classes = [styles$
|
|
2711
|
+
const classes = [styles$f.timeInput];
|
|
2653
2712
|
if (error)
|
|
2654
|
-
classes.push(styles$
|
|
2713
|
+
classes.push(styles$f.error);
|
|
2655
2714
|
if (success)
|
|
2656
|
-
classes.push(styles$
|
|
2715
|
+
classes.push(styles$f.success);
|
|
2657
2716
|
if (loading)
|
|
2658
|
-
classes.push(styles$
|
|
2717
|
+
classes.push(styles$f.loading);
|
|
2659
2718
|
if (disabled)
|
|
2660
|
-
classes.push(styles$
|
|
2719
|
+
classes.push(styles$f.disabled);
|
|
2661
2720
|
if (className)
|
|
2662
2721
|
classes.push(className);
|
|
2663
2722
|
return classes.join(' ');
|
|
2664
2723
|
};
|
|
2665
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: getContainerClassName(), children: [jsxs("label", { className: styles$
|
|
2724
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: getContainerClassName(), children: [jsxs("label", { className: styles$f.label, children: [label, required && jsx("span", { className: styles$f.required, children: "*" })] }), jsxs("div", { className: styles$f.inputWrapper, children: [jsx("input", { type: "text", value: value, onChange: (e) => handleTextChange(e.target.value), onFocus: onFocus, onBlur: onBlur, placeholder: placeholder, className: styles$f.textInput, maxLength: 5, disabled: disabled || loading, "aria-invalid": error, "aria-required": required, inputMode: "numeric", pattern: "[0-9:]*" }), jsx("button", { type: "button", onClick: handleClockClick, className: styles$f.clockButton, title: "Open time picker", disabled: disabled || loading, "aria-label": "Open time picker", children: jsx(Clock, { size: 20 }) })] })] }), jsx(TimePickerModal, { isOpen: showPicker, onClose: () => setShowPicker(false), value: value, onChange: onChange })] }));
|
|
2666
2725
|
}
|
|
2667
2726
|
|
|
2668
2727
|
const ThemeContext = createContext(undefined);
|
|
@@ -2673,24 +2732,70 @@ const useTheme = () => {
|
|
|
2673
2732
|
}
|
|
2674
2733
|
return context;
|
|
2675
2734
|
};
|
|
2735
|
+
/** Safe version of useTheme that returns null when outside a ThemeProvider */
|
|
2736
|
+
const useThemeSafe = () => {
|
|
2737
|
+
return useContext(ThemeContext) ?? null;
|
|
2738
|
+
};
|
|
2739
|
+
const ThemeProvider = ({ children, defaultTheme = 'light', storageKey = 'app-theme', }) => {
|
|
2740
|
+
const [theme, setThemeState] = useState(() => {
|
|
2741
|
+
// Check localStorage first
|
|
2742
|
+
const stored = localStorage.getItem(storageKey);
|
|
2743
|
+
if (stored && ['light', 'dark', 'lossito', 'lossito-dark', 'dmood', 'dmood-dark', 'crt'].includes(stored)) {
|
|
2744
|
+
return stored;
|
|
2745
|
+
}
|
|
2746
|
+
// Check system preference
|
|
2747
|
+
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
2748
|
+
return 'dark';
|
|
2749
|
+
}
|
|
2750
|
+
return defaultTheme;
|
|
2751
|
+
});
|
|
2752
|
+
const setTheme = (newTheme) => {
|
|
2753
|
+
setThemeState(newTheme);
|
|
2754
|
+
localStorage.setItem(storageKey, newTheme);
|
|
2755
|
+
};
|
|
2756
|
+
const toggleTheme = () => {
|
|
2757
|
+
const themeOrder = ['light', 'dark', 'lossito', 'lossito-dark', 'dmood', 'dmood-dark', 'crt'];
|
|
2758
|
+
const currentIndex = themeOrder.indexOf(theme);
|
|
2759
|
+
const nextIndex = (currentIndex + 1) % themeOrder.length;
|
|
2760
|
+
setTheme(themeOrder[nextIndex]);
|
|
2761
|
+
};
|
|
2762
|
+
useEffect(() => {
|
|
2763
|
+
const root = document.documentElement;
|
|
2764
|
+
// Apply theme attribute
|
|
2765
|
+
root.setAttribute('data-theme', theme);
|
|
2766
|
+
// Apply dark class if needed
|
|
2767
|
+
if (theme.includes('dark')) {
|
|
2768
|
+
root.classList.add('dark');
|
|
2769
|
+
}
|
|
2770
|
+
else {
|
|
2771
|
+
root.classList.remove('dark');
|
|
2772
|
+
}
|
|
2773
|
+
}, [theme]);
|
|
2774
|
+
// Listen for system theme changes
|
|
2775
|
+
useEffect(() => {
|
|
2776
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
2777
|
+
const handleChange = (e) => {
|
|
2778
|
+
const stored = localStorage.getItem(storageKey);
|
|
2779
|
+
if (!stored) {
|
|
2780
|
+
setThemeState(e.matches ? 'dark' : 'light');
|
|
2781
|
+
}
|
|
2782
|
+
};
|
|
2783
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
2784
|
+
return () => mediaQuery.removeEventListener('change', handleChange);
|
|
2785
|
+
}, [storageKey]);
|
|
2786
|
+
return (jsx(ThemeContext.Provider, { value: { theme, setTheme, toggleTheme }, children: children }));
|
|
2787
|
+
};
|
|
2676
2788
|
|
|
2677
|
-
var styles$
|
|
2789
|
+
var styles$e = {"button":"ThemeSwitcher-module_button__VfRjU","iconWrapper":"ThemeSwitcher-module_iconWrapper__FpHo8","label":"ThemeSwitcher-module_label__2Hfkp","toggle":"ThemeSwitcher-module_toggle__ATXx4","toggleTrack":"ThemeSwitcher-module_toggleTrack__x28Rv","toggleThumb":"ThemeSwitcher-module_toggleThumb__V8QeN","dropdown":"ThemeSwitcher-module_dropdown__3qLdt","dropdownTrigger":"ThemeSwitcher-module_dropdownTrigger__UzYV5","dropdownMenu":"ThemeSwitcher-module_dropdownMenu__3L5hT","dropdownItem":"ThemeSwitcher-module_dropdownItem__inw-K","active":"ThemeSwitcher-module_active__OHP19","icon":"ThemeSwitcher-module_icon__iRZiJ","text":"ThemeSwitcher-module_text__OCOoA"};
|
|
2678
2790
|
|
|
2679
2791
|
const ThemeSwitcher = ({ variant = 'button', showLabel = false, className = '', currentTheme, onThemeChange, themes: customThemes, }) => {
|
|
2680
|
-
//
|
|
2681
|
-
const contextTheme = (
|
|
2682
|
-
try {
|
|
2683
|
-
return useTheme();
|
|
2684
|
-
}
|
|
2685
|
-
catch {
|
|
2686
|
-
return null;
|
|
2687
|
-
}
|
|
2688
|
-
})();
|
|
2792
|
+
// Use safe version that returns null when outside a ThemeProvider
|
|
2793
|
+
const contextTheme = useThemeSafe();
|
|
2689
2794
|
const theme = currentTheme ?? contextTheme?.theme ?? 'light';
|
|
2690
2795
|
const setTheme = onThemeChange ?? contextTheme?.setTheme ?? (() => { });
|
|
2691
2796
|
const defaultThemes = [
|
|
2692
|
-
{ value: 'light', label: 'Light', icon: jsx(
|
|
2693
|
-
{ value: 'dark', label: 'Dark', icon: jsx(
|
|
2797
|
+
{ value: 'light', label: 'Light', icon: jsx(Sun, {}) },
|
|
2798
|
+
{ value: 'dark', label: 'Dark', icon: jsx(Moon, {}) },
|
|
2694
2799
|
{ value: 'lossito', label: 'Lossito Light', icon: '✨' },
|
|
2695
2800
|
{ value: 'lossito-dark', label: 'Lossito Dark', icon: '🌑' },
|
|
2696
2801
|
{ value: 'dmood', label: 'Dmood Light', icon: '💙' },
|
|
@@ -2702,48 +2807,154 @@ const ThemeSwitcher = ({ variant = 'button', showLabel = false, className = '',
|
|
|
2702
2807
|
if (variant === 'toggle') {
|
|
2703
2808
|
// Simple toggle between light and dark
|
|
2704
2809
|
const isDark = theme.includes('dark');
|
|
2705
|
-
return (jsxs(motion.button, { className: `${styles$
|
|
2810
|
+
return (jsxs(motion.button, { className: `${styles$e.toggle} ${className}`, onClick: () => setTheme(isDark ? 'light' : 'dark'), whileTap: { scale: 0.95 }, "aria-label": "Toggle theme", children: [jsx(motion.div, { className: styles$e.toggleTrack, animate: { backgroundColor: isDark ? 'var(--color-primary)' : 'var(--color-border)' }, children: jsx(motion.div, { className: styles$e.toggleThumb, animate: { x: isDark ? 24 : 0 }, transition: { type: 'spring', stiffness: 500, damping: 30 }, children: isDark ? jsx(Moon, { size: 14 }) : jsx(Sun, { size: 14 }) }) }), showLabel && jsx("span", { className: styles$e.label, children: isDark ? 'Dark' : 'Light' })] }));
|
|
2706
2811
|
}
|
|
2707
2812
|
if (variant === 'dropdown') {
|
|
2708
|
-
return (jsxs("div", { className: `${styles$
|
|
2813
|
+
return (jsxs("div", { className: `${styles$e.dropdown} ${className}`, children: [jsxs(motion.button, { className: styles$e.dropdownTrigger, whileTap: { scale: 0.98 }, children: [currentThemeData.icon, showLabel && jsx("span", { className: styles$e.label, children: currentThemeData.label })] }), jsx(motion.div, { className: styles$e.dropdownMenu, initial: { opacity: 0, y: -10 }, animate: { opacity: 1, y: 0 }, children: themes.map((t) => (jsxs(motion.button, { className: `${styles$e.dropdownItem} ${theme === t.value ? styles$e.active : ''}`, onClick: () => setTheme(t.value), whileHover: { x: 4 }, whileTap: { scale: 0.98 }, children: [jsx("span", { className: styles$e.icon, children: t.icon }), jsx("span", { className: styles$e.text, children: t.label })] }, t.value))) })] }));
|
|
2709
2814
|
}
|
|
2710
2815
|
// Default button variant - cycles through themes
|
|
2711
|
-
return (jsxs(motion.button, { className: `${styles$
|
|
2816
|
+
return (jsxs(motion.button, { className: `${styles$e.button} ${className}`, onClick: () => {
|
|
2712
2817
|
const nextIndex = (currentThemeIndex + 1) % themes.length;
|
|
2713
2818
|
setTheme(themes[nextIndex].value);
|
|
2714
|
-
}, whileTap: { scale: 0.95 }, whileHover: { scale: 1.05 }, "aria-label": `Current theme: ${currentThemeData.label}. Click to change.`, children: [jsx(motion.div, { initial: { rotate: -180, opacity: 0 }, animate: { rotate: 0, opacity: 1 }, exit: { rotate: 180, opacity: 0 }, transition: { duration: 0.3 }, className: styles$
|
|
2819
|
+
}, whileTap: { scale: 0.95 }, whileHover: { scale: 1.05 }, "aria-label": `Current theme: ${currentThemeData.label}. Click to change.`, children: [jsx(motion.div, { initial: { rotate: -180, opacity: 0 }, animate: { rotate: 0, opacity: 1 }, exit: { rotate: 180, opacity: 0 }, transition: { duration: 0.3 }, className: styles$e.iconWrapper, children: currentThemeData.icon }, theme), showLabel && jsx("span", { className: styles$e.label, children: currentThemeData.label })] }));
|
|
2715
2820
|
};
|
|
2716
2821
|
|
|
2717
|
-
|
|
2718
|
-
function SiJira (props) {
|
|
2719
|
-
return GenIcon({"attr":{"role":"img","viewBox":"0 0 24 24"},"child":[{"tag":"path","attr":{"d":"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"},"child":[]}]})(props);
|
|
2720
|
-
}
|
|
2721
|
-
|
|
2722
|
-
var styles$9 = {"tabs":"Tabs-module_tabs__Vlvn7","tab":"Tabs-module_tab__uQKim","tabIcon":"Tabs-module_tabIcon__AgN-O"};
|
|
2822
|
+
var styles$d = {"tabs":"Tabs-module_tabs__Vlvn7","tab":"Tabs-module_tab__uQKim","tabIcon":"Tabs-module_tabIcon__AgN-O"};
|
|
2723
2823
|
|
|
2724
2824
|
// Default tabs for backwards compatibility
|
|
2725
2825
|
const defaultTabs = [
|
|
2726
|
-
{ id: 'details', icon:
|
|
2727
|
-
{ id: 'github', icon:
|
|
2728
|
-
{ id: 'jira', icon:
|
|
2729
|
-
{ id: 'functional', icon:
|
|
2826
|
+
{ id: 'details', icon: Info, label: 'Dettagli' },
|
|
2827
|
+
{ id: 'github', icon: Github, label: 'GitHub' },
|
|
2828
|
+
{ id: 'jira', icon: SquareKanban, label: 'Jira' },
|
|
2829
|
+
{ id: 'functional', icon: Info, label: 'Analisi funzionale' }
|
|
2730
2830
|
];
|
|
2731
2831
|
const Tabs = ({ activeTab, onTabChange, tabs: customTabs, className = '' }) => {
|
|
2732
2832
|
const tabs = customTabs ?? defaultTabs;
|
|
2733
|
-
return (jsx("div", { className: `${styles$
|
|
2833
|
+
return (jsx("div", { className: `${styles$d.tabs} ${className}`, children: tabs.map((tab) => {
|
|
2734
2834
|
const isActive = activeTab === tab.id;
|
|
2735
|
-
return (jsxs(motion.button, { className: styles$
|
|
2835
|
+
return (jsxs(motion.button, { className: styles$d.tab, "data-active": isActive, onClick: () => onTabChange(tab.id), style: { position: 'relative' }, children: [jsx(motion.div, { animate: {
|
|
2736
2836
|
rotate: isActive ? [0, -10, 10, -5, 5, 0] : 0,
|
|
2737
2837
|
}, transition: {
|
|
2738
2838
|
rotate: {
|
|
2739
2839
|
duration: 0.5,
|
|
2740
2840
|
ease: 'easeInOut'
|
|
2741
2841
|
}
|
|
2742
|
-
}, children: tab.icon && (
|
|
2842
|
+
}, children: tab.icon && (React.isValidElement(tab.icon) ? (jsx("span", { className: styles$d.tabIcon, children: tab.icon })) : (jsx("span", { className: styles$d.tabIcon, children: React.createElement(tab.icon) }))) }), jsx("span", { children: tab.label })] }, tab.id));
|
|
2843
|
+
}) }));
|
|
2844
|
+
};
|
|
2845
|
+
|
|
2846
|
+
var styles$c = {"toastContainer":"Toast-module_toastContainer__gp5C0","toast":"Toast-module_toast__eenNR","toastSuccess":"Toast-module_toastSuccess__e-cSx","toastError":"Toast-module_toastError__6JO9w","toastWarning":"Toast-module_toastWarning__pJoF1","toastInfo":"Toast-module_toastInfo__y33kR","icon":"Toast-module_icon__Z-D6i","iconSuccess":"Toast-module_iconSuccess__ehY27","iconError":"Toast-module_iconError__nXhZz","iconWarning":"Toast-module_iconWarning__Ie8oD","iconInfo":"Toast-module_iconInfo__8vOf5","content":"Toast-module_content__eBhK8","title":"Toast-module_title__EfUfZ","message":"Toast-module_message__l4pyr","closeButton":"Toast-module_closeButton__UWOVG","progressBar":"Toast-module_progressBar__fGwBU"};
|
|
2847
|
+
|
|
2848
|
+
const getIcon = (type) => {
|
|
2849
|
+
switch (type) {
|
|
2850
|
+
case 'success':
|
|
2851
|
+
return (jsx("svg", { className: `${styles$c.icon} ${styles$c.iconSuccess}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }));
|
|
2852
|
+
case 'error':
|
|
2853
|
+
return (jsx("svg", { className: `${styles$c.icon} ${styles$c.iconError}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }));
|
|
2854
|
+
case 'warning':
|
|
2855
|
+
return (jsx("svg", { className: `${styles$c.icon} ${styles$c.iconWarning}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }));
|
|
2856
|
+
case 'info':
|
|
2857
|
+
return (jsx("svg", { className: `${styles$c.icon} ${styles$c.iconInfo}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }));
|
|
2858
|
+
}
|
|
2859
|
+
};
|
|
2860
|
+
const getToastStyle = (type) => {
|
|
2861
|
+
switch (type) {
|
|
2862
|
+
case 'success': return styles$c.toastSuccess;
|
|
2863
|
+
case 'error': return styles$c.toastError;
|
|
2864
|
+
case 'warning': return styles$c.toastWarning;
|
|
2865
|
+
case 'info': return styles$c.toastInfo;
|
|
2866
|
+
default: return '';
|
|
2867
|
+
}
|
|
2868
|
+
};
|
|
2869
|
+
const ToastItem = ({ toast, removeToast, }) => {
|
|
2870
|
+
const [progress, setProgress] = useState(100);
|
|
2871
|
+
const duration = toast.duration || 5000;
|
|
2872
|
+
useEffect(() => {
|
|
2873
|
+
const timer = setTimeout(() => {
|
|
2874
|
+
removeToast(toast.id);
|
|
2875
|
+
}, duration);
|
|
2876
|
+
const interval = setInterval(() => {
|
|
2877
|
+
setProgress((prev) => {
|
|
2878
|
+
const newProgress = prev - 100 / (duration / 100);
|
|
2879
|
+
return newProgress <= 0 ? 0 : newProgress;
|
|
2880
|
+
});
|
|
2881
|
+
}, 100);
|
|
2882
|
+
return () => {
|
|
2883
|
+
clearTimeout(timer);
|
|
2884
|
+
clearInterval(interval);
|
|
2885
|
+
};
|
|
2886
|
+
}, [toast.id, duration, removeToast]);
|
|
2887
|
+
return (jsxs(motion.div, { className: `${styles$c.toast} ${getToastStyle(toast.type)}`, initial: { opacity: 0, x: 100, scale: 0.9 }, animate: { opacity: 1, x: 0, scale: 1 }, exit: { opacity: 0, x: 100, scale: 0.9 }, transition: { type: 'spring', stiffness: 500, damping: 40 }, layout: true, children: [getIcon(toast.type), jsxs("div", { className: styles$c.content, children: [toast.title && jsx("p", { className: styles$c.title, children: toast.title }), jsx("p", { className: styles$c.message, children: toast.message })] }), jsx("button", { className: styles$c.closeButton, onClick: () => removeToast(toast.id), "aria-label": "Close notification", children: jsx("svg", { width: "16", height: "16", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) }), jsx(motion.div, { className: styles$c.progressBar, initial: { width: '100%' }, animate: { width: `${progress}%` }, style: {
|
|
2888
|
+
color: toast.type === 'success' ? '#10B981'
|
|
2889
|
+
: toast.type === 'error' ? '#EF4444'
|
|
2890
|
+
: toast.type === 'warning' ? '#F59E0B'
|
|
2891
|
+
: '#3B82F6',
|
|
2892
|
+
} })] }));
|
|
2893
|
+
};
|
|
2894
|
+
const ToastContainer = ({ toasts, removeToast }) => {
|
|
2895
|
+
if (typeof document === 'undefined')
|
|
2896
|
+
return null;
|
|
2897
|
+
return createPortal(jsx("div", { className: styles$c.toastContainer, children: jsx(AnimatePresence, { mode: "sync", children: toasts.map((toast) => (jsx(ToastItem, { toast: toast, removeToast: removeToast }, toast.id))) }) }), document.body);
|
|
2898
|
+
};
|
|
2899
|
+
|
|
2900
|
+
var styles$b = {"breadcrumb":"Breadcrumb-module_breadcrumb__pGabz","separator":"Breadcrumb-module_separator__UCmyy","item":"Breadcrumb-module_item__0cLOg","link":"Breadcrumb-module_link__udp8M","current":"Breadcrumb-module_current__3DpQc"};
|
|
2901
|
+
|
|
2902
|
+
/**
|
|
2903
|
+
* Breadcrumb Component
|
|
2904
|
+
*
|
|
2905
|
+
* Navigation breadcrumb trail. Router-agnostic: pass onNavigate to handle
|
|
2906
|
+
* clicks on breadcrumb links (e.g. with react-router's navigate function).
|
|
2907
|
+
*
|
|
2908
|
+
* @example
|
|
2909
|
+
* <Breadcrumb
|
|
2910
|
+
* items={[
|
|
2911
|
+
* { label: 'Home', href: '/' },
|
|
2912
|
+
* { label: 'Settings', href: '/settings' },
|
|
2913
|
+
* { label: 'Profile' },
|
|
2914
|
+
* ]}
|
|
2915
|
+
* onNavigate={(href) => navigate(href)}
|
|
2916
|
+
* />
|
|
2917
|
+
*/
|
|
2918
|
+
const Breadcrumb = ({ items, onNavigate, className = '' }) => {
|
|
2919
|
+
return (jsx("nav", { className: `${styles$b.breadcrumb} ${className}`, "aria-label": "Breadcrumb", children: items.map((item, index) => {
|
|
2920
|
+
const isLast = index === items.length - 1;
|
|
2921
|
+
return (jsxs(React.Fragment, { children: [index > 0 && jsx(ChevronRight, { size: 14, className: styles$b.separator }), isLast || !item.href ? (jsx("span", { className: `${styles$b.item} ${isLast ? styles$b.current : ''}`, children: item.label })) : (jsx("button", { className: `${styles$b.item} ${styles$b.link}`, onClick: () => onNavigate?.(item.href), children: item.label }))] }, index));
|
|
2743
2922
|
}) }));
|
|
2744
2923
|
};
|
|
2745
2924
|
|
|
2746
|
-
var styles$
|
|
2925
|
+
var styles$a = {"overlay":"LiquidButton-module_overlay__-P-xm","container":"LiquidButton-module_container__f1COS","actions":"LiquidButton-module_actions__XBz7p","actionButton":"LiquidButton-module_actionButton__PlEOk","actionLabel":"LiquidButton-module_actionLabel__tIGHE","button":"LiquidButton-module_button__znjyS"};
|
|
2926
|
+
|
|
2927
|
+
/**
|
|
2928
|
+
* LiquidButton Component
|
|
2929
|
+
*
|
|
2930
|
+
* A floating action button that expands to reveal quick action options.
|
|
2931
|
+
* The main button rotates 45 degrees when expanded (Plus becomes X).
|
|
2932
|
+
* Actions fan out above the button with staggered animations.
|
|
2933
|
+
*
|
|
2934
|
+
* @example
|
|
2935
|
+
* <LiquidButton
|
|
2936
|
+
* actions={[
|
|
2937
|
+
* { key: 'add', label: 'Add Item', icon: Plus, color: '#2196F3', onClick: () => {} },
|
|
2938
|
+
* { key: 'edit', label: 'Edit', icon: Edit, color: '#FF9800', onClick: () => {} },
|
|
2939
|
+
* ]}
|
|
2940
|
+
* />
|
|
2941
|
+
*/
|
|
2942
|
+
const LiquidButton = ({ actions, icon: Icon = Plus, className = '', }) => {
|
|
2943
|
+
const [expanded, setExpanded] = useState(false);
|
|
2944
|
+
const handleToggle = useCallback(() => {
|
|
2945
|
+
setExpanded((prev) => !prev);
|
|
2946
|
+
}, []);
|
|
2947
|
+
const handleAction = useCallback((action) => {
|
|
2948
|
+
setExpanded(false);
|
|
2949
|
+
action.onClick();
|
|
2950
|
+
}, []);
|
|
2951
|
+
return (jsxs(Fragment, { children: [jsx(AnimatePresence, { children: expanded && (jsx(motion.div, { className: styles$a.overlay, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: handleToggle })) }), jsxs("div", { className: `${styles$a.container} ${className}`, children: [jsx(AnimatePresence, { children: expanded && (jsx("div", { className: styles$a.actions, children: actions.map((action, index) => (jsxs(motion.button, { type: "button", className: styles$a.actionButton, initial: { opacity: 0, scale: 0.8 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.8 }, transition: {
|
|
2952
|
+
duration: 0.15,
|
|
2953
|
+
delay: (actions.length - 1 - index) * 0.05,
|
|
2954
|
+
}, onClick: () => handleAction(action), children: [jsx(action.icon, { size: 18, color: action.color }), jsx("span", { className: styles$a.actionLabel, children: action.label })] }, action.key))) })) }), jsx(motion.button, { type: "button", className: styles$a.button, onClick: handleToggle, animate: { rotate: expanded ? 45 : 0 }, transition: { duration: 0.2 }, "aria-label": expanded ? 'Close actions' : 'Open actions', children: jsx(Icon, { size: 24, strokeWidth: 2.5 }) })] })] }));
|
|
2955
|
+
};
|
|
2956
|
+
|
|
2957
|
+
var styles$9 = {"calendar":"Calendar-module_calendar__3mIJS","loading":"Calendar-module_loading__59Z9-","loadingSpinner":"Calendar-module_loadingSpinner__7MXqV","header":"Calendar-module_header__cZHNA","navigation":"Calendar-module_navigation__PGkpY","navButton":"Calendar-module_navButton__kOe-w","title":"Calendar-module_title__oJZ7m","controls":"Calendar-module_controls__i1Z38","todayButton":"Calendar-module_todayButton__Ac9zc","viewToggle":"Calendar-module_viewToggle__Fhg2t","viewButton":"Calendar-module_viewButton__J2WY6","active":"Calendar-module_active__lIqH-","weekDays":"Calendar-module_weekDays__4J-8f","weekNumberHeader":"Calendar-module_weekNumberHeader__xhKbB","weekDay":"Calendar-module_weekDay__cg8Gr","daysGrid":"Calendar-module_daysGrid__ER0GM","weekView":"Calendar-module_weekView__bdtGs","dayCell":"Calendar-module_dayCell__TV-HR","dayNumber":"Calendar-module_dayNumber__ICH-X","today":"Calendar-module_today__eGuUU","events":"Calendar-module_events__qdbs7","event":"Calendar-module_event__Q1Zq3","eventTitle":"Calendar-module_eventTitle__XU7Wd","eventTime":"Calendar-module_eventTime__pMGEB","otherMonth":"Calendar-module_otherMonth__r6VJK","weekNumber":"Calendar-module_weekNumber__nlo50","completed":"Calendar-module_completed__B-SHI","completedIcon":"Calendar-module_completedIcon__-oDZ9","moreEvents":"Calendar-module_moreEvents__TIKaT","emptyState":"Calendar-module_emptyState__2fcj7","dayView":"Calendar-module_dayView__PCIos","dayViewHeader":"Calendar-module_dayViewHeader__Gvxx2","timeColumnHeader":"Calendar-module_timeColumnHeader__B0btR","dayColumnHeader":"Calendar-module_dayColumnHeader__Rjqwg","dayViewScrollContainer":"Calendar-module_dayViewScrollContainer__84Byq","dayViewContent":"Calendar-module_dayViewContent__VU9JI","timeColumn":"Calendar-module_timeColumn__Sce-X","dayColumn":"Calendar-module_dayColumn__-j2oT","timeSlot":"Calendar-module_timeSlot__jldHq","timeLabel":"Calendar-module_timeLabel__9xLiK","hourSlot":"Calendar-module_hourSlot__z-80Q","hourLine":"Calendar-module_hourLine__fofdD","dayEvent":"Calendar-module_dayEvent__tSPFa","dayEventTitle":"Calendar-module_dayEventTitle__er03k","dayEventTime":"Calendar-module_dayEventTime__TlkeQ","currentTimeIndicator":"Calendar-module_currentTimeIndicator__GntOZ"};
|
|
2747
2958
|
|
|
2748
2959
|
/**
|
|
2749
2960
|
* Calendar component - A flexible, reusable calendar for displaying events
|
|
@@ -2991,11 +3202,11 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
2991
3202
|
return Math.floor(diff / oneWeek) + 1;
|
|
2992
3203
|
};
|
|
2993
3204
|
if (loading) {
|
|
2994
|
-
return (jsx("div", { className: `${styles$
|
|
3205
|
+
return (jsx("div", { className: `${styles$9.calendar} ${styles$9.loading} ${className}`, style: style, children: jsx("div", { className: styles$9.loadingSpinner, children: "Loading..." }) }));
|
|
2995
3206
|
}
|
|
2996
|
-
return (jsxs("div", { className: `${styles$
|
|
3207
|
+
return (jsxs("div", { className: `${styles$9.calendar} ${className}`, style: style, children: [!hideHeader && (jsxs("div", { className: styles$9.header, children: [jsxs("div", { className: styles$9.navigation, children: [jsx("button", { onClick: handlePrevious, className: styles$9.navButton, "aria-label": "Previous", children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsx("polyline", { points: "15,18 9,12 15,6" }) }) }), jsx("h3", { className: styles$9.title, children: calendarData.displayTitle }), jsx("button", { onClick: handleNext, className: styles$9.navButton, "aria-label": "Next", children: jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsx("polyline", { points: "9,6 15,12 9,18" }) }) })] }), jsxs("div", { className: styles$9.controls, children: [jsx("button", { onClick: handleToday, className: styles$9.todayButton, children: "Today" }), jsxs("div", { className: styles$9.viewToggle, children: [jsx("button", { className: `${styles$9.viewButton} ${currentViewMode === 'month' ? styles$9.active : ''}`, onClick: () => setCurrentViewMode('month'), children: "Month" }), jsx("button", { className: `${styles$9.viewButton} ${currentViewMode === 'week' ? styles$9.active : ''}`, onClick: () => setCurrentViewMode('week'), children: "Week" }), jsx("button", { className: `${styles$9.viewButton} ${currentViewMode === 'day' ? styles$9.active : ''}`, onClick: () => setCurrentViewMode('day'), children: "Day" })] })] })] })), currentViewMode !== 'day' && (jsxs("div", { className: styles$9.weekDays, children: [showWeekNumbers && jsx("div", { className: styles$9.weekNumberHeader, children: "Week" }), finalDayLabels.map((day) => (jsx("div", { className: styles$9.weekDay, children: day }, day)))] })), currentViewMode === 'day' ? (
|
|
2997
3208
|
// Day view layout
|
|
2998
|
-
jsxs("div", { className: styles$
|
|
3209
|
+
jsxs("div", { className: styles$9.dayView, children: [jsxs("div", { className: styles$9.dayViewHeader, children: [jsx("div", { className: styles$9.timeColumnHeader }), jsx("div", { className: styles$9.dayColumnHeader, children: currentDate.toLocaleDateString(locale, { weekday: 'short', day: 'numeric' }) })] }), jsx("div", { className: styles$9.dayViewScrollContainer, ref: dayViewScrollRef, children: jsxs("div", { className: styles$9.dayViewContent, children: [(() => {
|
|
2999
3210
|
const now = new Date();
|
|
3000
3211
|
const currentHour = now.getHours();
|
|
3001
3212
|
const currentMinute = now.getMinutes();
|
|
@@ -3003,21 +3214,21 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
3003
3214
|
const topPosition = (minutesSinceMidnight / 1440) * (24 * 60); // 24 hours * 60px per hour
|
|
3004
3215
|
// Only show if viewing today
|
|
3005
3216
|
const isToday = currentDate.toDateString() === now.toDateString();
|
|
3006
|
-
return isToday ? (jsx("div", { className: styles$
|
|
3007
|
-
})(), jsx("div", { className: styles$
|
|
3217
|
+
return isToday ? (jsx("div", { className: styles$9.currentTimeIndicator, style: { top: `${topPosition}px` } })) : null;
|
|
3218
|
+
})(), jsx("div", { className: styles$9.timeColumn, children: Array.from({ length: 24 }, (_, hour) => (jsx("div", { className: styles$9.timeSlot, children: jsxs("span", { className: styles$9.timeLabel, children: [hour.toString().padStart(2, '0'), ":00"] }) }, hour))) }), jsx("div", { className: styles$9.dayColumn, children: Array.from({ length: 24 }, (_, hour) => {
|
|
3008
3219
|
const hourEvents = getDayEvents(currentDate).filter(event => {
|
|
3009
3220
|
if (!event.time)
|
|
3010
3221
|
return false;
|
|
3011
3222
|
const eventHour = parseInt(event.time.split(':')[0]);
|
|
3012
3223
|
return eventHour === hour;
|
|
3013
3224
|
});
|
|
3014
|
-
return (jsxs("div", { className: styles$
|
|
3225
|
+
return (jsxs("div", { className: styles$9.hourSlot, onClick: (e) => {
|
|
3015
3226
|
// Only trigger if clicking on the slot itself, not on an event
|
|
3016
3227
|
if (e.target === e.currentTarget ||
|
|
3017
|
-
e.target.classList.contains(styles$
|
|
3228
|
+
e.target.classList.contains(styles$9.hourLine)) {
|
|
3018
3229
|
handleTimeSlotClick(hour);
|
|
3019
3230
|
}
|
|
3020
|
-
}, style: { cursor: 'pointer' }, children: [jsx("div", { className: styles$
|
|
3231
|
+
}, style: { cursor: 'pointer' }, children: [jsx("div", { className: styles$9.hourLine }), hourEvents.map((event, eventIndex) => (jsxs(motion.div, { className: `${styles$9.dayEvent} ${event.status === 'completed' ? styles$9.completed : ''}`, style: {
|
|
3021
3232
|
backgroundColor: getEventColor(event),
|
|
3022
3233
|
color: getEventTextColor(event),
|
|
3023
3234
|
opacity: event.status === 'completed' ? 0.7 : 1
|
|
@@ -3035,17 +3246,17 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
3035
3246
|
}, whileTap: {
|
|
3036
3247
|
scale: 0.98,
|
|
3037
3248
|
transition: { duration: 0.1 }
|
|
3038
|
-
}, children: [iconRenderer && iconRenderer(event), jsxs("span", { className: styles$
|
|
3039
|
-
}) })] }) })] })) : (jsx("div", { className: `${styles$
|
|
3249
|
+
}, children: [iconRenderer && iconRenderer(event), jsxs("span", { className: styles$9.dayEventTitle, children: [jsx("span", { className: styles$9.dayEventTime, children: event.time }), event.title] }), event.status === 'completed' && (jsx("svg", { className: styles$9.completedIcon, width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsx("polyline", { points: "20,6 9,17 4,12" }) }))] }, event.id)))] }, hour));
|
|
3250
|
+
}) })] }) })] })) : (jsx("div", { className: `${styles$9.daysGrid} ${currentViewMode === 'week' ? styles$9.weekView : ''}`, children: calendarData.days.map((day, index) => {
|
|
3040
3251
|
const dayEvents = getDayEvents(day);
|
|
3041
3252
|
const dayIsToday = isToday(day);
|
|
3042
3253
|
const isInCurrentMonth = currentViewMode === 'week' || isCurrentMonth(day);
|
|
3043
3254
|
const isWeekStart = showWeekNumbers && (index % 7 === 0);
|
|
3044
|
-
return (jsxs(motion.div, { className: `${styles$
|
|
3255
|
+
return (jsxs(motion.div, { className: `${styles$9.dayCell} ${dayIsToday ? styles$9.today : ''} ${!isInCurrentMonth ? styles$9.otherMonth : ''}`, initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, transition: {
|
|
3045
3256
|
duration: 0.3,
|
|
3046
3257
|
delay: index * 0.02,
|
|
3047
3258
|
ease: "easeOut"
|
|
3048
|
-
}, onClick: () => handleDateClick(day), children: [isWeekStart && (jsx("div", { className: styles$
|
|
3259
|
+
}, onClick: () => handleDateClick(day), children: [isWeekStart && (jsx("div", { className: styles$9.weekNumber, children: getWeekNumber(day) })), jsx("div", { className: styles$9.dayNumber, children: day.getDate() }), dayEvents.length > 0 && (jsxs("div", { className: styles$9.events, children: [dayEvents.slice(0, maxEventsPerDay).map((event, eventIndex) => (jsxs(motion.div, { className: `${styles$9.event} ${event.status === 'completed' ? styles$9.completed : ''}`, style: {
|
|
3049
3260
|
backgroundColor: getEventColor(event),
|
|
3050
3261
|
color: getEventTextColor(event),
|
|
3051
3262
|
opacity: event.status === 'completed' ? 0.7 : 1
|
|
@@ -3063,7 +3274,7 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
3063
3274
|
}, whileTap: {
|
|
3064
3275
|
scale: 0.98,
|
|
3065
3276
|
transition: { duration: 0.1 }
|
|
3066
|
-
}, children: [iconRenderer && iconRenderer(event), jsxs("span", { className: styles$
|
|
3277
|
+
}, children: [iconRenderer && iconRenderer(event), jsxs("span", { className: styles$9.eventTitle, children: [event.time && (jsx("span", { className: styles$9.eventTime, children: event.time })), event.title] }), event.status === 'completed' && (jsx("svg", { className: styles$9.completedIcon, width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsx("polyline", { points: "20,6 9,17 4,12" }) }))] }, event.id))), dayEvents.length > maxEventsPerDay && (jsxs("div", { className: styles$9.moreEvents, children: ["+", dayEvents.length - maxEventsPerDay, " more"] }))] })), dayEvents.length === 0 && emptyState && (jsx("div", { className: styles$9.emptyState, children: emptyState }))] }, `${day.getFullYear()}-${day.getMonth()}-${day.getDate()}`));
|
|
3067
3278
|
}) }))] }));
|
|
3068
3279
|
}
|
|
3069
3280
|
|
|
@@ -3133,10 +3344,10 @@ const Navbar = ({ items, logo, onItemClick, variant = 'sidebar', isMobile = fals
|
|
|
3133
3344
|
if (variant === 'top') {
|
|
3134
3345
|
return (jsx(motion.nav, { className: `${styles.navbar} ${styles.navbarTop} ${className}`, initial: { y: -100 }, animate: { y: 0 }, transition: { type: "spring", stiffness: 300, damping: 30 }, children: navContent }));
|
|
3135
3346
|
}
|
|
3136
|
-
return (jsxs(Fragment, { children: [(isMobile || window.innerWidth <= 768) && (jsx(motion.button, { className: styles.mobileMenuButton, onClick: toggleMobileMenu, "aria-label": "Toggle navigation menu", whileTap: { scale: 0.9 }, children: jsx(AnimatePresence, { mode: "wait", children: isMobileMenuOpen ? (jsx(motion.div, { initial: { rotate: -90, opacity: 0 }, animate: { rotate: 0, opacity: 1 }, exit: { rotate: 90, opacity: 0 }, children: jsx(
|
|
3347
|
+
return (jsxs(Fragment, { children: [(isMobile || window.innerWidth <= 768) && (jsx(motion.button, { className: styles.mobileMenuButton, onClick: toggleMobileMenu, "aria-label": "Toggle navigation menu", whileTap: { scale: 0.9 }, children: jsx(AnimatePresence, { mode: "wait", children: isMobileMenuOpen ? (jsx(motion.div, { initial: { rotate: -90, opacity: 0 }, animate: { rotate: 0, opacity: 1 }, exit: { rotate: 90, opacity: 0 }, children: jsx(X, {}) }, "close")) : (jsx(motion.div, { initial: { rotate: 90, opacity: 0 }, animate: { rotate: 0, opacity: 1 }, exit: { rotate: -90, opacity: 0 }, children: jsx(Menu, {}) }, "menu")) }) })), jsx(AnimatePresence, { children: isMobileMenuOpen && (jsx(motion.div, { className: styles.mobileBackdrop, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: () => setIsMobileMenuOpen(false) })) }), jsx(motion.nav, { className: `${styles.navbar} ${styles[`navbar${variant.charAt(0).toUpperCase() + variant.slice(1)}`]} ${isMobileMenuOpen ? styles.mobileMenuOpen : ''} ${className}`, initial: variant === 'sidebar' ? { x: -300 } : { opacity: 0 }, animate: variant === 'sidebar' ? { x: isMobileMenuOpen || !isMobile ? 0 : -300 } : { opacity: 1 }, transition: { type: "spring", stiffness: 300, damping: 30 }, children: navContent })] }));
|
|
3137
3348
|
};
|
|
3138
3349
|
|
|
3139
|
-
var styles$
|
|
3350
|
+
var styles$8 = {"container":"MoodChart-module_container__MB1Vr","chart":"MoodChart-module_chart__4-spu","gridLine":"MoodChart-module_gridLine__YJpZ8","line":"MoodChart-module_line__LfeUX","xAxis":"MoodChart-module_xAxis__SeIWG","yAxis":"MoodChart-module_yAxis__sRjjE","dataPoint":"MoodChart-module_dataPoint__112P1","tooltip":"MoodChart-module_tooltip__vW59y","tooltipHeader":"MoodChart-module_tooltipHeader__U7yvN","tooltipDate":"MoodChart-module_tooltipDate__6Jjeu","tooltipRating":"MoodChart-module_tooltipRating__5A2Yx","ratingValue":"MoodChart-module_ratingValue__7Gpfx","ratingMax":"MoodChart-module_ratingMax__10WcJ","tooltipTags":"MoodChart-module_tooltipTags__FUQrU","tag":"MoodChart-module_tag__QhCh5","tooltipComment":"MoodChart-module_tooltipComment__6driJ"};
|
|
3140
3351
|
|
|
3141
3352
|
const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
3142
3353
|
const svgRef = useRef(null);
|
|
@@ -3145,7 +3356,7 @@ const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
|
3145
3356
|
const [selectedMood, setSelectedMood] = useState(null);
|
|
3146
3357
|
const [tooltipPosition, setTooltipPosition] = useState({ x: 0, y: 0 });
|
|
3147
3358
|
const [isHoveringTooltip, setIsHoveringTooltip] = useState(false);
|
|
3148
|
-
const margin = { top: 20, right: 20, bottom: 50, left: 40 };
|
|
3359
|
+
const margin = useMemo(() => ({ top: 20, right: 20, bottom: 50, left: 40 }), []);
|
|
3149
3360
|
const chartWidth = width - margin.left - margin.right;
|
|
3150
3361
|
const chartHeight = height - margin.top - margin.bottom;
|
|
3151
3362
|
const processedData = useMemo(() => {
|
|
@@ -3194,27 +3405,27 @@ const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
|
3194
3405
|
g.selectAll('.grid-line-y')
|
|
3195
3406
|
.data(yScale.ticks(5))
|
|
3196
3407
|
.enter().append('line')
|
|
3197
|
-
.attr('class', styles$
|
|
3408
|
+
.attr('class', styles$8.gridLine)
|
|
3198
3409
|
.attr('x1', 0)
|
|
3199
3410
|
.attr('y1', d => yScale(d))
|
|
3200
3411
|
.attr('x2', chartWidth)
|
|
3201
3412
|
.attr('y2', d => yScale(d));
|
|
3202
3413
|
g.append('path')
|
|
3203
3414
|
.datum(processedData)
|
|
3204
|
-
.attr('class', styles$
|
|
3415
|
+
.attr('class', styles$8.line)
|
|
3205
3416
|
.attr('d', line);
|
|
3206
3417
|
g.append('g')
|
|
3207
|
-
.attr('class', styles$
|
|
3418
|
+
.attr('class', styles$8.xAxis)
|
|
3208
3419
|
.attr('transform', `translate(0,${chartHeight})`)
|
|
3209
3420
|
.call(d3.axisBottom(xScale)
|
|
3210
3421
|
.tickFormat(d => d3.timeFormat('%m/%d')(d)));
|
|
3211
3422
|
g.append('g')
|
|
3212
|
-
.attr('class', styles$
|
|
3423
|
+
.attr('class', styles$8.yAxis)
|
|
3213
3424
|
.call(d3.axisLeft(yScale));
|
|
3214
3425
|
g.selectAll('.mood-circle')
|
|
3215
3426
|
.data(processedData)
|
|
3216
3427
|
.enter().append('circle')
|
|
3217
|
-
.attr('class', styles$
|
|
3428
|
+
.attr('class', styles$8.dataPoint)
|
|
3218
3429
|
.attr('cx', d => xScale(d.date))
|
|
3219
3430
|
.attr('cy', d => yScale(d.rating))
|
|
3220
3431
|
.attr('r', 5)
|
|
@@ -3268,7 +3479,7 @@ const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
|
3268
3479
|
setSelectedMood(null);
|
|
3269
3480
|
};
|
|
3270
3481
|
}, []);
|
|
3271
|
-
return (jsxs("div", { className: styles$
|
|
3482
|
+
return (jsxs("div", { className: styles$8.container, ref: containerRef, children: [jsx("svg", { ref: svgRef, width: width, height: height, className: styles$8.chart }), selectedMood && (jsxs("div", { ref: tooltipRef, className: styles$8.tooltip, style: {
|
|
3272
3483
|
position: 'absolute',
|
|
3273
3484
|
pointerEvents: 'auto',
|
|
3274
3485
|
left: tooltipPosition.x,
|
|
@@ -3277,10 +3488,10 @@ const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
|
3277
3488
|
}, onMouseEnter: () => setIsHoveringTooltip(true), onMouseLeave: () => {
|
|
3278
3489
|
setIsHoveringTooltip(false);
|
|
3279
3490
|
setSelectedMood(null);
|
|
3280
|
-
}, children: [jsxs("div", { className: styles$
|
|
3491
|
+
}, children: [jsxs("div", { className: styles$8.tooltipHeader, children: [jsx("div", { className: styles$8.tooltipDate, children: selectedMood.date.toLocaleDateString() }), jsxs("div", { className: styles$8.tooltipRating, children: [jsx("span", { className: styles$8.ratingValue, children: selectedMood.rating }), jsx("span", { className: styles$8.ratingMax, children: "/10" })] })] }), selectedMood.tags.length > 0 && (jsx("div", { className: styles$8.tooltipTags, children: selectedMood.tags.map((tag, index) => (jsx("span", { className: styles$8.tag, children: tag }, index))) })), selectedMood.comment && (jsx("div", { className: styles$8.tooltipComment, children: selectedMood.comment }))] }))] }));
|
|
3281
3492
|
};
|
|
3282
3493
|
|
|
3283
|
-
var styles$
|
|
3494
|
+
var styles$7 = {"container":"QuantifiableHabitsChart-module_container__X5SBp","controls":"QuantifiableHabitsChart-module_controls__O-ObQ","viewToggle":"QuantifiableHabitsChart-module_viewToggle__24hKA","viewButton":"QuantifiableHabitsChart-module_viewButton__WFU6j","active":"QuantifiableHabitsChart-module_active__Pjqy9","viewIcon":"QuantifiableHabitsChart-module_viewIcon__b2mfk","viewLabel":"QuantifiableHabitsChart-module_viewLabel__9MjCU","aggregationToggle":"QuantifiableHabitsChart-module_aggregationToggle__WnxwB","aggregationButton":"QuantifiableHabitsChart-module_aggregationButton__sGCxX","aggregationIcon":"QuantifiableHabitsChart-module_aggregationIcon__HIaEf","aggregationLabel":"QuantifiableHabitsChart-module_aggregationLabel__Yc-S-","legend":"QuantifiableHabitsChart-module_legend__3Ki7c","compactLegend":"QuantifiableHabitsChart-module_compactLegend__jMpLB","legendItem":"QuantifiableHabitsChart-module_legendItem__Zl7fz","legendEmoji":"QuantifiableHabitsChart-module_legendEmoji__HG9CZ","legendLabel":"QuantifiableHabitsChart-module_legendLabel__H3oFL","inactive":"QuantifiableHabitsChart-module_inactive__TzZC-","legendColor":"QuantifiableHabitsChart-module_legendColor__zbPoV","chart":"QuantifiableHabitsChart-module_chart__FMeA-","gridLine":"QuantifiableHabitsChart-module_gridLine__CTNIq","line":"QuantifiableHabitsChart-module_line__CpYip","xAxis":"QuantifiableHabitsChart-module_xAxis__lbgBG","yAxis":"QuantifiableHabitsChart-module_yAxis__Y6WeV","dataPoint":"QuantifiableHabitsChart-module_dataPoint__s8UMX","tooltip":"QuantifiableHabitsChart-module_tooltip__Fay8N","visible":"QuantifiableHabitsChart-module_visible__-KSJq","tooltipHeader":"QuantifiableHabitsChart-module_tooltipHeader__7Q2up","tooltipEmoji":"QuantifiableHabitsChart-module_tooltipEmoji__atV3T","tooltipDot":"QuantifiableHabitsChart-module_tooltipDot__YbdFh","tooltipInfo":"QuantifiableHabitsChart-module_tooltipInfo__XC7WF","tooltipDate":"QuantifiableHabitsChart-module_tooltipDate__6V6Xi","tooltipValue":"QuantifiableHabitsChart-module_tooltipValue__ldASB"};
|
|
3284
3495
|
|
|
3285
3496
|
// Default colors as fallback
|
|
3286
3497
|
const DEFAULT_HABIT_COLORS = {
|
|
@@ -3293,7 +3504,7 @@ const DEFAULT_HABIT_COLORS = {
|
|
|
3293
3504
|
'Calories': '#FF9F1C',
|
|
3294
3505
|
'Study': '#C774E8'
|
|
3295
3506
|
};
|
|
3296
|
-
const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewType = 'daily', periodType = 'month', habitColors: customHabitColors = {}, habitEmojis: customHabitEmojis = {}, onDataPointClick }) => {
|
|
3507
|
+
const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewType = 'daily', periodType = 'month', habitColors: customHabitColors = {}, habitEmojis: customHabitEmojis = {}, onDataPointClick, hideControls = false, compactLegend = false }) => {
|
|
3297
3508
|
const svgRef = useRef(null);
|
|
3298
3509
|
const tooltipRef = useRef(null);
|
|
3299
3510
|
const [viewType, setViewType] = useState(defaultViewType);
|
|
@@ -3301,7 +3512,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3301
3512
|
const [hoveredHabit, setHoveredHabit] = useState(null);
|
|
3302
3513
|
const [tooltipData, setTooltipData] = useState(null);
|
|
3303
3514
|
const [aggregationMode, setAggregationMode] = useState('average');
|
|
3304
|
-
const margin = { top: 20, right: 20, bottom: 50, left: 50 };
|
|
3515
|
+
const margin = useMemo(() => ({ top: 20, right: 20, bottom: 50, left: 50 }), []);
|
|
3305
3516
|
const chartWidth = width - margin.left - margin.right;
|
|
3306
3517
|
const chartHeight = height - margin.top - margin.bottom;
|
|
3307
3518
|
const habits = useMemo(() => Object.keys(data).filter(key => key !== 'dates'), [data]);
|
|
@@ -3334,10 +3545,10 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3334
3545
|
return ['daily'];
|
|
3335
3546
|
}
|
|
3336
3547
|
}, [periodType]);
|
|
3337
|
-
const getColor = (habit) => {
|
|
3548
|
+
const getColor = useCallback((habit) => {
|
|
3338
3549
|
// First check custom colors, then defaults, then generate deterministic color
|
|
3339
3550
|
return customHabitColors[habit] || DEFAULT_HABIT_COLORS[habit] || `hsl(${Math.abs(habit.split('').reduce((a, b) => a + b.charCodeAt(0), 0)) % 360}, 70%, 50%)`;
|
|
3340
|
-
};
|
|
3551
|
+
}, [customHabitColors]);
|
|
3341
3552
|
// Aggregate data based on view type
|
|
3342
3553
|
const aggregateData = useMemo(() => {
|
|
3343
3554
|
if (viewType === 'daily' || !data.dates.length) {
|
|
@@ -3433,7 +3644,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3433
3644
|
g.selectAll('.grid-line-y')
|
|
3434
3645
|
.data(yScale.ticks(5))
|
|
3435
3646
|
.enter().append('line')
|
|
3436
|
-
.attr('class', styles$
|
|
3647
|
+
.attr('class', styles$7.gridLine)
|
|
3437
3648
|
.attr('x1', 0)
|
|
3438
3649
|
.attr('y1', d => yScale(d))
|
|
3439
3650
|
.attr('x2', chartWidth)
|
|
@@ -3446,7 +3657,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3446
3657
|
const habitData = dates.map((date, i) => [date, aggregateData[habit][i]]).filter(d => typeof d[1] === 'number');
|
|
3447
3658
|
g.append('path')
|
|
3448
3659
|
.datum(habitData)
|
|
3449
|
-
.attr('class', styles$
|
|
3660
|
+
.attr('class', styles$7.line)
|
|
3450
3661
|
.attr('d', line)
|
|
3451
3662
|
.attr('stroke', getColor(habit))
|
|
3452
3663
|
.attr('opacity', hoveredHabit && hoveredHabit !== habit ? 0.3 : 1);
|
|
@@ -3493,7 +3704,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3493
3704
|
g.selectAll(`.circle-${habit}`)
|
|
3494
3705
|
.data(habitData)
|
|
3495
3706
|
.enter().append('circle')
|
|
3496
|
-
.attr('class', (_d, i) => `${styles$
|
|
3707
|
+
.attr('class', (_d, i) => `${styles$7.dataPoint} circle-${habit}-${i}`)
|
|
3497
3708
|
.attr('cx', d => xScale(d[0]))
|
|
3498
3709
|
.attr('cy', d => yScale(d[1]))
|
|
3499
3710
|
.attr('r', 4)
|
|
@@ -3555,7 +3766,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3555
3766
|
xAxisGenerator.ticks(tickCount);
|
|
3556
3767
|
}
|
|
3557
3768
|
const xAxis = g.append('g')
|
|
3558
|
-
.attr('class', styles$
|
|
3769
|
+
.attr('class', styles$7.xAxis)
|
|
3559
3770
|
.attr('transform', `translate(0,${chartHeight})`)
|
|
3560
3771
|
.call(xAxisGenerator);
|
|
3561
3772
|
// Rotate labels for better readability if needed
|
|
@@ -3567,9 +3778,9 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3567
3778
|
.attr('transform', 'rotate(-45)');
|
|
3568
3779
|
}
|
|
3569
3780
|
g.append('g')
|
|
3570
|
-
.attr('class', styles$
|
|
3781
|
+
.attr('class', styles$7.yAxis)
|
|
3571
3782
|
.call(d3.axisLeft(yScale));
|
|
3572
|
-
}, [aggregateData, activeHabits, chartWidth, chartHeight, margin, hoveredHabit,
|
|
3783
|
+
}, [aggregateData, activeHabits, chartWidth, chartHeight, margin, hoveredHabit, onDataPointClick, getColor, height, viewType, width]);
|
|
3573
3784
|
// Format date for tooltip display
|
|
3574
3785
|
const formatTooltipDate = (dateStr, viewType) => {
|
|
3575
3786
|
const date = new Date(dateStr);
|
|
@@ -3599,13 +3810,13 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3599
3810
|
quarterly: { icon: '📊', label: 'Quarterly' }
|
|
3600
3811
|
};
|
|
3601
3812
|
const shouldShowAggregationToggle = viewType !== 'daily';
|
|
3602
|
-
return (jsxs("div", { className: styles$
|
|
3813
|
+
return (jsxs("div", { className: styles$7.container, children: [!hideControls && (jsxs("div", { className: styles$7.controls, children: [jsx("div", { className: styles$7.viewToggle, children: availableViewTypes.map(type => (jsxs("button", { className: `${styles$7.viewButton} ${viewType === type ? styles$7.active : ''}`, onClick: () => setViewType(type), title: viewTypeConfig[type].label, children: [jsx("span", { className: styles$7.viewIcon, children: viewTypeConfig[type].icon }), jsx("span", { className: styles$7.viewLabel, children: viewTypeConfig[type].label })] }, type))) }), shouldShowAggregationToggle && (jsxs("div", { className: styles$7.aggregationToggle, children: [jsxs("button", { className: `${styles$7.aggregationButton} ${aggregationMode === 'average' ? styles$7.active : ''}`, onClick: () => setAggregationMode('average'), title: "Show average values for each period", children: [jsx("span", { className: styles$7.aggregationIcon, children: "\uD83D\uDCCA" }), jsx("span", { className: styles$7.aggregationLabel, children: "Average" })] }), jsxs("button", { className: `${styles$7.aggregationButton} ${aggregationMode === 'sum' ? styles$7.active : ''}`, onClick: () => setAggregationMode('sum'), title: "Show total values for each period", children: [jsx("span", { className: styles$7.aggregationIcon, children: "\u2795" }), jsx("span", { className: styles$7.aggregationLabel, children: "Sum" })] })] }))] })), jsx("div", { className: `${styles$7.legend}${compactLegend ? ` ${styles$7.compactLegend}` : ''}`, children: habits.map(habit => (jsxs("button", { className: `${styles$7.legendItem} ${!activeHabits.includes(habit) ? styles$7.inactive : ''}`, onClick: () => toggleHabit(habit), onMouseEnter: () => setHoveredHabit(habit), onMouseLeave: () => setHoveredHabit(null), children: [jsx("span", { className: styles$7.legendEmoji, children: customHabitEmojis[habit] || '📊' }), jsx("span", { className: styles$7.legendColor, style: { backgroundColor: getColor(habit) } }), jsx("span", { className: styles$7.legendLabel, children: habit })] }, habit))) }), jsx("svg", { ref: svgRef, width: width, height: height, className: styles$7.chart }), tooltipData && (jsxs("div", { ref: tooltipRef, className: `${styles$7.tooltip} ${tooltipData ? styles$7.visible : ''}`, style: {
|
|
3603
3814
|
left: `${tooltipData.x}px`,
|
|
3604
3815
|
top: `${tooltipData.y - 80}px`
|
|
3605
|
-
}, children: [jsxs("div", { className: styles$
|
|
3816
|
+
}, children: [jsxs("div", { className: styles$7.tooltipHeader, children: [jsx("span", { className: styles$7.tooltipEmoji, children: customHabitEmojis[tooltipData.habit] || '📊' }), jsx("span", { className: styles$7.tooltipDot, style: { backgroundColor: getColor(tooltipData.habit) } }), jsx("span", { children: tooltipData.habit })] }), jsxs("div", { className: styles$7.tooltipInfo, children: [jsx("div", { className: styles$7.tooltipDate, children: formatTooltipDate(tooltipData.date, viewType) }), jsxs("div", { className: styles$7.tooltipValue, children: [jsx("strong", { children: Math.round(tooltipData.value * 10) / 10 }), jsx("span", { style: { fontSize: '12px', fontWeight: 'normal', opacity: 0.6 }, children: "units" })] })] })] }))] }));
|
|
3606
3817
|
};
|
|
3607
3818
|
|
|
3608
|
-
var styles$
|
|
3819
|
+
var styles$6 = {"container":"SleepChart-module_container__RjHVU","header":"SleepChart-module_header__bcoWe","title":"SleepChart-module_title__6-QII","legend":"SleepChart-module_legend__VsqQj","legendItem":"SleepChart-module_legendItem__2c1nd","sleepDot":"SleepChart-module_sleepDot__qCY6O","wakeDot":"SleepChart-module_wakeDot__-RcrT","chart":"SleepChart-module_chart__jC1nL","gridLine":"SleepChart-module_gridLine__hi715","sleepBar":"SleepChart-module_sleepBar__Hk76f","xAxis":"SleepChart-module_xAxis__xzXyM","yAxis":"SleepChart-module_yAxis__7N-LA","tooltip":"SleepChart-module_tooltip__jQBv1","visible":"SleepChart-module_visible__wy0ck","tooltipHeader":"SleepChart-module_tooltipHeader__5BdPL","tooltipEmoji":"SleepChart-module_tooltipEmoji__c5vtz","tooltipInfo":"SleepChart-module_tooltipInfo__9Yrno","tooltipRow":"SleepChart-module_tooltipRow__CuDaE","tooltipLabel":"SleepChart-module_tooltipLabel__7SNzQ","tooltipValue":"SleepChart-module_tooltipValue__FoAVy","tooltipDuration":"SleepChart-module_tooltipDuration__d2wBW"};
|
|
3609
3820
|
|
|
3610
3821
|
const parseTimeToDecimal = (time) => {
|
|
3611
3822
|
const [hours, minutes] = time.split(':').map(Number);
|
|
@@ -3663,7 +3874,7 @@ const SleepChart = ({ sleepData, width = 800, height = 400, onDateClick }) => {
|
|
|
3663
3874
|
g.selectAll('.grid-line-x')
|
|
3664
3875
|
.data(d3.range(18, 43, 1))
|
|
3665
3876
|
.enter().append('line')
|
|
3666
|
-
.attr('class', styles$
|
|
3877
|
+
.attr('class', styles$6.gridLine)
|
|
3667
3878
|
.attr('x1', d => xScale(d))
|
|
3668
3879
|
.attr('y1', 0)
|
|
3669
3880
|
.attr('x2', d => xScale(d))
|
|
@@ -3696,7 +3907,7 @@ const SleepChart = ({ sleepData, width = 800, height = 400, onDateClick }) => {
|
|
|
3696
3907
|
return;
|
|
3697
3908
|
const barHeight = yScale.bandwidth();
|
|
3698
3909
|
const sleepGroup = g.append('g')
|
|
3699
|
-
.attr('class', styles$
|
|
3910
|
+
.attr('class', styles$6.sleepBar)
|
|
3700
3911
|
.style('cursor', 'pointer')
|
|
3701
3912
|
.on('click', () => onDateClick?.(dayData.date));
|
|
3702
3913
|
// Handle sleep time and wake hour separately
|
|
@@ -3862,7 +4073,7 @@ const SleepChart = ({ sleepData, width = 800, height = 400, onDateClick }) => {
|
|
|
3862
4073
|
(hour % 24) === 12 ? '12 PM' : `${(hour % 24) - 12} PM`
|
|
3863
4074
|
}));
|
|
3864
4075
|
const xAxis = g.append('g')
|
|
3865
|
-
.attr('class', styles$
|
|
4076
|
+
.attr('class', styles$6.xAxis)
|
|
3866
4077
|
.attr('transform', `translate(0,${chartHeight})`)
|
|
3867
4078
|
.call(d3.axisBottom(xScale)
|
|
3868
4079
|
.tickValues(xAxisTicks.map(t => t.value))
|
|
@@ -3879,25 +4090,25 @@ const SleepChart = ({ sleepData, width = 800, height = 400, onDateClick }) => {
|
|
|
3879
4090
|
});
|
|
3880
4091
|
const yAxisTicks = yDomain.filter((_, i) => i % Math.ceil(yDomain.length / 10) === 0);
|
|
3881
4092
|
g.append('g')
|
|
3882
|
-
.attr('class', styles$
|
|
4093
|
+
.attr('class', styles$6.yAxis)
|
|
3883
4094
|
.call(d3.axisLeft(yScale)
|
|
3884
4095
|
.tickValues(yAxisTicks)
|
|
3885
4096
|
.tickFormat(d => {
|
|
3886
4097
|
const date = new Date(d);
|
|
3887
4098
|
return `${(date.getMonth() + 1).toString().padStart(2, '0')}/${date.getDate().toString().padStart(2, '0')}`;
|
|
3888
4099
|
}));
|
|
3889
|
-
}, [sleepData, chartWidth, chartHeight, margin, onDateClick]);
|
|
3890
|
-
return (jsxs("div", { className: styles$
|
|
4100
|
+
}, [sleepData, chartWidth, chartHeight, margin, onDateClick, height, width]);
|
|
4101
|
+
return (jsxs("div", { className: styles$6.container, children: [jsxs("div", { className: styles$6.header, children: [jsx("h3", { className: styles$6.title, children: "Sleep Pattern" }), jsxs("div", { className: styles$6.legend, children: [jsxs("div", { className: styles$6.legendItem, children: [jsx("span", { className: styles$6.sleepDot }), jsx("span", { children: "Sleep Time" })] }), jsxs("div", { className: styles$6.legendItem, children: [jsx("span", { className: styles$6.wakeDot }), jsx("span", { children: "Wake Time" })] })] })] }), jsx("svg", { ref: svgRef, width: width, height: height, className: styles$6.chart }), tooltipData && (jsxs("div", { className: `${styles$6.tooltip} ${tooltipData ? styles$6.visible : ''}`, style: {
|
|
3891
4102
|
left: `${tooltipData.x}px`,
|
|
3892
4103
|
top: `${tooltipData.y}px`
|
|
3893
|
-
}, children: [jsxs("div", { className: styles$
|
|
4104
|
+
}, children: [jsxs("div", { className: styles$6.tooltipHeader, children: [jsx("span", { className: styles$6.tooltipEmoji, children: "\uD83D\uDE34" }), jsx("span", { children: new Date(tooltipData.date).toLocaleDateString('en-US', {
|
|
3894
4105
|
weekday: 'short',
|
|
3895
4106
|
month: 'short',
|
|
3896
4107
|
day: 'numeric'
|
|
3897
|
-
}) })] }), jsxs("div", { className: styles$
|
|
4108
|
+
}) })] }), jsxs("div", { className: styles$6.tooltipInfo, children: [tooltipData.sleepTime && (jsxs("div", { className: styles$6.tooltipRow, children: [jsxs("span", { className: styles$6.tooltipLabel, children: [jsx("span", { children: "\uD83C\uDF19" }), jsx("span", { children: "Sleep:" })] }), jsx("span", { className: styles$6.tooltipValue, children: tooltipData.sleepTime })] })), tooltipData.wakeTime && (jsxs("div", { className: styles$6.tooltipRow, children: [jsxs("span", { className: styles$6.tooltipLabel, children: [jsx("span", { children: "\u2600\uFE0F" }), jsx("span", { children: "Wake:" })] }), jsx("span", { className: styles$6.tooltipValue, children: tooltipData.wakeTime })] })), tooltipData.duration !== null && (jsxs("div", { className: styles$6.tooltipDuration, children: [jsx("span", { children: "\u23F1\uFE0F" }), jsxs("span", { children: [Math.floor(tooltipData.duration), "h ", Math.round((tooltipData.duration % 1) * 60), "m"] })] }))] })] }))] }));
|
|
3898
4109
|
};
|
|
3899
4110
|
|
|
3900
|
-
var styles$
|
|
4111
|
+
var styles$5 = {"container":"BooleansHeatmap-module_container__IOyeU","title":"BooleansHeatmap-module_title__8DRRQ","habitEmoji":"BooleansHeatmap-module_habitEmoji__Mawv-","chart":"BooleansHeatmap-module_chart__-q0Pc","monthLabel":"BooleansHeatmap-module_monthLabel__MXbIg","dayLabel":"BooleansHeatmap-module_dayLabel__2RRtm","cell":"BooleansHeatmap-module_cell__WADVB","legend":"BooleansHeatmap-module_legend__WqGF8","legendItem":"BooleansHeatmap-module_legendItem__rDE2g","legendColor":"BooleansHeatmap-module_legendColor__Z34-d","tooltip":"BooleansHeatmap-module_tooltip__-fHl7"};
|
|
3901
4112
|
|
|
3902
4113
|
const DAYS_OF_WEEK = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
3903
4114
|
const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
@@ -3951,20 +4162,20 @@ const BooleansHeatmap = ({ data, habitName, width = 800, height = 200, habitColo
|
|
|
3951
4162
|
g.append('text')
|
|
3952
4163
|
.attr('x', weekIndex * (cellSize + cellGap))
|
|
3953
4164
|
.attr('y', -10)
|
|
3954
|
-
.attr('class', styles$
|
|
4165
|
+
.attr('class', styles$5.monthLabel)
|
|
3955
4166
|
.text(MONTHS[month]);
|
|
3956
4167
|
});
|
|
3957
4168
|
DAYS_OF_WEEK.forEach((day, index) => {
|
|
3958
4169
|
g.append('text')
|
|
3959
4170
|
.attr('x', -10)
|
|
3960
4171
|
.attr('y', index * (cellSize + cellGap) + cellSize / 2)
|
|
3961
|
-
.attr('class', styles$
|
|
4172
|
+
.attr('class', styles$5.dayLabel)
|
|
3962
4173
|
.attr('text-anchor', 'end')
|
|
3963
4174
|
.attr('alignment-baseline', 'middle')
|
|
3964
4175
|
.text(day);
|
|
3965
4176
|
});
|
|
3966
4177
|
const tooltip = d3.select('body').append('div')
|
|
3967
|
-
.attr('class', styles$
|
|
4178
|
+
.attr('class', styles$5.tooltip)
|
|
3968
4179
|
.style('opacity', 0)
|
|
3969
4180
|
.style('position', 'absolute');
|
|
3970
4181
|
const daysToShow = weeksToShow * 7;
|
|
@@ -3983,7 +4194,7 @@ const BooleansHeatmap = ({ data, habitName, width = 800, height = 200, habitColo
|
|
|
3983
4194
|
.attr('width', cellSize)
|
|
3984
4195
|
.attr('height', cellSize)
|
|
3985
4196
|
.attr('rx', 3)
|
|
3986
|
-
.attr('class', styles$
|
|
4197
|
+
.attr('class', styles$5.cell)
|
|
3987
4198
|
.attr('data-date', dateString)
|
|
3988
4199
|
.attr('data-value', isTrue ? 'true' : 'false')
|
|
3989
4200
|
.style('fill', isTrue ? habitColor : '#4D4D4DFF');
|
|
@@ -4011,10 +4222,10 @@ const BooleansHeatmap = ({ data, habitName, width = 800, height = 200, habitColo
|
|
|
4011
4222
|
tooltip.remove();
|
|
4012
4223
|
};
|
|
4013
4224
|
}, [data, habitName, width, height, startDate, endDate, weeksToShow, habitColor, habitEmoji]);
|
|
4014
|
-
return (jsxs("div", { className: styles$
|
|
4225
|
+
return (jsxs("div", { className: styles$5.container, children: [jsxs("h3", { className: styles$5.title, children: [jsx("span", { className: styles$5.habitEmoji, children: habitEmoji }), habitName] }), jsx("svg", { ref: svgRef, width: width, height: height, className: styles$5.chart }), jsxs("div", { className: styles$5.legend, children: [jsxs("span", { className: styles$5.legendItem, children: [jsx("span", { className: styles$5.legendColor, style: { backgroundColor: habitColor } }), "Done"] }), jsxs("span", { className: styles$5.legendItem, children: [jsx("span", { className: styles$5.legendColor, style: { backgroundColor: '#4D4D4DFF' } }), "Not done"] })] })] }));
|
|
4015
4226
|
};
|
|
4016
4227
|
|
|
4017
|
-
var styles$
|
|
4228
|
+
var styles$4 = {"container":"SunburstChart-module_container__w1ZYc","title":"SunburstChart-module_title__T6Ak7","chart":"SunburstChart-module_chart__BFM6E","tooltip":"SunburstChart-module_tooltip__TuTAN"};
|
|
4018
4229
|
|
|
4019
4230
|
const COLOR_PALETTE = [
|
|
4020
4231
|
'#6366f1', '#8b5cf6', '#06b6d4', '#10b981',
|
|
@@ -4041,6 +4252,15 @@ const getTextColor$1 = (backgroundColor) => {
|
|
|
4041
4252
|
// Use a threshold of 0.5 for better contrast
|
|
4042
4253
|
return luminance > 0.5 ? '#000000' : '#ffffff';
|
|
4043
4254
|
};
|
|
4255
|
+
// Helper to create an interpolated arc generator for transitions
|
|
4256
|
+
const createInterpolatedArc = (currX0, currX1, currY0, currY1, radius) => {
|
|
4257
|
+
return d3.arc()
|
|
4258
|
+
.startAngle(() => currX0)
|
|
4259
|
+
.endAngle(() => currX1)
|
|
4260
|
+
.innerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY0))))
|
|
4261
|
+
.outerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY1))))
|
|
4262
|
+
.cornerRadius(3);
|
|
4263
|
+
};
|
|
4044
4264
|
const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Chart', tagColors = {}, unit = 'items', centerLabel }) => {
|
|
4045
4265
|
const svgRef = useRef(null);
|
|
4046
4266
|
const colorMap = useRef(new Map()).current;
|
|
@@ -4081,6 +4301,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4081
4301
|
const partition = d3.partition()
|
|
4082
4302
|
.size([2 * Math.PI, radius * radius]);
|
|
4083
4303
|
const nodes = partition(root).descendants();
|
|
4304
|
+
// Store original positions for reset
|
|
4084
4305
|
nodes.forEach((d) => {
|
|
4085
4306
|
const node = d;
|
|
4086
4307
|
node.x0Original = d.x0;
|
|
@@ -4095,7 +4316,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4095
4316
|
.outerRadius(d => Math.sqrt(d.y1))
|
|
4096
4317
|
.cornerRadius(3);
|
|
4097
4318
|
const tooltip = d3.select('body').append('div')
|
|
4098
|
-
.attr('class', styles$
|
|
4319
|
+
.attr('class', styles$4.tooltip)
|
|
4099
4320
|
.style('opacity', 0)
|
|
4100
4321
|
.style('position', 'absolute');
|
|
4101
4322
|
// Function to reset to original view
|
|
@@ -4120,12 +4341,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4120
4341
|
node.x1 = currX1;
|
|
4121
4342
|
node.y0 = currY0;
|
|
4122
4343
|
node.y1 = currY1;
|
|
4123
|
-
const interpolatedArc =
|
|
4124
|
-
.startAngle(() => currX0)
|
|
4125
|
-
.endAngle(() => currX1)
|
|
4126
|
-
.innerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY0))))
|
|
4127
|
-
.outerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY1))))
|
|
4128
|
-
.cornerRadius(3);
|
|
4344
|
+
const interpolatedArc = createInterpolatedArc(currX0, currX1, currY0, currY1, radius);
|
|
4129
4345
|
return interpolatedArc(node) || '';
|
|
4130
4346
|
};
|
|
4131
4347
|
});
|
|
@@ -4181,7 +4397,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4181
4397
|
}
|
|
4182
4398
|
// Calculate new positions based on the original positions
|
|
4183
4399
|
// ALWAYS scale to fill the full circle, no minimum size preservation
|
|
4184
|
-
|
|
4400
|
+
const newX0 = xScale(node.x0Original);
|
|
4185
4401
|
let newX1 = xScale(node.x1Original);
|
|
4186
4402
|
// Ensure proper scaling even for very small segments
|
|
4187
4403
|
// The clicked node's extent should always map to full circle
|
|
@@ -4226,12 +4442,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4226
4442
|
node.x1 = currX1;
|
|
4227
4443
|
node.y0 = currY0;
|
|
4228
4444
|
node.y1 = currY1;
|
|
4229
|
-
const interpolatedArc =
|
|
4230
|
-
.startAngle(() => currX0)
|
|
4231
|
-
.endAngle(() => currX1)
|
|
4232
|
-
.innerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY0))))
|
|
4233
|
-
.outerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY1))))
|
|
4234
|
-
.cornerRadius(3);
|
|
4445
|
+
const interpolatedArc = createInterpolatedArc(currX0, currX1, currY0, currY1, radius);
|
|
4235
4446
|
return interpolatedArc(node) || '';
|
|
4236
4447
|
};
|
|
4237
4448
|
});
|
|
@@ -4257,7 +4468,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4257
4468
|
const paths = g.selectAll('path')
|
|
4258
4469
|
.data(nodes.filter(d => d.depth > 0 && d.value && d.value > 0))
|
|
4259
4470
|
.enter().append('path')
|
|
4260
|
-
.attr('d', arc)
|
|
4471
|
+
.attr('d', d => arc(d) || '')
|
|
4261
4472
|
.attr('fill', d => {
|
|
4262
4473
|
let ancestor = d;
|
|
4263
4474
|
while (ancestor.depth > 1 && ancestor.parent) {
|
|
@@ -4278,7 +4489,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4278
4489
|
if (focusedNodeRef.current) {
|
|
4279
4490
|
return;
|
|
4280
4491
|
}
|
|
4281
|
-
const hoveredElement =
|
|
4492
|
+
const hoveredElement = event.currentTarget;
|
|
4282
4493
|
// Show tooltip for all nodes
|
|
4283
4494
|
tooltip.transition()
|
|
4284
4495
|
.duration(200)
|
|
@@ -4524,11 +4735,11 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4524
4735
|
return () => {
|
|
4525
4736
|
tooltip.remove();
|
|
4526
4737
|
};
|
|
4527
|
-
}, [data, width, height, colorMap, radius, tagColors, unit, centerLabel]);
|
|
4528
|
-
return (jsxs("div", { className: styles$
|
|
4738
|
+
}, [data, width, height, colorMap, radius, tagColors, unit, centerLabel, getColor]);
|
|
4739
|
+
return (jsxs("div", { className: styles$4.container, children: [jsx("h3", { className: styles$4.title, children: title }), jsx("svg", { ref: svgRef, width: width, height: height, className: styles$4.chart })] }));
|
|
4529
4740
|
};
|
|
4530
4741
|
|
|
4531
|
-
var styles$
|
|
4742
|
+
var styles$3 = {"container":"PieChart-module_container__tXjbe","title":"PieChart-module_title__61o0R","chartContainer":"PieChart-module_chartContainer__uLmOz","chart":"PieChart-module_chart__3nqON","legend":"PieChart-module_legend__rAWgh","legendItem":"PieChart-module_legendItem__Nb031","legendColor":"PieChart-module_legendColor__fLuv9","legendLabel":"PieChart-module_legendLabel__xbjBr","legendValue":"PieChart-module_legendValue__h2WS2","tooltip":"PieChart-module_tooltip__140RU"};
|
|
4532
4743
|
|
|
4533
4744
|
const DEFAULT_COLORS = [
|
|
4534
4745
|
'#6366f1', '#8b5cf6', '#06b6d4', '#10b981',
|
|
@@ -4568,7 +4779,7 @@ const PieChart = ({ data, width = 400, height = 400, title = 'Distribution', sho
|
|
|
4568
4779
|
.innerRadius(radius * 0.7)
|
|
4569
4780
|
.outerRadius(radius * 0.7);
|
|
4570
4781
|
const tooltip = d3.select('body').append('div')
|
|
4571
|
-
.attr('class', styles$
|
|
4782
|
+
.attr('class', styles$3.tooltip)
|
|
4572
4783
|
.style('opacity', 0)
|
|
4573
4784
|
.style('position', 'absolute');
|
|
4574
4785
|
const pieData = pie(data);
|
|
@@ -4592,7 +4803,7 @@ const PieChart = ({ data, width = 400, height = 400, title = 'Distribution', sho
|
|
|
4592
4803
|
d3.select(this)
|
|
4593
4804
|
.transition()
|
|
4594
4805
|
.duration(200)
|
|
4595
|
-
.attr('d', d => hoverArc(d))
|
|
4806
|
+
.attr('d', (d) => hoverArc(d))
|
|
4596
4807
|
.style('filter', 'drop-shadow(0 4px 12px rgba(0,0,0,0.25))');
|
|
4597
4808
|
tooltip.transition()
|
|
4598
4809
|
.duration(200)
|
|
@@ -4606,18 +4817,21 @@ const PieChart = ({ data, width = 400, height = 400, title = 'Distribution', sho
|
|
|
4606
4817
|
.style('left', (event.pageX + 10) + 'px')
|
|
4607
4818
|
.style('top', (event.pageY - 28) + 'px');
|
|
4608
4819
|
})
|
|
4609
|
-
.on('mouseout', function (
|
|
4820
|
+
.on('mouseout', function (_event, _d) {
|
|
4610
4821
|
d3.select(this)
|
|
4611
4822
|
.transition()
|
|
4612
4823
|
.duration(200)
|
|
4613
|
-
.attr('d', d => arc(d))
|
|
4824
|
+
.attr('d', (d) => arc(d))
|
|
4614
4825
|
.style('filter', 'drop-shadow(0 2px 8px rgba(0,0,0,0.15))');
|
|
4615
4826
|
tooltip.transition()
|
|
4616
4827
|
.duration(500)
|
|
4617
4828
|
.style('opacity', 0);
|
|
4618
4829
|
});
|
|
4619
4830
|
// Calculate average background color for center text contrast
|
|
4620
|
-
const
|
|
4831
|
+
const colors = data.map((d, i) => d.color || DEFAULT_COLORS[i % DEFAULT_COLORS.length]);
|
|
4832
|
+
const avgColor = colors.length >= 2
|
|
4833
|
+
? d3.interpolateRgb.gamma(2.2)(colors[0], colors[1])(0.5)
|
|
4834
|
+
: colors[0] || '#ffffff';
|
|
4621
4835
|
const centerTextColor = getTextColor(avgColor);
|
|
4622
4836
|
// Add center text for donut
|
|
4623
4837
|
g.append('text')
|
|
@@ -4663,13 +4877,13 @@ const PieChart = ({ data, width = 400, height = 400, title = 'Distribution', sho
|
|
|
4663
4877
|
return () => {
|
|
4664
4878
|
tooltip.remove();
|
|
4665
4879
|
};
|
|
4666
|
-
}, [data, width, height, radius]);
|
|
4667
|
-
return (jsxs("div", { className: styles$
|
|
4880
|
+
}, [data, width, height, radius, centerLabel, unit]);
|
|
4881
|
+
return (jsxs("div", { className: styles$3.container, children: [jsx("h3", { className: styles$3.title, children: title }), jsxs("div", { className: styles$3.chartContainer, children: [jsx("svg", { ref: svgRef, width: width, height: height, className: styles$3.chart }), showLegend && (jsx("div", { className: styles$3.legend, children: data.map((item, index) => (jsxs("div", { className: styles$3.legendItem, children: [jsx("span", { className: styles$3.legendColor, style: {
|
|
4668
4882
|
backgroundColor: item.color || DEFAULT_COLORS[index % DEFAULT_COLORS.length]
|
|
4669
|
-
} }), jsx("span", { className: styles$
|
|
4883
|
+
} }), jsx("span", { className: styles$3.legendLabel, children: item.name }), jsx("span", { className: styles$3.legendValue, children: item.value.toLocaleString() })] }, item.name))) }))] })] }));
|
|
4670
4884
|
};
|
|
4671
4885
|
|
|
4672
|
-
var styles$
|
|
4886
|
+
var styles$2 = {"slideshow":"ImageSlideshow-module_slideshow__Ku43h","fullscreen":"ImageSlideshow-module_fullscreen__YhVju","empty":"ImageSlideshow-module_empty__XaCpW","emptyState":"ImageSlideshow-module_emptyState__caEwx","mainContainer":"ImageSlideshow-module_mainContainer__E9aZ3","slide":"ImageSlideshow-module_slide__Wt0U-","image":"ImageSlideshow-module_image__aLHJX","imageLoader":"ImageSlideshow-module_imageLoader__5oAf5","spinner":"ImageSlideshow-module_spinner__fmIFu","control":"ImageSlideshow-module_control__WF7Lz","controlPrev":"ImageSlideshow-module_controlPrev__PCSgw","controlNext":"ImageSlideshow-module_controlNext__RMVX2","controlPlay":"ImageSlideshow-module_controlPlay__183mX","topControls":"ImageSlideshow-module_topControls__AIEJT","controlAction":"ImageSlideshow-module_controlAction__NCD7t","caption":"ImageSlideshow-module_caption__9a3JW","captionTitle":"ImageSlideshow-module_captionTitle__w5Izi","captionText":"ImageSlideshow-module_captionText__FvPyQ","imageMetadata":"ImageSlideshow-module_imageMetadata__5RF2N","metadataItem":"ImageSlideshow-module_metadataItem__6MJDP","indicators":"ImageSlideshow-module_indicators__2cH2G","hasThumbnails":"ImageSlideshow-module_hasThumbnails__0B1N-","indicator":"ImageSlideshow-module_indicator__4zGqm","indicatorActive":"ImageSlideshow-module_indicatorActive__oLeK2","thumbnails":"ImageSlideshow-module_thumbnails__zwiUz","thumbnail":"ImageSlideshow-module_thumbnail__3YyIx","thumbnailActive":"ImageSlideshow-module_thumbnailActive__aADJh","thumbnailImage":"ImageSlideshow-module_thumbnailImage__Ft7Iq"};
|
|
4673
4887
|
|
|
4674
4888
|
const ImageSlideshow = ({ images, autoPlay = false, autoPlayInterval = 3000, showThumbnails = true, showControls = true, showIndicators = true, showCaptions = true, loop = true, fadeTransition = false, enableFullscreen = true, enableDownload = false, enableShare = false, enableDragReorder = false, lazyLoading = true, preloadAdjacent = true, className = '', onImageChange, onDownload, onShare, onImageReorder, initialIndex = 0, }) => {
|
|
4675
4889
|
const [currentIndex, setCurrentIndex] = useState(initialIndex);
|
|
@@ -4708,9 +4922,9 @@ const ImageSlideshow = ({ images, autoPlay = false, autoPlayInterval = 3000, sho
|
|
|
4708
4922
|
goToSlide(imageOrder.length - 1);
|
|
4709
4923
|
}
|
|
4710
4924
|
}, [currentIndex, imageOrder.length, loop, goToSlide]);
|
|
4711
|
-
const togglePlayPause = () => {
|
|
4712
|
-
setIsPlaying(!
|
|
4713
|
-
};
|
|
4925
|
+
const togglePlayPause = useCallback(() => {
|
|
4926
|
+
setIsPlaying(prev => !prev);
|
|
4927
|
+
}, []);
|
|
4714
4928
|
const toggleFullscreen = () => {
|
|
4715
4929
|
if (!document.fullscreenElement) {
|
|
4716
4930
|
slideshowRef.current?.requestFullscreen();
|
|
@@ -4834,7 +5048,7 @@ const ImageSlideshow = ({ images, autoPlay = false, autoPlayInterval = 3000, sho
|
|
|
4834
5048
|
}
|
|
4835
5049
|
});
|
|
4836
5050
|
}
|
|
4837
|
-
}, [currentIndex, images, loop, preloadAdjacent]);
|
|
5051
|
+
}, [currentIndex, imageOrder, images, loop, preloadAdjacent]);
|
|
4838
5052
|
useEffect(() => {
|
|
4839
5053
|
const handleFullscreenChange = () => {
|
|
4840
5054
|
setIsFullscreen(!!document.fullscreenElement);
|
|
@@ -4885,9 +5099,9 @@ const ImageSlideshow = ({ images, autoPlay = false, autoPlayInterval = 3000, sho
|
|
|
4885
5099
|
};
|
|
4886
5100
|
document.addEventListener('keydown', handleKeyDown);
|
|
4887
5101
|
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
4888
|
-
}, [goToPrevious, goToNext]);
|
|
5102
|
+
}, [goToPrevious, goToNext, enableFullscreen, togglePlayPause]);
|
|
4889
5103
|
if (!imageOrder || imageOrder.length === 0) {
|
|
4890
|
-
return (jsx("div", { className: `${styles$
|
|
5104
|
+
return (jsx("div", { className: `${styles$2.slideshow} ${styles$2.empty} ${className}`, children: jsx("div", { className: styles$2.emptyState, children: jsx("span", { children: "No images to display" }) }) }));
|
|
4891
5105
|
}
|
|
4892
5106
|
const slideVariants = {
|
|
4893
5107
|
enter: (direction) => ({
|
|
@@ -4907,16 +5121,16 @@ const ImageSlideshow = ({ images, autoPlay = false, autoPlayInterval = 3000, sho
|
|
|
4907
5121
|
};
|
|
4908
5122
|
const currentImage = imageOrder[currentIndex];
|
|
4909
5123
|
const isImageLoaded = loadedImages.has(currentImage.id);
|
|
4910
|
-
return (jsxs("div", { ref: slideshowRef, className: `${styles$
|
|
5124
|
+
return (jsxs("div", { ref: slideshowRef, className: `${styles$2.slideshow} ${isFullscreen ? styles$2.fullscreen : ''} ${showThumbnails && imageOrder.length > 1 ? styles$2.hasThumbnails : ''} ${className}`, children: [jsxs("div", { className: styles$2.mainContainer, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onTouchEnd, children: [jsx(AnimatePresence, { mode: "wait", custom: 1, children: jsxs(motion.div, { custom: 1, variants: slideVariants, initial: "enter", animate: "center", exit: "exit", transition: {
|
|
4911
5125
|
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
4912
5126
|
opacity: { duration: 0.3 }
|
|
4913
|
-
}, className: styles$
|
|
5127
|
+
}, className: styles$2.slide, children: [jsx("img", { ref: imageRef, src: lazyLoading && !isImageLoaded ? undefined : currentImage.src, "data-src": lazyLoading ? currentImage.src : undefined, srcSet: currentImage.srcSet, sizes: currentImage.sizes, alt: currentImage.alt, className: styles$2.image, draggable: false, onLoad: () => handleImageLoad(currentImage.id), style: {
|
|
4914
5128
|
opacity: lazyLoading && !isImageLoaded ? 0 : 1,
|
|
4915
5129
|
transition: 'opacity 0.3s ease'
|
|
4916
|
-
} }), lazyLoading && !isImageLoaded && (jsx("div", { className: styles$
|
|
5130
|
+
} }), lazyLoading && !isImageLoaded && (jsx("div", { className: styles$2.imageLoader, children: jsx("div", { className: styles$2.spinner }) }))] }, currentIndex) }), showControls && imageOrder.length > 1 && (jsxs(Fragment, { children: [jsx("button", { className: `${styles$2.control} ${styles$2.controlPrev}`, onClick: goToPrevious, disabled: !loop && currentIndex === 0, "aria-label": "Previous image", children: jsx(ChevronLeft, {}) }), jsx("button", { className: `${styles$2.control} ${styles$2.controlNext}`, onClick: goToNext, disabled: !loop && currentIndex === imageOrder.length - 1, "aria-label": "Next image", children: jsx(ChevronRight, {}) })] })), jsxs("div", { className: styles$2.topControls, children: [enableFullscreen && (jsx("button", { className: `${styles$2.control} ${styles$2.controlAction}`, onClick: toggleFullscreen, "aria-label": isFullscreen ? 'Exit fullscreen' : 'Enter fullscreen', title: isFullscreen ? 'Exit fullscreen (F)' : 'Enter fullscreen (F)', children: jsx("span", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', height: '100%' }, children: jsx(Maximize, {}) }) })), enableDownload && (jsx("button", { className: `${styles$2.control} ${styles$2.controlAction}`, onClick: handleDownload, "aria-label": "Download image", title: "Download image", children: jsx("span", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', height: '100%' }, children: jsx(Download, {}) }) })), enableShare && (jsx("button", { className: `${styles$2.control} ${styles$2.controlAction}`, onClick: handleShare, "aria-label": "Share image", title: "Share image", children: jsx("span", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', height: '100%' }, children: jsx(Share2, {}) }) }))] }), autoPlay && imageOrder.length > 1 && (jsx("button", { className: `${styles$2.control} ${styles$2.controlPlay}`, onClick: togglePlayPause, "aria-label": isPlaying ? 'Pause slideshow' : 'Play slideshow', title: isPlaying ? 'Pause slideshow (Space)' : 'Play slideshow (Space)', children: isPlaying ? jsx(Pause, {}) : jsx(Play, {}) })), showCaptions && (currentImage.caption || currentImage.title) && (jsxs(motion.div, { className: styles$2.caption, initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, transition: { delay: 0.3 }, children: [currentImage.title && (jsx("h3", { className: styles$2.captionTitle, children: currentImage.title })), currentImage.caption && (jsx("p", { className: styles$2.captionText, children: currentImage.caption })), currentImage.metadata && (jsxs("div", { className: styles$2.imageMetadata, children: [currentImage.metadata.photographer && (jsxs("span", { className: styles$2.metadataItem, children: ["\uD83D\uDCF7 ", currentImage.metadata.photographer] })), currentImage.metadata.location && (jsxs("span", { className: styles$2.metadataItem, children: ["\uD83D\uDCCD ", currentImage.metadata.location] })), currentImage.metadata.camera && (jsxs("span", { className: styles$2.metadataItem, children: ["\uD83D\uDCF9 ", currentImage.metadata.camera] }))] }))] }))] }), showIndicators && imageOrder.length > 1 && (jsx("div", { className: styles$2.indicators, children: imageOrder.map((_, index) => (jsx(motion.button, { className: `${styles$2.indicator} ${index === currentIndex ? styles$2.indicatorActive : ''}`, onClick: () => goToSlide(index), whileHover: { scale: 1.2 }, whileTap: { scale: 0.8 }, "aria-label": `Go to slide ${index + 1}` }, index))) })), showThumbnails && imageOrder.length > 1 && (jsx("div", { className: `${styles$2.thumbnails} ${isDragging ? styles$2.thumbnailsDragging : ''}`, children: imageOrder.map((image, index) => (jsx(motion.button, { className: `${styles$2.thumbnail} ${index === currentIndex ? styles$2.thumbnailActive : ''} ${draggedIndex === index ? styles$2.thumbnailDragged : ''}`, onClick: () => goToSlide(index), whileHover: { scale: 1.05 }, whileTap: { scale: 0.95 }, "aria-label": `Go to ${image.alt}`, draggable: enableDragReorder, onDragStart: (e) => handleDragStart(e, index), onDragOver: handleDragOver, onDrop: (e) => handleDrop(e, index), title: image.title || image.alt, children: jsx("img", { src: image.src, alt: image.alt, className: styles$2.thumbnailImage, draggable: false }) }, image.id))) }))] }));
|
|
4917
5131
|
};
|
|
4918
5132
|
|
|
4919
|
-
var styles = {"container":"Table-module_container__CH3T9","header":"Table-module_header__qVoF2","title":"Table-module_title__DSZgm","actions":"Table-module_actions__2J1i0","controls":"Table-module_controls__3WToN","searchBox":"Table-module_searchBox__bh3f3","searchIcon":"Table-module_searchIcon__1pQ5l","searchInput":"Table-module_searchInput__SrK6l","clearButton":"Table-module_clearButton__4Fysz","clearFiltersButton":"Table-module_clearFiltersButton__yFLI9","resultCount":"Table-module_resultCount__RR7Z6","loading":"Table-module_loading__xxSIa","spinner":"Table-module_spinner__T8mdH","empty":"Table-module_empty__-qPi2","emptyIcon":"Table-module_emptyIcon__FLViS","tableWrapper":"Table-module_tableWrapper__LvHGH","stickyHeader":"Table-module_stickyHeader__Dz0O8","table":"Table-module_table__4T9xo","striped":"Table-module_striped__TBcT6","compact":"Table-module_compact__w-QVs","th":"Table-module_th__bpKfX","td":"Table-module_td__HaytM","hoverable":"Table-module_hoverable__4aHgq","headerCell":"Table-module_headerCell__WUy2w","headerText":"Table-module_headerText__WGAqz","sortButton":"Table-module_sortButton__CJwYq","sortIcon":"Table-module_sortIcon__G48h1","columnFilter":"Table-module_columnFilter__hwNd2","tr":"Table-module_tr__-j8Fa","selected":"Table-module_selected__pjiMr","clickable":"Table-module_clickable__9R5oq","checkboxColumn":"Table-module_checkboxColumn__SpbCr","actionsColumn":"Table-module_actionsColumn__7x--N","actionButtons":"Table-module_actionButtons__8JQhr","actionButton":"Table-module_actionButton__9EQZu","actionButtonPrimary":"Table-module_actionButtonPrimary__Xyzgu","actionButtonSecondary":"Table-module_actionButtonSecondary__RiR1E","actionButtonDanger":"Table-module_actionButtonDanger__7aX-2","actionButtonWarning":"Table-module_actionButtonWarning__2s73k","actionButtonSuccess":"Table-module_actionButtonSuccess__DvbtN","checkbox":"Table-module_checkbox__9LC-f","nullValue":"Table-module_nullValue__TVTmT","badge":"Table-module_badge__OO-UL","badgeSuccess":"Table-module_badgeSuccess__uIJVY","badgeDanger":"Table-module_badgeDanger__Y6RPD","code":"Table-module_code__SIFLQ","pagination":"Table-module_pagination__UVcSr","pageInfo":"Table-module_pageInfo__e-k17","pageControls":"Table-module_pageControls__htKNN","pageButton":"Table-module_pageButton__9ukDT","pageNumber":"Table-module_pageNumber__qpnbj","pageSizeSelect":"Table-module_pageSizeSelect__GbSKL","bulkActions":"Table-module_bulkActions__7Rz-X","bulkActionButtons":"Table-module_bulkActionButtons__pb8M2","bulkActionButton":"Table-module_bulkActionButton__UOTDm","selectionCount":"Table-module_selectionCount__ZwGuQ","bulkPrimary":"Table-module_bulkPrimary__qx71n","bulkSecondary":"Table-module_bulkSecondary__WNEOF","bulkDanger":"Table-module_bulkDanger__Aqmye","bulkWarning":"Table-module_bulkWarning__jEkYC","bulkSuccess":"Table-module_bulkSuccess__VQd5s","bulkCustom":"Table-module_bulkCustom__BP47V","horizontalScroll":"Table-module_horizontalScroll__Cgx7N"};
|
|
5133
|
+
var styles$1 = {"container":"Table-module_container__CH3T9","header":"Table-module_header__qVoF2","title":"Table-module_title__DSZgm","actions":"Table-module_actions__2J1i0","controls":"Table-module_controls__3WToN","searchBox":"Table-module_searchBox__bh3f3","searchIcon":"Table-module_searchIcon__1pQ5l","searchInput":"Table-module_searchInput__SrK6l","clearButton":"Table-module_clearButton__4Fysz","clearFiltersButton":"Table-module_clearFiltersButton__yFLI9","resultCount":"Table-module_resultCount__RR7Z6","loading":"Table-module_loading__xxSIa","spinner":"Table-module_spinner__T8mdH","empty":"Table-module_empty__-qPi2","emptyIcon":"Table-module_emptyIcon__FLViS","tableWrapper":"Table-module_tableWrapper__LvHGH","stickyHeader":"Table-module_stickyHeader__Dz0O8","table":"Table-module_table__4T9xo","striped":"Table-module_striped__TBcT6","compact":"Table-module_compact__w-QVs","th":"Table-module_th__bpKfX","td":"Table-module_td__HaytM","hoverable":"Table-module_hoverable__4aHgq","headerCell":"Table-module_headerCell__WUy2w","headerText":"Table-module_headerText__WGAqz","sortButton":"Table-module_sortButton__CJwYq","sortIcon":"Table-module_sortIcon__G48h1","columnFilter":"Table-module_columnFilter__hwNd2","tr":"Table-module_tr__-j8Fa","selected":"Table-module_selected__pjiMr","clickable":"Table-module_clickable__9R5oq","checkboxColumn":"Table-module_checkboxColumn__SpbCr","actionsColumn":"Table-module_actionsColumn__7x--N","actionButtons":"Table-module_actionButtons__8JQhr","actionButton":"Table-module_actionButton__9EQZu","actionButtonPrimary":"Table-module_actionButtonPrimary__Xyzgu","actionButtonSecondary":"Table-module_actionButtonSecondary__RiR1E","actionButtonDanger":"Table-module_actionButtonDanger__7aX-2","actionButtonWarning":"Table-module_actionButtonWarning__2s73k","actionButtonSuccess":"Table-module_actionButtonSuccess__DvbtN","checkbox":"Table-module_checkbox__9LC-f","nullValue":"Table-module_nullValue__TVTmT","badge":"Table-module_badge__OO-UL","badgeSuccess":"Table-module_badgeSuccess__uIJVY","badgeDanger":"Table-module_badgeDanger__Y6RPD","code":"Table-module_code__SIFLQ","pagination":"Table-module_pagination__UVcSr","pageInfo":"Table-module_pageInfo__e-k17","pageControls":"Table-module_pageControls__htKNN","pageButton":"Table-module_pageButton__9ukDT","pageNumber":"Table-module_pageNumber__qpnbj","pageSizeSelect":"Table-module_pageSizeSelect__GbSKL","bulkActions":"Table-module_bulkActions__7Rz-X","bulkActionButtons":"Table-module_bulkActionButtons__pb8M2","bulkActionButton":"Table-module_bulkActionButton__UOTDm","selectionCount":"Table-module_selectionCount__ZwGuQ","bulkPrimary":"Table-module_bulkPrimary__qx71n","bulkSecondary":"Table-module_bulkSecondary__WNEOF","bulkDanger":"Table-module_bulkDanger__Aqmye","bulkWarning":"Table-module_bulkWarning__jEkYC","bulkSuccess":"Table-module_bulkSuccess__VQd5s","bulkCustom":"Table-module_bulkCustom__BP47V","horizontalScroll":"Table-module_horizontalScroll__Cgx7N"};
|
|
4920
5134
|
|
|
4921
5135
|
/**
|
|
4922
5136
|
* A comprehensive table component with sorting, filtering, pagination, selection, and row actions.
|
|
@@ -5117,7 +5331,7 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5117
5331
|
...action.style,
|
|
5118
5332
|
...action.buttonStyles?.style
|
|
5119
5333
|
};
|
|
5120
|
-
// Handle icon size -
|
|
5334
|
+
// Handle icon size - set CSS custom property
|
|
5121
5335
|
if (action.buttonStyles?.iconSize || actionButtonStyles?.iconSize) {
|
|
5122
5336
|
baseStyles['--icon-size'] = typeof (action.buttonStyles?.iconSize || actionButtonStyles?.iconSize) === 'number'
|
|
5123
5337
|
? `${action.buttonStyles?.iconSize || actionButtonStyles?.iconSize}px`
|
|
@@ -5126,13 +5340,13 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5126
5340
|
return baseStyles;
|
|
5127
5341
|
}, [actionButtonStyles]);
|
|
5128
5342
|
const getButtonClassName = useCallback((action) => {
|
|
5129
|
-
const baseClass = styles.actionButton;
|
|
5130
|
-
const variantClass = action.variant === 'primary' ? styles.actionButtonPrimary :
|
|
5131
|
-
action.variant === 'danger' ? styles.actionButtonDanger :
|
|
5132
|
-
action.variant === 'warning' ? styles.actionButtonWarning :
|
|
5133
|
-
action.variant === 'success' ? styles.actionButtonSuccess :
|
|
5343
|
+
const baseClass = styles$1.actionButton;
|
|
5344
|
+
const variantClass = action.variant === 'primary' ? styles$1.actionButtonPrimary :
|
|
5345
|
+
action.variant === 'danger' ? styles$1.actionButtonDanger :
|
|
5346
|
+
action.variant === 'warning' ? styles$1.actionButtonWarning :
|
|
5347
|
+
action.variant === 'success' ? styles$1.actionButtonSuccess :
|
|
5134
5348
|
action.variant === 'custom' ? '' :
|
|
5135
|
-
styles.actionButtonSecondary;
|
|
5349
|
+
styles$1.actionButtonSecondary;
|
|
5136
5350
|
const globalCustomClass = actionButtonStyles?.className || '';
|
|
5137
5351
|
const actionCustomClass = action.className || '';
|
|
5138
5352
|
const buttonCustomClass = action.buttonStyles?.className || '';
|
|
@@ -5140,23 +5354,23 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5140
5354
|
}, [actionButtonStyles]);
|
|
5141
5355
|
// Loading state
|
|
5142
5356
|
if (loading) {
|
|
5143
|
-
return (jsx("div", { className: `${styles.container} ${className}`, children: jsxs("div", { className: styles.loading, children: [jsx("div", { className: styles.spinner }), jsx("span", { children: "Loading..." })] }) }));
|
|
5357
|
+
return (jsx("div", { className: `${styles$1.container} ${className}`, children: jsxs("div", { className: styles$1.loading, children: [jsx("div", { className: styles$1.spinner }), jsx("span", { children: "Loading..." })] }) }));
|
|
5144
5358
|
}
|
|
5145
5359
|
// Empty state
|
|
5146
5360
|
if (data.length === 0) {
|
|
5147
|
-
return (jsxs("div", { className: `${styles.container} ${className}`, children: [title && jsx("h2", { className: styles.title, children: title }), jsxs("div", { className: styles.empty, children: [jsx("span", { className: styles.emptyIcon, children: "\uD83D\uDCCA" }), jsx("p", { children: emptyMessage })] })] }));
|
|
5361
|
+
return (jsxs("div", { className: `${styles$1.container} ${className}`, children: [title && jsx("h2", { className: styles$1.title, children: title }), jsxs("div", { className: styles$1.empty, children: [jsx("span", { className: styles$1.emptyIcon, children: "\uD83D\uDCCA" }), jsx("p", { children: emptyMessage })] })] }));
|
|
5148
5362
|
}
|
|
5149
|
-
return (jsxs("div", { className: `${styles.container} ${className}`, children: [(title || actions || bulkActions) && (jsxs("div", { className: styles.header, children: [title && jsx("h2", { className: styles.title, children: title }), (actions || bulkActions) && (jsxs("div", { className: styles.bulkActions, children: [actions && selectedItems.length > 0 && (jsx("div", { className: styles.actions, children: actions(selectedItems) })), bulkActions && bulkActions.length > 0 && selectedItems.length > 0 && (jsx("div", { className: styles.bulkActionButtons, children: bulkActions.map((bulkAction, index) => {
|
|
5363
|
+
return (jsxs("div", { className: `${styles$1.container} ${className}`, children: [(title || actions || bulkActions) && (jsxs("div", { className: styles$1.header, children: [title && jsx("h2", { className: styles$1.title, children: title }), (actions || bulkActions) && (jsxs("div", { className: styles$1.bulkActions, children: [actions && selectedItems.length > 0 && (jsx("div", { className: styles$1.actions, children: actions(selectedItems) })), bulkActions && bulkActions.length > 0 && selectedItems.length > 0 && (jsx("div", { className: styles$1.bulkActionButtons, children: bulkActions.map((bulkAction, index) => {
|
|
5150
5364
|
const isDisabled = (bulkAction.disabled && bulkAction.disabled(selectedItems)) ||
|
|
5151
5365
|
(bulkAction.minSelection && selectedItems.length < bulkAction.minSelection) ||
|
|
5152
5366
|
(bulkAction.maxSelection && selectedItems.length > bulkAction.maxSelection);
|
|
5153
|
-
return (jsxs("button", { className: `${styles.bulkActionButton} ${bulkAction.variant === 'primary' ? styles.bulkPrimary :
|
|
5154
|
-
bulkAction.variant === 'secondary' ? styles.bulkSecondary :
|
|
5155
|
-
bulkAction.variant === 'danger' ? styles.bulkDanger :
|
|
5156
|
-
bulkAction.variant === 'warning' ? styles.bulkWarning :
|
|
5157
|
-
bulkAction.variant === 'success' ? styles.bulkSuccess :
|
|
5158
|
-
bulkAction.variant === 'custom' ? styles.bulkCustom :
|
|
5159
|
-
styles.bulkPrimary} ${bulkAction.className || ''}`, style: bulkAction.style, disabled: !!isDisabled, onClick: async () => {
|
|
5367
|
+
return (jsxs("button", { className: `${styles$1.bulkActionButton} ${bulkAction.variant === 'primary' ? styles$1.bulkPrimary :
|
|
5368
|
+
bulkAction.variant === 'secondary' ? styles$1.bulkSecondary :
|
|
5369
|
+
bulkAction.variant === 'danger' ? styles$1.bulkDanger :
|
|
5370
|
+
bulkAction.variant === 'warning' ? styles$1.bulkWarning :
|
|
5371
|
+
bulkAction.variant === 'success' ? styles$1.bulkSuccess :
|
|
5372
|
+
bulkAction.variant === 'custom' ? styles$1.bulkCustom :
|
|
5373
|
+
styles$1.bulkPrimary} ${bulkAction.className || ''}`, style: bulkAction.style, disabled: !!isDisabled, onClick: async () => {
|
|
5160
5374
|
if (bulkAction.confirmMessage) {
|
|
5161
5375
|
const message = typeof bulkAction.confirmMessage === 'function'
|
|
5162
5376
|
? bulkAction.confirmMessage(selectedItems)
|
|
@@ -5165,27 +5379,27 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5165
5379
|
return;
|
|
5166
5380
|
}
|
|
5167
5381
|
await bulkAction.onClick(selectedItems);
|
|
5168
|
-
}, title: bulkAction.label, "aria-label": bulkAction.label, children: [bulkAction.icon, jsx("span", { children: bulkAction.label }), jsxs("span", { className: styles.selectionCount, children: ["(", selectedItems.length, ")"] })] }, index));
|
|
5169
|
-
}) }))] }))] })), (searchable || hasActiveFilters) && (jsxs("div", { className: styles.controls, children: [searchable && (jsxs("div", { className: styles.searchBox, children: [jsx("span", { className: styles.searchIcon, children: "\uD83D\uDD0D" }), jsx("input", { type: "text", placeholder: "Search...", value: searchQuery, onChange: e => {
|
|
5382
|
+
}, title: bulkAction.label, "aria-label": bulkAction.label, children: [bulkAction.icon, jsx("span", { children: bulkAction.label }), jsxs("span", { className: styles$1.selectionCount, children: ["(", selectedItems.length, ")"] })] }, index));
|
|
5383
|
+
}) }))] }))] })), (searchable || hasActiveFilters) && (jsxs("div", { className: styles$1.controls, children: [searchable && (jsxs("div", { className: styles$1.searchBox, children: [jsx("span", { className: styles$1.searchIcon, children: "\uD83D\uDD0D" }), jsx("input", { type: "text", placeholder: "Search...", value: searchQuery, onChange: e => {
|
|
5170
5384
|
setSearchQuery(e.target.value);
|
|
5171
5385
|
setCurrentPage(1);
|
|
5172
|
-
}, className: styles.searchInput }), searchQuery && (jsx("button", { className: styles.clearButton, onClick: () => setSearchQuery(''), children: "\u2715" }))] })), hasActiveFilters && (jsx("button", { className: styles.clearFiltersButton, onClick: clearFilters, children: "Clear All Filters" })), jsxs("div", { className: styles.resultCount, children: [filteredData.length, " ", filteredData.length === 1 ? 'result' : 'results'] })] })), jsx("div", { className: `${styles.tableWrapper} ${stickyHeader ? styles.stickyHeader : ''} ${horizontalScroll ? styles.horizontalScroll : ''}`, children: jsxs("table", { className: `
|
|
5173
|
-
${styles.table}
|
|
5174
|
-
${striped ? styles.striped : ''}
|
|
5175
|
-
${hoverable ? styles.hoverable : ''}
|
|
5176
|
-
${compact ? styles.compact : ''}
|
|
5177
|
-
`, role: "table", "aria-label": title || 'Data table', "aria-rowcount": sortedData.length, "aria-describedby": title ? `${title.replace(/\s+/g, '-').toLowerCase()}-summary` : undefined, children: [jsx("thead", { children: jsxs("tr", { children: [selectable && (jsx("th", { className: styles.checkboxColumn, scope: "col", children: jsx("input", { type: "checkbox", checked: allCurrentPageSelected, ref: input => {
|
|
5386
|
+
}, className: styles$1.searchInput }), searchQuery && (jsx("button", { className: styles$1.clearButton, onClick: () => setSearchQuery(''), children: "\u2715" }))] })), hasActiveFilters && (jsx("button", { className: styles$1.clearFiltersButton, onClick: clearFilters, children: "Clear All Filters" })), jsxs("div", { className: styles$1.resultCount, children: [filteredData.length, " ", filteredData.length === 1 ? 'result' : 'results'] })] })), jsx("div", { className: `${styles$1.tableWrapper} ${stickyHeader ? styles$1.stickyHeader : ''} ${horizontalScroll ? styles$1.horizontalScroll : ''}`, children: jsxs("table", { className: `
|
|
5387
|
+
${styles$1.table}
|
|
5388
|
+
${striped ? styles$1.striped : ''}
|
|
5389
|
+
${hoverable ? styles$1.hoverable : ''}
|
|
5390
|
+
${compact ? styles$1.compact : ''}
|
|
5391
|
+
`, role: "table", "aria-label": title || 'Data table', "aria-rowcount": sortedData.length, "aria-describedby": title ? `${title.replace(/\s+/g, '-').toLowerCase()}-summary` : undefined, children: [jsx("thead", { children: jsxs("tr", { children: [selectable && (jsx("th", { className: styles$1.checkboxColumn, scope: "col", children: jsx("input", { type: "checkbox", checked: allCurrentPageSelected, ref: input => {
|
|
5178
5392
|
if (input) {
|
|
5179
5393
|
input.indeterminate = !allCurrentPageSelected && someCurrentPageSelected;
|
|
5180
5394
|
}
|
|
5181
|
-
}, onChange: handleSelectAll, className: styles.checkbox, "aria-label": "Select all rows" }) })), columns.map(column => (jsx("th", { className: `${styles.th} ${column.className || ''}`, style: {
|
|
5395
|
+
}, onChange: handleSelectAll, className: styles$1.checkbox, "aria-label": "Select all rows" }) })), columns.map(column => (jsx("th", { className: `${styles$1.th} ${column.className || ''}`, style: {
|
|
5182
5396
|
width: column.width,
|
|
5183
5397
|
textAlign: column.align || 'left'
|
|
5184
5398
|
}, scope: "col", role: "columnheader", "aria-sort": sortConfig.key === column.key
|
|
5185
5399
|
? sortConfig.direction === 'asc' ? 'ascending' : 'descending'
|
|
5186
|
-
: column.sortable ? 'none' : undefined, children: jsxs("div", { className: styles.headerCell, children: [column.sortable ? (jsxs("button", { className: styles.sortButton, onClick: () => handleSort(column.key), "aria-label": `Sort by ${column.header} ${sortConfig.key === column.key
|
|
5400
|
+
: column.sortable ? 'none' : undefined, children: jsxs("div", { className: styles$1.headerCell, children: [column.sortable ? (jsxs("button", { className: styles$1.sortButton, onClick: () => handleSort(column.key), "aria-label": `Sort by ${column.header} ${sortConfig.key === column.key
|
|
5187
5401
|
? sortConfig.direction === 'asc' ? '(descending)' : '(ascending)'
|
|
5188
|
-
: '(ascending)'}`, children: [jsx("span", { children: column.header }), jsx("span", { className: styles.sortIcon, "aria-hidden": "true", children: sortConfig.key === column.key ? (sortConfig.direction === 'asc' ? '↑' : '↓') : '↕' })] })) : (jsx("span", { className: styles.headerText, children: column.header })), column.filterable && (jsx("input", { type: "text", placeholder: "Filter...", value: columnFilters[column.key] || '', onChange: e => handleColumnFilter(column.key, e.target.value), onClick: e => e.stopPropagation(), className: styles.columnFilter, "aria-label": `Filter ${column.header}` }))] }) }, column.key))), rowActions && rowActions.length > 0 && (jsx("th", { className: styles.actionsColumn, scope: "col", children: jsx("span", { className: styles.headerText, children: "Actions" }) }))] }) }), jsx("tbody", { children: animated ? (jsx(LayoutGroup, { children: jsx(AnimatePresence, { mode: "popLayout", children: paginatedData.map((item, index) => (jsxs(motion.tr, { layout: "position", initial: { opacity: 0, scale: 0.98 }, animate: {
|
|
5402
|
+
: '(ascending)'}`, children: [jsx("span", { children: column.header }), jsx("span", { className: styles$1.sortIcon, "aria-hidden": "true", children: sortConfig.key === column.key ? (sortConfig.direction === 'asc' ? '↑' : '↓') : '↕' })] })) : (jsx("span", { className: styles$1.headerText, children: column.header })), column.filterable && (jsx("input", { type: "text", placeholder: "Filter...", value: columnFilters[column.key] || '', onChange: e => handleColumnFilter(column.key, e.target.value), onClick: e => e.stopPropagation(), className: styles$1.columnFilter, "aria-label": `Filter ${column.header}` }))] }) }, column.key))), rowActions && rowActions.length > 0 && (jsx("th", { className: styles$1.actionsColumn, scope: "col", children: jsx("span", { className: styles$1.headerText, children: "Actions" }) }))] }) }), jsx("tbody", { children: animated ? (jsx(LayoutGroup, { children: jsx(AnimatePresence, { mode: "popLayout", children: paginatedData.map((item, index) => (jsxs(motion.tr, { layout: "position", initial: { opacity: 0, scale: 0.98 }, animate: {
|
|
5189
5403
|
opacity: 1,
|
|
5190
5404
|
scale: 1,
|
|
5191
5405
|
transition: {
|
|
@@ -5198,18 +5412,18 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5198
5412
|
scale: 0.98,
|
|
5199
5413
|
transition: { duration: 0.08 }
|
|
5200
5414
|
}, className: `
|
|
5201
|
-
${styles.tr}
|
|
5202
|
-
${selectedRows.has(item[keyField]) ? styles.selected : ''}
|
|
5203
|
-
${onRowClick ? styles.clickable : ''}
|
|
5204
|
-
`, onClick: () => onRowClick?.(item, index), children: [selectable && (jsx("td", { className: styles.checkboxColumn, children: jsx("input", { type: "checkbox", checked: selectedRows.has(item[keyField]), onChange: () => handleSelectRow(item[keyField]), onClick: e => e.stopPropagation(), className: styles.checkbox }) })), columns.map(column => (jsx("td", { className: `${styles.td} ${column.className || ''}`, style: { textAlign: column.align || 'left' }, children: column.render
|
|
5415
|
+
${styles$1.tr}
|
|
5416
|
+
${selectedRows.has(item[keyField]) ? styles$1.selected : ''}
|
|
5417
|
+
${onRowClick ? styles$1.clickable : ''}
|
|
5418
|
+
`, onClick: () => onRowClick?.(item, index), children: [selectable && (jsx("td", { className: styles$1.checkboxColumn, children: jsx("input", { type: "checkbox", checked: selectedRows.has(item[keyField]), onChange: () => handleSelectRow(item[keyField]), onClick: e => e.stopPropagation(), className: styles$1.checkbox }) })), columns.map(column => (jsx("td", { className: `${styles$1.td} ${column.className || ''}`, style: { textAlign: column.align || 'left' }, children: column.render
|
|
5205
5419
|
? column.render(item[column.key], item, index)
|
|
5206
|
-
: formatValue(item[column.key]) }, column.key))), rowActions && rowActions.length > 0 && (jsx("td", { className: styles.actionsColumn, onClick: e => e.stopPropagation(), children: jsx("div", { className: styles.actionButtons, children: rowActions.map((action, actionIndex) => (jsx("button", { className: getButtonClassName(action), style: getButtonStyles(action), onClick: () => action.onClick(item, index), disabled: action.disabled ? action.disabled(item) : false, title: action.label, "aria-label": action.label, children: action.icon }, actionIndex))) }) }))] }, `${item[keyField]}-${currentPage}`))) }) })) : (paginatedData.map((item, index) => (jsxs("tr", { className: `
|
|
5207
|
-
${styles.tr}
|
|
5208
|
-
${selectedRows.has(item[keyField]) ? styles.selected : ''}
|
|
5209
|
-
${onRowClick ? styles.clickable : ''}
|
|
5210
|
-
`, onClick: () => onRowClick?.(item, index), children: [selectable && (jsx("td", { className: styles.checkboxColumn, children: jsx("input", { type: "checkbox", checked: selectedRows.has(item[keyField]), onChange: () => handleSelectRow(item[keyField]), onClick: e => e.stopPropagation(), className: styles.checkbox }) })), columns.map(column => (jsx("td", { className: `${styles.td} ${column.className || ''}`, style: { textAlign: column.align || 'left' }, children: column.render
|
|
5420
|
+
: formatValue(item[column.key]) }, column.key))), rowActions && rowActions.length > 0 && (jsx("td", { className: styles$1.actionsColumn, onClick: e => e.stopPropagation(), children: jsx("div", { className: styles$1.actionButtons, children: rowActions.map((action, actionIndex) => (jsx("button", { className: getButtonClassName(action), style: getButtonStyles(action), onClick: () => action.onClick(item, index), disabled: action.disabled ? action.disabled(item) : false, title: action.label, "aria-label": action.label, children: action.icon }, actionIndex))) }) }))] }, `${String(item[keyField])}-${currentPage}`))) }) })) : (paginatedData.map((item, index) => (jsxs("tr", { className: `
|
|
5421
|
+
${styles$1.tr}
|
|
5422
|
+
${selectedRows.has(item[keyField]) ? styles$1.selected : ''}
|
|
5423
|
+
${onRowClick ? styles$1.clickable : ''}
|
|
5424
|
+
`, onClick: () => onRowClick?.(item, index), children: [selectable && (jsx("td", { className: styles$1.checkboxColumn, children: jsx("input", { type: "checkbox", checked: selectedRows.has(item[keyField]), onChange: () => handleSelectRow(item[keyField]), onClick: e => e.stopPropagation(), className: styles$1.checkbox }) })), columns.map(column => (jsx("td", { className: `${styles$1.td} ${column.className || ''}`, style: { textAlign: column.align || 'left' }, children: column.render
|
|
5211
5425
|
? column.render(item[column.key], item, index)
|
|
5212
|
-
: formatValue(item[column.key]) }, column.key))), rowActions && rowActions.length > 0 && (jsx("td", { className: styles.actionsColumn, onClick: e => e.stopPropagation(), children: jsx("div", { className: styles.actionButtons, children: rowActions.map((action, actionIndex) => (jsx("button", { className: getButtonClassName(action), style: getButtonStyles(action), onClick: () => action.onClick(item, index), disabled: action.disabled ? action.disabled(item) : false, title: action.label, "aria-label": action.label, children: action.icon }, actionIndex))) }) }))] }, item[keyField])))) })] }) }), pagination && totalPages > 1 && (jsxs("div", { className: styles.pagination, children: [jsxs("div", { className: styles.pageInfo, children: ["Showing ", ((currentPage - 1) * pageSize) + 1, "-", Math.min(currentPage * pageSize, sortedData.length), " of ", sortedData.length] }), jsxs("div", { className: styles.pageControls, children: [jsx("button", { className: styles.pageButton, onClick: () => setCurrentPage(1), disabled: currentPage === 1, children: "\u27E8\u27E8" }), jsx("button", { className: styles.pageButton, onClick: () => setCurrentPage(prev => Math.max(1, prev - 1)), disabled: currentPage === 1, children: "\u27E8" }), jsxs("span", { className: styles.pageNumber, children: ["Page ", currentPage, " of ", totalPages] }), jsx("button", { className: styles.pageButton, onClick: () => setCurrentPage(prev => Math.min(totalPages, prev + 1)), disabled: currentPage === totalPages, children: "\u27E9" }), jsx("button", { className: styles.pageButton, onClick: () => setCurrentPage(totalPages), disabled: currentPage === totalPages, children: "\u27E9\u27E9" })] }), typeof pagination === 'object' && (jsx("select", { className: styles.pageSizeSelect, value: pageSize, onChange: e => {
|
|
5426
|
+
: formatValue(item[column.key]) }, column.key))), rowActions && rowActions.length > 0 && (jsx("td", { className: styles$1.actionsColumn, onClick: e => e.stopPropagation(), children: jsx("div", { className: styles$1.actionButtons, children: rowActions.map((action, actionIndex) => (jsx("button", { className: getButtonClassName(action), style: getButtonStyles(action), onClick: () => action.onClick(item, index), disabled: action.disabled ? action.disabled(item) : false, title: action.label, "aria-label": action.label, children: action.icon }, actionIndex))) }) }))] }, String(item[keyField]))))) })] }) }), pagination && totalPages > 1 && (jsxs("div", { className: styles$1.pagination, children: [jsxs("div", { className: styles$1.pageInfo, children: ["Showing ", ((currentPage - 1) * pageSize) + 1, "-", Math.min(currentPage * pageSize, sortedData.length), " of ", sortedData.length] }), jsxs("div", { className: styles$1.pageControls, children: [jsx("button", { className: styles$1.pageButton, onClick: () => setCurrentPage(1), disabled: currentPage === 1, children: "\u27E8\u27E8" }), jsx("button", { className: styles$1.pageButton, onClick: () => setCurrentPage(prev => Math.max(1, prev - 1)), disabled: currentPage === 1, children: "\u27E8" }), jsxs("span", { className: styles$1.pageNumber, children: ["Page ", currentPage, " of ", totalPages] }), jsx("button", { className: styles$1.pageButton, onClick: () => setCurrentPage(prev => Math.min(totalPages, prev + 1)), disabled: currentPage === totalPages, children: "\u27E9" }), jsx("button", { className: styles$1.pageButton, onClick: () => setCurrentPage(totalPages), disabled: currentPage === totalPages, children: "\u27E9\u27E9" })] }), typeof pagination === 'object' && (jsx("select", { className: styles$1.pageSizeSelect, value: pageSize, onChange: e => {
|
|
5213
5427
|
setPageSize(Number(e.target.value));
|
|
5214
5428
|
setCurrentPage(1);
|
|
5215
5429
|
}, children: pageSizeOptions.map(size => (jsxs("option", { value: size, children: [size, " per page"] }, size))) }))] }))] }));
|
|
@@ -5217,21 +5431,50 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5217
5431
|
// Helper function to format values
|
|
5218
5432
|
function formatValue(value) {
|
|
5219
5433
|
if (value === null || value === undefined) {
|
|
5220
|
-
return jsx("span", { className: styles.nullValue, children: "\u2014" });
|
|
5434
|
+
return jsx("span", { className: styles$1.nullValue, children: "\u2014" });
|
|
5221
5435
|
}
|
|
5222
5436
|
if (typeof value === 'boolean') {
|
|
5223
|
-
return (jsx("span", { className: `${styles.badge} ${value ? styles.badgeSuccess : styles.badgeDanger}`, children: value ? '✓' : '✗' }));
|
|
5437
|
+
return (jsx("span", { className: `${styles$1.badge} ${value ? styles$1.badgeSuccess : styles$1.badgeDanger}`, children: value ? '✓' : '✗' }));
|
|
5224
5438
|
}
|
|
5225
5439
|
if (value instanceof Date) {
|
|
5226
5440
|
return value.toLocaleDateString();
|
|
5227
5441
|
}
|
|
5228
5442
|
if (typeof value === 'object') {
|
|
5229
|
-
return jsx("code", { className: styles.code, children: JSON.stringify(value, null, 2) });
|
|
5443
|
+
return jsx("code", { className: styles$1.code, children: JSON.stringify(value, null, 2) });
|
|
5230
5444
|
}
|
|
5231
5445
|
return String(value);
|
|
5232
5446
|
}
|
|
5233
5447
|
// Memoized Table component to prevent unnecessary re-renders
|
|
5234
5448
|
const Table = memo(TableComponent);
|
|
5235
5449
|
|
|
5236
|
-
|
|
5450
|
+
var styles = {"overlay":"ConfirmationModal-module_overlay__wzOO0","positioner":"ConfirmationModal-module_positioner__JbYiu","modal":"ConfirmationModal-module_modal__yG0nB","header":"ConfirmationModal-module_header__-mH-7","warning":"ConfirmationModal-module_warning__DbqCv","danger":"ConfirmationModal-module_danger__RGtlr","info":"ConfirmationModal-module_info__cyle2","title":"ConfirmationModal-module_title__-x6BK","closeButton":"ConfirmationModal-module_closeButton__NStBA","content":"ConfirmationModal-module_content__kFMOl","message":"ConfirmationModal-module_message__eOvmj","footer":"ConfirmationModal-module_footer__m41Eh"};
|
|
5451
|
+
|
|
5452
|
+
/**
|
|
5453
|
+
* ConfirmationModal Component
|
|
5454
|
+
*
|
|
5455
|
+
* A specialized modal for confirm/cancel flows with variant styling.
|
|
5456
|
+
*
|
|
5457
|
+
* @example
|
|
5458
|
+
* <ConfirmationModal
|
|
5459
|
+
* isOpen={showDelete}
|
|
5460
|
+
* onClose={() => setShowDelete(false)}
|
|
5461
|
+
* onConfirm={handleDelete}
|
|
5462
|
+
* title="Delete item?"
|
|
5463
|
+
* message="This action cannot be undone."
|
|
5464
|
+
* variant="danger"
|
|
5465
|
+
* confirmText="Delete"
|
|
5466
|
+
* />
|
|
5467
|
+
*/
|
|
5468
|
+
const ConfirmationModal = ({ isOpen, onClose, onConfirm, title, message, confirmText = 'Confirm', cancelText = 'Cancel', isLoading = false, variant = 'info', }) => {
|
|
5469
|
+
const handleConfirm = (e) => {
|
|
5470
|
+
if (!isLoading) {
|
|
5471
|
+
e.preventDefault();
|
|
5472
|
+
e.stopPropagation();
|
|
5473
|
+
onConfirm();
|
|
5474
|
+
}
|
|
5475
|
+
};
|
|
5476
|
+
return (jsx(AnimatePresence, { children: isOpen && (jsxs(Fragment, { children: [jsx(motion.div, { className: styles.overlay, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: !isLoading ? onClose : undefined }), jsx("div", { className: styles.positioner, children: jsxs(motion.div, { className: styles.modal, initial: { opacity: 0, scale: 0.9, y: 20 }, animate: { opacity: 1, scale: 1, y: 0 }, exit: { opacity: 0, scale: 0.9, y: 20 }, transition: { type: 'spring', stiffness: 300, damping: 30 }, children: [jsxs("div", { className: `${styles.header} ${styles[variant]}`, children: [jsx("h2", { className: styles.title, children: title }), !isLoading && (jsx("button", { className: styles.closeButton, onClick: onClose, type: "button", "aria-label": "Close", children: "\u2715" }))] }), jsx("div", { className: styles.content, children: jsx("p", { className: styles.message, children: message }) }), jsxs("div", { className: styles.footer, children: [jsx(Button, { type: "button", variant: "ghost", onClick: onClose, disabled: isLoading, children: cancelText }), jsx(Button, { type: "button", variant: variant === 'danger' ? 'danger' : 'primary', onClick: handleConfirm, disabled: isLoading, loading: isLoading, children: confirmText })] })] }) })] })) }));
|
|
5477
|
+
};
|
|
5478
|
+
|
|
5479
|
+
export { ArrayInput, BooleansHeatmap, Breadcrumb, Button, Calendar, Card, Checkbox, ConfirmationModal, DateInput, DecryptedText, EditFAB, EmptyState, ImageSlideshow, LiquidButton, LoadingSpinner, Modal, MoodChart, Navbar, NumberStepper, PieChart, QuantifiableHabitsChart, SearchBar, SearchableDropdown, SelectInput, SleepChart, Slider, SunburstChart, Table, Tabs, TextArea, TextInput, ThemeProvider, ThemeSwitcher, TimeInput, ToastContainer, Toggle, ToggleButton, soundManager, useComponentSound, useSound, useTheme, useThemeSafe };
|
|
5237
5480
|
//# sourceMappingURL=index.esm.js.map
|