@livestorm/ui-vue 1.1.1 → 1.1.2
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.
- package/.env +1 -0
- package/.eslintignore +4 -0
- package/.eslintrc.js +47 -0
- package/.pkg +11 -0
- package/babel.config.js +5 -0
- package/build/Dockerfile +31 -0
- package/ci/ci.yml +54 -0
- package/components-vite.js +29 -0
- package/components-webpack.js +29 -0
- package/components.d.ts +4 -0
- package/index.d.ts +3 -0
- package/index.js +24 -0
- package/package.json +1 -4
- package/plugins.js +17 -0
- package/postcss.config.js +1 -0
- package/src/components/BaseAutocomplete/BaseAutocomplete.spec.js +506 -0
- package/src/components/BaseAutocomplete/BaseAutocomplete.stories.js +184 -0
- package/src/components/BaseAutocomplete/BaseAutocomplete.vue +431 -0
- package/src/components/BaseBanner/BaseBanner.spec.js +32 -0
- package/src/components/BaseBanner/BaseBanner.stories.js +133 -0
- package/src/components/BaseBanner/BaseBanner.vue +229 -0
- package/src/components/BaseButton/BaseButton.spec.js +98 -0
- package/src/components/BaseButton/BaseButton.stories.js +291 -0
- package/src/components/BaseButton/BaseButton.vue +193 -0
- package/src/components/BaseButton/__snapshots__/BaseButton.spec.js.snap +37 -0
- package/src/components/BaseButton/__snapshots__/BaseButton.spec.js.snap.old +31 -0
- package/src/components/BaseCheckbox/BaseCheckbox.stories.js +82 -0
- package/src/components/BaseCheckbox/BaseCheckbox.vue +161 -0
- package/src/components/BaseDropdownMenu/BaseDropdownMenu.stories.js +84 -0
- package/src/components/BaseDropdownMenu/BaseDropdownMenu.vue +251 -0
- package/src/components/BaseDropdownMenu/BaseDropdownMenuButton.vue +26 -0
- package/src/components/BaseDropdownMenu/BaseDropdownMenuDivider.vue +10 -0
- package/src/components/BaseDropdownMenu/BaseDropdownMenuItem.vue +206 -0
- package/src/components/BaseDropdownMenu/BaseDropdownMenuSearch.vue +49 -0
- package/src/components/BaseDropdownMenu/BaseDropdownMenuTitle.vue +26 -0
- package/src/components/BaseModal/BaseModal.stories.js +143 -0
- package/src/components/BaseModal/BaseModal.vue +187 -0
- package/src/components/BaseModal/BaseModalContent.vue +164 -0
- package/src/components/BaseModal/BaseModalContentOld.vue +242 -0
- package/src/components/BaseRating/BaseRating.spec.js +46 -0
- package/src/components/BaseRating/BaseRating.stories.js +46 -0
- package/src/components/BaseRating/BaseRating.vue +119 -0
- package/src/components/BaseSelect/BaseSelect.stories.js +177 -0
- package/src/components/BaseSelect/BaseSelect.vue +443 -0
- package/src/components/BaseSelect/BaseSelectGroup.vue +34 -0
- package/src/components/BaseSelect/BaseSelectOption.vue +219 -0
- package/src/components/BaseSwitch/BaseSwitch.stories.js +44 -0
- package/src/components/BaseSwitch/BaseSwitch.vue +114 -0
- package/src/components/BaseTag/BaseTag.stories.js +123 -0
- package/src/components/BaseTag/BaseTag.vue +244 -0
- package/src/css/body.postcss +29 -0
- package/src/css/button.postcss +354 -0
- package/src/css/checkbox-radio.postcss +152 -0
- package/src/css/icon.postcss +9 -0
- package/src/css/loader.postcss +120 -0
- package/src/css/popper.postcss +143 -0
- package/src/css/tailwind-utilities.postcss +1 -0
- package/src/css/tailwind.postcss +2 -0
- package/src/css/transitions.postcss +66 -0
- package/src/mixins/DynamicAction.js +59 -0
- package/src/utils/breakpoints.js +8 -0
- package/src/utils/bus.js +3 -0
- package/src/utils/clipboard.js +38 -0
- package/src/utils/devices.js +134 -0
- package/src/utils/elements.js +25 -0
- package/src/utils/index.js +8 -0
- package/src/utils/responsive.js +61 -0
- package/src/utils/router.js +94 -0
- package/src/utils/slot.js +27 -0
- package/src/utils/stack-view.js +116 -0
- package/src/utils/uid.js +5 -0
- package/style-postcss.d.ts +3 -0
- package/style-postcss.js +2 -0
- package/style.js +12 -0
- package/tailwind.config.base.cjs +88 -0
- package/tailwind.config.js +9 -0
- package/tsconfig.check.json +13 -0
- package/tsconfig.json +66 -0
- package/vite.config.js +43 -0
- package/vitest.setup.js +26 -0
package/.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VITE_UI_VUE=true
|
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
parser: 'vue-eslint-parser',
|
|
4
|
+
parserOptions: {
|
|
5
|
+
parser: '@typescript-eslint/parser',
|
|
6
|
+
},
|
|
7
|
+
extends: [
|
|
8
|
+
'plugin:vue/vue3-recommended',
|
|
9
|
+
'@vue/eslint-config-standard',
|
|
10
|
+
'plugin:vitest-globals/recommended',
|
|
11
|
+
'@vue/typescript',
|
|
12
|
+
],
|
|
13
|
+
env: {
|
|
14
|
+
node: true,
|
|
15
|
+
mocha: true,
|
|
16
|
+
'vitest-globals/env': true,
|
|
17
|
+
},
|
|
18
|
+
rules: {
|
|
19
|
+
'no-console': 'off',
|
|
20
|
+
'no-debugger': 'off',
|
|
21
|
+
'comma-dangle': ['error', {
|
|
22
|
+
arrays: 'always-multiline',
|
|
23
|
+
objects: 'always-multiline',
|
|
24
|
+
imports: 'always-multiline',
|
|
25
|
+
exports: 'always-multiline',
|
|
26
|
+
functions: 'only-multiline',
|
|
27
|
+
}],
|
|
28
|
+
'vue/no-v-html': 'off',
|
|
29
|
+
// html-quotes off: Allow :query='gql => gql`query { foo (bar: "text with quotes") }`' as GraphQL only support double quotes (") for text in queries
|
|
30
|
+
'vue/html-quotes': 'off',
|
|
31
|
+
'vue/no-unsupported-features': ['warn', {
|
|
32
|
+
version: '^3.2.30',
|
|
33
|
+
ignores: [],
|
|
34
|
+
}],
|
|
35
|
+
'vue/multi-word-component-names': 'warn',
|
|
36
|
+
'import/export': 'off',
|
|
37
|
+
'no-use-before-define': 'off',
|
|
38
|
+
},
|
|
39
|
+
overrides: [
|
|
40
|
+
{
|
|
41
|
+
files: ['**/*.vue'],
|
|
42
|
+
rules: {
|
|
43
|
+
'import/first': 'off',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}
|
package/.pkg
ADDED
package/babel.config.js
ADDED
package/build/Dockerfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
FROM public.ecr.aws/docker/library/node:16-alpine as base
|
|
2
|
+
|
|
3
|
+
# Setup PNPM
|
|
4
|
+
|
|
5
|
+
RUN corepack enable && corepack prepare pnpm@8.6.0 --activate
|
|
6
|
+
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
|
|
9
|
+
# @TODO improve CI
|
|
10
|
+
# COPY . .
|
|
11
|
+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .
|
|
12
|
+
COPY packages/ui-icons/package.json packages/ui-icons/
|
|
13
|
+
COPY packages/ui-vue/package.json packages/ui-vue/
|
|
14
|
+
# Needed for the depedencies (for example postcss.config.js)
|
|
15
|
+
COPY packages/frontend/package.json packages/frontend/
|
|
16
|
+
COPY packages/dev-utils/package.json packages/dev-utils/
|
|
17
|
+
|
|
18
|
+
# NPM dependencies
|
|
19
|
+
|
|
20
|
+
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store/v3 \
|
|
21
|
+
pnpm install --frozen-lockfile --ignore-scripts --prefer-offline --filter "@livestorm/ui-vue..." --filter "@livestorm/frontend..."
|
|
22
|
+
|
|
23
|
+
COPY packages/ui-icons packages/ui-icons
|
|
24
|
+
COPY packages/ui-vue packages/ui-vue
|
|
25
|
+
# Needed for the references to '../frontend'
|
|
26
|
+
COPY packages/frontend/ packages/frontend/
|
|
27
|
+
|
|
28
|
+
RUN pnpm run -r --filter "@livestorm/ui-vue..." prepare && \
|
|
29
|
+
pnpm run -r --filter "@livestorm/ui-vue^..." build
|
|
30
|
+
|
|
31
|
+
WORKDIR /app/packages/ui-vue
|
package/ci/ci.yml
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
steps:
|
|
2
|
+
- label: ":docker: Build package (base)"
|
|
3
|
+
key: build-base
|
|
4
|
+
agents:
|
|
5
|
+
queue: "elastic-builders"
|
|
6
|
+
plugins:
|
|
7
|
+
- livestorm/lsc#v1.0.32:
|
|
8
|
+
build-package: true
|
|
9
|
+
build-target: base
|
|
10
|
+
build-cache-from:
|
|
11
|
+
- ${PACKAGE_REGISTRY}/${PACKAGE_IMAGE_NAME}:latest
|
|
12
|
+
|
|
13
|
+
- label: ":eslint: Run ESLint"
|
|
14
|
+
depends_on: build-base
|
|
15
|
+
command: |
|
|
16
|
+
pnpm run test:eslint
|
|
17
|
+
plugins:
|
|
18
|
+
- docker#v4.0.0:
|
|
19
|
+
image: "${PACKAGE_IMAGE}-base"
|
|
20
|
+
skip-checkout: true
|
|
21
|
+
mount-checkout: false
|
|
22
|
+
|
|
23
|
+
- label: ":typescript: Run TypeScript check"
|
|
24
|
+
depends_on: build-base
|
|
25
|
+
command: |
|
|
26
|
+
pnpm run test:types
|
|
27
|
+
plugins:
|
|
28
|
+
- docker#v4.0.0:
|
|
29
|
+
image: "${PACKAGE_IMAGE}-base"
|
|
30
|
+
skip-checkout: true
|
|
31
|
+
mount-checkout: false
|
|
32
|
+
|
|
33
|
+
- label: ":vitest: Run unit tests"
|
|
34
|
+
depends_on: build-base
|
|
35
|
+
key: "ut"
|
|
36
|
+
artifact_paths: "reports/junit/*.xml"
|
|
37
|
+
command: |
|
|
38
|
+
pnpm run test:vitest:run --reporter=default --reporter=junit --outputFile.junit=reports/junit/junit.xml
|
|
39
|
+
plugins:
|
|
40
|
+
- docker#v4.0.0:
|
|
41
|
+
image: "${PACKAGE_IMAGE}-base"
|
|
42
|
+
skip-checkout: true
|
|
43
|
+
mount-checkout: false
|
|
44
|
+
volumes:
|
|
45
|
+
- ./reports/junit:/app/packages/ui-vue/reports/junit
|
|
46
|
+
|
|
47
|
+
- label: ":memo: Tests Report"
|
|
48
|
+
depends_on: "ut"
|
|
49
|
+
allow_dependency_failure: true
|
|
50
|
+
plugins:
|
|
51
|
+
- junit-annotate#v2.0.2:
|
|
52
|
+
artifacts: "reports/junit/*.xml"
|
|
53
|
+
failure-format: file
|
|
54
|
+
report-slowest: 20
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RenderSlot } from './src/utils/slot'
|
|
2
|
+
|
|
3
|
+
const NAME_REG = /Base([a-z0-9]+)\./i
|
|
4
|
+
|
|
5
|
+
export function registerComponents (app, prefix = 'Ls') {
|
|
6
|
+
app.component('RenderSlot', RenderSlot)
|
|
7
|
+
|
|
8
|
+
const componentsLib = import.meta.globEager('./src/components/**/Base+([a-zA-Z0-9]).{js,jsx,vue}')
|
|
9
|
+
for (const key in componentsLib) {
|
|
10
|
+
const component = componentsLib[key]
|
|
11
|
+
const name = key.match(NAME_REG)[1]
|
|
12
|
+
app.component(`${prefix}${name}`, component.default || component)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function getComponents (prefix = 'Ls') {
|
|
17
|
+
const componentsMap = {}
|
|
18
|
+
|
|
19
|
+
componentsMap.RenderSlot = RenderSlot
|
|
20
|
+
|
|
21
|
+
const componentsLib = import.meta.globEager('./src/components/**/Base+([a-zA-Z0-9]).{js,jsx,vue}')
|
|
22
|
+
for (const key in componentsLib) {
|
|
23
|
+
const component = componentsLib[key]
|
|
24
|
+
const name = key.match(NAME_REG)[1]
|
|
25
|
+
componentsMap[`${prefix}${name}`] = component.default || component
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return componentsMap
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RenderSlot } from './src/utils/slot'
|
|
2
|
+
|
|
3
|
+
const NAME_REG = /Base([a-z0-9]+)\./i
|
|
4
|
+
|
|
5
|
+
export function registerComponents (app, prefix = 'Ls') {
|
|
6
|
+
app.component('RenderSlot', RenderSlot)
|
|
7
|
+
|
|
8
|
+
const requireComponentsLib = require.context('./src/components/', true, /Base[a-z0-9]+\.(jsx?|vue)$/i)
|
|
9
|
+
requireComponentsLib.keys().forEach(fileName => {
|
|
10
|
+
const component = requireComponentsLib(fileName)
|
|
11
|
+
const name = fileName.match(NAME_REG)[1]
|
|
12
|
+
app.component(`${prefix}${name}`, component.default || component)
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function getComponents (prefix = 'Ls') {
|
|
17
|
+
const componentsMap = {}
|
|
18
|
+
|
|
19
|
+
componentsMap.RenderSlot = RenderSlot
|
|
20
|
+
|
|
21
|
+
const requireComponentsLib = require.context('./src/components/', true, /Base[a-z0-9]+\.(jsx?|vue)$/i)
|
|
22
|
+
requireComponentsLib.keys().forEach(fileName => {
|
|
23
|
+
const component = requireComponentsLib(fileName)
|
|
24
|
+
const name = fileName.match(NAME_REG)[1]
|
|
25
|
+
componentsMap[`${prefix}${name}`] = component.default || component
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
return componentsMap
|
|
29
|
+
}
|
package/components.d.ts
ADDED
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This entry file is not loaded by livestorm-app
|
|
3
|
+
* Only useful for the export of the library
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import './style'
|
|
7
|
+
|
|
8
|
+
import BaseButton from './src/components/BaseButton/BaseButton.vue'
|
|
9
|
+
import BaseCheckbox from './src/components/BaseCheckbox/BaseCheckbox.vue'
|
|
10
|
+
import BaseModal from './src/components/BaseModal/BaseModal.vue'
|
|
11
|
+
import BaseBanner from './src/components/BaseBanner/BaseBanner.vue'
|
|
12
|
+
import BaseAutocomplete from './src/components/BaseAutocomplete/BaseAutocomplete.vue'
|
|
13
|
+
|
|
14
|
+
import './src/css/tailwind-utilities.postcss'
|
|
15
|
+
|
|
16
|
+
export * from './plugins'
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
BaseButton as LsButton,
|
|
20
|
+
BaseCheckbox as LsCheckbox,
|
|
21
|
+
BaseModal as LsModal,
|
|
22
|
+
BaseBanner as LsBanner,
|
|
23
|
+
BaseAutocomplete as LsAutocomplete,
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestorm/ui-vue",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Livestorm UI components for Vue 3",
|
|
5
5
|
"main": "./dist/ui-vue.umd.js",
|
|
6
6
|
"module": "./dist/ui-vue.mjs",
|
|
7
7
|
"types": "./index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
11
8
|
"dependencies": {
|
|
12
9
|
"@livestorm/design-tokens": "^2.0.1",
|
|
13
10
|
"@vueuse/core": "^9.0.2",
|
package/plugins.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import 'floating-vue/dist/style.css'
|
|
2
|
+
|
|
3
|
+
import FloatingVue from 'floating-vue'
|
|
4
|
+
import VueSafeTeleport from 'vue-safe-teleport'
|
|
5
|
+
import Responsive from './src/utils/responsive'
|
|
6
|
+
import { floatingVueConfig } from './../frontend/src/common/js/floating-vue'
|
|
7
|
+
import { isMobile } from './../frontend/src/common/js/environment'
|
|
8
|
+
|
|
9
|
+
export function install (app) {
|
|
10
|
+
// Tooltips and popovers
|
|
11
|
+
app.use(FloatingVue, floatingVueConfig(isMobile()))
|
|
12
|
+
|
|
13
|
+
// Responsive
|
|
14
|
+
app.use(Responsive)
|
|
15
|
+
|
|
16
|
+
app.use(VueSafeTeleport)
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../frontend/postcss.config.js')
|