Skip to content

Commit

Permalink
refactor: removed unwanted uno-layer-base
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Jan 4, 2023
1 parent 4e53e40 commit 55a2478
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions packages/anu-vue/src/components/card/ACard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ const _isTypographyUsed = isTypographyUsed(toRefs(props), slots)
// Modify text prop to have `text-sm`
const _textProp = useConfigurable(toRef(props, 'text'))
if (_textProp.value.classes === undefined)
_textProp.value.classes = 'uno-layer-base-text-sm'
_textProp.value.classes = 'text-sm'
else if (Array.isArray(_textProp.value.classes))
_textProp.value.classes = [..._textProp.value.classes, 'uno-layer-base-text-sm']
_textProp.value.classes = [..._textProp.value.classes, 'text-sm']
else
_textProp.value.classes = ' uno-layer-base-text-sm'
_textProp.value.classes = ' text-sm'
</script>

<template>
<div
class="a-card overflow-hidden uno-layer-base-bg-[hsl(var(--a-layer))]"
class="a-card overflow-hidden bg-[hsl(var(--a-layer))]"
:class="classes"
:style="[
...styles,
Expand Down
2 changes: 1 addition & 1 deletion packages/anu-vue/src/components/dialog/ADialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ useDOMScrollLock(toRef(props, 'modelValue') as Ref<boolean>)
<Transition name="bg">
<div
v-show="props.modelValue"
class="a-dialog-wrapper grid uno-layer-base-place-items-center fixed uno-layer-base-inset-0 bg-[hsla(var(--a-overlay-color),var(--a-overlay-opacity))]"
class="a-dialog-wrapper grid place-items-center fixed inset-0 bg-[hsla(var(--a-overlay-color),var(--a-overlay-opacity))]"
>
<Transition name="scale">
<ACard
Expand Down
2 changes: 1 addition & 1 deletion packages/anu-vue/src/components/drawer/ADrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ useDOMScrollLock(toRef(props, 'modelValue') as Ref<boolean>)
<Transition name="bg">
<div
v-show="props.modelValue"
class="a-drawer-wrapper flex fixed uno-layer-base-inset-0 bg-[hsla(var(--a-overlay-color),var(--a-overlay-opacity))]"
class="a-drawer-wrapper flex fixed inset-0 bg-[hsla(var(--a-overlay-color),var(--a-overlay-opacity))]"
:class="[
`a-drawer-anchor-${props.anchor}`,
// `flex-col` set full width for top & bottom anchored drawer
Expand Down
8 changes: 4 additions & 4 deletions packages/anu-vue/src/components/list-item/AListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const { getLayerClasses } = useLayer()
// 鈩癸笍 Reduce the size of title to 1rem. We did the same in ACard as well.
const _titleProp = useConfigurable(props.title)
if (Array.isArray(_titleProp.value.classes))
_titleProp.value.classes = [..._titleProp.value.classes, 'uno-layer-base-text-base']
_titleProp.value.classes = [..._titleProp.value.classes, 'text-base']
else
_titleProp.value.classes += ' uno-layer-base-text-base'
_titleProp.value.classes += ' text-base'
// useLayer
const { styles, classes } = getLayerClasses(
Expand All @@ -52,7 +52,7 @@ const { styles, classes } = getLayerClasses(
<slot name="prepend">
<i
v-if="props.icon && !props.iconAppend"
class="uno-layer-base-text-xl"
class="text-xl"
:class="props.icon"
@click="$emit('click:icon')"
/>
Expand All @@ -77,7 +77,7 @@ const { styles, classes } = getLayerClasses(
<slot name="append">
<i
v-if="props.icon && props.iconAppend"
class="uno-layer-base-text-xl"
class="text-xl"
:class="props.icon"
@click="$emit('click:iconAppend')"
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/anu-vue/src/components/switch/ASwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const dotPosition = computed(() => {
<template>
<label
:for="elementId"
class="a-switch a-switch cursor-pointer uno-layer-base-rounded-full justify-between items-center"
class="a-switch a-switch cursor-pointer rounded-full justify-between items-center"
:class="[
props.label || $slots.default
? 'flex'
Expand Down
8 changes: 4 additions & 4 deletions packages/anu-vue/src/components/typography/ATypography.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const text = useConfigurable(toRef(props, 'text'))
</script>

<template>
<div class="uno-layer-base-text-base gap-4 flex flex-col">
<div class="text-base gap-4 flex flex-col">
<!-- SECTION Typography header -->
<div
v-if="$slots.title || props.title || $slots.subtitle || props.subtitle || $slots['header-right']"
Expand All @@ -26,7 +26,7 @@ const text = useConfigurable(toRef(props, 'text'))
:is="props.titleTag"
v-if="(Array.isArray(props.title) ? props.title[0] : props.title) || $slots.title"
v-bind="title.attrs"
class="a-typography-title font-medium block em:uno-layer-base-text-lg uno-layer-base-text-[hsla(var(--a-typography-title-color),var(--a-typography-title-opacity))]"
class="a-typography-title font-medium block em:text-lg text-[hsla(var(--a-typography-title-color),var(--a-typography-title-opacity))]"
:class="[title.classes]"
>
<slot name="title">
Expand All @@ -39,7 +39,7 @@ const text = useConfigurable(toRef(props, 'text'))
:is="props.subtitleTag"
v-if="(Array.isArray(props.subtitle) ? props.subtitle[0] : props.subtitle) || $slots.subtitle"
v-bind="subtitle.attrs"
class="a-typography-subtitle block em:uno-layer-base-text-sm uno-layer-base-text-[hsla(var(--a-typography-subtitle-color),var(--a-typography-subtitle-opacity))]"
class="a-typography-subtitle block em:text-sm text-[hsla(var(--a-typography-subtitle-color),var(--a-typography-subtitle-opacity))]"
:class="[subtitle.classes]"
>
<slot name="subtitle">
Expand All @@ -57,7 +57,7 @@ const text = useConfigurable(toRef(props, 'text'))
:is="props.textTag"
v-if="(Array.isArray(props.text) ? props.text[0] : props.text) || $slots.text"
v-bind="text.attrs"
class="a-typography-text uno-layer-base-text-[hsla(var(--a-typography-text-color),var(--a-typography-text-opacity))]"
class="a-typography-text text-[hsla(var(--a-typography-text-color),var(--a-typography-text-opacity))]"
:class="[text.classes]"
>
<slot>
Expand Down
2 changes: 1 addition & 1 deletion packages/anu-vue/src/composables/useLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const useLayer = () => {
if (propVariant === 'light')
classes.push('bg-$a-layer-color bg-opacity-15')
if (propVariant === 'outline')
classes.push('border-width-1 uno-layer-base-border-solid border-$a-layer-color')
classes.push('border-width-1 border-solid border-$a-layer-color')
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/anu-vue/test/__snapshots__/ATable.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Vitest Snapshot v1

exports[`Testing ATable & ADataTable > mount component 1`] = `
"<div class=\\"a-card overflow-hidden uno-layer-base-bg-[hsl(var(--a-layer))] a-table a-data-table\\" style=\\"--a-spacing: 1;\\">
"<div class=\\"a-card overflow-hidden bg-[hsl(var(--a-layer))] a-table a-data-table\\" style=\\"--a-spacing: 1;\\">
<!-- 馃憠 Image -->
<!--v-if-->
<!-- 馃憠 Typography -->
Expand Down Expand Up @@ -37,13 +37,13 @@ exports[`Testing ATable & ADataTable > mount component 1`] = `
</table>
</div>
<div class=\\"a-data-table-pagination flex items-center w-full\\">
<div class=\\"uno-layer-base-text-base gap-4 flex flex-col a-data-table-pagination-meta\\">
<div class=\\"text-base gap-4 flex flex-col a-data-table-pagination-meta\\">
<!-- SECTION Typography header -->
<div class=\\"flex justify-between\\">
<div class=\\"flex-grow\\">
<!-- 馃憠 Title -->
<!--v-if-->
<!-- 馃憠 Subtitle --><span class=\\"a-typography-subtitle block em:uno-layer-base-text-sm uno-layer-base-text-[hsla(var(--a-typography-subtitle-color),var(--a-typography-subtitle-opacity))]\\">1 - 5 of 10</span>
<!-- 馃憠 Subtitle --><span class=\\"a-typography-subtitle block em:text-sm text-[hsla(var(--a-typography-subtitle-color),var(--a-typography-subtitle-opacity))]\\">1 - 5 of 10</span>
</div><!-- 馃憠 Slot: header-right -->
</div><!-- !SECTION -->
<!-- 馃憠 Text -->
Expand Down
12 changes: 6 additions & 6 deletions packages/preset-theme-default/src/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const shortcuts: Exclude<Preset['shortcuts'], undefined | StaticShortcutMap> = [
/^a-drawer-anchor-(left|right|top|bottom)$/,
([, dir]) => {
const classes = dir === 'left' || dir === 'right'
? 'uno-layer-base-w-[300px] max-w-[calc(100vw-2rem)]'
: 'uno-layer-base-h-[300px] max-h-[calc(100vh-2rem)]'
? 'w-[300px] max-w-[calc(100vw-2rem)]'
: 'h-[300px] max-h-[calc(100vh-2rem)]'

return `children-[.a-drawer]-(${classes})`
},
Expand All @@ -41,11 +41,11 @@ const shortcuts: Exclude<Preset['shortcuts'], undefined | StaticShortcutMap> = [
'a-alert': 'em:spacing:p-4 font-medium em:spacing:rounded-lg em:spacing:gap-x-2',

// 馃憠 Avatar
'a-avatar': 'uno-layer-base-text-2xl em:spacing:h-8 em:spacing:w-8 uno-layer-base-rounded-full',
'a-avatar': 'text-2xl em:spacing:h-8 em:spacing:w-8 rounded-full',

// 馃憠 Badge
// with text-xs, 1.6666666667em => 20px
'a-badge': 'em:spacing:px-[0.3333333333em] rounded-full spacing:h-[1.6666666667em] spacing:min-w-[1.6666666667em] flex justify-center items-center uno-layer-base-text-white em:uno-layer-base-text-xs uno-layer-base-font-medium z-[1] whitespace-nowrap',
'a-badge': 'em:spacing:px-[0.3333333333em] rounded-full spacing:h-[1.6666666667em] spacing:min-w-[1.6666666667em] flex justify-center items-center text-white em:text-xs font-medium z-[1] whitespace-nowrap',
'a-badge-dot': 'spacing:min-w-[0.666666666666667em] spacing:h-[0.666666666666667em]',

// with text-xs, outline: 0.166666666666667em => 2px
Expand Down Expand Up @@ -93,7 +93,7 @@ const shortcuts: Exclude<Preset['shortcuts'], undefined | StaticShortcutMap> = [

// 馃憠 Dialog
'a-dialog-wrapper': 'z-[52]',
'a-dialog': 'shadow-2xl uno-layer-base-w-[500px] z-[53]',
'a-dialog': 'shadow-2xl w-[500px] z-[53]',

// 馃憠 Drawer
'a-drawer-wrapper': 'z-[52]',
Expand All @@ -114,7 +114,7 @@ const shortcuts: Exclude<Preset['shortcuts'], undefined | StaticShortcutMap> = [
'a-menu': 'z-[51] shadow-xl [--a-transition-slide-up-transform:10px]',

// 馃憠 Rating
'a-rating': 'uno-layer-base-text-xl',
'a-rating': 'text-xl',
'a-rating-animated': 'i:(transition-transform ease-in-out duration-250) hover:i:scale-125',
'a-rating-disabled': 'opacity-50',

Expand Down

0 comments on commit 55a2478

Please sign in to comment.