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,685 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1685 commits
Select commit Hold shift + click to select a range
9e5826d
feat: add "too big" limit on entity in context
pirhoo Nov 5, 2024
0b8880d
feat: add watch for "from" state value
pirhoo Nov 6, 2024
67c89bc
feat: add method to sync page with from value in state and route
pirhoo Nov 6, 2024
6b9f30b
feat: add watchDocument
pirhoo Nov 6, 2024
1ae787e
fix: use correct getters
pirhoo Nov 6, 2024
7e33c9e
refactor: remove document search nav
pirhoo Nov 6, 2024
bec8131
feat: replace document search nav by a slot and a named router view
pirhoo Nov 6, 2024
a4399aa
feat: add SearchNav view
pirhoo Nov 6, 2024
1193a5f
feat: implement SearchNav
pirhoo Nov 6, 2024
f9bce0f
feat: ensure navigation between document update the scroll
pirhoo Nov 6, 2024
cf3ead6
feat: use nested overflow
pirhoo Nov 6, 2024
dfebe01
fix: track active document route to show document
pirhoo Nov 6, 2024
9f12c01
fix: use new entities indexing route
pirhoo Nov 6, 2024
f9d53f7
feat: use Display* components
pirhoo Nov 6, 2024
4c2bb07
refactor: use FormActions compact mode to handle different layouts
pirhoo Nov 7, 2024
337178e
fix: document view is shrinked by default in flex
pirhoo Nov 7, 2024
27e4f0e
refactor: mergen "shorterLabels" with "hideLabels"
pirhoo Nov 7, 2024
a5ca91c
feat: always load user, even in local mode
pirhoo Nov 8, 2024
e698a9a
refactor: add iconWeight and model value to handle close
pirhoo Nov 8, 2024
e6ce27d
feat: add ButtonRecommendation
pirhoo Nov 8, 2024
f84b5ee
feat: add ButtonToggleRecommendation
pirhoo Nov 8, 2024
9351cb2
refactor: indent
pirhoo Nov 8, 2024
6eee4e3
feat: pass username to translation message
pirhoo Nov 8, 2024
68d989e
feat: add event to handle actions
pirhoo Nov 8, 2024
e0116b4
feat: add iconWieght prop
pirhoo Nov 8, 2024
0128f97
feat: add DocumentUserActionsCardInfo
pirhoo Nov 8, 2024
e7b7fc3
refactor: use single tag
pirhoo Nov 8, 2024
004f887
refactor: indent
pirhoo Nov 8, 2024
46bb934
feat: add DocumentUserActionsCardRecommendations
pirhoo Nov 8, 2024
62446bd
fix: remove extra border
pirhoo Nov 8, 2024
2568bb0
doc: use correct slot
pirhoo Nov 8, 2024
a5f2489
feat: remove extra spacing
pirhoo Nov 8, 2024
f3b3828
i18n: add new translations for new components
pirhoo Nov 8, 2024
f8b290c
feat: reload recommendations from backend after toggling one
pirhoo Nov 8, 2024
cef3967
refactor: use new DocumentUserActionsCardInfo
pirhoo Nov 8, 2024
804d0e6
refactor: merge DocumentUserActionsCardRecommendations into DocumentU…
pirhoo Nov 8, 2024
a9b4588
refactor: split in to atomic components
pirhoo Nov 8, 2024
122c1f7
feat: add auth composable
pirhoo Nov 8, 2024
7cfc6e1
feat: add mode composable
pirhoo Nov 8, 2024
27b6a66
refactor: use tree-shaked import
pirhoo Nov 8, 2024
8a98f1f
refactor: harmonize actions
pirhoo Nov 8, 2024
c7f0a7d
feat: use fullscreen modal
pirhoo Nov 8, 2024
51c2855
feat: remove unused prop
pirhoo Nov 8, 2024
bc6294c
feat: use correct tag icon
pirhoo Nov 8, 2024
2081ce0
feat: add body class for each list
pirhoo Nov 8, 2024
50a20cd
feat: add body class and hide automaticaly
pirhoo Nov 8, 2024
5daff84
refactor: remove unused model
pirhoo Nov 8, 2024
10d52a8
feat: use outline-secondary for search parameters
pirhoo Nov 8, 2024
a4fd9ee
feat: adjust properties to reflect data structure
pirhoo Nov 8, 2024
988674d
feat: use darker x icon
pirhoo Nov 8, 2024
19b82cd
feat: add floating zone
pirhoo Nov 8, 2024
9088408
feat: implement tags and recommendations
pirhoo Nov 8, 2024
83c992d
feat: handle multi index tagging
pirhoo Nov 8, 2024
15eac13
refactor: lint
pirhoo Nov 8, 2024
325b88d
refactor: remove legacy component
pirhoo Nov 8, 2024
acc09da
build: update components.d.ts
pirhoo Nov 8, 2024
5b000d1
refactor: delete merged component doc
pirhoo Nov 8, 2024
931b48e
feat: if the route is just present for hierarchy purpose, it has no c…
caro3801 Nov 8, 2024
9ca3cb1
feat: prevent the tooltip to be created if the ref does not exists
caro3801 Nov 8, 2024
c323935
feat: move task actions to components
caro3801 Nov 8, 2024
dbcc97a
feat: rename task list
caro3801 Nov 8, 2024
07e3aab
fix: use store instead of core.store
caro3801 Nov 8, 2024
274e97f
feat: create unique task component which filters tasks accordingly to…
caro3801 Nov 8, 2024
d6d62a6
feat: share stored settings between task settings and task view
caro3801 Nov 12, 2024
d144688
feat: table column is customizable through settings
caro3801 Nov 13, 2024
748cb9e
feat: add table pages for batch download and batch searches
caro3801 Nov 14, 2024
f11cbe1
i18n: use component interpolation to display link
pirhoo Nov 11, 2024
c5a52b7
feat: center message
pirhoo Nov 11, 2024
2e168cf
feat: align project to the right
pirhoo Nov 11, 2024
6b2bac5
feat: remove target _blank to expand link
pirhoo Nov 11, 2024
840800f
feat: add floating zone to standalone view
pirhoo Nov 11, 2024
6fbf22f
refactor: use composable to provide document floating id
pirhoo Nov 11, 2024
7562ebf
feat: make queryObserver reactive
pirhoo Nov 11, 2024
b84cd75
feat: use ref from query observer composable
pirhoo Nov 11, 2024
f52318f
refactor: use composable to inject document floating id
pirhoo Nov 11, 2024
28a987d
feat: use queryObserver to ensure teleport target exists
pirhoo Nov 11, 2024
2c51438
feat: use $tc for explicite pluralization
pirhoo Nov 11, 2024
adb9f11
refactor: move sidebar and docuemnt list layout to reusable component
pirhoo Nov 11, 2024
9fb5d3c
feat: add document modals using DocumentFloating
pirhoo Nov 11, 2024
93ebfe4
refactor: use RORO to search docs
pirhoo Nov 11, 2024
245c785
feat: use correct tag icon
pirhoo Nov 13, 2024
0b88ba1
feat: use correct tag icon
pirhoo Nov 13, 2024
20bb29b
feat: add DisplayHighlights component
pirhoo Nov 13, 2024
ce0b536
refactor: use DisplayHighlights component
pirhoo Nov 13, 2024
430d960
feat: new bordered layout
pirhoo Nov 13, 2024
8117843
refactor: use getter and matches function
pirhoo Nov 13, 2024
0ed217f
feat: track document position in search context
pirhoo Nov 13, 2024
91b05d3
feat: adjust display
pirhoo Nov 13, 2024
571224a
feat: add document's routes composables
pirhoo Nov 15, 2024
4d24d47
feat: move navigation function to composable
pirhoo Nov 15, 2024
a8a6806
refactor: remove document ref
pirhoo Nov 15, 2024
e537ce6
refactor: remove old component
pirhoo Nov 15, 2024
4adc48b
feat: add search getters
pirhoo Nov 15, 2024
978d7fd
feat: add modal prop
pirhoo Nov 15, 2024
e7d031e
feat: pass modal prop down to actions component
pirhoo Nov 15, 2024
ce91585
refactor: simplify document grid card layout
pirhoo Nov 15, 2024
e3f1b37
feat: use models to handle pagination
pirhoo Nov 15, 2024
dfa5d0c
refactor: lint
pirhoo Nov 15, 2024
cd8f645
feat: add carousel slot
pirhoo Nov 15, 2024
0be6a93
feat: add carousel slot
pirhoo Nov 15, 2024
c17f172
feat: add search carousel component
pirhoo Nov 15, 2024
efaafb6
i18n: add "reduce"
pirhoo Nov 15, 2024
d9d3c9b
refactor: lint
pirhoo Nov 15, 2024
ae4f60c
refactor: lint
pirhoo Nov 15, 2024
af35934
refactor: lint
pirhoo Nov 15, 2024
8f8d8dd
feat: add sidebar toggler
pirhoo Nov 15, 2024
ceba1c6
feat: replace landing page by a redirect to project's list
pirhoo Nov 15, 2024
c756f44
feat: import caret icon directly to avoid flaky display
pirhoo Nov 15, 2024
67fdfd6
feat: center error message
pirhoo Nov 15, 2024
e433398
feat: allow body scroll
pirhoo Nov 15, 2024
7fb4948
refactor: harmonize description display
pirhoo Nov 15, 2024
a127ae6
refactor: use compact threashold
pirhoo Nov 15, 2024
8c1f55b
fix: use select-paths model
pirhoo Nov 15, 2024
e4cf400
feat: add missing creation date
pirhoo Nov 15, 2024
d385a82
feat: move edit link to the top of jumbotron
pirhoo Nov 15, 2024
d5dba8c
feat: adjust spacing
pirhoo Nov 15, 2024
d207d13
fix: restore submit text
pirhoo Nov 15, 2024
92f9e7a
feat: use props to pass project name
pirhoo Nov 15, 2024
bf0a0fe
feat: ensure path change are reflected on selected paths
pirhoo Nov 15, 2024
08223d0
feat: ensure change project is reflected on path
pirhoo Nov 15, 2024
d1939b3
fix: router links
pirhoo Nov 15, 2024
b6e7e1f
feat: add links to action
pirhoo Nov 15, 2024
10d76cb
feat: add project prop
pirhoo Nov 15, 2024
3eac347
refactor: indent
pirhoo Nov 15, 2024
4ffe06c
refactor: lint
pirhoo Nov 15, 2024
ceb4a91
i18n: shorten pin label
pirhoo Nov 15, 2024
2307a6c
feat: add last indexing date
pirhoo Nov 15, 2024
b91c13f
fix: find filter regardless of component(s) definition in route
pirhoo Nov 15, 2024
31ce582
feat: use more robust filters component lookup
pirhoo Nov 15, 2024
adab0e1
feat: redirect also from children routes
pirhoo Nov 15, 2024
6a07d3a
feat: use fixed position for nav link
pirhoo Nov 15, 2024
d49b5e0
fix: ensure scroll tracker has a target
pirhoo Nov 15, 2024
ceff52b
refactor: use $t directly
pirhoo Nov 15, 2024
c6928e2
feat: implement run download
pirhoo Nov 15, 2024
3d745c0
feat: add hover display only on pagination
pirhoo Nov 15, 2024
7dbfed5
refactor: replace 'ALL' task by empty filter
caro3801 Nov 15, 2024
d5979ed
feat: add action cell in tasks and add info on top of task list
caro3801 Nov 15, 2024
3d6a873
feat: unflush tabs
pirhoo Nov 18, 2024
f4af6f0
fix: remove extra overflow to restore sticky
pirhoo Nov 18, 2024
5b263fe
feat: adjust header padding
pirhoo Nov 18, 2024
653ffaf
refactor: remove DocumentActions import
pirhoo Nov 18, 2024
d72158e
refactor: delete legacy components
pirhoo Nov 18, 2024
8cd5bfb
refactor: delete legacy components
pirhoo Nov 18, 2024
7487c32
feat: add title slot for AppModal
pirhoo Nov 19, 2024
930b8e4
feat: check value exists before display datetime
pirhoo Nov 19, 2024
597b12c
feat: add composable to delete project in a modal
pirhoo Nov 19, 2024
ea94c50
feat: remove custom spacers
pirhoo Nov 19, 2024
9bd4819
feat: catch project not found
pirhoo Nov 19, 2024
5bb7788
i18n: translate project deletion modal
pirhoo Nov 19, 2024
3043e27
refactor: remove deletion in form and use project deletion modal instead
pirhoo Nov 19, 2024
16622b8
fix: avoid passing function as translation key
pirhoo Nov 19, 2024
899ba7e
fix: use single node root
pirhoo Nov 19, 2024
20513e3
fix: add translation for project
pirhoo Nov 19, 2024
b5438d5
refactor: move pin project to composable
pirhoo Nov 19, 2024
4317f27
refactor: create pin button
pirhoo Nov 19, 2024
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
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
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
Loading