@antify/ui 2.2.0 → 2.2.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 (150) hide show
  1. package/dist/components/AntAccordion.vue +25 -12
  2. package/dist/components/AntAccordionItem.vue +28 -13
  3. package/dist/components/AntAlert.vue +25 -15
  4. package/dist/components/AntCard.vue +26 -14
  5. package/dist/components/AntContent.vue +4 -4
  6. package/dist/components/AntDropdown.vue +41 -23
  7. package/dist/components/AntIcon.vue +18 -6
  8. package/dist/components/AntKeycap.vue +31 -16
  9. package/dist/components/AntListGroup.vue +13 -11
  10. package/dist/components/AntListGroupItem.vue +19 -9
  11. package/dist/components/AntModal.vue +26 -15
  12. package/dist/components/AntPagination.vue +28 -15
  13. package/dist/components/AntPopover.vue +74 -51
  14. package/dist/components/AntSkeleton.vue +8 -4
  15. package/dist/components/AntSpinner.vue +14 -6
  16. package/dist/components/AntTag.vue +25 -13
  17. package/dist/components/AntToast.vue +19 -11
  18. package/dist/components/AntToaster.vue +13 -5
  19. package/dist/components/AntTooltip.vue +78 -54
  20. package/dist/components/__stories/AntAccordion.stories.js +4 -4
  21. package/dist/components/__stories/AntAccordion.stories.mjs +50 -17
  22. package/dist/components/__stories/AntAlert.stories.mjs +18 -5
  23. package/dist/components/__stories/AntCard.stories.mjs +36 -10
  24. package/dist/components/__stories/AntContent.stories.mjs +14 -4
  25. package/dist/components/__stories/AntDropdown.stories.mjs +20 -4
  26. package/dist/components/__stories/AntIcon.stories.mjs +38 -12
  27. package/dist/components/__stories/AntKeycap.stories.mjs +35 -10
  28. package/dist/components/__stories/AntListGroup.stories.d.ts +1 -1
  29. package/dist/components/__stories/AntListGroup.stories.mjs +22 -4
  30. package/dist/components/__stories/AntListGroupItem.stories.mjs +27 -8
  31. package/dist/components/__stories/AntModal.stories.mjs +17 -4
  32. package/dist/components/__stories/AntPagination.stories.mjs +21 -6
  33. package/dist/components/__stories/AntPopover.stories.mjs +20 -4
  34. package/dist/components/__stories/AntSkeleton.stories.mjs +17 -5
  35. package/dist/components/__stories/AntSpinner.stories.mjs +33 -9
  36. package/dist/components/__stories/AntTag.stories.mjs +28 -8
  37. package/dist/components/__stories/AntToast.stories.mjs +19 -5
  38. package/dist/components/__stories/AntToaster.stories.d.ts +1 -1
  39. package/dist/components/__stories/AntToaster.stories.mjs +35 -9
  40. package/dist/components/__stories/AntTooltip.stories.js +1 -1
  41. package/dist/components/__stories/AntTooltip.stories.mjs +44 -13
  42. package/dist/components/buttons/AntActionButton.vue +38 -29
  43. package/dist/components/buttons/AntButton.vue +34 -13
  44. package/dist/components/buttons/AntCreateButton.vue +11 -4
  45. package/dist/components/buttons/AntDeleteButton.vue +11 -4
  46. package/dist/components/buttons/AntDuplicateButton.vue +11 -4
  47. package/dist/components/buttons/AntEditButton.vue +11 -4
  48. package/dist/components/buttons/AntSaveAndNewButton.vue +11 -4
  49. package/dist/components/buttons/AntSaveButton.vue +11 -4
  50. package/dist/components/buttons/__stories/AntActionButton.stories.mjs +35 -10
  51. package/dist/components/buttons/__stories/AntButton.stories.mjs +77 -23
  52. package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +25 -7
  53. package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +25 -7
  54. package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +25 -7
  55. package/dist/components/buttons/__stories/AntEditButton.stories.mjs +25 -7
  56. package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +25 -7
  57. package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +25 -7
  58. package/dist/components/crud/AntCrud.vue +6 -6
  59. package/dist/components/crud/AntCrudDetail.vue +8 -5
  60. package/dist/components/crud/AntCrudDetailActions.vue +14 -8
  61. package/dist/components/crud/AntCrudDetailNav.vue +21 -13
  62. package/dist/components/crud/AntCrudTableFilter.vue +29 -17
  63. package/dist/components/crud/AntCrudTableNav.vue +36 -22
  64. package/dist/components/crud/__stories/AntCrud.stories.mjs +17 -5
  65. package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +11 -3
  66. package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +10 -2
  67. package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +11 -3
  68. package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +17 -5
  69. package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +23 -7
  70. package/dist/components/dialogs/AntDeleteDialog.vue +13 -5
  71. package/dist/components/dialogs/AntDialog.vue +23 -13
  72. package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +12 -3
  73. package/dist/components/dialogs/__stories/AntDialog.stories.mjs +28 -7
  74. package/dist/components/forms/AntField.vue +18 -7
  75. package/dist/components/forms/AntFormGroup.vue +9 -5
  76. package/dist/components/forms/AntFormGroupLabel.vue +1 -1
  77. package/dist/components/forms/__stories/AntField.stories.mjs +37 -9
  78. package/dist/components/forms/__stories/AntFormGroup.stories.mjs +20 -5
  79. package/dist/components/forms/__stories/AntFormGroupLabel.stories.mjs +11 -3
  80. package/dist/components/index.d.ts +1 -1
  81. package/dist/components/inputs/AntCheckbox.vue +61 -36
  82. package/dist/components/inputs/AntCheckboxGroup.vue +40 -15
  83. package/dist/components/inputs/AntDateInput.vue +35 -12
  84. package/dist/components/inputs/AntNumberInput.vue +33 -12
  85. package/dist/components/inputs/AntPasswordInput.vue +32 -11
  86. package/dist/components/inputs/AntRadio.vue +57 -34
  87. package/dist/components/inputs/AntRadioGroup.vue +60 -35
  88. package/dist/components/inputs/AntRangeSlider.vue +31 -12
  89. package/dist/components/inputs/AntSearch.vue +19 -7
  90. package/dist/components/inputs/AntSelect.vue +107 -83
  91. package/dist/components/inputs/AntSwitch.vue +36 -18
  92. package/dist/components/inputs/AntSwitcher.vue +30 -15
  93. package/dist/components/inputs/AntTagInput.vue +91 -61
  94. package/dist/components/inputs/AntTextInput.vue +31 -11
  95. package/dist/components/inputs/AntTextarea.vue +53 -25
  96. package/dist/components/inputs/AntUnitInput.vue +33 -12
  97. package/dist/components/inputs/Elements/AntBaseInput.vue +47 -18
  98. package/dist/components/inputs/Elements/AntInputDescription.vue +16 -8
  99. package/dist/components/inputs/Elements/AntInputLabel.vue +13 -5
  100. package/dist/components/inputs/Elements/AntInputLimiter.vue +13 -5
  101. package/dist/components/inputs/Elements/AntSelectMenu.vue +65 -41
  102. package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +104 -27
  103. package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +33 -9
  104. package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +34 -9
  105. package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +33 -9
  106. package/dist/components/inputs/Elements/index.d.ts +1 -1
  107. package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +34 -9
  108. package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +45 -21
  109. package/dist/components/inputs/__stories/AntDateInput.stories.mjs +52 -14
  110. package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +66 -17
  111. package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +51 -13
  112. package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +45 -12
  113. package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +16 -5
  114. package/dist/components/inputs/__stories/AntSearch.stories.mjs +41 -10
  115. package/dist/components/inputs/__stories/AntSelect.stories.mjs +59 -15
  116. package/dist/components/inputs/__stories/AntSwitch.stories.js +126 -102
  117. package/dist/components/inputs/__stories/AntSwitch.stories.mjs +162 -112
  118. package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +38 -10
  119. package/dist/components/inputs/__stories/AntTagInput.stories.mjs +46 -12
  120. package/dist/components/inputs/__stories/AntTextInput.stories.mjs +59 -16
  121. package/dist/components/inputs/__stories/AntTextarea.stories.mjs +47 -13
  122. package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +46 -12
  123. package/dist/components/layouts/AntNavLeftLayout.vue +12 -6
  124. package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +10 -2
  125. package/dist/components/navbar/AntNavbar.vue +7 -3
  126. package/dist/components/navbar/AntNavbarItem.vue +12 -6
  127. package/dist/components/navbar/__stories/AntNavbar.stories.mjs +59 -37
  128. package/dist/components/table/AntCollapsibleTableRowContent.vue +7 -5
  129. package/dist/components/table/AntTable.vue +227 -165
  130. package/dist/components/table/AntTableSkeleton.vue +126 -0
  131. package/dist/components/table/AntTableSortButton.vue +22 -13
  132. package/dist/components/table/AntTd.vue +21 -17
  133. package/dist/components/table/AntTh.vue +19 -12
  134. package/dist/components/table/__stories/AntTable.stories.js +132 -14
  135. package/dist/components/table/__stories/AntTable.stories.mjs +253 -31
  136. package/dist/components/table/__types/index.d.ts +0 -1
  137. package/dist/components/table/__types/index.js +0 -11
  138. package/dist/components/table/__types/index.mjs +0 -1
  139. package/dist/components/tabs/AntTabItem.vue +20 -8
  140. package/dist/components/tabs/AntTabs.vue +35 -21
  141. package/dist/components/tabs/__stories/AntTabItem.stories.mjs +23 -7
  142. package/dist/components/tabs/__stories/AntTabs.stories.mjs +45 -13
  143. package/dist/components/transitions/AntTransitionCollapseHeight.vue +1 -1
  144. package/dist/composables/useToaster.mjs +25 -7
  145. package/dist/index.css +1 -0
  146. package/dist/utils.mjs +3 -1
  147. package/package.json +23 -16
  148. package/dist/tailwind.config.d.ts +0 -3
  149. package/dist/tailwind.config.js +0 -198
  150. package/dist/tailwind.config.mjs +0 -189
@@ -1,7 +1,13 @@
1
1
  import AntTagInput from "../AntTagInput.vue";
2
- import { ref } from "vue";
3
- import { InputState } from "../../../enums/index.mjs";
4
- import { AntTagInputSize } from "../__types/AntTagInput.types.mjs";
2
+ import {
3
+ ref
4
+ } from "vue";
5
+ import {
6
+ InputState
7
+ } from "../../../enums/index.mjs";
8
+ import {
9
+ AntTagInputSize
10
+ } from "../__types/AntTagInput.types.mjs";
5
11
  import AntFormGroup from "../../forms/AntFormGroup.vue";
6
12
  import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
7
13
  const meta = {
@@ -10,19 +16,35 @@ const meta = {
10
16
  argTypes: {
11
17
  modelValue: {
12
18
  control: "text",
13
- table: { type: { summary: "string|null" } }
19
+ table: {
20
+ type: {
21
+ summary: "string|null"
22
+ }
23
+ }
14
24
  },
15
25
  state: {
16
- control: { type: "select" },
26
+ control: {
27
+ type: "select"
28
+ },
17
29
  options: Object.values(InputState)
18
30
  },
19
31
  size: {
20
- control: { type: "select" },
32
+ control: {
33
+ type: "select"
34
+ },
21
35
  options: Object.values(AntTagInputSize),
22
- table: { defaultValue: { summary: AntTagInputSize.md } }
36
+ table: {
37
+ defaultValue: {
38
+ summary: AntTagInputSize.md
39
+ }
40
+ }
23
41
  },
24
42
  placeholder: {
25
- table: { defaultValue: { summary: "this.label" } }
43
+ table: {
44
+ defaultValue: {
45
+ summary: "this.label"
46
+ }
47
+ }
26
48
  },
27
49
  createCallback: {
28
50
  description: "If allowCreate is true the createCallback needs to be specified. It will be called when the user creates a new tag. It should return a promise that resolves to a SelectOption.",
@@ -62,7 +84,9 @@ const options = [
62
84
  ];
63
85
  export const Docs = {
64
86
  render: (args) => ({
65
- components: { AntTagInput },
87
+ components: {
88
+ AntTagInput
89
+ },
66
90
  setup() {
67
91
  const value = ref([]);
68
92
  return {
@@ -87,16 +111,26 @@ export const AllowCreate = {
87
111
  allowCreate: true,
88
112
  createCallback(item) {
89
113
  return new Promise((resolve) => {
90
- resolve({ label: item, value: `${Math.random()}-${item}` });
114
+ resolve({
115
+ label: item,
116
+ value: `${Math.random()}-${item}`
117
+ });
91
118
  });
92
119
  }
93
120
  }
94
121
  };
95
122
  export const summary = {
96
123
  render: (args) => ({
97
- components: { AntTagInput, AntFormGroup, AntFormGroupLabel },
124
+ components: {
125
+ AntTagInput,
126
+ AntFormGroup,
127
+ AntFormGroupLabel
128
+ },
98
129
  setup() {
99
- const value = ref(["1", "2"]);
130
+ const value = ref([
131
+ "1",
132
+ "2"
133
+ ]);
100
134
  const noValue = ref([]);
101
135
  return {
102
136
  args,
@@ -1,41 +1,77 @@
1
- import { Size } from "../../../enums/Size.enum.mjs";
1
+ import {
2
+ Size
3
+ } from "../../../enums/Size.enum.mjs";
2
4
  import AntTextInput from "../AntTextInput.vue";
3
- import { TextInputType } from "../__types/AntTextInput.types.mjs";
4
- import { InputState } from "../../../enums/index.mjs";
5
+ import {
6
+ TextInputType
7
+ } from "../__types/AntTextInput.types.mjs";
8
+ import {
9
+ InputState
10
+ } from "../../../enums/index.mjs";
5
11
  const meta = {
6
12
  title: "Inputs/Text Input",
7
13
  component: AntTextInput,
8
- parameters: { controls: { sort: "requiredFirst" } },
14
+ parameters: {
15
+ controls: {
16
+ sort: "requiredFirst"
17
+ }
18
+ },
9
19
  argTypes: {
10
20
  modelValue: {
11
21
  control: "text",
12
- table: { type: { summary: "string|null" } }
22
+ table: {
23
+ type: {
24
+ summary: "string|null"
25
+ }
26
+ }
13
27
  },
14
28
  state: {
15
- control: { type: "select" },
29
+ control: {
30
+ type: "select"
31
+ },
16
32
  options: Object.values(InputState)
17
33
  },
18
34
  size: {
19
- control: { type: "select" },
35
+ control: {
36
+ type: "select"
37
+ },
20
38
  options: Object.values(Size),
21
- table: { defaultValue: { summary: Size.md } }
39
+ table: {
40
+ defaultValue: {
41
+ summary: Size.md
42
+ }
43
+ }
22
44
  },
23
45
  placeholder: {
24
- table: { defaultValue: { summary: "this.label" } }
46
+ table: {
47
+ defaultValue: {
48
+ summary: "this.label"
49
+ }
50
+ }
25
51
  },
26
52
  type: {
27
- control: { type: "select" },
53
+ control: {
54
+ type: "select"
55
+ },
28
56
  options: Object.values(TextInputType),
29
- table: { defaultValue: { summary: TextInputType.text } }
57
+ table: {
58
+ defaultValue: {
59
+ summary: TextInputType.text
60
+ }
61
+ }
30
62
  }
31
63
  }
32
64
  };
33
65
  export default meta;
34
66
  export const Docs = {
35
67
  render: (args) => ({
36
- components: { AntTextInput },
68
+ components: {
69
+ AntTextInput
70
+ },
37
71
  setup() {
38
- return { args };
72
+ return {
73
+ args
74
+ };
39
75
  },
40
76
  template: `
41
77
  <AntTextInput
@@ -51,12 +87,19 @@ export const Docs = {
51
87
  };
52
88
  export const Summary = {
53
89
  parameters: {
54
- chromatic: { disableSnapshot: false }
90
+ chromatic: {
91
+ disableSnapshot: false
92
+ }
55
93
  },
56
94
  render: (args) => ({
57
- components: { AntTextInput },
95
+ components: {
96
+ AntTextInput
97
+ },
58
98
  setup() {
59
- return { args, InputState };
99
+ return {
100
+ args,
101
+ InputState
102
+ };
60
103
  },
61
104
  template: `
62
105
  <div class="flex gap-2.5">
@@ -1,46 +1,78 @@
1
- import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
2
- import { Size } from "../../../enums/Size.enum.mjs";
1
+ import {
2
+ Grouped as _Grouped
3
+ } from "../../../enums/Grouped.enum.mjs";
4
+ import {
5
+ Size
6
+ } from "../../../enums/Size.enum.mjs";
3
7
  import AntTextarea from "../AntTextarea.vue";
4
- import { InputState } from "../../../enums/index.mjs";
8
+ import {
9
+ InputState
10
+ } from "../../../enums/index.mjs";
5
11
  const meta = {
6
12
  title: "Inputs/Textarea",
7
13
  component: AntTextarea,
8
- parameters: { controls: { sort: "requiredFirst" } },
14
+ parameters: {
15
+ controls: {
16
+ sort: "requiredFirst"
17
+ }
18
+ },
9
19
  argTypes: {
10
20
  state: {
11
- control: { type: "select" },
21
+ control: {
22
+ type: "select"
23
+ },
12
24
  options: Object.values(InputState)
13
25
  },
14
26
  size: {
15
- control: { type: "select" },
27
+ control: {
28
+ type: "select"
29
+ },
16
30
  options: Object.values(Size)
17
31
  },
18
32
  placeholder: {
19
- table: { defaultValue: { summary: "this.label" } }
33
+ table: {
34
+ defaultValue: {
35
+ summary: "this.label"
36
+ }
37
+ }
20
38
  },
21
39
  grouped: {
22
- control: { type: "select" },
40
+ control: {
41
+ type: "select"
42
+ },
23
43
  options: Object.values(_Grouped),
24
44
  description: "Where is this fields position in a group"
25
45
  },
26
46
  wrapperClass: {
27
47
  control: "text",
28
48
  description: 'Class for the first element because the attribute "class" would affect the input element.',
29
- table: { type: { summary: "string|object" } }
49
+ table: {
50
+ type: {
51
+ summary: "string|object"
52
+ }
53
+ }
30
54
  },
31
55
  showIcon: {
32
56
  control: "boolean",
33
57
  description: "Some InputStates can has an icon. Control with this property if it get shown or not.",
34
- table: { type: { summary: "Type" } }
58
+ table: {
59
+ type: {
60
+ summary: "Type"
61
+ }
62
+ }
35
63
  }
36
64
  }
37
65
  };
38
66
  export default meta;
39
67
  export const Docs = {
40
68
  render: (args) => ({
41
- components: { AntTextarea },
69
+ components: {
70
+ AntTextarea
71
+ },
42
72
  setup: () => {
43
- return { args };
73
+ return {
74
+ args
75
+ };
44
76
  },
45
77
  template: `
46
78
  <div class="h-screen">
@@ -59,7 +91,9 @@ export const Docs = {
59
91
  };
60
92
  export const summary = {
61
93
  parameters: {
62
- chromatic: { disableSnapshot: false }
94
+ chromatic: {
95
+ disableSnapshot: false
96
+ }
63
97
  },
64
98
  render: (args, ctx) => ({
65
99
  // @ts-ignore
@@ -1,44 +1,78 @@
1
- import { Size } from "../../../enums/Size.enum.mjs";
1
+ import {
2
+ Size
3
+ } from "../../../enums/Size.enum.mjs";
2
4
  import AntUnitInput from "../AntUnitInput.vue";
3
- import { faEuroSign } from "@fortawesome/free-solid-svg-icons";
4
- import { InputState } from "../../../enums/index.mjs";
5
+ import {
6
+ faEuroSign
7
+ } from "@fortawesome/free-solid-svg-icons";
8
+ import {
9
+ InputState
10
+ } from "../../../enums/index.mjs";
5
11
  const meta = {
6
12
  title: "Inputs/Unit Input",
7
13
  component: AntUnitInput,
8
- parameters: { controls: { sort: "requiredFirst" } },
14
+ parameters: {
15
+ controls: {
16
+ sort: "requiredFirst"
17
+ }
18
+ },
9
19
  argTypes: {
10
20
  modelValue: {
11
- table: { type: { summary: "number|null" } }
21
+ table: {
22
+ type: {
23
+ summary: "number|null"
24
+ }
25
+ }
12
26
  },
13
27
  unit: {
14
28
  control: "text",
15
29
  description: "Will be displayed right to the input.<br>Use text or Font-awesome Icons.",
16
- table: { type: { summary: "string|IconDefinition" } }
30
+ table: {
31
+ type: {
32
+ summary: "string|IconDefinition"
33
+ }
34
+ }
17
35
  },
18
36
  state: {
19
- control: { type: "select" },
37
+ control: {
38
+ type: "select"
39
+ },
20
40
  options: Object.values(InputState)
21
41
  },
22
42
  size: {
23
- control: { type: "select" },
43
+ control: {
44
+ type: "select"
45
+ },
24
46
  options: Object.values(Size)
25
47
  },
26
48
  placeholder: {
27
- table: { defaultValue: { summary: "this.label" } }
49
+ table: {
50
+ defaultValue: {
51
+ summary: "this.label"
52
+ }
53
+ }
28
54
  },
29
55
  wrapperClass: {
30
56
  control: "text",
31
57
  description: 'Class for the first element because the attribute "class" would affect the input element.',
32
- table: { type: { summary: "string|object" } }
58
+ table: {
59
+ type: {
60
+ summary: "string|object"
61
+ }
62
+ }
33
63
  }
34
64
  }
35
65
  };
36
66
  export default meta;
37
67
  export const Docs = {
38
68
  render: (args) => ({
39
- components: { AntUnitInput },
69
+ components: {
70
+ AntUnitInput
71
+ },
40
72
  setup() {
41
- return { args };
73
+ return {
74
+ args
75
+ };
42
76
  },
43
77
  template: `
44
78
  <AntUnitInput
@@ -1,8 +1,14 @@
1
1
  <script setup lang="ts">
2
- import {computed, useSlots} from 'vue';
2
+ import {
3
+ computed, useSlots,
4
+ } from 'vue';
3
5
  import AntNavbar from '../navbar/AntNavbar.vue';
4
- import type {RouteLocationRaw} from 'vue-router';
5
- import type {NavbarItemTypes} from '../navbar/__types/NavbarItem.types';
6
+ import type {
7
+ RouteLocationRaw,
8
+ } from 'vue-router';
9
+ import type {
10
+ NavbarItemTypes,
11
+ } from '../navbar/__types/NavbarItem.types';
6
12
 
7
13
  defineProps<{
8
14
  navbarItems: NavbarItemTypes[];
@@ -21,7 +27,7 @@ const hasLogoImageSlot = computed(() => useSlots()['logo-image'] || false);
21
27
  :to="logoRoute"
22
28
  class="bg-white min-h-[60px] flex justify-center items-center p-2.5"
23
29
  >
24
- <slot name="logo-image"/>
30
+ <slot name="logo-image" />
25
31
  </component>
26
32
 
27
33
  <AntNavbar
@@ -29,8 +35,8 @@ const hasLogoImageSlot = computed(() => useSlots()['logo-image'] || false);
29
35
  />
30
36
  </div>
31
37
 
32
- <div class="w-px flex-grow">
33
- <slot/>
38
+ <div class="w-px grow">
39
+ <slot />
34
40
  </div>
35
41
  </div>
36
42
  </template>
@@ -3,8 +3,16 @@ import AntNavLeftLayout from "../AntNavLeftLayout.vue";
3
3
  const meta = {
4
4
  title: "Layouts/NavLeftLayout",
5
5
  component: AntNavLeftLayout,
6
- parameters: { controls: { sort: "requiredFirst" } },
7
- decorators: [() => ({ template: '<div class="border border-dashed border-base-300"><story/></div>' })],
6
+ parameters: {
7
+ controls: {
8
+ sort: "requiredFirst"
9
+ }
10
+ },
11
+ decorators: [
12
+ () => ({
13
+ template: '<div class="border border-dashed border-base-300"><story/></div>'
14
+ })
15
+ ],
8
16
  argTypes: {}
9
17
  };
10
18
  export default meta;
@@ -1,11 +1,15 @@
1
1
  <script setup lang="ts">
2
2
 
3
- import {computed} from 'vue';
4
- import type {NavbarItemTypes} from './__types/NavbarItem.types';
3
+ import {
4
+ computed,
5
+ } from 'vue';
6
+ import type {
7
+ NavbarItemTypes,
8
+ } from './__types/NavbarItem.types';
5
9
  import AntNavbarItem from './AntNavbarItem.vue';
6
10
 
7
11
  defineProps<{
8
- navbarItems: NavbarItemTypes[]
12
+ navbarItems: NavbarItemTypes[];
9
13
  }>();
10
14
 
11
15
  const containerClasses = computed(() => ({
@@ -1,18 +1,24 @@
1
1
  <script setup lang="ts">
2
- import type {NavbarItemTypes} from './__types/NavbarItem.types';
3
- import {computed, ref} from 'vue';
2
+ import type {
3
+ NavbarItemTypes,
4
+ } from './__types/NavbarItem.types';
5
+ import {
6
+ computed, ref,
7
+ } from 'vue';
4
8
  import AntIcon from '../AntIcon.vue';
5
- import {faChevronDown, faChevronUp} from '@fortawesome/free-solid-svg-icons';
9
+ import {
10
+ faChevronDown, faChevronUp,
11
+ } from '@fortawesome/free-solid-svg-icons';
6
12
  import AntTransitionCollapseHeight from '../transitions/AntTransitionCollapseHeight.vue';
7
13
 
8
14
  const props = defineProps<{
9
- navbarItem: NavbarItemTypes
15
+ navbarItem: NavbarItemTypes;
10
16
  }>();
11
17
 
12
18
  const itemClasses = computed(() => ({
13
19
  'w-full text-sm p-1.5 rounded-md cursor-pointer flex items-center flex-nowrap gap-1': true,
14
20
  'transition-colors hover:bg-base-100': true,
15
- 'text-primary-500': props.navbarItem.active
21
+ 'text-primary-500': props.navbarItem.active,
16
22
  }));
17
23
 
18
24
  const open = ref(false);
@@ -42,7 +48,7 @@ function itemClick(): void {
42
48
  :color="navbarItem.active ? 'text-primary-500' : 'text-for-white-bg-font'"
43
49
  />
44
50
 
45
- <div class="flex-grow select-none">
51
+ <div class="grow select-none">
46
52
  {{ navbarItem.label }}
47
53
  </div>
48
54
 
@@ -1,7 +1,11 @@
1
1
  import AntNavbar from "../AntNavbar.vue";
2
2
  import AntNavbarItem from "../AntNavbarItem.vue";
3
- import { faUserCircle } from "@fortawesome/free-regular-svg-icons";
4
- import { faBook } from "@fortawesome/free-solid-svg-icons";
3
+ import {
4
+ faUserCircle
5
+ } from "@fortawesome/free-regular-svg-icons";
6
+ import {
7
+ faBook
8
+ } from "@fortawesome/free-solid-svg-icons";
5
9
  const meta = {
6
10
  title: "Components/Navbar",
7
11
  component: AntNavbar,
@@ -13,7 +17,9 @@ const meta = {
13
17
  export default meta;
14
18
  export const Docs = {
15
19
  render: (args) => ({
16
- components: { AntNavbar },
20
+ components: {
21
+ AntNavbar
22
+ },
17
23
  setup() {
18
24
  return {
19
25
  args
@@ -26,39 +32,55 @@ export const Docs = {
26
32
  `
27
33
  }),
28
34
  args: {
29
- navbarItems: [{
30
- icon: faUserCircle,
31
- label: "Navbar item",
32
- children: [{
33
- label: "Child"
34
- }]
35
- }, {
36
- icon: faBook,
37
- label: "Navbar item"
38
- }, {
39
- label: "Navbar item"
40
- }, {
41
- label: "Navbar item"
42
- }, {
43
- label: "Navbar item"
44
- }, {
45
- icon: faBook,
46
- label: "Navbar item",
47
- active: true,
48
- children: [{
49
- label: "Child",
50
- icon: faBook
51
- }]
52
- }, {
53
- label: "Navbar item"
54
- }, {
55
- label: "Navbar item"
56
- }, {
57
- label: "Navbar item"
58
- }, {
59
- label: "Navbar item"
60
- }, {
61
- label: "Navbar item"
62
- }]
35
+ navbarItems: [
36
+ {
37
+ icon: faUserCircle,
38
+ label: "Navbar item",
39
+ children: [
40
+ {
41
+ label: "Child"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ icon: faBook,
47
+ label: "Navbar item"
48
+ },
49
+ {
50
+ label: "Navbar item"
51
+ },
52
+ {
53
+ label: "Navbar item"
54
+ },
55
+ {
56
+ label: "Navbar item"
57
+ },
58
+ {
59
+ icon: faBook,
60
+ label: "Navbar item",
61
+ active: true,
62
+ children: [
63
+ {
64
+ label: "Child",
65
+ icon: faBook
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ label: "Navbar item"
71
+ },
72
+ {
73
+ label: "Navbar item"
74
+ },
75
+ {
76
+ label: "Navbar item"
77
+ },
78
+ {
79
+ label: "Navbar item"
80
+ },
81
+ {
82
+ label: "Navbar item"
83
+ }
84
+ ]
63
85
  }
64
86
  };
@@ -1,5 +1,7 @@
1
1
  <script setup lang="ts">
2
- import {computed} from "vue";
2
+ import {
3
+ computed,
4
+ } from 'vue';
3
5
 
4
6
  const props = withDefaults(defineProps<{
5
7
  isOpen: boolean;
@@ -9,9 +11,9 @@ const props = withDefaults(defineProps<{
9
11
  });
10
12
 
11
13
  const rowContentClasses = computed(() => ({
12
- "grid transition-all duration-300 delay-0 ease-in-out": true,
13
- "grid-rows-[0fr]": !props.isOpen,
14
- "grid-rows-[1fr]": props.isOpen,
14
+ 'grid transition-all duration-300 delay-0 ease-in-out': true,
15
+ 'grid-rows-[0fr]': !props.isOpen,
16
+ 'grid-rows-[1fr]': props.isOpen,
15
17
  }));
16
18
 
17
19
  </script>
@@ -19,7 +21,7 @@ const rowContentClasses = computed(() => ({
19
21
  <template>
20
22
  <div :class="rowContentClasses">
21
23
  <div class="overflow-hidden">
22
- <slot/>
24
+ <slot />
23
25
  </div>
24
26
  </div>
25
27
  </template>