@stfrigerio/sito-template 0.1.35 → 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/EmptyState/EmptyState.d.ts +53 -0
- package/dist/components/atoms/EmptyState/EmptyState.d.ts.map +1 -0
- package/dist/components/atoms/EmptyState/index.d.ts +3 -0
- package/dist/components/atoms/EmptyState/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/Modal/Modal.d.ts +61 -0
- package/dist/components/atoms/Modal/Modal.d.ts.map +1 -0
- package/dist/components/atoms/Modal/index.d.ts +3 -0
- package/dist/components/atoms/Modal/index.d.ts.map +1 -0
- 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 +6 -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 +813 -465
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +833 -477
- 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.js
CHANGED
|
@@ -1,57 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
4
|
var framerMotion = require('framer-motion');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var reactDom = require('react-dom');
|
|
6
7
|
var lucideReact = require('lucide-react');
|
|
7
8
|
var d3 = require('d3');
|
|
8
9
|
|
|
9
10
|
function _interopNamespaceDefault(e) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
var d3__namespace = /*#__PURE__*/_interopNamespaceDefault(d3);
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
const useTheme$1 = () => {
|
|
30
|
-
const context = React.useContext(ThemeContext$1);
|
|
31
|
-
if (!context) {
|
|
32
|
-
throw new Error('useTheme must be used within a ThemeProvider');
|
|
33
|
-
}
|
|
34
|
-
return context;
|
|
35
|
-
};
|
|
36
|
-
const ThemeProvider = ({ children, defaultTheme = 'light' }) => {
|
|
37
|
-
const [theme, setTheme] = React.useState(defaultTheme);
|
|
38
|
-
React.useEffect(() => {
|
|
39
|
-
const savedTheme = localStorage.getItem('theme');
|
|
40
|
-
if (savedTheme) {
|
|
41
|
-
setTheme(savedTheme);
|
|
42
|
-
}
|
|
43
|
-
}, []);
|
|
44
|
-
React.useEffect(() => {
|
|
45
|
-
document.documentElement.setAttribute('data-theme', theme);
|
|
46
|
-
localStorage.setItem('theme', theme);
|
|
47
|
-
}, [theme]);
|
|
48
|
-
const toggleTheme = () => {
|
|
49
|
-
setTheme(prevTheme => prevTheme === 'light' ? 'dark' : 'light');
|
|
50
|
-
};
|
|
51
|
-
return (jsxRuntime.jsx(ThemeContext$1.Provider, { value: { theme, toggleTheme, setTheme }, children: children }));
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var styles$s = {"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"};
|
|
29
|
+
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"};
|
|
55
30
|
|
|
56
31
|
const SOUND_PACKS = {
|
|
57
32
|
digital: {
|
|
@@ -616,11 +591,11 @@ function useComponentSound(config, options) {
|
|
|
616
591
|
const Button = ({ variant = 'primary', size = 'medium', fullWidth = false, loading = false, iconLeft, iconRight, children, className = '', disabled, motionProps, soundConfig, onClick, onMouseEnter, onFocus, ...rest }) => {
|
|
617
592
|
const { handlers } = useComponentSound(soundConfig);
|
|
618
593
|
const buttonClasses = [
|
|
619
|
-
styles$
|
|
620
|
-
styles$
|
|
621
|
-
styles$
|
|
622
|
-
fullWidth && styles$
|
|
623
|
-
loading && styles$
|
|
594
|
+
styles$z.button,
|
|
595
|
+
styles$z[variant],
|
|
596
|
+
styles$z[size],
|
|
597
|
+
fullWidth && styles$z.fullWidth,
|
|
598
|
+
loading && styles$z.loading,
|
|
624
599
|
className
|
|
625
600
|
].filter(Boolean).join(' ');
|
|
626
601
|
const handleClick = (e) => {
|
|
@@ -631,10 +606,10 @@ const Button = ({ variant = 'primary', size = 'medium', fullWidth = false, loadi
|
|
|
631
606
|
handlers.onMouseEnter?.();
|
|
632
607
|
onMouseEnter?.(e);
|
|
633
608
|
};
|
|
634
|
-
return (jsxRuntime.jsxs(framerMotion.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 && jsxRuntime.jsx("span", { className: styles$
|
|
609
|
+
return (jsxRuntime.jsxs(framerMotion.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 && jsxRuntime.jsx("span", { className: styles$z.spinner }), iconLeft && jsxRuntime.jsx("span", { className: styles$z.iconLeft, children: iconLeft }), children, iconRight && jsxRuntime.jsx("span", { className: styles$z.iconRight, children: iconRight })] }));
|
|
635
610
|
};
|
|
636
611
|
|
|
637
|
-
var styles$
|
|
612
|
+
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"};
|
|
638
613
|
|
|
639
614
|
/**
|
|
640
615
|
* Card Component
|
|
@@ -699,28 +674,132 @@ const Card = ({ variant = 'elevated', hoverable = false, clickable = false, padd
|
|
|
699
674
|
onExpandChange?.(newExpanded);
|
|
700
675
|
};
|
|
701
676
|
const cardClasses = [
|
|
702
|
-
styles$
|
|
703
|
-
styles$
|
|
704
|
-
hoverable && styles$
|
|
705
|
-
clickable && styles$
|
|
706
|
-
!padding && styles$
|
|
707
|
-
expandable && styles$
|
|
677
|
+
styles$y.card,
|
|
678
|
+
styles$y[variant],
|
|
679
|
+
hoverable && styles$y.hoverable,
|
|
680
|
+
clickable && styles$y.clickable,
|
|
681
|
+
!padding && styles$y.noPadding,
|
|
682
|
+
expandable && styles$y.expandable,
|
|
708
683
|
className
|
|
709
684
|
].filter(Boolean).join(' ');
|
|
710
685
|
const renderHeader = () => {
|
|
711
686
|
if (header) {
|
|
712
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
687
|
+
return (jsxRuntime.jsxs("div", { className: styles$y.header, children: [jsxRuntime.jsx("div", { className: styles$y.headerContent, children: header }), expandable && (jsxRuntime.jsx("button", { className: styles$y.expandButton, onClick: handleToggleExpand, "aria-label": isExpanded ? 'Collapse card' : 'Expand card', children: jsxRuntime.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: jsxRuntime.jsx("path", { d: "M6 9l6 6 6-6" }) }) }))] }));
|
|
713
688
|
}
|
|
714
689
|
if (title || subtitle) {
|
|
715
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
690
|
+
return (jsxRuntime.jsxs("div", { className: styles$y.header, children: [jsxRuntime.jsxs("div", { className: styles$y.headerContent, children: [title && jsxRuntime.jsx("h3", { className: styles$y.title, children: title }), subtitle && jsxRuntime.jsx("p", { className: styles$y.subtitle, children: subtitle })] }), expandable && (jsxRuntime.jsx("button", { className: styles$y.expandButton, onClick: handleToggleExpand, "aria-label": isExpanded ? 'Collapse card' : 'Expand card', children: jsxRuntime.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: jsxRuntime.jsx("path", { d: "M6 9l6 6 6-6" }) }) }))] }));
|
|
716
691
|
}
|
|
717
692
|
return null;
|
|
718
693
|
};
|
|
719
|
-
const cardContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [image && (jsxRuntime.jsx("div", { className: styles$
|
|
694
|
+
const cardContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [image && (jsxRuntime.jsx("div", { className: styles$y.imageContainer, children: jsxRuntime.jsx("img", { src: image, alt: imageAlt, className: styles$y.image }) })), renderHeader(), jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: false, children: (!expandable || isExpanded) && (jsxRuntime.jsxs(framerMotion.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 && (jsxRuntime.jsx("div", { className: padding ? styles$y.body : undefined, children: children })), footer && jsxRuntime.jsx("div", { className: styles$y.footer, children: footer })] }, "content")) })] }));
|
|
720
695
|
return (jsxRuntime.jsx(framerMotion.motion.div, { className: cardClasses, onClick: clickable ? onClick : undefined, whileHover: hoverable ? { y: -4 } : undefined, transition: { type: "spring", stiffness: 400, damping: 17 }, ...motionProps, ...rest, children: cardContent }));
|
|
721
696
|
};
|
|
722
697
|
|
|
723
|
-
var styles$
|
|
698
|
+
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"};
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* EmptyState Component
|
|
702
|
+
*
|
|
703
|
+
* @component
|
|
704
|
+
* @description
|
|
705
|
+
* A composable placeholder for empty lists, empty sidebars, and
|
|
706
|
+
* "nothing to show" panels. Renders an icon, optional title, message,
|
|
707
|
+
* and optional action CTA in a vertically-centered stack. Pure layout —
|
|
708
|
+
* no fetching, no state.
|
|
709
|
+
*
|
|
710
|
+
* @example
|
|
711
|
+
* // Minimal: just a message
|
|
712
|
+
* <EmptyState message="No documents yet." />
|
|
713
|
+
*
|
|
714
|
+
* @example
|
|
715
|
+
* // With an icon
|
|
716
|
+
* import { FileText } from 'lucide-react';
|
|
717
|
+
* <EmptyState
|
|
718
|
+
* icon={<FileText size={32} />}
|
|
719
|
+
* message="Select a document from the sidebar to start editing."
|
|
720
|
+
* />
|
|
721
|
+
*
|
|
722
|
+
* @example
|
|
723
|
+
* // Full: icon + title + message + action
|
|
724
|
+
* <EmptyState
|
|
725
|
+
* icon={<FolderKanban size={40} />}
|
|
726
|
+
* title="No projects"
|
|
727
|
+
* message="Create your first project to get started."
|
|
728
|
+
* action={<Button onClick={handleCreate}>New project</Button>}
|
|
729
|
+
* />
|
|
730
|
+
*
|
|
731
|
+
* @param {EmptyStateProps} props - The props for the EmptyState component
|
|
732
|
+
* @returns {JSX.Element} The rendered EmptyState component
|
|
733
|
+
*/
|
|
734
|
+
const EmptyState = ({ icon, title, message, action, size = 'default', }) => {
|
|
735
|
+
const wrapperClass = [styles$x.wrapper, styles$x[size]].filter(Boolean).join(' ');
|
|
736
|
+
return (jsxRuntime.jsxs("div", { className: wrapperClass, children: [icon && jsxRuntime.jsx("div", { className: styles$x.icon, children: icon }), title && jsxRuntime.jsx("h3", { className: styles$x.title, children: title }), jsxRuntime.jsx("p", { className: styles$x.message, children: message }), action && jsxRuntime.jsx("div", { className: styles$x.action, children: action })] }));
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
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"};
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Modal Component
|
|
743
|
+
*
|
|
744
|
+
* @component
|
|
745
|
+
* @description
|
|
746
|
+
* An accessible overlay dialog with a backdrop, title header, optional
|
|
747
|
+
* header actions, and a flexible body. Renders into a React portal on
|
|
748
|
+
* `document.body`, animates in/out with Framer Motion, closes on Escape
|
|
749
|
+
* key or backdrop click, and clicks inside the dialog don't propagate
|
|
750
|
+
* to the backdrop.
|
|
751
|
+
*
|
|
752
|
+
* @example
|
|
753
|
+
* // Basic usage
|
|
754
|
+
* <Modal open={isOpen} title="Confirm" onClose={() => setIsOpen(false)}>
|
|
755
|
+
* <p>Are you sure?</p>
|
|
756
|
+
* </Modal>
|
|
757
|
+
*
|
|
758
|
+
* @example
|
|
759
|
+
* // With header actions and wide size
|
|
760
|
+
* <Modal
|
|
761
|
+
* open={isOpen}
|
|
762
|
+
* title="Edit profile"
|
|
763
|
+
* size="wide"
|
|
764
|
+
* actions={<button onClick={save}>Save</button>}
|
|
765
|
+
* onClose={handleClose}
|
|
766
|
+
* >
|
|
767
|
+
* <ProfileForm />
|
|
768
|
+
* </Modal>
|
|
769
|
+
*
|
|
770
|
+
* @example
|
|
771
|
+
* // Flush body (no padding) for editors and full-bleed content
|
|
772
|
+
* <Modal open={isOpen} title="Document" padding={false} onClose={handleClose}>
|
|
773
|
+
* <DocEditor content={content} onSave={save} />
|
|
774
|
+
* </Modal>
|
|
775
|
+
*
|
|
776
|
+
* @param {ModalProps} props - The props for the Modal component
|
|
777
|
+
* @returns {React.ReactPortal | null} A portal rendering the modal, or null on the server
|
|
778
|
+
*/
|
|
779
|
+
const Modal = ({ open, title, onClose, children, size = 'default', actions, padding = true, }) => {
|
|
780
|
+
React.useEffect(() => {
|
|
781
|
+
if (!open)
|
|
782
|
+
return;
|
|
783
|
+
const onKey = (e) => {
|
|
784
|
+
if (e.key === 'Escape')
|
|
785
|
+
onClose();
|
|
786
|
+
};
|
|
787
|
+
document.addEventListener('keydown', onKey);
|
|
788
|
+
return () => document.removeEventListener('keydown', onKey);
|
|
789
|
+
}, [open, onClose]);
|
|
790
|
+
if (typeof document === 'undefined')
|
|
791
|
+
return null;
|
|
792
|
+
const dialogClass = [
|
|
793
|
+
styles$w.dialog,
|
|
794
|
+
size === 'compact' && styles$w.dialogCompact,
|
|
795
|
+
size === 'wide' && styles$w.dialogWide,
|
|
796
|
+
]
|
|
797
|
+
.filter(Boolean)
|
|
798
|
+
.join(' ');
|
|
799
|
+
return reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence, { children: open && (jsxRuntime.jsx(framerMotion.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: jsxRuntime.jsxs(framerMotion.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: [jsxRuntime.jsxs("div", { className: styles$w.header, children: [jsxRuntime.jsx("span", { className: styles$w.title, children: title }), actions && jsxRuntime.jsx("div", { className: styles$w.headerActions, children: actions }), jsxRuntime.jsx("button", { className: styles$w.closeButton, onClick: onClose, "aria-label": "Close modal", type: "button", children: jsxRuntime.jsx(lucideReact.X, { size: 16 }) })] }), jsxRuntime.jsx("div", { className: padding ? styles$w.body : styles$w.bodyFlush, children: children })] }) })) }), document.body);
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
var styles$v = {"checkboxLabel":"Checkbox-module_checkboxLabel__4tBVg","checkbox":"Checkbox-module_checkbox__BbJul","checkboxText":"Checkbox-module_checkboxText__oJsc9"};
|
|
724
803
|
|
|
725
804
|
/**
|
|
726
805
|
* Checkbox component - Modern interactive checkbox with animations
|
|
@@ -759,126 +838,20 @@ var styles$q = {"checkboxLabel":"Checkbox-module_checkboxLabel__4tBVg","checkbox
|
|
|
759
838
|
*/
|
|
760
839
|
const Checkbox = ({ checked, onChange, label, disabled = false, indeterminate = false, id, name, value, soundConfig }) => {
|
|
761
840
|
const checkboxRef = React.useRef(null);
|
|
762
|
-
const {
|
|
841
|
+
const { playSound } = useComponentSound(soundConfig);
|
|
763
842
|
React.useEffect(() => {
|
|
764
843
|
if (checkboxRef.current) {
|
|
765
844
|
checkboxRef.current.indeterminate = indeterminate;
|
|
766
845
|
}
|
|
767
846
|
}, [indeterminate]);
|
|
768
|
-
return (jsxRuntime.jsxs("label", { className: styles$
|
|
847
|
+
return (jsxRuntime.jsxs("label", { className: styles$v.checkboxLabel, children: [jsxRuntime.jsx("input", { ref: checkboxRef, type: "checkbox", checked: checked, onChange: (e) => {
|
|
769
848
|
const isChecked = e.target.checked;
|
|
770
849
|
onChange(isChecked);
|
|
771
850
|
if (soundConfig?.onClick !== false) {
|
|
772
851
|
playSound('toggle');
|
|
773
852
|
}
|
|
774
|
-
}, className: styles$
|
|
775
|
-
};
|
|
776
|
-
|
|
777
|
-
var DefaultContext = {
|
|
778
|
-
color: undefined,
|
|
779
|
-
size: undefined,
|
|
780
|
-
className: undefined,
|
|
781
|
-
style: undefined,
|
|
782
|
-
attr: undefined
|
|
853
|
+
}, className: styles$v.checkbox, disabled: disabled, id: id, name: name, value: value, "aria-checked": indeterminate ? 'mixed' : checked }), label && jsxRuntime.jsx("span", { className: styles$v.checkboxText, children: label })] }));
|
|
783
854
|
};
|
|
784
|
-
var IconContext = React.createContext && /*#__PURE__*/React.createContext(DefaultContext);
|
|
785
|
-
|
|
786
|
-
var _excluded = ["attr", "size", "title"];
|
|
787
|
-
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; }
|
|
788
|
-
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; }
|
|
789
|
-
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); }
|
|
790
|
-
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; }
|
|
791
|
-
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; }
|
|
792
|
-
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; }
|
|
793
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
794
|
-
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); }
|
|
795
|
-
function Tree2Element(tree) {
|
|
796
|
-
return tree && tree.map((node, i) => /*#__PURE__*/React.createElement(node.tag, _objectSpread({
|
|
797
|
-
key: i
|
|
798
|
-
}, node.attr), Tree2Element(node.child)));
|
|
799
|
-
}
|
|
800
|
-
function GenIcon(data) {
|
|
801
|
-
return props => /*#__PURE__*/React.createElement(IconBase, _extends({
|
|
802
|
-
attr: _objectSpread({}, data.attr)
|
|
803
|
-
}, props), Tree2Element(data.child));
|
|
804
|
-
}
|
|
805
|
-
function IconBase(props) {
|
|
806
|
-
var elem = conf => {
|
|
807
|
-
var {
|
|
808
|
-
attr,
|
|
809
|
-
size,
|
|
810
|
-
title
|
|
811
|
-
} = props,
|
|
812
|
-
svgProps = _objectWithoutProperties(props, _excluded);
|
|
813
|
-
var computedSize = size || conf.size || "1em";
|
|
814
|
-
var className;
|
|
815
|
-
if (conf.className) className = conf.className;
|
|
816
|
-
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
817
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
818
|
-
stroke: "currentColor",
|
|
819
|
-
fill: "currentColor",
|
|
820
|
-
strokeWidth: "0"
|
|
821
|
-
}, conf.attr, attr, svgProps, {
|
|
822
|
-
className: className,
|
|
823
|
-
style: _objectSpread(_objectSpread({
|
|
824
|
-
color: props.color || conf.color
|
|
825
|
-
}, conf.style), props.style),
|
|
826
|
-
height: computedSize,
|
|
827
|
-
width: computedSize,
|
|
828
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
829
|
-
}), title && /*#__PURE__*/React.createElement("title", null, title), props.children);
|
|
830
|
-
};
|
|
831
|
-
return IconContext !== undefined ? /*#__PURE__*/React.createElement(IconContext.Consumer, null, conf => elem(conf)) : elem(DefaultContext);
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
// THIS FILE IS AUTO GENERATED
|
|
835
|
-
function FiBook (props) {
|
|
836
|
-
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);
|
|
837
|
-
}function FiCalendar (props) {
|
|
838
|
-
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);
|
|
839
|
-
}function FiCheck (props) {
|
|
840
|
-
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);
|
|
841
|
-
}function FiChevronDown (props) {
|
|
842
|
-
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);
|
|
843
|
-
}function FiChevronLeft (props) {
|
|
844
|
-
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);
|
|
845
|
-
}function FiChevronRight (props) {
|
|
846
|
-
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);
|
|
847
|
-
}function FiClock (props) {
|
|
848
|
-
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);
|
|
849
|
-
}function FiDownload (props) {
|
|
850
|
-
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);
|
|
851
|
-
}function FiFolder (props) {
|
|
852
|
-
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);
|
|
853
|
-
}function FiGithub (props) {
|
|
854
|
-
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);
|
|
855
|
-
}function FiInfo (props) {
|
|
856
|
-
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);
|
|
857
|
-
}function FiMaximize (props) {
|
|
858
|
-
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);
|
|
859
|
-
}function FiMenu (props) {
|
|
860
|
-
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);
|
|
861
|
-
}function FiMessageSquare (props) {
|
|
862
|
-
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);
|
|
863
|
-
}function FiMoon (props) {
|
|
864
|
-
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);
|
|
865
|
-
}function FiPause (props) {
|
|
866
|
-
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);
|
|
867
|
-
}function FiPlay (props) {
|
|
868
|
-
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);
|
|
869
|
-
}function FiSearch (props) {
|
|
870
|
-
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);
|
|
871
|
-
}function FiShare2 (props) {
|
|
872
|
-
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);
|
|
873
|
-
}function FiSun (props) {
|
|
874
|
-
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);
|
|
875
|
-
}function FiUserPlus (props) {
|
|
876
|
-
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);
|
|
877
|
-
}function FiUsers (props) {
|
|
878
|
-
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);
|
|
879
|
-
}function FiX (props) {
|
|
880
|
-
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);
|
|
881
|
-
}
|
|
882
855
|
|
|
883
856
|
const formatDateToEuropean = (date) => {
|
|
884
857
|
if (!date)
|
|
@@ -908,7 +881,7 @@ const parseEuropeanDate = (dateString) => {
|
|
|
908
881
|
return '';
|
|
909
882
|
};
|
|
910
883
|
|
|
911
|
-
var styles$
|
|
884
|
+
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"};
|
|
912
885
|
|
|
913
886
|
/**
|
|
914
887
|
* DateInput component - European format date picker with manual input support
|
|
@@ -997,19 +970,19 @@ function DateInput({ label, value, onChange, placeholder = "25/12/2024", onFocus
|
|
|
997
970
|
}
|
|
998
971
|
};
|
|
999
972
|
const getClassName = () => {
|
|
1000
|
-
const classes = [styles$
|
|
973
|
+
const classes = [styles$u.dateInput];
|
|
1001
974
|
if (error)
|
|
1002
|
-
classes.push(styles$
|
|
975
|
+
classes.push(styles$u.error);
|
|
1003
976
|
if (success)
|
|
1004
|
-
classes.push(styles$
|
|
977
|
+
classes.push(styles$u.success);
|
|
1005
978
|
if (loading)
|
|
1006
|
-
classes.push(styles$
|
|
979
|
+
classes.push(styles$u.loading);
|
|
1007
980
|
return classes.join(' ');
|
|
1008
981
|
};
|
|
1009
|
-
return (jsxRuntime.jsxs("div", { className: getClassName(), children: [jsxRuntime.jsx("label", { className: styles$
|
|
982
|
+
return (jsxRuntime.jsxs("div", { className: getClassName(), children: [jsxRuntime.jsx("label", { className: styles$u.label, children: label }), jsxRuntime.jsxs("div", { className: styles$u.inputWrapper, children: [jsxRuntime.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 }), jsxRuntime.jsx("button", { type: "button", onClick: handleCalendarClick, className: styles$u.calendarButton, title: "Select date from calendar", disabled: disabled || loading, children: jsxRuntime.jsx(lucideReact.Calendar, {}) }), jsxRuntime.jsx("input", { ref: hiddenDateInputRef, type: "date", onChange: handleCalendarChange, className: styles$u.hiddenDateInput, tabIndex: -1, disabled: disabled || loading })] })] }));
|
|
1010
983
|
}
|
|
1011
984
|
|
|
1012
|
-
var styles$
|
|
985
|
+
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"};
|
|
1013
986
|
|
|
1014
987
|
/**
|
|
1015
988
|
* SearchableDropdown component - Modern filterable dropdown with animations
|
|
@@ -1114,23 +1087,23 @@ function SearchableDropdown({ label, value, onChange, options, placeholder = "Se
|
|
|
1114
1087
|
}
|
|
1115
1088
|
};
|
|
1116
1089
|
const getTriggerClassName = () => {
|
|
1117
|
-
const classes = [styles$
|
|
1090
|
+
const classes = [styles$t.dropdownTrigger];
|
|
1118
1091
|
if (isOpen)
|
|
1119
|
-
classes.push(styles$
|
|
1092
|
+
classes.push(styles$t.open);
|
|
1120
1093
|
if (loading)
|
|
1121
|
-
classes.push(styles$
|
|
1094
|
+
classes.push(styles$t.loading);
|
|
1122
1095
|
if (error)
|
|
1123
|
-
classes.push(styles$
|
|
1096
|
+
classes.push(styles$t.error);
|
|
1124
1097
|
return classes.join(' ');
|
|
1125
1098
|
};
|
|
1126
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
1099
|
+
return (jsxRuntime.jsxs("div", { className: styles$t.searchableDropdown, ref: dropdownRef, onKeyDown: handleKeyDown, children: [jsxRuntime.jsx("label", { children: label }), jsxRuntime.jsxs(framerMotion.motion.button, { type: "button", className: getTriggerClassName(), onClick: () => !disabled && !loading && setIsOpen(!isOpen), whileTap: { scale: disabled ? 1 : 0.98 }, style: { willChange: 'transform' }, disabled: disabled, children: [jsxRuntime.jsx("span", { className: `${styles$t.dropdownValue} ${!displayValue ? styles$t.placeholder : ''}`, children: displayValue || placeholder }), jsxRuntime.jsx(lucideReact.ChevronDown, { className: styles$t.dropdownArrow })] }), jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen && (jsxRuntime.jsxs(framerMotion.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: [jsxRuntime.jsxs("div", { className: styles$t.dropdownSearch, children: [jsxRuntime.jsx(lucideReact.Search, { className: styles$t.searchIcon }), jsxRuntime.jsx("input", { ref: inputRef, type: "text", className: styles$t.searchInput, placeholder: "Cerca...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), onClick: (e) => e.stopPropagation() })] }), jsxRuntime.jsxs("div", { className: styles$t.dropdownOptions, children: [allOptions.map((opt, index) => {
|
|
1127
1100
|
const isSelected = value === opt.value;
|
|
1128
1101
|
const isHighlighted = highlightedIndex === index;
|
|
1129
|
-
return (jsxRuntime.jsxs(framerMotion.motion.button, { type: "button", className: `${styles$
|
|
1130
|
-
}), allOptions.length === 0 && (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$
|
|
1102
|
+
return (jsxRuntime.jsxs(framerMotion.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: [jsxRuntime.jsx("span", { children: opt.label }), isSelected && jsxRuntime.jsx(lucideReact.Check, { className: styles$t.checkIcon })] }, `${opt.value}-${index}`));
|
|
1103
|
+
}), allOptions.length === 0 && (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$t.dropdownNoResults, initial: { opacity: 0 }, animate: { opacity: 1 }, children: "No results found" }))] })] })) })] }));
|
|
1131
1104
|
}
|
|
1132
1105
|
|
|
1133
|
-
var styles$
|
|
1106
|
+
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"};
|
|
1134
1107
|
|
|
1135
1108
|
/**
|
|
1136
1109
|
* SelectInput component - Styled dropdown selector with flexible option format
|
|
@@ -1165,29 +1138,29 @@ var styles$n = {"selectInput":"SelectInput-module_selectInput__s6zEg","selectWra
|
|
|
1165
1138
|
* ]}
|
|
1166
1139
|
* />
|
|
1167
1140
|
*/
|
|
1168
|
-
function SelectInput({ label, value, onChange, options, placeholder = "Select...", disabled = false, error = false, success = false, loading = false, required = false, soundConfig }) {
|
|
1141
|
+
function SelectInput({ label, value, onChange, options, placeholder = "Select...", disabled = false, error = false, success = false, loading = false, required = false, soundConfig, className }) {
|
|
1169
1142
|
const { handlers, playSound } = useComponentSound(soundConfig);
|
|
1170
1143
|
const getClassName = () => {
|
|
1171
|
-
const classes = [styles$
|
|
1144
|
+
const classes = [styles$s.selectInput];
|
|
1172
1145
|
if (error)
|
|
1173
|
-
classes.push(styles$
|
|
1146
|
+
classes.push(styles$s.error);
|
|
1174
1147
|
if (success)
|
|
1175
|
-
classes.push(styles$
|
|
1148
|
+
classes.push(styles$s.success);
|
|
1176
1149
|
if (loading)
|
|
1177
|
-
classes.push(styles$
|
|
1150
|
+
classes.push(styles$s.loading);
|
|
1178
1151
|
return classes.join(' ');
|
|
1179
1152
|
};
|
|
1180
|
-
return (jsxRuntime.jsxs("div", { className: getClassName()
|
|
1153
|
+
return (jsxRuntime.jsxs("div", { className: `${getClassName()}${className ? ` ${className}` : ''}`, children: [jsxRuntime.jsxs("label", { children: [label, required && jsxRuntime.jsx("span", { style: { color: 'var(--color-error)' }, children: " *" })] }), jsxRuntime.jsxs("div", { className: styles$s.selectWrapper, children: [jsxRuntime.jsxs("select", { value: value, onChange: e => {
|
|
1181
1154
|
playSound('click');
|
|
1182
1155
|
onChange(e.target.value);
|
|
1183
1156
|
}, disabled: disabled || loading, required: required, ...handlers, children: [jsxRuntime.jsx("option", { value: "", children: placeholder }), options.map(opt => {
|
|
1184
1157
|
const optionValue = typeof opt === 'string' ? opt : opt.value;
|
|
1185
1158
|
const optionLabel = typeof opt === 'string' ? opt : opt.label;
|
|
1186
1159
|
return (jsxRuntime.jsx("option", { value: optionValue, children: optionLabel }, optionValue));
|
|
1187
|
-
})] }), jsxRuntime.jsx(
|
|
1160
|
+
})] }), jsxRuntime.jsx(lucideReact.ChevronDown, { className: styles$s.selectIcon })] })] }));
|
|
1188
1161
|
}
|
|
1189
1162
|
|
|
1190
|
-
var styles$
|
|
1163
|
+
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-"};
|
|
1191
1164
|
|
|
1192
1165
|
/**
|
|
1193
1166
|
* TextArea component - Multi-line text input with character counting
|
|
@@ -1222,38 +1195,38 @@ var styles$m = {"textareaContainer":"TextArea-module_textareaContainer__AquFj","
|
|
|
1222
1195
|
function TextArea({ label, value, onChange, rows = 5, placeholder = "", required = false, maxLength, disabled = false, error = false, success = false, loading = false, focusMode = false, compact = false, className = "" }) {
|
|
1223
1196
|
const textareaId = `textarea-${Math.random().toString(36).substr(2, 9)}`;
|
|
1224
1197
|
const getContainerClassName = () => {
|
|
1225
|
-
const classes = [styles$
|
|
1198
|
+
const classes = [styles$r.textareaContainer];
|
|
1226
1199
|
if (error)
|
|
1227
|
-
classes.push(styles$
|
|
1200
|
+
classes.push(styles$r.error);
|
|
1228
1201
|
if (success)
|
|
1229
|
-
classes.push(styles$
|
|
1202
|
+
classes.push(styles$r.success);
|
|
1230
1203
|
if (loading)
|
|
1231
|
-
classes.push(styles$
|
|
1204
|
+
classes.push(styles$r.loading);
|
|
1232
1205
|
if (focusMode)
|
|
1233
|
-
classes.push(styles$
|
|
1206
|
+
classes.push(styles$r.focusMode);
|
|
1234
1207
|
if (compact)
|
|
1235
|
-
classes.push(styles$
|
|
1208
|
+
classes.push(styles$r.compact);
|
|
1236
1209
|
if (className)
|
|
1237
1210
|
classes.push(className);
|
|
1238
1211
|
return classes.join(' ');
|
|
1239
1212
|
};
|
|
1240
1213
|
const getCharCountClassName = () => {
|
|
1241
1214
|
if (!maxLength)
|
|
1242
|
-
return styles$
|
|
1243
|
-
const classes = [styles$
|
|
1215
|
+
return styles$r.characterCount;
|
|
1216
|
+
const classes = [styles$r.characterCount];
|
|
1244
1217
|
const percentage = (value.length / maxLength) * 100;
|
|
1245
1218
|
if (percentage >= 100) {
|
|
1246
|
-
classes.push(styles$
|
|
1219
|
+
classes.push(styles$r.atLimit);
|
|
1247
1220
|
}
|
|
1248
1221
|
else if (percentage >= 80) {
|
|
1249
|
-
classes.push(styles$
|
|
1222
|
+
classes.push(styles$r.nearLimit);
|
|
1250
1223
|
}
|
|
1251
1224
|
return classes.join(' ');
|
|
1252
1225
|
};
|
|
1253
|
-
return (jsxRuntime.jsxs("div", { className: getContainerClassName(), children: [label && (jsxRuntime.jsxs("label", { htmlFor: textareaId, className: styles$
|
|
1226
|
+
return (jsxRuntime.jsxs("div", { className: getContainerClassName(), children: [label && (jsxRuntime.jsxs("label", { htmlFor: textareaId, className: styles$r.textareaLabel, children: [label, required && jsxRuntime.jsx("span", { className: styles$r.requiredIndicator, children: "*" })] })), jsxRuntime.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 && (jsxRuntime.jsxs("div", { className: getCharCountClassName(), children: [jsxRuntime.jsx("span", { children: value.length }), jsxRuntime.jsx("span", { style: { opacity: 0.7 }, children: " / " }), jsxRuntime.jsx("span", { children: maxLength })] }))] }));
|
|
1254
1227
|
}
|
|
1255
1228
|
|
|
1256
|
-
var styles$
|
|
1229
|
+
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"};
|
|
1257
1230
|
|
|
1258
1231
|
/**
|
|
1259
1232
|
* TextInput component - A versatile text input field with label and error handling
|
|
@@ -1290,21 +1263,21 @@ function TextInput({ label, value, onChange, type = "text", onBlur, placeholder,
|
|
|
1290
1263
|
const { handlers, playSound } = useComponentSound(soundConfig);
|
|
1291
1264
|
const prevValueRef = React.useRef(value);
|
|
1292
1265
|
const getContainerClassName = () => {
|
|
1293
|
-
const classes = [styles$
|
|
1266
|
+
const classes = [styles$q.textInput];
|
|
1294
1267
|
if (success)
|
|
1295
|
-
classes.push(styles$
|
|
1268
|
+
classes.push(styles$q.success);
|
|
1296
1269
|
if (loading)
|
|
1297
|
-
classes.push(styles$
|
|
1270
|
+
classes.push(styles$q.loading);
|
|
1298
1271
|
if (icon)
|
|
1299
|
-
classes.push(styles$
|
|
1272
|
+
classes.push(styles$q.withIcon);
|
|
1300
1273
|
if (actionButton)
|
|
1301
|
-
classes.push(styles$
|
|
1274
|
+
classes.push(styles$q.withAction);
|
|
1302
1275
|
return classes.join(' ');
|
|
1303
1276
|
};
|
|
1304
1277
|
React.useEffect(() => {
|
|
1305
1278
|
prevValueRef.current = value;
|
|
1306
1279
|
}, [value]);
|
|
1307
|
-
return (jsxRuntime.jsxs("div", { className: getContainerClassName(), children: [jsxRuntime.jsxs("label", { htmlFor: inputId, children: [label, required && jsxRuntime.jsx("span", { className: styles$
|
|
1280
|
+
return (jsxRuntime.jsxs("div", { className: getContainerClassName(), children: [jsxRuntime.jsxs("label", { htmlFor: inputId, children: [label, required && jsxRuntime.jsx("span", { className: styles$q.required, children: "*" })] }), jsxRuntime.jsxs("div", { style: { position: 'relative' }, children: [icon && jsxRuntime.jsx("div", { className: styles$q.inputIcon, children: icon }), jsxRuntime.jsx("input", { id: inputId, type: type, value: value, onChange: (e) => {
|
|
1308
1281
|
const newValue = e.target.value;
|
|
1309
1282
|
const oldValue = prevValueRef.current;
|
|
1310
1283
|
onChange(newValue);
|
|
@@ -1320,13 +1293,13 @@ function TextInput({ label, value, onChange, type = "text", onBlur, placeholder,
|
|
|
1320
1293
|
if (error && soundConfig?.onError) {
|
|
1321
1294
|
playSound(typeof soundConfig.onError === 'string' ? soundConfig.onError : 'error');
|
|
1322
1295
|
}
|
|
1323
|
-
}, onBlur: onBlur, placeholder: placeholder, className: error ? styles$
|
|
1296
|
+
}, 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 && (jsxRuntime.jsx("button", { type: "button", className: styles$q.actionButton, onClick: () => {
|
|
1324
1297
|
handlers.onClick?.();
|
|
1325
1298
|
actionButton.onClick();
|
|
1326
|
-
}, disabled: disabled || loading, children: actionButton.label }))] }), error && (jsxRuntime.jsx("span", { id: `${inputId}-error`, className: styles$
|
|
1299
|
+
}, disabled: disabled || loading, children: actionButton.label }))] }), error && (jsxRuntime.jsx("span", { id: `${inputId}-error`, className: styles$q.errorMessage, children: error }))] }));
|
|
1327
1300
|
}
|
|
1328
1301
|
|
|
1329
|
-
var styles$
|
|
1302
|
+
var styles$p = {"toggleContainer":"Toggle-module_toggleContainer__QxqQb","toggleButton":"Toggle-module_toggleButton__WUUf-","active":"Toggle-module_active__fX6Io"};
|
|
1330
1303
|
|
|
1331
1304
|
/**
|
|
1332
1305
|
* Toggle Component
|
|
@@ -1344,7 +1317,7 @@ var styles$k = {"toggleContainer":"Toggle-module_toggleContainer__QxqQb","toggle
|
|
|
1344
1317
|
* onToggle={setDarkMode}
|
|
1345
1318
|
* leftLabel="Light"
|
|
1346
1319
|
* rightLabel="Dark"
|
|
1347
|
-
* soundTheme="
|
|
1320
|
+
* soundTheme="digital"
|
|
1348
1321
|
* enableCelebration={true}
|
|
1349
1322
|
* />
|
|
1350
1323
|
*
|
|
@@ -1372,14 +1345,14 @@ var styles$k = {"toggleContainer":"Toggle-module_toggleContainer__QxqQb","toggle
|
|
|
1372
1345
|
* @returns {JSX.Element} The rendered Toggle component
|
|
1373
1346
|
*/
|
|
1374
1347
|
function Toggle(props) {
|
|
1375
|
-
const { isOn, onToggle, leftLabel, rightLabel, leftIcon, rightIcon, className, style, soundConfig,
|
|
1348
|
+
const { isOn, onToggle, leftLabel, rightLabel, leftIcon, rightIcon, className, style, soundConfig, enableCelebration = false } = props;
|
|
1376
1349
|
const leftButtonRef = React.useRef(null);
|
|
1377
1350
|
const rightButtonRef = React.useRef(null);
|
|
1378
|
-
const { handlers, playSound
|
|
1351
|
+
const { handlers, playSound } = useComponentSound({
|
|
1379
1352
|
...soundConfig,
|
|
1380
|
-
|
|
1353
|
+
onClick: soundConfig?.onClick ?? 'toggle',
|
|
1381
1354
|
onHover: soundConfig?.onHover ?? 'hover'
|
|
1382
|
-
}
|
|
1355
|
+
});
|
|
1383
1356
|
// Ensure content stays centered by merging styles
|
|
1384
1357
|
const buttonStyle = {
|
|
1385
1358
|
display: 'flex',
|
|
@@ -1387,42 +1360,40 @@ function Toggle(props) {
|
|
|
1387
1360
|
justifyContent: 'center',
|
|
1388
1361
|
...style
|
|
1389
1362
|
};
|
|
1390
|
-
return (jsxRuntime.jsxs("div", { className: `${styles$
|
|
1391
|
-
const element = leftButtonRef.current;
|
|
1363
|
+
return (jsxRuntime.jsxs("div", { className: `${styles$p.toggleContainer} ${className || ''}`, children: [jsxRuntime.jsxs(framerMotion.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: () => {
|
|
1392
1364
|
if (!isOn) {
|
|
1393
|
-
// Already on left
|
|
1365
|
+
// Already on left
|
|
1394
1366
|
if (enableCelebration) {
|
|
1395
|
-
|
|
1367
|
+
playSound('success');
|
|
1396
1368
|
}
|
|
1397
1369
|
else {
|
|
1398
|
-
playSound('
|
|
1370
|
+
playSound('click');
|
|
1399
1371
|
}
|
|
1400
1372
|
}
|
|
1401
1373
|
else {
|
|
1402
1374
|
// Switching to left
|
|
1403
|
-
playSound('toggle'
|
|
1375
|
+
playSound('toggle');
|
|
1404
1376
|
}
|
|
1405
1377
|
onToggle(false);
|
|
1406
|
-
}, onMouseEnter: () => handlers.onMouseEnter?.(
|
|
1407
|
-
const element = rightButtonRef.current;
|
|
1378
|
+
}, onMouseEnter: () => handlers.onMouseEnter?.(), style: buttonStyle, children: [jsxRuntime.jsx(framerMotion.motion.div, { animate: { scale: !isOn ? 1.1 : 1, rotate: !isOn ? [0, -5, 5, 0] : 0 }, transition: { duration: 0.3 }, children: leftIcon }), leftLabel] }), jsxRuntime.jsxs(framerMotion.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: () => {
|
|
1408
1379
|
if (isOn) {
|
|
1409
|
-
// Already on right
|
|
1380
|
+
// Already on right
|
|
1410
1381
|
if (enableCelebration) {
|
|
1411
|
-
|
|
1382
|
+
playSound('success');
|
|
1412
1383
|
}
|
|
1413
1384
|
else {
|
|
1414
|
-
playSound('
|
|
1385
|
+
playSound('click');
|
|
1415
1386
|
}
|
|
1416
1387
|
}
|
|
1417
1388
|
else {
|
|
1418
|
-
// Switching to right
|
|
1419
|
-
playSound('success'
|
|
1389
|
+
// Switching to right
|
|
1390
|
+
playSound('success');
|
|
1420
1391
|
}
|
|
1421
1392
|
onToggle(true);
|
|
1422
|
-
}, onMouseEnter: () => handlers.onMouseEnter?.(
|
|
1393
|
+
}, onMouseEnter: () => handlers.onMouseEnter?.(), style: buttonStyle, children: [jsxRuntime.jsx(framerMotion.motion.div, { animate: { scale: isOn ? 1.1 : 1, rotate: isOn ? [0, 5, -5, 0] : 0 }, transition: { duration: 0.3 }, children: rightIcon }), rightLabel] })] }));
|
|
1423
1394
|
}
|
|
1424
1395
|
|
|
1425
|
-
var styles$
|
|
1396
|
+
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"};
|
|
1426
1397
|
|
|
1427
1398
|
/**
|
|
1428
1399
|
* NumberStepper Component
|
|
@@ -1559,16 +1530,18 @@ const NumberStepper = ({ value, onChange, min = -Infinity, max = Infinity, step
|
|
|
1559
1530
|
e.preventDefault();
|
|
1560
1531
|
handleDecrement();
|
|
1561
1532
|
break;
|
|
1562
|
-
case 'PageUp':
|
|
1533
|
+
case 'PageUp': {
|
|
1563
1534
|
e.preventDefault();
|
|
1564
1535
|
const bigIncrease = Math.min(value + (step * 10), max);
|
|
1565
1536
|
onChange(bigIncrease);
|
|
1566
1537
|
break;
|
|
1567
|
-
|
|
1538
|
+
}
|
|
1539
|
+
case 'PageDown': {
|
|
1568
1540
|
e.preventDefault();
|
|
1569
1541
|
const bigDecrease = Math.max(value - (step * 10), min);
|
|
1570
1542
|
onChange(bigDecrease);
|
|
1571
1543
|
break;
|
|
1544
|
+
}
|
|
1572
1545
|
case 'Home':
|
|
1573
1546
|
e.preventDefault();
|
|
1574
1547
|
if (min !== -Infinity)
|
|
@@ -1607,32 +1580,32 @@ const NumberStepper = ({ value, onChange, min = -Infinity, max = Infinity, step
|
|
|
1607
1580
|
setDisplayValue(finalValue);
|
|
1608
1581
|
}, [displayValue, min, max, step, onChange]);
|
|
1609
1582
|
const containerClasses = [
|
|
1610
|
-
styles$
|
|
1611
|
-
styles$
|
|
1612
|
-
styles$
|
|
1613
|
-
layout === 'vertical' && styles$
|
|
1614
|
-
disabled && styles$
|
|
1583
|
+
styles$o.container,
|
|
1584
|
+
styles$o[size],
|
|
1585
|
+
styles$o[variant],
|
|
1586
|
+
layout === 'vertical' && styles$o.vertical,
|
|
1587
|
+
disabled && styles$o.disabled,
|
|
1615
1588
|
className
|
|
1616
1589
|
].filter(Boolean).join(' ');
|
|
1617
1590
|
// Merge custom styles with hover states
|
|
1618
1591
|
const [isButtonHovered, setIsButtonHovered] = React.useState(null);
|
|
1619
1592
|
const isDecrementDisabled = disabled || value <= min;
|
|
1620
1593
|
const isIncrementDisabled = disabled || value >= max;
|
|
1621
|
-
const stepperContent = (jsxRuntime.jsxs("div", { className: styles$
|
|
1594
|
+
const stepperContent = (jsxRuntime.jsxs("div", { className: styles$o.stepper, style: customStyles.stepper, onKeyDown: handleKeyDown, tabIndex: disabled ? -1 : 0, ...handlers, children: [jsxRuntime.jsx(framerMotion.motion.button, { className: styles$o.button, style: {
|
|
1622
1595
|
...customStyles.button,
|
|
1623
1596
|
...(isButtonHovered === 'decrement' && customStyles.buttonHover)
|
|
1624
|
-
}, 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 ? (jsxRuntime.jsx("span", { className: styles$
|
|
1597
|
+
}, 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 ? (jsxRuntime.jsx("span", { className: styles$o.buttonIcon, style: customStyles.buttonIcon, children: "\u2212" })) : (jsxRuntime.jsx("svg", { className: styles$o.buttonIcon, style: customStyles.buttonIcon, viewBox: "0 0 24 24", fill: "none", children: jsxRuntime.jsx("path", { d: "M15 18L9 12L15 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }))) }), jsxRuntime.jsx("div", { className: styles$o.valueContainer, style: customStyles.valueContainer, children: jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: jsxRuntime.jsx(framerMotion.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: jsxRuntime.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) }) }), jsxRuntime.jsx(framerMotion.motion.button, { className: styles$o.button, style: {
|
|
1625
1598
|
...customStyles.button,
|
|
1626
1599
|
...(isButtonHovered === 'increment' && customStyles.buttonHover)
|
|
1627
|
-
}, 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 ? (jsxRuntime.jsx("span", { className: styles$
|
|
1600
|
+
}, 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 ? (jsxRuntime.jsx("span", { className: styles$o.buttonIcon, style: customStyles.buttonIcon, children: "+" })) : (jsxRuntime.jsx("svg", { className: styles$o.buttonIcon, style: customStyles.buttonIcon, viewBox: "0 0 24 24", fill: "none", children: jsxRuntime.jsx("path", { d: "M9 18L15 12L9 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }))) })] }));
|
|
1628
1601
|
// For custom variant with horizontal layout, render differently
|
|
1629
1602
|
if (variant === 'custom' && (label || icon)) {
|
|
1630
|
-
return (jsxRuntime.jsxs("div", { className: containerClasses, style: { ...customStyles.container, display: 'flex', alignItems: 'center' }, children: [jsxRuntime.jsxs("div", { className: styles$
|
|
1603
|
+
return (jsxRuntime.jsxs("div", { className: containerClasses, style: { ...customStyles.container, display: 'flex', alignItems: 'center' }, children: [jsxRuntime.jsxs("div", { className: styles$o.header, style: { ...customStyles.header, flex: 1, marginBottom: 0 }, children: [icon && jsxRuntime.jsx("span", { className: styles$o.icon, style: customStyles.icon, children: icon }), label && jsxRuntime.jsx("label", { className: styles$o.label, style: customStyles.label, children: label })] }), stepperContent, !hideLimits && (min !== -Infinity || max !== Infinity) && (jsxRuntime.jsxs("div", { className: styles$o.limits, style: customStyles.limits, children: [jsxRuntime.jsx("span", { className: styles$o.limit, children: min !== -Infinity && `Min: ${min}` }), jsxRuntime.jsx("span", { className: styles$o.limit, children: max !== Infinity && `Max: ${max}` })] }))] }));
|
|
1631
1604
|
}
|
|
1632
|
-
return (jsxRuntime.jsxs("div", { className: containerClasses, style: customStyles.container, children: [(label || icon) && (jsxRuntime.jsxs("div", { className: styles$
|
|
1605
|
+
return (jsxRuntime.jsxs("div", { className: containerClasses, style: customStyles.container, children: [(label || icon) && (jsxRuntime.jsxs("div", { className: styles$o.header, style: customStyles.header, children: [icon && jsxRuntime.jsx("span", { className: styles$o.icon, style: customStyles.icon, children: icon }), label && jsxRuntime.jsx("label", { className: styles$o.label, style: customStyles.label, children: label })] })), stepperContent, !hideLimits && (min !== -Infinity || max !== Infinity) && (jsxRuntime.jsxs("div", { className: styles$o.limits, style: customStyles.limits, children: [jsxRuntime.jsx("span", { className: styles$o.limit, children: min !== -Infinity && `Min: ${min}` }), jsxRuntime.jsx("span", { className: styles$o.limit, children: max !== Infinity && `Max: ${max}` })] }))] }));
|
|
1633
1606
|
};
|
|
1634
1607
|
|
|
1635
|
-
var styles$
|
|
1608
|
+
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"};
|
|
1636
1609
|
|
|
1637
1610
|
/**
|
|
1638
1611
|
* ToggleButton Component
|
|
@@ -1671,18 +1644,18 @@ var styles$i = {"button":"ToggleButton-module_button__DTuyY","background":"Toggl
|
|
|
1671
1644
|
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 }) => {
|
|
1672
1645
|
const { handlers, playSound } = useComponentSound(soundConfig);
|
|
1673
1646
|
const buttonClasses = [
|
|
1674
|
-
styles$
|
|
1675
|
-
styles$
|
|
1676
|
-
styles$
|
|
1677
|
-
active && styles$
|
|
1678
|
-
active && styles$
|
|
1679
|
-
disabled && styles$
|
|
1680
|
-
animation !== 'none' && styles$
|
|
1647
|
+
styles$n.button,
|
|
1648
|
+
styles$n[size],
|
|
1649
|
+
styles$n[variant],
|
|
1650
|
+
active && styles$n.active,
|
|
1651
|
+
active && styles$n[`active-${activeColor}`],
|
|
1652
|
+
disabled && styles$n.disabled,
|
|
1653
|
+
animation !== 'none' && styles$n[`animation-${animation}`],
|
|
1681
1654
|
className
|
|
1682
1655
|
].filter(Boolean).join(' ');
|
|
1683
1656
|
const labelClasses = [
|
|
1684
|
-
styles$
|
|
1685
|
-
hideLabelOnMobile && styles$
|
|
1657
|
+
styles$n.label,
|
|
1658
|
+
hideLabelOnMobile && styles$n.hideMobile
|
|
1686
1659
|
].filter(Boolean).join(' ');
|
|
1687
1660
|
const iconVariants = {
|
|
1688
1661
|
scale: {
|
|
@@ -1746,10 +1719,10 @@ const ToggleButton = ({ active, onClick, icon, label, disabled = false, size = '
|
|
|
1746
1719
|
return (jsxRuntime.jsxs(framerMotion.motion.button, { className: buttonClasses, style: dynamicStyle, onClick: () => {
|
|
1747
1720
|
playSound('toggle');
|
|
1748
1721
|
onClick();
|
|
1749
|
-
}, disabled: disabled, whileHover: !disabled ? { scale: 1.05 } : undefined, whileTap: !disabled ? { scale: 0.95 } : undefined, title: tooltip, "aria-pressed": active, "aria-label": label, ...handlers, children: [jsxRuntime.jsx(framerMotion.motion.div, { className: styles$
|
|
1722
|
+
}, disabled: disabled, whileHover: !disabled ? { scale: 1.05 } : undefined, whileTap: !disabled ? { scale: 0.95 } : undefined, title: tooltip, "aria-pressed": active, "aria-label": label, ...handlers, children: [jsxRuntime.jsx(framerMotion.motion.div, { className: styles$n.background, variants: backgroundVariants, initial: "inactive", animate: active ? "active" : "inactive" }), jsxRuntime.jsxs("div", { className: styles$n.content, children: [icon && (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$n.iconWrapper, variants: iconVariants[animation], initial: "inactive", animate: active ? "active" : "inactive", transition: { duration: 0.3 }, children: typeof icon === 'string' ? (jsxRuntime.jsx("span", { className: styles$n.icon, children: icon })) : (jsxRuntime.jsx("div", { className: styles$n.icon, children: icon })) })), label && jsxRuntime.jsx("span", { className: labelClasses, children: label }), jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showCheckmark && active && (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$n.checkmark, variants: checkmarkVariants, initial: "hidden", animate: "visible", exit: "hidden", children: jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", children: jsxRuntime.jsx("path", { d: "M20 6L9 17L4 12", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }) }) })) })] }), jsxRuntime.jsx(framerMotion.AnimatePresence, { children: active && (jsxRuntime.jsx(framerMotion.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 } })) })] }));
|
|
1750
1723
|
};
|
|
1751
1724
|
|
|
1752
|
-
var styles$
|
|
1725
|
+
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"};
|
|
1753
1726
|
|
|
1754
1727
|
/**
|
|
1755
1728
|
* Slider component - A beautiful, animated range input
|
|
@@ -1837,16 +1810,16 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1837
1810
|
setShowTooltipState(false);
|
|
1838
1811
|
};
|
|
1839
1812
|
const dynamicColor = getDynamicColor();
|
|
1840
|
-
const sizeClass = styles$
|
|
1841
|
-
const stateClass = disabled ? styles$
|
|
1813
|
+
const sizeClass = styles$m[`size-${size}`];
|
|
1814
|
+
const stateClass = disabled ? styles$m.disabled : loading ? styles$m.loading : '';
|
|
1842
1815
|
if (loading) {
|
|
1843
|
-
return (jsxRuntime.jsxs("div", { className: `${styles$
|
|
1816
|
+
return (jsxRuntime.jsxs("div", { className: `${styles$m.slider} ${sizeClass} ${styles$m.loading} ${className}`, style: style, children: [label && jsxRuntime.jsx("label", { className: styles$m.label, children: label }), jsxRuntime.jsx("div", { className: styles$m.loadingTrack, children: jsxRuntime.jsx(framerMotion.motion.div, { className: styles$m.loadingIndicator, animate: { x: ['-100%', '200%'] }, transition: {
|
|
1844
1817
|
repeat: Infinity,
|
|
1845
1818
|
duration: 1.5,
|
|
1846
1819
|
ease: "easeInOut"
|
|
1847
1820
|
} }) })] }));
|
|
1848
1821
|
}
|
|
1849
|
-
return (jsxRuntime.jsxs("div", { className: `${styles$
|
|
1822
|
+
return (jsxRuntime.jsxs("div", { className: `${styles$m.slider} ${sizeClass} ${stateClass} ${className}`, style: style, children: [label && (jsxRuntime.jsx(framerMotion.motion.label, { className: styles$m.label, initial: { opacity: 0, y: -10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3 }, children: label })), jsxRuntime.jsxs(framerMotion.motion.div, { className: styles$m.sliderContainer, ref: sliderRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, whileHover: { scale: 1.02 }, transition: { duration: 0.1 }, children: [jsxRuntime.jsx(framerMotion.motion.div, { className: styles$m.track, whileHover: { height: 8, marginTop: -1 }, transition: { duration: 0.1 }, children: jsxRuntime.jsx(framerMotion.motion.div, { className: styles$m.fill, style: {
|
|
1850
1823
|
width: `${percentage}%`,
|
|
1851
1824
|
backgroundColor: dynamicColor
|
|
1852
1825
|
}, initial: { width: 0 }, animate: { width: `${percentage}%` }, transition: {
|
|
@@ -1856,7 +1829,7 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1856
1829
|
damping: 30
|
|
1857
1830
|
}, whileHover: {
|
|
1858
1831
|
boxShadow: `inset 0 0 0 1px rgba(255,255,255,0.2)`
|
|
1859
|
-
} }) }), jsxRuntime.jsx("input", { type: "range", min: min, max: max, step: step, value: value, onChange: handleChange, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, ...handlers, className: styles$
|
|
1832
|
+
} }) }), jsxRuntime.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 }), jsxRuntime.jsx(framerMotion.motion.div, { className: styles$m.thumb, style: {
|
|
1860
1833
|
left: `${percentage}%`,
|
|
1861
1834
|
backgroundColor: dynamicColor,
|
|
1862
1835
|
borderColor: colors.thumb || dynamicColor
|
|
@@ -1873,14 +1846,14 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1873
1846
|
}, whileHover: {
|
|
1874
1847
|
scale: 1.1,
|
|
1875
1848
|
transition: { duration: 0.1 }
|
|
1876
|
-
}, children: isDragging && (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$
|
|
1849
|
+
}, children: isDragging && (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$m.ripple, initial: { scale: 0, opacity: 0.6 }, animate: { scale: 2, opacity: 0 }, transition: { duration: 0.5 } })) }), jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showTooltipState && (jsxRuntime.jsxs(framerMotion.motion.div, { className: styles$m.tooltip, style: {
|
|
1877
1850
|
left: `${percentage}%`,
|
|
1878
1851
|
backgroundColor: dynamicColor
|
|
1879
|
-
}, 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), jsxRuntime.jsx("div", { className: styles$
|
|
1852
|
+
}, 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), jsxRuntime.jsx("div", { className: styles$m.tooltipArrow, style: { borderTopColor: dynamicColor } })] })) })] }), showValue && (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$m.valueDisplay, style: { color: dynamicColor }, initial: { scale: 0.8 }, animate: { scale: 1 }, transition: {
|
|
1880
1853
|
duration: 0.2,
|
|
1881
1854
|
type: "spring",
|
|
1882
1855
|
stiffness: 300
|
|
1883
|
-
}, children: formatValue(value) }, value)), labels.length > 0 && (jsxRuntime.jsx("div", { className: styles$
|
|
1856
|
+
}, children: formatValue(value) }, value)), labels.length > 0 && (jsxRuntime.jsx("div", { className: styles$m.labelsContainer, children: labels.map((labelConfig, index) => {
|
|
1884
1857
|
let position = 0;
|
|
1885
1858
|
if (labelConfig.position === 'start')
|
|
1886
1859
|
position = 0;
|
|
@@ -1888,7 +1861,7 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1888
1861
|
position = 100;
|
|
1889
1862
|
else if (typeof labelConfig.position === 'number')
|
|
1890
1863
|
position = labelConfig.position;
|
|
1891
|
-
return (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$
|
|
1864
|
+
return (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$m.labelItem, style: {
|
|
1892
1865
|
left: `${position}%`,
|
|
1893
1866
|
color: labelConfig.color
|
|
1894
1867
|
}, initial: { opacity: 0, y: 5 }, animate: { opacity: 1, y: 0 }, transition: {
|
|
@@ -1901,7 +1874,7 @@ function Slider({ value, onChange, min = 0, max = 100, step = 1, label, showValu
|
|
|
1901
1874
|
}) }))] }));
|
|
1902
1875
|
}
|
|
1903
1876
|
|
|
1904
|
-
var styles$
|
|
1877
|
+
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"};
|
|
1905
1878
|
|
|
1906
1879
|
const defaultMessages = [
|
|
1907
1880
|
'Loading your content...',
|
|
@@ -1977,6 +1950,7 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
1977
1950
|
}, messageRotationInterval);
|
|
1978
1951
|
return () => clearInterval(interval);
|
|
1979
1952
|
}
|
|
1953
|
+
return undefined;
|
|
1980
1954
|
}, [message, showMessage, messagesToUse.length, messageRotationInterval]);
|
|
1981
1955
|
React.useEffect(() => {
|
|
1982
1956
|
if (!message && showMessage) {
|
|
@@ -1984,22 +1958,22 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
1984
1958
|
}
|
|
1985
1959
|
}, [currentMessageIndex, message, messagesToUse, showMessage]);
|
|
1986
1960
|
const containerClasses = [
|
|
1987
|
-
styles$
|
|
1988
|
-
styles$
|
|
1989
|
-
styles$
|
|
1990
|
-
fullScreen && styles$
|
|
1991
|
-
overlay && styles$
|
|
1961
|
+
styles$l.loadingContainer,
|
|
1962
|
+
styles$l[size],
|
|
1963
|
+
styles$l[variant],
|
|
1964
|
+
fullScreen && styles$l.fullScreen,
|
|
1965
|
+
overlay && styles$l.overlay,
|
|
1992
1966
|
className
|
|
1993
1967
|
].filter(Boolean).join(' ');
|
|
1994
1968
|
const customStyle = {
|
|
1995
1969
|
...(color && { '--spinner-color': color }),
|
|
1996
1970
|
...(backgroundColor && { '--spinner-background': backgroundColor }),
|
|
1997
1971
|
};
|
|
1998
|
-
const renderDots = () => (jsxRuntime.jsxs(framerMotion.motion.div, { className: styles$
|
|
1972
|
+
const renderDots = () => (jsxRuntime.jsxs(framerMotion.motion.div, { className: styles$l.dotsSpinner, animate: { rotate: 360 }, transition: {
|
|
1999
1973
|
duration: 2,
|
|
2000
1974
|
repeat: Infinity,
|
|
2001
1975
|
ease: 'linear'
|
|
2002
|
-
}, children: [jsxRuntime.jsx(framerMotion.motion.div, { className: styles$
|
|
1976
|
+
}, children: [jsxRuntime.jsx(framerMotion.motion.div, { className: styles$l.dot1, animate: {
|
|
2003
1977
|
scale: [1, 1.3, 1],
|
|
2004
1978
|
y: [0, -6, 0]
|
|
2005
1979
|
}, transition: {
|
|
@@ -2007,7 +1981,7 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2007
1981
|
repeat: Infinity,
|
|
2008
1982
|
ease: 'easeInOut',
|
|
2009
1983
|
delay: 0
|
|
2010
|
-
} }), jsxRuntime.jsx(framerMotion.motion.div, { className: styles$
|
|
1984
|
+
} }), jsxRuntime.jsx(framerMotion.motion.div, { className: styles$l.dot2, animate: {
|
|
2011
1985
|
scale: [1, 1.3, 1],
|
|
2012
1986
|
y: [0, -6, 0]
|
|
2013
1987
|
}, transition: {
|
|
@@ -2015,7 +1989,7 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2015
1989
|
repeat: Infinity,
|
|
2016
1990
|
ease: 'easeInOut',
|
|
2017
1991
|
delay: 0.5
|
|
2018
|
-
} }), jsxRuntime.jsx(framerMotion.motion.div, { className: styles$
|
|
1992
|
+
} }), jsxRuntime.jsx(framerMotion.motion.div, { className: styles$l.dot3, animate: {
|
|
2019
1993
|
scale: [1, 1.3, 1],
|
|
2020
1994
|
y: [0, -6, 0]
|
|
2021
1995
|
}, transition: {
|
|
@@ -2024,12 +1998,12 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2024
1998
|
ease: 'easeInOut',
|
|
2025
1999
|
delay: 1
|
|
2026
2000
|
} })] }));
|
|
2027
|
-
const renderSpinner = () => (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$
|
|
2001
|
+
const renderSpinner = () => (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$l.circleSpinner, animate: { rotate: 360 }, transition: {
|
|
2028
2002
|
duration: 1,
|
|
2029
2003
|
repeat: Infinity,
|
|
2030
2004
|
ease: 'linear'
|
|
2031
2005
|
} }));
|
|
2032
|
-
const renderPulse = () => (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$
|
|
2006
|
+
const renderPulse = () => (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$l.pulseSpinner, animate: {
|
|
2033
2007
|
scale: [1, 1.2, 1],
|
|
2034
2008
|
opacity: [1, 0.7, 1]
|
|
2035
2009
|
}, transition: {
|
|
@@ -2048,10 +2022,10 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2048
2022
|
return renderDots();
|
|
2049
2023
|
}
|
|
2050
2024
|
};
|
|
2051
|
-
return (jsxRuntime.jsxs("div", { className: containerClasses, style: customStyle, children: [renderSpinnerVariant(), showMessage && (jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: jsxRuntime.jsx(framerMotion.motion.p, { className: styles$
|
|
2025
|
+
return (jsxRuntime.jsxs("div", { className: containerClasses, style: customStyle, children: [renderSpinnerVariant(), showMessage && (jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: jsxRuntime.jsx(framerMotion.motion.p, { className: styles$l.loadingText, initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -10 }, transition: {
|
|
2052
2026
|
duration: 0.4,
|
|
2053
2027
|
ease: 'easeOut'
|
|
2054
|
-
}, children: currentMessage }, currentMessage) })), showSparkles && (jsxRuntime.jsx("div", { className: styles$
|
|
2028
|
+
}, children: currentMessage }, currentMessage) })), showSparkles && (jsxRuntime.jsx("div", { className: styles$l.sparkleContainer, children: [...Array(4)].map((_, i) => (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$l.sparkle, animate: {
|
|
2055
2029
|
opacity: [0, 1, 0],
|
|
2056
2030
|
scale: [0.5, 1, 0.5],
|
|
2057
2031
|
rotate: [0, 180, 360]
|
|
@@ -2066,7 +2040,197 @@ const LoadingSpinner = ({ message, size = 'medium', variant = 'dots', className
|
|
|
2066
2040
|
} }, i))) }))] }));
|
|
2067
2041
|
};
|
|
2068
2042
|
|
|
2069
|
-
var styles$
|
|
2043
|
+
var styles$k = {"wrapper":"DecryptedText-module_wrapper__tuLvf","srOnly":"DecryptedText-module_srOnly__A-K2T"};
|
|
2044
|
+
|
|
2045
|
+
/**
|
|
2046
|
+
* DecryptedText Component
|
|
2047
|
+
*
|
|
2048
|
+
* Creates an animated text reveal effect where characters progressively
|
|
2049
|
+
* decrypt from scrambled characters to the final text.
|
|
2050
|
+
*
|
|
2051
|
+
* @example
|
|
2052
|
+
* // Basic usage - animates on hover
|
|
2053
|
+
* <DecryptedText text="Hello World" />
|
|
2054
|
+
*
|
|
2055
|
+
* @example
|
|
2056
|
+
* // Animate when scrolled into view
|
|
2057
|
+
* <DecryptedText text="Welcome" animateOn="view" />
|
|
2058
|
+
*
|
|
2059
|
+
* @example
|
|
2060
|
+
* // Sequential reveal from center
|
|
2061
|
+
* <DecryptedText
|
|
2062
|
+
* text="Decrypt Me"
|
|
2063
|
+
* sequential
|
|
2064
|
+
* revealDirection="center"
|
|
2065
|
+
* speed={30}
|
|
2066
|
+
* />
|
|
2067
|
+
*/
|
|
2068
|
+
const DecryptedText = ({ text, speed = 50, maxIterations = 10, sequential = false, revealDirection = 'start', useOriginalCharsOnly = false, characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', className = '', parentClassName = '', encryptedClassName = '', animateOn = 'hover', ...props }) => {
|
|
2069
|
+
const [displayText, setDisplayText] = React.useState(text);
|
|
2070
|
+
const [isHovering, setIsHovering] = React.useState(false);
|
|
2071
|
+
const [isScrambling, setIsScrambling] = React.useState(false);
|
|
2072
|
+
const [revealedIndices, setRevealedIndices] = React.useState(new Set());
|
|
2073
|
+
const [hasAnimated, setHasAnimated] = React.useState(false);
|
|
2074
|
+
const containerRef = React.useRef(null);
|
|
2075
|
+
React.useEffect(() => {
|
|
2076
|
+
let interval;
|
|
2077
|
+
let currentIteration = 0;
|
|
2078
|
+
const getNextIndex = (revealedSet) => {
|
|
2079
|
+
const textLength = text.length;
|
|
2080
|
+
switch (revealDirection) {
|
|
2081
|
+
case 'start':
|
|
2082
|
+
return revealedSet.size;
|
|
2083
|
+
case 'end':
|
|
2084
|
+
return textLength - 1 - revealedSet.size;
|
|
2085
|
+
case 'center': {
|
|
2086
|
+
const middle = Math.floor(textLength / 2);
|
|
2087
|
+
const offset = Math.floor(revealedSet.size / 2);
|
|
2088
|
+
const nextIndex = revealedSet.size % 2 === 0 ? middle + offset : middle - offset - 1;
|
|
2089
|
+
if (nextIndex >= 0 && nextIndex < textLength && !revealedSet.has(nextIndex)) {
|
|
2090
|
+
return nextIndex;
|
|
2091
|
+
}
|
|
2092
|
+
for (let i = 0; i < textLength; i++) {
|
|
2093
|
+
if (!revealedSet.has(i))
|
|
2094
|
+
return i;
|
|
2095
|
+
}
|
|
2096
|
+
return 0;
|
|
2097
|
+
}
|
|
2098
|
+
default:
|
|
2099
|
+
return revealedSet.size;
|
|
2100
|
+
}
|
|
2101
|
+
};
|
|
2102
|
+
const availableChars = useOriginalCharsOnly
|
|
2103
|
+
? Array.from(new Set(text.split(''))).filter((char) => char !== ' ')
|
|
2104
|
+
: characters.split('');
|
|
2105
|
+
const shuffleText = (originalText, currentRevealed) => {
|
|
2106
|
+
if (useOriginalCharsOnly) {
|
|
2107
|
+
const positions = originalText.split('').map((char, i) => ({
|
|
2108
|
+
char,
|
|
2109
|
+
isSpace: char === ' ',
|
|
2110
|
+
index: i,
|
|
2111
|
+
isRevealed: currentRevealed.has(i),
|
|
2112
|
+
}));
|
|
2113
|
+
const nonSpaceChars = positions
|
|
2114
|
+
.filter((p) => !p.isSpace && !p.isRevealed)
|
|
2115
|
+
.map((p) => p.char);
|
|
2116
|
+
for (let i = nonSpaceChars.length - 1; i > 0; i--) {
|
|
2117
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
2118
|
+
[nonSpaceChars[i], nonSpaceChars[j]] = [nonSpaceChars[j], nonSpaceChars[i]];
|
|
2119
|
+
}
|
|
2120
|
+
let charIndex = 0;
|
|
2121
|
+
return positions
|
|
2122
|
+
.map((p) => {
|
|
2123
|
+
if (p.isSpace)
|
|
2124
|
+
return ' ';
|
|
2125
|
+
if (p.isRevealed)
|
|
2126
|
+
return originalText[p.index];
|
|
2127
|
+
return nonSpaceChars[charIndex++];
|
|
2128
|
+
})
|
|
2129
|
+
.join('');
|
|
2130
|
+
}
|
|
2131
|
+
else {
|
|
2132
|
+
return originalText
|
|
2133
|
+
.split('')
|
|
2134
|
+
.map((char, i) => {
|
|
2135
|
+
if (char === ' ')
|
|
2136
|
+
return ' ';
|
|
2137
|
+
if (currentRevealed.has(i))
|
|
2138
|
+
return originalText[i];
|
|
2139
|
+
return availableChars[Math.floor(Math.random() * availableChars.length)];
|
|
2140
|
+
})
|
|
2141
|
+
.join('');
|
|
2142
|
+
}
|
|
2143
|
+
};
|
|
2144
|
+
if (isHovering) {
|
|
2145
|
+
setIsScrambling(true);
|
|
2146
|
+
interval = setInterval(() => {
|
|
2147
|
+
setRevealedIndices((prevRevealed) => {
|
|
2148
|
+
if (sequential) {
|
|
2149
|
+
if (prevRevealed.size < text.length) {
|
|
2150
|
+
const nextIndex = getNextIndex(prevRevealed);
|
|
2151
|
+
const newRevealed = new Set(prevRevealed);
|
|
2152
|
+
newRevealed.add(nextIndex);
|
|
2153
|
+
setDisplayText(shuffleText(text, newRevealed));
|
|
2154
|
+
return newRevealed;
|
|
2155
|
+
}
|
|
2156
|
+
else {
|
|
2157
|
+
clearInterval(interval);
|
|
2158
|
+
setIsScrambling(false);
|
|
2159
|
+
return prevRevealed;
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
else {
|
|
2163
|
+
setDisplayText(shuffleText(text, prevRevealed));
|
|
2164
|
+
currentIteration++;
|
|
2165
|
+
if (currentIteration >= maxIterations) {
|
|
2166
|
+
clearInterval(interval);
|
|
2167
|
+
setIsScrambling(false);
|
|
2168
|
+
setDisplayText(text);
|
|
2169
|
+
}
|
|
2170
|
+
return prevRevealed;
|
|
2171
|
+
}
|
|
2172
|
+
});
|
|
2173
|
+
}, speed);
|
|
2174
|
+
}
|
|
2175
|
+
else {
|
|
2176
|
+
setDisplayText(text);
|
|
2177
|
+
setRevealedIndices(new Set());
|
|
2178
|
+
setIsScrambling(false);
|
|
2179
|
+
}
|
|
2180
|
+
return () => {
|
|
2181
|
+
if (interval)
|
|
2182
|
+
clearInterval(interval);
|
|
2183
|
+
};
|
|
2184
|
+
}, [
|
|
2185
|
+
isHovering,
|
|
2186
|
+
text,
|
|
2187
|
+
speed,
|
|
2188
|
+
maxIterations,
|
|
2189
|
+
sequential,
|
|
2190
|
+
revealDirection,
|
|
2191
|
+
characters,
|
|
2192
|
+
useOriginalCharsOnly,
|
|
2193
|
+
]);
|
|
2194
|
+
React.useEffect(() => {
|
|
2195
|
+
if (animateOn !== 'view' && animateOn !== 'both')
|
|
2196
|
+
return;
|
|
2197
|
+
const observerCallback = (entries) => {
|
|
2198
|
+
entries.forEach((entry) => {
|
|
2199
|
+
if (entry.isIntersecting && !hasAnimated) {
|
|
2200
|
+
setIsHovering(true);
|
|
2201
|
+
setHasAnimated(true);
|
|
2202
|
+
}
|
|
2203
|
+
});
|
|
2204
|
+
};
|
|
2205
|
+
const observerOptions = {
|
|
2206
|
+
root: null,
|
|
2207
|
+
rootMargin: '0px',
|
|
2208
|
+
threshold: 0.1,
|
|
2209
|
+
};
|
|
2210
|
+
const observer = new IntersectionObserver(observerCallback, observerOptions);
|
|
2211
|
+
const currentRef = containerRef.current;
|
|
2212
|
+
if (currentRef) {
|
|
2213
|
+
observer.observe(currentRef);
|
|
2214
|
+
}
|
|
2215
|
+
return () => {
|
|
2216
|
+
if (currentRef) {
|
|
2217
|
+
observer.unobserve(currentRef);
|
|
2218
|
+
}
|
|
2219
|
+
};
|
|
2220
|
+
}, [animateOn, hasAnimated]);
|
|
2221
|
+
const hoverProps = animateOn === 'hover' || animateOn === 'both'
|
|
2222
|
+
? {
|
|
2223
|
+
onMouseEnter: () => setIsHovering(true),
|
|
2224
|
+
onMouseLeave: () => setIsHovering(false),
|
|
2225
|
+
}
|
|
2226
|
+
: {};
|
|
2227
|
+
return (jsxRuntime.jsxs(framerMotion.motion.span, { className: `${styles$k.wrapper} ${parentClassName}`, ref: containerRef, ...hoverProps, ...props, children: [jsxRuntime.jsx("span", { className: styles$k.srOnly, children: displayText }), jsxRuntime.jsx("span", { "aria-hidden": "true", children: displayText.split('').map((char, index) => {
|
|
2228
|
+
const isRevealedOrDone = revealedIndices.has(index) || !isScrambling || !isHovering;
|
|
2229
|
+
return (jsxRuntime.jsx("span", { className: isRevealedOrDone ? className : encryptedClassName, children: char }, index));
|
|
2230
|
+
}) })] }));
|
|
2231
|
+
};
|
|
2232
|
+
|
|
2233
|
+
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"};
|
|
2070
2234
|
|
|
2071
2235
|
/**
|
|
2072
2236
|
* ArrayInput component - Versatile dynamic list manager
|
|
@@ -2133,11 +2297,11 @@ function SimpleArrayInput({ label, values, onChange, placeholder, itemStyle, inp
|
|
|
2133
2297
|
itemIdsRef.current.splice(index, 1);
|
|
2134
2298
|
onChange(newValues);
|
|
2135
2299
|
};
|
|
2136
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
2300
|
+
return (jsxRuntime.jsxs("div", { className: styles$j.arrayInput, children: [jsxRuntime.jsx("h3", { className: styles$j.arrayInputLabel, children: label }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(framerMotion.AnimatePresence, { children: values.map((value, index) => (jsxRuntime.jsxs(framerMotion.motion.div, { className: styles$j.arrayInputItem, style: itemStyle, initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0 }, transition: {
|
|
2137
2301
|
duration: 0.3,
|
|
2138
2302
|
ease: "easeInOut",
|
|
2139
2303
|
layout: { duration: 0.2 }
|
|
2140
|
-
}, children: [jsxRuntime.jsx("div", { className: styles$
|
|
2304
|
+
}, children: [jsxRuntime.jsx("div", { className: styles$j.inputWrapper, children: multiline ? (jsxRuntime.jsx("div", { style: inputStyle, children: jsxRuntime.jsx(TextArea, { label: "", value: value, onChange: (newValue) => handleChange(index, newValue), placeholder: placeholder, rows: rows, compact: true }) })) : (jsxRuntime.jsx("input", { type: "text", value: value, onChange: (e) => handleChange(index, e.target.value), placeholder: placeholder, className: styles$j.input, style: inputStyle })) }), jsxRuntime.jsx(Button, { variant: "ghost", size: "small", onClick: () => handleRemove(index), "aria-label": "Remove item", className: styles$j.removeButton, children: jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: jsxRuntime.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]))) }) }), jsxRuntime.jsx(Button, { variant: buttonVariant, size: "small", onClick: handleAdd, className: styles$j.addButton, children: label })] }));
|
|
2141
2305
|
}
|
|
2142
2306
|
// Complex object array implementation
|
|
2143
2307
|
function ComplexArrayInput({ label, values, onChange, fields, getKey, itemStyle, inputStyle, buttonVariant = 'primary' }) {
|
|
@@ -2162,14 +2326,14 @@ function ComplexArrayInput({ label, values, onChange, fields, getKey, itemStyle,
|
|
|
2162
2326
|
// Generate key from all field values
|
|
2163
2327
|
return fields.map(f => item[f.name] || '').join('-') + `-${index}`;
|
|
2164
2328
|
};
|
|
2165
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
2329
|
+
return (jsxRuntime.jsxs("div", { className: styles$j.arrayInput, children: [jsxRuntime.jsx("h3", { className: styles$j.arrayInputLabel, children: label }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(framerMotion.AnimatePresence, { children: values.map((value, index) => (jsxRuntime.jsxs(framerMotion.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: {
|
|
2166
2330
|
duration: 0.3,
|
|
2167
2331
|
ease: "easeInOut",
|
|
2168
2332
|
layout: { duration: 0.2 }
|
|
2169
|
-
}, children: [jsxRuntime.jsx("div", { className: styles$
|
|
2333
|
+
}, children: [jsxRuntime.jsx("div", { className: styles$j.fieldsWrapper, children: fields.map((field) => (jsxRuntime.jsx("div", { style: inputStyle, children: field.multiline ? (jsxRuntime.jsx(TextArea, { value: value[field.name] || '', onChange: (newValue) => handleChange(index, field.name, newValue), label: field.label, placeholder: field.placeholder, rows: field.rows, compact: true })) : (jsxRuntime.jsx(TextInput, { value: value[field.name] || '', onChange: (newValue) => handleChange(index, field.name, newValue), label: field.label, type: field.type, placeholder: field.placeholder })) }, field.name))) }), jsxRuntime.jsx(Button, { variant: "ghost", size: "small", onClick: () => handleRemove(index), "aria-label": "Remove item", className: styles$j.removeButton, children: jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: jsxRuntime.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)))) }) }), jsxRuntime.jsxs(Button, { variant: buttonVariant, size: "small", onClick: handleAdd, className: styles$j.addButton, children: ["Add ", label] })] }));
|
|
2170
2334
|
}
|
|
2171
2335
|
|
|
2172
|
-
var styles$
|
|
2336
|
+
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"};
|
|
2173
2337
|
|
|
2174
2338
|
const EditFAB = ({ canEdit, isEditMode, hasUnsavedChanges = false, isSaving = false, onEnterEditMode, onExitEditMode, position = { bottom: 32, right: 32 } }) => {
|
|
2175
2339
|
const [isMobile, setIsMobile] = React.useState(false);
|
|
@@ -2254,15 +2418,15 @@ const EditFAB = ({ canEdit, isEditMode, hasUnsavedChanges = false, isSaving = fa
|
|
|
2254
2418
|
};
|
|
2255
2419
|
const getVariantClass = () => {
|
|
2256
2420
|
if (isSaving)
|
|
2257
|
-
return styles$
|
|
2421
|
+
return styles$i.primary;
|
|
2258
2422
|
if (isEditMode) {
|
|
2259
|
-
return hasUnsavedChanges ? styles$
|
|
2423
|
+
return hasUnsavedChanges ? styles$i.success : styles$i.secondary;
|
|
2260
2424
|
}
|
|
2261
|
-
return styles$
|
|
2425
|
+
return styles$i.primary;
|
|
2262
2426
|
};
|
|
2263
2427
|
const getIcon = () => {
|
|
2264
2428
|
if (isSaving) {
|
|
2265
|
-
return jsxRuntime.jsx("div", { className: styles$
|
|
2429
|
+
return jsxRuntime.jsx("div", { className: styles$i.loader });
|
|
2266
2430
|
}
|
|
2267
2431
|
if (isEditMode) {
|
|
2268
2432
|
return hasUnsavedChanges ? jsxRuntime.jsx(lucideReact.Check, { size: 24 }) : jsxRuntime.jsx(lucideReact.X, { size: 24 });
|
|
@@ -2277,30 +2441,30 @@ const EditFAB = ({ canEdit, isEditMode, hasUnsavedChanges = false, isSaving = fa
|
|
|
2277
2441
|
}
|
|
2278
2442
|
return "Enter edit mode";
|
|
2279
2443
|
};
|
|
2280
|
-
return (jsxRuntime.jsx(framerMotion.motion.button, { ref: fabRef, className: `${styles$
|
|
2444
|
+
return (jsxRuntime.jsx(framerMotion.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: {
|
|
2281
2445
|
type: "spring",
|
|
2282
2446
|
stiffness: 260,
|
|
2283
2447
|
damping: 20
|
|
2284
2448
|
}, children: getIcon() }));
|
|
2285
2449
|
};
|
|
2286
2450
|
|
|
2287
|
-
var styles$
|
|
2451
|
+
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"};
|
|
2288
2452
|
|
|
2289
2453
|
// Default filter options for backwards compatibility
|
|
2290
2454
|
const defaultFilterOptions = [
|
|
2291
|
-
{ value: 'all', label: 'All', icon:
|
|
2292
|
-
{ value: 'projects', label: 'Projects', icon:
|
|
2293
|
-
{ value: 'clients', label: 'Clients', icon:
|
|
2294
|
-
{ value: 'contacts', label: 'Contacts', icon:
|
|
2295
|
-
{ value: 'interactions', label: 'Interactions', icon:
|
|
2296
|
-
{ value: 'team', label: 'Team', icon:
|
|
2455
|
+
{ value: 'all', label: 'All', icon: lucideReact.Search },
|
|
2456
|
+
{ value: 'projects', label: 'Projects', icon: lucideReact.Folder },
|
|
2457
|
+
{ value: 'clients', label: 'Clients', icon: lucideReact.Users },
|
|
2458
|
+
{ value: 'contacts', label: 'Contacts', icon: lucideReact.Book },
|
|
2459
|
+
{ value: 'interactions', label: 'Interactions', icon: lucideReact.MessageSquare },
|
|
2460
|
+
{ value: 'team', label: 'Team', icon: lucideReact.UserPlus },
|
|
2297
2461
|
];
|
|
2298
2462
|
const defaultEntityIcons = {
|
|
2299
|
-
projects:
|
|
2300
|
-
clients:
|
|
2301
|
-
contacts:
|
|
2302
|
-
interactions:
|
|
2303
|
-
team:
|
|
2463
|
+
projects: lucideReact.Folder,
|
|
2464
|
+
clients: lucideReact.Users,
|
|
2465
|
+
contacts: lucideReact.Book,
|
|
2466
|
+
interactions: lucideReact.MessageSquare,
|
|
2467
|
+
team: lucideReact.UserPlus,
|
|
2304
2468
|
};
|
|
2305
2469
|
const SearchBar = ({ className, placeholder = "Search (Ctrl+Space)...", onSearch, onResultClick, onClear, debounceDelay = 300, minSearchLength = 2, showFilter = true, enableKeyboardShortcut = true, filterOptions: customFilterOptions, entityIcons: customEntityIcons }) => {
|
|
2306
2470
|
const filterOptions = customFilterOptions ?? defaultFilterOptions;
|
|
@@ -2477,18 +2641,18 @@ const SearchBar = ({ className, placeholder = "Search (Ctrl+Space)...", onSearch
|
|
|
2477
2641
|
return text || '';
|
|
2478
2642
|
const regex = new RegExp(`(${highlight.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})`, 'gi');
|
|
2479
2643
|
const parts = text.split(regex);
|
|
2480
|
-
return parts.map((part, index) => regex.test(part) ? (jsxRuntime.jsx("mark", { className: styles$
|
|
2644
|
+
return parts.map((part, index) => regex.test(part) ? (jsxRuntime.jsx("mark", { className: styles$h.highlight, children: part }, index)) : (part));
|
|
2481
2645
|
};
|
|
2482
|
-
return (jsxRuntime.jsxs("div", { ref: searchRef, className: `${styles$
|
|
2646
|
+
return (jsxRuntime.jsxs("div", { ref: searchRef, className: `${styles$h.searchContainer} ${className || ''}`, children: [jsxRuntime.jsxs("div", { className: styles$h.searchInputWrapper, children: [jsxRuntime.jsx(lucideReact.Search, { className: styles$h.searchIcon }), jsxRuntime.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 && (jsxRuntime.jsx(framerMotion.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: jsxRuntime.jsx(lucideReact.X, {}) })), showFilter && (jsxRuntime.jsx("select", { value: filter, onChange: (e) => setFilter(e.target.value), className: styles$h.filterSelect, "aria-label": "Filter search results", children: filterOptions.map(option => (jsxRuntime.jsx("option", { value: option.value, children: option.label }, option.value))) }))] }), jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isDropdownOpen && (jsxRuntime.jsx(framerMotion.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 ? (jsxRuntime.jsxs("div", { className: styles$h.loadingState, children: [jsxRuntime.jsx("div", { className: styles$h.spinner }), jsxRuntime.jsx("span", { children: "Searching..." })] })) : results.length === 0 ? (jsxRuntime.jsxs("div", { className: styles$h.emptyState, children: ["No results found for \"", query, "\""] })) : (jsxRuntime.jsx("div", { className: styles$h.resultsGroups, children: Object.entries(groupedResults).map(([type, groupResults]) => {
|
|
2483
2647
|
const Icon = entityIcons[type];
|
|
2484
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
2648
|
+
return (jsxRuntime.jsxs("div", { className: styles$h.resultGroup, children: [jsxRuntime.jsxs("div", { className: styles$h.groupHeader, children: [Icon && jsxRuntime.jsx(Icon, { className: styles$h.groupIcon }), jsxRuntime.jsx("span", { className: styles$h.groupTitle, children: type.charAt(0).toUpperCase() + type.slice(1) }), jsxRuntime.jsx("span", { className: styles$h.groupCount, children: groupResults.length })] }), jsxRuntime.jsx("div", { className: styles$h.groupResults, children: groupResults.map((result) => {
|
|
2485
2649
|
const globalIndex = results.indexOf(result);
|
|
2486
|
-
return (jsxRuntime.jsxs(framerMotion.motion.button, { "data-result-index": globalIndex, className: `${styles$
|
|
2650
|
+
return (jsxRuntime.jsxs(framerMotion.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: [jsxRuntime.jsxs("div", { className: styles$h.resultContent, children: [jsxRuntime.jsx("div", { className: styles$h.resultTitle, children: highlightMatch(result.title || 'Untitled', query) }), result.subtitle && (jsxRuntime.jsx("div", { className: styles$h.resultSubtitle, children: highlightMatch(result.subtitle, query) }))] }), result.meta && (jsxRuntime.jsx("div", { className: styles$h.resultMeta, children: result.meta }))] }, `${result.type}-${result.id}`));
|
|
2487
2651
|
}) })] }, type));
|
|
2488
2652
|
}) })) })) })] }));
|
|
2489
2653
|
};
|
|
2490
2654
|
|
|
2491
|
-
var styles$
|
|
2655
|
+
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"};
|
|
2492
2656
|
|
|
2493
2657
|
function TimePickerModal({ isOpen, onClose, value, onChange }) {
|
|
2494
2658
|
const [hours, minutes] = value ? value.split(':').map(Number) : [12, 0];
|
|
@@ -2509,10 +2673,10 @@ function TimePickerModal({ isOpen, onClose, value, onChange }) {
|
|
|
2509
2673
|
};
|
|
2510
2674
|
if (!isOpen)
|
|
2511
2675
|
return null;
|
|
2512
|
-
return (jsxRuntime.jsx("div", { className: styles$
|
|
2676
|
+
return (jsxRuntime.jsx("div", { className: styles$g.modalOverlay, onClick: onClose, children: jsxRuntime.jsxs("div", { className: styles$g.modalContent, onClick: (e) => e.stopPropagation(), children: [jsxRuntime.jsxs("div", { className: styles$g.modalHeader, children: [jsxRuntime.jsx("h3", { children: "Select Time" }), jsxRuntime.jsx("button", { className: styles$g.closeButton, onClick: onClose, "aria-label": "Close", children: jsxRuntime.jsx(lucideReact.X, {}) })] }), jsxRuntime.jsxs("div", { className: styles$g.timeDisplay, children: [selectedHour.toString().padStart(2, '0'), ":", selectedMinute.toString().padStart(2, '0')] }), jsxRuntime.jsxs("div", { className: styles$g.pickerContainer, children: [jsxRuntime.jsxs("div", { className: styles$g.pickerColumn, children: [jsxRuntime.jsx("div", { className: styles$g.pickerLabel, children: "Hours" }), jsxRuntime.jsx("div", { className: styles$g.pickerScroll, children: Array.from({ length: 24 }, (_, i) => (jsxRuntime.jsx("button", { className: `${styles$g.pickerItem} ${selectedHour === i ? styles$g.selected : ''}`, onClick: () => setSelectedHour(i), children: i.toString().padStart(2, '0') }, i))) })] }), jsxRuntime.jsx("div", { className: styles$g.pickerDivider, children: ":" }), jsxRuntime.jsxs("div", { className: styles$g.pickerColumn, children: [jsxRuntime.jsx("div", { className: styles$g.pickerLabel, children: "Minutes" }), jsxRuntime.jsx("div", { className: styles$g.pickerScroll, children: Array.from({ length: 60 }, (_, i) => (jsxRuntime.jsx("button", { className: `${styles$g.pickerItem} ${selectedMinute === i ? styles$g.selected : ''}`, onClick: () => setSelectedMinute(i), children: i.toString().padStart(2, '0') }, i))) })] })] }), jsxRuntime.jsxs("div", { className: styles$g.modalActions, children: [jsxRuntime.jsx("button", { className: styles$g.cancelButton, onClick: onClose, children: "Cancel" }), jsxRuntime.jsx("button", { className: styles$g.confirmButton, onClick: handleConfirm, children: "Confirm" })] })] }) }));
|
|
2513
2677
|
}
|
|
2514
2678
|
|
|
2515
|
-
var styles$
|
|
2679
|
+
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-"};
|
|
2516
2680
|
|
|
2517
2681
|
function TimeInput({ label, value, onChange, placeholder = "14:30", onFocus, onBlur, error = false, success = false, loading = false, disabled = false, required = false, className = "" }) {
|
|
2518
2682
|
const [showPicker, setShowPicker] = React.useState(false);
|
|
@@ -2565,20 +2729,20 @@ function TimeInput({ label, value, onChange, placeholder = "14:30", onFocus, onB
|
|
|
2565
2729
|
}
|
|
2566
2730
|
};
|
|
2567
2731
|
const getContainerClassName = () => {
|
|
2568
|
-
const classes = [styles$
|
|
2732
|
+
const classes = [styles$f.timeInput];
|
|
2569
2733
|
if (error)
|
|
2570
|
-
classes.push(styles$
|
|
2734
|
+
classes.push(styles$f.error);
|
|
2571
2735
|
if (success)
|
|
2572
|
-
classes.push(styles$
|
|
2736
|
+
classes.push(styles$f.success);
|
|
2573
2737
|
if (loading)
|
|
2574
|
-
classes.push(styles$
|
|
2738
|
+
classes.push(styles$f.loading);
|
|
2575
2739
|
if (disabled)
|
|
2576
|
-
classes.push(styles$
|
|
2740
|
+
classes.push(styles$f.disabled);
|
|
2577
2741
|
if (className)
|
|
2578
2742
|
classes.push(className);
|
|
2579
2743
|
return classes.join(' ');
|
|
2580
2744
|
};
|
|
2581
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: getContainerClassName(), children: [jsxRuntime.jsxs("label", { className: styles$
|
|
2745
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: getContainerClassName(), children: [jsxRuntime.jsxs("label", { className: styles$f.label, children: [label, required && jsxRuntime.jsx("span", { className: styles$f.required, children: "*" })] }), jsxRuntime.jsxs("div", { className: styles$f.inputWrapper, children: [jsxRuntime.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:]*" }), jsxRuntime.jsx("button", { type: "button", onClick: handleClockClick, className: styles$f.clockButton, title: "Open time picker", disabled: disabled || loading, "aria-label": "Open time picker", children: jsxRuntime.jsx(lucideReact.Clock, { size: 20 }) })] })] }), jsxRuntime.jsx(TimePickerModal, { isOpen: showPicker, onClose: () => setShowPicker(false), value: value, onChange: onChange })] }));
|
|
2582
2746
|
}
|
|
2583
2747
|
|
|
2584
2748
|
const ThemeContext = React.createContext(undefined);
|
|
@@ -2589,24 +2753,70 @@ const useTheme = () => {
|
|
|
2589
2753
|
}
|
|
2590
2754
|
return context;
|
|
2591
2755
|
};
|
|
2756
|
+
/** Safe version of useTheme that returns null when outside a ThemeProvider */
|
|
2757
|
+
const useThemeSafe = () => {
|
|
2758
|
+
return React.useContext(ThemeContext) ?? null;
|
|
2759
|
+
};
|
|
2760
|
+
const ThemeProvider = ({ children, defaultTheme = 'light', storageKey = 'app-theme', }) => {
|
|
2761
|
+
const [theme, setThemeState] = React.useState(() => {
|
|
2762
|
+
// Check localStorage first
|
|
2763
|
+
const stored = localStorage.getItem(storageKey);
|
|
2764
|
+
if (stored && ['light', 'dark', 'lossito', 'lossito-dark', 'dmood', 'dmood-dark', 'crt'].includes(stored)) {
|
|
2765
|
+
return stored;
|
|
2766
|
+
}
|
|
2767
|
+
// Check system preference
|
|
2768
|
+
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
2769
|
+
return 'dark';
|
|
2770
|
+
}
|
|
2771
|
+
return defaultTheme;
|
|
2772
|
+
});
|
|
2773
|
+
const setTheme = (newTheme) => {
|
|
2774
|
+
setThemeState(newTheme);
|
|
2775
|
+
localStorage.setItem(storageKey, newTheme);
|
|
2776
|
+
};
|
|
2777
|
+
const toggleTheme = () => {
|
|
2778
|
+
const themeOrder = ['light', 'dark', 'lossito', 'lossito-dark', 'dmood', 'dmood-dark', 'crt'];
|
|
2779
|
+
const currentIndex = themeOrder.indexOf(theme);
|
|
2780
|
+
const nextIndex = (currentIndex + 1) % themeOrder.length;
|
|
2781
|
+
setTheme(themeOrder[nextIndex]);
|
|
2782
|
+
};
|
|
2783
|
+
React.useEffect(() => {
|
|
2784
|
+
const root = document.documentElement;
|
|
2785
|
+
// Apply theme attribute
|
|
2786
|
+
root.setAttribute('data-theme', theme);
|
|
2787
|
+
// Apply dark class if needed
|
|
2788
|
+
if (theme.includes('dark')) {
|
|
2789
|
+
root.classList.add('dark');
|
|
2790
|
+
}
|
|
2791
|
+
else {
|
|
2792
|
+
root.classList.remove('dark');
|
|
2793
|
+
}
|
|
2794
|
+
}, [theme]);
|
|
2795
|
+
// Listen for system theme changes
|
|
2796
|
+
React.useEffect(() => {
|
|
2797
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
2798
|
+
const handleChange = (e) => {
|
|
2799
|
+
const stored = localStorage.getItem(storageKey);
|
|
2800
|
+
if (!stored) {
|
|
2801
|
+
setThemeState(e.matches ? 'dark' : 'light');
|
|
2802
|
+
}
|
|
2803
|
+
};
|
|
2804
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
2805
|
+
return () => mediaQuery.removeEventListener('change', handleChange);
|
|
2806
|
+
}, [storageKey]);
|
|
2807
|
+
return (jsxRuntime.jsx(ThemeContext.Provider, { value: { theme, setTheme, toggleTheme }, children: children }));
|
|
2808
|
+
};
|
|
2592
2809
|
|
|
2593
|
-
var styles$
|
|
2810
|
+
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"};
|
|
2594
2811
|
|
|
2595
2812
|
const ThemeSwitcher = ({ variant = 'button', showLabel = false, className = '', currentTheme, onThemeChange, themes: customThemes, }) => {
|
|
2596
|
-
//
|
|
2597
|
-
const contextTheme = (
|
|
2598
|
-
try {
|
|
2599
|
-
return useTheme();
|
|
2600
|
-
}
|
|
2601
|
-
catch {
|
|
2602
|
-
return null;
|
|
2603
|
-
}
|
|
2604
|
-
})();
|
|
2813
|
+
// Use safe version that returns null when outside a ThemeProvider
|
|
2814
|
+
const contextTheme = useThemeSafe();
|
|
2605
2815
|
const theme = currentTheme ?? contextTheme?.theme ?? 'light';
|
|
2606
2816
|
const setTheme = onThemeChange ?? contextTheme?.setTheme ?? (() => { });
|
|
2607
2817
|
const defaultThemes = [
|
|
2608
|
-
{ value: 'light', label: 'Light', icon: jsxRuntime.jsx(
|
|
2609
|
-
{ value: 'dark', label: 'Dark', icon: jsxRuntime.jsx(
|
|
2818
|
+
{ value: 'light', label: 'Light', icon: jsxRuntime.jsx(lucideReact.Sun, {}) },
|
|
2819
|
+
{ value: 'dark', label: 'Dark', icon: jsxRuntime.jsx(lucideReact.Moon, {}) },
|
|
2610
2820
|
{ value: 'lossito', label: 'Lossito Light', icon: '✨' },
|
|
2611
2821
|
{ value: 'lossito-dark', label: 'Lossito Dark', icon: '🌑' },
|
|
2612
2822
|
{ value: 'dmood', label: 'Dmood Light', icon: '💙' },
|
|
@@ -2618,48 +2828,154 @@ const ThemeSwitcher = ({ variant = 'button', showLabel = false, className = '',
|
|
|
2618
2828
|
if (variant === 'toggle') {
|
|
2619
2829
|
// Simple toggle between light and dark
|
|
2620
2830
|
const isDark = theme.includes('dark');
|
|
2621
|
-
return (jsxRuntime.jsxs(framerMotion.motion.button, { className: `${styles$
|
|
2831
|
+
return (jsxRuntime.jsxs(framerMotion.motion.button, { className: `${styles$e.toggle} ${className}`, onClick: () => setTheme(isDark ? 'light' : 'dark'), whileTap: { scale: 0.95 }, "aria-label": "Toggle theme", children: [jsxRuntime.jsx(framerMotion.motion.div, { className: styles$e.toggleTrack, animate: { backgroundColor: isDark ? 'var(--color-primary)' : 'var(--color-border)' }, children: jsxRuntime.jsx(framerMotion.motion.div, { className: styles$e.toggleThumb, animate: { x: isDark ? 24 : 0 }, transition: { type: 'spring', stiffness: 500, damping: 30 }, children: isDark ? jsxRuntime.jsx(lucideReact.Moon, { size: 14 }) : jsxRuntime.jsx(lucideReact.Sun, { size: 14 }) }) }), showLabel && jsxRuntime.jsx("span", { className: styles$e.label, children: isDark ? 'Dark' : 'Light' })] }));
|
|
2622
2832
|
}
|
|
2623
2833
|
if (variant === 'dropdown') {
|
|
2624
|
-
return (jsxRuntime.jsxs("div", { className: `${styles$
|
|
2834
|
+
return (jsxRuntime.jsxs("div", { className: `${styles$e.dropdown} ${className}`, children: [jsxRuntime.jsxs(framerMotion.motion.button, { className: styles$e.dropdownTrigger, whileTap: { scale: 0.98 }, children: [currentThemeData.icon, showLabel && jsxRuntime.jsx("span", { className: styles$e.label, children: currentThemeData.label })] }), jsxRuntime.jsx(framerMotion.motion.div, { className: styles$e.dropdownMenu, initial: { opacity: 0, y: -10 }, animate: { opacity: 1, y: 0 }, children: themes.map((t) => (jsxRuntime.jsxs(framerMotion.motion.button, { className: `${styles$e.dropdownItem} ${theme === t.value ? styles$e.active : ''}`, onClick: () => setTheme(t.value), whileHover: { x: 4 }, whileTap: { scale: 0.98 }, children: [jsxRuntime.jsx("span", { className: styles$e.icon, children: t.icon }), jsxRuntime.jsx("span", { className: styles$e.text, children: t.label })] }, t.value))) })] }));
|
|
2625
2835
|
}
|
|
2626
2836
|
// Default button variant - cycles through themes
|
|
2627
|
-
return (jsxRuntime.jsxs(framerMotion.motion.button, { className: `${styles$
|
|
2837
|
+
return (jsxRuntime.jsxs(framerMotion.motion.button, { className: `${styles$e.button} ${className}`, onClick: () => {
|
|
2628
2838
|
const nextIndex = (currentThemeIndex + 1) % themes.length;
|
|
2629
2839
|
setTheme(themes[nextIndex].value);
|
|
2630
|
-
}, whileTap: { scale: 0.95 }, whileHover: { scale: 1.05 }, "aria-label": `Current theme: ${currentThemeData.label}. Click to change.`, children: [jsxRuntime.jsx(framerMotion.motion.div, { initial: { rotate: -180, opacity: 0 }, animate: { rotate: 0, opacity: 1 }, exit: { rotate: 180, opacity: 0 }, transition: { duration: 0.3 }, className: styles$
|
|
2840
|
+
}, whileTap: { scale: 0.95 }, whileHover: { scale: 1.05 }, "aria-label": `Current theme: ${currentThemeData.label}. Click to change.`, children: [jsxRuntime.jsx(framerMotion.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 && jsxRuntime.jsx("span", { className: styles$e.label, children: currentThemeData.label })] }));
|
|
2631
2841
|
};
|
|
2632
2842
|
|
|
2633
|
-
|
|
2634
|
-
function SiJira (props) {
|
|
2635
|
-
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);
|
|
2636
|
-
}
|
|
2637
|
-
|
|
2638
|
-
var styles$9 = {"tabs":"Tabs-module_tabs__Vlvn7","tab":"Tabs-module_tab__uQKim","tabIcon":"Tabs-module_tabIcon__AgN-O"};
|
|
2843
|
+
var styles$d = {"tabs":"Tabs-module_tabs__Vlvn7","tab":"Tabs-module_tab__uQKim","tabIcon":"Tabs-module_tabIcon__AgN-O"};
|
|
2639
2844
|
|
|
2640
2845
|
// Default tabs for backwards compatibility
|
|
2641
2846
|
const defaultTabs = [
|
|
2642
|
-
{ id: 'details', icon:
|
|
2643
|
-
{ id: 'github', icon:
|
|
2644
|
-
{ id: 'jira', icon:
|
|
2645
|
-
{ id: 'functional', icon:
|
|
2847
|
+
{ id: 'details', icon: lucideReact.Info, label: 'Dettagli' },
|
|
2848
|
+
{ id: 'github', icon: lucideReact.Github, label: 'GitHub' },
|
|
2849
|
+
{ id: 'jira', icon: lucideReact.SquareKanban, label: 'Jira' },
|
|
2850
|
+
{ id: 'functional', icon: lucideReact.Info, label: 'Analisi funzionale' }
|
|
2646
2851
|
];
|
|
2647
2852
|
const Tabs = ({ activeTab, onTabChange, tabs: customTabs, className = '' }) => {
|
|
2648
2853
|
const tabs = customTabs ?? defaultTabs;
|
|
2649
|
-
return (jsxRuntime.jsx("div", { className: `${styles$
|
|
2854
|
+
return (jsxRuntime.jsx("div", { className: `${styles$d.tabs} ${className}`, children: tabs.map((tab) => {
|
|
2650
2855
|
const isActive = activeTab === tab.id;
|
|
2651
|
-
return (jsxRuntime.jsxs(framerMotion.motion.button, { className: styles$
|
|
2856
|
+
return (jsxRuntime.jsxs(framerMotion.motion.button, { className: styles$d.tab, "data-active": isActive, onClick: () => onTabChange(tab.id), style: { position: 'relative' }, children: [jsxRuntime.jsx(framerMotion.motion.div, { animate: {
|
|
2652
2857
|
rotate: isActive ? [0, -10, 10, -5, 5, 0] : 0,
|
|
2653
2858
|
}, transition: {
|
|
2654
2859
|
rotate: {
|
|
2655
2860
|
duration: 0.5,
|
|
2656
2861
|
ease: 'easeInOut'
|
|
2657
2862
|
}
|
|
2658
|
-
}, children: tab.icon && (
|
|
2863
|
+
}, children: tab.icon && (React.isValidElement(tab.icon) ? (jsxRuntime.jsx("span", { className: styles$d.tabIcon, children: tab.icon })) : (jsxRuntime.jsx("span", { className: styles$d.tabIcon, children: React.createElement(tab.icon) }))) }), jsxRuntime.jsx("span", { children: tab.label })] }, tab.id));
|
|
2659
2864
|
}) }));
|
|
2660
2865
|
};
|
|
2661
2866
|
|
|
2662
|
-
var styles$
|
|
2867
|
+
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"};
|
|
2868
|
+
|
|
2869
|
+
const getIcon = (type) => {
|
|
2870
|
+
switch (type) {
|
|
2871
|
+
case 'success':
|
|
2872
|
+
return (jsxRuntime.jsx("svg", { className: `${styles$c.icon} ${styles$c.iconSuccess}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }));
|
|
2873
|
+
case 'error':
|
|
2874
|
+
return (jsxRuntime.jsx("svg", { className: `${styles$c.icon} ${styles$c.iconError}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }));
|
|
2875
|
+
case 'warning':
|
|
2876
|
+
return (jsxRuntime.jsx("svg", { className: `${styles$c.icon} ${styles$c.iconWarning}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsxRuntime.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" }) }));
|
|
2877
|
+
case 'info':
|
|
2878
|
+
return (jsxRuntime.jsx("svg", { className: `${styles$c.icon} ${styles$c.iconInfo}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsxRuntime.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" }) }));
|
|
2879
|
+
}
|
|
2880
|
+
};
|
|
2881
|
+
const getToastStyle = (type) => {
|
|
2882
|
+
switch (type) {
|
|
2883
|
+
case 'success': return styles$c.toastSuccess;
|
|
2884
|
+
case 'error': return styles$c.toastError;
|
|
2885
|
+
case 'warning': return styles$c.toastWarning;
|
|
2886
|
+
case 'info': return styles$c.toastInfo;
|
|
2887
|
+
default: return '';
|
|
2888
|
+
}
|
|
2889
|
+
};
|
|
2890
|
+
const ToastItem = ({ toast, removeToast, }) => {
|
|
2891
|
+
const [progress, setProgress] = React.useState(100);
|
|
2892
|
+
const duration = toast.duration || 5000;
|
|
2893
|
+
React.useEffect(() => {
|
|
2894
|
+
const timer = setTimeout(() => {
|
|
2895
|
+
removeToast(toast.id);
|
|
2896
|
+
}, duration);
|
|
2897
|
+
const interval = setInterval(() => {
|
|
2898
|
+
setProgress((prev) => {
|
|
2899
|
+
const newProgress = prev - 100 / (duration / 100);
|
|
2900
|
+
return newProgress <= 0 ? 0 : newProgress;
|
|
2901
|
+
});
|
|
2902
|
+
}, 100);
|
|
2903
|
+
return () => {
|
|
2904
|
+
clearTimeout(timer);
|
|
2905
|
+
clearInterval(interval);
|
|
2906
|
+
};
|
|
2907
|
+
}, [toast.id, duration, removeToast]);
|
|
2908
|
+
return (jsxRuntime.jsxs(framerMotion.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), jsxRuntime.jsxs("div", { className: styles$c.content, children: [toast.title && jsxRuntime.jsx("p", { className: styles$c.title, children: toast.title }), jsxRuntime.jsx("p", { className: styles$c.message, children: toast.message })] }), jsxRuntime.jsx("button", { className: styles$c.closeButton, onClick: () => removeToast(toast.id), "aria-label": "Close notification", children: jsxRuntime.jsx("svg", { width: "16", height: "16", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) }), jsxRuntime.jsx(framerMotion.motion.div, { className: styles$c.progressBar, initial: { width: '100%' }, animate: { width: `${progress}%` }, style: {
|
|
2909
|
+
color: toast.type === 'success' ? '#10B981'
|
|
2910
|
+
: toast.type === 'error' ? '#EF4444'
|
|
2911
|
+
: toast.type === 'warning' ? '#F59E0B'
|
|
2912
|
+
: '#3B82F6',
|
|
2913
|
+
} })] }));
|
|
2914
|
+
};
|
|
2915
|
+
const ToastContainer = ({ toasts, removeToast }) => {
|
|
2916
|
+
if (typeof document === 'undefined')
|
|
2917
|
+
return null;
|
|
2918
|
+
return reactDom.createPortal(jsxRuntime.jsx("div", { className: styles$c.toastContainer, children: jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "sync", children: toasts.map((toast) => (jsxRuntime.jsx(ToastItem, { toast: toast, removeToast: removeToast }, toast.id))) }) }), document.body);
|
|
2919
|
+
};
|
|
2920
|
+
|
|
2921
|
+
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"};
|
|
2922
|
+
|
|
2923
|
+
/**
|
|
2924
|
+
* Breadcrumb Component
|
|
2925
|
+
*
|
|
2926
|
+
* Navigation breadcrumb trail. Router-agnostic: pass onNavigate to handle
|
|
2927
|
+
* clicks on breadcrumb links (e.g. with react-router's navigate function).
|
|
2928
|
+
*
|
|
2929
|
+
* @example
|
|
2930
|
+
* <Breadcrumb
|
|
2931
|
+
* items={[
|
|
2932
|
+
* { label: 'Home', href: '/' },
|
|
2933
|
+
* { label: 'Settings', href: '/settings' },
|
|
2934
|
+
* { label: 'Profile' },
|
|
2935
|
+
* ]}
|
|
2936
|
+
* onNavigate={(href) => navigate(href)}
|
|
2937
|
+
* />
|
|
2938
|
+
*/
|
|
2939
|
+
const Breadcrumb = ({ items, onNavigate, className = '' }) => {
|
|
2940
|
+
return (jsxRuntime.jsx("nav", { className: `${styles$b.breadcrumb} ${className}`, "aria-label": "Breadcrumb", children: items.map((item, index) => {
|
|
2941
|
+
const isLast = index === items.length - 1;
|
|
2942
|
+
return (jsxRuntime.jsxs(React.Fragment, { children: [index > 0 && jsxRuntime.jsx(lucideReact.ChevronRight, { size: 14, className: styles$b.separator }), isLast || !item.href ? (jsxRuntime.jsx("span", { className: `${styles$b.item} ${isLast ? styles$b.current : ''}`, children: item.label })) : (jsxRuntime.jsx("button", { className: `${styles$b.item} ${styles$b.link}`, onClick: () => onNavigate?.(item.href), children: item.label }))] }, index));
|
|
2943
|
+
}) }));
|
|
2944
|
+
};
|
|
2945
|
+
|
|
2946
|
+
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"};
|
|
2947
|
+
|
|
2948
|
+
/**
|
|
2949
|
+
* LiquidButton Component
|
|
2950
|
+
*
|
|
2951
|
+
* A floating action button that expands to reveal quick action options.
|
|
2952
|
+
* The main button rotates 45 degrees when expanded (Plus becomes X).
|
|
2953
|
+
* Actions fan out above the button with staggered animations.
|
|
2954
|
+
*
|
|
2955
|
+
* @example
|
|
2956
|
+
* <LiquidButton
|
|
2957
|
+
* actions={[
|
|
2958
|
+
* { key: 'add', label: 'Add Item', icon: Plus, color: '#2196F3', onClick: () => {} },
|
|
2959
|
+
* { key: 'edit', label: 'Edit', icon: Edit, color: '#FF9800', onClick: () => {} },
|
|
2960
|
+
* ]}
|
|
2961
|
+
* />
|
|
2962
|
+
*/
|
|
2963
|
+
const LiquidButton = ({ actions, icon: Icon = lucideReact.Plus, className = '', }) => {
|
|
2964
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
2965
|
+
const handleToggle = React.useCallback(() => {
|
|
2966
|
+
setExpanded((prev) => !prev);
|
|
2967
|
+
}, []);
|
|
2968
|
+
const handleAction = React.useCallback((action) => {
|
|
2969
|
+
setExpanded(false);
|
|
2970
|
+
action.onClick();
|
|
2971
|
+
}, []);
|
|
2972
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(framerMotion.AnimatePresence, { children: expanded && (jsxRuntime.jsx(framerMotion.motion.div, { className: styles$a.overlay, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: handleToggle })) }), jsxRuntime.jsxs("div", { className: `${styles$a.container} ${className}`, children: [jsxRuntime.jsx(framerMotion.AnimatePresence, { children: expanded && (jsxRuntime.jsx("div", { className: styles$a.actions, children: actions.map((action, index) => (jsxRuntime.jsxs(framerMotion.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: {
|
|
2973
|
+
duration: 0.15,
|
|
2974
|
+
delay: (actions.length - 1 - index) * 0.05,
|
|
2975
|
+
}, onClick: () => handleAction(action), children: [jsxRuntime.jsx(action.icon, { size: 18, color: action.color }), jsxRuntime.jsx("span", { className: styles$a.actionLabel, children: action.label })] }, action.key))) })) }), jsxRuntime.jsx(framerMotion.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: jsxRuntime.jsx(Icon, { size: 24, strokeWidth: 2.5 }) })] })] }));
|
|
2976
|
+
};
|
|
2977
|
+
|
|
2978
|
+
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"};
|
|
2663
2979
|
|
|
2664
2980
|
/**
|
|
2665
2981
|
* Calendar component - A flexible, reusable calendar for displaying events
|
|
@@ -2907,11 +3223,11 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
2907
3223
|
return Math.floor(diff / oneWeek) + 1;
|
|
2908
3224
|
};
|
|
2909
3225
|
if (loading) {
|
|
2910
|
-
return (jsxRuntime.jsx("div", { className: `${styles$
|
|
3226
|
+
return (jsxRuntime.jsx("div", { className: `${styles$9.calendar} ${styles$9.loading} ${className}`, style: style, children: jsxRuntime.jsx("div", { className: styles$9.loadingSpinner, children: "Loading..." }) }));
|
|
2911
3227
|
}
|
|
2912
|
-
return (jsxRuntime.jsxs("div", { className: `${styles$
|
|
3228
|
+
return (jsxRuntime.jsxs("div", { className: `${styles$9.calendar} ${className}`, style: style, children: [!hideHeader && (jsxRuntime.jsxs("div", { className: styles$9.header, children: [jsxRuntime.jsxs("div", { className: styles$9.navigation, children: [jsxRuntime.jsx("button", { onClick: handlePrevious, className: styles$9.navButton, "aria-label": "Previous", children: jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsxRuntime.jsx("polyline", { points: "15,18 9,12 15,6" }) }) }), jsxRuntime.jsx("h3", { className: styles$9.title, children: calendarData.displayTitle }), jsxRuntime.jsx("button", { onClick: handleNext, className: styles$9.navButton, "aria-label": "Next", children: jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsxRuntime.jsx("polyline", { points: "9,6 15,12 9,18" }) }) })] }), jsxRuntime.jsxs("div", { className: styles$9.controls, children: [jsxRuntime.jsx("button", { onClick: handleToday, className: styles$9.todayButton, children: "Today" }), jsxRuntime.jsxs("div", { className: styles$9.viewToggle, children: [jsxRuntime.jsx("button", { className: `${styles$9.viewButton} ${currentViewMode === 'month' ? styles$9.active : ''}`, onClick: () => setCurrentViewMode('month'), children: "Month" }), jsxRuntime.jsx("button", { className: `${styles$9.viewButton} ${currentViewMode === 'week' ? styles$9.active : ''}`, onClick: () => setCurrentViewMode('week'), children: "Week" }), jsxRuntime.jsx("button", { className: `${styles$9.viewButton} ${currentViewMode === 'day' ? styles$9.active : ''}`, onClick: () => setCurrentViewMode('day'), children: "Day" })] })] })] })), currentViewMode !== 'day' && (jsxRuntime.jsxs("div", { className: styles$9.weekDays, children: [showWeekNumbers && jsxRuntime.jsx("div", { className: styles$9.weekNumberHeader, children: "Week" }), finalDayLabels.map((day) => (jsxRuntime.jsx("div", { className: styles$9.weekDay, children: day }, day)))] })), currentViewMode === 'day' ? (
|
|
2913
3229
|
// Day view layout
|
|
2914
|
-
jsxRuntime.jsxs("div", { className: styles$
|
|
3230
|
+
jsxRuntime.jsxs("div", { className: styles$9.dayView, children: [jsxRuntime.jsxs("div", { className: styles$9.dayViewHeader, children: [jsxRuntime.jsx("div", { className: styles$9.timeColumnHeader }), jsxRuntime.jsx("div", { className: styles$9.dayColumnHeader, children: currentDate.toLocaleDateString(locale, { weekday: 'short', day: 'numeric' }) })] }), jsxRuntime.jsx("div", { className: styles$9.dayViewScrollContainer, ref: dayViewScrollRef, children: jsxRuntime.jsxs("div", { className: styles$9.dayViewContent, children: [(() => {
|
|
2915
3231
|
const now = new Date();
|
|
2916
3232
|
const currentHour = now.getHours();
|
|
2917
3233
|
const currentMinute = now.getMinutes();
|
|
@@ -2919,21 +3235,21 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
2919
3235
|
const topPosition = (minutesSinceMidnight / 1440) * (24 * 60); // 24 hours * 60px per hour
|
|
2920
3236
|
// Only show if viewing today
|
|
2921
3237
|
const isToday = currentDate.toDateString() === now.toDateString();
|
|
2922
|
-
return isToday ? (jsxRuntime.jsx("div", { className: styles$
|
|
2923
|
-
})(), jsxRuntime.jsx("div", { className: styles$
|
|
3238
|
+
return isToday ? (jsxRuntime.jsx("div", { className: styles$9.currentTimeIndicator, style: { top: `${topPosition}px` } })) : null;
|
|
3239
|
+
})(), jsxRuntime.jsx("div", { className: styles$9.timeColumn, children: Array.from({ length: 24 }, (_, hour) => (jsxRuntime.jsx("div", { className: styles$9.timeSlot, children: jsxRuntime.jsxs("span", { className: styles$9.timeLabel, children: [hour.toString().padStart(2, '0'), ":00"] }) }, hour))) }), jsxRuntime.jsx("div", { className: styles$9.dayColumn, children: Array.from({ length: 24 }, (_, hour) => {
|
|
2924
3240
|
const hourEvents = getDayEvents(currentDate).filter(event => {
|
|
2925
3241
|
if (!event.time)
|
|
2926
3242
|
return false;
|
|
2927
3243
|
const eventHour = parseInt(event.time.split(':')[0]);
|
|
2928
3244
|
return eventHour === hour;
|
|
2929
3245
|
});
|
|
2930
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
3246
|
+
return (jsxRuntime.jsxs("div", { className: styles$9.hourSlot, onClick: (e) => {
|
|
2931
3247
|
// Only trigger if clicking on the slot itself, not on an event
|
|
2932
3248
|
if (e.target === e.currentTarget ||
|
|
2933
|
-
e.target.classList.contains(styles$
|
|
3249
|
+
e.target.classList.contains(styles$9.hourLine)) {
|
|
2934
3250
|
handleTimeSlotClick(hour);
|
|
2935
3251
|
}
|
|
2936
|
-
}, style: { cursor: 'pointer' }, children: [jsxRuntime.jsx("div", { className: styles$
|
|
3252
|
+
}, style: { cursor: 'pointer' }, children: [jsxRuntime.jsx("div", { className: styles$9.hourLine }), hourEvents.map((event, eventIndex) => (jsxRuntime.jsxs(framerMotion.motion.div, { className: `${styles$9.dayEvent} ${event.status === 'completed' ? styles$9.completed : ''}`, style: {
|
|
2937
3253
|
backgroundColor: getEventColor(event),
|
|
2938
3254
|
color: getEventTextColor(event),
|
|
2939
3255
|
opacity: event.status === 'completed' ? 0.7 : 1
|
|
@@ -2951,17 +3267,17 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
2951
3267
|
}, whileTap: {
|
|
2952
3268
|
scale: 0.98,
|
|
2953
3269
|
transition: { duration: 0.1 }
|
|
2954
|
-
}, children: [iconRenderer && iconRenderer(event), jsxRuntime.jsxs("span", { className: styles$
|
|
2955
|
-
}) })] }) })] })) : (jsxRuntime.jsx("div", { className: `${styles$
|
|
3270
|
+
}, children: [iconRenderer && iconRenderer(event), jsxRuntime.jsxs("span", { className: styles$9.dayEventTitle, children: [jsxRuntime.jsx("span", { className: styles$9.dayEventTime, children: event.time }), event.title] }), event.status === 'completed' && (jsxRuntime.jsx("svg", { className: styles$9.completedIcon, width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsxRuntime.jsx("polyline", { points: "20,6 9,17 4,12" }) }))] }, event.id)))] }, hour));
|
|
3271
|
+
}) })] }) })] })) : (jsxRuntime.jsx("div", { className: `${styles$9.daysGrid} ${currentViewMode === 'week' ? styles$9.weekView : ''}`, children: calendarData.days.map((day, index) => {
|
|
2956
3272
|
const dayEvents = getDayEvents(day);
|
|
2957
3273
|
const dayIsToday = isToday(day);
|
|
2958
3274
|
const isInCurrentMonth = currentViewMode === 'week' || isCurrentMonth(day);
|
|
2959
3275
|
const isWeekStart = showWeekNumbers && (index % 7 === 0);
|
|
2960
|
-
return (jsxRuntime.jsxs(framerMotion.motion.div, { className: `${styles$
|
|
3276
|
+
return (jsxRuntime.jsxs(framerMotion.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: {
|
|
2961
3277
|
duration: 0.3,
|
|
2962
3278
|
delay: index * 0.02,
|
|
2963
3279
|
ease: "easeOut"
|
|
2964
|
-
}, onClick: () => handleDateClick(day), children: [isWeekStart && (jsxRuntime.jsx("div", { className: styles$
|
|
3280
|
+
}, onClick: () => handleDateClick(day), children: [isWeekStart && (jsxRuntime.jsx("div", { className: styles$9.weekNumber, children: getWeekNumber(day) })), jsxRuntime.jsx("div", { className: styles$9.dayNumber, children: day.getDate() }), dayEvents.length > 0 && (jsxRuntime.jsxs("div", { className: styles$9.events, children: [dayEvents.slice(0, maxEventsPerDay).map((event, eventIndex) => (jsxRuntime.jsxs(framerMotion.motion.div, { className: `${styles$9.event} ${event.status === 'completed' ? styles$9.completed : ''}`, style: {
|
|
2965
3281
|
backgroundColor: getEventColor(event),
|
|
2966
3282
|
color: getEventTextColor(event),
|
|
2967
3283
|
opacity: event.status === 'completed' ? 0.7 : 1
|
|
@@ -2979,7 +3295,7 @@ function Calendar({ events, onEventClick, onDateClick, onEventClickByView, onDat
|
|
|
2979
3295
|
}, whileTap: {
|
|
2980
3296
|
scale: 0.98,
|
|
2981
3297
|
transition: { duration: 0.1 }
|
|
2982
|
-
}, children: [iconRenderer && iconRenderer(event), jsxRuntime.jsxs("span", { className: styles$
|
|
3298
|
+
}, children: [iconRenderer && iconRenderer(event), jsxRuntime.jsxs("span", { className: styles$9.eventTitle, children: [event.time && (jsxRuntime.jsx("span", { className: styles$9.eventTime, children: event.time })), event.title] }), event.status === 'completed' && (jsxRuntime.jsx("svg", { className: styles$9.completedIcon, width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: jsxRuntime.jsx("polyline", { points: "20,6 9,17 4,12" }) }))] }, event.id))), dayEvents.length > maxEventsPerDay && (jsxRuntime.jsxs("div", { className: styles$9.moreEvents, children: ["+", dayEvents.length - maxEventsPerDay, " more"] }))] })), dayEvents.length === 0 && emptyState && (jsxRuntime.jsx("div", { className: styles$9.emptyState, children: emptyState }))] }, `${day.getFullYear()}-${day.getMonth()}-${day.getDate()}`));
|
|
2983
3299
|
}) }))] }));
|
|
2984
3300
|
}
|
|
2985
3301
|
|
|
@@ -3049,10 +3365,10 @@ const Navbar = ({ items, logo, onItemClick, variant = 'sidebar', isMobile = fals
|
|
|
3049
3365
|
if (variant === 'top') {
|
|
3050
3366
|
return (jsxRuntime.jsx(framerMotion.motion.nav, { className: `${styles.navbar} ${styles.navbarTop} ${className}`, initial: { y: -100 }, animate: { y: 0 }, transition: { type: "spring", stiffness: 300, damping: 30 }, children: navContent }));
|
|
3051
3367
|
}
|
|
3052
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(isMobile || window.innerWidth <= 768) && (jsxRuntime.jsx(framerMotion.motion.button, { className: styles.mobileMenuButton, onClick: toggleMobileMenu, "aria-label": "Toggle navigation menu", whileTap: { scale: 0.9 }, children: jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isMobileMenuOpen ? (jsxRuntime.jsx(framerMotion.motion.div, { initial: { rotate: -90, opacity: 0 }, animate: { rotate: 0, opacity: 1 }, exit: { rotate: 90, opacity: 0 }, children: jsxRuntime.jsx(
|
|
3368
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(isMobile || window.innerWidth <= 768) && (jsxRuntime.jsx(framerMotion.motion.button, { className: styles.mobileMenuButton, onClick: toggleMobileMenu, "aria-label": "Toggle navigation menu", whileTap: { scale: 0.9 }, children: jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isMobileMenuOpen ? (jsxRuntime.jsx(framerMotion.motion.div, { initial: { rotate: -90, opacity: 0 }, animate: { rotate: 0, opacity: 1 }, exit: { rotate: 90, opacity: 0 }, children: jsxRuntime.jsx(lucideReact.X, {}) }, "close")) : (jsxRuntime.jsx(framerMotion.motion.div, { initial: { rotate: 90, opacity: 0 }, animate: { rotate: 0, opacity: 1 }, exit: { rotate: -90, opacity: 0 }, children: jsxRuntime.jsx(lucideReact.Menu, {}) }, "menu")) }) })), jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isMobileMenuOpen && (jsxRuntime.jsx(framerMotion.motion.div, { className: styles.mobileBackdrop, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: () => setIsMobileMenuOpen(false) })) }), jsxRuntime.jsx(framerMotion.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 })] }));
|
|
3053
3369
|
};
|
|
3054
3370
|
|
|
3055
|
-
var styles$
|
|
3371
|
+
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"};
|
|
3056
3372
|
|
|
3057
3373
|
const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
3058
3374
|
const svgRef = React.useRef(null);
|
|
@@ -3061,7 +3377,7 @@ const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
|
3061
3377
|
const [selectedMood, setSelectedMood] = React.useState(null);
|
|
3062
3378
|
const [tooltipPosition, setTooltipPosition] = React.useState({ x: 0, y: 0 });
|
|
3063
3379
|
const [isHoveringTooltip, setIsHoveringTooltip] = React.useState(false);
|
|
3064
|
-
const margin = { top: 20, right: 20, bottom: 50, left: 40 };
|
|
3380
|
+
const margin = React.useMemo(() => ({ top: 20, right: 20, bottom: 50, left: 40 }), []);
|
|
3065
3381
|
const chartWidth = width - margin.left - margin.right;
|
|
3066
3382
|
const chartHeight = height - margin.top - margin.bottom;
|
|
3067
3383
|
const processedData = React.useMemo(() => {
|
|
@@ -3110,27 +3426,27 @@ const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
|
3110
3426
|
g.selectAll('.grid-line-y')
|
|
3111
3427
|
.data(yScale.ticks(5))
|
|
3112
3428
|
.enter().append('line')
|
|
3113
|
-
.attr('class', styles$
|
|
3429
|
+
.attr('class', styles$8.gridLine)
|
|
3114
3430
|
.attr('x1', 0)
|
|
3115
3431
|
.attr('y1', d => yScale(d))
|
|
3116
3432
|
.attr('x2', chartWidth)
|
|
3117
3433
|
.attr('y2', d => yScale(d));
|
|
3118
3434
|
g.append('path')
|
|
3119
3435
|
.datum(processedData)
|
|
3120
|
-
.attr('class', styles$
|
|
3436
|
+
.attr('class', styles$8.line)
|
|
3121
3437
|
.attr('d', line);
|
|
3122
3438
|
g.append('g')
|
|
3123
|
-
.attr('class', styles$
|
|
3439
|
+
.attr('class', styles$8.xAxis)
|
|
3124
3440
|
.attr('transform', `translate(0,${chartHeight})`)
|
|
3125
3441
|
.call(d3__namespace.axisBottom(xScale)
|
|
3126
3442
|
.tickFormat(d => d3__namespace.timeFormat('%m/%d')(d)));
|
|
3127
3443
|
g.append('g')
|
|
3128
|
-
.attr('class', styles$
|
|
3444
|
+
.attr('class', styles$8.yAxis)
|
|
3129
3445
|
.call(d3__namespace.axisLeft(yScale));
|
|
3130
3446
|
g.selectAll('.mood-circle')
|
|
3131
3447
|
.data(processedData)
|
|
3132
3448
|
.enter().append('circle')
|
|
3133
|
-
.attr('class', styles$
|
|
3449
|
+
.attr('class', styles$8.dataPoint)
|
|
3134
3450
|
.attr('cx', d => xScale(d.date))
|
|
3135
3451
|
.attr('cy', d => yScale(d.rating))
|
|
3136
3452
|
.attr('r', 5)
|
|
@@ -3184,7 +3500,7 @@ const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
|
3184
3500
|
setSelectedMood(null);
|
|
3185
3501
|
};
|
|
3186
3502
|
}, []);
|
|
3187
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
3503
|
+
return (jsxRuntime.jsxs("div", { className: styles$8.container, ref: containerRef, children: [jsxRuntime.jsx("svg", { ref: svgRef, width: width, height: height, className: styles$8.chart }), selectedMood && (jsxRuntime.jsxs("div", { ref: tooltipRef, className: styles$8.tooltip, style: {
|
|
3188
3504
|
position: 'absolute',
|
|
3189
3505
|
pointerEvents: 'auto',
|
|
3190
3506
|
left: tooltipPosition.x,
|
|
@@ -3193,10 +3509,10 @@ const MoodChart = ({ moodData, width = 800, height = 400 }) => {
|
|
|
3193
3509
|
}, onMouseEnter: () => setIsHoveringTooltip(true), onMouseLeave: () => {
|
|
3194
3510
|
setIsHoveringTooltip(false);
|
|
3195
3511
|
setSelectedMood(null);
|
|
3196
|
-
}, children: [jsxRuntime.jsxs("div", { className: styles$
|
|
3512
|
+
}, children: [jsxRuntime.jsxs("div", { className: styles$8.tooltipHeader, children: [jsxRuntime.jsx("div", { className: styles$8.tooltipDate, children: selectedMood.date.toLocaleDateString() }), jsxRuntime.jsxs("div", { className: styles$8.tooltipRating, children: [jsxRuntime.jsx("span", { className: styles$8.ratingValue, children: selectedMood.rating }), jsxRuntime.jsx("span", { className: styles$8.ratingMax, children: "/10" })] })] }), selectedMood.tags.length > 0 && (jsxRuntime.jsx("div", { className: styles$8.tooltipTags, children: selectedMood.tags.map((tag, index) => (jsxRuntime.jsx("span", { className: styles$8.tag, children: tag }, index))) })), selectedMood.comment && (jsxRuntime.jsx("div", { className: styles$8.tooltipComment, children: selectedMood.comment }))] }))] }));
|
|
3197
3513
|
};
|
|
3198
3514
|
|
|
3199
|
-
var styles$
|
|
3515
|
+
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"};
|
|
3200
3516
|
|
|
3201
3517
|
// Default colors as fallback
|
|
3202
3518
|
const DEFAULT_HABIT_COLORS = {
|
|
@@ -3209,7 +3525,7 @@ const DEFAULT_HABIT_COLORS = {
|
|
|
3209
3525
|
'Calories': '#FF9F1C',
|
|
3210
3526
|
'Study': '#C774E8'
|
|
3211
3527
|
};
|
|
3212
|
-
const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewType = 'daily', periodType = 'month', habitColors: customHabitColors = {}, habitEmojis: customHabitEmojis = {}, onDataPointClick }) => {
|
|
3528
|
+
const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewType = 'daily', periodType = 'month', habitColors: customHabitColors = {}, habitEmojis: customHabitEmojis = {}, onDataPointClick, hideControls = false, compactLegend = false }) => {
|
|
3213
3529
|
const svgRef = React.useRef(null);
|
|
3214
3530
|
const tooltipRef = React.useRef(null);
|
|
3215
3531
|
const [viewType, setViewType] = React.useState(defaultViewType);
|
|
@@ -3217,7 +3533,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3217
3533
|
const [hoveredHabit, setHoveredHabit] = React.useState(null);
|
|
3218
3534
|
const [tooltipData, setTooltipData] = React.useState(null);
|
|
3219
3535
|
const [aggregationMode, setAggregationMode] = React.useState('average');
|
|
3220
|
-
const margin = { top: 20, right: 20, bottom: 50, left: 50 };
|
|
3536
|
+
const margin = React.useMemo(() => ({ top: 20, right: 20, bottom: 50, left: 50 }), []);
|
|
3221
3537
|
const chartWidth = width - margin.left - margin.right;
|
|
3222
3538
|
const chartHeight = height - margin.top - margin.bottom;
|
|
3223
3539
|
const habits = React.useMemo(() => Object.keys(data).filter(key => key !== 'dates'), [data]);
|
|
@@ -3250,10 +3566,10 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3250
3566
|
return ['daily'];
|
|
3251
3567
|
}
|
|
3252
3568
|
}, [periodType]);
|
|
3253
|
-
const getColor = (habit) => {
|
|
3569
|
+
const getColor = React.useCallback((habit) => {
|
|
3254
3570
|
// First check custom colors, then defaults, then generate deterministic color
|
|
3255
3571
|
return customHabitColors[habit] || DEFAULT_HABIT_COLORS[habit] || `hsl(${Math.abs(habit.split('').reduce((a, b) => a + b.charCodeAt(0), 0)) % 360}, 70%, 50%)`;
|
|
3256
|
-
};
|
|
3572
|
+
}, [customHabitColors]);
|
|
3257
3573
|
// Aggregate data based on view type
|
|
3258
3574
|
const aggregateData = React.useMemo(() => {
|
|
3259
3575
|
if (viewType === 'daily' || !data.dates.length) {
|
|
@@ -3349,7 +3665,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3349
3665
|
g.selectAll('.grid-line-y')
|
|
3350
3666
|
.data(yScale.ticks(5))
|
|
3351
3667
|
.enter().append('line')
|
|
3352
|
-
.attr('class', styles$
|
|
3668
|
+
.attr('class', styles$7.gridLine)
|
|
3353
3669
|
.attr('x1', 0)
|
|
3354
3670
|
.attr('y1', d => yScale(d))
|
|
3355
3671
|
.attr('x2', chartWidth)
|
|
@@ -3362,7 +3678,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3362
3678
|
const habitData = dates.map((date, i) => [date, aggregateData[habit][i]]).filter(d => typeof d[1] === 'number');
|
|
3363
3679
|
g.append('path')
|
|
3364
3680
|
.datum(habitData)
|
|
3365
|
-
.attr('class', styles$
|
|
3681
|
+
.attr('class', styles$7.line)
|
|
3366
3682
|
.attr('d', line)
|
|
3367
3683
|
.attr('stroke', getColor(habit))
|
|
3368
3684
|
.attr('opacity', hoveredHabit && hoveredHabit !== habit ? 0.3 : 1);
|
|
@@ -3409,7 +3725,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3409
3725
|
g.selectAll(`.circle-${habit}`)
|
|
3410
3726
|
.data(habitData)
|
|
3411
3727
|
.enter().append('circle')
|
|
3412
|
-
.attr('class', (_d, i) => `${styles$
|
|
3728
|
+
.attr('class', (_d, i) => `${styles$7.dataPoint} circle-${habit}-${i}`)
|
|
3413
3729
|
.attr('cx', d => xScale(d[0]))
|
|
3414
3730
|
.attr('cy', d => yScale(d[1]))
|
|
3415
3731
|
.attr('r', 4)
|
|
@@ -3471,7 +3787,7 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3471
3787
|
xAxisGenerator.ticks(tickCount);
|
|
3472
3788
|
}
|
|
3473
3789
|
const xAxis = g.append('g')
|
|
3474
|
-
.attr('class', styles$
|
|
3790
|
+
.attr('class', styles$7.xAxis)
|
|
3475
3791
|
.attr('transform', `translate(0,${chartHeight})`)
|
|
3476
3792
|
.call(xAxisGenerator);
|
|
3477
3793
|
// Rotate labels for better readability if needed
|
|
@@ -3483,9 +3799,9 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3483
3799
|
.attr('transform', 'rotate(-45)');
|
|
3484
3800
|
}
|
|
3485
3801
|
g.append('g')
|
|
3486
|
-
.attr('class', styles$
|
|
3802
|
+
.attr('class', styles$7.yAxis)
|
|
3487
3803
|
.call(d3__namespace.axisLeft(yScale));
|
|
3488
|
-
}, [aggregateData, activeHabits, chartWidth, chartHeight, margin, hoveredHabit,
|
|
3804
|
+
}, [aggregateData, activeHabits, chartWidth, chartHeight, margin, hoveredHabit, onDataPointClick, getColor, height, viewType, width]);
|
|
3489
3805
|
// Format date for tooltip display
|
|
3490
3806
|
const formatTooltipDate = (dateStr, viewType) => {
|
|
3491
3807
|
const date = new Date(dateStr);
|
|
@@ -3515,13 +3831,13 @@ const QuantifiableHabitsChart = ({ data, width = 800, height = 400, defaultViewT
|
|
|
3515
3831
|
quarterly: { icon: '📊', label: 'Quarterly' }
|
|
3516
3832
|
};
|
|
3517
3833
|
const shouldShowAggregationToggle = viewType !== 'daily';
|
|
3518
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
3834
|
+
return (jsxRuntime.jsxs("div", { className: styles$7.container, children: [!hideControls && (jsxRuntime.jsxs("div", { className: styles$7.controls, children: [jsxRuntime.jsx("div", { className: styles$7.viewToggle, children: availableViewTypes.map(type => (jsxRuntime.jsxs("button", { className: `${styles$7.viewButton} ${viewType === type ? styles$7.active : ''}`, onClick: () => setViewType(type), title: viewTypeConfig[type].label, children: [jsxRuntime.jsx("span", { className: styles$7.viewIcon, children: viewTypeConfig[type].icon }), jsxRuntime.jsx("span", { className: styles$7.viewLabel, children: viewTypeConfig[type].label })] }, type))) }), shouldShowAggregationToggle && (jsxRuntime.jsxs("div", { className: styles$7.aggregationToggle, children: [jsxRuntime.jsxs("button", { className: `${styles$7.aggregationButton} ${aggregationMode === 'average' ? styles$7.active : ''}`, onClick: () => setAggregationMode('average'), title: "Show average values for each period", children: [jsxRuntime.jsx("span", { className: styles$7.aggregationIcon, children: "\uD83D\uDCCA" }), jsxRuntime.jsx("span", { className: styles$7.aggregationLabel, children: "Average" })] }), jsxRuntime.jsxs("button", { className: `${styles$7.aggregationButton} ${aggregationMode === 'sum' ? styles$7.active : ''}`, onClick: () => setAggregationMode('sum'), title: "Show total values for each period", children: [jsxRuntime.jsx("span", { className: styles$7.aggregationIcon, children: "\u2795" }), jsxRuntime.jsx("span", { className: styles$7.aggregationLabel, children: "Sum" })] })] }))] })), jsxRuntime.jsx("div", { className: `${styles$7.legend}${compactLegend ? ` ${styles$7.compactLegend}` : ''}`, children: habits.map(habit => (jsxRuntime.jsxs("button", { className: `${styles$7.legendItem} ${!activeHabits.includes(habit) ? styles$7.inactive : ''}`, onClick: () => toggleHabit(habit), onMouseEnter: () => setHoveredHabit(habit), onMouseLeave: () => setHoveredHabit(null), children: [jsxRuntime.jsx("span", { className: styles$7.legendEmoji, children: customHabitEmojis[habit] || '📊' }), jsxRuntime.jsx("span", { className: styles$7.legendColor, style: { backgroundColor: getColor(habit) } }), jsxRuntime.jsx("span", { className: styles$7.legendLabel, children: habit })] }, habit))) }), jsxRuntime.jsx("svg", { ref: svgRef, width: width, height: height, className: styles$7.chart }), tooltipData && (jsxRuntime.jsxs("div", { ref: tooltipRef, className: `${styles$7.tooltip} ${tooltipData ? styles$7.visible : ''}`, style: {
|
|
3519
3835
|
left: `${tooltipData.x}px`,
|
|
3520
3836
|
top: `${tooltipData.y - 80}px`
|
|
3521
|
-
}, children: [jsxRuntime.jsxs("div", { className: styles$
|
|
3837
|
+
}, children: [jsxRuntime.jsxs("div", { className: styles$7.tooltipHeader, children: [jsxRuntime.jsx("span", { className: styles$7.tooltipEmoji, children: customHabitEmojis[tooltipData.habit] || '📊' }), jsxRuntime.jsx("span", { className: styles$7.tooltipDot, style: { backgroundColor: getColor(tooltipData.habit) } }), jsxRuntime.jsx("span", { children: tooltipData.habit })] }), jsxRuntime.jsxs("div", { className: styles$7.tooltipInfo, children: [jsxRuntime.jsx("div", { className: styles$7.tooltipDate, children: formatTooltipDate(tooltipData.date, viewType) }), jsxRuntime.jsxs("div", { className: styles$7.tooltipValue, children: [jsxRuntime.jsx("strong", { children: Math.round(tooltipData.value * 10) / 10 }), jsxRuntime.jsx("span", { style: { fontSize: '12px', fontWeight: 'normal', opacity: 0.6 }, children: "units" })] })] })] }))] }));
|
|
3522
3838
|
};
|
|
3523
3839
|
|
|
3524
|
-
var styles$
|
|
3840
|
+
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"};
|
|
3525
3841
|
|
|
3526
3842
|
const parseTimeToDecimal = (time) => {
|
|
3527
3843
|
const [hours, minutes] = time.split(':').map(Number);
|
|
@@ -3579,7 +3895,7 @@ const SleepChart = ({ sleepData, width = 800, height = 400, onDateClick }) => {
|
|
|
3579
3895
|
g.selectAll('.grid-line-x')
|
|
3580
3896
|
.data(d3__namespace.range(18, 43, 1))
|
|
3581
3897
|
.enter().append('line')
|
|
3582
|
-
.attr('class', styles$
|
|
3898
|
+
.attr('class', styles$6.gridLine)
|
|
3583
3899
|
.attr('x1', d => xScale(d))
|
|
3584
3900
|
.attr('y1', 0)
|
|
3585
3901
|
.attr('x2', d => xScale(d))
|
|
@@ -3612,7 +3928,7 @@ const SleepChart = ({ sleepData, width = 800, height = 400, onDateClick }) => {
|
|
|
3612
3928
|
return;
|
|
3613
3929
|
const barHeight = yScale.bandwidth();
|
|
3614
3930
|
const sleepGroup = g.append('g')
|
|
3615
|
-
.attr('class', styles$
|
|
3931
|
+
.attr('class', styles$6.sleepBar)
|
|
3616
3932
|
.style('cursor', 'pointer')
|
|
3617
3933
|
.on('click', () => onDateClick?.(dayData.date));
|
|
3618
3934
|
// Handle sleep time and wake hour separately
|
|
@@ -3778,7 +4094,7 @@ const SleepChart = ({ sleepData, width = 800, height = 400, onDateClick }) => {
|
|
|
3778
4094
|
(hour % 24) === 12 ? '12 PM' : `${(hour % 24) - 12} PM`
|
|
3779
4095
|
}));
|
|
3780
4096
|
const xAxis = g.append('g')
|
|
3781
|
-
.attr('class', styles$
|
|
4097
|
+
.attr('class', styles$6.xAxis)
|
|
3782
4098
|
.attr('transform', `translate(0,${chartHeight})`)
|
|
3783
4099
|
.call(d3__namespace.axisBottom(xScale)
|
|
3784
4100
|
.tickValues(xAxisTicks.map(t => t.value))
|
|
@@ -3795,25 +4111,25 @@ const SleepChart = ({ sleepData, width = 800, height = 400, onDateClick }) => {
|
|
|
3795
4111
|
});
|
|
3796
4112
|
const yAxisTicks = yDomain.filter((_, i) => i % Math.ceil(yDomain.length / 10) === 0);
|
|
3797
4113
|
g.append('g')
|
|
3798
|
-
.attr('class', styles$
|
|
4114
|
+
.attr('class', styles$6.yAxis)
|
|
3799
4115
|
.call(d3__namespace.axisLeft(yScale)
|
|
3800
4116
|
.tickValues(yAxisTicks)
|
|
3801
4117
|
.tickFormat(d => {
|
|
3802
4118
|
const date = new Date(d);
|
|
3803
4119
|
return `${(date.getMonth() + 1).toString().padStart(2, '0')}/${date.getDate().toString().padStart(2, '0')}`;
|
|
3804
4120
|
}));
|
|
3805
|
-
}, [sleepData, chartWidth, chartHeight, margin, onDateClick]);
|
|
3806
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
4121
|
+
}, [sleepData, chartWidth, chartHeight, margin, onDateClick, height, width]);
|
|
4122
|
+
return (jsxRuntime.jsxs("div", { className: styles$6.container, children: [jsxRuntime.jsxs("div", { className: styles$6.header, children: [jsxRuntime.jsx("h3", { className: styles$6.title, children: "Sleep Pattern" }), jsxRuntime.jsxs("div", { className: styles$6.legend, children: [jsxRuntime.jsxs("div", { className: styles$6.legendItem, children: [jsxRuntime.jsx("span", { className: styles$6.sleepDot }), jsxRuntime.jsx("span", { children: "Sleep Time" })] }), jsxRuntime.jsxs("div", { className: styles$6.legendItem, children: [jsxRuntime.jsx("span", { className: styles$6.wakeDot }), jsxRuntime.jsx("span", { children: "Wake Time" })] })] })] }), jsxRuntime.jsx("svg", { ref: svgRef, width: width, height: height, className: styles$6.chart }), tooltipData && (jsxRuntime.jsxs("div", { className: `${styles$6.tooltip} ${tooltipData ? styles$6.visible : ''}`, style: {
|
|
3807
4123
|
left: `${tooltipData.x}px`,
|
|
3808
4124
|
top: `${tooltipData.y}px`
|
|
3809
|
-
}, children: [jsxRuntime.jsxs("div", { className: styles$
|
|
4125
|
+
}, children: [jsxRuntime.jsxs("div", { className: styles$6.tooltipHeader, children: [jsxRuntime.jsx("span", { className: styles$6.tooltipEmoji, children: "\uD83D\uDE34" }), jsxRuntime.jsx("span", { children: new Date(tooltipData.date).toLocaleDateString('en-US', {
|
|
3810
4126
|
weekday: 'short',
|
|
3811
4127
|
month: 'short',
|
|
3812
4128
|
day: 'numeric'
|
|
3813
|
-
}) })] }), jsxRuntime.jsxs("div", { className: styles$
|
|
4129
|
+
}) })] }), jsxRuntime.jsxs("div", { className: styles$6.tooltipInfo, children: [tooltipData.sleepTime && (jsxRuntime.jsxs("div", { className: styles$6.tooltipRow, children: [jsxRuntime.jsxs("span", { className: styles$6.tooltipLabel, children: [jsxRuntime.jsx("span", { children: "\uD83C\uDF19" }), jsxRuntime.jsx("span", { children: "Sleep:" })] }), jsxRuntime.jsx("span", { className: styles$6.tooltipValue, children: tooltipData.sleepTime })] })), tooltipData.wakeTime && (jsxRuntime.jsxs("div", { className: styles$6.tooltipRow, children: [jsxRuntime.jsxs("span", { className: styles$6.tooltipLabel, children: [jsxRuntime.jsx("span", { children: "\u2600\uFE0F" }), jsxRuntime.jsx("span", { children: "Wake:" })] }), jsxRuntime.jsx("span", { className: styles$6.tooltipValue, children: tooltipData.wakeTime })] })), tooltipData.duration !== null && (jsxRuntime.jsxs("div", { className: styles$6.tooltipDuration, children: [jsxRuntime.jsx("span", { children: "\u23F1\uFE0F" }), jsxRuntime.jsxs("span", { children: [Math.floor(tooltipData.duration), "h ", Math.round((tooltipData.duration % 1) * 60), "m"] })] }))] })] }))] }));
|
|
3814
4130
|
};
|
|
3815
4131
|
|
|
3816
|
-
var styles$
|
|
4132
|
+
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"};
|
|
3817
4133
|
|
|
3818
4134
|
const DAYS_OF_WEEK = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
3819
4135
|
const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
@@ -3867,20 +4183,20 @@ const BooleansHeatmap = ({ data, habitName, width = 800, height = 200, habitColo
|
|
|
3867
4183
|
g.append('text')
|
|
3868
4184
|
.attr('x', weekIndex * (cellSize + cellGap))
|
|
3869
4185
|
.attr('y', -10)
|
|
3870
|
-
.attr('class', styles$
|
|
4186
|
+
.attr('class', styles$5.monthLabel)
|
|
3871
4187
|
.text(MONTHS[month]);
|
|
3872
4188
|
});
|
|
3873
4189
|
DAYS_OF_WEEK.forEach((day, index) => {
|
|
3874
4190
|
g.append('text')
|
|
3875
4191
|
.attr('x', -10)
|
|
3876
4192
|
.attr('y', index * (cellSize + cellGap) + cellSize / 2)
|
|
3877
|
-
.attr('class', styles$
|
|
4193
|
+
.attr('class', styles$5.dayLabel)
|
|
3878
4194
|
.attr('text-anchor', 'end')
|
|
3879
4195
|
.attr('alignment-baseline', 'middle')
|
|
3880
4196
|
.text(day);
|
|
3881
4197
|
});
|
|
3882
4198
|
const tooltip = d3__namespace.select('body').append('div')
|
|
3883
|
-
.attr('class', styles$
|
|
4199
|
+
.attr('class', styles$5.tooltip)
|
|
3884
4200
|
.style('opacity', 0)
|
|
3885
4201
|
.style('position', 'absolute');
|
|
3886
4202
|
const daysToShow = weeksToShow * 7;
|
|
@@ -3899,7 +4215,7 @@ const BooleansHeatmap = ({ data, habitName, width = 800, height = 200, habitColo
|
|
|
3899
4215
|
.attr('width', cellSize)
|
|
3900
4216
|
.attr('height', cellSize)
|
|
3901
4217
|
.attr('rx', 3)
|
|
3902
|
-
.attr('class', styles$
|
|
4218
|
+
.attr('class', styles$5.cell)
|
|
3903
4219
|
.attr('data-date', dateString)
|
|
3904
4220
|
.attr('data-value', isTrue ? 'true' : 'false')
|
|
3905
4221
|
.style('fill', isTrue ? habitColor : '#4D4D4DFF');
|
|
@@ -3927,10 +4243,10 @@ const BooleansHeatmap = ({ data, habitName, width = 800, height = 200, habitColo
|
|
|
3927
4243
|
tooltip.remove();
|
|
3928
4244
|
};
|
|
3929
4245
|
}, [data, habitName, width, height, startDate, endDate, weeksToShow, habitColor, habitEmoji]);
|
|
3930
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
4246
|
+
return (jsxRuntime.jsxs("div", { className: styles$5.container, children: [jsxRuntime.jsxs("h3", { className: styles$5.title, children: [jsxRuntime.jsx("span", { className: styles$5.habitEmoji, children: habitEmoji }), habitName] }), jsxRuntime.jsx("svg", { ref: svgRef, width: width, height: height, className: styles$5.chart }), jsxRuntime.jsxs("div", { className: styles$5.legend, children: [jsxRuntime.jsxs("span", { className: styles$5.legendItem, children: [jsxRuntime.jsx("span", { className: styles$5.legendColor, style: { backgroundColor: habitColor } }), "Done"] }), jsxRuntime.jsxs("span", { className: styles$5.legendItem, children: [jsxRuntime.jsx("span", { className: styles$5.legendColor, style: { backgroundColor: '#4D4D4DFF' } }), "Not done"] })] })] }));
|
|
3931
4247
|
};
|
|
3932
4248
|
|
|
3933
|
-
var styles$
|
|
4249
|
+
var styles$4 = {"container":"SunburstChart-module_container__w1ZYc","title":"SunburstChart-module_title__T6Ak7","chart":"SunburstChart-module_chart__BFM6E","tooltip":"SunburstChart-module_tooltip__TuTAN"};
|
|
3934
4250
|
|
|
3935
4251
|
const COLOR_PALETTE = [
|
|
3936
4252
|
'#6366f1', '#8b5cf6', '#06b6d4', '#10b981',
|
|
@@ -3957,6 +4273,15 @@ const getTextColor$1 = (backgroundColor) => {
|
|
|
3957
4273
|
// Use a threshold of 0.5 for better contrast
|
|
3958
4274
|
return luminance > 0.5 ? '#000000' : '#ffffff';
|
|
3959
4275
|
};
|
|
4276
|
+
// Helper to create an interpolated arc generator for transitions
|
|
4277
|
+
const createInterpolatedArc = (currX0, currX1, currY0, currY1, radius) => {
|
|
4278
|
+
return d3__namespace.arc()
|
|
4279
|
+
.startAngle(() => currX0)
|
|
4280
|
+
.endAngle(() => currX1)
|
|
4281
|
+
.innerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY0))))
|
|
4282
|
+
.outerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY1))))
|
|
4283
|
+
.cornerRadius(3);
|
|
4284
|
+
};
|
|
3960
4285
|
const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Chart', tagColors = {}, unit = 'items', centerLabel }) => {
|
|
3961
4286
|
const svgRef = React.useRef(null);
|
|
3962
4287
|
const colorMap = React.useRef(new Map()).current;
|
|
@@ -3997,6 +4322,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
3997
4322
|
const partition = d3__namespace.partition()
|
|
3998
4323
|
.size([2 * Math.PI, radius * radius]);
|
|
3999
4324
|
const nodes = partition(root).descendants();
|
|
4325
|
+
// Store original positions for reset
|
|
4000
4326
|
nodes.forEach((d) => {
|
|
4001
4327
|
const node = d;
|
|
4002
4328
|
node.x0Original = d.x0;
|
|
@@ -4011,7 +4337,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4011
4337
|
.outerRadius(d => Math.sqrt(d.y1))
|
|
4012
4338
|
.cornerRadius(3);
|
|
4013
4339
|
const tooltip = d3__namespace.select('body').append('div')
|
|
4014
|
-
.attr('class', styles$
|
|
4340
|
+
.attr('class', styles$4.tooltip)
|
|
4015
4341
|
.style('opacity', 0)
|
|
4016
4342
|
.style('position', 'absolute');
|
|
4017
4343
|
// Function to reset to original view
|
|
@@ -4036,12 +4362,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4036
4362
|
node.x1 = currX1;
|
|
4037
4363
|
node.y0 = currY0;
|
|
4038
4364
|
node.y1 = currY1;
|
|
4039
|
-
const interpolatedArc =
|
|
4040
|
-
.startAngle(() => currX0)
|
|
4041
|
-
.endAngle(() => currX1)
|
|
4042
|
-
.innerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY0))))
|
|
4043
|
-
.outerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY1))))
|
|
4044
|
-
.cornerRadius(3);
|
|
4365
|
+
const interpolatedArc = createInterpolatedArc(currX0, currX1, currY0, currY1, radius);
|
|
4045
4366
|
return interpolatedArc(node) || '';
|
|
4046
4367
|
};
|
|
4047
4368
|
});
|
|
@@ -4097,7 +4418,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4097
4418
|
}
|
|
4098
4419
|
// Calculate new positions based on the original positions
|
|
4099
4420
|
// ALWAYS scale to fill the full circle, no minimum size preservation
|
|
4100
|
-
|
|
4421
|
+
const newX0 = xScale(node.x0Original);
|
|
4101
4422
|
let newX1 = xScale(node.x1Original);
|
|
4102
4423
|
// Ensure proper scaling even for very small segments
|
|
4103
4424
|
// The clicked node's extent should always map to full circle
|
|
@@ -4142,12 +4463,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4142
4463
|
node.x1 = currX1;
|
|
4143
4464
|
node.y0 = currY0;
|
|
4144
4465
|
node.y1 = currY1;
|
|
4145
|
-
const interpolatedArc =
|
|
4146
|
-
.startAngle(() => currX0)
|
|
4147
|
-
.endAngle(() => currX1)
|
|
4148
|
-
.innerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY0))))
|
|
4149
|
-
.outerRadius(() => Math.min(radius, Math.sqrt(Math.max(0, currY1))))
|
|
4150
|
-
.cornerRadius(3);
|
|
4466
|
+
const interpolatedArc = createInterpolatedArc(currX0, currX1, currY0, currY1, radius);
|
|
4151
4467
|
return interpolatedArc(node) || '';
|
|
4152
4468
|
};
|
|
4153
4469
|
});
|
|
@@ -4173,7 +4489,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4173
4489
|
const paths = g.selectAll('path')
|
|
4174
4490
|
.data(nodes.filter(d => d.depth > 0 && d.value && d.value > 0))
|
|
4175
4491
|
.enter().append('path')
|
|
4176
|
-
.attr('d', arc)
|
|
4492
|
+
.attr('d', d => arc(d) || '')
|
|
4177
4493
|
.attr('fill', d => {
|
|
4178
4494
|
let ancestor = d;
|
|
4179
4495
|
while (ancestor.depth > 1 && ancestor.parent) {
|
|
@@ -4194,7 +4510,7 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4194
4510
|
if (focusedNodeRef.current) {
|
|
4195
4511
|
return;
|
|
4196
4512
|
}
|
|
4197
|
-
const hoveredElement =
|
|
4513
|
+
const hoveredElement = event.currentTarget;
|
|
4198
4514
|
// Show tooltip for all nodes
|
|
4199
4515
|
tooltip.transition()
|
|
4200
4516
|
.duration(200)
|
|
@@ -4440,11 +4756,11 @@ const SunburstChart = ({ data, width = 500, height = 500, title = 'Sunburst Char
|
|
|
4440
4756
|
return () => {
|
|
4441
4757
|
tooltip.remove();
|
|
4442
4758
|
};
|
|
4443
|
-
}, [data, width, height, colorMap, radius, tagColors, unit, centerLabel]);
|
|
4444
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
4759
|
+
}, [data, width, height, colorMap, radius, tagColors, unit, centerLabel, getColor]);
|
|
4760
|
+
return (jsxRuntime.jsxs("div", { className: styles$4.container, children: [jsxRuntime.jsx("h3", { className: styles$4.title, children: title }), jsxRuntime.jsx("svg", { ref: svgRef, width: width, height: height, className: styles$4.chart })] }));
|
|
4445
4761
|
};
|
|
4446
4762
|
|
|
4447
|
-
var styles$
|
|
4763
|
+
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"};
|
|
4448
4764
|
|
|
4449
4765
|
const DEFAULT_COLORS = [
|
|
4450
4766
|
'#6366f1', '#8b5cf6', '#06b6d4', '#10b981',
|
|
@@ -4484,7 +4800,7 @@ const PieChart = ({ data, width = 400, height = 400, title = 'Distribution', sho
|
|
|
4484
4800
|
.innerRadius(radius * 0.7)
|
|
4485
4801
|
.outerRadius(radius * 0.7);
|
|
4486
4802
|
const tooltip = d3__namespace.select('body').append('div')
|
|
4487
|
-
.attr('class', styles$
|
|
4803
|
+
.attr('class', styles$3.tooltip)
|
|
4488
4804
|
.style('opacity', 0)
|
|
4489
4805
|
.style('position', 'absolute');
|
|
4490
4806
|
const pieData = pie(data);
|
|
@@ -4508,7 +4824,7 @@ const PieChart = ({ data, width = 400, height = 400, title = 'Distribution', sho
|
|
|
4508
4824
|
d3__namespace.select(this)
|
|
4509
4825
|
.transition()
|
|
4510
4826
|
.duration(200)
|
|
4511
|
-
.attr('d', d => hoverArc(d))
|
|
4827
|
+
.attr('d', (d) => hoverArc(d))
|
|
4512
4828
|
.style('filter', 'drop-shadow(0 4px 12px rgba(0,0,0,0.25))');
|
|
4513
4829
|
tooltip.transition()
|
|
4514
4830
|
.duration(200)
|
|
@@ -4522,18 +4838,21 @@ const PieChart = ({ data, width = 400, height = 400, title = 'Distribution', sho
|
|
|
4522
4838
|
.style('left', (event.pageX + 10) + 'px')
|
|
4523
4839
|
.style('top', (event.pageY - 28) + 'px');
|
|
4524
4840
|
})
|
|
4525
|
-
.on('mouseout', function (
|
|
4841
|
+
.on('mouseout', function (_event, _d) {
|
|
4526
4842
|
d3__namespace.select(this)
|
|
4527
4843
|
.transition()
|
|
4528
4844
|
.duration(200)
|
|
4529
|
-
.attr('d', d => arc(d))
|
|
4845
|
+
.attr('d', (d) => arc(d))
|
|
4530
4846
|
.style('filter', 'drop-shadow(0 2px 8px rgba(0,0,0,0.15))');
|
|
4531
4847
|
tooltip.transition()
|
|
4532
4848
|
.duration(500)
|
|
4533
4849
|
.style('opacity', 0);
|
|
4534
4850
|
});
|
|
4535
4851
|
// Calculate average background color for center text contrast
|
|
4536
|
-
const
|
|
4852
|
+
const colors = data.map((d, i) => d.color || DEFAULT_COLORS[i % DEFAULT_COLORS.length]);
|
|
4853
|
+
const avgColor = colors.length >= 2
|
|
4854
|
+
? d3__namespace.interpolateRgb.gamma(2.2)(colors[0], colors[1])(0.5)
|
|
4855
|
+
: colors[0] || '#ffffff';
|
|
4537
4856
|
const centerTextColor = getTextColor(avgColor);
|
|
4538
4857
|
// Add center text for donut
|
|
4539
4858
|
g.append('text')
|
|
@@ -4579,13 +4898,13 @@ const PieChart = ({ data, width = 400, height = 400, title = 'Distribution', sho
|
|
|
4579
4898
|
return () => {
|
|
4580
4899
|
tooltip.remove();
|
|
4581
4900
|
};
|
|
4582
|
-
}, [data, width, height, radius]);
|
|
4583
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
4901
|
+
}, [data, width, height, radius, centerLabel, unit]);
|
|
4902
|
+
return (jsxRuntime.jsxs("div", { className: styles$3.container, children: [jsxRuntime.jsx("h3", { className: styles$3.title, children: title }), jsxRuntime.jsxs("div", { className: styles$3.chartContainer, children: [jsxRuntime.jsx("svg", { ref: svgRef, width: width, height: height, className: styles$3.chart }), showLegend && (jsxRuntime.jsx("div", { className: styles$3.legend, children: data.map((item, index) => (jsxRuntime.jsxs("div", { className: styles$3.legendItem, children: [jsxRuntime.jsx("span", { className: styles$3.legendColor, style: {
|
|
4584
4903
|
backgroundColor: item.color || DEFAULT_COLORS[index % DEFAULT_COLORS.length]
|
|
4585
|
-
} }), jsxRuntime.jsx("span", { className: styles$
|
|
4904
|
+
} }), jsxRuntime.jsx("span", { className: styles$3.legendLabel, children: item.name }), jsxRuntime.jsx("span", { className: styles$3.legendValue, children: item.value.toLocaleString() })] }, item.name))) }))] })] }));
|
|
4586
4905
|
};
|
|
4587
4906
|
|
|
4588
|
-
var styles$
|
|
4907
|
+
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"};
|
|
4589
4908
|
|
|
4590
4909
|
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, }) => {
|
|
4591
4910
|
const [currentIndex, setCurrentIndex] = React.useState(initialIndex);
|
|
@@ -4624,9 +4943,9 @@ const ImageSlideshow = ({ images, autoPlay = false, autoPlayInterval = 3000, sho
|
|
|
4624
4943
|
goToSlide(imageOrder.length - 1);
|
|
4625
4944
|
}
|
|
4626
4945
|
}, [currentIndex, imageOrder.length, loop, goToSlide]);
|
|
4627
|
-
const togglePlayPause = () => {
|
|
4628
|
-
setIsPlaying(!
|
|
4629
|
-
};
|
|
4946
|
+
const togglePlayPause = React.useCallback(() => {
|
|
4947
|
+
setIsPlaying(prev => !prev);
|
|
4948
|
+
}, []);
|
|
4630
4949
|
const toggleFullscreen = () => {
|
|
4631
4950
|
if (!document.fullscreenElement) {
|
|
4632
4951
|
slideshowRef.current?.requestFullscreen();
|
|
@@ -4750,7 +5069,7 @@ const ImageSlideshow = ({ images, autoPlay = false, autoPlayInterval = 3000, sho
|
|
|
4750
5069
|
}
|
|
4751
5070
|
});
|
|
4752
5071
|
}
|
|
4753
|
-
}, [currentIndex, images, loop, preloadAdjacent]);
|
|
5072
|
+
}, [currentIndex, imageOrder, images, loop, preloadAdjacent]);
|
|
4754
5073
|
React.useEffect(() => {
|
|
4755
5074
|
const handleFullscreenChange = () => {
|
|
4756
5075
|
setIsFullscreen(!!document.fullscreenElement);
|
|
@@ -4801,9 +5120,9 @@ const ImageSlideshow = ({ images, autoPlay = false, autoPlayInterval = 3000, sho
|
|
|
4801
5120
|
};
|
|
4802
5121
|
document.addEventListener('keydown', handleKeyDown);
|
|
4803
5122
|
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
4804
|
-
}, [goToPrevious, goToNext]);
|
|
5123
|
+
}, [goToPrevious, goToNext, enableFullscreen, togglePlayPause]);
|
|
4805
5124
|
if (!imageOrder || imageOrder.length === 0) {
|
|
4806
|
-
return (jsxRuntime.jsx("div", { className: `${styles$
|
|
5125
|
+
return (jsxRuntime.jsx("div", { className: `${styles$2.slideshow} ${styles$2.empty} ${className}`, children: jsxRuntime.jsx("div", { className: styles$2.emptyState, children: jsxRuntime.jsx("span", { children: "No images to display" }) }) }));
|
|
4807
5126
|
}
|
|
4808
5127
|
const slideVariants = {
|
|
4809
5128
|
enter: (direction) => ({
|
|
@@ -4823,16 +5142,16 @@ const ImageSlideshow = ({ images, autoPlay = false, autoPlayInterval = 3000, sho
|
|
|
4823
5142
|
};
|
|
4824
5143
|
const currentImage = imageOrder[currentIndex];
|
|
4825
5144
|
const isImageLoaded = loadedImages.has(currentImage.id);
|
|
4826
|
-
return (jsxRuntime.jsxs("div", { ref: slideshowRef, className: `${styles$
|
|
5145
|
+
return (jsxRuntime.jsxs("div", { ref: slideshowRef, className: `${styles$2.slideshow} ${isFullscreen ? styles$2.fullscreen : ''} ${showThumbnails && imageOrder.length > 1 ? styles$2.hasThumbnails : ''} ${className}`, children: [jsxRuntime.jsxs("div", { className: styles$2.mainContainer, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onTouchEnd, children: [jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", custom: 1, children: jsxRuntime.jsxs(framerMotion.motion.div, { custom: 1, variants: slideVariants, initial: "enter", animate: "center", exit: "exit", transition: {
|
|
4827
5146
|
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
4828
5147
|
opacity: { duration: 0.3 }
|
|
4829
|
-
}, className: styles$
|
|
5148
|
+
}, className: styles$2.slide, children: [jsxRuntime.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: {
|
|
4830
5149
|
opacity: lazyLoading && !isImageLoaded ? 0 : 1,
|
|
4831
5150
|
transition: 'opacity 0.3s ease'
|
|
4832
|
-
} }), lazyLoading && !isImageLoaded && (jsxRuntime.jsx("div", { className: styles$
|
|
5151
|
+
} }), lazyLoading && !isImageLoaded && (jsxRuntime.jsx("div", { className: styles$2.imageLoader, children: jsxRuntime.jsx("div", { className: styles$2.spinner }) }))] }, currentIndex) }), showControls && imageOrder.length > 1 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", { className: `${styles$2.control} ${styles$2.controlPrev}`, onClick: goToPrevious, disabled: !loop && currentIndex === 0, "aria-label": "Previous image", children: jsxRuntime.jsx(lucideReact.ChevronLeft, {}) }), jsxRuntime.jsx("button", { className: `${styles$2.control} ${styles$2.controlNext}`, onClick: goToNext, disabled: !loop && currentIndex === imageOrder.length - 1, "aria-label": "Next image", children: jsxRuntime.jsx(lucideReact.ChevronRight, {}) })] })), jsxRuntime.jsxs("div", { className: styles$2.topControls, children: [enableFullscreen && (jsxRuntime.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: jsxRuntime.jsx("span", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', height: '100%' }, children: jsxRuntime.jsx(lucideReact.Maximize, {}) }) })), enableDownload && (jsxRuntime.jsx("button", { className: `${styles$2.control} ${styles$2.controlAction}`, onClick: handleDownload, "aria-label": "Download image", title: "Download image", children: jsxRuntime.jsx("span", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', height: '100%' }, children: jsxRuntime.jsx(lucideReact.Download, {}) }) })), enableShare && (jsxRuntime.jsx("button", { className: `${styles$2.control} ${styles$2.controlAction}`, onClick: handleShare, "aria-label": "Share image", title: "Share image", children: jsxRuntime.jsx("span", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', height: '100%' }, children: jsxRuntime.jsx(lucideReact.Share2, {}) }) }))] }), autoPlay && imageOrder.length > 1 && (jsxRuntime.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 ? jsxRuntime.jsx(lucideReact.Pause, {}) : jsxRuntime.jsx(lucideReact.Play, {}) })), showCaptions && (currentImage.caption || currentImage.title) && (jsxRuntime.jsxs(framerMotion.motion.div, { className: styles$2.caption, initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, transition: { delay: 0.3 }, children: [currentImage.title && (jsxRuntime.jsx("h3", { className: styles$2.captionTitle, children: currentImage.title })), currentImage.caption && (jsxRuntime.jsx("p", { className: styles$2.captionText, children: currentImage.caption })), currentImage.metadata && (jsxRuntime.jsxs("div", { className: styles$2.imageMetadata, children: [currentImage.metadata.photographer && (jsxRuntime.jsxs("span", { className: styles$2.metadataItem, children: ["\uD83D\uDCF7 ", currentImage.metadata.photographer] })), currentImage.metadata.location && (jsxRuntime.jsxs("span", { className: styles$2.metadataItem, children: ["\uD83D\uDCCD ", currentImage.metadata.location] })), currentImage.metadata.camera && (jsxRuntime.jsxs("span", { className: styles$2.metadataItem, children: ["\uD83D\uDCF9 ", currentImage.metadata.camera] }))] }))] }))] }), showIndicators && imageOrder.length > 1 && (jsxRuntime.jsx("div", { className: styles$2.indicators, children: imageOrder.map((_, index) => (jsxRuntime.jsx(framerMotion.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 && (jsxRuntime.jsx("div", { className: `${styles$2.thumbnails} ${isDragging ? styles$2.thumbnailsDragging : ''}`, children: imageOrder.map((image, index) => (jsxRuntime.jsx(framerMotion.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: jsxRuntime.jsx("img", { src: image.src, alt: image.alt, className: styles$2.thumbnailImage, draggable: false }) }, image.id))) }))] }));
|
|
4833
5152
|
};
|
|
4834
5153
|
|
|
4835
|
-
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"};
|
|
5154
|
+
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"};
|
|
4836
5155
|
|
|
4837
5156
|
/**
|
|
4838
5157
|
* A comprehensive table component with sorting, filtering, pagination, selection, and row actions.
|
|
@@ -5033,7 +5352,7 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5033
5352
|
...action.style,
|
|
5034
5353
|
...action.buttonStyles?.style
|
|
5035
5354
|
};
|
|
5036
|
-
// Handle icon size -
|
|
5355
|
+
// Handle icon size - set CSS custom property
|
|
5037
5356
|
if (action.buttonStyles?.iconSize || actionButtonStyles?.iconSize) {
|
|
5038
5357
|
baseStyles['--icon-size'] = typeof (action.buttonStyles?.iconSize || actionButtonStyles?.iconSize) === 'number'
|
|
5039
5358
|
? `${action.buttonStyles?.iconSize || actionButtonStyles?.iconSize}px`
|
|
@@ -5042,13 +5361,13 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5042
5361
|
return baseStyles;
|
|
5043
5362
|
}, [actionButtonStyles]);
|
|
5044
5363
|
const getButtonClassName = React.useCallback((action) => {
|
|
5045
|
-
const baseClass = styles.actionButton;
|
|
5046
|
-
const variantClass = action.variant === 'primary' ? styles.actionButtonPrimary :
|
|
5047
|
-
action.variant === 'danger' ? styles.actionButtonDanger :
|
|
5048
|
-
action.variant === 'warning' ? styles.actionButtonWarning :
|
|
5049
|
-
action.variant === 'success' ? styles.actionButtonSuccess :
|
|
5364
|
+
const baseClass = styles$1.actionButton;
|
|
5365
|
+
const variantClass = action.variant === 'primary' ? styles$1.actionButtonPrimary :
|
|
5366
|
+
action.variant === 'danger' ? styles$1.actionButtonDanger :
|
|
5367
|
+
action.variant === 'warning' ? styles$1.actionButtonWarning :
|
|
5368
|
+
action.variant === 'success' ? styles$1.actionButtonSuccess :
|
|
5050
5369
|
action.variant === 'custom' ? '' :
|
|
5051
|
-
styles.actionButtonSecondary;
|
|
5370
|
+
styles$1.actionButtonSecondary;
|
|
5052
5371
|
const globalCustomClass = actionButtonStyles?.className || '';
|
|
5053
5372
|
const actionCustomClass = action.className || '';
|
|
5054
5373
|
const buttonCustomClass = action.buttonStyles?.className || '';
|
|
@@ -5056,23 +5375,23 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5056
5375
|
}, [actionButtonStyles]);
|
|
5057
5376
|
// Loading state
|
|
5058
5377
|
if (loading) {
|
|
5059
|
-
return (jsxRuntime.jsx("div", { className: `${styles.container} ${className}`, children: jsxRuntime.jsxs("div", { className: styles.loading, children: [jsxRuntime.jsx("div", { className: styles.spinner }), jsxRuntime.jsx("span", { children: "Loading..." })] }) }));
|
|
5378
|
+
return (jsxRuntime.jsx("div", { className: `${styles$1.container} ${className}`, children: jsxRuntime.jsxs("div", { className: styles$1.loading, children: [jsxRuntime.jsx("div", { className: styles$1.spinner }), jsxRuntime.jsx("span", { children: "Loading..." })] }) }));
|
|
5060
5379
|
}
|
|
5061
5380
|
// Empty state
|
|
5062
5381
|
if (data.length === 0) {
|
|
5063
|
-
return (jsxRuntime.jsxs("div", { className: `${styles.container} ${className}`, children: [title && jsxRuntime.jsx("h2", { className: styles.title, children: title }), jsxRuntime.jsxs("div", { className: styles.empty, children: [jsxRuntime.jsx("span", { className: styles.emptyIcon, children: "\uD83D\uDCCA" }), jsxRuntime.jsx("p", { children: emptyMessage })] })] }));
|
|
5382
|
+
return (jsxRuntime.jsxs("div", { className: `${styles$1.container} ${className}`, children: [title && jsxRuntime.jsx("h2", { className: styles$1.title, children: title }), jsxRuntime.jsxs("div", { className: styles$1.empty, children: [jsxRuntime.jsx("span", { className: styles$1.emptyIcon, children: "\uD83D\uDCCA" }), jsxRuntime.jsx("p", { children: emptyMessage })] })] }));
|
|
5064
5383
|
}
|
|
5065
|
-
return (jsxRuntime.jsxs("div", { className: `${styles.container} ${className}`, children: [(title || actions || bulkActions) && (jsxRuntime.jsxs("div", { className: styles.header, children: [title && jsxRuntime.jsx("h2", { className: styles.title, children: title }), (actions || bulkActions) && (jsxRuntime.jsxs("div", { className: styles.bulkActions, children: [actions && selectedItems.length > 0 && (jsxRuntime.jsx("div", { className: styles.actions, children: actions(selectedItems) })), bulkActions && bulkActions.length > 0 && selectedItems.length > 0 && (jsxRuntime.jsx("div", { className: styles.bulkActionButtons, children: bulkActions.map((bulkAction, index) => {
|
|
5384
|
+
return (jsxRuntime.jsxs("div", { className: `${styles$1.container} ${className}`, children: [(title || actions || bulkActions) && (jsxRuntime.jsxs("div", { className: styles$1.header, children: [title && jsxRuntime.jsx("h2", { className: styles$1.title, children: title }), (actions || bulkActions) && (jsxRuntime.jsxs("div", { className: styles$1.bulkActions, children: [actions && selectedItems.length > 0 && (jsxRuntime.jsx("div", { className: styles$1.actions, children: actions(selectedItems) })), bulkActions && bulkActions.length > 0 && selectedItems.length > 0 && (jsxRuntime.jsx("div", { className: styles$1.bulkActionButtons, children: bulkActions.map((bulkAction, index) => {
|
|
5066
5385
|
const isDisabled = (bulkAction.disabled && bulkAction.disabled(selectedItems)) ||
|
|
5067
5386
|
(bulkAction.minSelection && selectedItems.length < bulkAction.minSelection) ||
|
|
5068
5387
|
(bulkAction.maxSelection && selectedItems.length > bulkAction.maxSelection);
|
|
5069
|
-
return (jsxRuntime.jsxs("button", { className: `${styles.bulkActionButton} ${bulkAction.variant === 'primary' ? styles.bulkPrimary :
|
|
5070
|
-
bulkAction.variant === 'secondary' ? styles.bulkSecondary :
|
|
5071
|
-
bulkAction.variant === 'danger' ? styles.bulkDanger :
|
|
5072
|
-
bulkAction.variant === 'warning' ? styles.bulkWarning :
|
|
5073
|
-
bulkAction.variant === 'success' ? styles.bulkSuccess :
|
|
5074
|
-
bulkAction.variant === 'custom' ? styles.bulkCustom :
|
|
5075
|
-
styles.bulkPrimary} ${bulkAction.className || ''}`, style: bulkAction.style, disabled: !!isDisabled, onClick: async () => {
|
|
5388
|
+
return (jsxRuntime.jsxs("button", { className: `${styles$1.bulkActionButton} ${bulkAction.variant === 'primary' ? styles$1.bulkPrimary :
|
|
5389
|
+
bulkAction.variant === 'secondary' ? styles$1.bulkSecondary :
|
|
5390
|
+
bulkAction.variant === 'danger' ? styles$1.bulkDanger :
|
|
5391
|
+
bulkAction.variant === 'warning' ? styles$1.bulkWarning :
|
|
5392
|
+
bulkAction.variant === 'success' ? styles$1.bulkSuccess :
|
|
5393
|
+
bulkAction.variant === 'custom' ? styles$1.bulkCustom :
|
|
5394
|
+
styles$1.bulkPrimary} ${bulkAction.className || ''}`, style: bulkAction.style, disabled: !!isDisabled, onClick: async () => {
|
|
5076
5395
|
if (bulkAction.confirmMessage) {
|
|
5077
5396
|
const message = typeof bulkAction.confirmMessage === 'function'
|
|
5078
5397
|
? bulkAction.confirmMessage(selectedItems)
|
|
@@ -5081,27 +5400,27 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5081
5400
|
return;
|
|
5082
5401
|
}
|
|
5083
5402
|
await bulkAction.onClick(selectedItems);
|
|
5084
|
-
}, title: bulkAction.label, "aria-label": bulkAction.label, children: [bulkAction.icon, jsxRuntime.jsx("span", { children: bulkAction.label }), jsxRuntime.jsxs("span", { className: styles.selectionCount, children: ["(", selectedItems.length, ")"] })] }, index));
|
|
5085
|
-
}) }))] }))] })), (searchable || hasActiveFilters) && (jsxRuntime.jsxs("div", { className: styles.controls, children: [searchable && (jsxRuntime.jsxs("div", { className: styles.searchBox, children: [jsxRuntime.jsx("span", { className: styles.searchIcon, children: "\uD83D\uDD0D" }), jsxRuntime.jsx("input", { type: "text", placeholder: "Search...", value: searchQuery, onChange: e => {
|
|
5403
|
+
}, title: bulkAction.label, "aria-label": bulkAction.label, children: [bulkAction.icon, jsxRuntime.jsx("span", { children: bulkAction.label }), jsxRuntime.jsxs("span", { className: styles$1.selectionCount, children: ["(", selectedItems.length, ")"] })] }, index));
|
|
5404
|
+
}) }))] }))] })), (searchable || hasActiveFilters) && (jsxRuntime.jsxs("div", { className: styles$1.controls, children: [searchable && (jsxRuntime.jsxs("div", { className: styles$1.searchBox, children: [jsxRuntime.jsx("span", { className: styles$1.searchIcon, children: "\uD83D\uDD0D" }), jsxRuntime.jsx("input", { type: "text", placeholder: "Search...", value: searchQuery, onChange: e => {
|
|
5086
5405
|
setSearchQuery(e.target.value);
|
|
5087
5406
|
setCurrentPage(1);
|
|
5088
|
-
}, className: styles.searchInput }), searchQuery && (jsxRuntime.jsx("button", { className: styles.clearButton, onClick: () => setSearchQuery(''), children: "\u2715" }))] })), hasActiveFilters && (jsxRuntime.jsx("button", { className: styles.clearFiltersButton, onClick: clearFilters, children: "Clear All Filters" })), jsxRuntime.jsxs("div", { className: styles.resultCount, children: [filteredData.length, " ", filteredData.length === 1 ? 'result' : 'results'] })] })), jsxRuntime.jsx("div", { className: `${styles.tableWrapper} ${stickyHeader ? styles.stickyHeader : ''} ${horizontalScroll ? styles.horizontalScroll : ''}`, children: jsxRuntime.jsxs("table", { className: `
|
|
5089
|
-
${styles.table}
|
|
5090
|
-
${striped ? styles.striped : ''}
|
|
5091
|
-
${hoverable ? styles.hoverable : ''}
|
|
5092
|
-
${compact ? styles.compact : ''}
|
|
5093
|
-
`, role: "table", "aria-label": title || 'Data table', "aria-rowcount": sortedData.length, "aria-describedby": title ? `${title.replace(/\s+/g, '-').toLowerCase()}-summary` : undefined, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [selectable && (jsxRuntime.jsx("th", { className: styles.checkboxColumn, scope: "col", children: jsxRuntime.jsx("input", { type: "checkbox", checked: allCurrentPageSelected, ref: input => {
|
|
5407
|
+
}, className: styles$1.searchInput }), searchQuery && (jsxRuntime.jsx("button", { className: styles$1.clearButton, onClick: () => setSearchQuery(''), children: "\u2715" }))] })), hasActiveFilters && (jsxRuntime.jsx("button", { className: styles$1.clearFiltersButton, onClick: clearFilters, children: "Clear All Filters" })), jsxRuntime.jsxs("div", { className: styles$1.resultCount, children: [filteredData.length, " ", filteredData.length === 1 ? 'result' : 'results'] })] })), jsxRuntime.jsx("div", { className: `${styles$1.tableWrapper} ${stickyHeader ? styles$1.stickyHeader : ''} ${horizontalScroll ? styles$1.horizontalScroll : ''}`, children: jsxRuntime.jsxs("table", { className: `
|
|
5408
|
+
${styles$1.table}
|
|
5409
|
+
${striped ? styles$1.striped : ''}
|
|
5410
|
+
${hoverable ? styles$1.hoverable : ''}
|
|
5411
|
+
${compact ? styles$1.compact : ''}
|
|
5412
|
+
`, role: "table", "aria-label": title || 'Data table', "aria-rowcount": sortedData.length, "aria-describedby": title ? `${title.replace(/\s+/g, '-').toLowerCase()}-summary` : undefined, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [selectable && (jsxRuntime.jsx("th", { className: styles$1.checkboxColumn, scope: "col", children: jsxRuntime.jsx("input", { type: "checkbox", checked: allCurrentPageSelected, ref: input => {
|
|
5094
5413
|
if (input) {
|
|
5095
5414
|
input.indeterminate = !allCurrentPageSelected && someCurrentPageSelected;
|
|
5096
5415
|
}
|
|
5097
|
-
}, onChange: handleSelectAll, className: styles.checkbox, "aria-label": "Select all rows" }) })), columns.map(column => (jsxRuntime.jsx("th", { className: `${styles.th} ${column.className || ''}`, style: {
|
|
5416
|
+
}, onChange: handleSelectAll, className: styles$1.checkbox, "aria-label": "Select all rows" }) })), columns.map(column => (jsxRuntime.jsx("th", { className: `${styles$1.th} ${column.className || ''}`, style: {
|
|
5098
5417
|
width: column.width,
|
|
5099
5418
|
textAlign: column.align || 'left'
|
|
5100
5419
|
}, scope: "col", role: "columnheader", "aria-sort": sortConfig.key === column.key
|
|
5101
5420
|
? sortConfig.direction === 'asc' ? 'ascending' : 'descending'
|
|
5102
|
-
: column.sortable ? 'none' : undefined, children: jsxRuntime.jsxs("div", { className: styles.headerCell, children: [column.sortable ? (jsxRuntime.jsxs("button", { className: styles.sortButton, onClick: () => handleSort(column.key), "aria-label": `Sort by ${column.header} ${sortConfig.key === column.key
|
|
5421
|
+
: column.sortable ? 'none' : undefined, children: jsxRuntime.jsxs("div", { className: styles$1.headerCell, children: [column.sortable ? (jsxRuntime.jsxs("button", { className: styles$1.sortButton, onClick: () => handleSort(column.key), "aria-label": `Sort by ${column.header} ${sortConfig.key === column.key
|
|
5103
5422
|
? sortConfig.direction === 'asc' ? '(descending)' : '(ascending)'
|
|
5104
|
-
: '(ascending)'}`, children: [jsxRuntime.jsx("span", { children: column.header }), jsxRuntime.jsx("span", { className: styles.sortIcon, "aria-hidden": "true", children: sortConfig.key === column.key ? (sortConfig.direction === 'asc' ? '↑' : '↓') : '↕' })] })) : (jsxRuntime.jsx("span", { className: styles.headerText, children: column.header })), column.filterable && (jsxRuntime.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 && (jsxRuntime.jsx("th", { className: styles.actionsColumn, scope: "col", children: jsxRuntime.jsx("span", { className: styles.headerText, children: "Actions" }) }))] }) }), jsxRuntime.jsx("tbody", { children: animated ? (jsxRuntime.jsx(framerMotion.LayoutGroup, { children: jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "popLayout", children: paginatedData.map((item, index) => (jsxRuntime.jsxs(framerMotion.motion.tr, { layout: "position", initial: { opacity: 0, scale: 0.98 }, animate: {
|
|
5423
|
+
: '(ascending)'}`, children: [jsxRuntime.jsx("span", { children: column.header }), jsxRuntime.jsx("span", { className: styles$1.sortIcon, "aria-hidden": "true", children: sortConfig.key === column.key ? (sortConfig.direction === 'asc' ? '↑' : '↓') : '↕' })] })) : (jsxRuntime.jsx("span", { className: styles$1.headerText, children: column.header })), column.filterable && (jsxRuntime.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 && (jsxRuntime.jsx("th", { className: styles$1.actionsColumn, scope: "col", children: jsxRuntime.jsx("span", { className: styles$1.headerText, children: "Actions" }) }))] }) }), jsxRuntime.jsx("tbody", { children: animated ? (jsxRuntime.jsx(framerMotion.LayoutGroup, { children: jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "popLayout", children: paginatedData.map((item, index) => (jsxRuntime.jsxs(framerMotion.motion.tr, { layout: "position", initial: { opacity: 0, scale: 0.98 }, animate: {
|
|
5105
5424
|
opacity: 1,
|
|
5106
5425
|
scale: 1,
|
|
5107
5426
|
transition: {
|
|
@@ -5114,18 +5433,18 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5114
5433
|
scale: 0.98,
|
|
5115
5434
|
transition: { duration: 0.08 }
|
|
5116
5435
|
}, className: `
|
|
5117
|
-
${styles.tr}
|
|
5118
|
-
${selectedRows.has(item[keyField]) ? styles.selected : ''}
|
|
5119
|
-
${onRowClick ? styles.clickable : ''}
|
|
5120
|
-
`, onClick: () => onRowClick?.(item, index), children: [selectable && (jsxRuntime.jsx("td", { className: styles.checkboxColumn, children: jsxRuntime.jsx("input", { type: "checkbox", checked: selectedRows.has(item[keyField]), onChange: () => handleSelectRow(item[keyField]), onClick: e => e.stopPropagation(), className: styles.checkbox }) })), columns.map(column => (jsxRuntime.jsx("td", { className: `${styles.td} ${column.className || ''}`, style: { textAlign: column.align || 'left' }, children: column.render
|
|
5436
|
+
${styles$1.tr}
|
|
5437
|
+
${selectedRows.has(item[keyField]) ? styles$1.selected : ''}
|
|
5438
|
+
${onRowClick ? styles$1.clickable : ''}
|
|
5439
|
+
`, onClick: () => onRowClick?.(item, index), children: [selectable && (jsxRuntime.jsx("td", { className: styles$1.checkboxColumn, children: jsxRuntime.jsx("input", { type: "checkbox", checked: selectedRows.has(item[keyField]), onChange: () => handleSelectRow(item[keyField]), onClick: e => e.stopPropagation(), className: styles$1.checkbox }) })), columns.map(column => (jsxRuntime.jsx("td", { className: `${styles$1.td} ${column.className || ''}`, style: { textAlign: column.align || 'left' }, children: column.render
|
|
5121
5440
|
? column.render(item[column.key], item, index)
|
|
5122
|
-
: formatValue(item[column.key]) }, column.key))), rowActions && rowActions.length > 0 && (jsxRuntime.jsx("td", { className: styles.actionsColumn, onClick: e => e.stopPropagation(), children: jsxRuntime.jsx("div", { className: styles.actionButtons, children: rowActions.map((action, actionIndex) => (jsxRuntime.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) => (jsxRuntime.jsxs("tr", { className: `
|
|
5123
|
-
${styles.tr}
|
|
5124
|
-
${selectedRows.has(item[keyField]) ? styles.selected : ''}
|
|
5125
|
-
${onRowClick ? styles.clickable : ''}
|
|
5126
|
-
`, onClick: () => onRowClick?.(item, index), children: [selectable && (jsxRuntime.jsx("td", { className: styles.checkboxColumn, children: jsxRuntime.jsx("input", { type: "checkbox", checked: selectedRows.has(item[keyField]), onChange: () => handleSelectRow(item[keyField]), onClick: e => e.stopPropagation(), className: styles.checkbox }) })), columns.map(column => (jsxRuntime.jsx("td", { className: `${styles.td} ${column.className || ''}`, style: { textAlign: column.align || 'left' }, children: column.render
|
|
5441
|
+
: formatValue(item[column.key]) }, column.key))), rowActions && rowActions.length > 0 && (jsxRuntime.jsx("td", { className: styles$1.actionsColumn, onClick: e => e.stopPropagation(), children: jsxRuntime.jsx("div", { className: styles$1.actionButtons, children: rowActions.map((action, actionIndex) => (jsxRuntime.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) => (jsxRuntime.jsxs("tr", { className: `
|
|
5442
|
+
${styles$1.tr}
|
|
5443
|
+
${selectedRows.has(item[keyField]) ? styles$1.selected : ''}
|
|
5444
|
+
${onRowClick ? styles$1.clickable : ''}
|
|
5445
|
+
`, onClick: () => onRowClick?.(item, index), children: [selectable && (jsxRuntime.jsx("td", { className: styles$1.checkboxColumn, children: jsxRuntime.jsx("input", { type: "checkbox", checked: selectedRows.has(item[keyField]), onChange: () => handleSelectRow(item[keyField]), onClick: e => e.stopPropagation(), className: styles$1.checkbox }) })), columns.map(column => (jsxRuntime.jsx("td", { className: `${styles$1.td} ${column.className || ''}`, style: { textAlign: column.align || 'left' }, children: column.render
|
|
5127
5446
|
? column.render(item[column.key], item, index)
|
|
5128
|
-
: formatValue(item[column.key]) }, column.key))), rowActions && rowActions.length > 0 && (jsxRuntime.jsx("td", { className: styles.actionsColumn, onClick: e => e.stopPropagation(), children: jsxRuntime.jsx("div", { className: styles.actionButtons, children: rowActions.map((action, actionIndex) => (jsxRuntime.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 && (jsxRuntime.jsxs("div", { className: styles.pagination, children: [jsxRuntime.jsxs("div", { className: styles.pageInfo, children: ["Showing ", ((currentPage - 1) * pageSize) + 1, "-", Math.min(currentPage * pageSize, sortedData.length), " of ", sortedData.length] }), jsxRuntime.jsxs("div", { className: styles.pageControls, children: [jsxRuntime.jsx("button", { className: styles.pageButton, onClick: () => setCurrentPage(1), disabled: currentPage === 1, children: "\u27E8\u27E8" }), jsxRuntime.jsx("button", { className: styles.pageButton, onClick: () => setCurrentPage(prev => Math.max(1, prev - 1)), disabled: currentPage === 1, children: "\u27E8" }), jsxRuntime.jsxs("span", { className: styles.pageNumber, children: ["Page ", currentPage, " of ", totalPages] }), jsxRuntime.jsx("button", { className: styles.pageButton, onClick: () => setCurrentPage(prev => Math.min(totalPages, prev + 1)), disabled: currentPage === totalPages, children: "\u27E9" }), jsxRuntime.jsx("button", { className: styles.pageButton, onClick: () => setCurrentPage(totalPages), disabled: currentPage === totalPages, children: "\u27E9\u27E9" })] }), typeof pagination === 'object' && (jsxRuntime.jsx("select", { className: styles.pageSizeSelect, value: pageSize, onChange: e => {
|
|
5447
|
+
: formatValue(item[column.key]) }, column.key))), rowActions && rowActions.length > 0 && (jsxRuntime.jsx("td", { className: styles$1.actionsColumn, onClick: e => e.stopPropagation(), children: jsxRuntime.jsx("div", { className: styles$1.actionButtons, children: rowActions.map((action, actionIndex) => (jsxRuntime.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 && (jsxRuntime.jsxs("div", { className: styles$1.pagination, children: [jsxRuntime.jsxs("div", { className: styles$1.pageInfo, children: ["Showing ", ((currentPage - 1) * pageSize) + 1, "-", Math.min(currentPage * pageSize, sortedData.length), " of ", sortedData.length] }), jsxRuntime.jsxs("div", { className: styles$1.pageControls, children: [jsxRuntime.jsx("button", { className: styles$1.pageButton, onClick: () => setCurrentPage(1), disabled: currentPage === 1, children: "\u27E8\u27E8" }), jsxRuntime.jsx("button", { className: styles$1.pageButton, onClick: () => setCurrentPage(prev => Math.max(1, prev - 1)), disabled: currentPage === 1, children: "\u27E8" }), jsxRuntime.jsxs("span", { className: styles$1.pageNumber, children: ["Page ", currentPage, " of ", totalPages] }), jsxRuntime.jsx("button", { className: styles$1.pageButton, onClick: () => setCurrentPage(prev => Math.min(totalPages, prev + 1)), disabled: currentPage === totalPages, children: "\u27E9" }), jsxRuntime.jsx("button", { className: styles$1.pageButton, onClick: () => setCurrentPage(totalPages), disabled: currentPage === totalPages, children: "\u27E9\u27E9" })] }), typeof pagination === 'object' && (jsxRuntime.jsx("select", { className: styles$1.pageSizeSelect, value: pageSize, onChange: e => {
|
|
5129
5448
|
setPageSize(Number(e.target.value));
|
|
5130
5449
|
setCurrentPage(1);
|
|
5131
5450
|
}, children: pageSizeOptions.map(size => (jsxRuntime.jsxs("option", { value: size, children: [size, " per page"] }, size))) }))] }))] }));
|
|
@@ -5133,32 +5452,67 @@ const TableComponent = function Table({ data, columns, keyField = 'id', title, s
|
|
|
5133
5452
|
// Helper function to format values
|
|
5134
5453
|
function formatValue(value) {
|
|
5135
5454
|
if (value === null || value === undefined) {
|
|
5136
|
-
return jsxRuntime.jsx("span", { className: styles.nullValue, children: "\u2014" });
|
|
5455
|
+
return jsxRuntime.jsx("span", { className: styles$1.nullValue, children: "\u2014" });
|
|
5137
5456
|
}
|
|
5138
5457
|
if (typeof value === 'boolean') {
|
|
5139
|
-
return (jsxRuntime.jsx("span", { className: `${styles.badge} ${value ? styles.badgeSuccess : styles.badgeDanger}`, children: value ? '✓' : '✗' }));
|
|
5458
|
+
return (jsxRuntime.jsx("span", { className: `${styles$1.badge} ${value ? styles$1.badgeSuccess : styles$1.badgeDanger}`, children: value ? '✓' : '✗' }));
|
|
5140
5459
|
}
|
|
5141
5460
|
if (value instanceof Date) {
|
|
5142
5461
|
return value.toLocaleDateString();
|
|
5143
5462
|
}
|
|
5144
5463
|
if (typeof value === 'object') {
|
|
5145
|
-
return jsxRuntime.jsx("code", { className: styles.code, children: JSON.stringify(value, null, 2) });
|
|
5464
|
+
return jsxRuntime.jsx("code", { className: styles$1.code, children: JSON.stringify(value, null, 2) });
|
|
5146
5465
|
}
|
|
5147
5466
|
return String(value);
|
|
5148
5467
|
}
|
|
5149
5468
|
// Memoized Table component to prevent unnecessary re-renders
|
|
5150
5469
|
const Table = React.memo(TableComponent);
|
|
5151
5470
|
|
|
5471
|
+
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"};
|
|
5472
|
+
|
|
5473
|
+
/**
|
|
5474
|
+
* ConfirmationModal Component
|
|
5475
|
+
*
|
|
5476
|
+
* A specialized modal for confirm/cancel flows with variant styling.
|
|
5477
|
+
*
|
|
5478
|
+
* @example
|
|
5479
|
+
* <ConfirmationModal
|
|
5480
|
+
* isOpen={showDelete}
|
|
5481
|
+
* onClose={() => setShowDelete(false)}
|
|
5482
|
+
* onConfirm={handleDelete}
|
|
5483
|
+
* title="Delete item?"
|
|
5484
|
+
* message="This action cannot be undone."
|
|
5485
|
+
* variant="danger"
|
|
5486
|
+
* confirmText="Delete"
|
|
5487
|
+
* />
|
|
5488
|
+
*/
|
|
5489
|
+
const ConfirmationModal = ({ isOpen, onClose, onConfirm, title, message, confirmText = 'Confirm', cancelText = 'Cancel', isLoading = false, variant = 'info', }) => {
|
|
5490
|
+
const handleConfirm = (e) => {
|
|
5491
|
+
if (!isLoading) {
|
|
5492
|
+
e.preventDefault();
|
|
5493
|
+
e.stopPropagation();
|
|
5494
|
+
onConfirm();
|
|
5495
|
+
}
|
|
5496
|
+
};
|
|
5497
|
+
return (jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(framerMotion.motion.div, { className: styles.overlay, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: !isLoading ? onClose : undefined }), jsxRuntime.jsx("div", { className: styles.positioner, children: jsxRuntime.jsxs(framerMotion.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: [jsxRuntime.jsxs("div", { className: `${styles.header} ${styles[variant]}`, children: [jsxRuntime.jsx("h2", { className: styles.title, children: title }), !isLoading && (jsxRuntime.jsx("button", { className: styles.closeButton, onClick: onClose, type: "button", "aria-label": "Close", children: "\u2715" }))] }), jsxRuntime.jsx("div", { className: styles.content, children: jsxRuntime.jsx("p", { className: styles.message, children: message }) }), jsxRuntime.jsxs("div", { className: styles.footer, children: [jsxRuntime.jsx(Button, { type: "button", variant: "ghost", onClick: onClose, disabled: isLoading, children: cancelText }), jsxRuntime.jsx(Button, { type: "button", variant: variant === 'danger' ? 'danger' : 'primary', onClick: handleConfirm, disabled: isLoading, loading: isLoading, children: confirmText })] })] }) })] })) }));
|
|
5498
|
+
};
|
|
5499
|
+
|
|
5152
5500
|
exports.ArrayInput = ArrayInput;
|
|
5153
5501
|
exports.BooleansHeatmap = BooleansHeatmap;
|
|
5502
|
+
exports.Breadcrumb = Breadcrumb;
|
|
5154
5503
|
exports.Button = Button;
|
|
5155
5504
|
exports.Calendar = Calendar;
|
|
5156
5505
|
exports.Card = Card;
|
|
5157
5506
|
exports.Checkbox = Checkbox;
|
|
5507
|
+
exports.ConfirmationModal = ConfirmationModal;
|
|
5158
5508
|
exports.DateInput = DateInput;
|
|
5509
|
+
exports.DecryptedText = DecryptedText;
|
|
5159
5510
|
exports.EditFAB = EditFAB;
|
|
5511
|
+
exports.EmptyState = EmptyState;
|
|
5160
5512
|
exports.ImageSlideshow = ImageSlideshow;
|
|
5513
|
+
exports.LiquidButton = LiquidButton;
|
|
5161
5514
|
exports.LoadingSpinner = LoadingSpinner;
|
|
5515
|
+
exports.Modal = Modal;
|
|
5162
5516
|
exports.MoodChart = MoodChart;
|
|
5163
5517
|
exports.Navbar = Navbar;
|
|
5164
5518
|
exports.NumberStepper = NumberStepper;
|
|
@@ -5177,10 +5531,12 @@ exports.TextInput = TextInput;
|
|
|
5177
5531
|
exports.ThemeProvider = ThemeProvider;
|
|
5178
5532
|
exports.ThemeSwitcher = ThemeSwitcher;
|
|
5179
5533
|
exports.TimeInput = TimeInput;
|
|
5534
|
+
exports.ToastContainer = ToastContainer;
|
|
5180
5535
|
exports.Toggle = Toggle;
|
|
5181
5536
|
exports.ToggleButton = ToggleButton;
|
|
5182
5537
|
exports.soundManager = soundManager;
|
|
5183
5538
|
exports.useComponentSound = useComponentSound;
|
|
5184
5539
|
exports.useSound = useSound;
|
|
5185
|
-
exports.useTheme = useTheme
|
|
5540
|
+
exports.useTheme = useTheme;
|
|
5541
|
+
exports.useThemeSafe = useThemeSafe;
|
|
5186
5542
|
//# sourceMappingURL=index.js.map
|