File tree Expand file tree Collapse file tree 6 files changed +22
-14
lines changed Expand file tree Collapse file tree 6 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,14 @@ Use this component as an advanced layout for user ratings that include both the
47
47
48
48
To learn more about how to customize the appearance of components, please see the [ Theme docs] ( /docs/customize/theme ) .
49
49
50
+ ### Rating theme
51
+
50
52
<Theme name = " rating" />
51
53
54
+ ### Advanced rating theme
55
+
56
+ <Theme name = " ratingAdvanced" />
57
+
52
58
## References
53
59
54
60
- [ Flowbite Rating] ( https://flowbite.com/docs/components/rating/ )
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import type { FlowbitePaginationTheme } from '../Pagination';
25
25
import type { FlowbiteProgressTheme } from '../Progress' ;
26
26
import type { FlowbiteRadioTheme } from '../Radio' ;
27
27
import type { FlowbiteRangeSliderTheme } from '../RangeSlider' ;
28
- import type { FlowbiteRatingTheme } from '../Rating' ;
28
+ import type { FlowbiteRatingAdvancedTheme , FlowbiteRatingTheme } from '../Rating' ;
29
29
import type { FlowbiteSelectTheme } from '../Select' ;
30
30
import type { FlowbiteSidebarTheme } from '../Sidebar' ;
31
31
import type { FlowbiteSpinnerTheme } from '../Spinner' ;
@@ -59,6 +59,7 @@ export interface FlowbiteTheme {
59
59
modal : FlowbiteModalTheme ;
60
60
navbar : FlowbiteNavbarTheme ;
61
61
rating : FlowbiteRatingTheme ;
62
+ ratingAdvanced : FlowbiteRatingAdvancedTheme ;
62
63
pagination : FlowbitePaginationTheme ;
63
64
sidebar : FlowbiteSidebarTheme ;
64
65
progress : FlowbiteProgressTheme ;
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { twMerge } from 'tailwind-merge';
5
5
import { mergeDeep } from '../../helpers/merge-deep' ;
6
6
import { getTheme } from '../../theme-store' ;
7
7
import type { DeepPartial } from '../../types' ;
8
- import type { FlowbiteRatingAdvancedTheme } from './RatingAdvanced' ;
9
8
import { RatingAdvanced } from './RatingAdvanced' ;
10
9
import { RatingContext } from './RatingContext' ;
11
10
import type { FlowbiteRatingStarTheme , FlowbiteStarSizes } from './RatingStar' ;
@@ -16,7 +15,6 @@ export interface FlowbiteRatingTheme {
16
15
base : string ;
17
16
} ;
18
17
star : FlowbiteRatingStarTheme ;
19
- advanced : FlowbiteRatingAdvancedTheme ;
20
18
}
21
19
22
20
export interface RatingProps extends ComponentProps < 'div' > {
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export const RatingAdvanced: FC<RatingAdvancedProps> = ({
26
26
theme : customTheme = { } ,
27
27
...props
28
28
} ) => {
29
- const theme = mergeDeep ( getTheme ( ) . rating . advanced , customTheme ) ;
29
+ const theme = mergeDeep ( getTheme ( ) . ratingAdvanced , customTheme ) ;
30
30
31
31
return (
32
32
< div className = { twMerge ( theme . base , className ) } { ...props } >
Original file line number Diff line number Diff line change 1
1
import type { FlowbiteRatingTheme } from './Rating' ;
2
+ import { FlowbiteRatingAdvancedTheme } from './RatingAdvanced' ;
2
3
3
4
export const ratingTheme : FlowbiteRatingTheme = {
4
5
root : {
5
6
base : 'flex items-center' ,
6
7
} ,
7
- advanced : {
8
- base : 'flex items-center' ,
9
- label : 'text-sm font-medium text-cyan-600 dark:text-cyan-500' ,
10
- progress : {
11
- base : 'mx-4 h-5 w-2/4 rounded bg-gray-200 dark:bg-gray-700' ,
12
- fill : 'h-5 rounded bg-yellow-400' ,
13
- label : 'text-sm font-medium text-cyan-600 dark:text-cyan-500' ,
14
- } ,
15
- } ,
16
8
star : {
17
9
empty : 'text-gray-300 dark:text-gray-500' ,
18
10
filled : 'text-yellow-400' ,
@@ -23,3 +15,13 @@ export const ratingTheme: FlowbiteRatingTheme = {
23
15
} ,
24
16
} ,
25
17
} ;
18
+
19
+ export const ratingAdvancedTheme : FlowbiteRatingAdvancedTheme = {
20
+ base : 'flex items-center' ,
21
+ label : 'text-sm font-medium text-cyan-600 dark:text-cyan-500' ,
22
+ progress : {
23
+ base : 'mx-4 h-5 w-2/4 rounded bg-gray-200 dark:bg-gray-700' ,
24
+ fill : 'h-5 rounded bg-yellow-400' ,
25
+ label : 'text-sm font-medium text-cyan-600 dark:text-cyan-500' ,
26
+ } ,
27
+ } ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import { paginationTheme } from './components/Pagination/theme';
25
25
import { progressTheme } from './components/Progress/theme' ;
26
26
import { radioTheme } from './components/Radio/theme' ;
27
27
import { rangeSliderTheme } from './components/RangeSlider/theme' ;
28
- import { ratingTheme } from './components/Rating/theme' ;
28
+ import { ratingAdvancedTheme , ratingTheme } from './components/Rating/theme' ;
29
29
import { selectTheme } from './components/Select/theme' ;
30
30
import { sidebarTheme } from './components/Sidebar/theme' ;
31
31
import { spinnerTheme } from './components/Spinner/theme' ;
@@ -67,6 +67,7 @@ export const theme: FlowbiteTheme = {
67
67
radio : radioTheme ,
68
68
rangeSlider : rangeSliderTheme ,
69
69
rating : ratingTheme ,
70
+ ratingAdvanced : ratingAdvancedTheme ,
70
71
select : selectTheme ,
71
72
textInput : textInputTheme ,
72
73
textarea : textareaTheme ,
You can’t perform that action at this time.
0 commit comments