@witchcraft/ui 0.1.3 → 0.2.1-beta.1

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 (179) hide show
  1. package/README.md +3 -6
  2. package/dist/module.json +3 -3
  3. package/dist/module.mjs +15 -12
  4. package/dist/runtime/build/generateTheme.js +1 -1
  5. package/dist/runtime/components/Aria/Aria.vue +5 -9
  6. package/dist/runtime/components/Aria/Aria.vue.d.ts +5 -0
  7. package/dist/runtime/components/Icon/Icon.vue +10 -30
  8. package/dist/runtime/components/Icon/Icon.vue.d.ts +21 -0
  9. package/dist/runtime/components/LibButton/LibButton.vue +51 -72
  10. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +36 -0
  11. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +43 -74
  12. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +42 -0
  13. package/dist/runtime/components/LibColorInput/LibColorInput.vue +63 -107
  14. package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +63 -0
  15. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +272 -352
  16. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +61 -0
  17. package/dist/runtime/components/LibColorPicker/utils/safeConvertToHsva.js +1 -1
  18. package/dist/runtime/components/LibColorPicker/utils/safeConvertToRgba.js +1 -1
  19. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +35 -69
  20. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +22 -0
  21. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue +17 -38
  22. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +40 -0
  23. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +58 -82
  24. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +34 -0
  25. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +55 -67
  26. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +34 -0
  27. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue +7 -8
  28. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +22 -0
  29. package/dist/runtime/components/LibDebug/LibDebug.vue +43 -70
  30. package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +32 -0
  31. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +18 -31
  32. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +22 -0
  33. package/dist/runtime/components/LibFileInput/LibFileInput.vue +116 -156
  34. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +43 -0
  35. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +211 -241
  36. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +165 -0
  37. package/dist/runtime/components/LibLabel/LibLabel.vue +25 -46
  38. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +26 -0
  39. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +43 -58
  40. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +29 -0
  41. package/dist/runtime/components/LibNotifications/LibNotification.vue +34 -48
  42. package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +17 -0
  43. package/dist/runtime/components/LibNotifications/LibNotifications.vue +63 -83
  44. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +13 -0
  45. package/dist/runtime/components/LibPagination/LibPagination.vue +67 -111
  46. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +104 -0
  47. package/dist/runtime/components/LibPalette/LibPalette.vue +17 -23
  48. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +14 -0
  49. package/dist/runtime/components/LibPopup/LibPopup.vue +314 -351
  50. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +46 -0
  51. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +65 -91
  52. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +41 -0
  53. package/dist/runtime/components/LibRecorder/LibRecorder.vue +127 -177
  54. package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +77 -0
  55. package/dist/runtime/components/LibRoot/LibRoot.vue +75 -101
  56. package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +41 -0
  57. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +42 -77
  58. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +35 -0
  59. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +118 -156
  60. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +94 -0
  61. package/dist/runtime/components/LibTable/LibTable.vue +63 -99
  62. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +45 -0
  63. package/dist/runtime/components/Template/NAME.vue +15 -36
  64. package/dist/runtime/components/Template/NAME.vue.d.ts +17 -0
  65. package/dist/runtime/components/TestControls/TestControls.vue +6 -9
  66. package/dist/runtime/components/TestControls/TestControls.vue.d.ts +5 -0
  67. package/dist/runtime/components/shared/props.d.ts +0 -29
  68. package/dist/runtime/components/shared/props.js +0 -12
  69. package/dist/runtime/composables/useAccesibilityOutline.js +1 -1
  70. package/dist/runtime/composables/useDivideAttrs.js +1 -1
  71. package/dist/runtime/composables/useSuggestions.js +4 -4
  72. package/dist/runtime/directives/vDetectFlex.js +4 -4
  73. package/dist/runtime/directives/vExtractRootEl.d.ts +1 -1
  74. package/dist/runtime/directives/vResizableCols.d.ts +1 -1
  75. package/dist/runtime/directives/vResizableCols.js +4 -4
  76. package/dist/runtime/helpers/NotificationHandler.js +6 -6
  77. package/dist/runtime/helpers/base64ToImg.js +2 -2
  78. package/dist/runtime/nuxt/plugins/vue-plugin.js +1 -1
  79. package/dist/runtime/tailwind/themeConvertionOpts.d.ts +1 -1
  80. package/dist/runtime/theme.d.ts +1 -1
  81. package/dist/runtime/theme.js +1 -1
  82. package/dist/runtime/utils/notifyIfError.js +1 -1
  83. package/dist/runtime/vue/registerComponents.js +1 -1
  84. package/dist/types.d.mts +2 -6
  85. package/package.json +68 -90
  86. package/src/module.ts +19 -12
  87. package/src/runtime/build/generateTheme.ts +1 -1
  88. package/src/runtime/components/LibButton/LibButton.stories.ts +1 -1
  89. package/src/runtime/components/LibButton/LibButton.vue +3 -3
  90. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +3 -7
  91. package/src/runtime/components/LibColorPicker/LibColorPicker.vue +6 -4
  92. package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +1 -1
  93. package/src/runtime/components/LibColorPicker/utils/safeConvertToRgba.ts +1 -1
  94. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +8 -15
  95. package/src/runtime/components/LibDatePicker/LibRangeDatePicker.vue +6 -0
  96. package/src/runtime/components/LibDatePicker/LibSingleDatePicker.vue +6 -0
  97. package/src/runtime/components/LibDebug/LibDebug.stories.ts +1 -1
  98. package/src/runtime/components/LibDebug/LibDebug.vue +2 -0
  99. package/src/runtime/components/LibFileInput/LibFileInput.vue +4 -0
  100. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +7 -5
  101. package/src/runtime/components/LibLabel/LibLabel.vue +2 -3
  102. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +5 -3
  103. package/src/runtime/components/LibNotifications/LibNotification.vue +3 -0
  104. package/src/runtime/components/LibNotifications/LibNotifications.vue +1 -1
  105. package/src/runtime/components/LibPalette/LibPalette.vue +3 -3
  106. package/src/runtime/components/LibPopup/LibPopup.vue +2 -2
  107. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +2 -2
  108. package/src/runtime/components/LibRecorder/LibRecorder.vue +3 -3
  109. package/src/runtime/components/LibRoot/LibRoot.vue +3 -2
  110. package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +2 -2
  111. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +2 -2
  112. package/src/runtime/components/LibTable/LibTable.vue +1 -1
  113. package/src/runtime/components/Template/NAME.vue +2 -2
  114. package/src/runtime/components/shared/props.ts +8 -12
  115. package/src/runtime/composables/useAccesibilityOutline.ts +1 -1
  116. package/src/runtime/composables/useDivideAttrs.ts +1 -1
  117. package/src/runtime/composables/useSuggestions.ts +4 -4
  118. package/src/runtime/directives/vDetectFlex.ts +4 -4
  119. package/src/runtime/directives/vExtractRootEl.ts +1 -1
  120. package/src/runtime/directives/vResizableCols.ts +5 -5
  121. package/src/runtime/helpers/NotificationHandler.ts +6 -6
  122. package/src/runtime/nuxt/plugins/vue-plugin.ts +1 -1
  123. package/src/runtime/tailwind/themeConvertionOpts.ts +1 -1
  124. package/src/runtime/theme.ts +2 -2
  125. package/src/runtime/utils/notifyIfError.ts +1 -1
  126. package/src/runtime/vue/registerComponents.ts +1 -1
  127. package/dist/module.cjs +0 -5
  128. package/dist/module.d.ts +0 -36
  129. package/dist/runtime/components/Focus.stories.d.ts +0 -11
  130. package/dist/runtime/components/Focus.stories.js +0 -53
  131. package/dist/runtime/components/LibButton/LibButton.stories.d.ts +0 -12
  132. package/dist/runtime/components/LibButton/LibButton.stories.js +0 -94
  133. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.d.ts +0 -14
  134. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.js +0 -29
  135. package/dist/runtime/components/LibColorInput/LibColorInput.stories.d.ts +0 -7
  136. package/dist/runtime/components/LibColorInput/LibColorInput.stories.js +0 -58
  137. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.d.ts +0 -9
  138. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.js +0 -68
  139. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.d.ts +0 -7
  140. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.js +0 -36
  141. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.d.ts +0 -11
  142. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.js +0 -98
  143. package/dist/runtime/components/LibDebug/LibDebug.stories.d.ts +0 -9
  144. package/dist/runtime/components/LibDebug/LibDebug.stories.js +0 -46
  145. package/dist/runtime/components/LibFileInput/LibFileInput.stories.d.ts +0 -10
  146. package/dist/runtime/components/LibFileInput/LibFileInput.stories.js +0 -63
  147. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.d.ts +0 -33
  148. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.js +0 -384
  149. package/dist/runtime/components/LibLabel/LibLabel.stories.d.ts +0 -6
  150. package/dist/runtime/components/LibLabel/LibLabel.stories.js +0 -25
  151. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.d.ts +0 -23
  152. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.js +0 -61
  153. package/dist/runtime/components/LibNotifications/LibNotification.stories.d.ts +0 -15
  154. package/dist/runtime/components/LibNotifications/LibNotification.stories.js +0 -126
  155. package/dist/runtime/components/LibNotifications/LibNotifications.stories.d.ts +0 -6
  156. package/dist/runtime/components/LibNotifications/LibNotifications.stories.js +0 -109
  157. package/dist/runtime/components/LibPagination/LibPagination.stories.d.ts +0 -6
  158. package/dist/runtime/components/LibPagination/LibPagination.stories.js +0 -40
  159. package/dist/runtime/components/LibPalette/LibPalette.stories.d.ts +0 -6
  160. package/dist/runtime/components/LibPalette/LibPalette.stories.js +0 -20
  161. package/dist/runtime/components/LibPopup/LibPopup.stories.d.ts +0 -14
  162. package/dist/runtime/components/LibPopup/LibPopup.stories.js +0 -147
  163. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.d.ts +0 -10
  164. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.js +0 -81
  165. package/dist/runtime/components/LibRecorder/LibRecorder.stories.d.ts +0 -19
  166. package/dist/runtime/components/LibRecorder/LibRecorder.stories.js +0 -63
  167. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.d.ts +0 -26
  168. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.js +0 -78
  169. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.d.ts +0 -27
  170. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.js +0 -112
  171. package/dist/runtime/components/LibTable/LibTable.stories.d.ts +0 -16
  172. package/dist/runtime/components/LibTable/LibTable.stories.js +0 -156
  173. package/dist/runtime/components/Reset.stories.d.ts +0 -5
  174. package/dist/runtime/components/Reset.stories.js +0 -19
  175. package/dist/runtime/components/Scrolling.stories.d.ts +0 -6
  176. package/dist/runtime/components/Scrolling.stories.js +0 -44
  177. package/dist/runtime/composables/useScrollNearContainerEdges.stories.d.ts +0 -7
  178. package/dist/runtime/composables/useScrollNearContainerEdges.stories.js +0 -85
  179. package/dist/types.d.ts +0 -7
@@ -1,46 +0,0 @@
1
- import { crop } from "@alanscodelog/utils/crop.js";
2
- import LibDebug from "./LibDebug.vue";
3
- import * as components from "../index.js";
4
- const meta = {
5
- component: LibDebug,
6
- title: "Components/Debug",
7
- args: {
8
- value: { any: ["any", { value: "any" }] }
9
- }
10
- };
11
- export default meta;
12
- export const Primary = {
13
- render: (args) => ({
14
- components,
15
- setup: () => ({ args }),
16
- template: `
17
- <lib-debug v-bind="args" />
18
- `
19
- })
20
- };
21
- export const WithCustomTab = {
22
- ...Primary,
23
- args: {
24
- ...Primary.args,
25
- value: { any: ["any", { value: "any" }] },
26
- tab: 2
27
- }
28
- };
29
- export const NoValue = {
30
- ...Primary,
31
- args: {
32
- ...Primary.args,
33
- value: void 0
34
- }
35
- };
36
- export const StringWithWhitespace = {
37
- ...Primary,
38
- args: {
39
- ...Primary.args,
40
- value: crop`
41
- Manually
42
- Indented
43
- String
44
- `
45
- }
46
- };
@@ -1,10 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import LibFileInput from "./LibFileInput.vue.js";
3
- declare const meta: Meta<typeof LibFileInput>;
4
- export default meta;
5
- type Story = StoryObj<typeof LibFileInput>;
6
- export declare const SingleFile: Story;
7
- export declare const MultipleFile: Story;
8
- export declare const AnyFormat: Story;
9
- export declare const Compact: Story;
10
- export declare const ErrorHandling: Story;
@@ -1,63 +0,0 @@
1
- import { ref } from "vue";
2
- import LibFileInput from "./LibFileInput.vue";
3
- import * as components from "../index.js";
4
- const meta = {
5
- component: LibFileInput,
6
- title: "Components/FileInput",
7
- args: {}
8
- };
9
- export default meta;
10
- export const SingleFile = {
11
- render: (args) => ({
12
- components,
13
- setup: () => {
14
- function errorHandler(e) {
15
- console.log(e);
16
- }
17
- return { args, errorHandler };
18
- },
19
- template: `
20
- <lib-file-input v-bind="{...args}" @errors="errorHandler"></lib-file-input>
21
- `
22
- })
23
- };
24
- export const MultipleFile = {
25
- ...SingleFile,
26
- args: {
27
- ...SingleFile.args,
28
- multiple: true
29
- }
30
- };
31
- export const AnyFormat = {
32
- ...SingleFile,
33
- args: {
34
- ...SingleFile.args,
35
- multiple: true,
36
- formats: []
37
- }
38
- };
39
- export const Compact = {
40
- ...SingleFile,
41
- args: {
42
- ...SingleFile.args,
43
- compact: true
44
- }
45
- };
46
- export const ErrorHandling = {
47
- render: (args) => ({
48
- components,
49
- setup: () => {
50
- const errors = ref([]);
51
- const errorHandler = (e) => errors.value = e;
52
- return {
53
- args,
54
- errors,
55
- errorHandler
56
- };
57
- },
58
- template: `
59
- <lib-debug :title="'Errors'">{{errors}}</lib-debug>
60
- <lib-file-input v-bind="{...args}" @errors="errorHandler"></lib-file-input>
61
- `
62
- })
63
- };
@@ -1,33 +0,0 @@
1
- import type { StoryObj } from "@storybook/vue3";
2
- import LibInputDeprecated from "./LibInputDeprecated.vue.js";
3
- declare const meta: {
4
- component: any;
5
- title: string;
6
- args: any;
7
- };
8
- export default meta;
9
- type Story = StoryObj<typeof LibInputDeprecated>;
10
- export declare const Primary: Story;
11
- export declare const Disabled: Story;
12
- export declare const Readonly: Story;
13
- export declare const Invalid: Story;
14
- export declare const AttrsPassword: Story;
15
- export declare const AttrsDate: Story;
16
- export declare const AttrsNumber: Story;
17
- export declare const Borderless: any;
18
- export declare const WithAutosuggest: any;
19
- export declare const WithAutosuggestNoLabel: any;
20
- export declare const WithInstantAutosuggest: any;
21
- export declare const AutosuggestRestricted: any;
22
- export declare const AutosuggestRestrictedWithClearOnClick: any;
23
- export declare const AutosuggestSelectLikeShowAllUnrestricted: any;
24
- export declare const AutosuggestObjectOptions: any;
25
- export declare const Slots: Story;
26
- /** Press enter to add a value. */
27
- export declare const WithMultipleValues: Story;
28
- export declare const WithMultipleValuesWithSuggestions: any;
29
- export declare const WithMultipleValuesWithSuggestionsNoSelected: any;
30
- export declare const WithMultipleValuesDisabled: any;
31
- export declare const WithMultipleValuesReadonly: any;
32
- export declare const InputSlotReplacement: Story;
33
- export declare const NextToButton: Story;
@@ -1,384 +0,0 @@
1
- import { ref, watchEffect } from "vue";
2
- import LibInputDeprecated from "./LibInputDeprecated.vue";
3
- import IconFaChevronLeft from "~icons/fa6-solid/chevron-left";
4
- import IconFaChevronRight from "~icons/fa6-solid/chevron-right";
5
- import IconFaSolidKeyboard from "~icons/fa6-solid/keyboard";
6
- import IconFaSolidTags from "~icons/fa6-solid/tags";
7
- import { vExtractRootEl } from "../../directives/vExtractRootEl.js";
8
- import { createRecorderHandler, createRecorderWatchEffect } from "../../helpers/storybook.js";
9
- import Icon from "../Icon/Icon.vue";
10
- import * as components from "../index.js";
11
- import {
12
- playBasicVModel,
13
- playMultipleValues
14
- } from "../shared/storyHelpers/playInput.js";
15
- import {
16
- playBasicClickSelect,
17
- playBasicKeyboardSelect,
18
- playBasicSelect
19
- } from "../shared/storyHelpers/playSuggestions.js";
20
- const meta = {
21
- component: LibInputDeprecated,
22
- title: "Components/Combobox",
23
- args: {
24
- border: true,
25
- label: "Some Label",
26
- ...{
27
- _template: void 0
28
- }
29
- }
30
- };
31
- export default meta;
32
- const allComponents = {
33
- ...components,
34
- LibInputDeprecated,
35
- Icon,
36
- IconFaChevronRight,
37
- IconFaChevronLeft,
38
- IconFaSolidKeyboard,
39
- IconFaSolidTags
40
- };
41
- const playAutosuggestSelectLike = async (context) => {
42
- await playBasicSelect(context);
43
- await playBasicKeyboardSelect(context);
44
- await playBasicClickSelect(context);
45
- };
46
- const setupModelValue = (args) => ({
47
- modelValue: ref(args.modelValue ?? ""),
48
- inputValue: ref(args.inputValue ?? "")
49
- });
50
- const setupModelValues = (args) => ({
51
- values: ref(args.values ?? void 0)
52
- });
53
- const Base = {
54
- render: (args) => ({
55
- components: allComponents,
56
- setup: () => ({
57
- ...setupModelValue(args),
58
- ...setupModelValues(args),
59
- args: {
60
- ...args,
61
- updateOnlyOnSubmit: args.suggestions !== void 0
62
- }
63
- }),
64
- template: args._template ?? `
65
- Model Value: <span class="inline-block" data-testid="model-value">{{modelValue}}</span>
66
-
67
- <lib-simple-input-deprecated
68
- v-bind="args"
69
- v-model:values="values"
70
- v-model:inputValue="inputValue"
71
- v-model="modelValue"
72
- @submit="modelValue = $event"
73
- >
74
- </lib-simple-input-deprecated>
75
- `
76
- })
77
- };
78
- export const Primary = {
79
- ...Base,
80
- play: playBasicVModel
81
- };
82
- export const Disabled = {
83
- ...Base,
84
- args: {
85
- disabled: true
86
- }
87
- };
88
- export const Readonly = {
89
- ...Base,
90
- args: {
91
- readonly: true
92
- }
93
- };
94
- export const Invalid = {
95
- ...Base,
96
- args: {
97
- valid: false
98
- }
99
- };
100
- export const AttrsPassword = {
101
- ...Base,
102
- args: {
103
- type: "password"
104
- }
105
- };
106
- export const AttrsDate = {
107
- ...Base,
108
- args: {
109
- type: "date"
110
- }
111
- };
112
- export const AttrsNumber = {
113
- ...Base,
114
- args: {
115
- type: "number"
116
- }
117
- };
118
- export const Borderless = {
119
- ...Base,
120
- args: {
121
- border: false,
122
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
123
- }
124
- };
125
- export const WithAutosuggest = {
126
- ...Base,
127
- args: {
128
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
129
- },
130
- play: playAutosuggestSelectLike
131
- };
132
- export const WithAutosuggestNoLabel = {
133
- ...Base,
134
- args: {
135
- label: void 0,
136
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
137
- },
138
- play: playAutosuggestSelectLike
139
- };
140
- export const WithInstantAutosuggest = {
141
- ...Base,
142
- args: {
143
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
144
- }
145
- };
146
- export const AutosuggestRestricted = {
147
- ...WithAutosuggest,
148
- args: {
149
- ...WithAutosuggest.args,
150
- restrictToSuggestions: true
151
- },
152
- play: playAutosuggestSelectLike
153
- };
154
- export const AutosuggestRestrictedWithClearOnClick = {
155
- ...WithAutosuggest,
156
- args: {
157
- ...WithAutosuggest.args,
158
- restrictToSuggestions: true,
159
- _template: `
160
- Model Value: <span class="inline-block" data-testid="model-value">{{modelValue}}</span>
161
-
162
- Temp Value: <span class="inline-block" data-testid="temp-value">{{inputValue}}</span>
163
-
164
- <lib-simple-input-deprecated
165
- v-bind="args"
166
- v-model:values="values"
167
- v-model:inputValue="inputValue"
168
- v-model="modelValue"
169
- @submit="modelValue = $event"
170
- @click="inputValue = ''"
171
- >
172
- </lib-simple-input-deprecated>
173
- `
174
- },
175
- play: null
176
- };
177
- export const AutosuggestSelectLikeShowAllUnrestricted = {
178
- ...WithAutosuggest,
179
- args: {
180
- ...WithAutosuggest.args,
181
- restrictToSuggestions: false,
182
- suggestionsFilter: (_input, items) => items
183
- },
184
- play: playAutosuggestSelectLike
185
- };
186
- export const AutosuggestObjectOptions = {
187
- ...WithAutosuggest,
188
- args: {
189
- ...WithAutosuggest.args,
190
- restrictToSuggestions: true,
191
- suggestions: [
192
- { label: "A", other: "some data A" },
193
- { label: "AB", other: "some data AB" },
194
- { label: "ABC", other: "some data ABC" },
195
- { label: "ABCDEFGHIJKLMNOPQRSTUVWXYZ", other: "some data ABCDEFGHIJKLMNOPQRSTUVWXYZ" }
196
- ],
197
- suggestionLabel: (item) => item.label
198
- },
199
- play: playAutosuggestSelectLike
200
- };
201
- export const Slots = {
202
- render: (args) => ({
203
- components: allComponents,
204
- setup: () => ({
205
- ...setupModelValue(args),
206
- ...setupModelValues(args),
207
- args: {
208
- ...args,
209
- updateOnlyOnSubmit: args.suggestions !== void 0
210
- }
211
- }),
212
- template: `
213
- Model Value: <span class="inline-block" data-testid="model-value">{{modelValue}}</span>
214
-
215
-
216
- <lib-simple-input-deprecated
217
- v-bind="args"
218
- v-model="modelValue"
219
- v-model:values="values"
220
- >
221
- <template #label>
222
- Custom Label Slot
223
- </template>
224
- <template #left>
225
- <lib-button class="px-0" :border="false" :label="'none'">
226
- <icon><icon-fa-chevron-left/></icon>
227
- </lib-button>
228
- </template>
229
- <template #right>
230
- <lib-button class="px-0" :border="false" :label="'none'">
231
- <icon><icon-fa-chevron-right/></icon>
232
- </lib-button>
233
- </template>
234
- </lib-simple-input-deprecated>
235
- `
236
- })
237
- };
238
- const MultipleValuesBase = {
239
- render: (args) => ({
240
- components: allComponents,
241
- setup: () => ({
242
- ...setupModelValue(args),
243
- ...setupModelValues(args),
244
- args
245
- }),
246
- template: `
247
- Model Value: <span class="inline-block" data-testid="model-value">{{modelValue}}</span>
248
-
249
- <br/>
250
- Values: <span class="inline-block" data-testid="values">{{values.join(", ")}}</span>
251
-
252
- <lib-simple-input-deprecated
253
- v-bind="args"
254
- v-model="modelValue"
255
- v-model:values="values"
256
- >
257
- <template #left>
258
- <lib-button class="px-0" :border="false" :disabled="args.disabled || args.readonly">
259
- <icon><icon-fa-solid-tags/></icon>
260
- </lib-button>
261
- </template>
262
- </lib-simple-input-deprecated>
263
- `
264
- }),
265
- args: {
266
- values: ["A", "B", "C"]
267
- }
268
- };
269
- export const WithMultipleValues = {
270
- ...MultipleValuesBase,
271
- play: playMultipleValues
272
- };
273
- export const WithMultipleValuesWithSuggestions = {
274
- ...MultipleValuesBase,
275
- args: {
276
- ...MultipleValuesBase.args,
277
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
278
- },
279
- play: playAutosuggestSelectLike
280
- };
281
- export const WithMultipleValuesWithSuggestionsNoSelected = {
282
- ...MultipleValuesBase,
283
- args: {
284
- ...MultipleValuesBase.args,
285
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
286
- showSelectedValues: false
287
- },
288
- play: playAutosuggestSelectLike
289
- };
290
- export const WithMultipleValuesDisabled = {
291
- ...MultipleValuesBase,
292
- args: {
293
- ...MultipleValuesBase.args,
294
- disabled: true
295
- }
296
- };
297
- export const WithMultipleValuesReadonly = {
298
- ...MultipleValuesBase,
299
- args: {
300
- ...MultipleValuesBase.args,
301
- readonly: true
302
- }
303
- };
304
- export const InputSlotReplacement = {
305
- render: (args) => ({
306
- components: allComponents,
307
- directives: { vExtractRootEl },
308
- setup: () => {
309
- const recording = ref(false);
310
- const recordingValue = ref("");
311
- const modelValue = ref("K E Y S");
312
- const values = ref(args.values ?? []);
313
- const recorderEl = ref(null);
314
- const recorder = createRecorderHandler(recordingValue, recording, modelValue, recorderEl);
315
- watchEffect(createRecorderWatchEffect(recordingValue, recording, modelValue, values));
316
- return {
317
- recorder,
318
- recording,
319
- recordingValue,
320
- recorderEl,
321
- modelValue,
322
- values,
323
- args
324
- };
325
- },
326
- template: `
327
- Model Value: <span class="inline-block" data-testid="model-value">{{modelValue}}</span>
328
-
329
- <br/>
330
- Values: <span class="inline-block" data-testid="values">{{values.join(", ")}}</span>
331
-
332
- <br/>
333
- Recording: <span class="inline-block" data-testid="recording">{{recording}}</span>
334
-
335
- <lib-simple-input-deprecated
336
- v-bind="args"
337
- v-model="modelValue"
338
- v-model:values="values"
339
- >
340
- <template #input >
341
- <lib-recorder
342
- class="p-0"
343
- v-extract-root-el="_ => recorderEl = _"
344
- :border="false"
345
- :recordingValue="recordingValue"
346
- :recorder="recorder"
347
- v-model:recording="recording"
348
- v-model="modelValue"
349
- @recorder:click="recording = !recording"
350
- @recorder:blur="recordingValue = modelValue; recording = false"
351
- />
352
- </template>
353
- <template #left>
354
- <icon><icon-fa-solid-keyboard/></icon>
355
- </template>
356
- </lib-simple-input-deprecated>
357
- `
358
- }),
359
- args: {
360
- values: ["A", "B", "C"]
361
- }
362
- };
363
- export const NextToButton = {
364
- render: (args) => ({
365
- components: allComponents,
366
- setup: () => ({
367
- ...setupModelValue(args),
368
- ...setupModelValues(args),
369
- args
370
- }),
371
- template: `
372
- <div class="flex gap-2 items-center">
373
- <lib-simple-input-deprecated
374
- v-bind="args"
375
- v-model:values="values"
376
- v-model="modelValue"
377
- :label="undefined"
378
- >
379
- </lib-simple-input-deprecated>
380
- <lib-button>Button</lib-button>
381
- </div>
382
- `
383
- })
384
- };
@@ -1,6 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import Label from "./LibLabel.vue.js";
3
- declare const meta: Meta<typeof Label>;
4
- export default meta;
5
- type Story = StoryObj<typeof Label>;
6
- export declare const Primary: Story;
@@ -1,25 +0,0 @@
1
- import Label from "./LibLabel.vue";
2
- import * as components from "../index.js";
3
- const meta = {
4
- component: Label,
5
- title: "Components/Label",
6
- args: {
7
- slot: "label"
8
- }
9
- };
10
- export default meta;
11
- export const Primary = {
12
- render: (args) => ({
13
- components,
14
- setup: () => ({ args }),
15
- template: `
16
- <lib-label v-bind="args">{{args.slot}}</lib-label>
17
- <br/>
18
- In flex col with input:
19
- <div class="flex flex-col">
20
- <lib-label v-bind="args">{{args.slot}}</lib-label>
21
- <lib-simple-input modelValue="some input"></lib-simple-input>
22
- </div>
23
- `
24
- })
25
- };
@@ -1,23 +0,0 @@
1
- import type { StoryObj } from "@storybook/vue3";
2
- import LibMultiValues from "./LibMultiValues.vue.js";
3
- declare const meta: {
4
- component: any;
5
- title: string;
6
- args: {
7
- modelValue: string[];
8
- border: boolean;
9
- };
10
- tags: string[];
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof LibMultiValues>;
14
- /**
15
- * The multi-value component is just the values part beneath the input.
16
- *
17
- * This is a simple example of how it can be combined with the simple-input component to create an input with multiple values.
18
- *
19
- * Note that setting the `disabled` or `readonly` props won't prevent the component from accepting an updated `values` prop. Disabling adding must be done separately from whatever is controlling the component (e.g. the input in this case).
20
- */
21
- export declare const Primary: Story;
22
- export declare const Disabled: any;
23
- export declare const Readonly: any;
@@ -1,61 +0,0 @@
1
- import { ref } from "vue";
2
- import LibMultiValues from "./LibMultiValues.vue";
3
- import * as components from "../index.js";
4
- const meta = {
5
- component: LibMultiValues,
6
- title: "Components/MultiValues",
7
- args: {
8
- modelValue: ["A", "B", "C"],
9
- border: true
10
- },
11
- tags: ["!test"]
12
- };
13
- export default meta;
14
- export const Primary = {
15
- render: (args) => ({
16
- components: { ...components, LibMultiValues },
17
- setup: () => {
18
- const inputValue = ref("B");
19
- const multiValueEl = ref(null);
20
- const onKeydownEnter = (e) => {
21
- if (e.key === "Enter") args.modelValue.push(inputValue.value);
22
- };
23
- return {
24
- args,
25
- inputValue,
26
- multiValueEl,
27
- onKeydownEnter
28
- };
29
- },
30
- template: `
31
- <p>Simple Input connected to multi-value.</p>
32
- <p>Note: You will be able to add values, including duplicates, even to the disabled/readonly version in this test, see the Input component for a properly connected approach.</p>
33
- <p> Press enter to add value :</p>
34
- <lib-simple-input
35
- v-model="inputValue"
36
- @keydown="onKeydownEnter"
37
- >
38
- </lib-simple-input>
39
- <p>Multi-value component: </p>
40
- <div class="flex justify-start">
41
- <lib-multi-values
42
- ref="multiValueEl"
43
- v-bind="args"
44
- v-model="args.modelValue"
45
- />
46
- </div>
47
- `
48
- })
49
- };
50
- export const Disabled = {
51
- ...Primary,
52
- args: {
53
- disabled: true
54
- }
55
- };
56
- export const Readonly = {
57
- ...Primary,
58
- args: {
59
- readonly: true
60
- }
61
- };
@@ -1,15 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import LibNotification from "./LibNotification.vue.js";
3
- declare const meta: Meta<typeof LibNotification>;
4
- export default meta;
5
- type Story = StoryObj<typeof LibNotification>;
6
- export declare const Primary: Story;
7
- export declare const WithoutTitle: Story;
8
- export declare const WithCode: Story;
9
- export declare const RequiresAction: Story;
10
- /** Should not have cancel cross in top corner. */
11
- export declare const Uncancellable: Story;
12
- export declare const CustomOptions: Story;
13
- export declare const CustomDefaultOption: Story;
14
- export declare const CustomDangerousOption: Story;
15
- export declare const CustomDefaultAndDangerousOption: Story;