From cc543a398c9cd315698f68c1586abf2847d4c12e Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Mon, 25 Mar 2024 12:28:26 +0300 Subject: [PATCH] fix(vue): useContext util fixes #196 --- src/vue/components/Actions.vue | 3 ++- src/vue/components/ActionsButton.vue | 8 +++++--- src/vue/components/ActionsGroup.vue | 3 ++- src/vue/components/ActionsLabel.vue | 10 ++++++---- src/vue/components/Badge.vue | 3 ++- src/vue/components/Block.vue | 8 +++++--- src/vue/components/BlockFooter.vue | 10 ++++++---- src/vue/components/BlockHeader.vue | 8 +++++--- src/vue/components/BlockTitle.vue | 6 ++++-- src/vue/components/Breadcrumbs.vue | 3 ++- src/vue/components/BreadcrumbsCollapsed.vue | 8 +++++--- src/vue/components/BreadcrumbsItem.vue | 8 +++++--- src/vue/components/BreadcrumbsSeparator.vue | 3 ++- src/vue/components/Button.vue | 8 +++++--- src/vue/components/Card.vue | 8 +++++--- src/vue/components/Checkbox.vue | 6 ++++-- src/vue/components/Chip.vue | 8 +++++--- src/vue/components/Dialog.vue | 6 ++++-- src/vue/components/DialogButton.vue | 8 +++++--- src/vue/components/Fab.vue | 6 ++++-- src/vue/components/Icon.vue | 5 +++-- src/vue/components/Link.vue | 8 +++++--- src/vue/components/List.vue | 8 +++++--- src/vue/components/ListButton.vue | 8 +++++--- src/vue/components/ListGroup.vue | 4 +--- src/vue/components/ListInput.vue | 8 +++++--- src/vue/components/ListItem.vue | 8 +++++--- src/vue/components/MenuList.vue | 4 +--- src/vue/components/MenuListItem.vue | 2 -- src/vue/components/Message.vue | 8 +++++--- src/vue/components/Messagebar.vue | 8 +++++--- src/vue/components/Messages.vue | 5 +++-- src/vue/components/MessagesTitle.vue | 10 ++++++---- src/vue/components/Navbar.vue | 10 ++++++---- src/vue/components/NavbarBackLink.vue | 9 +++++---- src/vue/components/Notification.vue | 10 ++++++---- src/vue/components/Page.vue | 8 +++++--- src/vue/components/Panel.vue | 8 +++++--- src/vue/components/Popover.vue | 9 ++++++--- src/vue/components/Popup.vue | 8 +++++--- src/vue/components/Preloader.vue | 12 +++++++----- src/vue/components/Progressbar.vue | 10 ++++++---- src/vue/components/Radio.vue | 8 +++++--- src/vue/components/Range.vue | 8 +++++--- src/vue/components/Searchbar.vue | 10 ++++++---- src/vue/components/Segmented.vue | 10 ++++++---- src/vue/components/SegmentedButton.vue | 4 +--- src/vue/components/Sheet.vue | 8 +++++--- src/vue/components/Stepper.vue | 10 ++++++---- src/vue/components/Tabbar.vue | 4 +--- src/vue/components/TabbarLink.vue | 8 +++++--- src/vue/components/Table.vue | 5 +++-- src/vue/components/TableBody.vue | 5 +++-- src/vue/components/TableCell.vue | 8 +++++--- src/vue/components/TableHead.vue | 5 +++-- src/vue/components/TableRow.vue | 6 ++++-- src/vue/components/Toast.vue | 8 +++++--- src/vue/components/Toggle.vue | 8 +++++--- src/vue/components/Toolbar.vue | 8 +++++--- src/vue/components/icons/CheckboxIcon.vue | 6 +++--- src/vue/shared/KonstaProvider.vue | 4 +--- 61 files changed, 260 insertions(+), 174 deletions(-) diff --git a/src/vue/components/Actions.vue b/src/vue/components/Actions.vue index 9f47933b..a2e429ed 100644 --- a/src/vue/components/Actions.vue +++ b/src/vue/components/Actions.vue @@ -9,7 +9,7 @@ import { useContext } from '../shared/use-context.js'; import { ActionsClasses } from '../../shared/classes/ActionsClasses.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; export default { name: 'k-actions', @@ -32,6 +32,7 @@ emits: ['backdropclick'], setup(props, ctx) { const context = useContext(); + const useThemeClasses = themeClasses(context); const state = computed(() => (props.opened ? 'opened' : 'closed')); const c = useThemeClasses(props, () => diff --git a/src/vue/components/ActionsButton.vue b/src/vue/components/ActionsButton.vue index dcb5ffa3..c22514bc 100644 --- a/src/vue/components/ActionsButton.vue +++ b/src/vue/components/ActionsButton.vue @@ -14,9 +14,9 @@ import { useContext } from '../shared/use-context.js'; import { useTouchRipple } from '../shared/use-touch-ripple.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import { useTheme } from '../shared/use-theme.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; import { ActionsButtonClasses } from '../../shared/classes/ActionsButtonClasses.js'; import { ActionsButtonColors } from '../../shared/colors/ActionsButtonColors.js'; @@ -56,6 +56,8 @@ }, setup(props) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const rippleElRef = ref(null); const Component = computed(() => { let c = props.component; @@ -74,7 +76,7 @@ ActionsButtonColors(props.colors || {}, useDarkClasses) ); - const theme = useTheme(context); + const theme = useTheme({}, context); const isDividers = computed(() => typeof props.dividers === 'undefined' diff --git a/src/vue/components/ActionsGroup.vue b/src/vue/components/ActionsGroup.vue index 71f12523..10c32da1 100644 --- a/src/vue/components/ActionsGroup.vue +++ b/src/vue/components/ActionsGroup.vue @@ -7,7 +7,7 @@ import { useContext } from '../shared/use-context.js'; import { ActionsGroupClasses } from '../../shared/classes/ActionsGroupClasses.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; export default { name: 'k-actions-group', @@ -28,6 +28,7 @@ }, setup(props, ctx) { const context = useContext(); + const useThemeClasses = themeClasses(context); const c = useThemeClasses(props, () => ActionsGroupClasses(props, ctx.attrs.class) ); diff --git a/src/vue/components/ActionsLabel.vue b/src/vue/components/ActionsLabel.vue index dbe1ead7..3964d4a4 100644 --- a/src/vue/components/ActionsLabel.vue +++ b/src/vue/components/ActionsLabel.vue @@ -9,8 +9,8 @@ import { ActionsLabelClasses } from '../../shared/classes/ActionsLabelClasses.js'; import { ActionsLabelColors } from '../../shared/colors/ActionsLabelColors.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import { useTheme } from '../shared/use-theme.js'; export default { @@ -35,13 +35,15 @@ fontSizeIos: { type: String, default: 'text-sm' }, fontSizeMaterial: { type: String, default: 'text-sm' }, }, - setup(props, ctx) { + setup(props) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const colors = computed(() => ActionsLabelColors(props.colors || {}, useDarkClasses) ); - const theme = useTheme(context); + const theme = useTheme({}, context); const isDividers = computed(() => typeof props.dividers === 'undefined' diff --git a/src/vue/components/Badge.vue b/src/vue/components/Badge.vue index 0b8d5340..268709a8 100644 --- a/src/vue/components/Badge.vue +++ b/src/vue/components/Badge.vue @@ -8,7 +8,7 @@ import { useContext } from '../shared/use-context.js'; import { BadgeClasses } from '../../shared/classes/BadgeClasses.js'; import { BadgeColors } from '../../shared/colors/BadgeColors.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; export default { name: 'k-badge', @@ -35,6 +35,7 @@ }, setup(props) { const context = useContext(); + const useThemeClasses = themeClasses(context); const colors = computed(() => BadgeColors(props.colors || {})); const size = computed(() => (props.small ? 'sm' : 'md')); diff --git a/src/vue/components/Block.vue b/src/vue/components/Block.vue index c57bf49b..874392a4 100644 --- a/src/vue/components/Block.vue +++ b/src/vue/components/Block.vue @@ -9,9 +9,9 @@ import { useTheme } from '../shared/use-theme.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; import { cls } from '../../shared/cls.js'; @@ -52,11 +52,13 @@ }, setup(props, ctx) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const colors = computed(() => BlockColors(props.colors || {}, useDarkClasses) ); - const theme = useTheme(context); + const theme = useTheme({}, context); const isStrong = computed(() => typeof props.strong === 'undefined' diff --git a/src/vue/components/BlockFooter.vue b/src/vue/components/BlockFooter.vue index 2784cc71..1e176b80 100644 --- a/src/vue/components/BlockFooter.vue +++ b/src/vue/components/BlockFooter.vue @@ -13,9 +13,9 @@ import { useTheme } from '../shared/use-theme.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; export default { name: 'k-block-footer', @@ -39,9 +39,11 @@ insetIos: { type: Boolean, default: false }, insetMaterial: { type: Boolean, default: false }, }, - setup(props, ctx) { + setup(props) { const context = useContext(); - const theme = useTheme(context); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); + const theme = useTheme({}, context); const isInset = computed(() => typeof props.inset === 'undefined' ? theme.value === 'ios' diff --git a/src/vue/components/BlockHeader.vue b/src/vue/components/BlockHeader.vue index ea6bea5c..3ed0e737 100644 --- a/src/vue/components/BlockHeader.vue +++ b/src/vue/components/BlockHeader.vue @@ -13,9 +13,9 @@ import { BlockHeaderColors } from '../../shared/colors/BlockHeaderColors.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; export default { name: 'k-block-header', @@ -41,7 +41,9 @@ }, setup(props) { const context = useContext(); - const theme = useTheme(context); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); + const theme = useTheme({}, context); const isInset = computed(() => typeof props.inset === 'undefined' ? theme.value === 'ios' diff --git a/src/vue/components/BlockTitle.vue b/src/vue/components/BlockTitle.vue index fc7027c7..b35ee37b 100644 --- a/src/vue/components/BlockTitle.vue +++ b/src/vue/components/BlockTitle.vue @@ -11,9 +11,9 @@ import { BlockTitleColors } from '../../shared/colors/BlockTitleColors.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; export default { name: 'k-block-title', @@ -48,6 +48,8 @@ }, setup(props) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const colors = computed(() => BlockTitleColors(props.colors || {}, useDarkClasses) ); diff --git a/src/vue/components/Breadcrumbs.vue b/src/vue/components/Breadcrumbs.vue index ac05f58d..68ac54f0 100644 --- a/src/vue/components/Breadcrumbs.vue +++ b/src/vue/components/Breadcrumbs.vue @@ -7,7 +7,7 @@ import { useContext } from '../shared/use-context.js'; import { BreadcrumbsClasses } from '../../shared/classes/BreadcrumbsClasses.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; export default { name: 'k-breadcrumbs', @@ -35,6 +35,7 @@ }, setup(props) { const context = useContext(); + const useThemeClasses = themeClasses(context); const c = useThemeClasses(props, () => BreadcrumbsClasses(props)); return { c, diff --git a/src/vue/components/BreadcrumbsCollapsed.vue b/src/vue/components/BreadcrumbsCollapsed.vue index 3bc4d5cb..010f80dd 100644 --- a/src/vue/components/BreadcrumbsCollapsed.vue +++ b/src/vue/components/BreadcrumbsCollapsed.vue @@ -14,9 +14,9 @@ import { BreadcrumbsCollapsedColors } from '../../shared/colors/BreadcrumbsCollapsedColors.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; export default { name: 'k-breadcrumbs-collapsed', @@ -37,8 +37,10 @@ type: Object, }, }, - setup(props, ctx) { + setup(props) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const colors = computed(() => BreadcrumbsCollapsedColors(props.colors, useDarkClasses) ); diff --git a/src/vue/components/BreadcrumbsItem.vue b/src/vue/components/BreadcrumbsItem.vue index 88cf678b..341b8a12 100644 --- a/src/vue/components/BreadcrumbsItem.vue +++ b/src/vue/components/BreadcrumbsItem.vue @@ -11,9 +11,9 @@ import { BreadcrumbsItemColors } from '../../shared/colors/BreadcrumbsItemColors.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; export default { name: 'k-breadcrumbs-item', @@ -38,8 +38,10 @@ default: false, }, }, - setup(props, ctx) { + setup(props) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const colors = computed(() => BreadcrumbsItemColors(props.colors, useDarkClasses) ); diff --git a/src/vue/components/BreadcrumbsSeparator.vue b/src/vue/components/BreadcrumbsSeparator.vue index 930e71bb..9f08a3f4 100644 --- a/src/vue/components/BreadcrumbsSeparator.vue +++ b/src/vue/components/BreadcrumbsSeparator.vue @@ -8,7 +8,7 @@ import { BreadcrumbsSeparatorClasses } from '../../shared/classes/BreadcrumbsSeparatorClasses.js'; import { useContext } from '../shared/use-context.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import ChevronIcon from './icons/ChevronIcon.vue'; export default { @@ -30,6 +30,7 @@ }, setup(props) { const context = useContext(); + const useThemeClasses = themeClasses(context); const c = useThemeClasses(props, () => BreadcrumbsSeparatorClasses(props) ); diff --git a/src/vue/components/Button.vue b/src/vue/components/Button.vue index 183917e8..fbae5290 100644 --- a/src/vue/components/Button.vue +++ b/src/vue/components/Button.vue @@ -18,11 +18,11 @@ import { useTouchRipple } from '../shared/use-touch-ripple.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import { useTheme } from '../shared/use-theme.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; import { ButtonClasses } from '../../shared/classes/ButtonClasses.js'; @@ -169,6 +169,8 @@ }, setup(props, ctx) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const rippleElRef = ref(null); const Component = computed(() => { let c = props.component; @@ -183,7 +185,7 @@ useTouchRipple(rippleElRef, props, { context }); - const theme = useTheme(context); + const theme = useTheme({}, context); const isOutline = computed(() => typeof props.outline === 'undefined' diff --git a/src/vue/components/Card.vue b/src/vue/components/Card.vue index 8ec35f82..5965b1d9 100644 --- a/src/vue/components/Card.vue +++ b/src/vue/components/Card.vue @@ -18,11 +18,11 @@ import { computed } from 'vue'; import { useContext } from '../shared/use-context.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; import { useTheme } from '../shared/use-theme.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import { CardClasses } from '../../shared/classes/CardClasses.js'; @@ -63,11 +63,13 @@ }, setup(props, ctx) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const colors = computed(() => CardColors(props.colors || {}, useDarkClasses) ); - const theme = useTheme(context); + const theme = useTheme({}, context); const isOutline = computed(() => typeof props.outline === 'undefined' diff --git a/src/vue/components/Checkbox.vue b/src/vue/components/Checkbox.vue index d420cc95..235fefeb 100644 --- a/src/vue/components/Checkbox.vue +++ b/src/vue/components/Checkbox.vue @@ -31,9 +31,9 @@ import { CheckboxColors } from '../../shared/colors/CheckboxColors.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import { useTouchRipple } from '../shared/use-touch-ripple.js'; import CheckboxIcon from './icons/CheckboxIcon.vue'; @@ -71,6 +71,8 @@ emits: ['change'], setup(props, ctx) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const elRef = ref(null); const inputElRef = ref(null); diff --git a/src/vue/components/Chip.vue b/src/vue/components/Chip.vue index a77a34f2..c42e2bbf 100644 --- a/src/vue/components/Chip.vue +++ b/src/vue/components/Chip.vue @@ -21,11 +21,11 @@ import { ChipColors } from '../../shared/colors/ChipColors.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; import { useTheme } from '../shared/use-theme.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import DeleteIcon from './icons/DeleteIcon.vue'; export default { @@ -61,8 +61,10 @@ emits: ['delete'], setup(props, ctx) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const style = computed(() => (props.outline ? 'outline' : 'fill')); - const theme = useTheme(context); + const theme = useTheme({}, context); const colors = computed(() => ChipColors(props.colors || {}, useDarkClasses) diff --git a/src/vue/components/Dialog.vue b/src/vue/components/Dialog.vue index 8fe3852e..909f3124 100644 --- a/src/vue/components/Dialog.vue +++ b/src/vue/components/Dialog.vue @@ -18,9 +18,9 @@ import { DialogColors } from '../../shared/colors/DialogColors.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; export default { name: 'k-dialog', @@ -54,6 +54,8 @@ emits: ['backdropclick'], setup(props, ctx) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const state = computed(() => (props.opened ? 'opened' : 'closed')); const colors = computed(() => DialogColors(props.colors || {}, useDarkClasses) diff --git a/src/vue/components/DialogButton.vue b/src/vue/components/DialogButton.vue index 3b279d96..526e1cc4 100644 --- a/src/vue/components/DialogButton.vue +++ b/src/vue/components/DialogButton.vue @@ -25,11 +25,11 @@ import { computed } from 'vue'; import { useContext } from '../shared/use-context.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import { useTheme } from '../shared/use-theme.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; import { DialogButtonClasses } from '../../shared/classes/DialogButtonClasses.js'; @@ -67,8 +67,10 @@ }, setup(props) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const Component = computed(() => props.component); - const theme = useTheme(context); + const theme = useTheme({}, context); const isStrong = computed(() => typeof props.strong === 'undefined' diff --git a/src/vue/components/Fab.vue b/src/vue/components/Fab.vue index 5eb4bfa5..4b51b52a 100644 --- a/src/vue/components/Fab.vue +++ b/src/vue/components/Fab.vue @@ -29,11 +29,11 @@ import { FabColors } from '../../shared/colors/FabColors.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import { useTouchRipple } from '../shared/use-touch-ripple.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; export default { name: 'k-fab', @@ -60,6 +60,8 @@ }, setup(props, ctx) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const rippleElRef = ref(null); useTouchRipple(rippleElRef, props, { context }); diff --git a/src/vue/components/Icon.vue b/src/vue/components/Icon.vue index d39a0737..f88a7033 100644 --- a/src/vue/components/Icon.vue +++ b/src/vue/components/Icon.vue @@ -16,7 +16,7 @@ import { useContext } from '../shared/use-context.js'; import { useTheme } from '../shared/use-theme.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import kBadge from './Badge.vue'; import { IconClasses } from '../../shared/classes/IconClasses.js'; @@ -36,7 +36,8 @@ }, setup(props, ctx) { const context = useContext(); - const theme = useTheme(context); + const useThemeClasses = themeClasses(context); + const theme = useTheme({}, context); const c = useThemeClasses(props, () => IconClasses(props, ctx.attrs.class) diff --git a/src/vue/components/Link.vue b/src/vue/components/Link.vue index ac0e5eb6..bc33a97f 100644 --- a/src/vue/components/Link.vue +++ b/src/vue/components/Link.vue @@ -17,11 +17,11 @@ import { useTheme } from '../shared/use-theme.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import { useTouchRipple } from '../shared/use-touch-ripple.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; import { LinkClasses } from '../../shared/classes/LinkClasses.js'; @@ -60,8 +60,10 @@ }, setup(props, ctx) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const rippleElRef = ref(null); - const theme = useTheme(props); + const theme = useTheme(props, context); const needsTouchRipple = computed( () => diff --git a/src/vue/components/List.vue b/src/vue/components/List.vue index 1ade9ce7..6a54d801 100644 --- a/src/vue/components/List.vue +++ b/src/vue/components/List.vue @@ -15,9 +15,9 @@ import { ListColors } from '../../shared/colors/ListColors.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; import { useTheme } from '../shared/use-theme.js'; @@ -57,7 +57,9 @@ }, setup(props, ctx) { const context = useContext(); - const theme = useTheme(context); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); + const theme = useTheme({}, context); const hasDividers = computed(() => typeof props.dividers === 'undefined' diff --git a/src/vue/components/ListButton.vue b/src/vue/components/ListButton.vue index 632aa32a..ccf79f00 100644 --- a/src/vue/components/ListButton.vue +++ b/src/vue/components/ListButton.vue @@ -20,9 +20,9 @@ import { useTheme } from '../shared/use-theme.js'; - import { useThemeClasses } from '../shared/use-theme-classes.js'; + import { themeClasses } from '../shared/use-theme-classes.js'; - import { useDarkClasses } from '../shared/use-dark-classes.js'; + import { darkClasses } from '../shared/use-dark-classes.js'; import { useTouchRipple } from '../shared/use-touch-ripple.js'; @@ -60,6 +60,8 @@ }, setup(props, ctx) { const context = useContext(); + const useDarkClasses = darkClasses(context); + const useThemeClasses = themeClasses(context); const rippleElRef = ref(null); useTouchRipple(rippleElRef, props, { context }); @@ -71,7 +73,7 @@ ListButtonColors(props.colors || {}, useDarkClasses) ); - const theme = useTheme(props); + const theme = useTheme(props, context); const c = useThemeClasses(props, () => ListButtonClasses( diff --git a/src/vue/components/ListGroup.vue b/src/vue/components/ListGroup.vue index c42d2f2b..e7f02fd8 100644 --- a/src/vue/components/ListGroup.vue +++ b/src/vue/components/ListGroup.vue @@ -6,7 +6,6 @@