Skip to content

Commit

Permalink
feat(switch): add new colours strategy
Browse files Browse the repository at this point in the history
add new colours startegy

BREAKING CHANGE: new colours strategy
  • Loading branch information
andresin87 authored and acd02 committed Aug 2, 2023
1 parent 6354f52 commit 7013e7f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/components/switch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spark-ui/switch",
"version": "1.14.4",
"version": "1.14.3-colours.0",
"description": "A control that allows the user to toggle between checked and not checked.",
"publishConfig": {
"access": "public"
Expand All @@ -20,8 +20,8 @@
"@radix-ui/react-id": "1.0.1",
"@radix-ui/react-switch": "1.0.3",
"@spark-ui/form-field": "^1.2.1",
"@spark-ui/icons": "^1.19.5",
"@spark-ui/internal-utils": "^1.6.1",
"@spark-ui/icons": "^1.19.4",
"@spark-ui/internal-utils": "colours",
"@spark-ui/label": "^1.5.0",
"@spark-ui/slot": "^1.6.1",
"@spark-ui/use-combined-state": "^0.5.0",
Expand Down
6 changes: 4 additions & 2 deletions packages/components/switch/src/Switch.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ export const Sizes: StoryFn = _args => (
)

const switchColors: ComponentProps<typeof Switch>['intent'][] = [
'primary',
'secondary',
'main',
'support',
'accent',
'basic',
'success',
'alert',
'error',
Expand Down
14 changes: 6 additions & 8 deletions packages/components/switch/src/SwitchInput.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ export const styles = cva(
}),
intent: makeVariants<
'intent',
['primary', 'secondary', 'success', 'alert', 'error', 'info', 'neutral']
['main', 'support', 'accent', 'basic', 'success', 'alert', 'error', 'info', 'neutral']
>({
primary: ['spark-state-checked:bg-primary', 'hover:ring-primary-container', 'text-primary'],
secondary: [
'spark-state-checked:bg-secondary',
'hover:ring-secondary-container',
'text-secondary',
],
main: ['spark-state-checked:bg-main', 'hover:ring-main-container', 'text-main'],
support: ['spark-state-checked:bg-support', 'hover:ring-support-container', 'text-support'],
accent: ['spark-state-checked:bg-accent', 'hover:ring-accent-container', 'text-accent'],
basic: ['spark-state-checked:bg-basic', 'hover:ring-basic-container', 'text-basic'],
success: ['spark-state-checked:bg-success', 'hover:ring-success-container', 'text-success'],
alert: ['spark-state-checked:bg-alert', 'hover:ring-alert-container', 'text-alert'],
error: ['spark-state-checked:bg-error', 'hover:ring-error-container', 'text-error'],
Expand All @@ -37,7 +35,7 @@ export const styles = cva(
}),
},
defaultVariants: {
intent: 'primary',
intent: 'basic',
size: 'sm',
},
}
Expand Down

0 comments on commit 7013e7f

Please sign in to comment.