@admin-layout/tailwind-design-pro 11.0.4-alpha.4 → 11.2.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +471 -1
- package/lib/cdm-locales/en/menu.json +2 -1
- package/lib/cdm-locales/en/settings.json +40 -1
- package/lib/cdm-locales/es/menu.json +2 -1
- package/lib/cdm-locales/es/settings.json +42 -3
- package/lib/cdm-locales/index.d.ts +2 -0
- package/lib/cdm-locales/index.d.ts.map +1 -0
- package/lib/cdm-locales/index.ts +1 -0
- package/lib/components/LanguageMenu/LanguageMenu.d.ts +2 -1
- package/lib/components/LanguageMenu/LanguageMenu.d.ts.map +1 -1
- package/lib/components/LanguageMenu/LanguageMenu.js +40 -61
- package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
- package/lib/components/Layout/BasicLayout/index.d.ts +6 -12
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +274 -108
- package/lib/components/Layout/BasicLayout/index.js.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.d.ts +4 -2
- package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.js +80 -109
- package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts +1 -8
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +28 -38
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalFooter/Copyright.d.ts +2 -1
- package/lib/components/Layout/GlobalFooter/Copyright.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/Footer.d.ts +2 -1
- package/lib/components/Layout/GlobalFooter/Footer.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts +1 -15
- package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.js +107 -65
- package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.js +187 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts +1 -12
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +26 -30
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts +3 -16
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.js +86 -0
- package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.js +248 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.d.ts +9 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.js +109 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/index.d.ts +3 -0
- package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -0
- package/lib/components/Layout/ProTailwindLayout.d.ts +3 -1
- package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.js +77 -12
- package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
- package/lib/components/Layout/Sidebar/BottomMenu.d.ts +4 -0
- package/lib/components/Layout/Sidebar/BottomMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/BottomMenu.js +294 -0
- package/lib/components/Layout/Sidebar/BottomMenu.js.map +1 -0
- package/lib/components/Layout/Sidebar/Divider.d.ts +2 -31
- package/lib/components/Layout/Sidebar/Divider.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/Divider.js +26 -28
- package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
- package/lib/components/Layout/Sidebar/DynamicIcon.d.ts +5 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.js +50 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebar.d.ts +5 -0
- package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebar.js +224 -0
- package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +6 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js +451 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +4 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.js +254 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts +4 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +318 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -0
- package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/TailwindLayout.js +46 -13
- package/lib/components/Layout/TailwindLayout.js.map +1 -1
- package/lib/components/Layout/getPageTitle.d.ts +1 -16
- package/lib/components/Layout/getPageTitle.d.ts.map +1 -1
- package/lib/components/Layout/getPageTitle.js +1 -1
- package/lib/components/Layout/getPageTitle.js.map +1 -1
- package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts +5 -0
- package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/AdditionalSettings.js +7 -0
- package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -0
- package/lib/components/Layout/slot-fill/Footer.d.ts +4 -3
- package/lib/components/Layout/slot-fill/Footer.d.ts.map +1 -1
- package/lib/components/Layout/slot-fill/Footer.js +6 -6
- package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderNotice.d.ts +3 -2
- package/lib/components/Layout/slot-fill/HeaderNotice.d.ts.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderNotice.js +7 -0
- package/lib/components/Layout/slot-fill/HeaderNotice.js.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts +4 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.js +6 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts +4 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.js +6 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -0
- package/lib/components/Layout/slot-fill/Logo.d.ts +5 -0
- package/lib/components/Layout/slot-fill/Logo.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/Logo.js +7 -0
- package/lib/components/Layout/slot-fill/Logo.js.map +1 -0
- package/lib/components/Layout/slot-fill/RightContent.d.ts +4 -0
- package/lib/components/Layout/slot-fill/RightContent.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/RightContent.js +6 -0
- package/lib/components/Layout/slot-fill/RightContent.js.map +1 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts +5 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.js +7 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.js.map +1 -0
- package/lib/components/Layout/slot-fill/index.d.ts +6 -0
- package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
- package/lib/components/Layout/util.d.ts.map +1 -1
- package/lib/components/Layout/util.js +12 -0
- package/lib/components/Layout/util.js.map +1 -0
- package/lib/components/SettingDrawer/SettingDrawer.d.ts +2 -25
- package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.js +203 -382
- package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts +8 -0
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js +21 -0
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js.map +1 -0
- package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts +4 -0
- package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/CheckBoxTheme.js +119 -0
- package/lib/components/SettingDrawer/components/CheckBoxTheme.js.map +1 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.d.ts +8 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.js +74 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.js.map +1 -0
- package/lib/components/SettingDrawer/components/InvitationSettings.d.ts +4 -0
- package/lib/components/SettingDrawer/components/InvitationSettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/InvitationSettings.js +72 -0
- package/lib/components/SettingDrawer/components/InvitationSettings.js.map +1 -0
- package/lib/components/SettingDrawer/components/LayoutChange.d.ts +4 -0
- package/lib/components/SettingDrawer/components/LayoutChange.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/LayoutChange.js +111 -0
- package/lib/components/SettingDrawer/components/LayoutChange.js.map +1 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts +21 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js +106 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js.map +1 -0
- package/lib/components/SettingDrawer/components/NavigationsModes.d.ts +4 -0
- package/lib/components/SettingDrawer/components/NavigationsModes.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/NavigationsModes.js +322 -0
- package/lib/components/SettingDrawer/components/NavigationsModes.js.map +1 -0
- package/lib/components/SettingDrawer/components/RegionalSettings.d.ts +4 -0
- package/lib/components/SettingDrawer/components/RegionalSettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/RegionalSettings.js +519 -0
- package/lib/components/SettingDrawer/components/RegionalSettings.js.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsActions.d.ts +13 -0
- package/lib/components/SettingDrawer/components/SettingsActions.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsActions.js +42 -0
- package/lib/components/SettingDrawer/components/SettingsActions.js.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts +5 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js +22 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js.map +1 -0
- package/lib/components/SettingDrawer/components/Switch.d.ts +4 -0
- package/lib/components/SettingDrawer/components/Switch.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/Switch.js +20 -0
- package/lib/components/SettingDrawer/components/Switch.js.map +1 -0
- package/lib/components/SettingDrawer/components/ThemeColor.d.ts +4 -0
- package/lib/components/SettingDrawer/components/ThemeColor.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/ThemeColor.js +45 -0
- package/lib/components/SettingDrawer/components/ThemeColor.js.map +1 -0
- package/lib/components/SettingDrawer/components/ThemeSelector.d.ts +4 -0
- package/lib/components/SettingDrawer/components/ThemeSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/ThemeSelector.js +16 -0
- package/lib/components/SettingDrawer/components/ThemeSelector.js.map +1 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts +4 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.js +22 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.js.map +1 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts +18 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts.map +1 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.js +115 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.js.map +1 -0
- package/lib/components/SettingDrawer/utils/constants.d.ts +11 -0
- package/lib/components/SettingDrawer/utils/constants.d.ts.map +1 -0
- package/lib/components/SettingDrawer/utils/constants.js +77 -0
- package/lib/components/SettingDrawer/utils/constants.js.map +1 -0
- package/lib/components/SettingDrawer/utils/helper.d.ts +37 -0
- package/lib/components/SettingDrawer/utils/helper.d.ts.map +1 -0
- package/lib/components/SettingDrawer/utils/helper.js +154 -0
- package/lib/components/SettingDrawer/utils/helper.js.map +1 -0
- package/lib/components/SettingDrawer/utils/transformers.d.ts +15 -0
- package/lib/components/SettingDrawer/utils/transformers.d.ts.map +1 -0
- package/lib/components/SettingDrawer/utils/transformers.js +73 -0
- package/lib/components/SettingDrawer/utils/transformers.js.map +1 -0
- package/lib/components/SettingDrawer/utils/types.d.ts +105 -0
- package/lib/components/SettingDrawer/utils/types.d.ts.map +1 -0
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +16 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +97 -4
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/typings.d.ts +154 -50
- package/lib/components/typings.d.ts.map +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +16 -6
- package/lib/compute.js.map +1 -1
- package/lib/config/analytics-config.d.ts +59 -0
- package/lib/config/analytics-config.d.ts.map +1 -0
- package/lib/config/constants.d.ts +8 -0
- package/lib/config/constants.d.ts.map +1 -0
- package/lib/config/constants.js +32 -0
- package/lib/config/constants.js.map +1 -0
- package/lib/config/env-config.d.ts +21 -0
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +86 -1
- package/lib/config/env-config.js.map +1 -1
- package/lib/config/index.d.ts +3 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/helpers/DynamicIcon.d.ts +8 -5
- package/lib/helpers/DynamicIcon.d.ts.map +1 -1
- package/lib/helpers/DynamicIcon.js +50 -0
- package/lib/helpers/DynamicIcon.js.map +1 -0
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/useMediaQuery.d.ts +14 -0
- package/lib/hooks/useMediaQuery.d.ts.map +1 -0
- package/lib/hooks/useMediaQuery.js +48 -0
- package/lib/hooks/useMediaQuery.js.map +1 -0
- package/lib/hooks/useScrollThreshold.d.ts +12 -0
- package/lib/hooks/useScrollThreshold.d.ts.map +1 -0
- package/lib/hooks/useScrollThreshold.js +60 -0
- package/lib/hooks/useScrollThreshold.js.map +1 -0
- package/lib/hooks/useTailwindTheme.d.ts +34 -0
- package/lib/hooks/useTailwindTheme.d.ts.map +1 -0
- package/lib/hooks/useTailwindTheme.js +82 -0
- package/lib/hooks/useTailwindTheme.js.map +1 -0
- package/lib/icons.d.ts +18 -0
- package/lib/icons.d.ts.map +1 -0
- package/lib/icons.js +14 -0
- package/lib/icons.js.map +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/machines/selectors.d.ts +118 -0
- package/lib/machines/selectors.d.ts.map +1 -0
- package/lib/machines/settingsMachine.d.ts +29 -0
- package/lib/machines/settingsMachine.d.ts.map +1 -0
- package/lib/machines/settingsMachine.js +171 -0
- package/lib/machines/settingsMachine.js.map +1 -0
- package/lib/machines/types.d.ts +272 -0
- package/lib/machines/types.d.ts.map +1 -0
- package/lib/machines/types.js +5 -0
- package/lib/machines/types.js.map +1 -0
- package/lib/module.d.ts +0 -1
- package/lib/module.d.ts.map +1 -1
- package/lib/module.js +14 -15
- package/lib/module.js.map +1 -1
- package/lib/redux/index.d.ts +2 -0
- package/lib/redux/index.d.ts.map +1 -0
- package/lib/redux/searchReducer.d.ts +42 -0
- package/lib/redux/searchReducer.d.ts.map +1 -0
- package/lib/redux/searchReducer.js +64 -0
- package/lib/redux/searchReducer.js.map +1 -0
- package/lib/routes.json +10 -1
- package/lib/styles/index.css +667 -45
- package/lib/tailwindConfig.d.ts +100 -0
- package/lib/tailwindConfig.d.ts.map +1 -0
- package/lib/tailwindConfig.js +101 -0
- package/lib/tailwindConfig.js.map +1 -0
- package/lib/utils/__tests__/analytics-utils.test.d.ts +2 -0
- package/lib/utils/__tests__/analytics-utils.test.d.ts.map +1 -0
- package/lib/utils/__tests__/configOverrides.test.d.ts +2 -0
- package/lib/utils/__tests__/configOverrides.test.d.ts.map +1 -0
- package/lib/utils/__tests__/menu.test.d.ts +2 -0
- package/lib/utils/__tests__/menu.test.d.ts.map +1 -0
- package/lib/utils/__tests__/selectors.test.d.ts +2 -0
- package/lib/utils/__tests__/selectors.test.d.ts.map +1 -0
- package/lib/utils/__tests__/settingsMachine.test.d.ts +2 -0
- package/lib/utils/__tests__/settingsMachine.test.d.ts.map +1 -0
- package/lib/utils/__tests__/settingsUtils.test.d.ts +2 -0
- package/lib/utils/__tests__/settingsUtils.test.d.ts.map +1 -0
- package/lib/utils/analytics-utils.d.ts +43 -0
- package/lib/utils/analytics-utils.d.ts.map +1 -0
- package/lib/utils/analytics.d.ts +48 -0
- package/lib/utils/analytics.d.ts.map +1 -0
- package/lib/utils/configOverrides.d.ts +213 -0
- package/lib/utils/configOverrides.d.ts.map +1 -0
- package/lib/utils/configOverrides.js +91 -0
- package/lib/utils/configOverrides.js.map +1 -0
- package/lib/utils/formateCarData.d.ts +2 -0
- package/lib/utils/formateCarData.d.ts.map +1 -0
- package/lib/utils/isBrowser/index.js.map +1 -1
- package/lib/utils/menu.d.ts.map +1 -1
- package/lib/utils/settingsUtils.d.ts +20 -0
- package/lib/utils/settingsUtils.d.ts.map +1 -0
- package/lib/utils/settingsUtils.js +74 -0
- package/lib/utils/settingsUtils.js.map +1 -0
- package/lib/utils/test-utils.d.ts.map +1 -1
- package/lib/utils/utils/index.d.ts.map +1 -1
- package/lib/utils/utils/index.js.map +1 -1
- package/package.json +7 -15
- package/lib/components/Layout/GlobalFooter/Copyright.js +0 -8
- package/lib/components/Layout/GlobalFooter/Copyright.js.map +0 -1
- package/lib/components/Layout/GlobalFooter/Footer.js +0 -22
- package/lib/components/Layout/GlobalFooter/Footer.js.map +0 -1
- package/lib/components/Layout/Sidebar/Sidebar.d.ts +0 -15
- package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +0 -1
- package/lib/components/Layout/Sidebar/Sidebar.js +0 -141
- package/lib/components/Layout/Sidebar/Sidebar.js.map +0 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +0 -6
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +0 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.js +0 -89
- package/lib/components/Layout/Sidebar/SidebarMenu.js.map +0 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts +0 -8
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +0 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.js +0 -48
- package/lib/components/SettingDrawer/CheckBoxTheme.js.map +0 -1
- package/lib/components/SettingDrawer/LayoutChange.d.ts +0 -7
- package/lib/components/SettingDrawer/LayoutChange.d.ts.map +0 -1
- package/lib/components/SettingDrawer/LayoutChange.js +0 -69
- package/lib/components/SettingDrawer/LayoutChange.js.map +0 -1
- package/lib/components/SettingDrawer/RegionalSettings.d.ts +0 -8
- package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +0 -1
- package/lib/components/SettingDrawer/RegionalSettings.js +0 -95
- package/lib/components/SettingDrawer/RegionalSettings.js.map +0 -1
- package/lib/components/SettingDrawer/Switch/index.d.ts +0 -9
- package/lib/components/SettingDrawer/Switch/index.d.ts.map +0 -1
- package/lib/components/SettingDrawer/Switch/index.js +0 -39
- package/lib/components/SettingDrawer/Switch/index.js.map +0 -1
- package/lib/components/SettingDrawer/ThemeColor.d.ts +0 -8
- package/lib/components/SettingDrawer/ThemeColor.d.ts.map +0 -1
- package/lib/components/SettingDrawer/ThemeColor.js +0 -32
- package/lib/components/SettingDrawer/ThemeColor.js.map +0 -1
- package/lib/components/defaultSettings.d.ts +0 -4
- package/lib/components/defaultSettings.d.ts.map +0 -1
- package/lib/components/defaultSettings.js +0 -14
- package/lib/components/defaultSettings.js.map +0 -1
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/index.js +0 -13
- package/lib/utils/index.js.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Analytics Configuration
|
|
3
|
+
*/
|
|
4
|
+
export declare const ANALYTICS_CONFIG: {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
debug: boolean;
|
|
7
|
+
GA4_MEASUREMENT_ID: string;
|
|
8
|
+
trackEvents: {
|
|
9
|
+
pageViews: boolean;
|
|
10
|
+
clicks: boolean;
|
|
11
|
+
redirections: boolean;
|
|
12
|
+
errors: boolean;
|
|
13
|
+
};
|
|
14
|
+
trackUserProperties: {
|
|
15
|
+
userId: boolean;
|
|
16
|
+
deviceInfo: boolean;
|
|
17
|
+
location: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const EVENT_CATEGORIES: {
|
|
21
|
+
REDIRECTION: string;
|
|
22
|
+
USER_INTERACTION: string;
|
|
23
|
+
SYSTEM: string;
|
|
24
|
+
ERROR: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const EVENT_ACTIONS: {
|
|
27
|
+
AUTO_REDIRECT: string;
|
|
28
|
+
MANUAL_CLICK: string;
|
|
29
|
+
LINK_CLICK: string;
|
|
30
|
+
BUTTON_CLICK: string;
|
|
31
|
+
FORM_SUBMIT: string;
|
|
32
|
+
SEARCH: string;
|
|
33
|
+
VIEW_ITEM: string;
|
|
34
|
+
ADD_TO_CART: string;
|
|
35
|
+
REMOVE_FROM_CART: string;
|
|
36
|
+
BEGIN_CHECKOUT: string;
|
|
37
|
+
ADD_PAYMENT_INFO: string;
|
|
38
|
+
PURCHASE: string;
|
|
39
|
+
LOAD: string;
|
|
40
|
+
INIT: string;
|
|
41
|
+
API_ERROR: string;
|
|
42
|
+
CLIENT_ERROR: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const GA4_EVENTS: {
|
|
45
|
+
PAGE_VIEW: string;
|
|
46
|
+
SEARCH: string;
|
|
47
|
+
VIEW_ITEM: string;
|
|
48
|
+
VIEW_ITEM_LIST: string;
|
|
49
|
+
SELECT_ITEM: string;
|
|
50
|
+
ADD_TO_CART: string;
|
|
51
|
+
REMOVE_FROM_CART: string;
|
|
52
|
+
BEGIN_CHECKOUT: string;
|
|
53
|
+
ADD_PAYMENT_INFO: string;
|
|
54
|
+
PURCHASE: string;
|
|
55
|
+
LOGIN: string;
|
|
56
|
+
SIGN_UP: string;
|
|
57
|
+
USER_ENGAGEMENT: string;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=analytics-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-config.d.ts","sourceRoot":"","sources":["../../src/config/analytics-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;CAwB5B,CAAC;AAGF,eAAO,MAAM,gBAAgB;;;;;CAK5B,CAAC;AAGF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;CAwBzB,CAAC;AAGF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;CActB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;CAKnB,CAAC;AAEX,eAAO,MAAM,eAAe,IAyBlB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const SCROLL_THRESHOLD = {
|
|
2
|
+
MIN: 0,
|
|
3
|
+
MAX: 1000,
|
|
4
|
+
STEP: 10,
|
|
5
|
+
DEFAULT: 50
|
|
6
|
+
};
|
|
7
|
+
const LAYOUT_SETTINGS = {
|
|
8
|
+
// navTheme: 'light',
|
|
9
|
+
// routeSettings: {
|
|
10
|
+
// '/': {
|
|
11
|
+
// layout: {
|
|
12
|
+
// desktop: {
|
|
13
|
+
// navigationMode: 'topbar',
|
|
14
|
+
// contentWidth: 'fluid',
|
|
15
|
+
// },
|
|
16
|
+
// mobile: {
|
|
17
|
+
// contentWidth: 'fluid',
|
|
18
|
+
// },
|
|
19
|
+
// },
|
|
20
|
+
// regions: {
|
|
21
|
+
// desktop: {
|
|
22
|
+
// header: {
|
|
23
|
+
// showMenuToggle: false,
|
|
24
|
+
// showBackButton: false,
|
|
25
|
+
// showPageTitle: false,
|
|
26
|
+
// showActionButtons: false,
|
|
27
|
+
// },
|
|
28
|
+
// },
|
|
29
|
+
// },
|
|
30
|
+
// },
|
|
31
|
+
// },
|
|
32
|
+
};export{LAYOUT_SETTINGS,SCROLL_THRESHOLD};//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/config/constants.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GAAG;AAC5B,EAAA,GAAA,EAAG;AACH,EAAA,GAAA,EAAG,IAAE;AACL,EAAA,IAAA,EAAI,EAAE;AACN,EAAA,OAAA,EAAO;;AAGJ,MAAM,eAAe,GAAG;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
export declare const config: Readonly<{
|
|
2
2
|
LAYOUT_ROOT: string;
|
|
3
|
+
ENABLE_PROPERTY_PRICE_COMPARISON: boolean;
|
|
4
|
+
SCROLL_THRESHOLD: string;
|
|
5
|
+
LAYOUT_SETTINGS: string;
|
|
6
|
+
BOOKING_CAR_RENTAL_API_KEY: string;
|
|
7
|
+
AIRBNB_API_KEY: string;
|
|
8
|
+
BOOKING_COM_API_KEY: string;
|
|
9
|
+
APP_DOMAIN: string;
|
|
10
|
+
SEARCH_LAYOUT: string;
|
|
11
|
+
GOOGLE_MAPS_API_KEY: string;
|
|
12
|
+
PROPERTY_SEARCH_DEFAULT_PAGE_SIZE: number;
|
|
13
|
+
PROPERTY_COUPONS_DEFAULT_PAGE_SIZE: number;
|
|
14
|
+
DEFAULT_NEARBY_PROPERTY_RADIUS: number;
|
|
15
|
+
AIRBNB_DEFAULT_TOTAL_PAGES: number;
|
|
16
|
+
BOOKING_COM_DEFAULT_PAGE_SIZE: number;
|
|
17
|
+
PRICELINE_API_KEY: string;
|
|
18
|
+
DEFAULT_COORDINATES: string;
|
|
19
|
+
ENABLE_SETTING_DRAWER: boolean;
|
|
20
|
+
GOOGLE_ANALYTICS_ID: string;
|
|
21
|
+
RAPID_API_KEY: string;
|
|
22
|
+
APPLICATION_ID: string;
|
|
23
|
+
USE_FETCH_SETTINGS: string;
|
|
3
24
|
} & import("envalid").CleanedEnvAccessors>;
|
|
4
25
|
//# sourceMappingURL=env-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;0CA4CjB,CAAC"}
|
package/lib/config/env-config.js
CHANGED
|
@@ -1,7 +1,92 @@
|
|
|
1
|
-
import {cleanEnv,str}from'envalid';import {getEnvironment}from'@common-stack/core';const env = getEnvironment();
|
|
1
|
+
import {cleanEnv,str,bool,num}from'envalid';import {getEnvironment}from'@common-stack/core';import {SCROLL_THRESHOLD,LAYOUT_SETTINGS}from'./constants.js';const env = getEnvironment();
|
|
2
|
+
const defaultScrollThreshold = JSON.stringify({
|
|
3
|
+
MIN: SCROLL_THRESHOLD.MIN,
|
|
4
|
+
MAX: SCROLL_THRESHOLD.MAX,
|
|
5
|
+
STEP: SCROLL_THRESHOLD.STEP,
|
|
6
|
+
DEFAULT: SCROLL_THRESHOLD.DEFAULT
|
|
7
|
+
});
|
|
2
8
|
const config = cleanEnv(env, {
|
|
3
9
|
LAYOUT_ROOT: str({
|
|
4
10
|
default: '/o/:orgName',
|
|
5
11
|
desc: 'Layout parent route'
|
|
12
|
+
}),
|
|
13
|
+
ENABLE_PROPERTY_PRICE_COMPARISON: bool({
|
|
14
|
+
default: false,
|
|
15
|
+
desc: 'Enable property price comparison section'
|
|
16
|
+
}),
|
|
17
|
+
SCROLL_THRESHOLD: str({
|
|
18
|
+
default: defaultScrollThreshold,
|
|
19
|
+
desc: 'Scroll threshold configuration'
|
|
20
|
+
}),
|
|
21
|
+
LAYOUT_SETTINGS: str({
|
|
22
|
+
default: JSON.stringify(LAYOUT_SETTINGS),
|
|
23
|
+
desc: 'Layout settings'
|
|
24
|
+
}),
|
|
25
|
+
BOOKING_CAR_RENTAL_API_KEY: str({
|
|
26
|
+
default: '',
|
|
27
|
+
desc: 'Booking car rental API key'
|
|
28
|
+
}),
|
|
29
|
+
AIRBNB_API_KEY: str({
|
|
30
|
+
default: '',
|
|
31
|
+
desc: 'Airbnb API key'
|
|
32
|
+
}),
|
|
33
|
+
BOOKING_COM_API_KEY: str({
|
|
34
|
+
default: '',
|
|
35
|
+
desc: 'Booking com API key'
|
|
36
|
+
}),
|
|
37
|
+
APP_DOMAIN: str({
|
|
38
|
+
default: 'cdebase.dev'
|
|
39
|
+
}),
|
|
40
|
+
SEARCH_LAYOUT: str({
|
|
41
|
+
default: '/search',
|
|
42
|
+
desc: 'Layout Search route'
|
|
43
|
+
}),
|
|
44
|
+
GOOGLE_MAPS_API_KEY: str({
|
|
45
|
+
default: 'AIzaSyCtMaqd4AQayEx4-QTbuM_uL91pQrUsbK8'
|
|
46
|
+
}),
|
|
47
|
+
PROPERTY_SEARCH_DEFAULT_PAGE_SIZE: num({
|
|
48
|
+
default: 10,
|
|
49
|
+
desc: 'Number of property to fetch in each request'
|
|
50
|
+
}),
|
|
51
|
+
PROPERTY_COUPONS_DEFAULT_PAGE_SIZE: num({
|
|
52
|
+
default: 10,
|
|
53
|
+
desc: 'Number of coupons to fetch in each request'
|
|
54
|
+
}),
|
|
55
|
+
DEFAULT_NEARBY_PROPERTY_RADIUS: num({
|
|
56
|
+
default: 160934,
|
|
57
|
+
// The value is in meter so its actually 100 miles
|
|
58
|
+
desc: 'Sets the default distance for searching nearby properties'
|
|
59
|
+
}),
|
|
60
|
+
AIRBNB_DEFAULT_TOTAL_PAGES: num({
|
|
61
|
+
default: 8,
|
|
62
|
+
desc: 'Number of property to fetch in each request'
|
|
63
|
+
}),
|
|
64
|
+
BOOKING_COM_DEFAULT_PAGE_SIZE: num({
|
|
65
|
+
default: 20,
|
|
66
|
+
desc: 'Number of property to fetch in each request'
|
|
67
|
+
}),
|
|
68
|
+
PRICELINE_API_KEY: str({
|
|
69
|
+
default: ''
|
|
70
|
+
}),
|
|
71
|
+
DEFAULT_COORDINATES: str({
|
|
72
|
+
default: '{"lat":40.7127281,"lng":-74.0060152}',
|
|
73
|
+
desc: 'Default coordinates for property search'
|
|
74
|
+
}),
|
|
75
|
+
ENABLE_SETTING_DRAWER: bool({
|
|
76
|
+
default: false,
|
|
77
|
+
desc: 'Enable setting drawer'
|
|
78
|
+
}),
|
|
79
|
+
GOOGLE_ANALYTICS_ID: str({
|
|
80
|
+
default: 'G-L5J3SYZ69C'
|
|
81
|
+
}),
|
|
82
|
+
RAPID_API_KEY: str({
|
|
83
|
+
default: '7c2d15ba29msh468be2f129d847cp183e95jsnc7c279116f6e'
|
|
84
|
+
}),
|
|
85
|
+
APPLICATION_ID: str({
|
|
86
|
+
default: '660e8400-e29b-41d4-a716-446655440001',
|
|
87
|
+
desc: 'Matches the Application ID exist already'
|
|
88
|
+
}),
|
|
89
|
+
USE_FETCH_SETTINGS: str({
|
|
90
|
+
default: ''
|
|
6
91
|
})
|
|
7
92
|
});export{config};//# sourceMappingURL=env-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":[null],"names":[],"mappings":"0JAIA,MAAM,GAAG,GAAG,cAAc,EAAE;AAE5B,MAAM,sBAAsB,GAAG,IAAI,CAAC,SAAS,CAAC;KAC1C,EAAG,gBAAE,CAAA,GAAiB;KACtB,EAAG,gBAAE,CAAA,GAAiB;MACtB,EAAI,gBAAE,CAAA,IAAiB;SACvB,EAAO,gBAAE,CAAA;AACZ,CAAA,CAAC;AAEK,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE;AAChC,EAAA,WAAA,EAAW,GAAE,CAAA;AACb,IAAA,OAAA,EAAA,aAAA;AACA,IAAA,IAAA,EAAA;AACA,GAAA,CAAA;AACA,EAAA,gCAA4B,EAAI,IAAE,CAAA;AAClC,IAAA,OAAA,EAAA,KAAc;AACd,IAAA,IAAA,EAAA;IACA;AACA,EAAA,gBAAa,EAAE,GAAI,CAAA;IACnB,OAAA,EAAA;IACA,IAAA,EAAA;AACI,GAAA,CAAA;AACA,EAAA,eAAM,EAAA,GAAA,CAAA;WACR,EAAA,IAAA,CAAA,SAAA,CAAA,eAAA,CAAA;IACF,IAAA,EAAA;AACI,GAAA,CAAA;AACA,EAAA,0BAAM,EAAA,GAAA,CAAA;WACR,EAAA,EAAA;IACF,IAAA,EAAA;;AAEI,EAAA,cAAM,EAAA,GAAA,CAAA;WACR,EAAA,EAAA;IACF,IAAA,EAAA;AACI,GAAA,CAAA;AACA,EAAA,mBAAM,EAAA,GAAA,CAAA;WACR,EAAA,EAAA;IACF,IAAA,EAAA;AACI,GAAA,CAAA;AACA,EAAA,UAAI,EAAE,GAAA,CAAA;WACR,EAAA;IACF;eACA,EAAA,GAAA,CAAA;AACI,IAAA,OAAA,EAAA,SAAS;AACT,IAAA,IAAA,EAAA;;AAEJ,EAAA,mBAAA,EAAA,GAAqB,CAAE;IACvB,OAAA,EAAA;IACA;mCACoB,EAAA,GAAA,CAAA;AAChB,IAAA,OAAA,EAAA,EAAO;AACP,IAAA,IAAA,EAAA;;sCAE6B,GAAI;AACxC,IAAE,OAAA,EAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface DynamicTypeIconsProps {
|
|
3
3
|
icon: any;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
iconStyle?: {
|
|
5
|
+
iconColor?: string;
|
|
6
|
+
w?: string;
|
|
7
|
+
h?: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
[key: string]: any;
|
|
8
11
|
}
|
|
9
12
|
export declare const DynamicIcon: React.FC<DynamicTypeIconsProps>;
|
|
10
|
-
export declare const renderDynamicIcon: (icon: any) =>
|
|
13
|
+
export declare const renderDynamicIcon: (icon: any) => React.JSX.Element;
|
|
11
14
|
export {};
|
|
12
15
|
//# sourceMappingURL=DynamicIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicIcon.d.ts","sourceRoot":"","sources":["../../src/helpers/DynamicIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DynamicIcon.d.ts","sourceRoot":"","sources":["../../src/helpers/DynamicIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,qBAAqB;IAC3B,IAAI,EAAE,GAAG,CAAC;IACV,SAAS,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAyCvD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAI,sBAQrC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import*as React from'react';import {useState,useEffect}from'react';import selectiveIcons from'@app/selectiveIcons';const DynamicIcon = React.memo(({
|
|
2
|
+
icon,
|
|
3
|
+
iconStyle,
|
|
4
|
+
...props
|
|
5
|
+
}) => {
|
|
6
|
+
const [IconComponent, setIconComponent] = useState(null);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const loadIcon = () => {
|
|
9
|
+
const selectedIcon = selectiveIcons(icon);
|
|
10
|
+
selectedIcon.then(module => {
|
|
11
|
+
if (typeof module.default === 'object') {
|
|
12
|
+
setIconComponent(() => module.default[icon]);
|
|
13
|
+
} else {
|
|
14
|
+
setIconComponent(() => module.default);
|
|
15
|
+
}
|
|
16
|
+
}).catch(err => {
|
|
17
|
+
setIconComponent(null);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
loadIcon();
|
|
21
|
+
}, [icon]);
|
|
22
|
+
if (!IconComponent) return null;
|
|
23
|
+
return React.createElement("div", {
|
|
24
|
+
className: "m-0 flex"
|
|
25
|
+
}, React.createElement(IconComponent, {
|
|
26
|
+
className: "textCurrent",
|
|
27
|
+
style: {
|
|
28
|
+
color: iconStyle?.iconColor,
|
|
29
|
+
stroke: iconStyle?.iconColor,
|
|
30
|
+
width: iconStyle?.w || '16px',
|
|
31
|
+
height: iconStyle?.h || '16px',
|
|
32
|
+
...props.style
|
|
33
|
+
},
|
|
34
|
+
...props
|
|
35
|
+
}));
|
|
36
|
+
}, (prevProps, nextProps) => prevProps.icon === nextProps.icon && prevProps.iconStyle?.iconColor === nextProps.iconStyle?.iconColor);
|
|
37
|
+
const renderDynamicIcon = icon => {
|
|
38
|
+
if (typeof icon === 'object') {
|
|
39
|
+
return React.createElement(DynamicIcon, {
|
|
40
|
+
icon: icon.name,
|
|
41
|
+
iconStyle: icon.style
|
|
42
|
+
});
|
|
43
|
+
} else if (typeof icon === 'string') {
|
|
44
|
+
return React.createElement(DynamicIcon, {
|
|
45
|
+
icon: icon
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
};export{DynamicIcon,renderDynamicIcon};//# sourceMappingURL=DynamicIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicIcon.js","sources":["../../src/helpers/DynamicIcon.tsx"],"sourcesContent":[null],"names":[],"mappings":"mHAgBO,MAAM,WAAW,GAAoC,KAAK,CAAC,IAAI,CAClE,CAAC;MACG;WACA;;AAEQ,CAAA,KAAA;sBACA,EAAY,gBAAA,CAAA,GAAA,QAAA,CAAA,IAAA,CAAA;AACP,EAAA,SAAA,CAAA,MAAA;AACG,IAAA,MAAA,QAAA,SAAW;wBACP,GAAA,cAAoB,CAAE,IAAC,CAAA;kBAC1B,CAAA,IAAA,CAAA,MAAA,IAAA;yBAAO,CAAA,OAAA,KAAA,QAAA,EAAA;0BACJ,CAAA,MAAA,OAAoB,YAAU,CAAA,CAAA;;AAEtC,UAAA,gBAAE,CAAA,MAAA,MAAA,CAAA,OAAA,CAAA;AACD,QAAA;kBACG,IAAA;AACJ,QAAA,gBAAG,CAAA,IAAA,CAAA;AACX,MAAA,CAAA,CAAA;AACA,IAAA,CAAA;AACJ,IAAA,QAAQ,EAAE;AAEV,EAAA,CAAA,EAAA,CAAA,IAAK,CAAA,CAAA;AAAe,EAAA,IAAA,CAAA,aAAY,EAAA,OAAA,IAAA;AAEhC,EAAA,OAAA,KACI,CAAA,aAAA,CAAA,KAAA,EAAA;AACI,IAAA,SAAA,EAAA;wBAGe,CAAA,aAAW,EAAA;4BACV;AACR,IAAA,KAAA,EAAA;AACA,MAAA,KAAA,EAAA,SAAM,EAAE,SAAS;uBACd,EAAM,SAAK;AACjB,MAAA,KAAA,EAAA,SACG,EAAK,CAAA,IAGnB,MAAA;AACN,MACC,MAAA,EAAS,SAAE,EAAS,CAAE,IACnB,MAAA;AAGR,MAAM,GAAC,KAAM,CAAA;AACT,KAAA;AACI,IAAA,GAAA;IACJ,CAAC;AAAM,CAAA,EAAA,CAAA,SAAI,EAAA,SAAW,KAAK,UAAU,IAAC,KAAA,SAAA,CAAA,IAAA,IAAA,SAAA,CAAA,SAAA,EAAA,SAAA,KAAA,SAAA,CAAA,SAAA,EAAA,SAAA;AAClC,MAAA,wBAAQ,IAAA;MACX,OAAA,IAAA,KAAA,QAAA,EAAA;WAAO,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AACJ,MAAA,IAAA,EAAA,SAAY;MACf,SAAA,EAAA,IAAA,CAAA;AACL,KAAE,CAAA;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface MediaQueryResult {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
isMobile: boolean;
|
|
5
|
+
xs: boolean;
|
|
6
|
+
sm: boolean;
|
|
7
|
+
md: boolean;
|
|
8
|
+
lg: boolean;
|
|
9
|
+
xl: boolean;
|
|
10
|
+
'2xl': boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const useMediaQuery: () => MediaQueryResult;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=useMediaQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../src/hooks/useMediaQuery.ts"],"names":[],"mappings":"AAEA,UAAU,gBAAgB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;CAClB;AAoBD,eAAO,MAAM,aAAa,QAAO,gBAyChC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {useState,useEffect}from'react';const breakpoints = {
|
|
2
|
+
sm: 640,
|
|
3
|
+
md: 768,
|
|
4
|
+
lg: 1024,
|
|
5
|
+
xl: 1280,
|
|
6
|
+
'2xl': 1536
|
|
7
|
+
};
|
|
8
|
+
const getFlags = width => ({
|
|
9
|
+
xs: width < breakpoints.sm,
|
|
10
|
+
sm: width >= breakpoints.sm && width < breakpoints.md,
|
|
11
|
+
md: width >= breakpoints.md && width < breakpoints.lg,
|
|
12
|
+
lg: width >= breakpoints.lg && width < breakpoints.xl,
|
|
13
|
+
xl: width >= breakpoints.xl && width < breakpoints['2xl'],
|
|
14
|
+
'2xl': width >= breakpoints['2xl']
|
|
15
|
+
});
|
|
16
|
+
const useMediaQuery = () => {
|
|
17
|
+
const getDimensions = () => {
|
|
18
|
+
const width = window.innerWidth;
|
|
19
|
+
const height = window.innerHeight;
|
|
20
|
+
const isMobile = width < breakpoints.md;
|
|
21
|
+
const flags = getFlags(width);
|
|
22
|
+
return {
|
|
23
|
+
width,
|
|
24
|
+
height,
|
|
25
|
+
isMobile,
|
|
26
|
+
...flags
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const [state, setState] = useState(() => typeof window !== 'undefined' ? getDimensions() : {
|
|
30
|
+
width: 0,
|
|
31
|
+
height: 0,
|
|
32
|
+
isMobile: false,
|
|
33
|
+
xs: false,
|
|
34
|
+
sm: false,
|
|
35
|
+
md: false,
|
|
36
|
+
lg: false,
|
|
37
|
+
xl: false,
|
|
38
|
+
'2xl': false
|
|
39
|
+
});
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const handleResize = () => {
|
|
42
|
+
setState(getDimensions());
|
|
43
|
+
};
|
|
44
|
+
window.addEventListener('resize', handleResize);
|
|
45
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
46
|
+
}, []);
|
|
47
|
+
return state;
|
|
48
|
+
};export{useMediaQuery};//# sourceMappingURL=useMediaQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMediaQuery.js","sources":["../../src/hooks/useMediaQuery.ts"],"sourcesContent":[null],"names":[],"mappings":"uCAcA,MAAM,WAAW,GAAG;AAChB,EACA,EAAA,EAAE,GAAE;AACJ,EAAA,EAAA,EAAE,GAAE;AACJ,EAAA,EAAA,EAAE,IAAE;AACJ,EAAA,EAAA,EAAE,IAAE;AACJ,EAAA,KAAA,EAAK;CACR;AAED,MAAM,QAAQ,GAAG,UAA2E;AACxF,EAAA,EAAA,EAAE,KAAE,GAAK,WAAG,CAAA,EAAY;IACxB,EAAE,KAAE,IAAK,WAAI,CAAA,EAAY,IAAE,KAAI,GAAK,WAAG,CAAA,EAAY;IACnD,EAAE,KAAE,IAAK,WAAI,CAAA,EAAY,IAAE,KAAI,GAAK,WAAG,CAAA,EAAY;IACnD,EAAE,KAAE,IAAK,WAAI,CAAA,EAAY,IAAE,KAAI,GAAK,WAAG,CAAA,EAAY;AACnD,EAAA,EAAA,EAAE,KAAE,IAAK,WAAI,CAAA,EAAY,IAAE,KAAI,GAAK,WAAG,CAAA,KAAY,CAAA;AACnD,EAAA,KAAA,EAAK,KAAE,IAAK,WAAI,CAAA;AACnB,CAAA,CAAC;AAEK,MAAM,aAAa,GAAG,MAAuB;QAChD,aAAM,GAAa,MAAM;AACrB,IAAA,MAAA,KAAM,GAAA,MAAQ,CAAA;AACd,IAAA,MAAA,MAAM,GAAA,MAAS,CAAA;AACf,IAAA,MAAA,gBAAiB,GAAA,WAAQ,CAAA,EAAA;AACzB,IAAA,MAAA,gBAAc,CAAA,KAAS,CAAA;WAEvB;;YAEI;cACA;AACA,MAAA,GAAA;;AAER,EAAA,CAAA;AAEA,EAAA,MAAA,CAAA,KAAO,EAAK,QAAE,CAAA,GAAS,QAAG,CAAA,MAA8B,OACpD,MAAO,gBAAW,GAAW,aAAA,EAAA,GAAA;SACxB;AACD,IAAA,MAAE,EAAA,CAAA;AACI,IAAA,QAAA,EAAA,KAAO;AACP,IAAA,EAAA,EAAA,KAAA;AACA,IAAA,EAAA,EAAA,KAAA;AACA,IAAA,EAAA,EAAA,KAAA;AACA,IAAA,EAAA,EAAA,KAAA;AACA,IAAA,EAAA,EAAA,KAAA;AACA,IAAA,KAAA,EAAA;AACA,GAAA,CAAA;AACA,EAAA,SAAA,CAAA;AACH,IAAA,MACV,YAAC,GAAA,MAAA;MAEF,QAAU,cAAK,EAAA,CAAA;;AAEP,IAAA,MAAA,CAAA,gBAAS,CAAA,QAAe,EAAE,YAAA,CAAA;AAC9B,IAAA,OAAE,MAAA,MAAA,CAAA,mBAAA,CAAA,QAAA,EAAA,YAAA,CAAA;AAEF,EAAA,CAAA,EAAA,EAAA,CAAA;SACA,KAAA;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
interface ScrollThresholdConfig {
|
|
3
|
+
threshold: number;
|
|
4
|
+
id: string;
|
|
5
|
+
useWindowScroll?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const useScrollThreshold: (configs: ScrollThresholdConfig[]) => {
|
|
8
|
+
containerRef: MutableRefObject<HTMLDivElement>;
|
|
9
|
+
componentVisibility: Record<string, boolean>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=useScrollThreshold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollThreshold.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollThreshold.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,gBAAgB,EAAe,MAAM,OAAO,CAAC;AAEnF,UAAU,qBAAqB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAYD,eAAO,MAAM,kBAAkB,GAAI,SAAS,qBAAqB,EAAE;;;CA4DlE,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {useState,useRef,useCallback,useEffect}from'react';const throttle = (fn, wait = 100) => {
|
|
2
|
+
let time = Date.now();
|
|
3
|
+
return function (...args) {
|
|
4
|
+
if (time + wait - Date.now() < 0) {
|
|
5
|
+
fn(...args);
|
|
6
|
+
time = Date.now();
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
const useScrollThreshold = configs => {
|
|
11
|
+
const [componentVisibility, setComponentVisibility] = useState({});
|
|
12
|
+
const containerRef = useRef(null);
|
|
13
|
+
const visibilityRef = useRef({});
|
|
14
|
+
const updateVisibility = useCallback(scrollPosition => {
|
|
15
|
+
const newVisibility = {};
|
|
16
|
+
let hasChanges = false;
|
|
17
|
+
configs.forEach(({
|
|
18
|
+
threshold,
|
|
19
|
+
id
|
|
20
|
+
}) => {
|
|
21
|
+
const isVisible = scrollPosition >= threshold;
|
|
22
|
+
if (visibilityRef.current[id] !== isVisible) {
|
|
23
|
+
hasChanges = true;
|
|
24
|
+
}
|
|
25
|
+
newVisibility[id] = isVisible;
|
|
26
|
+
});
|
|
27
|
+
if (hasChanges) {
|
|
28
|
+
visibilityRef.current = newVisibility;
|
|
29
|
+
setComponentVisibility(newVisibility);
|
|
30
|
+
}
|
|
31
|
+
}, [configs]);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const config = configs[0]; // Assuming we're only using one config for now
|
|
34
|
+
const useWindowScroll = config?.useWindowScroll ?? false;
|
|
35
|
+
const throttledUpdate = throttle(() => {
|
|
36
|
+
const scrollPosition = useWindowScroll ? window.scrollY : containerRef.current?.scrollTop ?? 0;
|
|
37
|
+
updateVisibility(scrollPosition);
|
|
38
|
+
}, 50);
|
|
39
|
+
const handleScroll = () => {
|
|
40
|
+
throttledUpdate();
|
|
41
|
+
};
|
|
42
|
+
if (useWindowScroll) {
|
|
43
|
+
window.addEventListener('scroll', handleScroll);
|
|
44
|
+
} else if (containerRef.current) {
|
|
45
|
+
containerRef.current.addEventListener('scroll', handleScroll);
|
|
46
|
+
}
|
|
47
|
+
updateVisibility(useWindowScroll ? window.scrollY : containerRef.current?.scrollTop ?? 0);
|
|
48
|
+
return () => {
|
|
49
|
+
if (useWindowScroll) {
|
|
50
|
+
window.removeEventListener('scroll', handleScroll);
|
|
51
|
+
} else if (containerRef.current) {
|
|
52
|
+
containerRef.current.removeEventListener('scroll', handleScroll);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}, [configs, updateVisibility]);
|
|
56
|
+
return {
|
|
57
|
+
containerRef,
|
|
58
|
+
componentVisibility
|
|
59
|
+
};
|
|
60
|
+
};export{useScrollThreshold};//# sourceMappingURL=useScrollThreshold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollThreshold.js","sources":["../../src/hooks/useScrollThreshold.ts"],"sourcesContent":[null],"names":[],"mappings":"0DAQA,MAAM,QAAQ,GAAG,CAAC,EAAY,EAAE,IAAA,GAAe,GAAG,KAAI;AAClD,EAAA,IAAA,OAAQ,IAAG,CAAA,GAAK,EAAG;SACnB,UAAO,OAAa,EAAW;QAC3B,IAAI,GAAA,IAAO,GAAA,IAAO,CAAA,GAAI,EAAC,GAAG,CAAE,EAAA;AACxB,MAAA,EAAA,CAAA,GAAA,IAAG,CAAA;AACH,MAAA,IAAA,GAAA,IAAI,CAAA,GAAG,EAAI;;AAEnB,EAAA,CAAA;AACJ,CAAC;AAEM,MAAM,kBAAkB,GAAG,OAAC,IAAkC;QACjE,CAAA,mBAAO,EAAmB,sBAAE,CAAA,WAA0B,CAAA,EAAkC,CAAA;AACxF,EAAA,MAAA,eAAkB,MAAG,CAAA,IAAuB,CAAA;AAC5C,EAAA,MAAA,gBAAmB,MAAG,CAAA,EAAgC,CAAA;AAEtD,EAAA,MAAA,mBAAsB,WAAG,CAAA,cACpB;UACG,aAAM,GAAA,EAAa;QACnB,UAAI,GAAA,KAAa;WAEjB,CAAA,OAAQ,CAAA,CAAA;AACJ,MAAA,SAAA;;;YAGA,SAAC,GAAA,cAAA,IAAA,SAAA;AACD,MAAA,IAAA,aAAA,CAAA,OAAiB,CAAG,iBAAU,EAAA;AAClC,QAAA,UAAG,GAAA,IAAA;;AAGC,MAAA,aAAA,CAAA,EAAA,CAAA,GAAc,SAAO;;QAEzB,UAAC,EAAA;AACL,MAAC,aAEH,CAAA,OAAA,GAAA,aAAA;MAEF,sBAAe,CAAA,aAAA,CAAA;;AAEX,EAAA,CAAA,EAAA,CAAA,OAAA,CAAM;AAEN,EAAA,SAAA,CAAA,MAAM;AACF,IAAA,MAAA,MAAA;yBACA,GAAgB,MAAC,EAAA,eAAgB,IAAA,KAAA;UACpC,eAAM,GAAA,QAAA,CAAA,MAAA;YAEP,cAAkB,GAAG,eAAK,GAAA,MAAA,CAAA,OAAA,GAAA,YAAA,CAAA,OAAA,EAAA,SAAA,IAAA,CAAA;AACtB,MAAA,gBAAA,CAAA,cAAkB,CAAA;AACtB,IAAA,CAAA,EAAA,EAAC,CAAC;UAEF,YAAI,GAAA,MAAkB;AAClB,MAAA,eAAO,EAAA;;AACJ,IAAA,IAAA,eAAI,EAAA;YACP,CAAA,yBAAqB,EAAA,YAAiB,CAAA;WACzC,IAAA,YAAA,CAAA,OAAA,EAAA;AAED,MAAA,YAAA,CAAA,OAAiB,CAAA,gBAAkB,CAAA,QAAO,EAAA,YAAU,CAAA;AAEpD,IAAA;oBACQ,CAAA,eAAkB,GAAA,MAAA,CAAA,OAAA,GAAA,YAAA,CAAA,OAAA,EAAA,SAAA,IAAA,CAAA,CAAA;AAClB,IAAA,OAAA,MAAA;yBACH,EAAA;AAAM,QAAA,MAAA,CAAA,mBAAiB,CAAA,QAAS,EAAC,YAAA,CAAA;iBAC9B,YAAa,QAAQ,EAAA;oBACxB,CAAA,OAAA,CAAA,mBAAA,CAAA,QAAA,EAAA,YAAA,CAAA;AACL,MAAA;AACJ,IAAA,CAAC;KAED,CAAA,OAAO,EAAA,gBAAA,CAAA,CAAA;SACH;gBACA;;AAER,GAAE;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type UseTailwindThemeReturnValue = {
|
|
2
|
+
toggleColorMode: () => void;
|
|
3
|
+
colorModeLabel: string;
|
|
4
|
+
ColorModeIcon: any;
|
|
5
|
+
color: string;
|
|
6
|
+
bgColor: string;
|
|
7
|
+
blackColor: string;
|
|
8
|
+
borderColor: string;
|
|
9
|
+
checkBgColor: string;
|
|
10
|
+
radioActiveBgColor: string;
|
|
11
|
+
checkInactiveColor: string;
|
|
12
|
+
grayColor: string;
|
|
13
|
+
greenColor: string;
|
|
14
|
+
passiveColor: string;
|
|
15
|
+
blueColor: string;
|
|
16
|
+
yellowColor: string;
|
|
17
|
+
becomeHostColor: string;
|
|
18
|
+
activeMenuBgColor: string;
|
|
19
|
+
shadowColor: string;
|
|
20
|
+
calendarAvailableColor: string;
|
|
21
|
+
calendarPartialColor: string;
|
|
22
|
+
calendarBlockColor: string;
|
|
23
|
+
discountColor: string;
|
|
24
|
+
cancelColor: string;
|
|
25
|
+
errorColor: string;
|
|
26
|
+
isDark: boolean;
|
|
27
|
+
textColor: string;
|
|
28
|
+
borderColorClass: string;
|
|
29
|
+
bgColorClass: string;
|
|
30
|
+
textColorClass: string;
|
|
31
|
+
shadowClass: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const useTailwindTheme: () => UseTailwindThemeReturnValue;
|
|
34
|
+
//# sourceMappingURL=useTailwindTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTailwindTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTailwindTheme.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,2BAA2B,GAAG;IACtC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,GAAG,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAEhB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAO,2BAyFnC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {useState,useEffect}from'react';import {FaMoon}from'@react-icons/all-files/fa/FaMoon.js';import {FaSun}from'@react-icons/all-files/fa/FaSun.js';const useTailwindTheme = () => {
|
|
2
|
+
// Check if dark mode is preferred by user or system
|
|
3
|
+
const [isDark, setIsDark] = useState(() => {
|
|
4
|
+
if (typeof window !== 'undefined') {
|
|
5
|
+
// Check local storage first, then system preference
|
|
6
|
+
const storedTheme = localStorage.getItem('color-theme');
|
|
7
|
+
if (storedTheme === 'dark') return true;
|
|
8
|
+
if (storedTheme === 'light') return false;
|
|
9
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
});
|
|
13
|
+
// Set dark mode class on body when theme changes
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
document.documentElement.classList.toggle('dark', isDark);
|
|
16
|
+
localStorage.setItem('color-theme', isDark ? 'dark' : 'light');
|
|
17
|
+
}, [isDark]);
|
|
18
|
+
const toggleColorMode = () => setIsDark(!isDark);
|
|
19
|
+
const colorModeLabel = isDark ? 'light' : 'dark';
|
|
20
|
+
const ColorModeIcon = isDark ? FaSun : FaMoon;
|
|
21
|
+
// Define colors for both light and dark modes
|
|
22
|
+
const bgColor = isDark ? '#1A202C' : 'white'; // gray-800 or white
|
|
23
|
+
const color = isDark ? 'white' : '#2d3748'; // white or gray-800
|
|
24
|
+
const grayColor = isDark ? '#A0AEC0' : '#4A5568'; // gray-400 or gray-600
|
|
25
|
+
const greenColor = '#38A169'; // green-500 in both modes
|
|
26
|
+
const passiveColor = isDark ? '#4A5568' : '#E2E8F0'; // gray-600 or gray-200
|
|
27
|
+
const borderColor = isDark ? '#4A5568' : '#E2E8F0'; // gray-600 or gray-200
|
|
28
|
+
const checkBgColor = isDark ? '#1A202C' : '#CBD5E0'; // gray-800 or gray-300
|
|
29
|
+
const radioActiveBgColor = isDark ? 'rgb(0 31 71)' : '#EBF8FF'; // custom dark blue or blue-50
|
|
30
|
+
const checkInactiveColor = isDark ? 'rgba(255, 255, 255, 0.4)' : '#CBD5E0'; // whiteAlpha-400 or gray-300
|
|
31
|
+
const blueColor = '#2869E0'; // same in both modes
|
|
32
|
+
const yellowColor = '#F5BC00'; // same in both modes
|
|
33
|
+
const blackColor = '#000'; // same in both modes
|
|
34
|
+
const becomeHostColor = isDark ? '#4299E1' : '#9DECF9'; // blue-400 or cyan-200
|
|
35
|
+
const activeMenuBgColor = isDark ? '#2D3748' : '#EDF2F7'; // gray-700 or gray-100
|
|
36
|
+
const shadowColor = isDark ? 'rgba(205, 205, 162, 0.25) 0px 6px 12px -2px, rgba(255,255,255, 0.3) 0px 3px 7px -3px' : 'rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px';
|
|
37
|
+
const calendarAvailableColor = '#3e9f31'; // same in both modes
|
|
38
|
+
const calendarPartialColor = '#31679f'; // same in both modes
|
|
39
|
+
const calendarBlockColor = isDark ? '#2d3748' : '#e2e8f0'; // gray-800 or gray-300
|
|
40
|
+
const discountColor = '#3182CE'; // blue-500 in both modes
|
|
41
|
+
const cancelColor = '#E53E3E'; // red-500 in both modes
|
|
42
|
+
const errorColor = '#C53030'; // red-600 in both modes
|
|
43
|
+
// Tailwind-specific class helpers
|
|
44
|
+
const textColorClass = isDark ? 'text-white' : 'text-gray-800';
|
|
45
|
+
const borderColorClass = isDark ? 'border-gray-600' : 'border-gray-200';
|
|
46
|
+
const bgColorClass = isDark ? 'bg-gray-800' : 'bg-white';
|
|
47
|
+
const textColor = isDark ? 'white' : 'gray-800';
|
|
48
|
+
const shadowClass = isDark ? 'shadow-dark' : 'shadow-light';
|
|
49
|
+
return {
|
|
50
|
+
toggleColorMode,
|
|
51
|
+
colorModeLabel,
|
|
52
|
+
ColorModeIcon,
|
|
53
|
+
color,
|
|
54
|
+
bgColor,
|
|
55
|
+
blackColor,
|
|
56
|
+
borderColor,
|
|
57
|
+
checkBgColor,
|
|
58
|
+
radioActiveBgColor,
|
|
59
|
+
checkInactiveColor,
|
|
60
|
+
grayColor,
|
|
61
|
+
greenColor,
|
|
62
|
+
passiveColor,
|
|
63
|
+
blueColor,
|
|
64
|
+
yellowColor,
|
|
65
|
+
becomeHostColor,
|
|
66
|
+
activeMenuBgColor,
|
|
67
|
+
shadowColor,
|
|
68
|
+
calendarAvailableColor,
|
|
69
|
+
calendarPartialColor,
|
|
70
|
+
calendarBlockColor,
|
|
71
|
+
discountColor,
|
|
72
|
+
cancelColor,
|
|
73
|
+
errorColor,
|
|
74
|
+
isDark,
|
|
75
|
+
// Tailwind specific
|
|
76
|
+
textColor,
|
|
77
|
+
borderColorClass,
|
|
78
|
+
bgColorClass,
|
|
79
|
+
textColorClass,
|
|
80
|
+
shadowClass
|
|
81
|
+
};
|
|
82
|
+
};export{useTailwindTheme};//# sourceMappingURL=useTailwindTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTailwindTheme.js","sources":["../../src/hooks/useTailwindTheme.tsx"],"sourcesContent":[null],"names":[],"mappings":"uJAsCO,MAAM,gBAAgB,GAAG,MAAkC;;QAE9D,CAAA,QAAa,SAAE,CAAA,GAAU,QAAG,CAAA,MAAY;AACpC,IAAA,IAAA,OAAI,MAAO,KAAM,WAAK,EAAA;;YAElB,WAAM,GAAA,YAAc,CAAA,qBAAqB,CAAA;qBACrC,KAAA,MAAgB,EAAA,OAAM,IAAA;AAAE,MAAA,IAAA,WAAA,YAAY,EAAA,OAAA,KAAA;aACxC,MAAI,CAAA,yCAAuB,CAAA,CAAA,OAAA;AAAE,IAAA;gBAC7B;;AAEJ;AACJ,EAAA,SAAG,CAAA,MAAA;IAEH,QAAA,CAAA,eAAA,CAAA,SAAA,CAAA,MAAA,CAAA,MAAA,EAAiD,MAAA,CAAA;IACjD,aAAa,OAAE,CAAA,aAAA,EAAA,MAAA,GAAA,MAAA,GAAA,OAAA,CAAA;YACX,CAAA,CAAA;AACA,EAAA,MAAA,eAAa,GAAA,MAAQ,SAAA,CAAa,OAAE,CAAM;AAC9C,EAAA,MAAI,cAAS,GAAA,MAAA,GAAA,OAAA,GAAA,MAAA;QAEb,aAAM,GAAA,MAAkB,GAAK,cAAY;;QAEzC,OAAM,GAAA,MAAa,GAAG,SAAS,GAAA,OAAQ,CAAA;QAEvC,KAAA,GAAA,MAAA,GAAA,OAAA,GAAA,SAAA,CAAA;AACA,EAAA,MAAA,SAAa,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;AAC9C,EAAA,MAAA,UAAc,GAAA,SAAS,CAAA;AACvB,EAAA,MAAA,YAAe,GAAG,MAAO,GAAE,SAAU,GAAE,SAAU,CAAC;AAClD,EAAA,MAAA,WAAM,GAAU,MAAG,GAAA,SAAW,GAAA,SAAA,CAAA;AAC9B,EAAA,MAAA,YAAM,GAAY,MAAG,GAAO,SAAE,GAAU,SAAE,CAAA;AAC1C,EAAA,MAAA,kBAAoB,GAAA,MAAS,GAAA,cAAY,GAAU,SAAC,CAAA;AACpD,EAAA,MAAA,kBAAqB,GAAA,MAAS,GAAA,0BAAuB,GAAA,SAAA,CAAA;AACrD,EAAA,MAAA,SAAM,GAAA,SAAkB,CAAA;AACxB,EAAA,MAAA,WAAM,GAAA,SAAqB,CAAA;AAC3B,EAAA,MAAA,UAAM,GAAS,MAAG,CAAA;AAClB,EAAA,MAAA,eAAiB,GAAG,MAAA,GAAW,SAAA,GAAA,SAAqB,CAAA;AACpD,EAAA,MAAA,iBAAmB,GAAA,MAAQ,GAAA,SAAA,GAAA,SAAqB,CAAA;AAChD,EAAA,MAAA,WAAM,GAAA,MAAkB,GAAA,sFAAuD,GAAA,+EAAA;AAC/E,EAAA,MAAA,sBAA0B,GAAA,SAAS,CAAA;QACnC,oBAAoB,GAAM,SAAA,CAAA;AACtB,EAAA,MAAA,kBAAE,GAAA,MAAA,GAAA,SAAA,GAAA,SAAA,CAAA;QACF;AAEJ,EAAA,MAAA,WAAM,GAAA,SAAA,CAAsB;AAC5B,EAAA,MAAA,UAAM,GAAA,SAAoB,CAAA;AAC1B;AACA,EAAA,MAAA,cAAM,GAAa,MAAG,GAAA,YAAW,GAAA,eAAyB;AAC1D,EAAA,MAAA,gBAAoB,GAAA,MAAS,GAAE,iBAAA,GAAA,iBAAwB;AACvD,EAAA,MAAA,YAAgB,GAAG,MAAA,GAAS,aAAE,GAAA,UAAwB;QAEtD,SAAA,GAAA,MAAA,GAAA,OAAA,GAAkC,UAAA;QAClC,WAAM,GAAA,MAAiB,GAAA,aAAS,GAAA,cAAe;SAC/C;IACA,eAAM;IACN,cAAM;IACN,aAAM;IAEN,KAAA;WACI;cACA;eACA;gBACK;sBACE;sBACG;aACV;cACA;gBACA;aACA;eACA;mBACU;qBACE;eACZ;0BACW;wBACI;sBACf;iBACA;eACA;cACA;UACA;;aAEA;oBACU;gBACJ;kBACN;;;"}
|
package/lib/icons.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const icons: {
|
|
2
|
+
SearchIcon: import("@react-icons/all-files/lib").IconType;
|
|
3
|
+
ChevronDownIcon: import("@react-icons/all-files/lib").IconType;
|
|
4
|
+
ChevronRightIcon: import("@react-icons/all-files/lib").IconType;
|
|
5
|
+
MenuIcon: import("@react-icons/all-files/lib").IconType;
|
|
6
|
+
OutlineDashIcon: import("@react-icons/all-files/lib").IconType;
|
|
7
|
+
CloseIcon: import("@react-icons/all-files/lib").IconType;
|
|
8
|
+
Settings5FillIcon: import("@react-icons/all-files/lib").IconType;
|
|
9
|
+
CopyIcon: import("@react-icons/all-files/lib").IconType;
|
|
10
|
+
CheckIcon: import("@react-icons/all-files/lib").IconType;
|
|
11
|
+
ChevronBackCircleIcon: import("@react-icons/all-files/lib").IconType;
|
|
12
|
+
ChevronForwardCircleIcon: import("@react-icons/all-files/lib").IconType;
|
|
13
|
+
ChevronUpIcon: import("@react-icons/all-files/lib").IconType;
|
|
14
|
+
ChevronLeftIcon: import("@react-icons/all-files/lib").IconType;
|
|
15
|
+
PushpinLineIcon: import("@react-icons/all-files/lib").IconType;
|
|
16
|
+
PushpinFillIcon: import("@react-icons/all-files/lib").IconType;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=icons.d.ts.map
|