@admin-layout/tailwind-design-pro 10.0.9-alpha.6 → 10.0.9-alpha.61
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 +345 -1
- package/lib/cdm-locales/en/settings.json +21 -1
- package/lib/cdm-locales/es/settings.json +23 -3
- package/lib/components/Layout/BasicLayout/index.d.ts +1 -2
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +102 -37
- package/lib/components/Layout/BasicLayout/index.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.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts +2 -15
- package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.js +44 -21
- package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/Logo.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/Logo.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/Logo.js +141 -0
- package/lib/components/Layout/GlobalHeader/Logo.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +6 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.js +226 -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.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -13
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
- 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 +290 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/index.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -0
- package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.js +1 -2
- package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
- package/lib/components/Layout/Sidebar/Divider.d.ts +1 -31
- package/lib/components/Layout/Sidebar/Divider.d.ts.map +1 -1
- 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 +51 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -0
- package/lib/components/Layout/Sidebar/Sidebar.d.ts +1 -12
- package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/Sidebar.js +107 -91
- package/lib/components/Layout/Sidebar/Sidebar.js.map +1 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.js +110 -20
- package/lib/components/Layout/Sidebar/SidebarMenu.js.map +1 -1
- package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/TailwindLayout.js +29 -19
- 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 +2 -2
- package/lib/components/Layout/getPageTitle.js.map +1 -1
- package/lib/components/Layout/slot-fill/Footer.d.ts +1 -1
- 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/HeaderSearchBar.d.ts +3 -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 +3 -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/RightContent.d.ts +3 -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/index.d.ts +3 -0
- package/lib/components/Layout/slot-fill/index.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/LayoutChange.d.ts +1 -1
- package/lib/components/SettingDrawer/LayoutChange.d.ts.map +1 -1
- package/lib/components/SettingDrawer/LayoutChange.js +75 -17
- package/lib/components/SettingDrawer/LayoutChange.js.map +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.d.ts +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.js +18 -10
- package/lib/components/SettingDrawer/NavigationsModes.js.map +1 -1
- package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +1 -1
- package/lib/components/SettingDrawer/RegionalSettings.js +609 -32
- package/lib/components/SettingDrawer/RegionalSettings.js.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.d.ts +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.js +183 -38
- package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts +3 -0
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/WebFontsSelector.js +24 -0
- package/lib/components/SettingDrawer/WebFontsSelector.js.map +1 -0
- package/lib/components/SettingDrawer/types.d.ts +23 -2
- package/lib/components/SettingDrawer/types.d.ts.map +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +6 -16
- package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.js +26 -29
- package/lib/components/ThemeProvider/ThemeProvider.js.map +1 -1
- package/lib/components/ThemeProvider/ThemeToggle.js +50 -0
- package/lib/components/ThemeProvider/ThemeToggle.js.map +1 -0
- package/lib/components/ThemeProvider/index.d.ts +2 -5
- package/lib/components/ThemeProvider/index.d.ts.map +1 -1
- package/lib/components/ThemeProvider/themes/airbnb.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/airbnb.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/airbnb.js +186 -0
- package/lib/components/ThemeProvider/themes/airbnb.js.map +1 -0
- package/lib/components/ThemeProvider/themes/default.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/default.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/default.js +183 -0
- package/lib/components/ThemeProvider/themes/default.js.map +1 -0
- package/lib/components/ThemeProvider/themes/github.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/github.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/github.js +190 -0
- package/lib/components/ThemeProvider/themes/github.js.map +1 -0
- package/lib/components/ThemeProvider/themes/index.d.ts +15 -0
- package/lib/components/ThemeProvider/themes/index.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/index.js +7 -0
- package/lib/components/ThemeProvider/themes/index.js.map +1 -0
- package/lib/components/ThemeProvider/themes/slack.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/slack.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/slack.js +188 -0
- package/lib/components/ThemeProvider/themes/slack.js.map +1 -0
- package/lib/components/ThemeProvider/themes/spotify.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/spotify.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/spotify.js +189 -0
- package/lib/components/ThemeProvider/themes/spotify.js.map +1 -0
- package/lib/components/ThemeProvider/types.d.ts +106 -106
- package/lib/components/ThemeProvider/types.d.ts.map +1 -1
- package/lib/components/UI/CategoriesTypeList.d.ts +29 -0
- package/lib/components/UI/CategoriesTypeList.d.ts.map +1 -0
- package/lib/components/UI/CategoriesTypeList.js +140 -0
- package/lib/components/UI/CategoriesTypeList.js.map +1 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts +83 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts.map +1 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.js +107 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.js.map +1 -0
- package/lib/components/UI/Pagination.d.ts +6 -0
- package/lib/components/UI/Pagination.d.ts.map +1 -0
- package/lib/components/UI/Pagination.js +59 -0
- package/lib/components/UI/Pagination.js.map +1 -0
- package/lib/components/UI/ParamSearchResultContainer.d.ts +90 -0
- package/lib/components/UI/ParamSearchResultContainer.d.ts.map +1 -0
- package/lib/components/UI/ParamSearchResultContainer.js +80 -0
- package/lib/components/UI/ParamSearchResultContainer.js.map +1 -0
- package/lib/components/UI/PropertyCard.d.ts +24 -0
- package/lib/components/UI/PropertyCard.d.ts.map +1 -0
- package/lib/components/UI/PropertyCard.js +377 -0
- package/lib/components/UI/PropertyCard.js.map +1 -0
- package/lib/components/UI/PropertyCardList.d.ts +93 -0
- package/lib/components/UI/PropertyCardList.d.ts.map +1 -0
- package/lib/components/UI/PropertyCardList.js +41 -0
- package/lib/components/UI/PropertyCardList.js.map +1 -0
- package/lib/components/UI/PropertyCardOnMap.d.ts +10 -0
- package/lib/components/UI/PropertyCardOnMap.d.ts.map +1 -0
- package/lib/components/UI/PropertyCardOnMap.js +108 -0
- package/lib/components/UI/PropertyCardOnMap.js.map +1 -0
- package/lib/components/UI/icons/LocationIcon.d.ts +7 -0
- package/lib/components/UI/icons/LocationIcon.d.ts.map +1 -0
- package/lib/components/UI/icons/LocationIcon.js +18 -0
- package/lib/components/UI/icons/LocationIcon.js.map +1 -0
- package/lib/components/UI/icons/index.d.ts +2 -0
- package/lib/components/UI/icons/index.d.ts.map +1 -0
- package/lib/components/UI/index.d.ts +8 -0
- package/lib/components/UI/index.d.ts.map +1 -0
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
- package/lib/components/index.d.ts +4 -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 +128 -51
- package/lib/components/typings.d.ts.map +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +5 -4
- package/lib/compute.js.map +1 -1
- package/lib/config/constants.d.ts +7 -0
- package/lib/config/constants.d.ts.map +1 -0
- package/lib/config/constants.js +6 -0
- package/lib/config/constants.js.map +1 -0
- package/lib/config/env-config.d.ts +2 -0
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +15 -1
- package/lib/config/env-config.js.map +1 -1
- package/lib/helpers/DynamicIcon.d.ts +7 -4
- package/lib/helpers/DynamicIcon.d.ts.map +1 -1
- package/lib/helpers/DynamicIcon.js +51 -0
- package/lib/helpers/DynamicIcon.js.map +1 -0
- package/lib/hooks/index.d.ts +6 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/use-get-current-lat-long.d.ts +18 -0
- package/lib/hooks/use-get-current-lat-long.d.ts.map +1 -0
- package/lib/hooks/use-get-current-lat-long.js +29 -0
- package/lib/hooks/use-get-current-lat-long.js.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 +49 -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/hooks/useWindowSize.d.ts +6 -0
- package/lib/hooks/useWindowSize.d.ts.map +1 -0
- package/lib/hooks/useWindowSize.js +20 -0
- package/lib/hooks/useWindowSize.js.map +1 -0
- package/lib/icons.d.ts +2 -0
- package/lib/icons.d.ts.map +1 -1
- package/lib/icons.js +4 -2
- package/lib/icons.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/machines/settingsMachine.d.ts +4 -1
- package/lib/machines/settingsMachine.d.ts.map +1 -1
- package/lib/machines/settingsMachine.js +173 -67
- package/lib/machines/settingsMachine.js.map +1 -1
- package/lib/machines/types.d.ts +117 -17
- package/lib/machines/types.d.ts.map +1 -1
- 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 +12 -14
- package/lib/module.js.map +1 -1
- package/lib/tailwindConfig.d.ts +42 -0
- package/lib/tailwindConfig.d.ts.map +1 -0
- package/lib/tailwindConfig.js +23 -0
- package/lib/tailwindConfig.js.map +1 -0
- package/package.json +4 -4
- 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/ThemeProvider/themeRegistry.d.ts +0 -3
- package/lib/components/ThemeProvider/themeRegistry.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themeRegistry.js +0 -388
- package/lib/components/ThemeProvider/themeRegistry.js.map +0 -1
- package/lib/components/ThemeProvider/themeUtils.d.ts +0 -26
- package/lib/components/ThemeProvider/themeUtils.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themeUtils.js +0 -135
- package/lib/components/ThemeProvider/themeUtils.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/README.md
CHANGED
|
@@ -1 +1,345 @@
|
|
|
1
|
-
# Tailwind
|
|
1
|
+
# Tailwind Design Pro
|
|
2
|
+
|
|
3
|
+
A universal tailwind design system for use across all projects.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Unified theme system with light and dark mode support
|
|
8
|
+
- Consistent styling across all projects
|
|
9
|
+
- Easy to customize and extend
|
|
10
|
+
- Built-in typography, forms, and aspect ratio support
|
|
11
|
+
|
|
12
|
+
## Usage in Servers
|
|
13
|
+
|
|
14
|
+
To use this package in your server project, follow these steps:
|
|
15
|
+
|
|
16
|
+
### 1. Install the package
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @admin-layout/tailwind-design-pro
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Use the Universal Tailwind Config
|
|
23
|
+
|
|
24
|
+
Create a `tailwind.config.js` or `tailwind.config.ts` file in your server project and import the universal config:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
// tailwind.config.ts or tailwind.config.js
|
|
28
|
+
import { themeConfig } from '@admin-layout/tailwind-design-pro';
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
// Override content paths to include server-specific paths
|
|
32
|
+
content: [
|
|
33
|
+
'./src/**/{**,.client,.server}/**/*.{js,jsx,ts,tsx}',
|
|
34
|
+
'./app/**/{**,.client,.server}/**/*.{js,jsx,ts,tsx}',
|
|
35
|
+
'../../packages/**/*.{js,jsx,ts,tsx}',
|
|
36
|
+
'../../packages-modules/**/*.{js,jsx,ts,tsx}',
|
|
37
|
+
],
|
|
38
|
+
|
|
39
|
+
// You can add server-specific overrides here if needed
|
|
40
|
+
theme: {
|
|
41
|
+
extend: {
|
|
42
|
+
// Any server-specific extensions would go here
|
|
43
|
+
...themeConfig,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
darkMode: 'class',
|
|
47
|
+
variants: {
|
|
48
|
+
typography: ['dark'],
|
|
49
|
+
},
|
|
50
|
+
plugins: [typography, forms, aspectRatio],
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
# Theme System Documentation
|
|
55
|
+
|
|
56
|
+
## Overview
|
|
57
|
+
|
|
58
|
+
The theme system provides a flexible and powerful way to manage the visual appearance of your application. It supports multiple pre-built themes (default, Airbnb, Slack, GitHub, and Spotify) and includes dark mode functionality.
|
|
59
|
+
|
|
60
|
+
## Available Themes
|
|
61
|
+
|
|
62
|
+
The system comes with several pre-built themes:
|
|
63
|
+
|
|
64
|
+
- `default`: A neutral theme with standard components
|
|
65
|
+
- `airbnb`: Inspired by Airbnb's design system
|
|
66
|
+
- `slack`: Based on Slack's color scheme and components
|
|
67
|
+
- `github`: Following GitHub's design patterns
|
|
68
|
+
- `spotify`: Matching Spotify's visual identity
|
|
69
|
+
|
|
70
|
+
## Theme Structure
|
|
71
|
+
|
|
72
|
+
Each theme follows a consistent structure defined by the `DefaultTheme` interface:
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
interface DefaultTheme {
|
|
76
|
+
name: string;
|
|
77
|
+
colors: {
|
|
78
|
+
primary: ColorRamp;
|
|
79
|
+
secondary: ColorRamp;
|
|
80
|
+
accent: ColorRamp;
|
|
81
|
+
success: ColorRamp;
|
|
82
|
+
warning: ColorRamp;
|
|
83
|
+
error: ColorRamp;
|
|
84
|
+
neutral: ColorRamp;
|
|
85
|
+
background: {
|
|
86
|
+
light: string;
|
|
87
|
+
dark: string;
|
|
88
|
+
};
|
|
89
|
+
text: {
|
|
90
|
+
light: {
|
|
91
|
+
primary: string;
|
|
92
|
+
secondary: string;
|
|
93
|
+
tertiary: string;
|
|
94
|
+
};
|
|
95
|
+
dark: {
|
|
96
|
+
primary: string;
|
|
97
|
+
secondary: string;
|
|
98
|
+
tertiary: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
borderRadius: {
|
|
103
|
+
sm: string;
|
|
104
|
+
DEFAULT: string;
|
|
105
|
+
md: string;
|
|
106
|
+
lg: string;
|
|
107
|
+
xl: string;
|
|
108
|
+
'2xl': string;
|
|
109
|
+
full: string;
|
|
110
|
+
};
|
|
111
|
+
fontFamily: {
|
|
112
|
+
sans: string[];
|
|
113
|
+
serif: string[];
|
|
114
|
+
mono: string[];
|
|
115
|
+
};
|
|
116
|
+
boxShadow: {
|
|
117
|
+
sm: string;
|
|
118
|
+
DEFAULT: string;
|
|
119
|
+
md: string;
|
|
120
|
+
lg: string;
|
|
121
|
+
xl: string;
|
|
122
|
+
};
|
|
123
|
+
components: {
|
|
124
|
+
buttons: {
|
|
125
|
+
primary: ButtonStyle;
|
|
126
|
+
secondary: ButtonStyle;
|
|
127
|
+
};
|
|
128
|
+
cards: {
|
|
129
|
+
borderRadius: string;
|
|
130
|
+
padding: string;
|
|
131
|
+
shadow: string;
|
|
132
|
+
border: string;
|
|
133
|
+
};
|
|
134
|
+
inputs: {
|
|
135
|
+
borderRadius: string;
|
|
136
|
+
borderColor: string;
|
|
137
|
+
focusBorderColor: string;
|
|
138
|
+
padding: string;
|
|
139
|
+
fontSize: string;
|
|
140
|
+
lineHeight: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Setting Up the Theme Provider
|
|
147
|
+
|
|
148
|
+
To use the theme system, wrap your application with the `ThemeProviderTailwind` component:
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import { ThemeProviderTailwind } from 'packages/tailwind-design-pro/src/components/ThemeProvider';
|
|
152
|
+
|
|
153
|
+
const App = () => {
|
|
154
|
+
const settings = {
|
|
155
|
+
theme: 'default', // or 'airbnb', 'slack', 'github', 'spotify'
|
|
156
|
+
themeType: 'light',
|
|
157
|
+
primaryColor: '#your-color',
|
|
158
|
+
fontFamily: 'your-font-family',
|
|
159
|
+
navTheme: 'light', // or 'dark'
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
return <ThemeProviderTailwind settings={settings}>{/* Your app components */}</ThemeProviderTailwind>;
|
|
163
|
+
};
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Using the useTheme Hook
|
|
167
|
+
|
|
168
|
+
The `useTheme` hook provides access to the current theme and theme-related functionality. Here's how to use it:
|
|
169
|
+
|
|
170
|
+
```tsx
|
|
171
|
+
import { useTheme } from 'packages/tailwind-design-pro/src/components/ThemeProvider';
|
|
172
|
+
|
|
173
|
+
const YourComponent = () => {
|
|
174
|
+
const { themeName, theme, isDarkMode, toggleDarkMode } = useTheme();
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<div>
|
|
178
|
+
{/* Access theme colors */}
|
|
179
|
+
<div style={{ color: theme.colors.primary[500] }}>Primary Color</div>
|
|
180
|
+
|
|
181
|
+
{/* Use theme-specific styles */}
|
|
182
|
+
<button
|
|
183
|
+
style={{
|
|
184
|
+
borderRadius: theme.borderRadius.DEFAULT,
|
|
185
|
+
fontFamily: theme.fontFamily.sans.join(', '),
|
|
186
|
+
}}
|
|
187
|
+
>
|
|
188
|
+
Themed Button
|
|
189
|
+
</button>
|
|
190
|
+
|
|
191
|
+
{/* Toggle dark mode */}
|
|
192
|
+
<button onClick={toggleDarkMode}>Toggle {isDarkMode ? 'Light' : 'Dark'} Mode</button>
|
|
193
|
+
</div>
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Available Properties from useTheme
|
|
199
|
+
|
|
200
|
+
1. `themeName`: The current theme name ('default', 'airbnb', 'slack', 'github', or 'spotify')
|
|
201
|
+
2. `theme`: The complete theme object containing all styling properties
|
|
202
|
+
3. `isDarkMode`: Boolean indicating if dark mode is active
|
|
203
|
+
4. `toggleDarkMode`: Function to toggle between light and dark modes
|
|
204
|
+
|
|
205
|
+
## Theme Features
|
|
206
|
+
|
|
207
|
+
### 1. Dark Mode Support
|
|
208
|
+
|
|
209
|
+
- Automatically handles dark mode through the `isDarkMode` state
|
|
210
|
+
- Persists dark mode preference in localStorage
|
|
211
|
+
- Applies appropriate dark mode classes to the document
|
|
212
|
+
|
|
213
|
+
### 2. Dynamic Theme Switching
|
|
214
|
+
|
|
215
|
+
- Themes can be changed dynamically through the settings prop
|
|
216
|
+
- All theme properties are immediately applied when changed
|
|
217
|
+
|
|
218
|
+
### 3. Component-Specific Styling
|
|
219
|
+
|
|
220
|
+
Each theme includes specific styling for common components:
|
|
221
|
+
|
|
222
|
+
- Buttons (primary and secondary variants)
|
|
223
|
+
- Cards
|
|
224
|
+
- Input fields
|
|
225
|
+
|
|
226
|
+
### 4. Color System
|
|
227
|
+
|
|
228
|
+
- Each theme includes a comprehensive color system with:
|
|
229
|
+
- Primary colors
|
|
230
|
+
- Secondary colors
|
|
231
|
+
- Accent colors
|
|
232
|
+
- Semantic colors (success, warning, error)
|
|
233
|
+
- Neutral colors
|
|
234
|
+
- Background colors
|
|
235
|
+
- Text colors
|
|
236
|
+
|
|
237
|
+
### 5. Typography
|
|
238
|
+
|
|
239
|
+
- Customizable font families for different text styles
|
|
240
|
+
- Consistent typography settings across themes
|
|
241
|
+
|
|
242
|
+
## Best Practices
|
|
243
|
+
|
|
244
|
+
1. **Theme Access**
|
|
245
|
+
|
|
246
|
+
```tsx
|
|
247
|
+
const { theme } = useTheme();
|
|
248
|
+
// Use theme properties directly
|
|
249
|
+
const primaryColor = theme.colors.primary[500];
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
2. **Dark Mode Handling**
|
|
253
|
+
|
|
254
|
+
```tsx
|
|
255
|
+
const { isDarkMode, toggleDarkMode } = useTheme();
|
|
256
|
+
// Use isDarkMode to conditionally render styles
|
|
257
|
+
const backgroundColor = isDarkMode ? theme.colors.background.dark : theme.colors.background.light;
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
3. **Component Styling**
|
|
261
|
+
|
|
262
|
+
```tsx
|
|
263
|
+
const { theme } = useTheme();
|
|
264
|
+
// Use theme component styles
|
|
265
|
+
const buttonStyle = {
|
|
266
|
+
...theme.components.buttons.primary,
|
|
267
|
+
// Add custom styles as needed
|
|
268
|
+
};
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
4. **Responsive Design**
|
|
272
|
+
```tsx
|
|
273
|
+
const { theme } = useTheme();
|
|
274
|
+
// Use theme's responsive values
|
|
275
|
+
const cardStyle = {
|
|
276
|
+
borderRadius: theme.borderRadius.md,
|
|
277
|
+
boxShadow: theme.boxShadow.DEFAULT,
|
|
278
|
+
};
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Theme Customization
|
|
282
|
+
|
|
283
|
+
### Creating a Custom Theme
|
|
284
|
+
|
|
285
|
+
You can create your own theme by following the `DefaultTheme` interface structure:
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
const customTheme: DefaultTheme = {
|
|
289
|
+
name: 'custom',
|
|
290
|
+
colors: {
|
|
291
|
+
// Define your color palette
|
|
292
|
+
},
|
|
293
|
+
// Define other theme properties
|
|
294
|
+
};
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Extending Existing Themes
|
|
298
|
+
|
|
299
|
+
You can extend existing themes by importing them and modifying specific properties:
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
import { defaultTheme } from './themes/default';
|
|
303
|
+
|
|
304
|
+
const extendedTheme: DefaultTheme = {
|
|
305
|
+
...defaultTheme,
|
|
306
|
+
name: 'extended',
|
|
307
|
+
colors: {
|
|
308
|
+
...defaultTheme.colors,
|
|
309
|
+
primary: {
|
|
310
|
+
// Override primary colors
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Troubleshooting
|
|
317
|
+
|
|
318
|
+
### Common Issues
|
|
319
|
+
|
|
320
|
+
1. **Theme Not Applying**
|
|
321
|
+
|
|
322
|
+
- Ensure the `ThemeProviderTailwind` is properly wrapped around your application
|
|
323
|
+
- Check if the theme name matches one of the available themes
|
|
324
|
+
- Verify that the settings prop is correctly configured
|
|
325
|
+
|
|
326
|
+
2. **Dark Mode Not Working**
|
|
327
|
+
|
|
328
|
+
- Check if `navTheme` is properly set in the settings
|
|
329
|
+
- Verify that the dark mode classes are being applied to the document
|
|
330
|
+
- Ensure localStorage is accessible in your environment
|
|
331
|
+
|
|
332
|
+
3. **Custom Styles Not Taking Effect**
|
|
333
|
+
- Verify that your custom theme follows the `DefaultTheme` interface
|
|
334
|
+
- Check if the theme is properly registered in the themes object
|
|
335
|
+
- Ensure the theme name is correctly referenced in the settings
|
|
336
|
+
|
|
337
|
+
## Contributing
|
|
338
|
+
|
|
339
|
+
When contributing to the theme system:
|
|
340
|
+
|
|
341
|
+
1. Follow the existing theme structure
|
|
342
|
+
2. Maintain consistency with other themes
|
|
343
|
+
3. Include both light and dark mode variants
|
|
344
|
+
4. Document any new theme properties or features
|
|
345
|
+
5. Test the theme across different components and scenarios
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
"header": "Header",
|
|
6
6
|
"footer": "Footer",
|
|
7
7
|
"search_bar": "Search Bar",
|
|
8
|
+
"search_bar_on_scroll": "Show Search Bar on Scroll",
|
|
9
|
+
"search_bar_overlay": "Show Overlay on Search",
|
|
8
10
|
"menu": "Menu",
|
|
9
11
|
"menu_header": "Menu Header",
|
|
10
12
|
"setting": "Setting",
|
|
@@ -15,5 +17,23 @@
|
|
|
15
17
|
"other_setting": "Other Setting",
|
|
16
18
|
"weak_mode": "Weak Mode",
|
|
17
19
|
"light": "Light",
|
|
18
|
-
"dark": "Dark"
|
|
20
|
+
"dark": "Dark",
|
|
21
|
+
"font_family": "Font Family",
|
|
22
|
+
"select_theme": "Select Theme",
|
|
23
|
+
"scroll_threshold": "Searchbar Scroll Threshold",
|
|
24
|
+
"menu_divider_names": "Menu Divider Names",
|
|
25
|
+
"upper_menu_divider": "Upper Menu Divider",
|
|
26
|
+
"middle_menu_divider": "Middle Menu Divider",
|
|
27
|
+
"lower_menu_divider": "Lower Menu Divider",
|
|
28
|
+
"header_elements": "Header Elements",
|
|
29
|
+
"show_logo": "Show Logo",
|
|
30
|
+
"show_search_slot": "Show Search Slot",
|
|
31
|
+
"show_right_content": "Show Right Content",
|
|
32
|
+
"desktop_settings": "Desktop Settings",
|
|
33
|
+
"mobile_settings": "Mobile Settings",
|
|
34
|
+
"show_menu_toggle": "Show Menu Toggle",
|
|
35
|
+
"show_back_button": "Show Back Button",
|
|
36
|
+
"show_page_title": "Show Page Title",
|
|
37
|
+
"show_action_buttons": "Show Action Buttons",
|
|
38
|
+
"show_header": "Show Header"
|
|
19
39
|
}
|
|
@@ -5,15 +5,35 @@
|
|
|
5
5
|
"header": "Encabezado",
|
|
6
6
|
"footer": "Pie de Página",
|
|
7
7
|
"search_bar": "Barra de Búsqueda",
|
|
8
|
+
"search_bar_on_scroll": "Mostrar Barra de Búsqueda al Desplazar",
|
|
9
|
+
"search_bar_overlay": "Mostrar Superposición en Búsqueda",
|
|
8
10
|
"menu": "Menú",
|
|
9
11
|
"menu_header": "Encabezado del Menú",
|
|
10
12
|
"setting": "Configuración",
|
|
11
|
-
"page_style_settings": "
|
|
13
|
+
"page_style_settings": "Configuración de Estilo de Página",
|
|
12
14
|
"theme_color": "Color del Tema",
|
|
13
15
|
"navigation_mode": "Modo de Navegación",
|
|
14
|
-
"regional_rettings": "
|
|
16
|
+
"regional_rettings": "Configuración Regional",
|
|
15
17
|
"other_setting": "Otra Configuración",
|
|
16
18
|
"weak_mode": "Modo Débil",
|
|
17
19
|
"light": "Claro",
|
|
18
|
-
"dark": "Oscuro"
|
|
20
|
+
"dark": "Oscuro",
|
|
21
|
+
"font_family": "Familia de Fuente",
|
|
22
|
+
"select_theme": "Seleccionar Tema",
|
|
23
|
+
"scroll_threshold": "Umbral de Desplazamiento de la Barra de Búsqueda",
|
|
24
|
+
"menu_divider_names": "Nombres de Divisores de Menú",
|
|
25
|
+
"upper_menu_divider": "Divisor Superior del Menú",
|
|
26
|
+
"middle_menu_divider": "Divisor Medio del Menú",
|
|
27
|
+
"lower_menu_divider": "Divisor Inferior del Menú",
|
|
28
|
+
"header_elements": "Elementos del Encabezado",
|
|
29
|
+
"show_logo": "Mostrar Logo",
|
|
30
|
+
"show_search_slot": "Mostrar Espacio de Búsqueda",
|
|
31
|
+
"show_right_content": "Mostrar Contenido Derecho",
|
|
32
|
+
"desktop_settings": "Configuración de Escritorio",
|
|
33
|
+
"mobile_settings": "Configuración Móvil",
|
|
34
|
+
"show_menu_toggle": "Mostrar Alternador de Menú",
|
|
35
|
+
"show_back_button": "Mostrar Botón de Atrás",
|
|
36
|
+
"show_page_title": "Mostrar Título de Página",
|
|
37
|
+
"show_action_buttons": "Mostrar Botones de Acción",
|
|
38
|
+
"show_header": "Mostrar Encabezado"
|
|
19
39
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BasicLayoutProps, GlobalHeaderProps } from '@admin-layout/client';
|
|
3
|
-
export declare const useHorizontalScroll: ({
|
|
4
|
-
scrolled: any;
|
|
3
|
+
export declare const useHorizontalScroll: ({ setScrolled, setSearchOptionsShown, onScrollReachEnd }: {
|
|
5
4
|
setScrolled: any;
|
|
6
5
|
setSearchOptionsShown: any;
|
|
7
6
|
onScrollReachEnd: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/BasicLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiE,MAAM,OAAO,CAAC;AAOtF,OAAO,EACH,gBAAgB,EAGhB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/BasicLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiE,MAAM,OAAO,CAAC;AAOtF,OAAO,EACH,gBAAgB,EAGhB,iBAAiB,EAIpB,MAAM,sBAAsB,CAAC;AAU9B,eAAO,MAAM,mBAAmB;;;;uCA4B/B,CAAC;AAgCF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAC9B,gBAAgB,GAAG,iBAAiB,GAAG;IAAE,WAAW,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CA0N3F,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {jsx
|
|
2
|
-
scrolled,
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {Sidebar}from'../Sidebar/Sidebar.js';import {GlobalHeader}from'../GlobalHeader/Header.js';import {Outlet}from'@remix-run/react';import warning from'warning';import {omit}from'lodash-es';import {SettingDrawer}from'../../SettingDrawer/SettingDrawer.js';import {defaultSettings,useComponentSize,getMenuSeparation,getThemeColors}from'@admin-layout/client';import isBrowser from'../../../utils/isBrowser/index.js';import {getPageTitleInfo}from'../getPageTitle.js';import {useTheme}from'../../ThemeProvider/ThemeProvider.js';import {MainHeader}from'../GlobalHeader/MainHeader.js';import'../GlobalHeader/Logo.js';import'react-router';import'../../../helpers/DynamicIcon.js';import'@app/dialog/WrappedDialogsSwitch';import'@common-stack/components-pro';import {FooterSlot}from'../slot-fill/Footer.js';import'reflect-metadata';import'@admin-layout/client/lib/constants/layout.js';import {config}from'../../../config/env-config.js';import {useScrollThreshold}from'../../../hooks/useScrollThreshold.js';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import'../../../hooks/use-get-current-lat-long.js';import {useMediaQuery}from'../../../hooks/useMediaQuery.js';const useHorizontalScroll = ({
|
|
3
2
|
setScrolled,
|
|
4
3
|
setSearchOptionsShown,
|
|
5
4
|
onScrollReachEnd
|
|
@@ -64,17 +63,13 @@ const BasicLayout = props => {
|
|
|
64
63
|
const {
|
|
65
64
|
children,
|
|
66
65
|
onCollapse: propsOnCollapse,
|
|
67
|
-
// contentStyle,
|
|
68
66
|
defaultCollapsed,
|
|
69
67
|
menuData,
|
|
70
|
-
// style,
|
|
71
|
-
// disableContentMargin,
|
|
72
68
|
siderWidth = 208,
|
|
73
69
|
menu,
|
|
74
|
-
// isChildrenLayout: propsIsChildrenLayout,
|
|
75
70
|
menuDataRender,
|
|
76
71
|
loading,
|
|
77
|
-
|
|
72
|
+
location,
|
|
78
73
|
routeParams,
|
|
79
74
|
settings,
|
|
80
75
|
authorities,
|
|
@@ -84,15 +79,32 @@ const BasicLayout = props => {
|
|
|
84
79
|
actor
|
|
85
80
|
} = propsWithSettings;
|
|
86
81
|
const [isSideMenuOpen, setIsSideMenuOpen] = useState(false);
|
|
87
|
-
useState(false);
|
|
88
|
-
const location = useLocation();
|
|
89
82
|
const [scrollEnd, setScrollEnd] = useState(false);
|
|
90
83
|
const [searchOptionsShown, setSearchOptionsShown] = useState(false);
|
|
84
|
+
const {
|
|
85
|
+
picture
|
|
86
|
+
} = mainHeaderProps;
|
|
87
|
+
const {
|
|
88
|
+
LAYOUT_ROOT
|
|
89
|
+
} = config;
|
|
90
|
+
const {
|
|
91
|
+
theme,
|
|
92
|
+
isDarkMode
|
|
93
|
+
} = useTheme();
|
|
94
|
+
const {
|
|
95
|
+
isMobile
|
|
96
|
+
} = useMediaQuery();
|
|
97
|
+
// Get current route settings with proper fallback
|
|
98
|
+
const currentRoute = location?.pathname || '/';
|
|
99
|
+
const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
|
|
100
|
+
// Get device-specific settings
|
|
101
|
+
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
102
|
+
const deviceSettings = routeSettings?.regions?.[deviceType] || {};
|
|
103
|
+
const layoutSettings = routeSettings?.layout?.[deviceType] || {};
|
|
91
104
|
const onScrollReachEnd = () => {
|
|
92
105
|
setScrollEnd(prevScrollEnd => !prevScrollEnd);
|
|
93
106
|
};
|
|
94
|
-
useHorizontalScroll({
|
|
95
|
-
scrolled,
|
|
107
|
+
const horizontalScrollRef = useHorizontalScroll({
|
|
96
108
|
setScrolled,
|
|
97
109
|
setSearchOptionsShown,
|
|
98
110
|
onScrollReachEnd
|
|
@@ -100,13 +112,20 @@ const BasicLayout = props => {
|
|
|
100
112
|
const defaultProps = omit({
|
|
101
113
|
...propsWithSettings
|
|
102
114
|
}, ['layout']);
|
|
103
|
-
defaultPageTitleRender({
|
|
115
|
+
const pageTitleInfo = defaultPageTitleRender({
|
|
104
116
|
pathname: location?.pathname,
|
|
105
117
|
...defaultProps
|
|
106
118
|
}, propsWithSettings);
|
|
107
119
|
const settingRef = useRef(settings);
|
|
120
|
+
const scrollThreshold = deviceSettings?.header?.scrollThreshold || 50;
|
|
121
|
+
const {
|
|
122
|
+
componentVisibility
|
|
123
|
+
} = useScrollThreshold([{
|
|
124
|
+
threshold: scrollThreshold,
|
|
125
|
+
id: 'search-bar',
|
|
126
|
+
useWindowScroll: true
|
|
127
|
+
}]);
|
|
108
128
|
useEffect(() => {
|
|
109
|
-
// Only update if the primaryColor actually needs to change
|
|
110
129
|
if (settingRef.current?.primaryColor === '#3FA541C' && primaryColor !== '#3FA541C') {
|
|
111
130
|
const newState = {
|
|
112
131
|
...settingRef.current,
|
|
@@ -115,6 +134,15 @@ const BasicLayout = props => {
|
|
|
115
134
|
onSettingChange(newState);
|
|
116
135
|
}
|
|
117
136
|
}, [primaryColor, isBrowser, settingRef]);
|
|
137
|
+
// Update settings when route changes
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
if (actor && location?.pathname) {
|
|
140
|
+
actor.send({
|
|
141
|
+
type: 'ROUTE_CHANGE',
|
|
142
|
+
pathname: location?.pathname
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}, [location?.pathname, actor]);
|
|
118
146
|
const {
|
|
119
147
|
ref: refHeader,
|
|
120
148
|
height: heightHeader
|
|
@@ -139,11 +167,35 @@ const BasicLayout = props => {
|
|
|
139
167
|
const closeSideMenu = () => {
|
|
140
168
|
setIsSideMenuOpen(false);
|
|
141
169
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
170
|
+
const backgroundColor = isDarkMode ? theme.colors.background.dark : theme.colors.background.light;
|
|
171
|
+
return jsxs("div", {
|
|
172
|
+
className: "flex flex-col h-screen bg-background font-sans",
|
|
173
|
+
ref: horizontalScrollRef,
|
|
174
|
+
style: {
|
|
175
|
+
backgroundColor: backgroundColor
|
|
176
|
+
},
|
|
177
|
+
children: [deviceSettings?.header?.showHeader && LAYOUT_ROOT != '/' && jsx(GlobalHeader, {
|
|
178
|
+
toggleSideMenu: toggleSideMenu,
|
|
179
|
+
settings: settings,
|
|
180
|
+
upperMenus: getMenuSeparation(menuData).upperMenus,
|
|
181
|
+
routeParams: routeParams,
|
|
182
|
+
collapsed: collapsed,
|
|
183
|
+
...props
|
|
184
|
+
}), LAYOUT_ROOT === '/' && deviceSettings?.header?.showHeader && jsx(MainHeader, {
|
|
185
|
+
scrolled: scrolled,
|
|
186
|
+
location: location,
|
|
187
|
+
menuData: menuData,
|
|
188
|
+
settings: settings,
|
|
189
|
+
pageTitleInfo: pageTitleInfo,
|
|
190
|
+
onSettingChange: onSettingChange,
|
|
191
|
+
searchOptionsShown: searchOptionsShown,
|
|
192
|
+
setSearchOptionsShown: setSearchOptionsShown,
|
|
193
|
+
authorities: authorities,
|
|
194
|
+
picture: picture,
|
|
195
|
+
componentVisibility: componentVisibility
|
|
196
|
+
}), jsxs("div", {
|
|
197
|
+
className: "flex flex-1 relative",
|
|
198
|
+
children: [layoutSettings?.navigationMode !== 'topbar' && deviceSettings?.header?.showMenu && LAYOUT_ROOT != '/' && jsx(Sidebar, {
|
|
147
199
|
isSideMenuOpen: isSideMenuOpen,
|
|
148
200
|
closeSideMenu: closeSideMenu,
|
|
149
201
|
menuData: menuData,
|
|
@@ -152,30 +204,43 @@ const BasicLayout = props => {
|
|
|
152
204
|
routeParams: routeParams,
|
|
153
205
|
settings: settings
|
|
154
206
|
}), jsxs("div", {
|
|
155
|
-
className: "flex flex-col flex-1
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
routeParams: routeParams,
|
|
161
|
-
collapsed: collapsed
|
|
162
|
-
}), jsx(SettingDrawer, {
|
|
207
|
+
className: "flex flex-col flex-1 overflow-auto",
|
|
208
|
+
style: {
|
|
209
|
+
marginLeft: layoutSettings?.navigationMode !== 'topbar' && deviceSettings?.header?.showMenu && layoutSettings?.fixedSidebar && !isMobile && LAYOUT_ROOT != '/' ? collapsed ? '64px' : '256px' : '0px'
|
|
210
|
+
},
|
|
211
|
+
children: [jsx(SettingDrawer, {
|
|
163
212
|
primaryColor: primaryColor,
|
|
164
213
|
settings: settings,
|
|
165
|
-
onSettingChange:
|
|
214
|
+
onSettingChange: newSettings => {
|
|
215
|
+
if (actor) {
|
|
216
|
+
actor.send({
|
|
217
|
+
type: 'UPDATE',
|
|
218
|
+
value: newSettings
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
onSettingChange?.(newSettings);
|
|
222
|
+
},
|
|
166
223
|
actor: actor,
|
|
167
|
-
colorList: getThemeColors(settings?.theme)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
224
|
+
colorList: getThemeColors(settings?.theme),
|
|
225
|
+
...props
|
|
226
|
+
}), jsxs("main", {
|
|
227
|
+
className: "relative",
|
|
228
|
+
children: [searchOptionsShown && deviceSettings?.header?.searchBarOverlay && jsx("div", {
|
|
229
|
+
className: "fixed inset-0 bg-black bg-opacity-50 z-30 cursor-pointer",
|
|
230
|
+
onClick: e => {
|
|
231
|
+
e.stopPropagation();
|
|
232
|
+
setSearchOptionsShown(false);
|
|
233
|
+
}
|
|
234
|
+
}), jsx(Outlet, {})]
|
|
235
|
+
}), jsx("div", {
|
|
236
|
+
ref: refFooter,
|
|
237
|
+
className: footerFixed ? 'fixed bottom-0 w-full' : '',
|
|
238
|
+
children: jsx(FooterSlot, {
|
|
239
|
+
settings: settings,
|
|
240
|
+
active: deviceSettings?.footer?.showFooter
|
|
173
241
|
})
|
|
174
|
-
}), jsx(GlobalFooter, {
|
|
175
|
-
settings: settings,
|
|
176
|
-
active: settings?.regions?.showFooter
|
|
177
242
|
})]
|
|
178
243
|
})]
|
|
179
|
-
})
|
|
244
|
+
})]
|
|
180
245
|
});
|
|
181
246
|
};export{BasicLayout,useHorizontalScroll};//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Layout/BasicLayout/index.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Layout/BasicLayout/index.tsx"],"sourcesContent":[null],"names":[],"mappings":"owCAyBO,MAAM,mBAAmB,GAAG,CAAC;AAChC,EAAA,WAAW;uBAEI;AACX,EAAA;;AAEI,EAAA,MAAA,KAAA,GAAA,MAAa,EAAA;AACT,EAAA,SAAA,CAAA,MAAA;oBAAmB,CAAO,OAAA,IAAA,IAAA;;mBAEL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gName?: string;
|
|
7
|
-
[key: string]: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
2
|
+
import { BottomMenuDropDownProps } from '../../typings';
|
|
10
3
|
declare const BottomMenuDropDown: React.FC<BottomMenuDropDownProps>;
|
|
11
4
|
export default BottomMenuDropDown;
|
|
12
5
|
//# sourceMappingURL=BottomMenuDropdown.d.ts.map
|