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

feat: new design #357

Draft
wants to merge 1,840 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1840 commits
Select commit Hold shift + click to select a range
a9dad71
feat: add pin toggler to project row actions
pirhoo Nov 19, 2024
126cd9c
feat: add mode computed
pirhoo Nov 19, 2024
1437b43
refactor: migrate to composition API
pirhoo Nov 19, 2024
b2ded48
refactor: migrate to composition API
pirhoo Nov 19, 2024
438b429
feat: filter out widget in wrong mode
pirhoo Nov 19, 2024
3744822
feat: add "modes" property to widget
pirhoo Nov 19, 2024
3bb16a0
feat: restrict recommendations widget to server mode
pirhoo Nov 19, 2024
8f56c4c
feat: restrict recommendations action to server mode
pirhoo Nov 19, 2024
83ba7bf
refactor: lint
pirhoo Nov 19, 2024
ea9071e
feat: add thresholds to separator line
pirhoo Nov 19, 2024
33594ae
feat: ensure the different parts of the entries list are visible
pirhoo Nov 19, 2024
e3e4d74
refactor: lint
pirhoo Nov 19, 2024
f1e3f5b
refactor: use watchQuery
pirhoo Nov 19, 2024
698ae9f
feat: add function to diff objects
pirhoo Nov 20, 2024
c38213a
feat: create store for search breadcrumb
pirhoo Nov 20, 2024
c106875
feat: save new queries in breadcrumb store
pirhoo Nov 20, 2024
1dcead7
build: configure resolvers and auto import for phosphor icons
pirhoo Nov 20, 2024
ed80d1d
build: disable dts
pirhoo Nov 20, 2024
bc067a5
fix: use correct icons import
pirhoo Nov 20, 2024
3c59b83
build: disable dts files
pirhoo Nov 20, 2024
cecd8e9
doc: update props and use value
pirhoo Nov 20, 2024
5f90179
fix: add missing imports
pirhoo Nov 20, 2024
93b02c8
refactor: use Phosphor Icon auto import
pirhoo Nov 21, 2024
bacc894
refactor: use phopshor component as icon
pirhoo Nov 21, 2024
17fbd1c
fix: watch route query, not search query
pirhoo Nov 21, 2024
cab4958
refactor: lint
pirhoo Nov 21, 2024
a6e5645
feat: add sort and order on task slot
caro3801 Nov 19, 2024
230f391
fix: update task setting label
caro3801 Nov 19, 2024
00f382e
feat: add task empty state label and no results
caro3801 Nov 19, 2024
24c663f
feat: add disabled option
caro3801 Nov 20, 2024
84be46b
feat: set settings per tasks and make them reactive
caro3801 Nov 21, 2024
7426b73
feat: order properties
caro3801 Nov 21, 2024
78c0fa0
fix: use value variant to display status title properly
caro3801 Nov 21, 2024
9e7eb1f
feat: add column icon
caro3801 Nov 21, 2024
271c3a4
feat: retrieve properties from store
caro3801 Nov 21, 2024
4d3df1e
fix: flat task array
caro3801 Nov 28, 2024
8042a8f
feat: watch project changes in url
caro3801 Nov 28, 2024
2aa1231
fix: remove logs
caro3801 Nov 28, 2024
ed967ac
style: add bottom spacing on expanded filter section
caro3801 Nov 29, 2024
3d0b7d1
feat: create a path composable
caro3801 Nov 29, 2024
e60a70b
feat: add multiple selection and elastic search path restriction with…
caro3801 Nov 29, 2024
fe88441
feat: add multiple selection and elastic search path restriction with…
caro3801 Nov 29, 2024
49b4ba2
feat: (wip) add batch search form
caro3801 Nov 29, 2024
06a0cf7
refactor: replace watchProjects by watchIndices to prevent confusion …
caro3801 Dec 2, 2024
e0b9a08
fix: remove unused attribute
caro3801 Dec 2, 2024
b4d342f
feat: add filters for batch search (wip)
caro3801 Dec 2, 2024
cc2c88f
lint: clean up
caro3801 Dec 2, 2024
761c16b
feat: add visibility option
caro3801 Dec 2, 2024
fbbf4bd
fix: use correct icon
pirhoo Nov 21, 2024
d420ef8
feat: add missing variant
pirhoo Nov 22, 2024
fe653ff
fix: submit event prevent multiple times
pirhoo Nov 22, 2024
96c608e
refactor: remove comments
pirhoo Nov 22, 2024
4406db8
feat: stop catching route navigation error
pirhoo Nov 22, 2024
3a5d00b
feat: helper function to find the path of an object in another object
pirhoo Dec 2, 2024
81b23d1
refactor: remove unused mutation
pirhoo Dec 2, 2024
1cd58b4
feat: remove filter item and add function to cast item value
pirhoo Dec 2, 2024
780ed5e
refactor: remove useless condition
pirhoo Dec 2, 2024
fc603e1
refactor: use param destruct
pirhoo Dec 2, 2024
a8e297a
feat: do not save search count
pirhoo Dec 2, 2024
726cb52
feat: define events and use singular for query
pirhoo Dec 2, 2024
e60e21f
feat: add option to deactivate XIcon
pirhoo Dec 2, 2024
41906ae
fix: typo on "occurrences"
pirhoo Dec 2, 2024
fe9f379
feat: use PhMagnifyingGlass directly
pirhoo Dec 2, 2024
6bb89c2
feat: define click:x event
pirhoo Dec 2, 2024
df447df
feat: add props to hide footer features
pirhoo Dec 2, 2024
a9119ea
feat: define click:x event
pirhoo Dec 2, 2024
da3a37d
feat: define click:x event
pirhoo Dec 2, 2024
6c86b57
feat: use singular for query
pirhoo Dec 2, 2024
6f1d7f3
feat: add search-breadcrumb composable
pirhoo Dec 2, 2024
e549c4f
refactor: rename SearchBreadcrumb to SearchBreadcrumbForm
pirhoo Dec 2, 2024
76ffbb6
feat: add SearchBreadcrumb view
pirhoo Dec 2, 2024
4eae1d6
feat: add comosable to save search
pirhoo Dec 4, 2024
a1ac6e7
feat: pass along slot bindings
pirhoo Dec 4, 2024
b641c5c
feat: add search saving modal
pirhoo Dec 4, 2024
4d7bc8a
feat: add form validation
pirhoo Dec 4, 2024
70b7ace
fix: use body color for toaster
pirhoo Dec 4, 2024
3e429ab
i18n: add success/error keys for search saving
pirhoo Dec 4, 2024
f7959d8
refactor: use defineModel for collapse props
caro3801 Dec 6, 2024
8d49c94
feat: add form step to batch search
caro3801 Dec 6, 2024
ac8cd57
feat: update wording and radio buttons
caro3801 Dec 10, 2024
0ee401a
feat: add link to batch search result
caro3801 Dec 10, 2024
2a2946b
fix: styling
caro3801 Dec 10, 2024
78d8633
feat: add radio button with column description
caro3801 Dec 11, 2024
f5032ee
refactor: use attrs to pass on props
caro3801 Dec 12, 2024
c81a5d2
refactor: use v-model
caro3801 Dec 12, 2024
70db97c
fix: make header clickable only to open the step, else use only the b…
caro3801 Dec 12, 2024
1c3318c
refactor: rename FiltersPanelSectionFilterFooter to FiltersPanelSecti…
caro3801 Dec 12, 2024
1799f87
feat: add queries tab group
caro3801 Dec 12, 2024
6a39d7e
style: update flex properties to display either in title or footer
caro3801 Dec 12, 2024
8ac967b
feat: update batch form filters to display actions in title
caro3801 Dec 12, 2024
6cd20a8
feat: add initial values, reset options and form data inputs for subm…
caro3801 Dec 12, 2024
7d9ac1a
fix: hide title action on collapse filter
caro3801 Dec 13, 2024
7071434
fix: use value instead of ref
caro3801 Dec 16, 2024
bab312d
refactor: use v-model and defineModel to update range input
caro3801 Dec 16, 2024
d679083
feat: add hidden input for range to retrieve value in form data
caro3801 Dec 16, 2024
9162987
feat: create editable table to create batch queries
caro3801 Jan 6, 2025
09f0470
feat: add hidden form inputs
caro3801 Jan 6, 2025
f3e1b15
fix: reset selected path only if props OR store changes
caro3801 Jan 10, 2025
190304d
lint
caro3801 Jan 10, 2025
29acab6
fix: add top space for footer
caro3801 Jan 10, 2025
11bb779
fix: move extra padding to batch search form
caro3801 Jan 10, 2025
ffe466e
fix: wip batch search
caro3801 Jan 10, 2025
ce916bb
fix: update you tests
caro3801 Jan 10, 2025
75a9c73
fix: correct unmount method call in DocumentViewTabsMetadata tests
caro3801 Jan 10, 2025
5c16846
fix: restore correct spacing
pirhoo Jan 9, 2025
fcde80d
feat: use a single value for date range filter
pirhoo Jan 21, 2025
a74fd4a
refactor: remove trace
pirhoo Jan 21, 2025
711474e
feat: implement new date range filter
pirhoo Jan 21, 2025
f2e8b64
feat: add safer accessors
pirhoo Jan 21, 2025
a303e8b
fix: find filter even with exclude prefix
pirhoo Jan 21, 2025
68a295d
feat: add q model value to filters panel
pirhoo Jan 21, 2025
06d1fcf
feat: add filter's panel search
pirhoo Jan 21, 2025
000b0cb
test: repair tests
caro3801 Jan 14, 2025
32ab047
fix: remove broken ref and add cursor pointer to version number
caro3801 Jan 15, 2025
8b60406
fix: add allowed modes LOCAL and EMBEDDED on documents tasks
caro3801 Jan 15, 2025
bc43c61
refactor: rename class to match filename
caro3801 Jan 15, 2025
4da9b8f
fix: move delete project test to ProjectDeletionModal.spec.js
caro3801 Jan 15, 2025
1430f9e
fix: match tests with new markup
caro3801 Jan 16, 2025
07c9012
fix: update param name according to backend changes
caro3801 Jan 21, 2025
5153df6
refactor: inline code
caro3801 Jan 21, 2025
f6f565c
fix: use new label keys
caro3801 Jan 21, 2025
e83def3
fix: set i18n category key string to lowercase
caro3801 Jan 21, 2025
a122e70
fix: add entity link
caro3801 Jan 21, 2025
fa125bb
fix: add slot props to bind list entries
caro3801 Jan 21, 2025
e74ff91
feat: replace old code with entity section component
caro3801 Jan 21, 2025
4a388c2
feat: add category validator
caro3801 Jan 21, 2025
2887776
feat: keep "await" outside of a loop
caro3801 Jan 21, 2025
321a149
refactor: change props modelValue to model
caro3801 Jan 21, 2025
f6bd87b
feat: add project display
pirhoo Jan 21, 2025
6ebf4d3
refactor: lint
pirhoo Jan 21, 2025
31bd3ce
feat: add contextual document
pirhoo Jan 22, 2025
ce38cd1
feat: add document viewer modal
pirhoo Jan 22, 2025
411b243
feat: add word break to grid's title
pirhoo Jan 22, 2025
0b13995
fix: add missing components import
pirhoo Jan 22, 2025
bc5bd2e
refactor: delete unused components
pirhoo Jan 22, 2025
44c643e
refactor: lint
pirhoo Jan 22, 2025
b8b381a
refactor: delete unused components
pirhoo Jan 22, 2025
f02ab35
fix: new link to creationDate filter
pirhoo Jan 22, 2025
b459e62
refactor: use color variant composable for dynamic variant according …
pirhoo Jan 22, 2025
a4a5164
feat: refresh thumbnail and add auto
pirhoo Jan 22, 2025
220a42a
fix: correct thumbnail
pirhoo Jan 22, 2025
365152b
fix: use correct link
pirhoo Jan 22, 2025
88976d8
refactor: une provide/inject to detect modal
pirhoo Jan 23, 2025
e0f0a27
feat: use modal when search results list use full width
pirhoo Jan 23, 2025
8854bf0
refactor: remove debug output
pirhoo Jan 23, 2025
2318158
feat: handle parent resize
pirhoo Jan 23, 2025
5995fd3
feat: ensure full width is preserved on resize
pirhoo Jan 23, 2025
a9ee9d7
feat: adjust padding
pirhoo Jan 23, 2025
f58ba42
fix: use new date range format in test
caro3801 Jan 22, 2025
6cfd6b6
fix: update search filter values
caro3801 Jan 22, 2025
3837b9b
fix: add missing path to source to get the hit categorie's values
caro3801 Jan 23, 2025
0ca365d
feat: add tests on EntityButton
caro3801 Jan 23, 2025
5ea9e41
feat: add tests on FormControlSearch
caro3801 Jan 23, 2025
cdd93b3
fix: document view tab entities
caro3801 Jan 23, 2025
1a38bb3
fix: update tests to match component changes
caro3801 Jan 24, 2025
0ef1f6b
refactor: move path.js to utils
caro3801 Jan 24, 2025
6df7b82
feat: add phosphor icon min width to prevent visual jumps on load
caro3801 Jan 24, 2025
6e4784e
fix: change await by return
caro3801 Jan 24, 2025
9fdfc47
feat: add DocumentViewTabs props and tests
caro3801 Jan 24, 2025
5bb9ee1
feat: add keep alive on tabs
caro3801 Jan 24, 2025
bb85a89
fix: typo
caro3801 Jan 24, 2025
3463414
fix: update date range format
caro3801 Jan 24, 2025
c0d9962
fix: update props type
caro3801 Jan 24, 2025
bb60bb8
fix: remove log
caro3801 Jan 24, 2025
98b7b76
fix: udpate class names
caro3801 Jan 24, 2025
a8e359a
fix: reset floating start block when childs or siblings are added
pirhoo Jan 27, 2025
1caa84a
fix: use MODE_NAME enums everywhere
pirhoo Jan 27, 2025
263bfc5
feat: filter displayed filters by mode
pirhoo Jan 27, 2025
c658176
refactor: remove legacy Settings page
pirhoo Jan 27, 2025
ad3224c
refactor: format
pirhoo Jan 27, 2025
f4a6e96
refactor: remove never displayed alert
pirhoo Jan 27, 2025
b9d6e04
feat: filter out settings views not visible in server mode
pirhoo Jan 27, 2025
c1525e2
build: add Ph icons to no unused vars ignore pattern
pirhoo Jan 27, 2025
4791306
refactor: format
pirhoo Jan 27, 2025
fbaef7a
fix: add missing import
pirhoo Jan 27, 2025
4fe6b55
refactor: format
pirhoo Jan 27, 2025
f214e0e
refactor: remove commented code
pirhoo Jan 27, 2025
42e4572
refactor: format
pirhoo Jan 27, 2025
c683a5f
refactor: format
pirhoo Jan 27, 2025
11582af
feat: persit dismissable alert
pirhoo Jan 27, 2025
dfdf82c
feat: add redirect from tasks root
pirhoo Jan 27, 2025
4dd0f99
feat: add missing spacer
pirhoo Jan 27, 2025
772ac41
feat: add info icon to phosphor variant
caro3801 Jan 24, 2025
c9d4aab
fix: remove dead code
caro3801 Jan 24, 2025
792be5e
feat: add index path tests
caro3801 Jan 27, 2025
32e856b
feat: remove indexing store
caro3801 Jan 27, 2025
b488f91
feat: add task actions tests
caro3801 Jan 27, 2025
6a79bf0
fix: pass store and t as function instead of initiating inside compos…
caro3801 Jan 27, 2025
e040f80
Revert "feat: remove indexing store"
caro3801 Jan 27, 2025
b093f5e
feat: create task tests
caro3801 Jan 27, 2025
bc3668e
fix: restore indexing tests
caro3801 Jan 27, 2025
899e0e6
fix: remove unused imports
caro3801 Jan 27, 2025
f9c6353
feat: add tests to task.vue
caro3801 Jan 27, 2025
68b4b68
fix: add reset and update namings
caro3801 Jan 28, 2025
9ddd7a9
fix: add braces on event function to spy on it
caro3801 Jan 28, 2025
170b263
fix: uses doc from the store instead of prop in document view
caro3801 Jan 28, 2025
ddeaf92
fix: use shallow mount and component attributes
caro3801 Jan 28, 2025
0979c6d
feat: harmonize variant
pirhoo Jan 28, 2025
a95547b
feat: ensure button are not shrinked
pirhoo Jan 28, 2025
60b8ef2
fix: remove shortkeys mixin
caro3801 Jan 28, 2025
646f076
feat: add test on DocumentGlobalSearchTermsEntry
caro3801 Jan 29, 2025
adb1da6
fix: update tests for DocumentGlobalSearchTerms to match new Document…
caro3801 Jan 29, 2025
5e845db
fix: repair DocumentTranslation tests
caro3801 Jan 29, 2025
5ef3da6
fix: repair DocumentView
caro3801 Jan 29, 2025
93d58d5
test: adapt to new document view
pirhoo Jan 29, 2025
32746de
refactor: remove usePath to use core function instead
caro3801 Jan 30, 2025
38bf086
chore: update vitest
caro3801 Jan 30, 2025
baded82
fix: use core.defaultDataDir()
caro3801 Jan 30, 2025
539a9e3
feat: update SearchBarInputDropdownForProjects in vue 3
caro3801 Jan 30, 2025
f21d20b
refactor: remove unused param
caro3801 Jan 30, 2025
0d3e4d6
wip
caro3801 Jan 30, 2025
df17847
fix: update DocumentViewTabsEntities to use elasticsearch variable an…
pirhoo Jan 30, 2025
856c2ad
refactor: remove console.log
pirhoo Jan 30, 2025
0ae67e9
fix: use html element to set form values
pirhoo Jan 30, 2025
0b61646
refactor: remove unused prop
pirhoo Jan 30, 2025
05c771c
refactor: move test
pirhoo Jan 30, 2025
710d16b
fix: remove legacy test
pirhoo Jan 30, 2025
544b8bf
fix: remove cardinality
pirhoo Jan 30, 2025
44e8571
fix: adapt test to stateless component
pirhoo Jan 31, 2025
f3dc5c8
refactor: remove describe
pirhoo Jan 31, 2025
d33db65
fix: improve TaskDocumentsForm test + remove uneeded valid prop on form
caro3801 Jan 31, 2025
b2f44d1
refactor: add computed property for better readability
caro3801 Jan 31, 2025
90de31f
refactor: replace config props with getDefaultDataDir from core for h…
caro3801 Jan 31, 2025
215aa39
fix: reset api mock before each test
caro3801 Jan 31, 2025
a1ff0c0
build: use flat config for eslint and add Phosphor components
pirhoo Jan 31, 2025
4149e0c
refactor: lint
pirhoo Jan 31, 2025
e15b411
refactor: lint
pirhoo Jan 31, 2025
ed40747
build: use name of components for preset
pirhoo Jan 31, 2025
a99c938
fix: add missing Error message
caro3801 Jan 31, 2025
5c1cce4
fix: use loaderId as primitive
caro3801 Jan 31, 2025
e098d37
refactor: move file
caro3801 Jan 31, 2025
d4dd503
feat: add tests on tasklist
caro3801 Jan 31, 2025
b306412
refactor: move task composables
caro3801 Jan 31, 2025
7162180
refactor: update composable to use vue singletons
caro3801 Jan 31, 2025
d385436
feat: add task settings tests
caro3801 Jan 31, 2025
5e9d782
feat: add batch download tests
caro3801 Jan 31, 2025
bdb9da0
feat: add entities tests
caro3801 Jan 31, 2025
76c7061
refactor: rename test
caro3801 Jan 31, 2025
5c53f08
fix: remove old batch search tests and components
caro3801 Jan 31, 2025
52ad92a
style: remove unused lines
caro3801 Jan 31, 2025
6336dd9
refactor: lint
pirhoo Jan 31, 2025
2aee2c1
fix: syntax error
pirhoo Jan 31, 2025
85b79a0
refactor: lint
pirhoo Jan 31, 2025
9f9c289
refactor: move methods to elasticsearch
pirhoo Jan 31, 2025
794cf8a
test: mock API calls
pirhoo Jan 31, 2025
b2afeb2
chore: apply patch updates
pirhoo Jan 31, 2025
a7edf1f
chore: upgrade to storybook 8.5.2
pirhoo Jan 31, 2025
4a2dec5
chore: upgrade vite and build deps
pirhoo Jan 31, 2025
c154e0b
build: fix cjs scripts
pirhoo Jan 31, 2025
0c339af
chore: upgrade jsdom
pirhoo Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 9 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,18 @@ jobs:
resource_class: large
docker:
- image: cimg/node:18.19
environment:
# This is required to run the tests
NODE_OPTIONS: --max_old_space_size=4096
- image: docker.elastic.co/elasticsearch/elasticsearch:7.9.1
environment:
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
- "discovery.type=single-node"
- "cluster.name=datashare"
ES_JAVA_OPTS: -Xms256m -Xmx256m
discovery.type: single-node
cluster.name: datashare
# CORS
- "http.cors.enabled=true"
- "http.cors.allow-origin=*"
- "http.cors.allow-methods=OPTIONS, HEAD, GET, POST, PUT, DELETE"
http.cors.enabled: "true"
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
name: elasticsearch
working_directory: ~/datashare-client
steps:
Expand Down
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Workflow name
name: Build and Publish Storybook to GitHub Pages

on:
push:

permissions:
contents: read
pages: write
id-token: write

jobs:

publish:
if: github.ref == 'refs/heads/feat/new-design'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'yarn'

- name: Install Node dependencies
run: yarn --frozen-lockfile

- name: Build storybook artifacts
run: yarn build:storybook

- name: Upload storybook artifacts
uses: actions/upload-pages-artifact@v3
with:
path: storybook-static

- name: Deploy artifact to Github Pages
uses: actions/deploy-pages@v4


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ package-lock.json
*.sln
*.sw*
*.iml

*storybook.log
19 changes: 19 additions & 0 deletions .storybook/decorators/murmur.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Murmur from '@icij/murmur-next'
import { getCurrentInstance } from 'vue'

export const withMurmur = (config = {},
useConfig = true,
useI18n = false,
useBootstrap = false,
registerComponents = true) => {
return () => ({
setup () {
const { app } = getCurrentInstance()?.appContext
Murmur.config.merge(config)
app.use(Murmur, { useConfig, useI18n, useBootstrap, registerComponents })
},
template: '<story />'
})
}

export default { withMurmur }
30 changes: 30 additions & 0 deletions .storybook/decorators/vuex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { createStore } from 'vuex'
import { getCurrentInstance } from 'vue'
import {identity} from "lodash";

export const withVuex = (config = {}) => {
return () => ({
setup () {
const { app } = getCurrentInstance()?.appContext
app.use(createStore(config))
},
template: '<story />'
})
}


export const storeDecoratorPipelineChainByCategory = withVuex({
modules: {
pipelines: {
namespaced: true,
getters: {
applyPipelineChainByCategory() {
return () => {
return identity
}
}
}
}
}
})
export default { withVuex, storeDecoratorPipelineChainByCategory }
21 changes: 21 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** @type { import('@storybook/vue3-vite').StorybookConfig } */
const config = {
core: {
disableTelemetry: true
},
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
'@storybook/addon-themes',
'storybook-addon-vue-slots',
"storybook-addon-pseudo-states"
],
framework: {
name: "@storybook/vue3-vite",
options: {},
},
}

export default config
4 changes: 4 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { addons } from '@storybook/manager-api'
import theme from './theme'

addons.setConfig({ navSize: 300, theme })
5 changes: 5 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css?family=Inter:400,700,800|Merriweather:300,400,400italic&display=swap"
rel="stylesheet">
137 changes: 137 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/** @type { import('@storybook/vue3').Preview } */
import { setup } from '@storybook/vue3'
import { useArgs } from '@storybook/preview-api'
import { styled } from '@storybook/theming'
import { withThemeByDataAttribute } from '@storybook/addon-themes'
import { createBootstrap } from 'bootstrap-vue-next'
import { createI18n } from 'vue-i18n'
import { createVueWait } from 'vue-wait'
import Vue3Toastify from 'vue3-toastify'

import messages from '@/lang/en'
import settings from '@/utils/settings'

import './preview.scss'

setup((app) => {
const vueWait = createVueWait({ useVuex: false })
const bootstrap = createBootstrap({
directives: true,
components: {
BPopover: {
offset: '16px'
},
BTooltip: {
offset: '6px',
delay: {
show: 500,
hide: 0
}
}
}
})
const i18n = createI18n({
warnHtmlInMessage: 'off',
warnHtmlMessage: 'off',
globalInjection: true,
allowComposition: true,
legacy: true,
locale: settings.defaultLocale,
fallbackLocale: settings.defaultLocale,
messages: {
[settings.defaultLocale]: messages
}
})
app.use(vueWait)
app.use(bootstrap)
app.use(i18n)
app.use(Vue3Toastify)
})

const decorators = [
withThemeByDataAttribute({
themes: {
light: 'light',
dark: 'dark'
},
defaultTheme: 'light',
attributeName: 'data-bs-theme'
}),
/**
* Support `v-model` for vue
* @see {@link https://craigbaldwin.com/blog/updating-args-storybook-vue/}
*/
(story, context) => {
const [args, updateArgs] = useArgs()
if ('modelValue' in args) {
const update = args['onUpdate:model-value'] || args['onUpdate:modelValue']
args['onUpdate:model-value'] = undefined
args['onUpdate:modelValue'] = (...vals) => {
update?.(...vals)
/**
* Arg with `undefined` will be deleted by `deleteUndefined()`, then loss of reactive
* @see {@link https://github.com/storybookjs/storybook/blob/next/code/lib/preview-api/src/modules/store/ArgsStore.ts#L63}
*/
const modelValue = vals[0] === undefined ? null : vals[0]
updateArgs({ modelValue })
}
}
return story({ ...context, updateArgs })
}
]


const style = {
fontFamily: 'var(--bs-font-sans-serif) !important',
fontSize: '1rem',
}

const headingsStyle = {
fontFamily: 'var(--bs-font-sans-serif) !important',
fontWeight: 'var(--bs-headings-weight-bold)'
}

const h1Style = {
...headingsStyle,
fontSize: '2.5rem'
}

const aStyle = {
...style,
color: 'rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));',
'&:hover': {
textDecoration: 'underline'
}
}

const preview = {
decorators,
parameters: {
docs: {
components: {
h1: styled.h1(() => h1Style),
h2: styled.h2(() => headingsStyle),
h3: styled.h3(() => headingsStyle),
h4: styled.h4(() => headingsStyle),
h5: styled.h5(() => headingsStyle),
h6: styled.h6(() => headingsStyle),
a: styled.a(() => aStyle),
section: styled.section(() => style),
p: styled.p(() => style),
li: styled.li(() => style),
div: styled.div(() => style),
pre: styled.div(() => ({ })),
span: styled.span(() => style),
input: styled.input(() => style)
},
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
}

export default preview
65 changes: 65 additions & 0 deletions .storybook/preview.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
@import '@/main.scss';

.bg-striped {
background: repeating-linear-gradient(
45deg,
#dfdddd,
#dfdddd 10px,
#cfcccc 10px,
#cfcccc 20px
);
width: 500px;
}

@include color-mode(dark) {
.bg-striped {
background: repeating-linear-gradient(
45deg,
#222,
#333 10px,
#444 10px,
#444 20px
);
}
}

h1 {
font-family: var(--bs-font-sans-serif) !important;
font-weight: var(--bs-body-font-weight);
font-size: 2.5rem;
}

h2,
h3,
h4,
h5,
h6 {
font-family: var(--bs-font-sans-serif);
font-weight: var(--bs-body-font-weight);
}

pre.prismjs {
padding: 0.75rem;
font-size: 0.90rem;
}

.docs-story {
background: var(--bs-body-bg)
}

.btn.pseudo-focus {
box-shadow: var(--bs-btn-active-shadow), var(--bs-btn-focus-box-shadow);
}

.btn.pseudo-hover {
color: var(--bs-btn-hover-color);
background-color: var(--bs-btn-hover-bg);
border-color: var(--bs-btn-hover-border-color);
}

.btn.pseudo-active {
color: var(--bs-btn-active-color);
background-color: var(--bs-btn-active-bg);
border-color: var(--bs-btn-active-border-color);
box-shadow: var(--bs-btn-active-shadow);
}
Loading