@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.
- package/README.md +3 -6
- package/dist/module.json +3 -3
- package/dist/module.mjs +15 -12
- package/dist/runtime/build/generateTheme.js +1 -1
- package/dist/runtime/components/Aria/Aria.vue +5 -9
- package/dist/runtime/components/Aria/Aria.vue.d.ts +5 -0
- package/dist/runtime/components/Icon/Icon.vue +10 -30
- package/dist/runtime/components/Icon/Icon.vue.d.ts +21 -0
- package/dist/runtime/components/LibButton/LibButton.vue +51 -72
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +36 -0
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +43 -74
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +42 -0
- package/dist/runtime/components/LibColorInput/LibColorInput.vue +63 -107
- package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +63 -0
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +272 -352
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +61 -0
- package/dist/runtime/components/LibColorPicker/utils/safeConvertToHsva.js +1 -1
- package/dist/runtime/components/LibColorPicker/utils/safeConvertToRgba.js +1 -1
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +35 -69
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +22 -0
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue +17 -38
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +40 -0
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +58 -82
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +34 -0
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +55 -67
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +34 -0
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue +7 -8
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +22 -0
- package/dist/runtime/components/LibDebug/LibDebug.vue +43 -70
- package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +32 -0
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +18 -31
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +22 -0
- package/dist/runtime/components/LibFileInput/LibFileInput.vue +116 -156
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +43 -0
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +211 -241
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +165 -0
- package/dist/runtime/components/LibLabel/LibLabel.vue +25 -46
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +26 -0
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +43 -58
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +29 -0
- package/dist/runtime/components/LibNotifications/LibNotification.vue +34 -48
- package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +17 -0
- package/dist/runtime/components/LibNotifications/LibNotifications.vue +63 -83
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +13 -0
- package/dist/runtime/components/LibPagination/LibPagination.vue +67 -111
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +104 -0
- package/dist/runtime/components/LibPalette/LibPalette.vue +17 -23
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +14 -0
- package/dist/runtime/components/LibPopup/LibPopup.vue +314 -351
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +46 -0
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +65 -91
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +41 -0
- package/dist/runtime/components/LibRecorder/LibRecorder.vue +127 -177
- package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +77 -0
- package/dist/runtime/components/LibRoot/LibRoot.vue +75 -101
- package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +41 -0
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +42 -77
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +35 -0
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +118 -156
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +94 -0
- package/dist/runtime/components/LibTable/LibTable.vue +63 -99
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +45 -0
- package/dist/runtime/components/Template/NAME.vue +15 -36
- package/dist/runtime/components/Template/NAME.vue.d.ts +17 -0
- package/dist/runtime/components/TestControls/TestControls.vue +6 -9
- package/dist/runtime/components/TestControls/TestControls.vue.d.ts +5 -0
- package/dist/runtime/components/shared/props.d.ts +0 -29
- package/dist/runtime/components/shared/props.js +0 -12
- package/dist/runtime/composables/useAccesibilityOutline.js +1 -1
- package/dist/runtime/composables/useDivideAttrs.js +1 -1
- package/dist/runtime/composables/useSuggestions.js +4 -4
- package/dist/runtime/directives/vDetectFlex.js +4 -4
- package/dist/runtime/directives/vExtractRootEl.d.ts +1 -1
- package/dist/runtime/directives/vResizableCols.d.ts +1 -1
- package/dist/runtime/directives/vResizableCols.js +4 -4
- package/dist/runtime/helpers/NotificationHandler.js +6 -6
- package/dist/runtime/helpers/base64ToImg.js +2 -2
- package/dist/runtime/nuxt/plugins/vue-plugin.js +1 -1
- package/dist/runtime/tailwind/themeConvertionOpts.d.ts +1 -1
- package/dist/runtime/theme.d.ts +1 -1
- package/dist/runtime/theme.js +1 -1
- package/dist/runtime/utils/notifyIfError.js +1 -1
- package/dist/runtime/vue/registerComponents.js +1 -1
- package/dist/types.d.mts +2 -6
- package/package.json +68 -90
- package/src/module.ts +19 -12
- package/src/runtime/build/generateTheme.ts +1 -1
- package/src/runtime/components/LibButton/LibButton.stories.ts +1 -1
- package/src/runtime/components/LibButton/LibButton.vue +3 -3
- package/src/runtime/components/LibCheckbox/LibCheckbox.vue +3 -7
- package/src/runtime/components/LibColorPicker/LibColorPicker.vue +6 -4
- package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +1 -1
- package/src/runtime/components/LibColorPicker/utils/safeConvertToRgba.ts +1 -1
- package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +8 -15
- package/src/runtime/components/LibDatePicker/LibRangeDatePicker.vue +6 -0
- package/src/runtime/components/LibDatePicker/LibSingleDatePicker.vue +6 -0
- package/src/runtime/components/LibDebug/LibDebug.stories.ts +1 -1
- package/src/runtime/components/LibDebug/LibDebug.vue +2 -0
- package/src/runtime/components/LibFileInput/LibFileInput.vue +4 -0
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +7 -5
- package/src/runtime/components/LibLabel/LibLabel.vue +2 -3
- package/src/runtime/components/LibMultiValues/LibMultiValues.vue +5 -3
- package/src/runtime/components/LibNotifications/LibNotification.vue +3 -0
- package/src/runtime/components/LibNotifications/LibNotifications.vue +1 -1
- package/src/runtime/components/LibPalette/LibPalette.vue +3 -3
- package/src/runtime/components/LibPopup/LibPopup.vue +2 -2
- package/src/runtime/components/LibProgressBar/LibProgressBar.vue +2 -2
- package/src/runtime/components/LibRecorder/LibRecorder.vue +3 -3
- package/src/runtime/components/LibRoot/LibRoot.vue +3 -2
- package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +2 -2
- package/src/runtime/components/LibSuggestions/LibSuggestions.vue +2 -2
- package/src/runtime/components/LibTable/LibTable.vue +1 -1
- package/src/runtime/components/Template/NAME.vue +2 -2
- package/src/runtime/components/shared/props.ts +8 -12
- package/src/runtime/composables/useAccesibilityOutline.ts +1 -1
- package/src/runtime/composables/useDivideAttrs.ts +1 -1
- package/src/runtime/composables/useSuggestions.ts +4 -4
- package/src/runtime/directives/vDetectFlex.ts +4 -4
- package/src/runtime/directives/vExtractRootEl.ts +1 -1
- package/src/runtime/directives/vResizableCols.ts +5 -5
- package/src/runtime/helpers/NotificationHandler.ts +6 -6
- package/src/runtime/nuxt/plugins/vue-plugin.ts +1 -1
- package/src/runtime/tailwind/themeConvertionOpts.ts +1 -1
- package/src/runtime/theme.ts +2 -2
- package/src/runtime/utils/notifyIfError.ts +1 -1
- package/src/runtime/vue/registerComponents.ts +1 -1
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -36
- package/dist/runtime/components/Focus.stories.d.ts +0 -11
- package/dist/runtime/components/Focus.stories.js +0 -53
- package/dist/runtime/components/LibButton/LibButton.stories.d.ts +0 -12
- package/dist/runtime/components/LibButton/LibButton.stories.js +0 -94
- package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.d.ts +0 -14
- package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.js +0 -29
- package/dist/runtime/components/LibColorInput/LibColorInput.stories.d.ts +0 -7
- package/dist/runtime/components/LibColorInput/LibColorInput.stories.js +0 -58
- package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.d.ts +0 -9
- package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.js +0 -68
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.d.ts +0 -7
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.js +0 -36
- package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.d.ts +0 -11
- package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.js +0 -98
- package/dist/runtime/components/LibDebug/LibDebug.stories.d.ts +0 -9
- package/dist/runtime/components/LibDebug/LibDebug.stories.js +0 -46
- package/dist/runtime/components/LibFileInput/LibFileInput.stories.d.ts +0 -10
- package/dist/runtime/components/LibFileInput/LibFileInput.stories.js +0 -63
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.d.ts +0 -33
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.js +0 -384
- package/dist/runtime/components/LibLabel/LibLabel.stories.d.ts +0 -6
- package/dist/runtime/components/LibLabel/LibLabel.stories.js +0 -25
- package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.d.ts +0 -23
- package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.js +0 -61
- package/dist/runtime/components/LibNotifications/LibNotification.stories.d.ts +0 -15
- package/dist/runtime/components/LibNotifications/LibNotification.stories.js +0 -126
- package/dist/runtime/components/LibNotifications/LibNotifications.stories.d.ts +0 -6
- package/dist/runtime/components/LibNotifications/LibNotifications.stories.js +0 -109
- package/dist/runtime/components/LibPagination/LibPagination.stories.d.ts +0 -6
- package/dist/runtime/components/LibPagination/LibPagination.stories.js +0 -40
- package/dist/runtime/components/LibPalette/LibPalette.stories.d.ts +0 -6
- package/dist/runtime/components/LibPalette/LibPalette.stories.js +0 -20
- package/dist/runtime/components/LibPopup/LibPopup.stories.d.ts +0 -14
- package/dist/runtime/components/LibPopup/LibPopup.stories.js +0 -147
- package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.d.ts +0 -10
- package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.js +0 -81
- package/dist/runtime/components/LibRecorder/LibRecorder.stories.d.ts +0 -19
- package/dist/runtime/components/LibRecorder/LibRecorder.stories.js +0 -63
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.d.ts +0 -26
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.js +0 -78
- package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.d.ts +0 -27
- package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.js +0 -112
- package/dist/runtime/components/LibTable/LibTable.stories.d.ts +0 -16
- package/dist/runtime/components/LibTable/LibTable.stories.js +0 -156
- package/dist/runtime/components/Reset.stories.d.ts +0 -5
- package/dist/runtime/components/Reset.stories.js +0 -19
- package/dist/runtime/components/Scrolling.stories.d.ts +0 -6
- package/dist/runtime/components/Scrolling.stories.js +0 -44
- package/dist/runtime/composables/useScrollNearContainerEdges.stories.d.ts +0 -7
- package/dist/runtime/composables/useScrollNearContainerEdges.stories.js +0 -85
- package/dist/types.d.ts +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { castType } from "@alanscodelog/utils/castType
|
|
2
|
-
import { override } from "@alanscodelog/utils/override
|
|
3
|
-
import { throttle } from "@alanscodelog/utils/throttle
|
|
4
|
-
import { unreachable } from "@alanscodelog/utils/unreachable
|
|
1
|
+
import { castType } from "@alanscodelog/utils/castType"
|
|
2
|
+
import { override } from "@alanscodelog/utils/override"
|
|
3
|
+
import { throttle } from "@alanscodelog/utils/throttle"
|
|
4
|
+
import { unreachable } from "@alanscodelog/utils/unreachable"
|
|
5
5
|
import type { Directive, Ref } from "vue"
|
|
6
6
|
|
|
7
7
|
import { globalResizeObserver } from "../globalResizeObserver.js"
|
|
@@ -50,7 +50,7 @@ const throttledCallback = throttle(callback)
|
|
|
50
50
|
* </div>
|
|
51
51
|
* </template>
|
|
52
52
|
* <script setup>
|
|
53
|
-
* import {vResizeCols} from "@witchcraft/ui/directives/vResizableCols
|
|
53
|
+
* import {vResizeCols} from "@witchcraft/ui/directives/vResizableCols"
|
|
54
54
|
* </script>
|
|
55
55
|
* ```
|
|
56
56
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { AnyFunction, MakeRequired } from "@alanscodelog/utils"
|
|
2
|
-
import { castType } from "@alanscodelog/utils/castType
|
|
3
|
-
import { crop } from "@alanscodelog/utils/crop
|
|
4
|
-
import { indent } from "@alanscodelog/utils/indent
|
|
5
|
-
import { isBlank } from "@alanscodelog/utils/isBlank
|
|
6
|
-
import { pretty } from "@alanscodelog/utils/pretty
|
|
7
|
-
import { setReadOnly } from "@alanscodelog/utils/setReadOnly
|
|
2
|
+
import { castType } from "@alanscodelog/utils/castType"
|
|
3
|
+
import { crop } from "@alanscodelog/utils/crop"
|
|
4
|
+
import { indent } from "@alanscodelog/utils/indent"
|
|
5
|
+
import { isBlank } from "@alanscodelog/utils/isBlank"
|
|
6
|
+
import { pretty } from "@alanscodelog/utils/pretty"
|
|
7
|
+
import { setReadOnly } from "@alanscodelog/utils/setReadOnly"
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
export class NotificationHandler<
|
package/src/runtime/theme.ts
CHANGED
package/dist/module.cjs
DELETED
package/dist/module.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
|
|
3
|
-
declare const knownDirectives: readonly ["vExtractRootEl", "vResizableCols", "vResizeObserver", "vResizableCols"];
|
|
4
|
-
declare module "@nuxt/schema" {
|
|
5
|
-
interface PublicRuntimeConfig {
|
|
6
|
-
witchcraftUi: Pick<ModuleOptions, "directives">;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
interface ModuleOptions {
|
|
10
|
-
/**
|
|
11
|
-
* Whether to include the vite unplugin-icons plugins (pre-configured with the ui module's defaults.
|
|
12
|
-
*
|
|
13
|
-
* @default true
|
|
14
|
-
*/
|
|
15
|
-
includeUnpluginIconsPlugins?: boolean;
|
|
16
|
-
directives: (typeof knownDirectives[number])[];
|
|
17
|
-
/**
|
|
18
|
-
* Which components (without a prefix) to register for auto-importing globally.
|
|
19
|
-
*/
|
|
20
|
-
globalComponents: string[];
|
|
21
|
-
/**
|
|
22
|
-
* @default "W"
|
|
23
|
-
*/
|
|
24
|
-
componentPrefix: string;
|
|
25
|
-
debug?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* @default "~/assets/css/tailwind.css" if it exists.
|
|
28
|
-
*/
|
|
29
|
-
mainCssFile?: string;
|
|
30
|
-
/** @internal */
|
|
31
|
-
_playgroundWorkaround?: boolean;
|
|
32
|
-
}
|
|
33
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
34
|
-
|
|
35
|
-
export { _default as default };
|
|
36
|
-
export type { ModuleOptions };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/vue3";
|
|
2
|
-
/**
|
|
3
|
-
* For testing the focus styles. The (still WIP) idea is that normally the outlined class is set by whether the user is using the keyboard or not. When true, outlines generated by the focus-outline-* or outlined-* utilities are allowed (they might not always appear since most components have focus-visible styles), when false, they are not allowed, but components can still set custom focus styles that will always appear. Either or is usually not a good idea unless all components set custom focus styles. For something like a web app, focus-visible should be allowed. For an app, this setup allows that to be configurable.
|
|
4
|
-
*/
|
|
5
|
-
declare const meta: Meta;
|
|
6
|
-
export default meta;
|
|
7
|
-
type Story = StoryObj<{}>;
|
|
8
|
-
export declare const Primary: Story;
|
|
9
|
-
export declare const OutlineForcedTrue: Story;
|
|
10
|
-
export declare const OutlineFalse: Story;
|
|
11
|
-
export declare const AlwaysAllowFocusVisible: Story;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { onMounted, ref } from "vue";
|
|
2
|
-
import * as components from "./index.js";
|
|
3
|
-
const meta = {
|
|
4
|
-
title: "Other/Focus",
|
|
5
|
-
args: {
|
|
6
|
-
outline: true
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
const template = `
|
|
10
|
-
<div class="focus-outline-no-offset border border-accent-600" tabindex="0">focus-outline-no-offset (outlined i.e. outlined-focus-visible)</div>
|
|
11
|
-
<div class="focus-outline border border-accent-600" tabindex="0">focus-outline (outlined i.e. outlined-focus-visible)</div>
|
|
12
|
-
<div class="outline-hidden outlined-focus:border-danger-500 border border-accent-600" tabindex="0">outlined-focus</div>
|
|
13
|
-
<div class="outline-hidden outlined-within:border-danger-500 border border-accent-600" >
|
|
14
|
-
outlined-within<div tabindex="0">Inner</div>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="outline-hidden focus:border-danger-500 border border-accent-600" tabindex="0">Has Manual Focus Classes</div>
|
|
17
|
-
`;
|
|
18
|
-
export default meta;
|
|
19
|
-
export const Primary = {
|
|
20
|
-
render: (args) => ({
|
|
21
|
-
components,
|
|
22
|
-
setup: () => {
|
|
23
|
-
const el = ref(null);
|
|
24
|
-
onMounted(() => {
|
|
25
|
-
});
|
|
26
|
-
return { ...args, el };
|
|
27
|
-
},
|
|
28
|
-
template
|
|
29
|
-
})
|
|
30
|
-
};
|
|
31
|
-
export const OutlineForcedTrue = {
|
|
32
|
-
...Primary,
|
|
33
|
-
args: {
|
|
34
|
-
...Primary.args,
|
|
35
|
-
forceOutline: true
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
export const OutlineFalse = {
|
|
39
|
-
...Primary,
|
|
40
|
-
args: {
|
|
41
|
-
...Primary.args,
|
|
42
|
-
outline: false
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
export const AlwaysAllowFocusVisible = {
|
|
46
|
-
render: (args) => ({
|
|
47
|
-
components,
|
|
48
|
-
setup: () => args,
|
|
49
|
-
template: `
|
|
50
|
-
<div class="outlined-visible group">${template}</div>
|
|
51
|
-
`
|
|
52
|
-
})
|
|
53
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/vue3";
|
|
2
|
-
import * as components from "../index.js.js";
|
|
3
|
-
declare const meta: Meta<typeof components.LibButton>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof components.LibButton>;
|
|
6
|
-
export declare const Primary: Story;
|
|
7
|
-
export declare const IconAfter: Story;
|
|
8
|
-
export declare const OnlyIcon: Story;
|
|
9
|
-
export declare const Disabled: Story;
|
|
10
|
-
export declare const Borderless: Story;
|
|
11
|
-
export declare const BorderlessDisabled: Story;
|
|
12
|
-
export declare const WithDivInside: Story;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { capitalize } from "@alanscodelog/utils/capitalize.js";
|
|
2
|
-
import IconFaSolidBell from "~icons/fa-solid/bell";
|
|
3
|
-
import * as components from "../index.js";
|
|
4
|
-
const meta = {
|
|
5
|
-
component: components.LibButton,
|
|
6
|
-
title: "Components/Button",
|
|
7
|
-
args: {
|
|
8
|
-
label: "Label",
|
|
9
|
-
// @ts-expect-error - custom prop for story
|
|
10
|
-
_iconAfter: true
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export default meta;
|
|
14
|
-
export const Primary = {
|
|
15
|
-
render: (args) => ({
|
|
16
|
-
components: {
|
|
17
|
-
...components,
|
|
18
|
-
IconFaSolidBell
|
|
19
|
-
},
|
|
20
|
-
setup: () => ({ args, capitalize }),
|
|
21
|
-
template: `
|
|
22
|
-
<div class="flex gap-4 justify-center">
|
|
23
|
-
<template v-for="type of [false, 'ok', 'warning', 'danger', 'primary', 'secondary' ]">
|
|
24
|
-
<lib-button v-bind="{...args, color: type, label: !args.label ? undefined : args.label + ' ' + capitalize(type || 'false')}">
|
|
25
|
-
<template #icon>
|
|
26
|
-
<icon class="w-[1em]"><icon-fa-solid-bell /></icon>
|
|
27
|
-
</template>
|
|
28
|
-
</lib-button>
|
|
29
|
-
</template>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="flex flex-col gap-4 pt-10">
|
|
32
|
-
<template v-for="type of [false, 'ok', 'warning', 'danger', 'primary', 'secondary']">
|
|
33
|
-
<lib-button v-bind="{...args, color: type , label: !args.label ? undefined : args.label + ' ' + capitalize(type || 'false') }">
|
|
34
|
-
${args._iconAfter ? `
|
|
35
|
-
<template #icon-after>
|
|
36
|
-
<icon class="w-[1em]"><icon-fa-solid-bell /></icon>
|
|
37
|
-
</template>
|
|
38
|
-
` : ``}
|
|
39
|
-
</lib-button>
|
|
40
|
-
</template>
|
|
41
|
-
</div>
|
|
42
|
-
`
|
|
43
|
-
})
|
|
44
|
-
};
|
|
45
|
-
export const IconAfter = {
|
|
46
|
-
...Primary,
|
|
47
|
-
args: {
|
|
48
|
-
...Primary.args,
|
|
49
|
-
// @ts-expect-error - .
|
|
50
|
-
_iconAfter: true
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
export const OnlyIcon = {
|
|
54
|
-
...Primary,
|
|
55
|
-
args: {
|
|
56
|
-
...Primary.args,
|
|
57
|
-
label: void 0
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
export const Disabled = {
|
|
61
|
-
...Primary,
|
|
62
|
-
args: {
|
|
63
|
-
...Primary.args,
|
|
64
|
-
disabled: true
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
export const Borderless = {
|
|
68
|
-
...Primary,
|
|
69
|
-
args: {
|
|
70
|
-
...Primary.args,
|
|
71
|
-
border: false
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
export const BorderlessDisabled = {
|
|
75
|
-
...Primary,
|
|
76
|
-
args: {
|
|
77
|
-
...Primary.args,
|
|
78
|
-
border: false,
|
|
79
|
-
disabled: true
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
export const WithDivInside = {
|
|
83
|
-
render: (args) => ({
|
|
84
|
-
components,
|
|
85
|
-
setup: () => ({ args }),
|
|
86
|
-
template: `
|
|
87
|
-
<div class="flex gap-4 justify-center">
|
|
88
|
-
<lib-button v-bind="{...args}">
|
|
89
|
-
<div>Div inside button still has a pointer cursor.</div>
|
|
90
|
-
</lib-button>
|
|
91
|
-
</div>
|
|
92
|
-
`
|
|
93
|
-
})
|
|
94
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/vue3";
|
|
2
|
-
import * as components from "../index.js.js";
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: any;
|
|
5
|
-
title: string;
|
|
6
|
-
args: {
|
|
7
|
-
modelValue: boolean;
|
|
8
|
-
label: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof components.LibCheckbox>;
|
|
13
|
-
export declare const Primary: Story;
|
|
14
|
-
export declare const Disabled: any;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as components from "../index.js";
|
|
2
|
-
const meta = {
|
|
3
|
-
component: components.LibCheckbox,
|
|
4
|
-
title: "Components/Checkbox",
|
|
5
|
-
args: {
|
|
6
|
-
modelValue: true,
|
|
7
|
-
label: "Label"
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
export const Primary = {
|
|
12
|
-
render: (args) => ({
|
|
13
|
-
components,
|
|
14
|
-
setup: () => ({ args }),
|
|
15
|
-
template: `
|
|
16
|
-
<lib-checkbox v-bind="args" v-model="args.modelValue"></lib-checkbox>
|
|
17
|
-
<br>
|
|
18
|
-
Opposite State:
|
|
19
|
-
<br>
|
|
20
|
-
<lib-checkbox v-bind="args" :modelValue="!args.modelValue" @update:modelValue="args.modelValue = !$event"></lib-checkbox>
|
|
21
|
-
`
|
|
22
|
-
})
|
|
23
|
-
};
|
|
24
|
-
export const Disabled = {
|
|
25
|
-
...Primary,
|
|
26
|
-
args: {
|
|
27
|
-
disabled: true
|
|
28
|
-
}
|
|
29
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/vue3";
|
|
2
|
-
import LibColorInput from "./LibColorInput.vue.js";
|
|
3
|
-
declare const meta: Meta<typeof LibColorInput>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof LibColorInput>;
|
|
6
|
-
export declare const Primary: Story;
|
|
7
|
-
export declare const DoesNotAllowAlpha: Story;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
import LibColorInput from "./LibColorInput.vue";
|
|
3
|
-
import * as components from "../index.js";
|
|
4
|
-
const meta = {
|
|
5
|
-
component: LibColorInput,
|
|
6
|
-
title: "Components/ColorInput",
|
|
7
|
-
args: {}
|
|
8
|
-
};
|
|
9
|
-
export default meta;
|
|
10
|
-
export const Primary = {
|
|
11
|
-
render: (args) => ({
|
|
12
|
-
components,
|
|
13
|
-
setup: () => {
|
|
14
|
-
const color = ref({
|
|
15
|
-
r: 0,
|
|
16
|
-
g: 0,
|
|
17
|
-
b: 0
|
|
18
|
-
/* , a: 0.5 */
|
|
19
|
-
});
|
|
20
|
-
const handleChange = (e) => {
|
|
21
|
-
color.value = { ...e };
|
|
22
|
-
};
|
|
23
|
-
return {
|
|
24
|
-
args: {
|
|
25
|
-
outline: false,
|
|
26
|
-
color,
|
|
27
|
-
allowAlpha: true,
|
|
28
|
-
...args
|
|
29
|
-
},
|
|
30
|
-
handleChange
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
template: `
|
|
34
|
-
<lib-color-Input
|
|
35
|
-
:allowAlpha="args.allowAlpha"
|
|
36
|
-
:modelValue="args.color.value"
|
|
37
|
-
@update:modelValue="handleChange"
|
|
38
|
-
>
|
|
39
|
-
</lib-color-Input>
|
|
40
|
-
Stretched:
|
|
41
|
-
<div class="flex-1 flex">
|
|
42
|
-
<lib-color-Input
|
|
43
|
-
class="flex-1"
|
|
44
|
-
:allowAlpha="args.allowAlpha"
|
|
45
|
-
:modelValue="args.color.value"
|
|
46
|
-
@update:modelValue="handleChange"
|
|
47
|
-
>
|
|
48
|
-
</lib-color-Input>
|
|
49
|
-
</div>
|
|
50
|
-
`
|
|
51
|
-
})
|
|
52
|
-
};
|
|
53
|
-
export const DoesNotAllowAlpha = {
|
|
54
|
-
...Primary,
|
|
55
|
-
args: {
|
|
56
|
-
allowAlpha: false
|
|
57
|
-
}
|
|
58
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/vue3";
|
|
2
|
-
import LibColorPicker from "./LibColorPicker.vue.js";
|
|
3
|
-
declare const meta: Meta<typeof LibColorPicker>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof LibColorPicker>;
|
|
6
|
-
export declare const Primary: Story;
|
|
7
|
-
export declare const DoesNotAllowAlpha: Story;
|
|
8
|
-
export declare const WithExistingValue: Story;
|
|
9
|
-
export declare const CustomStringRepresentation: Story;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import Color from "colorjs.io";
|
|
2
|
-
import { ref } from "vue";
|
|
3
|
-
import LibColorPicker from "./LibColorPicker.vue";
|
|
4
|
-
import * as components from "../index.js";
|
|
5
|
-
const meta = {
|
|
6
|
-
component: LibColorPicker,
|
|
7
|
-
title: "Components/ColorPicker",
|
|
8
|
-
args: {}
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
export const Primary = {
|
|
12
|
-
render: (args) => ({
|
|
13
|
-
components,
|
|
14
|
-
setup: () => {
|
|
15
|
-
const color = ref({ r: 0, g: 0, b: 0, ...args.modelValue });
|
|
16
|
-
delete args.modelValue;
|
|
17
|
-
const handleChange = (e) => {
|
|
18
|
-
color.value = { ...e };
|
|
19
|
-
};
|
|
20
|
-
return {
|
|
21
|
-
args: {
|
|
22
|
-
outline: false,
|
|
23
|
-
color,
|
|
24
|
-
allowAlpha: true,
|
|
25
|
-
...args
|
|
26
|
-
},
|
|
27
|
-
handleChange
|
|
28
|
-
};
|
|
29
|
-
},
|
|
30
|
-
template: `
|
|
31
|
-
<lib-root :outline="args.outline">
|
|
32
|
-
{{args.color}}
|
|
33
|
-
<lib-color-picker
|
|
34
|
-
:modelValue="args.color.value"
|
|
35
|
-
v-bind="args"
|
|
36
|
-
@update:modelValue="handleChange"
|
|
37
|
-
>
|
|
38
|
-
</lib-color-picker>
|
|
39
|
-
</lib-root>
|
|
40
|
-
`
|
|
41
|
-
})
|
|
42
|
-
};
|
|
43
|
-
export const DoesNotAllowAlpha = {
|
|
44
|
-
...Primary,
|
|
45
|
-
args: {
|
|
46
|
-
allowAlpha: false
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
export const WithExistingValue = {
|
|
50
|
-
...Primary,
|
|
51
|
-
args: {
|
|
52
|
-
modelValue: { r: 255, g: 0, b: 0 }
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
export const CustomStringRepresentation = {
|
|
56
|
-
...Primary,
|
|
57
|
-
args: {
|
|
58
|
-
allowAlpha: false,
|
|
59
|
-
customRepresentation: {
|
|
60
|
-
fromHsvaToString: (hsva, includeAlpha) => new Color(
|
|
61
|
-
"hsv",
|
|
62
|
-
[hsva.h, hsva.s, hsva.v],
|
|
63
|
-
includeAlpha ? hsva.a : 1
|
|
64
|
-
// this takes care of the correct hex format
|
|
65
|
-
).toString({ format: "hex" })
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/vue3";
|
|
2
|
-
import LibDarkModeSwitcher from "./LibDarkModeSwitcher.vue.js";
|
|
3
|
-
declare const meta: Meta<typeof LibDarkModeSwitcher>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof LibDarkModeSwitcher>;
|
|
6
|
-
export declare const Primary: Story;
|
|
7
|
-
export declare const WithoutLabel: Story;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
import LibDarkModeSwitcher from "./LibDarkModeSwitcher.vue";
|
|
3
|
-
import * as components from "../index.js";
|
|
4
|
-
const meta = {
|
|
5
|
-
component: LibDarkModeSwitcher,
|
|
6
|
-
title: "Components/DarkModeSwitcher",
|
|
7
|
-
args: {}
|
|
8
|
-
};
|
|
9
|
-
export default meta;
|
|
10
|
-
export const Primary = {
|
|
11
|
-
render: (args) => ({
|
|
12
|
-
components,
|
|
13
|
-
setup: () => {
|
|
14
|
-
const darkMode = ref(false);
|
|
15
|
-
return {
|
|
16
|
-
args,
|
|
17
|
-
darkMode
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
template: `
|
|
21
|
-
Value: {{darkMode}}
|
|
22
|
-
<LibDarkModeSwitcher
|
|
23
|
-
@update:darkMode="darkMode = $event"
|
|
24
|
-
v-bind="{...args}"
|
|
25
|
-
></LibDarkModeSwitcher>
|
|
26
|
-
|
|
27
|
-
`
|
|
28
|
-
})
|
|
29
|
-
};
|
|
30
|
-
export const WithoutLabel = {
|
|
31
|
-
...Primary,
|
|
32
|
-
args: {
|
|
33
|
-
...Primary.args,
|
|
34
|
-
showLabel: false
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/vue3";
|
|
2
|
-
import * as components from "../index.js.js";
|
|
3
|
-
declare const singleMeta: Meta<typeof components.LibDatePicker>;
|
|
4
|
-
export default singleMeta;
|
|
5
|
-
type Story = StoryObj<typeof components.LibDatePicker>;
|
|
6
|
-
export declare const Primary: Story;
|
|
7
|
-
export declare const DateRange: Story;
|
|
8
|
-
export declare const IconTriggerFirst: Story;
|
|
9
|
-
export declare const BottomSlot: Story;
|
|
10
|
-
export declare const DateWithTime: Story;
|
|
11
|
-
export declare const WithDifferentFallbackDate: Story;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { CalendarDate, fromDate, getLocalTimeZone, toTimeZone } from "@internationalized/date";
|
|
2
|
-
import { computed, ref } from "vue";
|
|
3
|
-
import { createNoonUtcDate } from "../../helpers/createNoonUtcDate.js";
|
|
4
|
-
import * as components from "../index.js";
|
|
5
|
-
function html(strings, ...values) {
|
|
6
|
-
return String.raw(strings, ...values);
|
|
7
|
-
}
|
|
8
|
-
const singleMeta = {
|
|
9
|
-
component: components.LibDatePicker,
|
|
10
|
-
title: "Components/DatePicker",
|
|
11
|
-
args: {
|
|
12
|
-
// @ts-expect-error custom prop just for story
|
|
13
|
-
slot: "",
|
|
14
|
-
timeZone: getLocalTimeZone()
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
export default singleMeta;
|
|
18
|
-
function toUTC(m, timeZone) {
|
|
19
|
-
return toTimeZone(fromDate(m, timeZone), "UTC").toAbsoluteString();
|
|
20
|
-
}
|
|
21
|
-
export const Primary = {
|
|
22
|
-
render: (args) => ({
|
|
23
|
-
components: {
|
|
24
|
-
...components
|
|
25
|
-
},
|
|
26
|
-
setup: () => {
|
|
27
|
-
const modelValue = ref(args.modelValue);
|
|
28
|
-
const timeZone = ref(args.timeZone);
|
|
29
|
-
const debugUtcDate = computed(() => {
|
|
30
|
-
const m = modelValue.value;
|
|
31
|
-
const z = timeZone.value;
|
|
32
|
-
return m instanceof Date ? toUTC(m, z) : typeof m === "object" ? `Start: ${m.start ? toUTC(m.start, z) : "undefined"}, End: ${m.end ? toUTC(m.end, z) : "undefined"}` : "undefined";
|
|
33
|
-
});
|
|
34
|
-
return { args, getLocalTimeZone, modelValue, timeZone, debugUtcDate };
|
|
35
|
-
},
|
|
36
|
-
template: `
|
|
37
|
-
<div>Date: {{modelValue ?? "undefined"}}</div>
|
|
38
|
-
<div>Date UTC: {{debugUtcDate}}</div>
|
|
39
|
-
<div>Detected timezone (via @internationalized/date): {{getLocalTimeZone()}}</div>
|
|
40
|
-
<LibTimeZonePicker
|
|
41
|
-
v-model="timeZone"
|
|
42
|
-
label="Override Time Zone"
|
|
43
|
-
wrapper-class="[&_.suggestions]:max-h-[200px] [&_.suggestions]:overflow-y-auto"
|
|
44
|
-
/>
|
|
45
|
-
<div>
|
|
46
|
-
This component has no border, added here to see it's size.
|
|
47
|
-
</div>
|
|
48
|
-
<div class="border border-neutral-500">
|
|
49
|
-
<LibDatePicker v-bind="args" v-model="modelValue" :time-zone="timeZone">
|
|
50
|
-
${args.slot}
|
|
51
|
-
</LibDatePicker>
|
|
52
|
-
</div>
|
|
53
|
-
`
|
|
54
|
-
})
|
|
55
|
-
};
|
|
56
|
-
export const DateRange = {
|
|
57
|
-
...Primary,
|
|
58
|
-
args: {
|
|
59
|
-
modelValue: { start: void 0, end: void 0 }
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
export const IconTriggerFirst = {
|
|
63
|
-
...Primary,
|
|
64
|
-
args: {
|
|
65
|
-
...Primary.args,
|
|
66
|
-
class: "[&_.trigger]:order-first"
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
export const BottomSlot = {
|
|
70
|
-
...Primary,
|
|
71
|
-
args: {
|
|
72
|
-
// @ts-expect-error see above
|
|
73
|
-
slot: html`
|
|
74
|
-
<template #default="slotProps">
|
|
75
|
-
<LibButton>Custom content can be added here.</LibButton>
|
|
76
|
-
<p class="break-all">
|
|
77
|
-
Content has access to the internal temporary/suggested date value and can change it (e.g. set it to today).
|
|
78
|
-
</p>
|
|
79
|
-
<p>Temp value:</p>
|
|
80
|
-
{{ slotProps.tempValue }}
|
|
81
|
-
</template>
|
|
82
|
-
`
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
export const DateWithTime = {
|
|
86
|
-
...Primary,
|
|
87
|
-
args: {
|
|
88
|
-
...Primary.args,
|
|
89
|
-
showTime: true
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
export const WithDifferentFallbackDate = {
|
|
93
|
-
...Primary,
|
|
94
|
-
args: {
|
|
95
|
-
...Primary.args,
|
|
96
|
-
fallbackDate: createNoonUtcDate(new CalendarDate(2e3, 1, 1)).toDate()
|
|
97
|
-
}
|
|
98
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/vue3";
|
|
2
|
-
import LibDebug from "./LibDebug.vue.js";
|
|
3
|
-
declare const meta: Meta<typeof LibDebug>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof LibDebug>;
|
|
6
|
-
export declare const Primary: Story;
|
|
7
|
-
export declare const WithCustomTab: Story;
|
|
8
|
-
export declare const NoValue: Story;
|
|
9
|
-
export declare const StringWithWhitespace: Story;
|