@docsplain-kit/core 0.0.49 → 0.0.51
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 +36 -0
- package/SERVER_COMPONENTS.md +256 -0
- package/auto-complete/auto-complete-theme.d.ts +29 -0
- package/auto-complete/auto-complete-theme.js +53 -0
- package/auto-complete/auto-complete-theme.js.map +1 -0
- package/auto-complete/auto-complete.js +23 -3
- package/auto-complete/auto-complete.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +7 -1
- package/index.js.map +1 -1
- package/label/label-theme.d.ts +17 -0
- package/label/label-theme.js +35 -0
- package/label/label-theme.js.map +1 -0
- package/label/label.js +21 -3
- package/label/label.js.map +1 -1
- package/media/media.js +1 -1
- package/media/media.js.map +1 -1
- package/modal/modal-theme.d.ts +17 -0
- package/modal/modal-theme.js +32 -0
- package/modal/modal-theme.js.map +1 -0
- package/modal/modal.d.ts +1 -1
- package/modal/modal.js +22 -5
- package/modal/modal.js.map +1 -1
- package/mouse-popup/mouse-popup-theme.d.ts +17 -0
- package/mouse-popup/mouse-popup-theme.js +32 -0
- package/mouse-popup/mouse-popup-theme.js.map +1 -0
- package/mouse-popup/mouse-popup.js +19 -1
- package/mouse-popup/mouse-popup.js.map +1 -1
- package/multi-select/index.js.map +1 -1
- package/multi-select/multi-select-theme.d.ts +54 -0
- package/multi-select/multi-select-theme.js +127 -0
- package/multi-select/multi-select-theme.js.map +1 -0
- package/multi-select/multi-select.js +44 -10
- package/multi-select/multi-select.js.map +1 -1
- package/multi-select/multi-select.style.d.ts +97 -1
- package/multi-select/multi-select.style.js +99 -3
- package/multi-select/multi-select.style.js.map +1 -1
- package/package.json +1 -1
- package/popper/popper-content/popper-content.js +19 -1
- package/popper/popper-content/popper-content.js.map +1 -1
- package/popper/popper-theme.d.ts +21 -0
- package/popper/popper-theme.js +39 -0
- package/popper/popper-theme.js.map +1 -0
- package/select/select-theme.d.ts +50 -0
- package/select/select-theme.js +120 -0
- package/select/select-theme.js.map +1 -0
- package/select/select.js +44 -10
- package/select/select.js.map +1 -1
- package/select/select.style.d.ts +48 -16
- package/select/select.style.js +97 -65
- package/select/select.style.js.map +1 -1
- package/server/client-wrapper.d.ts +116 -0
- package/server/client-wrapper.js +249 -0
- package/server/client-wrapper.js.map +1 -0
- package/server/index.d.ts +22 -0
- package/server/index.js +40 -0
- package/server/index.js.map +1 -0
- package/tab/tab-item/tab-item.style.js +21 -6
- package/tab/tab-item/tab-item.style.js.map +1 -1
- package/tab/tab-theme.d.ts +42 -0
- package/tab/tab-theme.js +242 -0
- package/tab/tab-theme.js.map +1 -0
- package/tab/tab.js +21 -3
- package/tab/tab.js.map +1 -1
- package/text-input/text-input-theme.d.ts +30 -0
- package/text-input/text-input-theme.js +73 -0
- package/text-input/text-input-theme.js.map +1 -0
- package/text-input/text-input.js +26 -4
- package/text-input/text-input.js.map +1 -1
- package/text-input/text-input.style.d.ts +33 -1
- package/text-input/text-input.style.js +34 -2
- package/text-input/text-input.style.js.map +1 -1
- package/textarea/textarea-theme.d.ts +30 -0
- package/textarea/textarea-theme.js +73 -0
- package/textarea/textarea-theme.js.map +1 -0
- package/textarea/textarea.js +26 -4
- package/textarea/textarea.js.map +1 -1
- package/textarea/textarea.style.d.ts +33 -1
- package/textarea/textarea.style.js +34 -2
- package/textarea/textarea.style.js.map +1 -1
package/README.md
CHANGED
|
@@ -26,3 +26,39 @@ Get started with DocSplain Core in seconds:
|
|
|
26
26
|
```bash
|
|
27
27
|
npm install --save @docsplain-kit/core
|
|
28
28
|
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 🔄 **Using in Server Components (Next.js App Router)**
|
|
33
|
+
|
|
34
|
+
All Docsplain UI Kit components are client components. To use them in server components, create a client wrapper file:
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
// components/docsplain.tsx
|
|
38
|
+
'use client';
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
Tab,
|
|
42
|
+
TabItem,
|
|
43
|
+
Button,
|
|
44
|
+
// ... other components
|
|
45
|
+
} from '@docsplain-kit/core';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Then use in your server components:
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
// app/page.tsx (Server Component)
|
|
52
|
+
import { Tab, TabItem } from './components/docsplain';
|
|
53
|
+
|
|
54
|
+
export default function Page() {
|
|
55
|
+
return (
|
|
56
|
+
<Tab selectedValue="tab1" onTabSelect={() => {}}>
|
|
57
|
+
<TabItem value="tab1">Home</TabItem>
|
|
58
|
+
<TabItem value="tab2">About</TabItem>
|
|
59
|
+
</Tab>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
📖 **See [SERVER_COMPONENTS.md](./SERVER_COMPONENTS.md) for a complete guide** with examples, best practices, and troubleshooting.
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# Using Docsplain UI Kit in Server Components
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
All components in the Docsplain UI Kit are client components (they use `'use client'` directive) because they require React hooks, interactivity, and browser APIs. When using Next.js App Router or other React Server Components frameworks, you cannot directly import client components into server components.
|
|
6
|
+
|
|
7
|
+
## Solution: Client Component Wrappers
|
|
8
|
+
|
|
9
|
+
The recommended approach is to create client component wrappers that you can import in your server components. This guide shows you how to do this effectively.
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### Method 1: Create Individual Client Wrappers
|
|
14
|
+
|
|
15
|
+
Create a `components` directory in your project and create client wrapper files:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
// components/client-tab.tsx
|
|
19
|
+
'use client';
|
|
20
|
+
|
|
21
|
+
import { Tab, TabItem } from '@docsplain-kit/core';
|
|
22
|
+
|
|
23
|
+
export { Tab, TabItem };
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then use it in your server component:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
// app/page.tsx (Server Component)
|
|
30
|
+
import { Tab, TabItem } from './components/client-tab';
|
|
31
|
+
|
|
32
|
+
export default function Page() {
|
|
33
|
+
return (
|
|
34
|
+
<Tab selectedValue="tab1" onTabSelect={() => {}}>
|
|
35
|
+
<TabItem value="tab1">Home</TabItem>
|
|
36
|
+
<TabItem value="tab2">About</TabItem>
|
|
37
|
+
</Tab>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Method 2: Use the Client Wrapper Utility
|
|
43
|
+
|
|
44
|
+
We provide a utility to help you create client wrappers more easily:
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// components/docsplain-client.tsx
|
|
48
|
+
'use client';
|
|
49
|
+
|
|
50
|
+
import { createClientWrapper } from '@docsplain-kit/core/server';
|
|
51
|
+
|
|
52
|
+
// Export all components you need
|
|
53
|
+
export const {
|
|
54
|
+
Tab,
|
|
55
|
+
TabItem,
|
|
56
|
+
Button,
|
|
57
|
+
Checkbox,
|
|
58
|
+
// ... other components
|
|
59
|
+
} = createClientWrapper({
|
|
60
|
+
Tab: () => import('@docsplain-kit/core'),
|
|
61
|
+
TabItem: () => import('@docsplain-kit/core'),
|
|
62
|
+
Button: () => import('@docsplain-kit/core'),
|
|
63
|
+
Checkbox: () => import('@docsplain-kit/core'),
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Method 3: Create a Single Client Barrel File
|
|
68
|
+
|
|
69
|
+
Create a single file that re-exports all components you need:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// components/docsplain.tsx
|
|
73
|
+
'use client';
|
|
74
|
+
|
|
75
|
+
// Re-export all components you need
|
|
76
|
+
export {
|
|
77
|
+
Tab,
|
|
78
|
+
TabItem,
|
|
79
|
+
Button,
|
|
80
|
+
Checkbox,
|
|
81
|
+
Label,
|
|
82
|
+
TextInput,
|
|
83
|
+
Select,
|
|
84
|
+
// ... add other components as needed
|
|
85
|
+
} from '@docsplain-kit/core';
|
|
86
|
+
|
|
87
|
+
// Re-export provider and hooks
|
|
88
|
+
export {
|
|
89
|
+
DocsplainProvider,
|
|
90
|
+
useTheme,
|
|
91
|
+
useDocsplain,
|
|
92
|
+
} from '@docsplain-kit/core';
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Then use it in your server components:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// app/page.tsx (Server Component)
|
|
99
|
+
import { Tab, TabItem } from './components/docsplain';
|
|
100
|
+
|
|
101
|
+
export default function Page() {
|
|
102
|
+
return (
|
|
103
|
+
<Tab selectedValue="tab1" onTabSelect={() => {}}>
|
|
104
|
+
<TabItem value="tab1">Home</TabItem>
|
|
105
|
+
<TabItem value="tab2">About</TabItem>
|
|
106
|
+
</Tab>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Complete Example: Next.js App Router
|
|
112
|
+
|
|
113
|
+
Here's a complete example showing how to structure your Next.js app:
|
|
114
|
+
|
|
115
|
+
### Project Structure
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
app/
|
|
119
|
+
layout.tsx # Server Component
|
|
120
|
+
page.tsx # Server Component
|
|
121
|
+
components/
|
|
122
|
+
docsplain.tsx # Client Component (wrapper)
|
|
123
|
+
client-tab.tsx # Client Component (specific wrapper)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 1. Create Client Wrapper
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
// components/docsplain.tsx
|
|
130
|
+
'use client';
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
Tab,
|
|
134
|
+
TabItem,
|
|
135
|
+
Button,
|
|
136
|
+
Checkbox,
|
|
137
|
+
Label,
|
|
138
|
+
TextInput,
|
|
139
|
+
DocsplainProvider,
|
|
140
|
+
useTheme,
|
|
141
|
+
} from '@docsplain-kit/core';
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### 2. Use in Server Component
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
// app/page.tsx
|
|
148
|
+
import { Tab, TabItem } from '../components/docsplain';
|
|
149
|
+
|
|
150
|
+
export default function Page() {
|
|
151
|
+
// This is a server component - you can do server-side work here
|
|
152
|
+
const data = await fetchData(); // Server-side data fetching
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<div>
|
|
156
|
+
<h1>Server Component Page</h1>
|
|
157
|
+
<Tab selectedValue="tab1" onTabSelect={() => {}}>
|
|
158
|
+
<TabItem value="tab1">Home</TabItem>
|
|
159
|
+
<TabItem value="tab2">About</TabItem>
|
|
160
|
+
</Tab>
|
|
161
|
+
</div>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 3. Wrap with Provider (in Layout)
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
// app/layout.tsx
|
|
170
|
+
import { DocsplainProvider } from '../components/docsplain';
|
|
171
|
+
|
|
172
|
+
export default function RootLayout({ children }) {
|
|
173
|
+
return (
|
|
174
|
+
<html>
|
|
175
|
+
<body>
|
|
176
|
+
<DocsplainProvider theme="light" dir="ltr">
|
|
177
|
+
{children}
|
|
178
|
+
</DocsplainProvider>
|
|
179
|
+
</body>
|
|
180
|
+
</html>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Advanced: Dynamic Imports with SSR Disabled
|
|
186
|
+
|
|
187
|
+
For components that don't need SSR, you can use dynamic imports:
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
// app/page.tsx
|
|
191
|
+
import dynamic from 'next/dynamic';
|
|
192
|
+
|
|
193
|
+
const Tab = dynamic(
|
|
194
|
+
() => import('@docsplain-kit/core').then(mod => mod.Tab),
|
|
195
|
+
{ ssr: false }
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
const TabItem = dynamic(
|
|
199
|
+
() => import('@docsplain-kit/core').then(mod => mod.TabItem),
|
|
200
|
+
{ ssr: false }
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
export default function Page() {
|
|
204
|
+
return (
|
|
205
|
+
<Tab selectedValue="tab1" onTabSelect={() => {}}>
|
|
206
|
+
<TabItem value="tab1">Home</TabItem>
|
|
207
|
+
<TabItem value="tab2">About</TabItem>
|
|
208
|
+
</Tab>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Note:** This approach disables SSR for these components, which may not be ideal for SEO and initial load performance.
|
|
214
|
+
|
|
215
|
+
## Best Practices
|
|
216
|
+
|
|
217
|
+
1. **Create a Single Client Barrel File**: Instead of creating individual wrappers for each component, create one file that exports all components you need. This is easier to maintain.
|
|
218
|
+
|
|
219
|
+
2. **Keep Server Components as Server Components**: Only create client wrappers when you actually need to use client components. Keep as much of your app as server components as possible.
|
|
220
|
+
|
|
221
|
+
3. **Use the Provider in Layout**: Wrap your app with `DocsplainProvider` in your root layout so all components have access to theme and configuration.
|
|
222
|
+
|
|
223
|
+
4. **Organize by Feature**: If you have many components, you can organize them by feature:
|
|
224
|
+
```typescript
|
|
225
|
+
// components/forms.tsx
|
|
226
|
+
'use client';
|
|
227
|
+
export { TextInput, Select, Checkbox, Label } from '@docsplain-kit/core';
|
|
228
|
+
|
|
229
|
+
// components/navigation.tsx
|
|
230
|
+
'use client';
|
|
231
|
+
export { Tab, TabItem, Button } from '@docsplain-kit/core';
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Troubleshooting
|
|
235
|
+
|
|
236
|
+
### Error: "use client" must be in a file that only exports client components
|
|
237
|
+
|
|
238
|
+
**Solution**: Make sure your wrapper file has `'use client'` at the very top and only exports client components. Don't mix server and client code in the same file.
|
|
239
|
+
|
|
240
|
+
### Error: Cannot use hooks in server components
|
|
241
|
+
|
|
242
|
+
**Solution**: If you need to use hooks (like `useState`, `useEffect`), you must use them in a client component. Create a client wrapper component that uses the hooks, then use that wrapper in your server component.
|
|
243
|
+
|
|
244
|
+
### Components not rendering on server
|
|
245
|
+
|
|
246
|
+
**Solution**: This is expected behavior. Client components are hydrated on the client side. If you need server-side rendering, consider using the dynamic import approach with `ssr: true` (though this may not work for all components that rely heavily on browser APIs).
|
|
247
|
+
|
|
248
|
+
## Summary
|
|
249
|
+
|
|
250
|
+
- All Docsplain UI Kit components are client components
|
|
251
|
+
- Create client wrapper files with `'use client'` directive
|
|
252
|
+
- Import from your wrappers in server components
|
|
253
|
+
- Use a single barrel file for easier maintenance
|
|
254
|
+
- Wrap your app with `DocsplainProvider` in the root layout
|
|
255
|
+
|
|
256
|
+
This approach allows you to use all Docsplain UI Kit components in your server components while maintaining the benefits of React Server Components.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Theme } from '../provider';
|
|
2
|
+
/**
|
|
3
|
+
* Get autocomplete dropdown background color based on theme
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAutoCompleteBackground: (theme: Theme) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Get autocomplete dropdown border color based on theme
|
|
8
|
+
*/
|
|
9
|
+
export declare const getAutoCompleteBorder: (theme: Theme) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Get autocomplete list item hover background based on theme
|
|
12
|
+
*/
|
|
13
|
+
export declare const getAutoCompleteItemHover: (theme: Theme) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Get autocomplete selected item background based on theme
|
|
16
|
+
*/
|
|
17
|
+
export declare const getAutoCompleteSelectedBackground: (theme: Theme) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Get autocomplete list item default background based on theme
|
|
20
|
+
*/
|
|
21
|
+
export declare const getAutoCompleteItemBackground: (theme: Theme) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Get autocomplete text color based on theme
|
|
24
|
+
*/
|
|
25
|
+
export declare const getAutoCompleteTextColor: (theme: Theme) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Get autocomplete secondary text color based on theme
|
|
28
|
+
*/
|
|
29
|
+
export declare const getAutoCompleteSecondaryTextColor: (theme: Theme) => string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getAutoCompleteSecondaryTextColor = exports.getAutoCompleteTextColor = exports.getAutoCompleteItemBackground = exports.getAutoCompleteSelectedBackground = exports.getAutoCompleteItemHover = exports.getAutoCompleteBorder = exports.getAutoCompleteBackground = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get autocomplete dropdown background color based on theme
|
|
6
|
+
*/
|
|
7
|
+
var getAutoCompleteBackground = function (theme) {
|
|
8
|
+
return theme === 'dark' ? 'bg-gray-800' : 'bg-white';
|
|
9
|
+
};
|
|
10
|
+
exports.getAutoCompleteBackground = getAutoCompleteBackground;
|
|
11
|
+
/**
|
|
12
|
+
* Get autocomplete dropdown border color based on theme
|
|
13
|
+
*/
|
|
14
|
+
var getAutoCompleteBorder = function (theme) {
|
|
15
|
+
return theme === 'dark' ? 'border-gray-700' : 'border-slate-500';
|
|
16
|
+
};
|
|
17
|
+
exports.getAutoCompleteBorder = getAutoCompleteBorder;
|
|
18
|
+
/**
|
|
19
|
+
* Get autocomplete list item hover background based on theme
|
|
20
|
+
*/
|
|
21
|
+
var getAutoCompleteItemHover = function (theme) {
|
|
22
|
+
return theme === 'dark' ? 'hover:bg-primary-600 hover:text-white' : 'hover:bg-primary-500 hover:text-white';
|
|
23
|
+
};
|
|
24
|
+
exports.getAutoCompleteItemHover = getAutoCompleteItemHover;
|
|
25
|
+
/**
|
|
26
|
+
* Get autocomplete selected item background based on theme
|
|
27
|
+
*/
|
|
28
|
+
var getAutoCompleteSelectedBackground = function (theme) {
|
|
29
|
+
return theme === 'dark' ? 'bg-gray-700' : 'bg-control-100';
|
|
30
|
+
};
|
|
31
|
+
exports.getAutoCompleteSelectedBackground = getAutoCompleteSelectedBackground;
|
|
32
|
+
/**
|
|
33
|
+
* Get autocomplete list item default background based on theme
|
|
34
|
+
*/
|
|
35
|
+
var getAutoCompleteItemBackground = function (theme) {
|
|
36
|
+
return theme === 'dark' ? 'bg-gray-800' : 'bg-white';
|
|
37
|
+
};
|
|
38
|
+
exports.getAutoCompleteItemBackground = getAutoCompleteItemBackground;
|
|
39
|
+
/**
|
|
40
|
+
* Get autocomplete text color based on theme
|
|
41
|
+
*/
|
|
42
|
+
var getAutoCompleteTextColor = function (theme) {
|
|
43
|
+
return theme === 'dark' ? 'text-gray-100' : 'text-gray-900';
|
|
44
|
+
};
|
|
45
|
+
exports.getAutoCompleteTextColor = getAutoCompleteTextColor;
|
|
46
|
+
/**
|
|
47
|
+
* Get autocomplete secondary text color based on theme
|
|
48
|
+
*/
|
|
49
|
+
var getAutoCompleteSecondaryTextColor = function (theme) {
|
|
50
|
+
return theme === 'dark' ? 'text-gray-300' : 'text-gray-600';
|
|
51
|
+
};
|
|
52
|
+
exports.getAutoCompleteSecondaryTextColor = getAutoCompleteSecondaryTextColor;
|
|
53
|
+
//# sourceMappingURL=auto-complete-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-complete-theme.js","sourceRoot":"","sources":["../../auto-complete/auto-complete-theme.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,yBAAyB,GAAG,UAAC,KAAY;IACpD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC;AAEF;;GAEG;AACI,IAAM,qBAAqB,GAAG,UAAC,KAAY;IAChD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,CAAC;AACnE,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC;AAEF;;GAEG;AACI,IAAM,wBAAwB,GAAG,UAAC,KAAY;IACnD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC,CAAC,uCAAuC,CAAC;AAC9G,CAAC,CAAC;AAFW,QAAA,wBAAwB,4BAEnC;AAEF;;GAEG;AACI,IAAM,iCAAiC,GAAG,UAAC,KAAY;IAC5D,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,iCAAiC,qCAE5C;AAEF;;GAEG;AACI,IAAM,6BAA6B,GAAG,UAAC,KAAY;IACxD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,6BAA6B,iCAExC;AAEF;;GAEG;AACI,IAAM,wBAAwB,GAAG,UAAC,KAAY;IACnD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,wBAAwB,4BAEnC;AAEF;;GAEG;AACI,IAAM,iCAAiC,GAAG,UAAC,KAAY;IAC5D,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,iCAAiC,qCAE5C"}
|
|
@@ -11,6 +11,16 @@ var div_1 = tslib_1.__importDefault(require("../div"));
|
|
|
11
11
|
var text_1 = tslib_1.__importDefault(require("../text"));
|
|
12
12
|
var list_item_1 = tslib_1.__importDefault(require("../list-item"));
|
|
13
13
|
var tailwind_merge_config_1 = require("../tailwind-merge-config");
|
|
14
|
+
var auto_complete_theme_1 = require("./auto-complete-theme");
|
|
15
|
+
// Try to import the theme provider, but make it optional
|
|
16
|
+
var useThemeSafe = function () { return 'light'; };
|
|
17
|
+
try {
|
|
18
|
+
var useTheme = require('../provider').useTheme;
|
|
19
|
+
useThemeSafe = useTheme;
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
// Provider not available, use default
|
|
23
|
+
}
|
|
14
24
|
var AutoComplete = function (_a) {
|
|
15
25
|
var handleSelect = _a.handleSelect, getSearchData = _a.getSearchData, data = _a.data, loading = _a.loading, keyValue = _a.keyValue, id = _a.id, className = _a.className, searchValue = _a.searchValue, error = _a.error, textInputProps = _a.textInputProps;
|
|
16
26
|
var _b = (0, react_1.useState)(false), showList = _b[0], setShowList = _b[1];
|
|
@@ -59,16 +69,26 @@ var AutoComplete = function (_a) {
|
|
|
59
69
|
setDebouncedInput(keyValue && item[keyValue] ? item[keyValue] : '');
|
|
60
70
|
setShowList(false);
|
|
61
71
|
};
|
|
72
|
+
// Try to get theme from provider, fallback to 'light'
|
|
73
|
+
var theme = 'light';
|
|
74
|
+
try {
|
|
75
|
+
theme = useThemeSafe();
|
|
76
|
+
}
|
|
77
|
+
catch (_d) {
|
|
78
|
+
// Not in provider, use default
|
|
79
|
+
}
|
|
62
80
|
return (react_1["default"].createElement(popper_1["default"], { closeOnScroll: false, position: 'bottom', showPopper: showList, handlePopper: handlePopper, className: (0, tailwind_merge_config_1.twMerge)('w-full h-fit', className) },
|
|
63
81
|
react_1["default"].createElement(popper_handler_1["default"], null,
|
|
64
82
|
react_1["default"].createElement(text_input_1["default"], tslib_1.__assign({ color: 'primary', onChange: handleInputChange, error: error, value: debouncedInput, onClick: handlePopper, startAdornment: loading ? react_1["default"].createElement(spinner_1["default"], { size: 'tiny' }) : null, endAdornment: react_1["default"].createElement("svg", { width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', className: (0, tailwind_merge_config_1.twMerge)(showList ? 'rotate-0 duration-150' : 'rotate-180 duration-150'), xmlns: "http://www.w3.org/2000/svg" },
|
|
65
83
|
react_1["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.4107 6.91073C4.73614 6.5853 5.26378 6.5853 5.58922 6.91073L9.99996 11.3215L14.4107 6.91074C14.7361 6.5853 15.2638 6.5853 15.5892 6.91074C15.9147 7.23617 15.9147 7.76381 15.5892 8.08925L10.5892 13.0892C10.2638 13.4147 9.73614 13.4147 9.4107 13.0892L4.4107 8.08925C4.08527 7.76381 4.08527 7.23617 4.4107 6.91073Z", fill: "currentColor" })) }, textInputProps))),
|
|
66
84
|
react_1["default"].createElement(popper_content_1["default"], { className: 'w-full pt-2' },
|
|
67
|
-
react_1["default"].createElement(div_1["default"], { className: '
|
|
68
|
-
react_1["default"].createElement(text_1["default"], { typography: 'sm' }, "Loading..."))) : data && data.length ? (react_1["default"].createElement(div_1["default"], { className: 'flex-col w-full overflow-y-auto max-h-36' }, data.map(function (item, index) { return (react_1["default"].createElement(list_item_1["default"], { typography: 'sm', className: (0, tailwind_merge_config_1.twMerge)('cursor-pointer
|
|
85
|
+
react_1["default"].createElement(div_1["default"], { className: (0, tailwind_merge_config_1.twMerge)('shadow-lg rounded-md py-2 px-2 border w-full', (0, auto_complete_theme_1.getAutoCompleteBackground)(theme), (0, auto_complete_theme_1.getAutoCompleteBorder)(theme)) }, loading ? (react_1["default"].createElement(div_1["default"], { className: "flex justify-center items-center py-2" },
|
|
86
|
+
react_1["default"].createElement(text_1["default"], { typography: 'sm', className: (0, auto_complete_theme_1.getAutoCompleteTextColor)(theme) }, "Loading..."))) : data && data.length ? (react_1["default"].createElement(div_1["default"], { className: 'flex-col w-full overflow-y-auto max-h-36' }, data.map(function (item, index) { return (react_1["default"].createElement(list_item_1["default"], { typography: 'sm', className: (0, tailwind_merge_config_1.twMerge)('cursor-pointer rounded justify-between', (0, auto_complete_theme_1.getAutoCompleteItemHover)(theme), searchValue && id && searchValue[id] === item[id]
|
|
87
|
+
? (0, auto_complete_theme_1.getAutoCompleteSelectedBackground)(theme)
|
|
88
|
+
: (0, auto_complete_theme_1.getAutoCompleteItemBackground)(theme)), onClick: function () { return handleSelectValue({ item: item }); }, key: index },
|
|
69
89
|
keyValue && item[keyValue] ? item[keyValue] : '',
|
|
70
90
|
searchValue && id && searchValue[id] === item[id] ? (react_1["default"].createElement("svg", { width: "15", height: "11", viewBox: "0 0 15 11", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" },
|
|
71
|
-
react_1["default"].createElement("path", { d: "M5.33336 8.64332L12.9934 0.982483L14.1725 2.16082L5.33336 11L0.0300293 5.69665L1.20836 4.51832L5.33336 8.64332Z" }))) : null)); }))) : (react_1["default"].createElement(text_1["default"], { typography: 'sm' }, "No match was found"))))));
|
|
91
|
+
react_1["default"].createElement("path", { d: "M5.33336 8.64332L12.9934 0.982483L14.1725 2.16082L5.33336 11L0.0300293 5.69665L1.20836 4.51832L5.33336 8.64332Z" }))) : null)); }))) : (react_1["default"].createElement(text_1["default"], { typography: 'sm', className: (0, auto_complete_theme_1.getAutoCompleteSecondaryTextColor)(theme) }, "No match was found"))))));
|
|
72
92
|
};
|
|
73
93
|
exports["default"] = AutoComplete;
|
|
74
94
|
//# sourceMappingURL=auto-complete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-complete.js","sourceRoot":"","sources":["../../auto-complete/auto-complete.tsx"],"names":[],"mappings":";;;AAAA,qDAA2D;AAC3D,6DAA+B;AAC/B,oFAAqD;AACrD,qEAAsC;AACtC,+DAAiC;AAEjC,oFAAqD;AACrD,uDAAyB;AACzB,yDAA2B;AAC3B,mEAAoC;AACpC,kEAAmD;
|
|
1
|
+
{"version":3,"file":"auto-complete.js","sourceRoot":"","sources":["../../auto-complete/auto-complete.tsx"],"names":[],"mappings":";;;AAAA,qDAA2D;AAC3D,6DAA+B;AAC/B,oFAAqD;AACrD,qEAAsC;AACtC,+DAAiC;AAEjC,oFAAqD;AACrD,uDAAyB;AACzB,yDAA2B;AAC3B,mEAAoC;AACpC,kEAAmD;AAEnD,6DAQ+B;AAE/B,yDAAyD;AACzD,IAAI,YAAY,GAA2B,cAAM,OAAA,OAAO,EAAP,CAAO,CAAC;AACzD,IA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;AAEF,qBAAe,YAAY,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -42,3 +42,4 @@ import Tooltip from './tooltip/tooltip';
|
|
|
42
42
|
export { DocsplainProvider, useDocsplain, useFontSize, useResponsiveFontSize, useTextDirection, useTextScale, useTheme, } from './provider';
|
|
43
43
|
export type { DocsplainConfig, DocsplainProviderProps, TextDirection, TextScale, Theme, } from './provider';
|
|
44
44
|
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, Alert, AutoComplete, Avatar, Badge, Button, Card, CardBody, CardHeader, CardFooter, Checkbox, Chip, Div, Divider, Label, List, ListItem, Media, Modal, MousePopup, MultiSelect, Popper, PopperContent, PopperHandler, RadioButton, Select, Skeleton, Slider, Snackbar, Spinner, SwitchBox, Tab, TabItem, Text, Textarea, TextInput, Tooltip, twMerge, };
|
|
45
|
+
export { createClientWrapper, generateClientWrapper, clientWrapperTemplates, type ComponentImport, } from './server';
|
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.twMerge = exports.Tooltip = exports.TextInput = exports.Textarea = exports.Text = exports.TabItem = exports.Tab = exports.SwitchBox = exports.Spinner = exports.Snackbar = exports.Slider = exports.Skeleton = exports.Select = exports.RadioButton = exports.PopperHandler = exports.PopperContent = exports.Popper = exports.MultiSelect = exports.MousePopup = exports.Modal = exports.Media = exports.ListItem = exports.List = exports.Label = exports.Divider = exports.Div = exports.Chip = exports.Checkbox = exports.CardFooter = exports.CardHeader = exports.CardBody = exports.Card = exports.Button = exports.Badge = exports.Avatar = exports.AutoComplete = exports.Alert = exports.AccordionItem = exports.AccordionHeader = exports.AccordionContent = exports.Accordion = exports.useTheme = exports.useTextScale = exports.useTextDirection = exports.useResponsiveFontSize = exports.useFontSize = exports.useDocsplain = exports.DocsplainProvider = void 0;
|
|
3
|
+
exports.generateClientWrapper = exports.createClientWrapper = exports.twMerge = exports.Tooltip = exports.TextInput = exports.Textarea = exports.Text = exports.TabItem = exports.Tab = exports.SwitchBox = exports.Spinner = exports.Snackbar = exports.Slider = exports.Skeleton = exports.Select = exports.RadioButton = exports.PopperHandler = exports.PopperContent = exports.Popper = exports.MultiSelect = exports.MousePopup = exports.Modal = exports.Media = exports.ListItem = exports.List = exports.Label = exports.Divider = exports.Div = exports.Chip = exports.Checkbox = exports.CardFooter = exports.CardHeader = exports.CardBody = exports.Card = exports.Button = exports.Badge = exports.Avatar = exports.AutoComplete = exports.Alert = exports.AccordionItem = exports.AccordionHeader = exports.AccordionContent = exports.Accordion = exports.useTheme = exports.useTextScale = exports.useTextDirection = exports.useResponsiveFontSize = exports.useFontSize = exports.useDocsplain = exports.DocsplainProvider = void 0;
|
|
4
|
+
exports.clientWrapperTemplates = void 0;
|
|
4
5
|
var tslib_1 = require("tslib");
|
|
5
6
|
var accordion_1 = tslib_1.__importDefault(require("./accordion/accordion"));
|
|
6
7
|
exports.Accordion = accordion_1["default"];
|
|
@@ -93,4 +94,9 @@ tslib_1.__createBinding(exports, provider_1, "useResponsiveFontSize");
|
|
|
93
94
|
tslib_1.__createBinding(exports, provider_1, "useTextDirection");
|
|
94
95
|
tslib_1.__createBinding(exports, provider_1, "useTextScale");
|
|
95
96
|
tslib_1.__createBinding(exports, provider_1, "useTheme");
|
|
97
|
+
// Server Component Utilities
|
|
98
|
+
var server_1 = require("./server");
|
|
99
|
+
tslib_1.__createBinding(exports, server_1, "createClientWrapper");
|
|
100
|
+
tslib_1.__createBinding(exports, server_1, "generateClientWrapper");
|
|
101
|
+
tslib_1.__createBinding(exports, server_1, "clientWrapperTemplates");
|
|
96
102
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;AAAA,4EAA8C;AA6D5C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A3DlB,2BAAa,CA2DkB;AA1DtC,qFAAsD;AA2DpD,sBA3DK,yBAAW,CA2DL;AA1Db,mEAAqC;AA2DnC,iBA3DK,mBAAM,CA2DL;AA1DR,yEAA2C;AA2DzC,mBA3DK,qBAAQ,CA2DL;AA1DV,mEAAqC;AA2DnC,iBA3DK,mBAAM,CA2DL;AA1DR,yEAA2C;AA2DzC,mBA3DK,qBAAQ,CA2DL;AA1DV,sEAAwC;AA2DtC,kBA3DK,oBAAO,CA2DL;AA1DT,+EAAgD;AA2D9C,oBA3DK,uBAAS,CA2DL;AA1DX,sDAAwB;AA2DtB,cA3DK,gBAAG,CA2DL;AA1DL,oEAAqC;AA2DnC,kBA3DK,qBAAO,CA2DL;AA1DT,iEAAkD;AA+DhD,kBA/DO,+BAAO,CA+DP;AA9DT,+EAAgD;AA4D9C,oBA5DK,uBAAS,CA4DL;AA3DX,6DAA+B;AAyD7B,eAzDK,iBAAI,CAyDL;AAxDN,yEAA2C;AAyDzC,mBAzDK,qBAAQ,CAyDL;AAxDV,sEAAwC;AA0DtC,kBA1DK,oBAAO,CA0DL;AAxDT,WAAW;AACX,uCAQoB;AAPlB,kEAAiB;AACjB,6DAAY;AACZ,4DAAW;AACX,sEAAqB;AACrB,iEAAgB;AAChB,6DAAY;AACZ,yDAAQ;AAoDV,6BAA6B;AAC7B,mCAKkB;AAJhB,kEAAmB;AACnB,oEAAqB;AACrB,qEAAsB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Theme } from '../provider';
|
|
2
|
+
/**
|
|
3
|
+
* Get label text color based on theme
|
|
4
|
+
*/
|
|
5
|
+
export declare const getLabelTextColor: (theme: Theme) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Get validation message text color based on theme
|
|
8
|
+
*/
|
|
9
|
+
export declare const getValidationMessageColor: (theme: Theme, validationState: 'error' | 'warning' | 'success' | 'info' | 'none') => string;
|
|
10
|
+
/**
|
|
11
|
+
* Get more info icon hover color based on theme
|
|
12
|
+
*/
|
|
13
|
+
export declare const getMoreInfoIconHoverColor: (theme: Theme) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Get more info popup text color based on theme
|
|
16
|
+
*/
|
|
17
|
+
export declare const getMoreInfoPopupTextColor: (theme: Theme) => string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getMoreInfoPopupTextColor = exports.getMoreInfoIconHoverColor = exports.getValidationMessageColor = exports.getLabelTextColor = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get label text color based on theme
|
|
6
|
+
*/
|
|
7
|
+
var getLabelTextColor = function (theme) {
|
|
8
|
+
return theme === 'dark' ? 'text-control-100' : 'text-control-800';
|
|
9
|
+
};
|
|
10
|
+
exports.getLabelTextColor = getLabelTextColor;
|
|
11
|
+
/**
|
|
12
|
+
* Get validation message text color based on theme
|
|
13
|
+
*/
|
|
14
|
+
var getValidationMessageColor = function (theme, validationState) {
|
|
15
|
+
if (validationState === 'error') {
|
|
16
|
+
return 'danger';
|
|
17
|
+
}
|
|
18
|
+
return theme === 'dark' ? 'control.400' : 'control.600';
|
|
19
|
+
};
|
|
20
|
+
exports.getValidationMessageColor = getValidationMessageColor;
|
|
21
|
+
/**
|
|
22
|
+
* Get more info icon hover color based on theme
|
|
23
|
+
*/
|
|
24
|
+
var getMoreInfoIconHoverColor = function (theme) {
|
|
25
|
+
return theme === 'dark' ? 'hover:text-primary-300 hover:bg-info-900/40' : 'hover:text-primary hover:bg-info';
|
|
26
|
+
};
|
|
27
|
+
exports.getMoreInfoIconHoverColor = getMoreInfoIconHoverColor;
|
|
28
|
+
/**
|
|
29
|
+
* Get more info popup text color based on theme
|
|
30
|
+
*/
|
|
31
|
+
var getMoreInfoPopupTextColor = function (theme) {
|
|
32
|
+
return theme === 'dark' ? 'control.300' : 'control.600';
|
|
33
|
+
};
|
|
34
|
+
exports.getMoreInfoPopupTextColor = getMoreInfoPopupTextColor;
|
|
35
|
+
//# sourceMappingURL=label-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-theme.js","sourceRoot":"","sources":["../../label/label-theme.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAY;IAC5C,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,kBAAkB,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAEF;;GAEG;AACI,IAAM,yBAAyB,GAAG,UAAC,KAAY,EAAE,eAAkE;IACxH,IAAI,eAAe,KAAK,OAAO,EAAE;QAC/B,OAAO,QAAQ,CAAC;KACjB;IACD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;AAC1D,CAAC,CAAC;AALW,QAAA,yBAAyB,6BAKpC;AAEF;;GAEG;AACI,IAAM,yBAAyB,GAAG,UAAC,KAAY;IACpD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,6CAA6C,CAAC,CAAC,CAAC,kCAAkC,CAAC;AAC/G,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC;AAEF;;GAEG;AACI,IAAM,yBAAyB,GAAG,UAAC,KAAY;IACpD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;AAC1D,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC"}
|
package/label/label.js
CHANGED
|
@@ -8,17 +8,35 @@ var text_1 = tslib_1.__importDefault(require("../text"));
|
|
|
8
8
|
var tailwind_merge_config_1 = require("../tailwind-merge-config");
|
|
9
9
|
var div_1 = tslib_1.__importDefault(require("../div"));
|
|
10
10
|
var mouse_popup_1 = tslib_1.__importDefault(require("../mouse-popup"));
|
|
11
|
+
var label_theme_1 = require("./label-theme");
|
|
12
|
+
// Try to import the theme provider, but make it optional
|
|
13
|
+
var useThemeSafe = function () { return 'light'; };
|
|
14
|
+
try {
|
|
15
|
+
var useTheme = require('../provider').useTheme;
|
|
16
|
+
useThemeSafe = useTheme;
|
|
17
|
+
}
|
|
18
|
+
catch (_a) {
|
|
19
|
+
// Provider not available, use default
|
|
20
|
+
}
|
|
11
21
|
var Label = function (props) {
|
|
12
22
|
var className = props.className, label = props.label, children = props.children, containerRef = props.containerRef, disabled = props.disabled, _a = props.required, required = _a === void 0 ? false : _a, textProps = props.textProps, _b = props.orientation, orientation = _b === void 0 ? 'vertical' : _b, moreInfo = props.moreInfo, _c = props.validationState, validationState = _c === void 0 ? 'none' : _c, validationMessage = props.validationMessage, wrapperClassName = props.wrapperClassName;
|
|
13
23
|
var _d = (0, react_1.useState)(false), show = _d[0], setShow = _d[1];
|
|
24
|
+
// Try to get theme from provider, fallback to 'light'
|
|
25
|
+
var theme = 'light';
|
|
26
|
+
try {
|
|
27
|
+
theme = useThemeSafe();
|
|
28
|
+
}
|
|
29
|
+
catch (_e) {
|
|
30
|
+
// Not in provider, use default
|
|
31
|
+
}
|
|
14
32
|
return (react_1["default"].createElement(div_1["default"], { className: (0, tailwind_merge_config_1.twMerge)('flex-col w-full gap-y-0.5', wrapperClassName) },
|
|
15
33
|
react_1["default"].createElement("label", { className: (0, tailwind_merge_config_1.twMerge)('w-fit flex justify-center gap-1.5', orientation === 'vertical' ? 'flex-col' : 'flex-row', disabled ? 'cursor-not-allowed' : 'cursor-pointer', className), ref: containerRef },
|
|
16
34
|
react_1["default"].createElement(div_1["default"], { className: 'items-center gap-x-1' },
|
|
17
35
|
react_1["default"].createElement(text_1["default"], tslib_1.__assign({ align: 'start', type: 'medium', disabled: disabled, typography: (textProps === null || textProps === void 0 ? void 0 : textProps.typography) || 'sm' }, textProps),
|
|
18
36
|
label,
|
|
19
37
|
required ? react_1["default"].createElement(text_1["default"], { variant: 'span', typography: 'inherit', color: 'danger', className: 'ps-1' }, "*") : null),
|
|
20
|
-
moreInfo ? (react_1["default"].createElement(mouse_popup_1["default"], { show: show, content: react_1["default"].createElement(text_1["default"], { typography: 'sm', color:
|
|
21
|
-
react_1["default"].createElement("div", { onMouseEnter: function () { return setShow(true); }, onMouseLeave: function () { return setShow(false); }, className: '
|
|
38
|
+
moreInfo ? (react_1["default"].createElement(mouse_popup_1["default"], { show: show, content: react_1["default"].createElement(text_1["default"], { typography: 'sm', color: (0, label_theme_1.getMoreInfoPopupTextColor)(theme) }, moreInfo) },
|
|
39
|
+
react_1["default"].createElement("div", { onMouseEnter: function () { return setShow(true); }, onMouseLeave: function () { return setShow(false); }, className: (0, tailwind_merge_config_1.twMerge)('rounded-full', (0, label_theme_1.getMoreInfoIconHoverColor)(theme)) },
|
|
22
40
|
react_1["default"].createElement("svg", { width: "22", height: "22", viewBox: "0 0 22 22", className: 'w-4 h-4 hover:text-white', fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
23
41
|
react_1["default"].createElement("path", { d: "M12 15C12 15.5523 11.5523 16 11 16C10.4477 16 10 15.5523 10 15C10 14.4477 10.4477 14 11 14C11.5523 14 12 14.4477 12 15Z", fill: "currentColor" }),
|
|
24
42
|
react_1["default"].createElement("path", { d: "M11.75 6C11.75 5.58579 11.4142 5.25 11 5.25C10.5858 5.25 10.25 5.58579 10.25 6V12C10.25 12.4142 10.5858 12.75 11 12.75C11.4142 12.75 11.75 12.4142 11.75 12V6Z", fill: "currentColor" }),
|
|
@@ -27,7 +45,7 @@ var Label = function (props) {
|
|
|
27
45
|
validationMessage ? (react_1["default"].createElement(div_1["default"], { className: 'gap-x-1 items-center' },
|
|
28
46
|
react_1["default"].createElement(div_1["default"], { className: 'w-3 h-3 items-center justify-center' },
|
|
29
47
|
react_1["default"].createElement(Icon, { validationState: validationState })),
|
|
30
|
-
react_1["default"].createElement(text_1["default"], { typography: 'xs', color:
|
|
48
|
+
react_1["default"].createElement(text_1["default"], { typography: 'xs', color: (0, label_theme_1.getValidationMessageColor)(theme, validationState), align: 'start' }, validationMessage))) : null));
|
|
31
49
|
};
|
|
32
50
|
exports.Label = Label;
|
|
33
51
|
var Icon = function (_a) {
|
package/label/label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../label/label.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb,qDAAwC;AAExC,yDAA2B;AAC3B,kEAAmD;AACnD,uDAAyB;AACzB,uEAAwC;
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../label/label.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb,qDAAwC;AAExC,yDAA2B;AAC3B,kEAAmD;AACnD,uDAAyB;AACzB,uEAAwC;AACxC,6CAIuB;AAEvB,yDAAyD;AACzD,IAAI,YAAY,GAA2B,cAAM,OAAA,OAAO,EAAP,CAAO,CAAC;AACzD,IAAI;IACM,IAAA,QAAQ,GAAK,OAAO,CAAC,aAAa,CAAC,SAA3B,CAA4B;IAC5C,YAAY,GAAG,QAAQ,CAAC;CACzB;AAAC,WAAM;IACN,sCAAsC;CACvC;AAEM,IAAM,KAAK,GAAG,UAAC,KAAiB;IAEnC,IAAA,SAAS,GAYP,KAAK,UAZE,EACT,KAAK,GAWH,KAAK,MAXF,EACL,QAAQ,GAUN,KAAK,SAVC,EACR,YAAY,GASV,KAAK,aATK,EACZ,QAAQ,GAQN,KAAK,SARC,EACR,KAOE,KAAK,SAPS,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,SAAS,GAMP,KAAK,UANE,EACT,KAKE,KAAK,YALiB,EAAxB,WAAW,mBAAG,UAAU,KAAA,EACxB,QAAQ,GAIN,KAAK,SAJC,EACR,KAGE,KAAK,gBAHiB,EAAxB,eAAe,mBAAG,MAAM,KAAA,EACxB,iBAAiB,GAEf,KAAK,kBAFU,EACjB,gBAAgB,GACd,KAAK,iBADS,CACR;IACJ,IAAA,KAAkB,IAAA,gBAAQ,EAAU,KAAK,CAAC,EA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AAC,gTAAgT,EAAC,IAAI,EAAC,cAAc,GAAE,CAChX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,qBAAe,aAAK,CAAC"}
|
package/media/media.js
CHANGED
|
@@ -7,7 +7,7 @@ var media_style_1 = require("./media.style");
|
|
|
7
7
|
var tailwind_merge_config_1 = require("../tailwind-merge-config");
|
|
8
8
|
var Media = function (props) {
|
|
9
9
|
var children = props.children, style = props.style, at = props.at, greaterThan = props.greaterThan, lessThan = props.lessThan, between = props.between, className = props.className;
|
|
10
|
-
return (react_1["default"].createElement("div", { style: style, className: (0, tailwind_merge_config_1.twMerge)((0, media_style_1.STYLES)({ at: at, greaterThan: greaterThan, lessThan: lessThan, between: between }), className) }, children));
|
|
10
|
+
return (react_1["default"].createElement("div", { style: style, className: (0, tailwind_merge_config_1.twMerge)('bg-transparent', (0, media_style_1.STYLES)({ at: at, greaterThan: greaterThan, lessThan: lessThan, between: between }), className) }, children));
|
|
11
11
|
};
|
|
12
12
|
exports.Media = Media;
|
|
13
13
|
exports["default"] = exports.Media;
|
package/media/media.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../media/media.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAE1B,6CAAuC;AACvC,kEAAmD;AAE5C,IAAM,KAAK,GAAG,UAAC,KAAiB;IAC7B,IAAA,QAAQ,GAA2D,KAAK,SAAhE,EAAE,KAAK,GAAoD,KAAK,MAAzD,EAAE,EAAE,GAAgD,KAAK,GAArD,EAAE,WAAW,GAAmC,KAAK,YAAxC,EAAE,QAAQ,GAAyB,KAAK,SAA9B,EAAE,OAAO,GAAgB,KAAK,QAArB,EAAE,SAAS,GAAK,KAAK,UAAV,CAAW;IAEjF,OAAO,CACL,0CAAK,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,IAAA,+BAAO,EACnC,IAAA,oBAAM,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,W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