Skip to content

Commit e54167a

Browse files
Copilothotlong
andcommitted
Import component styles in fields package to fix styling issues
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 87797cf commit e54167a

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

packages/fields/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
"main": "./dist/index.js",
88
"module": "./dist/index.js",
99
"types": "./dist/index.d.ts",
10+
"sideEffects": true,
1011
"exports": {
1112
".": {
1213
"types": "./dist/index.d.ts",
1314
"import": "./dist/index.js",
1415
"require": "./dist/index.cjs"
15-
}
16+
},
17+
"./style.css": "./dist/index.css"
1618
},
1719
"files": [
1820
"dist",

packages/fields/src/index.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* ObjectUI Fields Styles
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
/* Import styles from @object-ui/components to ensure all Shadcn UI styles are available */
10+
@import '@object-ui/components/src/index.css';

packages/fields/src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9+
import './index.css';
10+
911
import React from 'react';
1012
import type { FieldMetadata, SelectOptionMetadata } from '@object-ui/types';
1113
import { Badge, Avatar, AvatarFallback, Button } from '@object-ui/components';

packages/fields/vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export default defineConfig({
1010
insertTypesEntry: true,
1111
}),
1212
],
13+
resolve: {
14+
alias: {
15+
'@': path.resolve(__dirname, './src'),
16+
},
17+
},
1318
build: {
1419
lib: {
1520
entry: path.resolve(__dirname, 'src/index.tsx'),

0 commit comments

Comments
 (0)