@explorer-1/html 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/.pre-commit-config.yaml +19 -0
  2. package/.stylelintcache +1 -0
  3. package/CHANGELOG.md +49 -0
  4. package/LICENSE +21 -0
  5. package/index.html +1202 -0
  6. package/package.json +55 -0
  7. package/postcss.config.js +7 -0
  8. package/src/assets/README.md +12 -0
  9. package/src/assets/fonts/README.md +12 -0
  10. package/src/assets/scss/styles.scss +1 -0
  11. package/src/components/AppBarInternal/AppBarInternal.js +102 -0
  12. package/src/components/BaseButton/BaseButton.js +115 -0
  13. package/src/components/BaseButton/BaseButton.stories.js +275 -0
  14. package/src/components/BaseImage/BaseImage.js +23 -0
  15. package/src/components/BaseImage/BaseImage.stories.js +85 -0
  16. package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.js +47 -0
  17. package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.stories.js +147 -0
  18. package/src/components/BaseLink/BaseLink.js +86 -0
  19. package/src/components/BaseLink/BaseLink.stories.js +114 -0
  20. package/src/components/FooterInternal/FooterInternal.js +156 -0
  21. package/src/components/FooterInternal/FooterInternal.stories.js +43 -0
  22. package/src/components/FooterInternal/FooterInternalContactList.js +30 -0
  23. package/src/components/HeaderInternal/HeaderInternal.docs.mdx +154 -0
  24. package/src/components/HeaderInternal/HeaderInternal.js +39 -0
  25. package/src/components/HeaderInternal/HeaderInternal.stories.js +64 -0
  26. package/src/components/Icons/IconArrow.js +20 -0
  27. package/src/components/Icons/IconCaret.js +19 -0
  28. package/src/components/Icons/IconClose.js +20 -0
  29. package/src/components/Icons/IconDownload.js +22 -0
  30. package/src/components/Icons/IconDropdown.js +19 -0
  31. package/src/components/Icons/IconExpand.js +20 -0
  32. package/src/components/Icons/IconExternal.js +19 -0
  33. package/src/components/Icons/IconMenu.js +20 -0
  34. package/src/components/Icons/IconNext.js +15 -0
  35. package/src/components/Icons/IconPrev.js +15 -0
  36. package/src/components/Icons/IconSearch.js +20 -0
  37. package/src/components/Icons/IconSocialEmail.js +20 -0
  38. package/src/components/Icons/IconSocialFacebook.js +20 -0
  39. package/src/components/Icons/IconSocialInstagram.js +23 -0
  40. package/src/components/Icons/IconSocialReddit.js +19 -0
  41. package/src/components/Icons/IconSocialTwitter.js +19 -0
  42. package/src/components/Icons/IconSocialYoutube.js +23 -0
  43. package/src/components/Icons/IconUser.js +16 -0
  44. package/src/components/LogoJPL/LogoJPL.docs.mdx +28 -0
  45. package/src/components/LogoJPL/LogoJPL.js +17 -0
  46. package/src/components/LogoJPL/LogoJPL.stories.js +40 -0
  47. package/src/components/MixinAnimationCaret/MixinAnimationCaret.js +42 -0
  48. package/src/components/MixinAnimationCaret/MixinAnimationCaret.stories.js +42 -0
  49. package/src/components/NavInternal/NavInternal.js +135 -0
  50. package/src/components/NavInternal/NavInternal.stories.js +68 -0
  51. package/src/components/NavInternal/NavInternalHighlight.js +64 -0
  52. package/src/components/NavInternal/NavInternalHighlight.stories.js +36 -0
  53. package/src/components/NavInternal/NavInternalPanel.js +88 -0
  54. package/src/components/NavInternal/NavInternalPanel.stories.js +248 -0
  55. package/src/components/NavInternal/NavInternalSection.js +47 -0
  56. package/src/components/NavInternal/NavInternalSection.stories.js +55 -0
  57. package/src/components/SearchInput/SearchInput.js +44 -0
  58. package/src/components/SearchInput/SearchInput.stories.js +30 -0
  59. package/src/main.js +6 -0
  60. package/stylelint.config.js +60 -0
  61. package/tailwind.config.js +19 -0
  62. package/tsconfig.json +23 -0
  63. package/vite.config.js +25 -0
@@ -0,0 +1,248 @@
1
+ import { NavInternalPanelTemplate } from './NavInternalPanel'
2
+
3
+ export default {
4
+ title: 'Internal Header/Elements/Panel',
5
+ excludeStories: /.*Data$/,
6
+ argTypes: {
7
+ title: {
8
+ type: { name: 'string', required: false },
9
+ description: 'The link text of the parent menu item for this panel.'
10
+ },
11
+ url: {
12
+ type: { name: 'string', required: false },
13
+ description: 'The link URL of the parent menu item for this panel.'
14
+ },
15
+ repeatInPanel: {
16
+ type: { name: 'boolean', required: false },
17
+ description:
18
+ 'Enable to display the parent menu item as a link at the top of this panel. This may be useful because top-level menu items with panels cannot be clicked on to go to their URL; clicking only opens and closes the panel.'
19
+ },
20
+ repeatedTitle: {
21
+ type: { name: 'string', required: false },
22
+ description:
23
+ 'When `repeatInPanel` is true, this property may be set to change the text of the parent menu item link in the panel. For example, if the parent menu item’s title is “Processes” and the panel has a subset of the most popular processes, you might want the parent menu item link to be “View all processes”'
24
+ },
25
+ highlights: {
26
+ type: { name: 'array', required: false },
27
+ description: 'This template is optimized for a maximum of 3 highlights.'
28
+ },
29
+ menuItems: {
30
+ type: { name: 'array', required: false },
31
+ description: 'Menu items, including nested menus.'
32
+ },
33
+ allowSectionBreaks: {
34
+ type: { name: 'boolean', required: false },
35
+ description:
36
+ 'If a nav [Section](/?path=/docs/global-layout-headers-for-internal-sites-elements-section--basic-heading) can flow into the next column (only applies if `allowSectionColumns` is `true`.',
37
+ table: {
38
+ defaultValue: { summary: 'true' }
39
+ }
40
+ },
41
+ allowSectionColumns: {
42
+ type: { name: 'boolean', required: false },
43
+ description:
44
+ 'If multiple columns should be used to display nav [Sections](/?path=/docs/global-layout-headers-for-internal-sites-elements-section--basic-heading). If set to `false`, all nav items will appear in a single column. Useful if you only have a couple items in the nav.',
45
+ table: {
46
+ defaultValue: { summary: 'true' }
47
+ }
48
+ }
49
+ },
50
+ parameters: {
51
+ viewMode: 'docs',
52
+ docs: {
53
+ description: {
54
+ component:
55
+ 'The contents of a mega-menu-style dropdown. Intended for use within the [Internal Header](https://nasa-jpl.github.io/explorer-1/?path=/docs/global-layout-headers-for-internal-sites--docs)'
56
+ }
57
+ },
58
+ html: {
59
+ root: '#storyRoot'
60
+ }
61
+ },
62
+ decorators: [(Story) => `<div id="storyRoot" class="NavInternal">${Story()}</div>`]
63
+ }
64
+
65
+ export const menuItemsData = [
66
+ {
67
+ title: 'Nam Cursus',
68
+ url: '#'
69
+ },
70
+ {
71
+ title: 'Pellentesque Iaculis Vel',
72
+ url: '#'
73
+ },
74
+ {
75
+ title: 'In Bibendum Imperdiet Mauris',
76
+ url: '#'
77
+ },
78
+ {
79
+ title: 'Placerat Lorem',
80
+ url: '#'
81
+ },
82
+ {
83
+ title: 'Maecenas Viverra',
84
+ url: '#'
85
+ },
86
+ {
87
+ title: 'Suspendisse Vestibulum',
88
+ url: '#'
89
+ },
90
+ {
91
+ title: 'Nunc Tincidunt Gravida Vel',
92
+ url: '#'
93
+ },
94
+ {
95
+ title: 'Sed Placerat',
96
+ url: '#'
97
+ },
98
+ {
99
+ title: 'Donec Feugiat Eu',
100
+ url: '#'
101
+ }
102
+ ]
103
+
104
+ export const menuItemsNestedData = [
105
+ {
106
+ title: 'Section A',
107
+ url: '',
108
+ menuItems: [menuItemsData[0], menuItemsData[2], menuItemsData[3], menuItemsData[4]]
109
+ },
110
+ {
111
+ title: 'Section B',
112
+ url: '',
113
+ menuItems: [menuItemsData[5], menuItemsData[6], menuItemsData[1], menuItemsData[3]]
114
+ },
115
+ {
116
+ title: 'Section C',
117
+ url: '',
118
+ menuItems: [menuItemsData[7], menuItemsData[4]]
119
+ }
120
+ ]
121
+
122
+ export const NavInternalPanelBasicData = {
123
+ title: 'Basic',
124
+ url: '#',
125
+ repeatInPanel: false,
126
+ repeatedTitle: '',
127
+ highlights: [
128
+ {
129
+ title: 'Highlight',
130
+ description:
131
+ 'Quisque auctor blandit blandit. Etiam eu dolor enim. In id dui porttitor, efficitur leo et, ornare purus. Pellentesque eget malesuada tortor. Donec porta. '
132
+ }
133
+ ],
134
+ menuItems: [
135
+ {
136
+ title: 'Quisque ligula (active)',
137
+ url: '#',
138
+ isActive: true
139
+ },
140
+ ...menuItemsData
141
+ ],
142
+ allowSectionBreaks: true,
143
+ allowSectionColumns: true
144
+ }
145
+
146
+ export const NavInternalPanelNoHighlightsData = {
147
+ title: 'No Highlights',
148
+ url: '#',
149
+ repeatInPanel: true,
150
+ repeatedTitle: 'No Highlights Overview',
151
+ menuItems: menuItemsData
152
+ }
153
+
154
+ export const NavInternalPanelAllHighlightsData = {
155
+ title: 'All Highlights',
156
+ url: '#',
157
+ repeatInPanel: false,
158
+ repeatedTitle: '',
159
+ highlights: [
160
+ {
161
+ title: 'Highlight 1',
162
+ description:
163
+ 'Praesent in eros iaculis, pulvinar est ut, maximus nisl. Vestibulum rutrum accumsan.',
164
+ image: {
165
+ src: 'http://picsum.photos/512/288?random=1',
166
+ width: '512',
167
+ height: '288',
168
+ alt: 'Alt text'
169
+ },
170
+ link: '#',
171
+ ariaLabel: 'Go to Highlight 1'
172
+ },
173
+ {
174
+ title: 'Highlight 2',
175
+ description: 'Vivamus rutrum, nibh eu euismod imperdiet, elit ante dapibus risus, ut rutrum.',
176
+ image: {
177
+ src: 'http://picsum.photos/512/288?random=2',
178
+ width: '512',
179
+ height: '288',
180
+ alt: 'Alt text'
181
+ },
182
+ link: '#',
183
+ ariaLabel: 'Go to Highlight 2'
184
+ },
185
+ {
186
+ title: 'Highlight 3',
187
+ description: 'Aliquam nisi nisi, iaculis sed iaculis et, rutrum quis orci. Quisque maximus.',
188
+ image: {
189
+ src: 'http://picsum.photos/512/288?random=3',
190
+ width: '512',
191
+ height: '288',
192
+ alt: 'Alt text'
193
+ },
194
+ link: '#',
195
+ ariaLabel: 'Go to Highlight 3'
196
+ }
197
+ ]
198
+ }
199
+
200
+ export const NavInternalPanelWithHeadingsData = {
201
+ title: 'With Headings',
202
+ url: '#',
203
+ repeatInPanel: false,
204
+ repeatedTitle: '',
205
+ menuItems: menuItemsNestedData,
206
+ allowSectionBreaks: false
207
+ }
208
+
209
+ export const NavInternalPanelCombinationData = {
210
+ title: 'Combination',
211
+ url: '#',
212
+ repeatInPanel: false,
213
+ repeatedTitle: '',
214
+ highlights: [
215
+ {
216
+ title: 'Highlight',
217
+ description:
218
+ 'Praesent in eros iaculis, pulvinar est ut, maximus nisl. Vestibulum rutrum accumsan.',
219
+ image: {
220
+ src: 'http://picsum.photos/512/288?random=4',
221
+ width: '512',
222
+ height: '288',
223
+ alt: 'Alt text'
224
+ },
225
+ link: '#',
226
+ ariaLabel: 'Go to Highlight'
227
+ }
228
+ ],
229
+ menuItems: menuItemsNestedData,
230
+ allowSectionBreaks: true,
231
+ allowSectionColumns: true
232
+ }
233
+
234
+ export const Default = NavInternalPanelTemplate.bind({})
235
+ Default.storyName = 'Basic'
236
+ Default.args = NavInternalPanelBasicData
237
+
238
+ export const NoHighlights = NavInternalPanelTemplate.bind({})
239
+ NoHighlights.args = NavInternalPanelNoHighlightsData
240
+
241
+ export const AllHighlights = NavInternalPanelTemplate.bind({})
242
+ AllHighlights.args = NavInternalPanelAllHighlightsData
243
+
244
+ export const WithHeadings = NavInternalPanelTemplate.bind({})
245
+ WithHeadings.args = NavInternalPanelWithHeadingsData
246
+
247
+ export const Combination = NavInternalPanelTemplate.bind({})
248
+ Combination.args = NavInternalPanelCombinationData
@@ -0,0 +1,47 @@
1
+ import { BaseLinkTemplate } from '../BaseLink/BaseLink'
2
+ import { IconExternalTemplate } from '../Icons/IconExternal'
3
+
4
+ export const NavInternalSectionTemplate = ({ title, url, menuItems, isActive }) => {
5
+ // set defaults
6
+ if (!title) title = ''
7
+ if (!url) url = ''
8
+ if (!menuItems) menuItems = []
9
+ if (isActive == undefined) isActive = false
10
+
11
+ // derive other constants
12
+ const hasMenuItems = menuItems.length > 0 ? true : false
13
+
14
+ const headingTemplate = title
15
+ ? url
16
+ ? `<a href="${url}" class="inline-block w-full p-2 pl-0 text-action hover:text-action-dark ${
17
+ isActive ? ' active' : ''
18
+ } ${hasMenuItems ? 'text-subtitle' : ''}">
19
+ <span>
20
+ ${title}
21
+ </span>
22
+ ${url.startsWith('h') ? `${IconExternalTemplate({})}` : ''}
23
+ </a>`
24
+ : `<p class="text-subtitle inline-block w-full p-2 pl-0">${title}</p>`
25
+ : ''
26
+
27
+ let menuItemsTemplate = ''
28
+ if (hasMenuItems) {
29
+ menuItemsTemplate = '<ul class="group-menu">'
30
+ for (const [index, item] of menuItems.entries()) {
31
+ menuItemsTemplate += `<li>${BaseLinkTemplate({
32
+ variant: 'none',
33
+ linkClass: `inline-block w-full p-2 pl-0 ${item.isActive ? 'active' : ''}`,
34
+ text: item.title,
35
+ link: item.url,
36
+ icon: item.url.startsWith('h') ? 'external' : ''
37
+ })}</li>`
38
+ }
39
+ menuItemsTemplate += `</ul>`
40
+ }
41
+
42
+ return `<div class="NavInternalSection w-full ${hasMenuItems ? 'has-children' : ''}">
43
+ ${headingTemplate}
44
+ ${menuItemsTemplate}
45
+ </div>
46
+ `
47
+ }
@@ -0,0 +1,55 @@
1
+ import { NavInternalSectionTemplate } from './NavInternalSection'
2
+ import { menuItemsData, menuItemsNestedData } from './NavInternalPanel.stories'
3
+
4
+ export default {
5
+ title: 'Internal Header/Elements/Section',
6
+ excludeStories: /.*Data$/,
7
+ argTypes: {
8
+ title: {
9
+ type: { name: 'string', required: false },
10
+ description:
11
+ 'Name of the menu item. If populating nested menuItems, this will be converted to a heading.'
12
+ },
13
+ url: {
14
+ type: { name: 'string', required: false },
15
+ description:
16
+ 'Link for the menu item. If populating nested menuItems, this will used as a link in the heading.'
17
+ },
18
+ menuItems: {
19
+ type: { name: 'array', required: false },
20
+ description:
21
+ 'Optional array of nested menu items. If populated, the title and url above will be converted to a heading.'
22
+ }
23
+ },
24
+ parameters: {
25
+ viewMode: 'docs',
26
+ docs: {
27
+ description: {
28
+ component:
29
+ 'A flexible component that can accommodate a variety of menu item hierarchies. Usage can range from single-level menu items (one component per item) to a list of menu items with a linked heading. Intended for use within [NavInternalPanel](https://nasa-jpl.github.io/explorer-1/?path=/docs/global-layout-headers-for-internal-sites-elements-panel--basic) '
30
+ }
31
+ },
32
+ html: {
33
+ root: '#storyRoot'
34
+ }
35
+ },
36
+ decorators: [
37
+ (Story) =>
38
+ `<div class="NavInternal">
39
+ <div id="storyRoot" class="NavInternalPanel">
40
+
41
+ ${Story()}
42
+ </div>
43
+ </div>`
44
+ ]
45
+ }
46
+
47
+ export const Default = NavInternalSectionTemplate.bind({})
48
+ Default.storyName = 'Basic Heading'
49
+ Default.args = menuItemsNestedData[0]
50
+
51
+ export const WithHeadingLink = NavInternalSectionTemplate.bind({})
52
+ WithHeadingLink.args = { ...menuItemsNestedData[0], url: '#' }
53
+
54
+ export const SingleItem = NavInternalSectionTemplate.bind({})
55
+ SingleItem.args = { ...menuItemsData[0], menuItems: [] }
@@ -0,0 +1,44 @@
1
+ import { IconSearchTemplate } from '../Icons/IconSearch'
2
+
3
+ export const SearchInputTemplate = ({ inputId, placeholder, compact }) => {
4
+ if (!placeholder) placeholder = ''
5
+ if (compact == undefined) compact = false
6
+ const iconTemplate = IconSearchTemplate({})
7
+ const underlinedInputTemplate = compact
8
+ ? `
9
+ <div class="compact ml-14 h-2px absolute inset-x-0 bottom-0 overflow-hidden text-lg text-transparent">
10
+ <span class="border-jpl-red-light absolute z-20 h-0 border-b-2 select-none">
11
+ <!-- TODO: auto-update with input value using javascript -->
12
+ </span>
13
+ <span class="border-black/50 absolute inset-x-0 z-10 h-0 border-b-2 select-none"></span>
14
+ </div>
15
+ `
16
+ : ''
17
+
18
+ return `<div class="SearchInput group relative flex items-center ${
19
+ !compact ? 'border border-gray-mid' : ''
20
+ }">
21
+ <div class="absolute inset-0 flex items-center">
22
+ <span class="relative z-20 ml-6 text-xl ${compact ? 'text-black' : 'text-gray-mid'}">
23
+ ${iconTemplate}
24
+ </span>
25
+ </div>
26
+
27
+ ${underlinedInputTemplate}
28
+
29
+ <input
30
+ ${inputId ? `id="${inputId}"` : ''}
31
+ name="query"
32
+ class="pl-14 border-none relative z-10 w-full pr-5 text-lg text-gray-dark bg-transparent ${
33
+ compact
34
+ ? 'focus:outline-none py-1 focus:ring-transparent'
35
+ : 'focus:ring-opacity-50 focus:ring-2 py-4'
36
+ }"
37
+ type="search"
38
+ aria-label="Query"
39
+ placeholder="${placeholder}"
40
+ />
41
+ <input hidden type="submit" value="Search" />
42
+ </div>
43
+ `
44
+ }
@@ -0,0 +1,30 @@
1
+ import { SearchInputTemplate } from './SearchInput'
2
+
3
+ export default {
4
+ title: 'Components/Search/SearchInput',
5
+ argTypes: {
6
+ placeholder: {
7
+ type: { name: 'string', required: false }
8
+ }
9
+ },
10
+ parameters: {
11
+ viewMode: 'docs',
12
+ docs: {
13
+ description: {
14
+ component: 'Includes a stylized search icon and a darker border than standard form inputs.'
15
+ }
16
+ }
17
+ }
18
+ }
19
+
20
+ export const Default = SearchInputTemplate.bind({})
21
+ Default.storyName = 'SearchInput'
22
+ Default.args = {
23
+ placeholder: 'Search this site&hellip;'
24
+ }
25
+
26
+ export const Compact = SearchInputTemplate.bind({})
27
+ Compact.args = {
28
+ compact: true,
29
+ placeholder: 'Search this site&hellip;'
30
+ }
package/src/main.js ADDED
@@ -0,0 +1,6 @@
1
+ // Vite Entrypoint
2
+
3
+ // JavaScript
4
+ import '@explorer-1/common/src/js/scripts.js'
5
+ // CSS
6
+ import './assets/scss/styles.scss'
@@ -0,0 +1,60 @@
1
+ module.exports = {
2
+ extends: ['stylelint-config-standard-scss'],
3
+ // add your custom config here
4
+ // https://stylelint.io/user-guide/configuration
5
+ rules: {
6
+ 'at-rule-empty-line-before': [
7
+ 'always',
8
+ {
9
+ except: ['first-nested'],
10
+ ignore: ['after-comment', 'blockless-after-blockless'],
11
+ ignoreAtRules: ['apply']
12
+ }
13
+ ],
14
+ 'color-hex-length': 'long',
15
+ 'function-name-case': [
16
+ 'lower',
17
+ {
18
+ ignoreFunctions: ['pxToRem']
19
+ }
20
+ ],
21
+ 'import-notation': null,
22
+ 'keyframes-name-pattern': null,
23
+ 'no-descending-specificity': null,
24
+ 'no-invalid-double-slash-comments': null,
25
+ 'no-invalid-position-at-import-rule': [
26
+ true,
27
+ {
28
+ ignoreAtRules: ['use'] // Sass will not compile if `@use` is not before all other rules.
29
+ }
30
+ ],
31
+ 'scss/at-extend-no-missing-placeholder': null,
32
+ 'scss/at-function-pattern': null,
33
+ 'scss/at-rule-no-unknown': [
34
+ true,
35
+ {
36
+ // Ignore at-rules introduced by Tailwind and Sass via PostCSS.
37
+ ignoreAtRules: [
38
+ 'apply',
39
+ 'extend',
40
+ 'for',
41
+ 'function',
42
+ 'include',
43
+ 'layer',
44
+ 'mixin',
45
+ 'responsive',
46
+ 'return',
47
+ 'screen',
48
+ 'tailwind',
49
+ 'use',
50
+ 'variants'
51
+ ]
52
+ }
53
+ ],
54
+ 'scss/dollar-variable-pattern': null,
55
+ 'scss/double-slash-comment-empty-line-before': null,
56
+ 'selector-class-pattern': null,
57
+ 'selector-id-pattern': null
58
+ },
59
+ ignoreFiles: ['dist/**/*', 'node_modules/**/*']
60
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ ** TailwindCSS Configuration File
3
+ **
4
+ ** Docs: https://tailwindcss.com/docs/configuration
5
+ ** Default: https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js
6
+ */
7
+
8
+ // import explorer 1's tailwind config
9
+ import explorer1Config from '@explorer-1/common/tailwind.config'
10
+
11
+ export default {
12
+ ...explorer1Config,
13
+ content: [
14
+ './src/docs/**/*.{js,ts,mdx}',
15
+ './src/components/**/*.{js,ts,mdx}',
16
+ './src/assets/js/components/**/*.{js,ts,mdx}',
17
+ './../vue/src/components/**/*.vue'
18
+ ]
19
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+
16
+ /* Linting */
17
+ "strict": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "noFallthroughCasesInSwitch": true
21
+ },
22
+ "include": ["src"]
23
+ }
package/vite.config.js ADDED
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from 'vite'
2
+
3
+ // https://vitejs.dev/config/
4
+ export default defineConfig({
5
+ build: {
6
+ rollupOptions: {
7
+ output: {
8
+ assetFileNames: (assetInfo) => {
9
+ if (assetInfo.name === 'index.css') return 'assets/css/explorer-1.min.css'
10
+ if (assetInfo.name?.startsWith('ArchivoNarrow'))
11
+ return 'assets/fonts/archivo-narrow/[name].[ext]'
12
+ if (assetInfo.name?.startsWith('Metropolis'))
13
+ return 'assets/fonts/metropolis/[name].[ext]'
14
+ return 'assets/[name].[ext]'
15
+ },
16
+ entryFileNames: (assetInfo) => {
17
+ if (assetInfo.name === 'index') return 'assets/js/explorer-1.min.js'
18
+ return 'assets/js/[name].js'
19
+ },
20
+ chunkFileNames: 'assets/chunks/[name].js'
21
+ }
22
+ },
23
+ outDir: './../common/dist/'
24
+ }
25
+ })