-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(react-checkbox): Removing mergeProps and refactoring Checkbo…
…x. (#19225) * Refactoring Checkbox to use new Slots API * Refactoring Checkbox, removing mergeProps, and indicator styles * removing temp style * Change files * updating default icons and their styling * updating checked, mixed, and unchecked styles to be applied from root" * Update packages/react-checkbox/src/components/Checkbox/useCheckboxStyles.ts * updating snapshots * updating snapshots and added checking if indicator has been set before applying default icons * renaming checkboxClassName to containerClassName and fixing unchecked styles * updating checkbox api file
- Loading branch information
1 parent
d09247f
commit 028f284
Showing
10 changed files
with
346 additions
and
367 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-checkbox-4da078c0-b510-4088-aec3-f33c521c1303.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "Refactoring Checkbox, removing mergeProps, and fixing indicator styles.", | ||
"packageName": "@fluentui/react-checkbox", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 18 additions & 6 deletions
24
packages/react-checkbox/src/components/Checkbox/DefaultIcons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
import * as React from 'react'; | ||
|
||
export const DefaultMixedIcon = () => ( | ||
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" focusable="false"> | ||
<rect width="100%" height="100%" /> | ||
export const Mixed12Regular = () => ( | ||
<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" focusable="false"> | ||
<rect width="8" height="8" x="2" y="2" /> | ||
</svg> | ||
); | ||
|
||
export const DefaultCheckmarkIcon = () => ( | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" focusable="false"> | ||
<path d="M1837 557L768 1627l-557-558 90-90 467 466 979-978 90 90z" /> | ||
export const Mixed16Regular = () => ( | ||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" focusable="false"> | ||
<rect width="10" height="10" x="3" y="3" /> | ||
</svg> | ||
); | ||
|
||
export const Checkmark12Regular = () => ( | ||
<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M9.85355 3.14645C10.0488 3.34171 10.0488 3.65829 9.85355 3.85355L5.35355 8.35355C5.15829 8.54882 4.84171 8.54882 4.64645 8.35355L2.64645 6.35355C2.45118 6.15829 2.45118 5.84171 2.64645 5.64645C2.84171 5.45118 3.15829 5.45118 3.35355 5.64645L5 7.29289L9.14645 3.14645C9.34171 2.95118 9.65829 2.95118 9.85355 3.14645Z" /> | ||
</svg> | ||
); | ||
|
||
export const Checkmark16Regular = () => ( | ||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M13.8639 3.65609C14.0533 3.85704 14.0439 4.17348 13.8429 4.36288L5.91309 11.8368C5.67573 12.0605 5.30311 12.0536 5.07417 11.8213L2.39384 9.10093C2.20003 8.90422 2.20237 8.58765 2.39907 8.39384C2.59578 8.20003 2.91235 8.20237 3.10616 8.39908L5.51192 10.8407L13.1571 3.63517C13.358 3.44577 13.6745 3.45513 13.8639 3.65609Z" /> | ||
</svg> | ||
); |
Oops, something went wrong.