@witchcraft/ui 0.1.0 → 0.1.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 (138) hide show
  1. package/dist/module.json +2 -2
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/Aria/Aria.vue +5 -9
  4. package/dist/runtime/components/Aria/Aria.vue.d.ts +5 -0
  5. package/dist/runtime/components/Icon/Icon.vue +10 -31
  6. package/dist/runtime/components/Icon/Icon.vue.d.ts +21 -0
  7. package/dist/runtime/components/LibButton/LibButton.vue +58 -77
  8. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +36 -0
  9. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +48 -75
  10. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +42 -0
  11. package/dist/runtime/components/LibColorInput/LibColorInput.vue +63 -108
  12. package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +63 -0
  13. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +271 -352
  14. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +61 -0
  15. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +32 -57
  16. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +22 -0
  17. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue +17 -38
  18. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +40 -0
  19. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +53 -82
  20. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +34 -0
  21. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +50 -67
  22. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +34 -0
  23. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue +7 -8
  24. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +22 -0
  25. package/dist/runtime/components/LibDebug/LibDebug.vue +42 -70
  26. package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +32 -0
  27. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +18 -31
  28. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +22 -0
  29. package/dist/runtime/components/LibFileInput/LibFileInput.vue +113 -157
  30. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +43 -0
  31. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +215 -242
  32. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +165 -0
  33. package/dist/runtime/components/LibLabel/LibLabel.vue +30 -46
  34. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +27 -0
  35. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +44 -59
  36. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +29 -0
  37. package/dist/runtime/components/LibNotifications/LibNotification.vue +32 -49
  38. package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +17 -0
  39. package/dist/runtime/components/LibNotifications/LibNotifications.vue +63 -84
  40. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +13 -0
  41. package/dist/runtime/components/LibPagination/LibPagination.vue +67 -112
  42. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +104 -0
  43. package/dist/runtime/components/LibPalette/LibPalette.vue +20 -23
  44. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +14 -0
  45. package/dist/runtime/components/LibPopup/LibPopup.vue +314 -352
  46. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +46 -0
  47. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +70 -92
  48. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +41 -0
  49. package/dist/runtime/components/LibRecorder/LibRecorder.vue +133 -178
  50. package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +77 -0
  51. package/dist/runtime/components/LibRoot/LibRoot.vue +73 -100
  52. package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +41 -0
  53. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +49 -78
  54. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +35 -0
  55. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +123 -157
  56. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +94 -0
  57. package/dist/runtime/components/LibTable/LibTable.vue +63 -100
  58. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +45 -0
  59. package/dist/runtime/components/Template/NAME.vue +15 -36
  60. package/dist/runtime/components/Template/NAME.vue.d.ts +17 -0
  61. package/dist/runtime/components/TestControls/TestControls.vue +6 -9
  62. package/dist/runtime/components/TestControls/TestControls.vue.d.ts +5 -0
  63. package/dist/runtime/directives/vResizableCols.js +89 -83
  64. package/dist/types.d.mts +2 -6
  65. package/package.json +11 -11
  66. package/src/runtime/components/Focus.stories.ts +3 -2
  67. package/src/runtime/components/Icon/Icon.vue +0 -1
  68. package/src/runtime/components/LibButton/LibButton.vue +0 -1
  69. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -1
  70. package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -1
  71. package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +0 -1
  72. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +0 -1
  73. package/src/runtime/components/LibFileInput/LibFileInput.vue +0 -1
  74. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -1
  75. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -1
  76. package/src/runtime/components/LibNotifications/LibNotification.vue +0 -1
  77. package/src/runtime/components/LibNotifications/LibNotifications.vue +0 -1
  78. package/src/runtime/components/LibPagination/LibPagination.vue +0 -1
  79. package/src/runtime/components/LibPopup/LibPopup.vue +0 -1
  80. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -1
  81. package/src/runtime/components/LibRecorder/LibRecorder.vue +0 -1
  82. package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +0 -1
  83. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -1
  84. package/src/runtime/components/LibTable/LibTable.vue +0 -1
  85. package/src/runtime/directives/vResizableCols.ts +79 -73
  86. package/dist/module.cjs +0 -5
  87. package/dist/module.d.ts +0 -36
  88. package/dist/runtime/components/Focus.stories.d.ts +0 -11
  89. package/dist/runtime/components/Focus.stories.js +0 -53
  90. package/dist/runtime/components/LibButton/LibButton.stories.d.ts +0 -12
  91. package/dist/runtime/components/LibButton/LibButton.stories.js +0 -94
  92. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.d.ts +0 -14
  93. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.js +0 -29
  94. package/dist/runtime/components/LibColorInput/LibColorInput.stories.d.ts +0 -7
  95. package/dist/runtime/components/LibColorInput/LibColorInput.stories.js +0 -58
  96. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.d.ts +0 -9
  97. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.js +0 -68
  98. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.d.ts +0 -7
  99. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.js +0 -36
  100. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.d.ts +0 -11
  101. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.js +0 -98
  102. package/dist/runtime/components/LibDebug/LibDebug.stories.d.ts +0 -9
  103. package/dist/runtime/components/LibDebug/LibDebug.stories.js +0 -46
  104. package/dist/runtime/components/LibFileInput/LibFileInput.stories.d.ts +0 -10
  105. package/dist/runtime/components/LibFileInput/LibFileInput.stories.js +0 -63
  106. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.d.ts +0 -33
  107. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.js +0 -384
  108. package/dist/runtime/components/LibLabel/LibLabel.stories.d.ts +0 -6
  109. package/dist/runtime/components/LibLabel/LibLabel.stories.js +0 -25
  110. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.d.ts +0 -23
  111. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.js +0 -61
  112. package/dist/runtime/components/LibNotifications/LibNotification.stories.d.ts +0 -15
  113. package/dist/runtime/components/LibNotifications/LibNotification.stories.js +0 -126
  114. package/dist/runtime/components/LibNotifications/LibNotifications.stories.d.ts +0 -6
  115. package/dist/runtime/components/LibNotifications/LibNotifications.stories.js +0 -109
  116. package/dist/runtime/components/LibPagination/LibPagination.stories.d.ts +0 -6
  117. package/dist/runtime/components/LibPagination/LibPagination.stories.js +0 -40
  118. package/dist/runtime/components/LibPalette/LibPalette.stories.d.ts +0 -6
  119. package/dist/runtime/components/LibPalette/LibPalette.stories.js +0 -20
  120. package/dist/runtime/components/LibPopup/LibPopup.stories.d.ts +0 -14
  121. package/dist/runtime/components/LibPopup/LibPopup.stories.js +0 -147
  122. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.d.ts +0 -10
  123. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.js +0 -81
  124. package/dist/runtime/components/LibRecorder/LibRecorder.stories.d.ts +0 -19
  125. package/dist/runtime/components/LibRecorder/LibRecorder.stories.js +0 -63
  126. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.d.ts +0 -26
  127. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.js +0 -78
  128. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.d.ts +0 -27
  129. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.js +0 -112
  130. package/dist/runtime/components/LibTable/LibTable.stories.d.ts +0 -16
  131. package/dist/runtime/components/LibTable/LibTable.stories.js +0 -156
  132. package/dist/runtime/components/Reset.stories.d.ts +0 -5
  133. package/dist/runtime/components/Reset.stories.js +0 -19
  134. package/dist/runtime/components/Scrolling.stories.d.ts +0 -6
  135. package/dist/runtime/components/Scrolling.stories.js +0 -44
  136. package/dist/runtime/composables/useScrollNearContainerEdges.stories.d.ts +0 -7
  137. package/dist/runtime/composables/useScrollNearContainerEdges.stories.js +0 -85
  138. package/dist/types.d.ts +0 -7
@@ -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;
@@ -1,126 +0,0 @@
1
- import LibNotification from "./LibNotification.vue";
2
- import { NotificationHandler } from "../../helpers/NotificationHandler.js";
3
- import * as components from "../index.js";
4
- const handler = new NotificationHandler();
5
- const meta = {
6
- component: LibNotification,
7
- title: "Components/Notification",
8
- args: {}
9
- };
10
- export default meta;
11
- export const Primary = {
12
- render: (args) => ({
13
- components: { ...components, LibNotification },
14
- setup() {
15
- return { args };
16
- },
17
- backgrounds: { disable: true },
18
- template: `
19
- <lib-notification v-bind="args"/>
20
- `
21
- }),
22
- args: {
23
- // @ts-expect-error calling protected method
24
- notification: {
25
- ...handler._createEntry({
26
- title: `Notification`,
27
- message: `This is a notification. Pick an option:`
28
- }),
29
- // eslint-disable-next-line @typescript-eslint/no-empty-function
30
- resolve: () => {
31
- }
32
- }
33
- }
34
- };
35
- export const WithoutTitle = {
36
- ...Primary,
37
- args: {
38
- ...Primary.args,
39
- // @ts-expect-error calling protected method
40
- notification: handler._createEntry({
41
- ...Primary.args.notification,
42
- title: void 0
43
- })
44
- }
45
- };
46
- export const WithCode = {
47
- ...Primary,
48
- args: {
49
- ...Primary.args,
50
- // @ts-expect-error calling protected method
51
- notification: handler._createEntry({
52
- ...Primary.args.notification,
53
- code: "0001"
54
- })
55
- }
56
- };
57
- export const RequiresAction = {
58
- ...Primary,
59
- args: {
60
- ...Primary.args,
61
- // @ts-expect-error calling protected method
62
- notification: handler._createEntry({
63
- ...Primary.args.notification,
64
- requiresAction: true
65
- })
66
- }
67
- };
68
- export const Uncancellable = {
69
- ...Primary,
70
- args: {
71
- ...Primary.args,
72
- // @ts-expect-error calling protected method
73
- notification: handler._createEntry({
74
- ...Primary.args.notification,
75
- options: ["Ok"],
76
- cancellable: false
77
- })
78
- }
79
- };
80
- export const CustomOptions = {
81
- ...Primary,
82
- args: {
83
- ...Primary.args,
84
- // @ts-expect-error calling protected method
85
- notification: handler._createEntry({
86
- ...Primary.args.notification,
87
- options: ["Ok", "Default Answer", "Cancel"]
88
- })
89
- }
90
- };
91
- export const CustomDefaultOption = {
92
- ...Primary,
93
- args: {
94
- ...Primary.args,
95
- // @ts-expect-error calling protected method
96
- notification: handler._createEntry({
97
- ...CustomOptions.args.notification,
98
- default: "Default Answer"
99
- })
100
- }
101
- };
102
- export const CustomDangerousOption = {
103
- ...Primary,
104
- args: {
105
- ...Primary.args,
106
- // @ts-expect-error calling protected method
107
- notification: handler._createEntry({
108
- ...CustomOptions.args.notification,
109
- options: ["Ok", "Dangerous Option", "Cancel"],
110
- dangerous: ["Dangerous Option"]
111
- })
112
- }
113
- };
114
- export const CustomDefaultAndDangerousOption = {
115
- ...Primary,
116
- args: {
117
- ...Primary.args,
118
- // @ts-expect-error calling protected method
119
- notification: handler._createEntry({
120
- ...CustomOptions.args.notification,
121
- options: ["Ok", "Default Answer", "Dangerous Option", "Cancel"],
122
- default: "Default Answer",
123
- dangerous: ["Dangerous Option"]
124
- })
125
- }
126
- };
@@ -1,6 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import LibNotifications from "./LibNotifications.vue.js";
3
- declare const meta: Meta<typeof LibNotifications>;
4
- export default meta;
5
- type Story = StoryObj<typeof LibNotifications>;
6
- export declare const Primary: Story;
@@ -1,109 +0,0 @@
1
- import { reactive, ref } from "vue";
2
- import LibNotifications from "./LibNotifications.vue";
3
- import { NotificationHandler } from "../../helpers/NotificationHandler.js";
4
- import * as components from "../index.js";
5
- const meta = {
6
- component: LibNotifications,
7
- title: "Components/Notifications",
8
- args: {
9
- // @ts-expect-error story only arg
10
- withTitle: true
11
- }
12
- };
13
- export default meta;
14
- export const Primary = {
15
- render: (args) => ({
16
- components,
17
- setup() {
18
- const handler = reactive(new NotificationHandler());
19
- let count = 0;
20
- const withTitle = ref(args.withTitle);
21
- const disableTimeout = ref(false);
22
- const notifyRequiresAction = () => {
23
- count++;
24
- void handler.notify({
25
- title: withTitle.value ? `Notification(${count})` : void 0,
26
- message: `This is a notification that requires action. Pick an option:`,
27
- requiresAction: true,
28
- options: ["Ok", "Default Answer", "Cancel"],
29
- default: "Default Answer"
30
- });
31
- };
32
- const notifyWithDangerousOption = () => {
33
- count++;
34
- void handler.notify({
35
- title: withTitle.value ? `Notification(${count})` : void 0,
36
- message: `This is a notification that has a dangerous option. Pick an option:`,
37
- options: ["Ok", "Default Answer", "Dangerous Option", "Cancel"],
38
- default: "Default Answer",
39
- dangerous: ["Dangerous Option"]
40
- });
41
- };
42
- const notifyNonCancellable = () => {
43
- count++;
44
- void handler.notify({
45
- title: withTitle.value ? `Notification(${count})` : void 0,
46
- message: `This is a non-cancellable notification. Pick an option:`,
47
- options: ["Ok", "Default Answer"],
48
- default: "Default Answer",
49
- cancellable: false
50
- });
51
- };
52
- const notifyNonCancellableRequiresAction = () => {
53
- count++;
54
- void handler.notify({
55
- title: withTitle.value ? `Notification(${count})` : void 0,
56
- message: `This is a non-cancellable notification. Pick an option:`,
57
- requiresAction: true,
58
- options: ["Ok", "Default Answer"],
59
- default: "Default Answer",
60
- cancellable: false
61
- });
62
- };
63
- const notifyTimeoutable = () => {
64
- count++;
65
- void handler.notify({
66
- title: withTitle.value ? `Notification(${count})` : void 0,
67
- message: `This is a notification. No action required.`,
68
- timeout: disableTimeout.value ? false : 2e3
69
- });
70
- };
71
- return {
72
- notifyRequiresAction,
73
- notifyTimeoutable,
74
- notifyNonCancellable,
75
- notifyWithDangerousOption,
76
- notifyNonCancellableRequiresAction,
77
- handler,
78
- withTitle,
79
- disableTimeout,
80
- args: {
81
- outline: false,
82
- ...args
83
- }
84
- };
85
- },
86
- backgrounds: { disable: true },
87
- // <lib-debug>{{args.handler}}</lib-debug>
88
- template: `
89
- <lib-root :outline="args.outline">
90
- <lib-button :label="'Notify Timeoutable'" @click="notifyTimeoutable()"></lib-button>
91
- <lib-button :label="'Notify RequiresAction'" @click="notifyRequiresAction()"></lib-button>
92
- <lib-button :label="'Notify Non-Cancellable that RequiresAction'" @click="notifyNonCancellableRequiresAction()"></lib-button>
93
- <lib-button :label="'Notify With Dangerous Option'" @click="notifyWithDangerousOption()"></lib-button>
94
- <lib-button :label="'Notify Non-Cancellable'" @click="notifyNonCancellable()"></lib-button>
95
- <input type="checkbox" v-model="withTitle"/> With Title
96
- <input type="checkbox" v-model="disableTimeout"/> Disable Timeout
97
- <lib-notifications :handler="handler" />
98
- History:
99
- <lib-debug>
100
- <template v-for="entry in handler.history">
101
- Message: {{entry.message}}
102
- Resolution: {{entry.resolution}}
103
- <br>
104
- </template>
105
- </lib-debug>
106
- </lib-root>
107
- `
108
- })
109
- };
@@ -1,6 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import LibPagination from "./LibPagination.vue.js";
3
- declare const meta: Meta<typeof LibPagination>;
4
- export default meta;
5
- type Story = StoryObj<typeof LibPagination>;
6
- export declare const Primary: Story;
@@ -1,40 +0,0 @@
1
- import { ref } from "vue";
2
- import LibPagination from "./LibPagination.vue";
3
- import * as components from "../index.js";
4
- const meta = {
5
- component: LibPagination,
6
- title: "Components/Pagination",
7
- args: {
8
- total: 10
9
- }
10
- };
11
- export default meta;
12
- export const Primary = {
13
- render: (args) => ({
14
- components,
15
- setup() {
16
- const num = ref(1);
17
- const changePage = ($event, i) => {
18
- $event.preventDefault();
19
- if (i >= 10) num.value = 10;
20
- if (i <= 1) num.value = 1;
21
- num.value = i;
22
- };
23
- return {
24
- changePage,
25
- args,
26
- num
27
- };
28
- },
29
- template: `
30
- <lib-pagination v-bind="{...args, current: num, route:'#'}">
31
- <template #link="linkProps">
32
- <a v-bind="linkProps" @click="changePage($event, linkProps.i)">{{ linkProps.text ?? linkProps.i }}</a>
33
- </template>
34
- </lib-pagination>
35
- <lib-simple-input :label="'Change Page'" :modelValue="num.toString()" @update:modelValue="num = parseInt($event)" type="number" min="0" :max="args.total">
36
-
37
- </lib-simple-input>
38
- `
39
- })
40
- };
@@ -1,6 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import LibPalette from "./LibPalette.vue.js";
3
- declare const meta: Meta<typeof LibPalette>;
4
- export default meta;
5
- type Story = StoryObj<typeof LibPalette>;
6
- export declare const Primary: Story;
@@ -1,20 +0,0 @@
1
- import LibPalette from "./LibPalette.vue";
2
- import { theme } from "../../theme.js";
3
- import * as components from "../index.js";
4
- const meta = {
5
- component: LibPalette,
6
- title: "Components/Palette",
7
- args: {
8
- // theme,
9
- }
10
- };
11
- export default meta;
12
- export const Primary = {
13
- render: (args) => ({
14
- components: { ...components, LibPalette },
15
- setup: () => ({ args: { ...args, theme } }),
16
- template: `
17
- <LibPalette v-bind="{...args}">{{args.value}}</LibPalette>
18
- `
19
- })
20
- };
@@ -1,14 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import LibPopup from "./LibPopup.vue.js";
3
- declare const meta: Meta<typeof LibPopup>;
4
- export default meta;
5
- type Story = StoryObj<typeof LibPopup>;
6
- export declare const Primary: Story;
7
- export declare const PopupNoShift: any;
8
- /** When the popup is too wide, it's positioned to the left and overflow scroll is set with an invisible scrollbar. */
9
- export declare const PopupTooBig: any;
10
- export declare const PopupCenterScreen: any;
11
- export declare const PopupRightBottomMost: any;
12
- export declare const PopupLeftTopMost: any;
13
- export declare const PopupCenterMost: any;
14
- export declare const LeftMenuShapeExample: any;
@@ -1,147 +0,0 @@
1
- import { computed, ref, watch } from "vue";
2
- import LibPopup from "./LibPopup.vue";
3
- import { vExtractRootEl } from "../../directives/vExtractRootEl.js";
4
- import * as components from "../index.js";
5
- const meta = {
6
- component: LibPopup,
7
- title: "Components/Popup",
8
- args: {}
9
- };
10
- export default meta;
11
- export const Primary = {
12
- render: (args) => ({
13
- components,
14
- directives: { extractRootEl: vExtractRootEl },
15
- setup: () => {
16
- const value = ref(false);
17
- const buttonPositions = ["TL", "TC", "TR", "BL", "BC", "BR"];
18
- const buttonPos = ref("TL");
19
- const autoRotatePos = ref(true);
20
- const buttonStyle = computed(() => {
21
- switch (buttonPos.value) {
22
- case "TL":
23
- return `align-self: flex-start; justify-self: flex-start;`;
24
- case "TC":
25
- return `align-self: flex-start; justify-self: center;`;
26
- case "TR":
27
- return `align-self: flex-start; justify-self: flex-end;`;
28
- case "BL":
29
- return `align-self: flex-end; justify-self: flex-start;`;
30
- case "BC":
31
- return `align-self: flex-end; justify-self: center;`;
32
- case "BR":
33
- return `align-self: flex-end; justify-self: flex-end;`;
34
- default:
35
- return "";
36
- }
37
- });
38
- watch(value, () => {
39
- if (!value.value && autoRotatePos.value) {
40
- const buttonI = buttonPositions.indexOf(buttonPos.value);
41
- if (buttonI < 5) {
42
- buttonPos.value = buttonPositions[buttonI + 1];
43
- } else {
44
- buttonPos.value = buttonPositions[0];
45
- }
46
- }
47
- });
48
- return {
49
- args,
50
- buttonPos,
51
- autoRotatePos,
52
- buttonStyle,
53
- value
54
- };
55
- },
56
- template: `
57
- <lib-simple-input
58
- :suggestions="['TL', 'TR', 'BL', 'BR']"
59
- :restrict-to-suggestions="true"
60
- :suggestions-filter="(_, items) => items"
61
- :label="'Button Position'"
62
- v-model="buttonPos"
63
- >
64
- </lib-simple-input>
65
- <div>
66
- <label>Auto Rotate Position</label>
67
- <input type="checkbox" v-model="autoRotatePos">
68
- </div>
69
- <div class="test bg-transparency-squares" style="display:grid;height:80vh;padding:50px;border:1px solid black;">
70
-
71
- <lib-popup v-model="value" v-bind="{ ...args, width:undefined, }" >
72
- {{value}}
73
- <template #button="{extractEl}">
74
- <lib-button :style="buttonStyle" @click="value = !value" v-extract-root-el="extractEl">Toggle Popup</lib-button>
75
- </template>
76
- <template #popup="{position, extractEl}">
77
- <lib-debug
78
- v-extract-root-el="extractEl"
79
- :style="(args.width ? \`width: \${args.width};\` : '') + (args.height ? \`height: \${args.height};\` : '')"
80
- class="bg-bg dark:bg-fg w-[500px]"
81
- >
82
- {{ position }}
83
- </lib-debug>
84
- </template>
85
- </lib-popup>
86
- </div>
87
- `
88
- })
89
- };
90
- export const PopupNoShift = {
91
- ...Primary,
92
- args: {
93
- avoidRepositioning: true
94
- }
95
- };
96
- export const PopupTooBig = {
97
- ...Primary,
98
- args: {
99
- width: "110vw"
100
- }
101
- };
102
- export const PopupCenterScreen = {
103
- ...Primary,
104
- args: {
105
- width: "500px",
106
- height: "500px",
107
- preferredHorizontal: ["center-screen"],
108
- preferredVertical: ["center-screen"]
109
- }
110
- };
111
- export const PopupRightBottomMost = {
112
- ...Primary,
113
- args: {
114
- width: "500px",
115
- height: "500px",
116
- preferredHorizontal: ["right-most"],
117
- preferredVertical: ["bottom-most"]
118
- }
119
- };
120
- export const PopupLeftTopMost = {
121
- ...Primary,
122
- args: {
123
- width: "500px",
124
- height: "500px",
125
- preferredHorizontal: ["left-most"],
126
- preferredVertical: ["top-most"]
127
- }
128
- };
129
- export const PopupCenterMost = {
130
- ...Primary,
131
- args: {
132
- width: "500px",
133
- height: "500px",
134
- preferredHorizontal: ["center-most"],
135
- preferredVertical: ["center-most"]
136
- }
137
- };
138
- export const LeftMenuShapeExample = {
139
- ...Primary,
140
- args: {
141
- width: "300px",
142
- height: "500px",
143
- preferredHorizontal: ["left-most"],
144
- preferredVertical: ["center-most"],
145
- avoidRepositioning: true
146
- }
147
- };
@@ -1,10 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import LibProgressBar from "./LibProgressBar.vue.js";
3
- declare const meta: Meta<typeof LibProgressBar>;
4
- export default meta;
5
- type Story = StoryObj<typeof LibProgressBar>;
6
- export declare const Primary: Story;
7
- export declare const Secondary: Story;
8
- export declare const ReallyLongLabel: Story;
9
- export declare const Static: Story;
10
- export declare const AutoHiding: Story;