@veritree/ui 0.12.0 → 0.13.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.
Files changed (73) hide show
  1. package/.prettierignore +96 -0
  2. package/.prettierrc +4 -0
  3. package/index.js +62 -68
  4. package/nuxt.js +11 -8
  5. package/package.json +1 -1
  6. package/src/{Accordion → components/Accordion}/VTAccordion.vue +0 -0
  7. package/src/{Accordion → components/Accordion}/VTAccordionButton.vue +0 -0
  8. package/src/{Accordion → components/Accordion}/VTAccordionGroup.vue +4 -8
  9. package/src/{Accordion → components/Accordion}/VTAccordionPanel.vue +0 -0
  10. package/src/components/Alert/VTAlert.vue +83 -0
  11. package/src/{Avatar → components/Avatar}/VTAvatar.vue +0 -0
  12. package/src/{Avatar → components/Avatar}/VTAvatarImage.vue +0 -0
  13. package/src/{Avatar → components/Avatar}/VTAvatarText.vue +0 -0
  14. package/src/components/Button/VTButton.vue +126 -0
  15. package/src/{Dialog → components/Dialog}/VTDialog.vue +1 -1
  16. package/src/{Dialog → components/Dialog}/VTDialogClose.vue +0 -0
  17. package/src/{Dialog → components/Dialog}/VTDialogContent.vue +1 -1
  18. package/src/{Dialog → components/Dialog}/VTDialogFooter.vue +7 -4
  19. package/src/{Dialog → components/Dialog}/VTDialogHeader.vue +1 -1
  20. package/src/{Dialog → components/Dialog}/VTDialogMain.vue +8 -1
  21. package/src/{Dialog → components/Dialog}/VTDialogOverlay.vue +0 -0
  22. package/src/{Dialog → components/Dialog}/VTDialogTitle.vue +0 -0
  23. package/src/{Drawer → components/Drawer}/VTDrawer.vue +1 -1
  24. package/src/{Drawer → components/Drawer}/VTDrawerClose.vue +0 -0
  25. package/src/{Drawer → components/Drawer}/VTDrawerContent.vue +0 -0
  26. package/src/{Drawer → components/Drawer}/VTDrawerFooter.vue +0 -0
  27. package/src/{Drawer → components/Drawer}/VTDrawerHeader.vue +0 -0
  28. package/src/{Drawer → components/Drawer}/VTDrawerMain.vue +0 -0
  29. package/src/{Drawer → components/Drawer}/VTDrawerOverlay.vue +0 -0
  30. package/src/{Drawer → components/Drawer}/VTDrawerTitle.vue +0 -0
  31. package/src/{DropdownMenu → components/DropdownMenu}/VTDropdownMenu.vue +2 -2
  32. package/src/{DropdownMenu → components/DropdownMenu}/VTDropdownMenuContent.vue +6 -6
  33. package/src/{DropdownMenu → components/DropdownMenu}/VTDropdownMenuDivider.vue +0 -0
  34. package/src/{DropdownMenu → components/DropdownMenu}/VTDropdownMenuGroup.vue +0 -0
  35. package/src/{DropdownMenu → components/DropdownMenu}/VTDropdownMenuItem.vue +6 -6
  36. package/src/{DropdownMenu → components/DropdownMenu}/VTDropdownMenuLabel.vue +0 -0
  37. package/src/{DropdownMenu → components/DropdownMenu}/VTDropdownMenuTrigger.vue +0 -0
  38. package/src/{Form → components/Form}/VTFormFeedback.vue +0 -0
  39. package/src/{Form → components/Form}/VTFormGroup.vue +0 -0
  40. package/src/{Image → components/Image}/VTImage.vue +1 -5
  41. package/src/{Image → components/Image}/VTImageCounter.vue +0 -0
  42. package/src/{Image → components/Image}/VTImageHover.vue +0 -0
  43. package/src/{Input → components/Input}/VTInput.vue +0 -0
  44. package/src/{Input → components/Input}/VTInputDate.vue +0 -0
  45. package/src/{Input → components/Input}/VTInputFile.vue +0 -0
  46. package/src/{Input → components/Input}/VTInputUpload.vue +0 -0
  47. package/src/{Listbox → components/Listbox}/VTListbox.vue +4 -4
  48. package/src/{Listbox → components/Listbox}/VTListboxContent.vue +5 -5
  49. package/src/{Listbox → components/Listbox}/VTListboxItem.vue +4 -4
  50. package/src/{Listbox → components/Listbox}/VTListboxLabel.vue +0 -0
  51. package/src/{Listbox → components/Listbox}/VTListboxList.vue +3 -3
  52. package/src/{Listbox → components/Listbox}/VTListboxSearch.vue +0 -0
  53. package/src/{Listbox → components/Listbox}/VTListboxTrigger.vue +0 -0
  54. package/src/{Modal → components/Modal}/VTModal.vue +0 -0
  55. package/src/{Popover → components/Popover}/VTPopover.vue +2 -2
  56. package/src/{Popover → components/Popover}/VTPopoverContent.vue +6 -7
  57. package/src/{Popover → components/Popover}/VTPopoverDivider.vue +0 -0
  58. package/src/{Popover → components/Popover}/VTPopoverGroup.vue +0 -0
  59. package/src/{Popover → components/Popover}/VTPopoverItem.vue +0 -0
  60. package/src/{Popover → components/Popover}/VTPopoverTrigger.vue +0 -0
  61. package/src/{Spinner → components/Spinner}/VTSpinner.vue +0 -0
  62. package/src/{Tabs → components/Tabs}/VTTab.vue +4 -4
  63. package/src/{Tabs → components/Tabs}/VTTabGroup.vue +0 -0
  64. package/src/{Tabs → components/Tabs}/VTTabList.vue +0 -0
  65. package/src/{Tabs → components/Tabs}/VTTabPanel.vue +0 -0
  66. package/src/{Tabs → components/Tabs}/VTTabPanels.vue +0 -0
  67. package/src/{Textarea → components/Textarea}/VTTextarea.vue +0 -0
  68. package/src/{Transitions → components/Transitions}/FadeInOut.vue +0 -0
  69. package/src/{icons → components/icons}/IconChevronDown.vue +0 -0
  70. package/src/{icons → components/icons}/IconChevronUp.vue +0 -0
  71. package/src/Alerts/VTAlert.vue +0 -72
  72. package/src/Button/VTButton.vue +0 -86
  73. package/src/Button/VTButtonSave.vue +0 -27
@@ -0,0 +1,96 @@
1
+ ###
2
+ # Place your Prettier ignore content here
3
+
4
+ ###
5
+ # .gitignore content is duplicated here due to https://github.com/prettier/prettier/issues/8506
6
+
7
+ # Created by .ignore support plugin (hsz.mobi)
8
+ ### Node template
9
+ # Logs
10
+ /logs
11
+ *.log
12
+ npm-debug.log*
13
+ yarn-debug.log*
14
+ yarn-error.log*
15
+
16
+ # Runtime data
17
+ pids
18
+ *.pid
19
+ *.seed
20
+ *.pid.lock
21
+
22
+ # Directory for instrumented libs generated by jscoverage/JSCover
23
+ lib-cov
24
+
25
+ # Coverage directory used by tools like istanbul
26
+ coverage
27
+
28
+ # nyc test coverage
29
+ .nyc_output
30
+
31
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
32
+ .grunt
33
+
34
+ # Bower dependency directory (https://bower.io/)
35
+ bower_components
36
+
37
+ # node-waf configuration
38
+ .lock-wscript
39
+
40
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
41
+ build/Release
42
+
43
+ # Dependency directories
44
+ node_modules/
45
+ jspm_packages/
46
+
47
+ # TypeScript v1 declaration files
48
+ typings/
49
+
50
+ # Optional npm cache directory
51
+ .npm
52
+
53
+ # Optional eslint cache
54
+ .eslintcache
55
+
56
+ # Optional REPL history
57
+ .node_repl_history
58
+
59
+ # Output of 'npm pack'
60
+ *.tgz
61
+
62
+ # Yarn Integrity file
63
+ .yarn-integrity
64
+
65
+ # dotenv environment variables file
66
+ .env
67
+
68
+ # parcel-bundler cache (https://parceljs.org/)
69
+ .cache
70
+
71
+ # next.js build output
72
+ .next
73
+
74
+ # nuxt.js build output
75
+ .nuxt
76
+
77
+ # Nuxt generate
78
+ dist
79
+
80
+ # vuepress build output
81
+ .vuepress/dist
82
+
83
+ # Serverless directories
84
+ .serverless
85
+
86
+ # IDE / Editor
87
+ .idea
88
+
89
+ # Service worker
90
+ sw.*
91
+
92
+ # macOS
93
+ .DS_Store
94
+
95
+ # Vim swap files
96
+ *.swp
package/.prettierrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "semi": true,
3
+ "singleQuote": true
4
+ }
package/index.js CHANGED
@@ -1,76 +1,71 @@
1
- import VTAvatar from "./src/Avatar/VTAvatar.vue";
2
- import VTAvatarImage from "./src/Avatar/VTAvatarImage.vue";
3
- import VTAvatarText from "./src/Avatar/VTAvatarText.vue";
4
- import VTImage from "./src/Image/VTImage.vue";
5
- import VTImageCounter from "./src/Image/VTImageCounter.vue";
6
- import VTImageHover from "./src/Image/VTImageHover.vue";
7
- import VTDropdownMenu from "./src/DropdownMenu/VTDropdownMenu.vue";
8
- import VTDropdownMenuContent from "./src/DropdownMenu/VTDropdownMenuContent.vue";
9
- import VTDropdownMenuDivider from "./src/DropdownMenu/VTDropdownMenuDivider.vue";
10
- import VTDropdownMenuGroup from "./src/DropdownMenu/VTDropdownMenuGroup.vue";
11
- import VTDropdownMenuItem from "./src/DropdownMenu/VTDropdownMenuItem.vue";
12
- import VTDropdownMenuLabel from "./src/DropdownMenu/VTDropdownMenuLabel.vue";
13
- import VTDropdownMenuTrigger from "./src/DropdownMenu/VTDropdownMenuTrigger.vue";
14
- import VTPopover from "./src/Popover/VTPopover.vue";
15
- import VTPopoverContent from "./src/Popover/VTPopoverContent.vue";
16
- import VTPopoverDivider from "./src/Popover/VTPopoverDivider.vue";
17
- import VTPopoverGroup from "./src/Popover/VTPopoverGroup.vue";
18
- import VTPopoverItem from "./src/Popover/VTPopoverItem.vue";
19
- import VTPopoverTrigger from "./src/Popover/VTPopoverTrigger.vue";
20
- import VTFormFeedback from "./src/Form/VTFormFeedback.vue";
21
- import VTFormGroup from "./src/Form/VTFormGroup.vue";
22
- import VTListbox from "./src/Listbox/VTListbox.vue";
23
- import VTListboxContent from "./src/Listbox/VTListboxContent.vue";
24
- import VTListboxItem from "./src/Listbox/VTListboxItem.vue";
25
- import VTListboxLabel from "./src/Listbox/VTListboxLabel.vue";
26
- import VTListboxList from "./src/Listbox/VTListboxList.vue";
27
- import VTListboxSearch from "./src/Listbox/VTListboxSearch.vue";
28
- import VTListboxTrigger from "./src/Listbox/VTListboxTrigger.vue";
1
+ import VTAlert from "./src/components/Alert/VTAlert.vue";
2
+ import VTAvatar from "./src/components/Avatar/VTAvatar.vue";
3
+ import VTAvatarImage from "./src/components/Avatar/VTAvatarImage.vue";
4
+ import VTAvatarText from "./src/components/Avatar/VTAvatarText.vue";
5
+ import VTButton from "./src/components/Button/VTButton.vue";
6
+ import VTImage from "./src/components/Image/VTImage.vue";
7
+ import VTImageCounter from "./src/components/Image/VTImageCounter.vue";
8
+ import VTImageHover from "./src/components/Image/VTImageHover.vue";
9
+ import VTDropdownMenu from "./src/components/DropdownMenu/VTDropdownMenu.vue";
10
+ import VTDropdownMenuContent from "./src/components/DropdownMenu/VTDropdownMenuContent.vue";
11
+ import VTDropdownMenuDivider from "./src/components/DropdownMenu/VTDropdownMenuDivider.vue";
12
+ import VTDropdownMenuGroup from "./src/components/DropdownMenu/VTDropdownMenuGroup.vue";
13
+ import VTDropdownMenuItem from "./src/components/DropdownMenu/VTDropdownMenuItem.vue";
14
+ import VTDropdownMenuLabel from "./src/components/DropdownMenu/VTDropdownMenuLabel.vue";
15
+ import VTDropdownMenuTrigger from "./src/components/DropdownMenu/VTDropdownMenuTrigger.vue";
16
+ import VTPopover from "./src/components/Popover/VTPopover.vue";
17
+ import VTPopoverContent from "./src/components/Popover/VTPopoverContent.vue";
18
+ import VTPopoverDivider from "./src/components/Popover/VTPopoverDivider.vue";
19
+ import VTPopoverGroup from "./src/components/Popover/VTPopoverGroup.vue";
20
+ import VTPopoverItem from "./src/components/Popover/VTPopoverItem.vue";
21
+ import VTPopoverTrigger from "./src/components/Popover/VTPopoverTrigger.vue";
22
+ import VTFormFeedback from "./src/components/Form/VTFormFeedback.vue";
23
+ import VTFormGroup from "./src/components/Form/VTFormGroup.vue";
24
+ import VTListbox from "./src/components/Listbox/VTListbox.vue";
25
+ import VTListboxContent from "./src/components/Listbox/VTListboxContent.vue";
26
+ import VTListboxItem from "./src/components/Listbox/VTListboxItem.vue";
27
+ import VTListboxLabel from "./src/components/Listbox/VTListboxLabel.vue";
28
+ import VTListboxList from "./src/components/Listbox/VTListboxList.vue";
29
+ import VTListboxSearch from "./src/components/Listbox/VTListboxSearch.vue";
30
+ import VTListboxTrigger from "./src/components/Listbox/VTListboxTrigger.vue";
31
+ import VTSpinner from "./src/components/Spinner/VTSpinner.vue";
32
+ import VTInput from "./src/components/Input/VTInput.vue";
33
+ import VTInputDate from "./src/components/Input/VTInputDate.vue";
34
+ import VTInputFile from "./src/components/Input/VTInputFile.vue";
35
+ import VTInputUpload from "./src/components/Input/VTInputUpload.vue";
29
36
 
30
- import VTAlert from "./src/Alerts/VTAlert.vue";
37
+ import VTTextarea from "./src/components/Textarea/VTTextarea.vue";
31
38
 
32
- import VTSpinner from "./src/Spinner/VTSpinner.vue";
39
+ import VTModal from "./src/components/Modal/VTModal.vue";
33
40
 
34
- import VTButton from "./src/Button/VTButton.vue";
35
- // import VTButtonSave from './src/Button/VTButtonSave.vue';
41
+ import VTAccordion from "./src/components/Accordion/VTAccordion.vue";
42
+ import VTAccordionButton from "./src/components/Accordion/VTAccordionButton.vue";
43
+ import VTAccordionGroup from "./src/components/Accordion/VTAccordionGroup.vue";
44
+ import VTAccordionPanel from "./src/components/Accordion/VTAccordionPanel.vue";
36
45
 
37
- import VTInput from "./src/Input/VTInput.vue";
38
- import VTInputDate from "./src/Input/VTInputDate.vue";
39
- import VTInputFile from "./src/Input/VTInputFile.vue";
40
- import VTInputUpload from "./src/Input/VTInputUpload.vue";
46
+ import VTTab from "./src/components/Tabs/VTTab.vue";
47
+ import VTTabGroup from "./src/components/Tabs/VTTabGroup.vue";
48
+ import VTTabList from "./src/components/Tabs/VTTabList.vue";
49
+ import VTTabPanel from "./src/components/Tabs/VTTabPanel.vue";
50
+ import VTTabPanels from "./src/components/Tabs/VTTabPanels.vue";
41
51
 
42
- import VTTextarea from "./src/Textarea/VTTextarea.vue";
52
+ import VTDialog from "./src/components/Dialog/VTDialog.vue";
53
+ import VTDialogClose from "./src/components/Dialog/VTDialogClose.vue";
54
+ import VTDialogContent from "./src/components/Dialog/VTDialogContent.vue";
55
+ import VTDialogFooter from "./src/components/Dialog/VTDialogFooter.vue";
56
+ import VTDialogHeader from "./src/components/Dialog/VTDialogHeader.vue";
57
+ import VTDialogMain from "./src/components/Dialog/VTDialogMain.vue";
58
+ import VTDialogOverlay from "./src/components/Dialog/VTDialogOverlay.vue";
59
+ import VTDialogTitle from "./src/components/Dialog/VTDialogTitle.vue";
43
60
 
44
- import VTModal from "./src/Modal/VTModal.vue";
45
-
46
- import VTAccordion from "./src/Accordion/VTAccordion.vue";
47
- import VTAccordionButton from "./src/Accordion/VTAccordionButton.vue";
48
- import VTAccordionGroup from "./src/Accordion/VTAccordionGroup.vue";
49
- import VTAccordionPanel from "./src/Accordion/VTAccordionPanel.vue";
50
-
51
- import VTTab from "./src/Tabs/VTTab.vue";
52
- import VTTabGroup from "./src/Tabs/VTTabGroup.vue";
53
- import VTTabList from "./src/Tabs/VTTabList.vue";
54
- import VTTabPanel from "./src/Tabs/VTTabPanel.vue";
55
- import VTTabPanels from "./src/Tabs/VTTabPanels.vue";
56
-
57
- import VTDialog from "./src/Dialog/VTDialog.vue";
58
- import VTDialogClose from "./src/Dialog/VTDialogClose.vue";
59
- import VTDialogContent from "./src/Dialog/VTDialogContent.vue";
60
- import VTDialogFooter from "./src/Dialog/VTDialogFooter.vue";
61
- import VTDialogHeader from "./src/Dialog/VTDialogHeader.vue";
62
- import VTDialogMain from "./src/Dialog/VTDialogMain.vue";
63
- import VTDialogOverlay from "./src/Dialog/VTDialogOverlay.vue";
64
- import VTDialogTitle from "./src/Dialog/VTDialogTitle.vue";
65
-
66
- import VTDrawer from "./src/Drawer/VTDrawer.vue";
67
- import VTDrawerClose from "./src/Drawer/VTDrawerClose.vue";
68
- import VTDrawerContent from "./src/Drawer/VTDrawerContent.vue";
69
- import VTDrawerFooter from "./src/Drawer/VTDrawerFooter.vue";
70
- import VTDrawerHeader from "./src/Drawer/VTDrawerHeader.vue";
71
- import VTDrawerTitle from "./src/Drawer/VTDrawerTitle.vue";
72
- import VTDrawerMain from "./src/Drawer/VTDrawerMain.vue";
73
- import VTDrawerOverlay from "./src/Drawer/VTDrawerOverlay.vue";
61
+ import VTDrawer from "./src/components/Drawer/VTDrawer.vue";
62
+ import VTDrawerClose from "./src/components/Drawer/VTDrawerClose.vue";
63
+ import VTDrawerContent from "./src/components/Drawer/VTDrawerContent.vue";
64
+ import VTDrawerFooter from "./src/components/Drawer/VTDrawerFooter.vue";
65
+ import VTDrawerHeader from "./src/components/Drawer/VTDrawerHeader.vue";
66
+ import VTDrawerTitle from "./src/components/Drawer/VTDrawerTitle.vue";
67
+ import VTDrawerMain from "./src/components/Drawer/VTDrawerMain.vue";
68
+ import VTDrawerOverlay from "./src/components/Drawer/VTDrawerOverlay.vue";
74
69
 
75
70
  export {
76
71
  VTAvatar,
@@ -104,7 +99,6 @@ export {
104
99
  VTListboxSearch,
105
100
  VTListboxTrigger,
106
101
  VTButton,
107
- // VTButtonSave,
108
102
  VTInput,
109
103
  VTInputDate,
110
104
  VTInputFile,
package/nuxt.js CHANGED
@@ -1,14 +1,17 @@
1
1
  import { join } from 'path';
2
2
 
3
3
  const components = [
4
- 'src/Avatar',
5
- 'src/Drawer',
6
- 'src/Dialog',
7
- 'src/DropdownMenu',
8
- 'src/Form',
9
- 'src/Listbox',
10
- 'src/Image',
11
- 'src/Tabs',
4
+ 'src/components/Alert',
5
+ 'src/components/Avatar',
6
+ 'src/components/Button',
7
+ 'src/components/Drawer',
8
+ 'src/components/Dialog',
9
+ 'src/components/DropdownMenu',
10
+ 'src/components/Form',
11
+ 'src/components/Listbox',
12
+ 'src/components/Image',
13
+ 'src/components/Popover',
14
+ 'src/components/Tabs',
12
15
  ]
13
16
 
14
17
  export default function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/ui",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,18 +1,15 @@
1
1
  <template>
2
- <div
3
- :id="id"
4
- class="accordion-group"
5
- >
2
+ <div :id="id" class="accordion-group">
6
3
  <slot></slot>
7
4
  </div>
8
5
  </template>
9
6
 
10
7
  <script>
11
- import { genId } from '../utils/genId';
8
+ import { genId } from "../../utils/genId";
12
9
 
13
10
  export default {
14
- name: 'VTAccordionGroup',
15
- inject: ['api'],
11
+ name: "VTAccordionGroup",
12
+ inject: ["api"],
16
13
 
17
14
  data() {
18
15
  return {
@@ -24,6 +21,5 @@ export default {
24
21
  mounted() {
25
22
  this.api.registerAccordionGroup(this);
26
23
  },
27
-
28
24
  };
29
25
  </script>
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div
3
+ v-if="show"
4
+ :class="[
5
+ // default styles
6
+ headless
7
+ ? 'alert'
8
+ : 'flex items-start gap-3 rounded border border-solid p-3',
9
+ // variant styles
10
+ headless
11
+ ? `alert--${variant}`
12
+ : isSuccess
13
+ ? 'border-success-300 bg-success-200 text-success-700'
14
+ : isError
15
+ ? 'border-error-300 bg-error-200 text-error-700'
16
+ : isWarning
17
+ ? 'border-warning-300 bg-warning-200 text-warning-700'
18
+ : null,
19
+ ]"
20
+ role="alert"
21
+ >
22
+ <slot></slot>
23
+ <button
24
+ v-if="dismissable"
25
+ :class="[
26
+ !headless
27
+ ? 'ml-auto mt-1 h-4 w-4 shrink-0 text-current'
28
+ : 'alert-close',
29
+ ]"
30
+ @click="hide"
31
+ >
32
+ <IconClose />
33
+ </button>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ export default {
39
+ name: 'VTAlert',
40
+
41
+ props: {
42
+ variant: {
43
+ type: String,
44
+ default: 'success',
45
+ },
46
+ headless: {
47
+ type: Boolean,
48
+ default: false,
49
+ },
50
+ dismissable: {
51
+ type: Boolean,
52
+ default: false,
53
+ },
54
+ },
55
+
56
+ data() {
57
+ return {
58
+ show: true,
59
+ };
60
+ },
61
+
62
+ computed: {
63
+ isSuccess() {
64
+ return this.variant === 'success';
65
+ },
66
+
67
+ isError() {
68
+ return this.variant === 'error';
69
+ },
70
+
71
+ isWarning() {
72
+ return this.variant === 'warning';
73
+ },
74
+ },
75
+
76
+ methods: {
77
+ hide() {
78
+ this.$emit('dismiss');
79
+ this.show = false;
80
+ },
81
+ },
82
+ };
83
+ </script>
File without changes
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <component
3
+ :is="tag"
4
+ :to="to"
5
+ :type="type"
6
+ :disabled="isDisabled"
7
+ :class="[
8
+ // default styles
9
+ headless
10
+ ? 'button'
11
+ : isIcon
12
+ ? 'inline-flex items-center justify-center rounded-full [&_svg]:max-h-full [&_svg]:max-w-full'
13
+ : 'relative inline-flex rounded border border-solid px-4 text-sm font-semibold leading-none no-underline transition-all',
14
+ // variant styles
15
+ headless
16
+ ? `button--${variant}`
17
+ : isPrimary
18
+ ? 'border-transparent bg-secondary-400 text-white hover:bg-secondary-500 active:bg-secondary-600 disabled:bg-gray-200 disabled:text-gray-400'
19
+ : isSecondary
20
+ ? 'border-gray-400 bg-white text-gray-700 hover:bg-gray-100 active:bg-gray-200 disabled:border-gray-300 disabled:text-gray-400'
21
+ : isTertiary
22
+ ? 'border-transparent text-secondary-400 hover:text-secondary-500 active:text-secondary-500 disabled:text-gray-400'
23
+ : isIcon
24
+ ? 'text-primary-100 focus-within:bg-gray-200 hover:bg-gray-200 active:bg-gray-300'
25
+ : null,
26
+ // sizes styles
27
+ headless
28
+ ? `button--${size}`
29
+ : isLarge
30
+ ? isIcon
31
+ ? 'h-8 w-8'
32
+ : 'h-10'
33
+ : isSmall
34
+ ? isIcon
35
+ ? 'h-6 w-6 p-1'
36
+ : 'h-8'
37
+ : null,
38
+ ]"
39
+ v-on="$listeners"
40
+ >
41
+ <VTSpinner v-if="busy" class="absolute inset-0 m-auto" />
42
+ <span
43
+ :class="[
44
+ headless ? null : 'inline-flex items-center gap-2 self-center mx-auto',
45
+ headless && busy ? 'button--busy' : busy ? 'invisible' : null,
46
+ ]"
47
+ >
48
+ <slot></slot>
49
+ </span>
50
+ </component>
51
+ </template>
52
+
53
+ <script>
54
+ import VTSpinner from '../Spinner/VTSpinner.vue';
55
+
56
+ export default {
57
+ name: 'VTButton',
58
+
59
+ components: { VTSpinner },
60
+
61
+ props: {
62
+ variant: {
63
+ type: String,
64
+ default: 'primary',
65
+ },
66
+ size: {
67
+ type: String,
68
+ default: 'large',
69
+ },
70
+ to: {
71
+ type: [String, Object],
72
+ default: null,
73
+ },
74
+ headless: {
75
+ type: Boolean,
76
+ default: false,
77
+ },
78
+ busy: {
79
+ type: Boolean,
80
+ default: false,
81
+ },
82
+ disabled: {
83
+ type: Boolean,
84
+ default: false,
85
+ },
86
+ },
87
+
88
+ computed: {
89
+ isPrimary() {
90
+ return this.variant === 'primary';
91
+ },
92
+
93
+ isSecondary() {
94
+ return this.variant === 'secondary';
95
+ },
96
+
97
+ isTertiary() {
98
+ return this.variant === 'tertiary';
99
+ },
100
+
101
+ isIcon() {
102
+ return this.variant === 'icon';
103
+ },
104
+
105
+ isLarge() {
106
+ return this.size === 'large';
107
+ },
108
+
109
+ isSmall() {
110
+ return this.size === 'small';
111
+ },
112
+
113
+ isDisabled() {
114
+ return this.disabled || this.busy;
115
+ },
116
+
117
+ tag() {
118
+ return this.to ? 'NuxtLink' : 'button';
119
+ },
120
+
121
+ type() {
122
+ return this.to ? null : 'button';
123
+ },
124
+ },
125
+ };
126
+ </script>
@@ -14,7 +14,7 @@
14
14
  </template>
15
15
 
16
16
  <script>
17
- import { genId } from "~/utils/ids";
17
+ import { genId } from "../../utils/ids";
18
18
 
19
19
  export default {
20
20
  name: "VTDialog",
@@ -13,7 +13,7 @@
13
13
  :id="id"
14
14
  :class="{
15
15
  'Dialog-content': headless,
16
- 'relative m-auto max-h-full max-w-full overflow-auto rounded p-6 focus:outline-none sm:p-10':
16
+ 'relative m-auto max-h-full max-w-full overflow-auto rounded p-6 focus:outline-none sm:p-10 flex flex-col':
17
17
  !headless,
18
18
  'bg-white': !dark,
19
19
  'bg-fd-600': dark,
@@ -1,19 +1,22 @@
1
1
  <template>
2
- <component :is="as" :class="{ 'Dialog-footer': headless }">
2
+ <component
3
+ :is="as"
4
+ :class="{ 'Dialog-footer': headless, 'w-full': !headless }"
5
+ >
3
6
  <slot></slot>
4
7
  </component>
5
8
  </template>
6
9
 
7
10
  <script>
8
11
  export default {
9
- name: 'VTDialogFooter',
12
+ name: "VTDialogFooter",
10
13
 
11
- inject: ['api'],
14
+ inject: ["api"],
12
15
 
13
16
  props: {
14
17
  as: {
15
18
  type: String,
16
- default: 'footer',
19
+ default: "footer",
17
20
  },
18
21
  },
19
22
 
@@ -4,7 +4,7 @@
4
4
  :id="id"
5
5
  :class="{
6
6
  'Dialog-header': headless,
7
- 'mb-8 flex justify-between gap-x-3 items-center': !headless,
7
+ 'mb-8 flex justify-between gap-x-3 items-center w-full': !headless,
8
8
  }"
9
9
  >
10
10
  <slot></slot>
@@ -1,5 +1,12 @@
1
1
  <template>
2
- <component :is="as" :id="id" :class="{ 'Dialog-body': headless }">
2
+ <component
3
+ :is="as"
4
+ :id="id"
5
+ :class="{
6
+ 'Dialog-body': headless,
7
+ 'flex-1 w-full h-full overflow-y-auto': !headless,
8
+ }"
9
+ >
3
10
  <slot></slot>
4
11
  </component>
5
12
  </template>
@@ -11,7 +11,7 @@
11
11
  </template>
12
12
 
13
13
  <script>
14
- import { genId } from "~/utils/ids";
14
+ import { genId } from "../../utils/ids";
15
15
 
16
16
  export default {
17
17
  name: "VTDrawer",
@@ -5,10 +5,10 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import { genId } from '~/utils/ids';
8
+ import { genId } from "../../utils/ids";
9
9
 
10
10
  export default {
11
- name: 'VTDropdownMenu',
11
+ name: "VTDropdownMenu",
12
12
 
13
13
  provide() {
14
14
  return {
@@ -27,12 +27,12 @@
27
27
  </template>
28
28
 
29
29
  <script>
30
- import { genId } from '~/utils/ids';
30
+ import { genId } from "../../utils/ids";
31
31
 
32
32
  export default {
33
- name: 'VTDropdownMenuContent',
33
+ name: "VTDropdownMenuContent",
34
34
 
35
- inject: ['api'],
35
+ inject: ["api"],
36
36
 
37
37
  data() {
38
38
  return {
@@ -67,7 +67,7 @@ export default {
67
67
  });
68
68
 
69
69
  // TODO: Create a directive or mixin for this
70
- document.addEventListener('click', (e) => {
70
+ document.addEventListener("click", (e) => {
71
71
  e.stopPropagation();
72
72
  if (this.visible && !this.$el.contains(e.target)) this.trigger.onClick();
73
73
  });
@@ -75,7 +75,7 @@ export default {
75
75
 
76
76
  destroyed() {
77
77
  // TODO: Create a directive or mixin for this
78
- document.removeEventListener('click', this.trigger.onClick());
78
+ document.removeEventListener("click", this.trigger.onClick());
79
79
  },
80
80
 
81
81
  methods: {
@@ -85,7 +85,7 @@ export default {
85
85
 
86
86
  hide() {
87
87
  this.visible = false;
88
- this.$emit('hidden');
88
+ this.$emit("hidden");
89
89
  this.api().unregisterItems();
90
90
  },
91
91
  },
@@ -5,7 +5,7 @@
5
5
  :to="to"
6
6
  :class="{
7
7
  MenuItem: headless,
8
- '-mx-3 flex min-w-max items-center gap-2 px-3 py-2 text-inherit no-underline':
8
+ '-mx-3 flex min-w-max items-center gap-3 px-3 py-2 text-inherit no-underline':
9
9
  !headless,
10
10
  'hover:bg-secondary-200/10': !dark,
11
11
  'text-white hover:bg-fd-450 focus:bg-fd-450': dark,
@@ -28,12 +28,12 @@
28
28
  </template>
29
29
 
30
30
  <script>
31
- import { genId } from '~/utils/ids';
31
+ import { genId } from "../../utils/ids";
32
32
 
33
33
  export default {
34
- name: 'VTDropdownMenuItem',
34
+ name: "VTDropdownMenuItem",
35
35
 
36
- inject: ['api'],
36
+ inject: ["api"],
37
37
 
38
38
  props: {
39
39
  to: {
@@ -68,7 +68,7 @@ export default {
68
68
  },
69
69
 
70
70
  as() {
71
- return this.href ? 'a' : this.to ? 'NuxtLink' : 'button';
71
+ return this.href ? "a" : this.to ? "NuxtLink" : "button";
72
72
  },
73
73
 
74
74
  items() {
@@ -163,7 +163,7 @@ export default {
163
163
  onClick() {
164
164
  if (this.disabled) return;
165
165
 
166
- this.$emit('click');
166
+ this.$emit("click");
167
167
  this.$nextTick(() => this.leaveMenu());
168
168
  },
169
169
  },
File without changes
File without changes
@@ -9,7 +9,7 @@
9
9
  </template>
10
10
 
11
11
  <script>
12
- import { handleImageResizing } from "../utils/images";
12
+ import { handleImageResizing } from "../../utils/images";
13
13
 
14
14
  export default {
15
15
  name: "VTImage",
@@ -58,10 +58,6 @@ export default {
58
58
  },
59
59
  },
60
60
 
61
- mounted() {
62
- console.log("mounted");
63
- },
64
-
65
61
  methods: {
66
62
  handleImageResizing,
67
63
 
File without changes
File without changes
File without changes
File without changes
@@ -5,10 +5,10 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import { genId } from '~/utils/ids';
8
+ import { genId } from "../../utils/ids";
9
9
 
10
10
  export default {
11
- name: 'VTListbox',
11
+ name: "VTListbox",
12
12
 
13
13
  provide() {
14
14
  return {
@@ -47,8 +47,8 @@ export default {
47
47
  };
48
48
 
49
49
  const emit = (value) => {
50
- this.$emit('input', value);
51
- this.$emit('change', value);
50
+ this.$emit("input", value);
51
+ this.$emit("change", value);
52
52
  };
53
53
 
54
54
  return {
@@ -32,12 +32,12 @@
32
32
  </template>
33
33
 
34
34
  <script>
35
- import { genId } from '~/utils/ids';
35
+ import { genId } from "../../utils/ids";
36
36
 
37
37
  export default {
38
- name: 'VTListboxContent',
38
+ name: "VTListboxContent",
39
39
 
40
- inject: ['api'],
40
+ inject: ["api"],
41
41
 
42
42
  props: {
43
43
  headless: {
@@ -104,7 +104,7 @@ export default {
104
104
  this.api().registerContent(content);
105
105
 
106
106
  // TODO: Create a directive or mixin for this
107
- document.addEventListener('click', (e) => {
107
+ document.addEventListener("click", (e) => {
108
108
  e.stopPropagation();
109
109
  if (this.visible && !this.$el.contains(e.target)) this.trigger.onClick();
110
110
  });
@@ -112,7 +112,7 @@ export default {
112
112
 
113
113
  destroyed() {
114
114
  // TODO: Create a directive or mixin for this
115
- document.removeEventListener('click', this.trigger.onClick());
115
+ document.removeEventListener("click", this.trigger.onClick());
116
116
  },
117
117
 
118
118
  methods: {
@@ -29,13 +29,13 @@
29
29
  </template>
30
30
 
31
31
  <script>
32
- import { scrollElementIntoView } from '~/utils/components';
33
- import { genId } from '~/utils/ids';
32
+ import { scrollElementIntoView } from "../../utils/components";
33
+ import { genId } from "../../utils/ids";
34
34
 
35
35
  export default {
36
- name: 'VTListboxItem',
36
+ name: "VTListboxItem",
37
37
 
38
- inject: ['api'],
38
+ inject: ["api"],
39
39
 
40
40
  props: {
41
41
  headless: {
@@ -11,12 +11,12 @@
11
11
  </template>
12
12
 
13
13
  <script>
14
- import { genId } from '~/utils/ids';
14
+ import { genId } from "../../utils/ids";
15
15
 
16
16
  export default {
17
- name: 'VTListboxList',
17
+ name: "VTListboxList",
18
18
 
19
- inject: ['api'],
19
+ inject: ["api"],
20
20
 
21
21
  props: {
22
22
  headless: {
File without changes
@@ -10,10 +10,10 @@
10
10
  </template>
11
11
 
12
12
  <script>
13
- import { genId } from '~/utils/ids';
13
+ import { genId } from "../../utils/ids";
14
14
 
15
15
  export default {
16
- name: 'VTPopover',
16
+ name: "VTPopover",
17
17
 
18
18
  provide() {
19
19
  return {
@@ -13,8 +13,7 @@
13
13
  :id="id"
14
14
  :class="{
15
15
  PopoverPanel: headless,
16
- 'absolute top-full mt-3 rounded-md shadow-300 ':
17
- !headless,
16
+ 'absolute top-full mt-3 rounded-md shadow-300 ': !headless,
18
17
  'bg-white': !dark,
19
18
  'border-gray-700 bg-forest-default shadow-gray-700': dark,
20
19
  'left-0': !right,
@@ -27,12 +26,12 @@
27
26
  </template>
28
27
 
29
28
  <script>
30
- import { genId } from '~/utils/ids';
29
+ import { genId } from "../../utils/ids";
31
30
 
32
31
  export default {
33
- name: 'VTPopoverContent',
32
+ name: "VTPopoverContent",
34
33
 
35
- inject: ['api'],
34
+ inject: ["api"],
36
35
 
37
36
  data() {
38
37
  return {
@@ -59,7 +58,7 @@ export default {
59
58
  this.api().registerContent(this);
60
59
 
61
60
  // TODO: Create a directive or mixin for this
62
- document.addEventListener('click', (e) => {
61
+ document.addEventListener("click", (e) => {
63
62
  e.stopPropagation();
64
63
  if (this.visible && !this.$el.contains(e.target)) this.hide();
65
64
  });
@@ -67,7 +66,7 @@ export default {
67
66
 
68
67
  destroyed() {
69
68
  // TODO: Create a directive or mixin for this
70
- document.removeEventListener('click', this.hide());
69
+ document.removeEventListener("click", this.hide());
71
70
  },
72
71
 
73
72
  methods: {
@@ -14,12 +14,12 @@
14
14
  </template>
15
15
 
16
16
  <script>
17
- import { keys } from '../utils/keyboard';
17
+ import { keys } from "../../utils/keyboard";
18
18
 
19
19
  export default {
20
- name: 'VTTabItem',
20
+ name: "VTTabItem",
21
21
 
22
- inject: ['api'],
22
+ inject: ["api"],
23
23
 
24
24
  data() {
25
25
  return {
@@ -85,7 +85,7 @@ export default {
85
85
 
86
86
  onClick() {
87
87
  this.api.selectTab(this.index);
88
- this.$emit('change');
88
+ this.$emit("change");
89
89
  },
90
90
 
91
91
  onKeyDown(event) {
File without changes
File without changes
File without changes
File without changes
@@ -1,72 +0,0 @@
1
- <template>
2
- <div v-if="isVisible" class="Alert" :class="classes" role="alert">
3
- <slot></slot>
4
- <button v-if="dismissable" class="Alert-close" @click="dismiss">
5
- <IconClose />
6
- </button>
7
- </div>
8
- </template>
9
-
10
- <script>
11
- import { IconClose } from '@veritree/icons';
12
-
13
- export default {
14
- name: 'VTAlert',
15
-
16
- components: { IconClose },
17
-
18
- model: {
19
- prop: 'value',
20
- },
21
-
22
- props: {
23
- dismissable: {
24
- type: Boolean,
25
- default: false,
26
- },
27
- variant: {
28
- type: String,
29
- default: '',
30
- validate(value) {
31
- if (value === '') return true;
32
- return ['success', 'warning', 'error'].includes(value);
33
- },
34
- },
35
- value: {
36
- type: Boolean,
37
- default: false,
38
- },
39
- },
40
-
41
- data() {
42
- return {
43
- destroy: false,
44
- };
45
- },
46
-
47
- computed: {
48
- classes() {
49
- return {
50
- [`Alert--${this.variant}`]: this.variant,
51
- };
52
- },
53
-
54
- isVisible() {
55
- return this.value && !this.destroy;
56
- },
57
- },
58
-
59
- watch: {
60
- isVisible(newVal) {
61
- if (newVal === false) this.destroy = false;
62
- },
63
- },
64
-
65
- methods: {
66
- dismiss() {
67
- this.destroy = true;
68
- this.$emit('input', false);
69
- },
70
- },
71
- };
72
- </script>
@@ -1,86 +0,0 @@
1
- <template>
2
- <component
3
- :is="tag"
4
- :class="classes"
5
- :data-theme="theme"
6
- :to="to"
7
- class="Button"
8
- type="button"
9
- v-on="$listeners"
10
- >
11
- <slot></slot>
12
- </component>
13
- </template>
14
-
15
- <script>
16
- export default {
17
- name: 'VTButton',
18
-
19
- props: {
20
- variant: {
21
- type: String,
22
- default: 'primary',
23
- validator(value) {
24
- return [
25
- 'primary',
26
- 'secondary',
27
- 'tertiary',
28
- 'danger',
29
- 'custom',
30
- 'icon',
31
- ].includes(value);
32
- },
33
- },
34
- size: {
35
- type: String,
36
- default: 'large',
37
- validator(value) {
38
- return ['large', 'small'].includes(value);
39
- },
40
- },
41
- pill: {
42
- type: Boolean,
43
- default: false,
44
- },
45
- theme: {
46
- type: String,
47
- default: null,
48
- validator(value) {
49
- return ['dark'].includes(value);
50
- },
51
- },
52
- to: {
53
- type: [String, Object],
54
- default: null,
55
- },
56
- },
57
-
58
- computed: {
59
- classes() {
60
- const classes = {};
61
-
62
- if (this.variant) {
63
- classes[`Button--${this.variant}`] = true;
64
- }
65
-
66
- if (this.size) {
67
- classes[`Button--${this.size}`] = true;
68
- }
69
-
70
- if (this.pill) {
71
- classes['Button--pill'] = true;
72
- }
73
-
74
- return classes;
75
- },
76
-
77
- tag() {
78
- if (this.to) {
79
- return 'NuxtLink';
80
- }
81
-
82
- return 'button';
83
- },
84
- },
85
- };
86
- </script>
@@ -1,27 +0,0 @@
1
- <template>
2
- <VTButton
3
- class="relative"
4
- :disabled="saving"
5
- v-bind="$attrs"
6
- v-on="$listeners"
7
- >
8
- <VTSpinner v-if="saving" class="absolute m-auto" />
9
- <span :class="{ invisible: saving }"><slot></slot></span>
10
- </VTButton>
11
- </template>
12
-
13
- <script>
14
- import VTButton from '../Button/VTButton.vue';
15
- import VTSpinner from '../Spinner/VTSpinner.vue';
16
-
17
- export default {
18
- components: { VTButton, VTSpinner },
19
-
20
- props: {
21
- saving: {
22
- type: Boolean,
23
- default: false,
24
- },
25
- },
26
- };
27
- </script>