Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: propagate types to downstream projects #63

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/NeExpandable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons'
import { onMounted, ref, watch } from 'vue'
import { NeButton } from '@/main'
import NeButton from './NeButton.vue'

const props = defineProps({
label: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/NeFileInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { computed } from 'vue'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { faFileArrowUp } from '@fortawesome/free-solid-svg-icons'
import NeProgressBar from '@/components/NeProgressBar.vue'
import NeProgressBar from './NeProgressBar.vue'

interface FileInputProps {
modelValue?: File | File[] | null
Expand Down Expand Up @@ -107,7 +107,7 @@ const dragOverHandler = (event: Event) => {
{{ dropZoneText }}
</p>
</div>
<input class="hidden" type="file" :accept="accept" />
<input :accept="accept" class="hidden" type="file" />
<!-- progress bar -->
<NeProgressBar
v-if="showProgress"
Expand Down
2 changes: 1 addition & 1 deletion src/components/NePaginator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { range } from 'lodash-es'
import { faChevronLeft as fasChevronLeft } from '@fortawesome/free-solid-svg-icons'
import { faChevronRight as fasChevronRight } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { NeListbox } from '@/main'
import NeListbox from './NeListbox.vue'

export type NePaginatorProps = {
currentPage: number
Expand Down
2 changes: 1 addition & 1 deletion src/components/NeRadioSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { type PropType, type Ref, ref, watch } from 'vue'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faCircleCheck } from '@fortawesome/free-solid-svg-icons'
import NeFormItemLabel from '@/components/NeFormItemLabel.vue'
import NeFormItemLabel from './NeFormItemLabel.vue'

export type RadioCardSize = 'md' | 'lg' | 'xl'

Expand Down
4 changes: 2 additions & 2 deletions src/components/NeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import NeTableSkeleton from './NeTableSkeleton.vue'
export type Breakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl'

const props = defineProps({
ariaLabel: {
label: {
type: String,
required: true
},
Expand Down Expand Up @@ -46,7 +46,7 @@ const tableCardStyle: Record<Breakpoint, string> = {
<div class="overflow-x-auto rounded-lg border border-gray-300 shadow-sm dark:border-gray-600">
<table
role="grid"
:aria-label="ariaLabel"
:aria-label="label"
:class="[
`grid w-full table-auto bg-white text-left text-sm font-normal text-gray-700 dark:bg-gray-950 dark:text-gray-200`,
tableCardStyle[cardBreakpoint]
Expand Down
2 changes: 1 addition & 1 deletion src/components/NeToastNotification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { faXmark as fasXmark } from '@fortawesome/free-solid-svg-icons'
import { library } from '@fortawesome/fontawesome-svg-core'
import { humanDistanceToNowLoc, formatDateLoc } from '../main'
import { humanDistanceToNowLoc, formatDateLoc } from '../lib/dateTime'
import NeButton from './NeButton.vue'
import NeRoundedIcon from './NeRoundedIcon.vue'
import NeTooltip from './NeTooltip.vue'
Expand Down
88 changes: 44 additions & 44 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
// style export
import '@/main.css'
import './main.css'

// components export
export { default as NeSkeleton } from '@/components/NeSkeleton.vue'
export { default as NeSpinner } from '@/components/NeSpinner.vue'
export { default as NeExpandable } from '@/components/NeExpandable.vue'
export { default as NeProgressBar } from '@/components/NeProgressBar.vue'
export { default as NeFileInput } from '@/components/NeFileInput.vue'
export { default as NeInlineNotification } from '@/components/NeInlineNotification.vue'
export { default as NeRoundedIcon } from '@/components/NeRoundedIcon.vue'
export { default as NeSideDrawer } from '@/components/NeSideDrawer.vue'
export { default as NeTooltip } from '@/components/NeTooltip.vue'
export { default as NeBadge } from '@/components/NeBadge.vue'
export { default as NeButton } from '@/components/NeButton.vue'
export { default as NeCheckbox } from '@/components/NeCheckbox.vue'
export { default as NeTable } from '@/components/NeTable.vue'
export { default as NeTableHead } from '@/components/NeTableHead.vue'
export { default as NeTableHeadCell } from '@/components/NeTableHeadCell.vue'
export { default as NeTableBody } from '@/components/NeTableBody.vue'
export { default as NeTableRow } from '@/components/NeTableRow.vue'
export { default as NeTableCell } from '@/components/NeTableCell.vue'
export { default as NeCombobox } from '@/components/NeCombobox.vue'
export { default as NeDropdown } from '@/components/NeDropdown.vue'
export { default as NeCard } from '@/components/NeCard.vue'
export { default as NeLink } from '@/components/NeLink.vue'
export { default as NeFormItemLabel } from '@/components/NeFormItemLabel.vue'
export { default as NeRadioSelection } from '@/components/NeRadioSelection.vue'
export { default as NePaginator } from '@/components/NePaginator.vue'
export { default as NeEmptyState } from '@/components/NeEmptyState.vue'
export { default as NeTabs } from '@/components/NeTabs.vue'
export { default as NeTextArea } from '@/components/NeTextArea.vue'
export { default as NeTextInput } from '@/components/NeTextInput.vue'
export { default as NeToggle } from '@/components/NeToggle.vue'
export { default as NeToastNotification } from '@/components/NeToastNotification.vue'
export { default as NeModal } from '@/components/NeModal.vue'
export { default as NeHeading } from '@/components/NeHeading.vue'
export { default as NeListbox } from '@/components/NeListbox.vue'
export { default as NeSkeleton } from './components/NeSkeleton.vue'
export { default as NeSpinner } from './components/NeSpinner.vue'
export { default as NeExpandable } from './components/NeExpandable.vue'
export { default as NeProgressBar } from './components/NeProgressBar.vue'
export { default as NeFileInput } from './components/NeFileInput.vue'
export { default as NeInlineNotification } from './components/NeInlineNotification.vue'
export { default as NeRoundedIcon } from './components/NeRoundedIcon.vue'
export { default as NeSideDrawer } from './components/NeSideDrawer.vue'
export { default as NeTooltip } from './components/NeTooltip.vue'
export { default as NeBadge } from './components/NeBadge.vue'
export { default as NeButton } from './components/NeButton.vue'
export { default as NeCheckbox } from './components/NeCheckbox.vue'
export { default as NeTable } from './components/NeTable.vue'
export { default as NeTableHead } from './components/NeTableHead.vue'
export { default as NeTableHeadCell } from './components/NeTableHeadCell.vue'
export { default as NeTableBody } from './components/NeTableBody.vue'
export { default as NeTableRow } from './components/NeTableRow.vue'
export { default as NeTableCell } from './components/NeTableCell.vue'
export { default as NeCombobox } from './components/NeCombobox.vue'
export { default as NeDropdown } from './components/NeDropdown.vue'
export { default as NeCard } from './components/NeCard.vue'
export { default as NeLink } from './components/NeLink.vue'
export { default as NeFormItemLabel } from './components/NeFormItemLabel.vue'
export { default as NeRadioSelection } from './components/NeRadioSelection.vue'
export { default as NePaginator } from './components/NePaginator.vue'
export { default as NeEmptyState } from './components/NeEmptyState.vue'
export { default as NeTabs } from './components/NeTabs.vue'
export { default as NeTextArea } from './components/NeTextArea.vue'
export { default as NeTextInput } from './components/NeTextInput.vue'
export { default as NeToggle } from './components/NeToggle.vue'
export { default as NeToastNotification } from './components/NeToastNotification.vue'
export { default as NeModal } from './components/NeModal.vue'
export { default as NeHeading } from './components/NeHeading.vue'
export { default as NeListbox } from './components/NeListbox.vue'

// types export
export type { NeComboboxOption } from '@/components/NeCombobox.vue'
export type { NePaginatorProps } from '@/components/NePaginator.vue'
export type { Tab } from '@/components/NeTabs.vue'
export type { NeNotification } from '@/components/NeToastNotification.vue'
export type { NeListboxOption } from '@/components/NeListbox.vue'
export type { NeComboboxOption } from './components/NeCombobox.vue'
export type { NePaginatorProps } from './components/NePaginator.vue'
export type { Tab } from './components/NeTabs.vue'
export type { NeNotification } from './components/NeToastNotification.vue'
export type { NeListboxOption } from './components/NeListbox.vue'

// library functions export
export {
Expand All @@ -52,22 +52,22 @@ export {
byteFormat1024,
byteFormat1000,
kbpsFormat
} from '@/lib/utils'
} from './lib/utils'
export {
formatDateLoc,
formatInTimeZoneLoc,
getDateFnsLocale,
formatDurationLoc,
humanDistanceToNowLoc
} from '@/lib/dateTime'
} from './lib/dateTime'
export {
saveToStorage,
getJsonFromStorage,
getStringFromStorage,
deleteFromStorage,
savePreference,
getPreference
} from '@/lib/storage'
} from './lib/storage'

// composables export
export { useItemPagination } from '@/composables/useItemPagination'
export { useItemPagination } from './composables/useItemPagination'
5 changes: 1 addition & 4 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"compilerOptions": {
"composite": true,
"baseUrl": ".",
"outDir": "dist",
"paths": {
"@/*": ["./src/*"]
}
"outDir": "dist"
}
}
9 changes: 1 addition & 8 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
Expand Down Expand Up @@ -38,10 +36,5 @@ export default defineConfig({
}
}
},
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
plugins: [vue()]
})