@livestorm/ui-vue 1.1.1 → 1.1.3

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 (87) hide show
  1. package/.env +1 -0
  2. package/.eslintignore +4 -0
  3. package/.eslintrc.js +49 -0
  4. package/.pkg +11 -0
  5. package/babel.config.js +5 -0
  6. package/build/Dockerfile +31 -0
  7. package/ci/ci.yml +54 -0
  8. package/components-vite.js +29 -0
  9. package/components-webpack.js +29 -0
  10. package/components.d.ts +4 -0
  11. package/dist/components.mjs +585 -473
  12. package/dist/environment-da321c85.mjs +1656 -0
  13. package/dist/index.mjs +2 -2
  14. package/dist/style.css +1 -1
  15. package/index.d.ts +3 -0
  16. package/index.js +24 -0
  17. package/package.json +15 -17
  18. package/plugins.js +17 -0
  19. package/postcss.config.js +1 -0
  20. package/src/components/BaseAutocomplete/BaseAutocomplete.spec.js +506 -0
  21. package/src/components/BaseAutocomplete/BaseAutocomplete.stories.js +184 -0
  22. package/src/components/BaseAutocomplete/BaseAutocomplete.vue +431 -0
  23. package/src/components/BaseBanner/BaseBanner.spec.js +32 -0
  24. package/src/components/BaseBanner/BaseBanner.stories.js +133 -0
  25. package/src/components/BaseBanner/BaseBanner.vue +229 -0
  26. package/src/components/BaseButton/BaseButton.spec.js +98 -0
  27. package/src/components/BaseButton/BaseButton.stories.js +300 -0
  28. package/src/components/BaseButton/BaseButton.vue +193 -0
  29. package/src/components/BaseButton/__snapshots__/BaseButton.spec.js.snap +37 -0
  30. package/src/components/BaseButton/__snapshots__/BaseButton.spec.js.snap.old +31 -0
  31. package/src/components/BaseCheckbox/BaseCheckbox.stories.js +157 -0
  32. package/src/components/BaseCheckbox/BaseCheckbox.vue +180 -0
  33. package/src/components/BaseDropdownMenu/BaseDropdownMenu.stories.js +84 -0
  34. package/src/components/BaseDropdownMenu/BaseDropdownMenu.vue +251 -0
  35. package/src/components/BaseDropdownMenu/BaseDropdownMenuButton.vue +26 -0
  36. package/src/components/BaseDropdownMenu/BaseDropdownMenuDivider.vue +10 -0
  37. package/src/components/BaseDropdownMenu/BaseDropdownMenuItem.vue +206 -0
  38. package/src/components/BaseDropdownMenu/BaseDropdownMenuSearch.vue +49 -0
  39. package/src/components/BaseDropdownMenu/BaseDropdownMenuTitle.vue +26 -0
  40. package/src/components/BaseModal/BaseModal.stories.js +155 -0
  41. package/src/components/BaseModal/BaseModal.vue +187 -0
  42. package/src/components/BaseModal/BaseModalContent.vue +166 -0
  43. package/src/components/BaseModal/BaseModalContentOld.vue +242 -0
  44. package/src/components/BaseRadio/BaseRadio.stories.js +164 -0
  45. package/src/components/BaseRadio/BaseRadio.vue +153 -0
  46. package/src/components/BaseRating/BaseRating.spec.js +46 -0
  47. package/src/components/BaseRating/BaseRating.stories.js +46 -0
  48. package/src/components/BaseRating/BaseRating.vue +119 -0
  49. package/src/components/BaseSelect/BaseSelect.stories.js +177 -0
  50. package/src/components/BaseSelect/BaseSelect.vue +443 -0
  51. package/src/components/BaseSelect/BaseSelectGroup.vue +34 -0
  52. package/src/components/BaseSelect/BaseSelectOption.vue +219 -0
  53. package/src/components/BaseSwitch/BaseSwitch.stories.js +44 -0
  54. package/src/components/BaseSwitch/BaseSwitch.vue +114 -0
  55. package/src/components/BaseTag/BaseTag.stories.js +123 -0
  56. package/src/components/BaseTag/BaseTag.vue +244 -0
  57. package/src/css/body.postcss +29 -0
  58. package/src/css/button.postcss +363 -0
  59. package/src/css/checkbox-radio.postcss +188 -0
  60. package/src/css/icon.postcss +9 -0
  61. package/src/css/loader.postcss +120 -0
  62. package/src/css/popper.postcss +161 -0
  63. package/src/css/tailwind-utilities.postcss +1 -0
  64. package/src/css/tailwind.postcss +2 -0
  65. package/src/css/transitions.postcss +66 -0
  66. package/src/mixins/DynamicAction.js +59 -0
  67. package/src/utils/breakpoints.js +8 -0
  68. package/src/utils/bus.js +3 -0
  69. package/src/utils/clipboard.js +38 -0
  70. package/src/utils/devices.js +134 -0
  71. package/src/utils/elements.js +25 -0
  72. package/src/utils/index.js +8 -0
  73. package/src/utils/responsive.js +61 -0
  74. package/src/utils/router.js +94 -0
  75. package/src/utils/slot.js +27 -0
  76. package/src/utils/stack-view.js +116 -0
  77. package/src/utils/uid.js +5 -0
  78. package/style-postcss.d.ts +3 -0
  79. package/style-postcss.js +2 -0
  80. package/style.js +12 -0
  81. package/tailwind.config.base.cjs +88 -0
  82. package/tailwind.config.js +9 -0
  83. package/tsconfig.check.json +13 -0
  84. package/tsconfig.json +66 -0
  85. package/vite.config.js +43 -0
  86. package/vitest.setup.js +26 -0
  87. package/dist/environment-e70e5768.mjs +0 -1664
package/.env ADDED
@@ -0,0 +1 @@
1
+ VITE_UI_VUE=true
package/.eslintignore ADDED
@@ -0,0 +1,4 @@
1
+ node_modules/
2
+ dist/
3
+ coverage/
4
+ !.*
package/.eslintrc.js ADDED
@@ -0,0 +1,49 @@
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
+ 'func-call-spacing': 'off',
39
+ '@typescript-eslint/func-call-spacing': 'error',
40
+ },
41
+ overrides: [
42
+ {
43
+ files: ['**/*.vue'],
44
+ rules: {
45
+ 'import/first': 'off',
46
+ },
47
+ },
48
+ ],
49
+ }
package/.pkg ADDED
@@ -0,0 +1,11 @@
1
+ target: //ui-vue
2
+ context: //..
3
+ name: ui-vue
4
+ description: Library for building Livestorm frontend
5
+ template: empty
6
+ owners: ["@livestorm/chapter-front-end"]
7
+ namespaced: false
8
+ runtime_dependencies: []
9
+ submodule: true
10
+ labels:
11
+ - livestorm-app
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ presets: [
3
+ '@vue/cli-plugin-babel/preset',
4
+ ],
5
+ }
@@ -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.10 --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
+ }
@@ -0,0 +1,4 @@
1
+ // @TODO remove when ui-vue is migrated to TS
2
+
3
+ export function registerComponents (app: any, prefix = 'Ls'): void
4
+ export function getComponents (prefix = 'Ls'): Record<string, any>