@community-release/nx-ui 0.0.67 → 0.0.71

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/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "ui",
3
3
  "configKey": "ui",
4
- "version": "0.0.67"
4
+ "version": "0.0.71"
5
5
  }
@@ -14,7 +14,7 @@
14
14
  <div class="title">{{ title }}</div>
15
15
  <div class="btn-toggle"></div>
16
16
  </button>
17
- <div :id="`acc-content-${cid}`" class="text" role="region" :aria-labelledby="`acc-button-${cid}`">
17
+ <div :id="`acc-content-${cid}`" class="text" role="region" :aria-labelledby="`acc-button-${cid}`" :inert="accordionData.open.value !== id">
18
18
  <div><slot /></div>
19
19
  </div>
20
20
  </section>
@@ -1,70 +1,74 @@
1
1
  <template>
2
2
  <div class="component-ui-spoiler" :class="{'tag-active': isShown}">
3
- <div class="content">
3
+ <div :id="cid" class="content" :inert="!isShown">
4
4
  <div>
5
5
  <slot></slot>
6
6
  </div>
7
7
  </div>
8
- <div class="title" @click="handleClick">{{ isShown ? hideText : showText }}</div>
8
+ <ui-button variant="flat" class="title" @click="handleClick" :aria-expanded="isShown.toString()" :aria-controls="cid">{{ isShown ? hideText : showText }}</ui-button>
9
9
  </div>
10
10
  </template>
11
11
 
12
12
  <script setup>
13
- import { watch, ref } from 'vue';
13
+ // Imports
14
+ import { watch, ref } from 'vue';
15
+ import uniq from './helpers/uniq';
14
16
 
15
17
  // Data
16
- const emit = defineEmits(['update:modelValue']);
17
- const props = defineProps({
18
- showText: {
19
- type: String,
20
- default: 'Show'
21
- },
22
- hideText: {
23
- type: String,
24
- default: 'Hide'
25
- },
26
- modelValue: {
27
- type: [Boolean, null],
28
- default: null
29
- }
30
- });
31
-
32
- let isShown = ref(false);
33
- let hasModel = props.modelValue !== null;
18
+ const emit = defineEmits(['update:modelValue']);
19
+ const props = defineProps({
20
+ showText: {
21
+ type: String,
22
+ default: 'Show'
23
+ },
24
+ hideText: {
25
+ type: String,
26
+ default: 'Hide'
27
+ },
28
+ modelValue: {
29
+ type: [Boolean, null],
30
+ default: null
31
+ }
32
+ });
34
33
 
35
- if (hasModel) {
36
- watch(() => props.modelValue, (v) => {
37
- isShown.value = v;
38
- }, { immediate: true });
39
- }
34
+ const cid = 'spoiler-' + uniq();
35
+ let isShown = ref(false);
36
+ let hasModel = props.modelValue !== null;
37
+
38
+ if (hasModel) {
39
+ watch(() => props.modelValue, (v) => {
40
+ isShown.value = v;
41
+ }, { immediate: true });
42
+ }
40
43
 
41
44
  // Methods
42
- function handleClick() {
43
- if (hasModel) {
44
- emit('update:modelValue', !isShown.value);
45
- } else {
46
- isShown.value = !isShown.value;
45
+ function handleClick() {
46
+ if (hasModel) {
47
+ emit('update:modelValue', !isShown.value);
48
+ } else {
49
+ isShown.value = !isShown.value;
50
+ }
47
51
  }
48
- }
49
52
  </script>
50
53
 
51
54
  <style lang="less">
52
55
  .component-ui-spoiler {
53
- @com-space-mini: var(--ui-space-mini);
56
+ @com-space-micro: var(--ui-space-micro);
54
57
  @com-ani-ease: var(--ui-ani-ease);
55
58
  @com-ani-time: var(--ui-ani-time);
56
59
  @com-color-primary-text: var(--ui-color-primary-text);
57
60
  @com-font-weight-medium: var(--ui-font-weight-medium);
58
61
 
59
62
  > .title {
60
- padding-top: @com-space-mini;
63
+ margin-left: calc(@com-space-micro * -1);
64
+ }
61
65
 
62
- color: @com-color-primary-text;
63
- font-weight: @com-font-weight-medium;
64
- cursor: pointer;
66
+ > .title {
67
+ padding-inline: @com-space-micro;
65
68
 
66
- -webkit-user-select: none;
67
- user-select: none;
69
+ .button-content .slot-default {
70
+ padding-inline: 0;
71
+ }
68
72
  }
69
73
 
70
74
  > .content {
package/package.json CHANGED
@@ -1,73 +1,73 @@
1
- {
2
- "name": "@community-release/nx-ui",
3
- "version": "0.0.67",
4
- "packageManager": "pnpm@10.14.0",
5
- "description": "nx-ui - Nuxt UI library",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/community-release/nx-ui.git"
9
- },
10
- "license": "MIT",
11
- "type": "module",
12
- "exports": {
13
- ".": {
14
- "import": "./dist/module.mjs",
15
- "require": "./dist/module.cjs"
16
- }
17
- },
18
- "main": "./dist/module.cjs",
19
- "files": [
20
- "dist"
21
- ],
22
- "dependencies": {
23
- "@nuxt/kit": "^3.15.4",
24
- "@nuxtjs/color-mode": "^3.5.2",
25
- "@nuxtjs/i18n": "^9.2.0",
26
- "@pinia/nuxt": "^0.10.1",
27
- "ol": "^9.1.0",
28
- "pinia": "^3.0.1",
29
- "vue": "^3.5.13"
30
- },
31
- "devDependencies": {
32
- "@nuxt/devtools": "latest",
33
- "@nuxt/module-builder": "^0.5.5",
34
- "@nuxt/schema": "^3.11.2",
35
- "@nuxt/test-utils": "^3.19.2",
36
- "@vitejs/plugin-vue": "^5.2.1",
37
- "@vue/test-utils": "^2.4.6",
38
- "@vuedoc/md": "^4.0.0-beta8",
39
- "@vuedoc/parser": "^4.0.0-beta14",
40
- "@vueuse/core": "^13.6.0",
41
- "@vueuse/nuxt": "^13.6.0",
42
- "changelogen": "^0.5.5",
43
- "cross-env": "^7.0.3",
44
- "happy-dom": "^14.12.0",
45
- "less": "^3.9.0",
46
- "less-loader": "^5.0.0",
47
- "nuxt": "^3.15.4",
48
- "playwright-core": "^1.54.1",
49
- "vite-raw-plugin": "^1.0.2",
50
- "vitest": "^1.6.0",
51
- "vue-docgen-cli": "^4.79.0",
52
- "vue-tsc": "^2.0.24"
53
- },
54
- "peerDependencies": {
55
- "vue-router": "^4.5.0"
56
- },
57
- "resolutions": {
58
- "string-width": "4.2.3"
59
- },
60
- "scripts": {
61
- "prepack": "nuxt-module-build build",
62
- "dev": "nuxi dev docs --host --port 7012",
63
- "build": "nuxi build docs",
64
- "prepare": "nuxt-module-build build && nuxt-module-build prepare && nuxi prepare docs",
65
- "release": "npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
66
- "test": "vitest run",
67
- "test:watch": "vitest watch",
68
- "test:com": "vitest components run",
69
- "test:genmocks": "node ./src/utils/generateTestMocks.mjs",
70
- "docs:components": "vue-docgen",
71
- "docs:generate": "npm run generate:production -prefix ./docs"
72
- }
1
+ {
2
+ "name": "@community-release/nx-ui",
3
+ "version": "0.0.71",
4
+ "packageManager": "pnpm@10.14.0",
5
+ "description": "nx-ui - Nuxt UI library",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/community-release/nx-ui.git"
9
+ },
10
+ "license": "MIT",
11
+ "type": "module",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/module.mjs",
15
+ "require": "./dist/module.cjs"
16
+ }
17
+ },
18
+ "main": "./dist/module.cjs",
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "dependencies": {
23
+ "@nuxt/kit": "^3.15.4",
24
+ "@nuxtjs/color-mode": "^3.5.2",
25
+ "@nuxtjs/i18n": "^9.2.0",
26
+ "@pinia/nuxt": "^0.10.1",
27
+ "ol": "^9.1.0",
28
+ "pinia": "^3.0.1",
29
+ "vue": "^3.5.13"
30
+ },
31
+ "devDependencies": {
32
+ "@nuxt/devtools": "latest",
33
+ "@nuxt/module-builder": "^0.5.5",
34
+ "@nuxt/schema": "^3.11.2",
35
+ "@nuxt/test-utils": "^3.19.2",
36
+ "@vitejs/plugin-vue": "^5.2.1",
37
+ "@vue/test-utils": "^2.4.6",
38
+ "@vuedoc/md": "^4.0.0-beta8",
39
+ "@vuedoc/parser": "^4.0.0-beta14",
40
+ "@vueuse/core": "^13.6.0",
41
+ "@vueuse/nuxt": "^13.6.0",
42
+ "changelogen": "^0.5.5",
43
+ "cross-env": "^7.0.3",
44
+ "happy-dom": "^14.12.0",
45
+ "less": "^3.9.0",
46
+ "less-loader": "^5.0.0",
47
+ "nuxt": "^3.15.4",
48
+ "playwright-core": "^1.54.1",
49
+ "vite-raw-plugin": "^1.0.2",
50
+ "vitest": "^1.6.0",
51
+ "vue-docgen-cli": "^4.79.0",
52
+ "vue-tsc": "^2.0.24"
53
+ },
54
+ "peerDependencies": {
55
+ "vue-router": "^4.5.0"
56
+ },
57
+ "resolutions": {
58
+ "string-width": "4.2.3"
59
+ },
60
+ "scripts": {
61
+ "prepack": "nuxt-module-build build",
62
+ "dev": "nuxi dev docs --host --port 7012",
63
+ "build": "nuxi build docs",
64
+ "prepare": "nuxt-module-build build && nuxt-module-build prepare && nuxi prepare docs",
65
+ "release": "npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
66
+ "test": "vitest run",
67
+ "test:watch": "vitest watch",
68
+ "test:com": "vitest components run",
69
+ "test:genmocks": "node ./src/utils/generateTestMocks.mjs",
70
+ "docs:components": "vue-docgen",
71
+ "docs:generate": "npm run generate:production -prefix ./docs"
72
+ }
73
73
  }