Skip to content

Commit 9fdf7d4

Browse files
feat: added component style in theme
1 parent eef5b49 commit 9fdf7d4

File tree

12 files changed

+41
-19
lines changed

12 files changed

+41
-19
lines changed

.changeset/curvy-rocks-tickle.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@yamada-ui/native-select': minor
3+
'@yamada-ui/autocomplete': minor
4+
'@yamada-ui/native-table': minor
5+
'@yamada-ui/file-input': minor
6+
'@yamada-ui/calendar': minor
7+
'@yamada-ui/select': minor
8+
'@yamada-ui/slider': minor
9+
'@yamada-ui/table': minor
10+
---
11+
12+
Added component style in theme.

packages/components/autocomplete/src/autocomplete.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export type AutocompleteProps = ThemeProps<'Select'> &
5757

5858
export const Autocomplete = forwardRef<AutocompleteProps, 'input'>(
5959
(props, ref) => {
60-
const [styles, mergedProps] = useMultiComponentStyle('Select', props)
60+
const [styles, mergedProps] = useMultiComponentStyle('Autocomplete', props)
6161
let {
6262
className,
6363
defaultValue = '',

packages/components/autocomplete/src/multi-autocomplete.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ export type MultiAutocompleteProps = ThemeProps<'Select'> &
9797

9898
export const MultiAutocomplete = forwardRef<MultiAutocompleteProps, 'div'>(
9999
(props, ref) => {
100-
const [styles, mergedProps] = useMultiComponentStyle('Select', props)
100+
const [styles, mergedProps] = useMultiComponentStyle(
101+
'MultiAutocomplete',
102+
props,
103+
)
101104
let {
102105
className,
103106
defaultValue = [],

packages/components/calendar/src/month-picker.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export type MonthPickerProps = Omit<
5555
UseMonthPickerProps
5656

5757
export const MonthPicker = forwardRef<MonthPickerProps, 'div'>((props, ref) => {
58-
const [styles, mergedProps] = useMultiComponentStyle('DatePicker', props)
58+
const [styles, mergedProps] = useMultiComponentStyle('MonthPicker', props)
5959
let {
6060
className,
6161
isClearable = true,

packages/components/file-input/src/file-input.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const defaultFormat: (value: File, index: number) => string = ({ name }) => name
9191

9292
export const FileInput = forwardRef<FileInputProps, 'input'>(
9393
({ children, ...props }, ref) => {
94-
const [styles, mergedProps] = useMultiComponentStyle('Input', props)
94+
const [styles, mergedProps] = useMultiComponentStyle('FileInput', props)
9595
const {
9696
className,
9797
id,

packages/components/native-select/src/native-select.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export type NativeSelectProps = Omit<HTMLUIProps<'select'>, 'size'> &
9191

9292
export const NativeSelect = forwardRef<NativeSelectProps, 'select'>(
9393
(props, ref) => {
94-
const [styles, mergedProps] = useMultiComponentStyle('Select', props)
94+
const [styles, mergedProps] = useMultiComponentStyle('NativeSelect', props)
9595
let {
9696
className,
9797
children,
@@ -102,7 +102,6 @@ export const NativeSelect = forwardRef<NativeSelectProps, 'select'>(
102102
minH,
103103
minHeight,
104104
options = [],
105-
value,
106105
placeholder,
107106
containerProps,
108107
iconProps,
@@ -112,7 +111,7 @@ export const NativeSelect = forwardRef<NativeSelectProps, 'select'>(
112111
rest = useFormControlProps(rest)
113112

114113
const formControlProps = pickObject(rest, formControlProperties)
115-
const [layoutProps, selectPorps] = splitObject(rest, layoutStylesProperties)
114+
const [layoutProps, selectProps] = splitObject(rest, layoutStylesProperties)
116115

117116
let computedChildren: ReactElement[] = []
118117

@@ -158,14 +157,13 @@ export const NativeSelect = forwardRef<NativeSelectProps, 'select'>(
158157
<ui.select
159158
ref={ref}
160159
className={cx('ui-native-select-field', className)}
161-
value={value}
162160
__css={{
163161
paddingEnd: '2rem',
164162
h: h ?? height,
165163
minH: minH ?? minHeight,
166164
...styles.field,
167165
}}
168-
{...selectPorps}
166+
{...selectProps}
169167
>
170168
{placeholder ? (
171169
<NativeOption value='' hidden={!placeholderInOptions}>

packages/components/native-table/src/native-table.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export type NativeTableProps = HTMLUIProps<'table'> &
4848

4949
export const NativeTable = forwardRef<NativeTableProps, 'table'>(
5050
(props, ref) => {
51-
const [styles, mergedProps] = useMultiComponentStyle('Table', props)
51+
const [styles, mergedProps] = useMultiComponentStyle('NativeTable', props)
5252
const { className, layout, ...rest } = omitThemeProps(mergedProps)
5353

5454
const css: CSSUIObject = { tableLayout: layout, ...styles.table }
@@ -59,7 +59,11 @@ export const NativeTable = forwardRef<NativeTableProps, 'table'>(
5959
ref={ref}
6060
className={cx('ui-native-table', className)}
6161
__css={css}
62-
{...omitObject(rest, ['withColumnBorders', 'highlightOnHover'])}
62+
{...omitObject(rest, [
63+
'withBorder',
64+
'withColumnBorders',
65+
'highlightOnHover',
66+
])}
6367
/>
6468
</TableStyleProvider>
6569
)

packages/components/select/src/multi-select.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export type MultiSelectProps = ThemeProps<'Select'> &
8585
MultiSelectOptions
8686

8787
export const MultiSelect = forwardRef<MultiSelectProps, 'div'>((props, ref) => {
88-
const [styles, mergedProps] = useMultiComponentStyle('Select', props)
88+
const [styles, mergedProps] = useMultiComponentStyle('MultiSelect', props)
8989
let {
9090
className,
9191
defaultValue = [],

packages/components/select/src/select.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
139139
w: '100%',
140140
h: 'fit-content',
141141
color,
142-
...styles.containerProps,
142+
...styles.container,
143143
}
144144

145145
return (

packages/components/slider/src/range-slider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ export type RangeSliderProps = Omit<
689689
RangeSliderOptions
690690

691691
export const RangeSlider = forwardRef<RangeSliderProps, 'div'>((props, ref) => {
692-
const [styles, mergedProps] = useMultiComponentStyle('Slider', props)
692+
const [styles, mergedProps] = useMultiComponentStyle('RangeSlider', props)
693693
const {
694694
className,
695695
children,

packages/components/table/src/paging-table.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,14 @@ export const PagingTable = forwardRef(
136136
{ colorScheme, highlightOnSelected = true, ...props }: PagingTableProps<Y>,
137137
ref: ForwardedRef<HTMLTableElement>,
138138
) => {
139-
const [styles, { size, ...mergedProps }] = useMultiComponentStyle('Table', {
140-
colorScheme,
141-
highlightOnSelected,
142-
...props,
143-
})
139+
const [styles, { size, ...mergedProps }] = useMultiComponentStyle(
140+
'PagingTable',
141+
{
142+
colorScheme,
143+
highlightOnSelected,
144+
...props,
145+
},
146+
)
144147
const {
145148
className,
146149
containerProps,
@@ -175,6 +178,7 @@ export const PagingTable = forwardRef(
175178
...omitObject(computedProps, [
176179
'highlightOnSelected',
177180
'highlightOnHover',
181+
'withBorder',
178182
'withColumnBorders',
179183
]),
180184
checkboxProps: { colorScheme, ...checkboxProps },

packages/components/table/src/table.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export const Table = forwardRef(
118118
...omitObject(computedProps, [
119119
'highlightOnSelected',
120120
'highlightOnHover',
121+
'withBorder',
121122
'withColumnBorders',
122123
]),
123124
checkboxProps: { colorScheme, ...checkboxProps },

0 commit comments

Comments
 (0)