Skip to content

Commit 6532812

Browse files
committed
- BsColorPicker: refactor 'outlineModeButton' props to 'modeButtonOutlined'
- Update typescript comments
1 parent 9292573 commit 6532812

File tree

7 files changed

+58
-45
lines changed

7 files changed

+58
-45
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Released: December 03, 2024
2222
- **BsAlert**, **BsChip**, **BsChipGroup**:
2323
- Improve `icon` property to better accommodate **Google Material Symbols**.
2424
- Improve `icon-variant` property to better accommodate **Google Material Symbols**.
25-
- Change property of `icon-variant` default value to `outlined`.
25+
- Change the default value of the `icon-variant` property to `outlined`.
2626
- **BsAvatar**, **BsTab**, **BsListTileLeading**, **BsListNavItem**, **BsButton**, **BsToggleButton**, **BsToggleField**:
2727
- Add new property `icon-variant` to better accommodate **Google Material Symbols**.
2828
- Improve `icon` property to better accommodate **Google Material Symbols**.

src/components/Avatar/types/index.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ export declare type TImageProps = {
3535

3636
export declare type TIconProps = {
3737
/**
38-
* Android icon name, either with or without suffix. Valid suffixes are:
38+
* A shortcut to insert component `BsIcon` inside this component.
39+
*
40+
* Use android icon name with or without suffix. Valid suffixes are:
3941
* `_outlined`, `_rounded`, `_sharp`, `_filled`, `_outlined_filled`,
4042
* `_rounded_filled`, or `_sharp_filled`. Suffix `_filled` and `_outlined_filled`
41-
* will result the same icon style. Suffix will take priority over
43+
* will result the same icon style variant. Suffix will take priority over
4244
* `iconVariant` property.
4345
*
44-
* This is a shortcut to insert component `BsIcon` inside this component.
45-
*
4646
* @see [Google Material Symbol](https://fonts.google.com/icons?icon.set=Material+Symbols) for details.
4747
*/
4848
icon?: string;
4949
/**
50-
* Use predefined icon style, valid values are: `outlined`, `rounded`, `sharp`,
51-
* `filled`, `outlined_filled`, `rounded_filled`, and `sharp_filled`. Default
52-
* is `outlined`.
50+
* Use predefined icon style variant, valid values are: `outlined`, `rounded`,
51+
* `sharp`, `filled`, `outlined_filled`, `rounded_filled`, and `sharp_filled`.
52+
* Default is `outlined`.
5353
*
54-
* Variant `filled` and `outlined_filled` will result the same icon style.
54+
* Variant `filled` and `outlined_filled` will result the same icon style variant.
5555
*
5656
* @see [Google Material Symbol](https://fonts.google.com/icons?icon.set=Material+Symbols) for details.
5757
*/

src/components/ColorPicker/mixins/colorPickerApi.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ function onUpdateInputNumber(
421421
updateColorPreview(pickerData, emit);
422422
}
423423

424-
function renderInputColorHSL(
424+
function createInputColorHSL(
425425
props: Readonly<TColorPickerOptionProps>,
426426
pickerData: TColorPickerData,
427427
cssNamePrefix: string,
@@ -453,7 +453,7 @@ function renderInputColorHSL(
453453
);
454454
}
455455

456-
function renderInputColorRGB(
456+
function createInputColorRGB(
457457
props: Readonly<TColorPickerOptionProps>,
458458
pickerData: TColorPickerData,
459459
cssNamePrefix: string,
@@ -485,7 +485,7 @@ function renderInputColorRGB(
485485
);
486486
}
487487

488-
function renderInputColorHEX(
488+
function createInputColorHEX(
489489
props: Readonly<TColorPickerOptionProps>,
490490
pickerData: TColorPickerData,
491491
cssNamePrefix: string,
@@ -561,10 +561,10 @@ function renderColorPickerInputs(
561561
},
562562
[
563563
pickerData.config.mode === 'HSL'
564-
? renderInputColorHSL(props, pickerData, cssNamePrefix, inputIDs, emit)
564+
? createInputColorHSL(props, pickerData, cssNamePrefix, inputIDs, emit)
565565
: pickerData.config.mode === 'RGB'
566-
? renderInputColorRGB(props, pickerData, cssNamePrefix, inputIDs, emit)
567-
: renderInputColorHEX(props, pickerData, cssNamePrefix, inputIDs, emit),
566+
? createInputColorRGB(props, pickerData, cssNamePrefix, inputIDs, emit)
567+
: createInputColorHEX(props, pickerData, cssNamePrefix, inputIDs, emit),
568568
]
569569
);
570570
}
@@ -589,7 +589,7 @@ function renderColorPickerModeButtons(
589589
color: props.modeButtonColor as Prop<string>,
590590
toggleColor: props.modeButtonToggleColor as Prop<string>,
591591
// @ts-ignore
592-
outlined: props.outlineModeButton as Prop<boolean>,
592+
outlined: props.modeButtonOutlined as Prop<boolean>,
593593
items: [
594594
{ value: 'HEX', label: 'HEX' },
595595
{ value: 'RGB', label: 'RGB' },

src/components/ColorPicker/mixins/colorPickerProps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const colorPickerProps = {
2323
hideAlpha: booleanProp,
2424
hideInputs: booleanProp,
2525
hideModeButton: booleanProp,
26-
outlineModeButton: booleanProp,
26+
modeButtonOutlined: booleanProp,
2727
modeButtonColor: {
2828
type: String,
2929
default: 'grey',

src/components/ColorPicker/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ export declare type TColorPickerOptionProps = {
7575
/**
7676
* Render the toggle mode buttons with outlined style.
7777
*/
78-
outlineModeButton?: boolean;
78+
modeButtonOutlined?: boolean;
7979
/**
8080
* Default the toggle mode button color style.
8181
*/
8282
modeButtonColor?: string;
8383
/**
84-
* Color to apply to the active button.
84+
* Color to apply to the active toggle mode button.
8585
*/
8686
modeButtonToggleColor?: string;
8787
/**

src/components/Field/types/index.d.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ export declare type TInputFieldProps = TInputBaseProps &
6262
/**
6363
* Sets the action icon style variant.
6464
*
65-
* Valid predefined icon style are: `outlined`, `rounded`, `sharp`,
65+
* Valid predefined icon variants are: `outlined`, `rounded`, `sharp`,
6666
* `filled`, `outlined_filled`, `rounded_filled`, and `sharp_filled`.
6767
* Default is `outlined`.
6868
*
69-
* Variant `filled` and `outlined_filled` will
70-
* result the same icon style.
69+
* Variant `filled` and `outlined_filled` will result the same icon style variant.
7170
*
7271
* @see [Google Material Symbol](https://fonts.google.com/icons?icon.set=Material+Symbols) for details.
7372
*/
@@ -107,9 +106,11 @@ export declare type TInputFieldProps = TInputBaseProps &
107106
* Sets icon to display on inner right side. This is a shortcut to insert
108107
* component `BsIcon` inside this component.
109108
*
110-
* Use android icon name with suffix: `_outlined`, `_rounded`, `_sharp`,
111-
* `_filled`, `_outlined_filled`, `_rounded_filled`, or `_sharp_filled`.
112-
* Suffix `_filled` and `_outlined_filled` will result the same icon style.
109+
* Use android icon name with or without suffix. Valid suffixes are:
110+
* `_outlined`, `_rounded`, `_sharp`, `_filled`, `_outlined_filled`,
111+
* `_rounded_filled`, or `_sharp_filled`. If no suffix is given, then
112+
* default (`outlined`) icon variant will be used. Suffix `_filled`
113+
* and `_outlined_filled` will result the same icon style variant.
113114
*
114115
* @see [Google Material Symbol](https://fonts.google.com/icons?icon.set=Material+Symbols) for details.
115116
*/
@@ -118,9 +119,11 @@ export declare type TInputFieldProps = TInputBaseProps &
118119
* Sets icon to display on outer right side. This is a shortcut to insert
119120
* component `BsIcon` inside this component.
120121
*
121-
* Use android icon name with suffix: `_outlined`, `_rounded`, `_sharp`,
122-
* `_filled`, `_outlined_filled`, `_rounded_filled`, or `_sharp_filled`.
123-
* Suffix `_filled` and `_outlined_filled` will result the same icon style.
122+
* Use android icon name with or without suffix. Valid suffixes are:
123+
* `_outlined`, `_rounded`, `_sharp`, `_filled`, `_outlined_filled`,
124+
* `_rounded_filled`, or `_sharp_filled`. If no suffix is given, then
125+
* default (`outlined`) icon variant will be used. Suffix `_filled`
126+
* and `_outlined_filled` will result the same icon style variant.
124127
*
125128
* @see [Google Material Symbol](https://fonts.google.com/icons?icon.set=Material+Symbols) for details.
126129
*/
@@ -129,9 +132,11 @@ export declare type TInputFieldProps = TInputBaseProps &
129132
* Sets icon to display on inner left side. This is a shortcut to insert
130133
* component `BsIcon` inside this component.
131134
*
132-
* Use android icon name with suffix: `_outlined`, `_rounded`, `_sharp`,
133-
* `_filled`, `_outlined_filled`, `_rounded_filled`, or `_sharp_filled`.
134-
* Suffix `_filled` and `_outlined_filled` will result the same icon style.
135+
* Use android icon name with or without suffix. Valid suffixes are:
136+
* `_outlined`, `_rounded`, `_sharp`, `_filled`, `_outlined_filled`,
137+
* `_rounded_filled`, or `_sharp_filled`. If no suffix is given, then
138+
* default (`outlined`) icon variant will be used. Suffix `_filled`
139+
* and `_outlined_filled` will result the same icon style variant.
135140
*
136141
* @see [Google Material Symbol](https://fonts.google.com/icons?icon.set=Material+Symbols) for details.
137142
*/
@@ -140,9 +145,11 @@ export declare type TInputFieldProps = TInputBaseProps &
140145
* Sets icon to display on outer left side. This is a shortcut to insert
141146
* component `BsIcon` inside this component.
142147
*
143-
* Use android icon name with suffix: `_outlined`, `_rounded`, `_sharp`,
144-
* `_filled`, `_outlined_filled`, `_rounded_filled`, or `_sharp_filled`.
145-
* Suffix `_filled` and `_outlined_filled` will result the same icon style.
148+
* Use android icon name with or without suffix. Valid suffixes are:
149+
* `_outlined`, `_rounded`, `_sharp`, `_filled`, `_outlined_filled`,
150+
* `_rounded_filled`, or `_sharp_filled`. If no suffix is given, then
151+
* default (`outlined`) icon variant will be used. Suffix `_filled`
152+
* and `_outlined_filled` will result the same icon style variant.
146153
*
147154
* @see [Google Material Symbol](https://fonts.google.com/icons?icon.set=Material+Symbols) for details.
148155
*/

src/components/Icon/types/index.d.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ export declare type TSizeOptionProps = {
6161

6262
export declare type TIconOptionProps = TSizeOptionProps & {
6363
/**
64-
* Android icon name with suffix: `_outlined`, `_rounded`, `_sharp`, `_filled`,
65-
* `_outlined_filled`, `_rounded_filled`, or `_sharp_filled`.
64+
* Android icon name with or without suffix. Valid suffixes are: `_outlined` ,
65+
* `_rounded`, `_sharp`, `_filled`, `_outlined_filled`, `_rounded_filled`,
66+
* or `_sharp_filled`. If no suffix is given, then default (`outlined`) icon
67+
* variant will be used.
6668
*
67-
* Suffix `_filled` and `_outlined_filled` will result the same icon style.
69+
* Suffix `_filled` and `_outlined_filled` will result the same icon style variant.
6870
* And you can either use `*_filled` or sets property `filled` to `true` to
6971
* create an icon with fill style.
7072
*
@@ -116,11 +118,13 @@ export declare type TToggleIconOptionProps = {
116118
/**
117119
* The icon to display when `modelValue` property is `false` or `undefined`.
118120
*
119-
* Use android icon name with suffix: `_outlined`, `_rounded`, `_sharp`,
120-
* `_filled`, `_outlined_filled`, `_rounded_filled`, or `_sharp_filled`.
121+
* Use android icon name with or without suffix. Valid suffixes are: `_outlined`,
122+
* `_rounded`, `_sharp`, `_filled`, `_outlined_filled`, `_rounded_filled`, or
123+
* `_sharp_filled`. If no suffix is given, then default (`outlined`) icon
124+
* variant will be used.
121125
*
122-
* Suffix `_filled` or `_outlined_filled` will result the same icon style.
123-
* And you can either use `*_filled` or sets property `filled` to `true` to
126+
* Suffix `_filled` or `_outlined_filled` will result the same icon style variant.
127+
* And you can either use `*_filled` or sets the `filled` property to `true` to
124128
* create an icon with fill style.
125129
*
126130
* @see [Google Material Symbol](https://fonts.google.com/icons?icon.set=Material+Symbols) for details.
@@ -129,11 +133,13 @@ export declare type TToggleIconOptionProps = {
129133
/**
130134
* The icon to display when `modelValue` property is `true`.
131135
*
132-
* Use android icon name with suffix: `_outlined`, `_rounded`, `_sharp`,
133-
* `_filled`, `_outlined_filled`, `_rounded_filled`, or `_sharp_filled`.
136+
* Use android icon name with or without suffix. Valid suffixes are: `_outlined`,
137+
* `_rounded`, `_sharp`, `_filled`, `_outlined_filled`, `_rounded_filled`, or
138+
* `_sharp_filled`. If no suffix is given, then default (`outlined`) icon
139+
* variant will be used.
134140
*
135-
* Suffix `_filled` or `_outlined_filled` will result the same icon style.
136-
* And you can either use `*_filled` or sets property `filled` to `true` to
141+
* Suffix `_filled` or `_outlined_filled` will result the same icon style variant.
142+
* And you can either use `*_filled` or sets the `filled` property to `true` to
137143
* create an icon with fill style.
138144
*
139145
* @see [Google Material Symbol](https://fonts.google.com/icons?icon.set=Material+Symbols) for details.

0 commit comments

Comments
 (0)