Skip to content

Commit

Permalink
lint: round 1
Browse files Browse the repository at this point in the history
  • Loading branch information
azuradara committed Dec 21, 2024
1 parent 2bb3e00 commit f743f0e
Show file tree
Hide file tree
Showing 374 changed files with 6,983 additions and 5,578 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"release": "pnpm build && bumpp --commit \"[chore]: Release v\" --push --tag && pnpm -r release"
},
"devDependencies": {
"@youcan/lint": "^3.0.3",
"@youcan/lint": "^3.0.4",
"bumpp": "^9.9.1",
"eslint": "^9.17.0",
"eslint-plugin-format": "^0.1.3",
Expand Down
38 changes: 19 additions & 19 deletions packages/alto/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import path from 'path';
import Unocss from 'unocss/vite';
import path from 'node:path'
import Unocss from 'unocss/vite'

module.exports = {
"stories": [
"../src/**/*.stories.@(js|jsx|ts|tsx)"
stories: [
'../src/**/*.stories.@(js|jsx|ts|tsx)',
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@chromatic-com/storybook",
"storybook-addon-rtl"
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@chromatic-com/storybook',
'storybook-addon-rtl',
],
"framework": {
"name": "@storybook/vue3-vite",
"options": {}
framework: {
name: '@storybook/vue3-vite',
options: {},
},
"docs": {
autodocs: true
docs: {
autodocs: true,
},
async viteFinal(config, { configType }) {
config.resolve.alias['~'] = `${path.resolve(__dirname, 'src')}/`;
config.plugins.push(Unocss);
return config;
}
config.resolve.alias['~'] = `${path.resolve(__dirname, 'src')}/`
config.plugins.push(Unocss)
return config
},
}
6 changes: 3 additions & 3 deletions packages/alto/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'uno.css';
import '../src/assets/main.css';
import '@youcan/ui-core/tokens';
import 'uno.css'
import '../src/assets/main.css'
import '@youcan/ui-core/tokens'

export const parameters = {
controls: {
Expand Down
16 changes: 10 additions & 6 deletions packages/alto/src/_dev/App.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<script setup lang="ts">
import 'uno.css';
import '../assets/main.css';
import { ref } from 'vue';
import { DatePicker } from '~/components';
import { ref } from 'vue'
import { DatePicker } from '~/components'
import 'uno.css'
import '../assets/main.css'
const date = ref(null);
const date = ref(null)
</script>

<template>
<DatePicker v-model="date" always-show-calender :close-on-select="false" />
<DatePicker
v-model="date"
always-show-calender
:close-on-select="false"
/>
</template>

<style scoped>
Expand Down
12 changes: 6 additions & 6 deletions packages/alto/src/_dev/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createApp } from 'vue';
import App from './App.vue';
import 'uno.css';
import '@youcan/ui-core/tokens';
import { createApp } from 'vue'
import App from './App.vue'
import 'uno.css'
import '@youcan/ui-core/tokens'

const app = createApp(App, {});
const app = createApp(App, {})

app.mount('#app');
app.mount('#app')
4 changes: 2 additions & 2 deletions packages/alto/src/assets/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import './main.css';
import 'uno.css';
import './main.css'
import 'uno.css'
24 changes: 12 additions & 12 deletions packages/alto/src/components/Accordion/Accordion.stories.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import type { Meta, StoryObj } from '@storybook/vue3';
import { ref } from 'vue';
import { Accordion, AccordionItem } from '~/components';
import type { Meta, StoryObj } from '@storybook/vue3'
import { ref } from 'vue'
import { Accordion, AccordionItem } from '~/components'

type Story = StoryObj<typeof Accordion>;
type Story = StoryObj<typeof Accordion>
const meta: Meta<typeof Accordion> = {
title: 'Application/Accordion',
component: Accordion,
tags: ['accordion', 'toggle', 'collapse'],
argTypes: {
default: { table: { disable: true } },
},
};
}

export const Default: Story = {
render: () => ({
components: { Accordion, AccordionItem },
setup() {
const current = ref(-1);
const current = ref(-1)

function toggle(index: number) {
if (index === current.value) {
current.value = -1;
current.value = -1

return;
return
}

current.value = index;
current.value = index
}

return { current, toggle };
return { current, toggle }
},
template: `<Accordion>
<AccordionItem
Expand All @@ -43,6 +43,6 @@ export const Default: Story = {
</AccordionItem>
</Accordion>`,
}),
};
}

export default meta;
export default meta
14 changes: 7 additions & 7 deletions packages/alto/src/components/Accordion/AccordionItem.stories.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from '@storybook/vue3';
import { AccordionItem } from '~/components';
import type { Meta, StoryObj } from '@storybook/vue3'
import { AccordionItem } from '~/components'

type Story = StoryObj<typeof AccordionItem>;
type Story = StoryObj<typeof AccordionItem>
const meta: Meta<typeof AccordionItem> = {
title: 'Application/Accordion/AccordionItem',
component: AccordionItem,
Expand All @@ -15,16 +15,16 @@ const meta: Meta<typeof AccordionItem> = {
disabled: false,
duration: 200,
},
};
}

export const Default: Story = {
render: args => ({
components: { AccordionItem },
setup() {
return { args };
return { args }
},
template: '<AccordionItem v-bind="args"> Placeholder for accordion text. </AccordionItem>',
}),
};
}

export default meta;
export default meta
45 changes: 25 additions & 20 deletions packages/alto/src/components/Accordion/AccordionItem.vue
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue';
import type { AccordionItemProps } from '~/types';
import type { AccordionItemProps } from '~/types'
import { computed, onMounted, ref } from 'vue'
const props = withDefaults(defineProps<AccordionItemProps>(), {
show: false,
duration: 200,
});
})
const emit = defineEmits(['toggle']);
const emit = defineEmits(['toggle'])
const content = ref();
const hide = ref(true);
const focus = ref(false);
const maxHeight = ref(`${400}px`);
const content = ref()
const hide = ref(true)
const focus = ref(false)
const maxHeight = ref(`${400}px`)
const durationFormat = computed(() => {
return `${props.duration}ms`;
});
return `${props.duration}ms`
})
const showCollapse = computed(() => (props.show || hide.value) && !props.disabled);
const focused = computed(() => focus.value && !props.disabled);
const showCollapse = computed(() => (props.show || hide.value) && !props.disabled)
const focused = computed(() => focus.value && !props.disabled)
function toggle() {
if (props.disabled) {
return;
return
}
emit('toggle');
emit('toggle')
}
onMounted(() => {
if (content.value) {
const mH = content.value.offsetHeight;
maxHeight.value = `${mH}px`;
const mH = content.value.offsetHeight
maxHeight.value = `${mH}px`
}
hide.value = false;
});
hide.value = false
})
</script>

<template>
<div
class="accordion-item" :class="[{ disabled }, { focused }]"
class="accordion-item"
:class="[{ disabled }, { focused }]"
@focusin="() => focus = true"
@focusout="() => focus = false"
>
Expand All @@ -48,7 +49,11 @@ onMounted(() => {
<i class="i-youcan-carret-down" :class="{ rotate: showCollapse }" />
</button>
<Transition name="collapse">
<div v-if="showCollapse" class="collapse" :class="{ hide }">
<div
v-if="showCollapse"
class="collapse"
:class="{ hide }"
>
<div ref="content" class="content">
<slot />
</div>
Expand Down
18 changes: 9 additions & 9 deletions packages/alto/src/components/Alert/Alert.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Meta, StoryObj } from '@storybook/vue3';
import { ref } from 'vue';
import Alert from './Alert.vue';
import type { Meta, StoryObj } from '@storybook/vue3'
import { ref } from 'vue'
import Alert from './Alert.vue'

type Story = StoryObj<typeof Alert>;
type Story = StoryObj<typeof Alert>
const meta: Meta<typeof Alert> = {
title: 'Application/Alert',
component: Alert,
Expand All @@ -20,15 +20,15 @@ const meta: Meta<typeof Alert> = {
closeAfterDuration: 5000,
canClose: true,
},
};
}

export const Default: Story = {
render: args => ({
components: { Alert },
setup() {
const show = ref(true);
const show = ref(true)

return { args, show };
return { args, show }
},
template: `
<Alert v-if="show" v-bind="args" @close="show = false">
Expand All @@ -41,6 +41,6 @@ export const Default: Story = {
</Alert>
`,
}),
};
}

export default meta;
export default meta
Loading

0 comments on commit f743f0e

Please sign in to comment.