@histoire/controls 0.7.9 → 0.8.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@histoire/controls",
3
- "version": "0.7.9",
3
+ "version": "0.8.0",
4
4
  "description": "Prebuilt controls components",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -31,9 +31,7 @@
31
31
  "*.vue"
32
32
  ],
33
33
  "dependencies": {
34
- "@iconify/vue": "^3.2.1",
35
- "@vueuse/core": "^8.2.5",
36
- "floating-vue": "^2.0.0-beta.16"
34
+ "@histoire/vendors": "^0.8.0"
37
35
  },
38
36
  "devDependencies": {
39
37
  "@peeky/test": "^0.13.5",
@@ -44,11 +42,11 @@
44
42
  "autoprefixer": "^10.4.4",
45
43
  "concurrently": "^7.1.0",
46
44
  "floating-vue": "^2.0.0-beta.16",
47
- "histoire": "0.7.9",
45
+ "histoire": "0.8.0",
48
46
  "postcss": "^8.4.12",
49
47
  "postcss-import": "^14.1.0",
50
48
  "tailwindcss": "^3.0.23",
51
- "typescript": "^4.6.3",
49
+ "typescript": "^4.7.4",
52
50
  "vite": "^2.9.1",
53
51
  "vue": "^3.2.31",
54
52
  "vue-tsc": "^0.35.2"
@@ -0,0 +1,22 @@
1
+ import { defineConfig } from '@peeky/test'
2
+
3
+ export default defineConfig({
4
+ runtimeEnv: 'dom',
5
+ previewSetupFiles: [
6
+ 'src/peeky-preview.ts',
7
+ ],
8
+ vite: {
9
+ resolve: {
10
+ alias: {
11
+ 'floating-vue': 'floating-vue',
12
+ '@iconify/vue': '@iconify/vue',
13
+ pinia: 'pinia',
14
+ 'scroll-into-view-if-needed': 'scroll-into-view-if-needed',
15
+ shiki: 'shiki',
16
+ 'vue-router': 'vue-router',
17
+ '@vueuse/core': '@vueuse/core',
18
+ vue: 'vue',
19
+ },
20
+ },
21
+ },
22
+ })
@@ -7,7 +7,7 @@ export default {
7
7
  <script lang="ts" setup>
8
8
  import { VTooltip as vTooltip } from 'floating-vue'
9
9
 
10
- const props = defineProps<{
10
+ defineProps<{
11
11
  title?: string
12
12
  }>()
13
13
  </script>
@@ -32,8 +32,6 @@ const emit = defineEmits<{
32
32
  (e: 'update:modelValue', value: string): void
33
33
  }>()
34
34
 
35
- const input = ref<HTMLInputElement>()
36
-
37
35
  function selectOption (value: string) {
38
36
  emit('update:modelValue', value)
39
37
  animationEnabled.value = true
@@ -64,7 +64,7 @@ const tooltipStyle = computed<CSSProperties>(() => {
64
64
  v-model.number="numberModel"
65
65
  class="htw-range-input htw-appearance-none htw-border-0 htw-bg-transparent htw-cursor-pointer htw-relative htw-w-full htw-m-0 htw-text-gray-700"
66
66
  type="range"
67
- v-bind="{ ...$attrs, class: null, style: null }"
67
+ v-bind="{ ...$attrs, class: null, style: null, min, max }"
68
68
  @mouseover="showTooltip = true"
69
69
  @mouseleave="showTooltip = false"
70
70
  >
@@ -8,7 +8,7 @@ export default {
8
8
  import { ref } from 'vue'
9
9
  import HstWrapper from '../HstWrapper.vue'
10
10
 
11
- const props = defineProps<{
11
+ defineProps<{
12
12
  title?: string
13
13
  modelValue: string
14
14
  }>()
@@ -9,7 +9,7 @@ export default {
9
9
  import { ref } from 'vue'
10
10
  import HstWrapper from '../HstWrapper.vue'
11
11
 
12
- const props = defineProps<{
12
+ defineProps<{
13
13
  title?: string
14
14
  modelValue: string
15
15
  }>()
package/src/index.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { App } from 'vue'
2
1
  import HstCheckboxVue from './components/checkbox/HstCheckbox.vue'
3
2
  import HstTextVue from './components/text/HstText.vue'
4
3
  import HstNumberVue from './components/number/HstNumber.vue'
@@ -16,21 +15,23 @@ export const HstText = HstTextVue
16
15
  export const HstNumber = HstNumberVue
17
16
  export const HstSlider = HstSliderVue
18
17
  export const HstTextarea = HstTextareaVue
18
+ export const HstSelect = HstSelectVue
19
19
  export const HstColorShades = HstColorShadesVue
20
20
  export const HstTokenList = HstTokenListVue
21
21
  export const HstTokenGrid = HstTokenGridVue
22
22
  export const HstCopyIcon = HstCopyIconVue
23
23
  export const HstRadio = HstRadioVue
24
24
 
25
- export function registerVueComponents (app: App) {
26
- app.component('HstCheckbox', HstCheckboxVue)
27
- app.component('HstText', HstTextVue)
28
- app.component('HstNumber', HstNumberVue)
29
- app.component('HstSlider', HstSliderVue)
30
- app.component('HstSelect', HstSelectVue)
31
- app.component('HstTextarea', HstTextareaVue)
32
- app.component('HstColorShades', HstColorShadesVue)
33
- app.component('HstTokenList', HstTokenListVue)
34
- app.component('HstTokenGrid', HstTokenGridVue)
35
- app.component('HstRadio', HstRadioVue)
25
+ export const components = {
26
+ HstCheckbox,
27
+ HstText,
28
+ HstNumber,
29
+ HstSlider,
30
+ HstTextarea,
31
+ HstSelect,
32
+ HstColorShades,
33
+ HstTokenList,
34
+ HstTokenGrid,
35
+ HstCopyIcon,
36
+ HstRadio,
36
37
  }
package/tsconfig.json CHANGED
@@ -29,6 +29,17 @@
29
29
  "strictFunctionTypes": true,
30
30
  // Volar
31
31
  "jsx": "preserve",
32
+ // Alias
33
+ "paths": {
34
+ "floating-vue": ["./node_modules/@histoire/vendors/dist/client/floating-vue"],
35
+ "@iconify/vue": ["./node_modules/@histoire/vendors/dist/client/iconify"],
36
+ "pinia": ["./node_modules/@histoire/vendors/dist/client/pinia"],
37
+ "scroll-into-view-if-needed": ["./node_modules/@histoire/vendors/dist/client/scroll"],
38
+ "shiki": ["./node_modules/@histoire/vendors/dist/client/shiki"],
39
+ "vue-router": ["./node_modules/@histoire/vendors/dist/client/vue-router"],
40
+ "@vueuse/core": ["./node_modules/@histoire/vendors/dist/client/vue-use"],
41
+ "vue": ["./node_modules/@histoire/vendors/dist/client/vue"]
42
+ }
32
43
  },
33
44
  "include": [
34
45
  "src"
package/vite.config.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="@peeky/test"/>
2
1
  /// <reference types="histoire"/>
3
2
 
4
3
  import { defineConfig } from 'vite'
@@ -9,6 +8,19 @@ export default defineConfig({
9
8
  vue(),
10
9
  ],
11
10
 
11
+ resolve: {
12
+ alias: {
13
+ 'floating-vue': '@histoire/vendors/dist/client/floating-vue.js',
14
+ '@iconify/vue': '@histoire/vendors/dist/client/iconify.js',
15
+ pinia: '@histoire/vendors/dist/client/pinia.js',
16
+ 'scroll-into-view-if-needed': '@histoire/vendors/dist/client/scroll.js',
17
+ shiki: '@histoire/vendors/dist/client/shiki.js',
18
+ 'vue-router': '@histoire/vendors/dist/client/vue-router.js',
19
+ '@vueuse/core': '@histoire/vendors/dist/client/vue-use.js',
20
+ vue: '@histoire/vendors/dist/client/vue.js',
21
+ },
22
+ },
23
+
12
24
  build: {
13
25
  emptyOutDir: false,
14
26
 
@@ -23,7 +35,6 @@ export default defineConfig({
23
35
  rollupOptions: {
24
36
  external: [
25
37
  /@histoire/,
26
- 'vue',
27
38
  ],
28
39
  },
29
40
  },
@@ -45,11 +56,4 @@ export default defineConfig({
45
56
  favicon: '/histoire.svg',
46
57
  },
47
58
  },
48
-
49
- test: {
50
- runtimeEnv: 'dom',
51
- previewSetupFiles: [
52
- 'src/peeky-preview.ts',
53
- ],
54
- },
55
59
  })