-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pie-toggle-switch): DSW-991 toggle switch (#672)
* feat(pie-toggle-switch): DSW-990 add empty package skeleton * docs - add note to generator readme * fix linting issues in generator * add todo comments to lint disable rules * remove test commands as no tests exist yet * add basic styles, template and story * add icon and comments * feat(pie-toggle-switch): DSW-991 rename prop and method * feat(pie-toggle-switch): DSW-991 update icon style * feat(pie-toggle-switch): DSW-991 sb control update * feat(pie-toggle-switch): DSW-991 storybook checked * feat(pie-toggle-switch): DSW-991 remove has * feat(pie-toggle-switch): DSW-991 style disabled * feat(pie-toggle-switch): DSW-991 use isDisabled * feat(pie-toggle-switch): DSW-991 remove unused prop * feat(pie-toggle-switch): DSW-991 update README * feat(pie-toggle-switch): DSW-991 adds rtl settings * feat(pie-toggle-switch): DSW-991 add test * feat(pie-toggle-switch): DSW-991 add component test * feat(pie-toggle-switch): DSW-991 add visual tests * feat(pie-toggle-switch): DSW-991 add component tests * feat(pie-toggle-switch): DSW-991 add some tests to cover component * feat(pie-toggle-switch): DSW-991 remove sass comments * feat(pie-toggle-switch): DSW-991 pr comments * feat(pie-toggle-switch): DSW-991 pr comment * feat(pie-toggle-switch): DSW-991 pr comment * feat(pie-toggle-switch): DSW-991 pr comment * feat(pie-toggle-switch): DSW-991 pr comment * feat(pie-toggle-switch): DSW-991 update icon style * feat(pie-toggle-switch): DSW-991 update element * feat(pie-toggle-switch): DSW-991 remove size var * feat(pie-toggle-switch): DSW-991 add to stories * feat(pie-toggle-switch): DSW-991 move mixin * feat(pie-toggle-switch): DSW-991 lint styles * feat(pie-toggle-switch): DSW-991 import icon * feat(pie-toggle-switch): DSW-991 re-lint * feat(pie-toggle-switch): DSW-991 set checked:false * feat(pie-toggle-switch): DSW-991 revert generator changes * feat(pie-docs): DSW-991 update transitions * refactor(pie-icons-react): DSW-1007 switch to mjs to enable usage in commonjs and esm (#666) * feat(pie-toggle-switch): DSW-991 revert generator changes * feat(pie-toggle-switch): DSW-991 update transitions * feat(pie-toggle-switch): DSW-991 lint * feat(pie-toggle-switch): DSW-991 add changeset * feat(pie-toggle-switch): DSW-991 name/story update * feat(pie-toggle-switch): DSW-991 pr comment * feat(pie-toggle-switch): DSW-991 use kebab case for style --------- Co-authored-by: jamieomaguire <jamieolivermaguire@googlemail.com> Co-authored-by: FayeCarter <faye.carter@justeattakeaway.com> Co-authored-by: Mariya Radchuk <radchuk.mary@gmail.com> Co-authored-by: Ashley Watson-Nolan <ashley.watson-nolan@justeattakeaway.com>
- Loading branch information
1 parent
5df562d
commit 5ff10d5
Showing
15 changed files
with
525 additions
and
35 deletions.
There are no files selected for viewing
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,9 @@ | ||
--- | ||
"@justeattakeaway/pie-toggle-switch": minor | ||
--- | ||
|
||
[Added] - component styles | ||
[Added] - component functionality | ||
[Added] - `isChecked` and `isDisabled` prop | ||
[Added] - `pie-toggle-switch` story | ||
[Updated] - README |
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
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
56 changes: 56 additions & 0 deletions
56
packages/components/pie-toggle-switch/playwright/index.html
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,56 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff2" as="font" type="font/woff2" crossorigin> | ||
<link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff2" as="font" type="font/woff2" crossorigin> | ||
<link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff2" as="font" type="font/woff2" crossorigin> | ||
<style> | ||
@font-face { | ||
font-family: JETSansDigital; | ||
src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff2') format("woff2"), | ||
url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff') format("woff"); | ||
font-weight: 400; | ||
font-display: swap; | ||
} | ||
@font-face { | ||
font-family: JETSansDigital; | ||
src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff2') format("woff2"), | ||
url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff') format("woff"); | ||
font-weight: 700; | ||
font-display: swap; | ||
} | ||
@font-face { | ||
font-family: JETSansDigital; | ||
src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff2') format("woff2"), | ||
url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff') format("woff"); | ||
font-weight: 800; | ||
font-display: swap; | ||
} | ||
body { | ||
font-feature-settings: "tnum"; /* Enable tabular numbers */ | ||
} | ||
/* basic styles to center align components and give them some spacing */ | ||
#root { | ||
padding: 1em; | ||
} | ||
|
||
#root > * { | ||
display: block; | ||
margin-inline: auto; | ||
} | ||
|
||
#root > * + * { | ||
margin-top: 1em; | ||
} | ||
</style> | ||
<title>Testing Page</title> | ||
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet.css" /> | ||
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet-hsl-colors.css" /> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="./index.ts"></script> | ||
</body> | ||
</html> |
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 @@ | ||
// Import common styles here |
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,3 +1,19 @@ | ||
// TODO - please remove the eslint disable comment below when you add props to this interface | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface ToggleSwitchProps {} | ||
import { RTLComponentProps } from '@justeattakeaway/pie-webc-core'; | ||
|
||
export interface ToggleSwitchProps extends RTLComponentProps { | ||
/** | ||
* Same as the HTML checked attribute - indicates whether the switch is on or off | ||
*/ | ||
isChecked: boolean; | ||
/** | ||
* Same as the HTML checked attribute - indicates whether the switch disabled or not | ||
*/ | ||
isDisabled: boolean; | ||
} | ||
|
||
/** | ||
* Event name for when the toggle switch checked state is changed. | ||
* | ||
* @constant | ||
*/ | ||
export const EVENT_TOGGLE_SWITCH_CHANGED = 'pie-toggle-switch-changed'; |
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
Oops, something went wrong.