independer-design-system 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +100 -0
  2. package/dist/module.d.mts +6 -0
  3. package/dist/module.json +12 -0
  4. package/dist/module.mjs +35 -0
  5. package/dist/runtime/assets/images/checkbox.svg +3 -0
  6. package/dist/runtime/assets/style.css +1 -0
  7. package/dist/runtime/components/Button.d.vue.ts +40 -0
  8. package/dist/runtime/components/Button.vue +110 -0
  9. package/dist/runtime/components/Button.vue.d.ts +40 -0
  10. package/dist/runtime/components/ButtonToggle.d.vue.ts +17 -0
  11. package/dist/runtime/components/ButtonToggle.vue +40 -0
  12. package/dist/runtime/components/ButtonToggle.vue.d.ts +17 -0
  13. package/dist/runtime/components/Dialog.d.vue.ts +52 -0
  14. package/dist/runtime/components/Dialog.vue +116 -0
  15. package/dist/runtime/components/Dialog.vue.d.ts +52 -0
  16. package/dist/runtime/components/Form/Checkbox.d.vue.ts +46 -0
  17. package/dist/runtime/components/Form/Checkbox.vue +93 -0
  18. package/dist/runtime/components/Form/Checkbox.vue.d.ts +46 -0
  19. package/dist/runtime/components/Form/Input.d.vue.ts +65 -0
  20. package/dist/runtime/components/Form/Input.vue +131 -0
  21. package/dist/runtime/components/Form/Input.vue.d.ts +65 -0
  22. package/dist/runtime/components/Form/Label.d.vue.ts +51 -0
  23. package/dist/runtime/components/Form/Label.vue +44 -0
  24. package/dist/runtime/components/Form/Label.vue.d.ts +51 -0
  25. package/dist/runtime/components/Form/Radio.d.vue.ts +50 -0
  26. package/dist/runtime/components/Form/Radio.vue +112 -0
  27. package/dist/runtime/components/Form/Radio.vue.d.ts +50 -0
  28. package/dist/runtime/components/Form/Row.d.vue.ts +31 -0
  29. package/dist/runtime/components/Form/Row.vue +37 -0
  30. package/dist/runtime/components/Form/Row.vue.d.ts +31 -0
  31. package/dist/runtime/components/Form/Select.d.vue.ts +45 -0
  32. package/dist/runtime/components/Form/Select.vue +90 -0
  33. package/dist/runtime/components/Form/Select.vue.d.ts +45 -0
  34. package/dist/runtime/components/Form/Tabs.d.vue.ts +38 -0
  35. package/dist/runtime/components/Form/Tabs.vue +75 -0
  36. package/dist/runtime/components/Form/Tabs.vue.d.ts +38 -0
  37. package/dist/runtime/components/Form/Textarea.d.vue.ts +83 -0
  38. package/dist/runtime/components/Form/Textarea.vue +120 -0
  39. package/dist/runtime/components/Form/Textarea.vue.d.ts +83 -0
  40. package/dist/runtime/components/Modal.d.vue.ts +59 -0
  41. package/dist/runtime/components/Modal.vue +158 -0
  42. package/dist/runtime/components/Modal.vue.d.ts +59 -0
  43. package/dist/runtime/components/Pill.d.vue.ts +24 -0
  44. package/dist/runtime/components/Pill.vue +37 -0
  45. package/dist/runtime/components/Pill.vue.d.ts +24 -0
  46. package/dist/runtime/plugin.d.ts +2 -0
  47. package/dist/runtime/plugin.js +4 -0
  48. package/dist/runtime/public/assets/logo-full.svg +19 -0
  49. package/dist/runtime/server/tsconfig.json +3 -0
  50. package/dist/types.d.mts +7 -0
  51. package/package.json +62 -0
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # Independer Design System
2
+
3
+ [![npm version][npm-version-src]][npm-version-href]
4
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
+ [![License][license-src]][license-href]
6
+ [![Nuxt][nuxt-src]][nuxt-href]
7
+
8
+ Independer Design System for Nuxt 4.
9
+
10
+ - [✨  Release Notes](/CHANGELOG.md)
11
+
12
+ ## Features
13
+
14
+ - ⛰  Create interactive prototypes with the included components
15
+ - 🧑‍💻  Built for Nuxt 4
16
+ - 🧩  Auto-registers components with an `Ind` prefix
17
+
18
+ ## Quick Setup
19
+
20
+ Install the module to your Nuxt application with one command:
21
+
22
+ ```bash
23
+ npx nuxt module add independer-design-system
24
+ ```
25
+
26
+ That's it! You can now use Independer Design System in your Nuxt app ✨
27
+
28
+ ```vue
29
+ <template>
30
+ <IndFormInput v-model="name" name="name" label="Naam" />
31
+ <IndButton label="Versturen" tone="filled-yellow" />
32
+ </template>
33
+
34
+ <script setup>
35
+ const name = ref('')
36
+ </script>
37
+ ```
38
+
39
+ By default the module registers:
40
+
41
+ `IndButton`, `IndButtonToggle`, `IndDialog`, `IndModal`, `IndPill`, `IndFormCheckbox`, `IndFormInput`, `IndFormLabel`, `IndFormRadio`, `IndFormRow`, `IndFormSelect`, `IndFormTabs`, and `IndFormTextarea`.
42
+
43
+ Use the module in `nuxt.config.ts`:
44
+
45
+ ```ts
46
+ export default defineNuxtConfig({
47
+ modules: ['independer-design-system'],
48
+ })
49
+ ```
50
+
51
+ Run the local playground to see the base form components in context:
52
+
53
+ ```bash
54
+ npm run dev
55
+ ```
56
+
57
+ ## Contribution
58
+
59
+ <details>
60
+ <summary>Local development</summary>
61
+
62
+ ```bash
63
+ # Install dependencies
64
+ npm install
65
+
66
+ # Generate type stubs
67
+ npm run dev:prepare
68
+
69
+ # Develop with the playground
70
+ npm run dev
71
+
72
+ # Build the playground
73
+ npm run dev:build
74
+
75
+ # Run ESLint
76
+ npm run lint
77
+
78
+ # Run Vitest
79
+ npm run test
80
+ npm run test:watch
81
+
82
+ # Release new version
83
+ npm run release
84
+ ```
85
+
86
+ </details>
87
+
88
+
89
+ <!-- Badges -->
90
+ [npm-version-src]: https://img.shields.io/npm/v/independer-design-system/latest.svg?style=flat&colorA=020420&colorB=00DC82
91
+ [npm-version-href]: https://npmjs.com/package/independer-design-system
92
+
93
+ [npm-downloads-src]: https://img.shields.io/npm/dm/independer-design-system.svg?style=flat&colorA=020420&colorB=00DC82
94
+ [npm-downloads-href]: https://npmjs.com/package/independer-design-system
95
+
96
+ [license-src]: https://img.shields.io/npm/l/independer-design-system.svg?style=flat&colorA=020420&colorB=00DC82
97
+ [license-href]: https://npmjs.com/package/independer-design-system
98
+
99
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt
100
+ [nuxt-href]: https://nuxt.com
@@ -0,0 +1,6 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ type ModuleOptions = Record<string, never>;
4
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
5
+
6
+ export { _default as default };
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "independer-design-system",
3
+ "configKey": "independerDesignSystem",
4
+ "compatibility": {
5
+ "nuxt": ">=4.2.0"
6
+ },
7
+ "version": "1.2.0",
8
+ "builder": {
9
+ "@nuxt/module-builder": "1.0.2",
10
+ "unbuild": "3.6.1"
11
+ }
12
+ }
@@ -0,0 +1,35 @@
1
+ import { createResolver, defineNuxtModule, addComponentsDir } from '@nuxt/kit';
2
+
3
+ const resolver = createResolver(import.meta.url);
4
+ const module$1 = defineNuxtModule({
5
+ meta: {
6
+ name: "independer-design-system",
7
+ configKey: "independerDesignSystem",
8
+ compatibility: {
9
+ nuxt: ">=4.2.0"
10
+ }
11
+ },
12
+ moduleDependencies: {
13
+ "@nuxt/icon": {
14
+ version: ">=2.2.1"
15
+ }
16
+ },
17
+ setup(options, nuxt) {
18
+ addComponentsDir({
19
+ path: resolver.resolve("./runtime/components"),
20
+ prefix: "Ind",
21
+ pathPrefix: true
22
+ });
23
+ nuxt.options.css.push(resolver.resolve("./runtime/assets/style.css"));
24
+ nuxt.hook("vite:extend", async ({ config }) => {
25
+ const plugin = await import('@tailwindcss/vite').then((r) => r.default);
26
+ config.plugins ||= [];
27
+ config.plugins.push(plugin());
28
+ });
29
+ if (nuxt.options.builder !== "@nuxt/vite-builder") {
30
+ nuxt.options.postcss.plugins["@tailwindcss/postcss"] = {};
31
+ }
32
+ }
33
+ });
34
+
35
+ export { module$1 as default };
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="11" viewBox="0 0 14 11" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M5.38302 10.5H5.38462H5.39211V10.5L5.39831 10.5C5.57029 10.4978 5.73998 10.4602 5.89673 10.3894L5.69096 9.93371L5.89674 10.3894C6.05293 10.3189 6.19294 10.2169 6.30802 10.0899C6.30843 10.0895 6.30884 10.089 6.30925 10.0886L13.1366 2.62701C13.253 2.5102 13.345 2.37145 13.4074 2.21875C13.4717 2.0613 13.5032 1.89236 13.4998 1.72231C13.4963 1.55225 13.4582 1.38471 13.3876 1.22996C13.317 1.07521 13.2155 0.936558 13.0894 0.822486C12.9633 0.708414 12.8152 0.621332 12.6542 0.566559C12.4932 0.511785 12.3227 0.490468 12.1532 0.503907C11.9837 0.517345 11.8187 0.565259 11.6684 0.644725C11.5233 0.721381 11.3949 0.825844 11.2903 0.952113L5.37232 7.4189L2.65942 4.5314C2.65941 4.53139 2.6594 4.53138 2.6594 4.53137C2.4327 4.29006 2.11944 4.14869 1.78857 4.13818C1.45769 4.12767 1.13608 4.24888 0.894509 4.47531C0.652919 4.70175 0.511171 5.01491 0.500632 5.34593C0.490093 5.67694 0.611637 5.99848 0.838355 6.23983L0.838662 6.24016L4.47209 10.1011C4.47251 10.1015 4.47292 10.102 4.47333 10.1024C4.5895 10.2272 4.72999 10.3268 4.88613 10.3952L5.08669 9.93714L4.88614 10.3952C5.04284 10.4638 5.21196 10.4994 5.38302 10.5Z" fill="#00BC9A" stroke="#00BC9A"/>
3
+ </svg>
@@ -0,0 +1 @@
1
+ @import url("https://use.typekit.net/uxr2esn.css");@import "tailwindcss";@theme{--container-mobile:320px;--container-tablet:768px;--container-desktop:1136px;--container-desktop-lg:1432px;--breakpoint-tablet:768px;--breakpoint-desktop:1136px;--breakpoint-desktop-lg:1432px;--font-sans:"proxima-nova",system-ui;--font-serif:"roboto-slab",system-ui;--text-xs:.75rem;--text-xs--line-height:1rem;--text-sm:.875rem;--text-sm--line-height:1.25rem;--text-base:1rem;--text-base--line-height:1.5rem;--text-lg:1.125rem;--text-lg--line-height:1.75rem;--text-xl:1.25rem;--text-xl--line-height:1.75rem;--text-2xl:1.5rem;--text-2xl--line-height:2rem;--text-3xl:2rem;--text-3xl--line-height:2.5rem;--text-4xl:2.5rem;--text-4xl--line-height:3rem;--text-5xl:3rem;--text-5xl--line-height:3.5rem;--color-interface:#f2f1fd;--color-transparent:transparent;--color-current:currentColor;--color-purple-100:#f2f1fd;--color-purple-200:#d9d5f8;--color-purple-300:#c1b9f2;--color-purple-400:#aa9ceb;--color-purple-500:#9480e4;--color-purple-600:#8063dc;--color-purple-700:#6e42d2;--color-purple-800:#5532a7;--color-purple-900:#3f247e;--color-purple-1000:#291556;--color-purple-darkest:#291556;--color-purple-dark:#3f247e;--color-purple:#6e42d2;--color-purple-light:#d9d5f8;--color-purple-lighter:#f2f1fd;--color-peach-100:#ffefe7;--color-peach-200:#ffcfb7;--color-peach-300:#f4b18e;--color-peach-400:#d99876;--color-peach-500:#b4856b;--color-peach-600:#976f59;--color-peach-700:#7a5a47;--color-peach-800:#604536;--color-peach-900:#473227;--color-peach-1000:#461000;--color-peach-darkest:#461000;--color-peach-dark:#d99876;--color-peach:#f4b18e;--color-peach-light:#ffcfb7;--color-peach-lighter:#ffefe7;--color-grey-100:#f2f2f2;--color-grey-200:#d7d9da;--color-grey-300:#b3b7c1;--color-grey-400:#a4a7a9;--color-grey-500:#908e84;--color-grey-600:#74787a;--color-grey-700:#626066;--color-grey-800:#4c4b4f;--color-grey-900:#37363a;--color-grey-1000:#232225;--color-grey-darkest:#232225;--color-grey-dark:#74787a;--color-grey:#a4a7a9;--color-grey-light:#d7d9da;--color-grey-lighter:#f2f2f2;--color-blue-100:#e5f4ff;--color-blue-200:#b4dffd;--color-blue-300:#7dc8fa;--color-blue-400:#33b0f5;--color-blue-500:#0097e0;--color-blue-600:#007dc5;--color-blue-700:#0063aa;--color-blue-800:#004b90;--color-blue-900:#003478;--color-blue-1000:#001c60;--color-blue-darkest:#001c60;--color-blue-dark:#007dc5;--color-blue:#33b0f5;--color-blue-light:#e5f4ff;--color-green-100:#e4f6f0;--color-green-200:#abe4d2;--color-green-300:#6ed2b7;--color-green-400:#00bc9a;--color-green-500:#00a281;--color-green-600:#00886a;--color-green-700:#006e52;--color-green-800:#00563c;--color-green-900:#004028;--color-green-1000:#002914;--color-green-darkest:#002914;--color-green-dark:#006e52;--color-green:#00bc9a;--color-green-light:#abe4d2;--color-yellow-100:#fff2bd;--color-yellow-200:#fcd610;--color-yellow-300:#e3bd00;--color-yellow-400:#c8a300;--color-yellow-500:#b08a00;--color-yellow-600:#987200;--color-yellow-700:#7f5a00;--color-yellow-800:#684300;--color-yellow-900:#542e00;--color-yellow-1000:#3e1800;--color-yellow-darkest:#542e00;--color-yellow-dark:#e3bd00;--color-yellow:#fcd610;--color-yellow-light:#fff2bd;--color-orange-100:#fff1e6;--color-orange-200:#ffd1a9;--color-orange-300:#ffae66;--color-orange-400:#f68c12;--color-orange-500:#db7400;--color-orange-600:#c05b00;--color-orange-700:#a54300;--color-orange-800:#8b2800;--color-orange-900:#720a00;--color-orange-1000:#4f0000;--color-orange-darkest:#4f0000;--color-orange-dark:#f68c12;--color-orange:#f68c12;--color-orange-light:#ffd1a9;--color-orange-lighter:#fff1e6;--color-red-100:#ffeff0;--color-red-200:#ffcdd2;--color-red-300:#ffa8b3;--color-red-400:#ff7f94;--color-red-500:#fb4f74;--color-red-600:#e02f5e;--color-red-700:#b7254b;--color-red-800:#901b3a;--color-red-900:#6d1129;--color-red-1000:#490819;--color-red-darkest:#490819;--color-red-dark:#b7254b;--color-red:#e02f5e;--color-red-light:#ffcdd2;--animate-pulse-fast:pulse 1.5s cubic-bezier(0.4,0,0.6,1) infinite;--default-transition-duration:200ms;--default-transition-timing-function:cubic-bezier(0,0,0.2,1);--shadow-default:0 0 1px 0 rgba(0,0,0,.1),0 0 3px 0 rgba(0,0,0,.1),0 0 16px 4px rgba(0,0,0,.05)}.iconify{@apply block w-6 h-6 flex-shrink-0}
@@ -0,0 +1,40 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
4
+ type __VLS_WithSlots<T, S> = T & (new () => {
5
+ $slots: S;
6
+ });
7
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ tone: StringConstructor;
9
+ name: StringConstructor;
10
+ label: StringConstructor;
11
+ path: StringConstructor;
12
+ icon: StringConstructor;
13
+ loading: BooleanConstructor;
14
+ disabled: BooleanConstructor;
15
+ modal: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
19
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
+ tone: StringConstructor;
21
+ name: StringConstructor;
22
+ label: StringConstructor;
23
+ path: StringConstructor;
24
+ icon: StringConstructor;
25
+ loading: BooleanConstructor;
26
+ disabled: BooleanConstructor;
27
+ modal: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ }>> & Readonly<{}>, {
32
+ loading: boolean;
33
+ disabled: boolean;
34
+ modal: boolean;
35
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
36
+ type __VLS_Slots = {
37
+ default?: ((props: {}) => any) | undefined;
38
+ } & {
39
+ default?: ((props: {}) => any) | undefined;
40
+ };
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <NuxtLink
3
+ v-if="path && !disabled"
4
+ :to="path"
5
+ class="inline-flex justify-center rounded-lg border font-semibold outline-none ring-purple transition-all ease-out focus-visible:border-purple focus-visible:ring-1"
6
+ :class="[classes, loadingClasses, iconOnly]"
7
+ >
8
+ <slot>
9
+ <Icon
10
+ v-if="icon"
11
+ :name="icon"
12
+ class="h-6 w-6 shrink-0 cursor-pointer"
13
+ :class="{ 'mr-2': label }"
14
+ />
15
+
16
+ <span :class="{ invisible: loading }">
17
+ {{ label }}
18
+ </span>
19
+
20
+ <Transition
21
+ name="fade"
22
+ mode="in-out"
23
+ >
24
+ <Icon
25
+ v-if="loading"
26
+ name="eva:loader-outline"
27
+ class="ml-2 h-6 w-6 shrink-0 animate-spin"
28
+ />
29
+ </Transition>
30
+ </slot>
31
+ </NuxtLink>
32
+
33
+ <button
34
+ v-else
35
+ class="inline-flex cursor-pointer justify-center rounded-lg border font-semibold outline-none ring-purple transition-all ease-out focus-visible:border-purple focus-visible:ring-1"
36
+ :class="[classes, loadingClasses, iconOnly]"
37
+ :disabled="disabled"
38
+ >
39
+ <slot>
40
+ <Icon
41
+ v-if="icon"
42
+ :name="icon"
43
+ class="h-6 w-6 shrink-0 cursor-pointer"
44
+ :class="{ 'mr-2': label }"
45
+ />
46
+
47
+ <span :class="{ invisible: loading }">
48
+ {{ label }}
49
+ </span>
50
+
51
+ <Transition
52
+ name="fade"
53
+ mode="in-out"
54
+ >
55
+ <div
56
+ v-if="loading"
57
+ class="absolute"
58
+ >
59
+ <Icon
60
+ name="eva:loader-outline"
61
+ class="h-6 w-6 shrink-0 animate-spin"
62
+ />
63
+ </div>
64
+ </Transition>
65
+ </slot>
66
+ </button>
67
+ </template>
68
+
69
+ <script setup>
70
+ import { computed } from "vue";
71
+ defineOptions({
72
+ name: "IndButton"
73
+ });
74
+ const props = defineProps({
75
+ tone: String,
76
+ name: String,
77
+ label: String,
78
+ path: String,
79
+ icon: String,
80
+ loading: Boolean,
81
+ disabled: Boolean,
82
+ modal: {
83
+ type: Boolean,
84
+ default: false
85
+ }
86
+ });
87
+ const classes = computed(() => {
88
+ return {
89
+ "filled-yellow": "bg-yellow border-yellow text-yellow-1000 hover:bg-yellow-dark hover:border-yellow-dark active:bg-yellow-300 active:border-yellow-300 disabled:bg-grey-200 disabled:text-grey-500 disabled:border-grey-200 disabled:cursor-not-allowed",
90
+ "filled-purple": "bg-purple border-purple text-white hover:bg-purple-dark hover:border-purple-dark active:bg-purple-800 active:border-purple-800 disabled:bg-grey-200 disabled:text-grey-500 disabled:border-grey-200 disabled:cursor-not-allowed",
91
+ "wire-purple": "border-purple text-purple hover:text-purple hover:bg-purple-200 active:bg-purple/40 disabled:bg-transparent disabled:border-grey disabled:text-grey disabled:cursor-not-allowed",
92
+ "naked-purple": "border-transparent text-purple hover:bg-purple-200 active:bg-purple/40",
93
+ "wire-white": "bg-transparent border-white text-white hover:bg-black/10 active:bg-black/30 ring-white focus-visible:border-white disabled:bg-transparent disabled:border-grey disabled:text-grey disabled:cursor-not-allowed",
94
+ "naked-white": "bg-transparent border-white text-white hover:bg-black/10 active:bg-black/30 ring-white focus-visible:border-white",
95
+ "link": "justify-start px-0 bg-transparent border-transparent text-purple hover:text-purple-dark active:text-purple-900"
96
+ }[props.tone];
97
+ });
98
+ const iconOnly = computed(() => {
99
+ if (props.label === void 0 && props.icon !== void 0) {
100
+ return "p-[0.6875rem]";
101
+ }
102
+ return "px-3 py-[0.6875rem]";
103
+ });
104
+ const loadingClasses = computed(() => {
105
+ if (props.loading) {
106
+ return "border-grey bg-grey text-grey-dark cursor-not-allowed";
107
+ }
108
+ return "";
109
+ });
110
+ </script>
@@ -0,0 +1,40 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
4
+ type __VLS_WithSlots<T, S> = T & (new () => {
5
+ $slots: S;
6
+ });
7
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ tone: StringConstructor;
9
+ name: StringConstructor;
10
+ label: StringConstructor;
11
+ path: StringConstructor;
12
+ icon: StringConstructor;
13
+ loading: BooleanConstructor;
14
+ disabled: BooleanConstructor;
15
+ modal: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
19
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
+ tone: StringConstructor;
21
+ name: StringConstructor;
22
+ label: StringConstructor;
23
+ path: StringConstructor;
24
+ icon: StringConstructor;
25
+ loading: BooleanConstructor;
26
+ disabled: BooleanConstructor;
27
+ modal: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ }>> & Readonly<{}>, {
32
+ loading: boolean;
33
+ disabled: boolean;
34
+ modal: boolean;
35
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
36
+ type __VLS_Slots = {
37
+ default?: ((props: {}) => any) | undefined;
38
+ } & {
39
+ default?: ((props: {}) => any) | undefined;
40
+ };
@@ -0,0 +1,17 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ state: BooleanConstructor;
5
+ iconPrimary: StringConstructor;
6
+ labelPrimary: StringConstructor;
7
+ iconSecondary: StringConstructor;
8
+ labelSecondary: StringConstructor;
9
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
+ state: BooleanConstructor;
11
+ iconPrimary: StringConstructor;
12
+ labelPrimary: StringConstructor;
13
+ iconSecondary: StringConstructor;
14
+ labelSecondary: StringConstructor;
15
+ }>> & Readonly<{}>, {
16
+ state: boolean;
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <button class="text-purple font-semibold transition-all cursor-pointer hover:text-purple-dark">
3
+ <Transition
4
+ name="fade"
5
+ mode="out-in"
6
+ >
7
+ <div
8
+ v-if="state === false"
9
+ class="flex gap-2"
10
+ >
11
+ <Icon
12
+ v-if="iconPrimary"
13
+ :name="iconPrimary"
14
+ />
15
+ {{ labelPrimary }}
16
+ </div>
17
+
18
+ <div
19
+ v-else
20
+ class="flex gap-2"
21
+ >
22
+ <Icon
23
+ v-if="iconSecondary"
24
+ :name="iconSecondary"
25
+ />
26
+ {{ labelSecondary }}
27
+ </div>
28
+ </Transition>
29
+ </button>
30
+ </template>
31
+
32
+ <script setup>
33
+ defineProps({
34
+ state: Boolean,
35
+ iconPrimary: String,
36
+ labelPrimary: String,
37
+ iconSecondary: String,
38
+ labelSecondary: String
39
+ });
40
+ </script>
@@ -0,0 +1,17 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ state: BooleanConstructor;
5
+ iconPrimary: StringConstructor;
6
+ labelPrimary: StringConstructor;
7
+ iconSecondary: StringConstructor;
8
+ labelSecondary: StringConstructor;
9
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
+ state: BooleanConstructor;
11
+ iconPrimary: StringConstructor;
12
+ labelPrimary: StringConstructor;
13
+ iconSecondary: StringConstructor;
14
+ labelSecondary: StringConstructor;
15
+ }>> & Readonly<{}>, {
16
+ state: boolean;
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,52 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
4
+ type __VLS_WithSlots<T, S> = T & (new () => {
5
+ $slots: S;
6
+ });
7
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ title: StringConstructor;
9
+ show: {
10
+ type: BooleanConstructor;
11
+ default: boolean;
12
+ };
13
+ size: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ validator: (value: unknown) => boolean;
17
+ };
18
+ classes: StringConstructor;
19
+ backgroundColorClass: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ close: (...args: any[]) => void;
25
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ title: StringConstructor;
27
+ show: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ size: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ validator: (value: unknown) => boolean;
35
+ };
36
+ classes: StringConstructor;
37
+ backgroundColorClass: {
38
+ type: StringConstructor;
39
+ default: string;
40
+ };
41
+ }>> & Readonly<{
42
+ onClose?: ((...args: any[]) => any) | undefined;
43
+ }>, {
44
+ show: boolean;
45
+ size: string;
46
+ backgroundColorClass: string;
47
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
48
+ type __VLS_Slots = {
49
+ default?: ((props: {}) => any) | undefined;
50
+ } & {
51
+ footer?: ((props: {}) => any) | undefined;
52
+ };
@@ -0,0 +1,116 @@
1
+ <template>
2
+ <Teleport to="body">
3
+ <Transition name="dialog-fade">
4
+ <div
5
+ v-if="isOpen"
6
+ class="dialog fixed bottom-4 z-100 grid grid-rows-[auto_1fr_auto] rounded-xl shadow-default desktop:bottom-auto desktop:left-1/2 desktop:top-1/2 desktop:-translate-x-1/2 desktop:-translate-y-1/2"
7
+ :class="[classes, backgroundColorClass, sizeClasses]"
8
+ role="dialog"
9
+ aria-modal="true"
10
+ :aria-label="title"
11
+ >
12
+ <header class="dialog__header grid items-center rounded-t-xl border-b border-purple-light bg-white px-2 py-2">
13
+ <span class="col-start-2 text-center font-semibold tablet:text-lg">{{ title }}</span>
14
+
15
+ <button
16
+ type="button"
17
+ class="col-start-3 ml-auto rounded-lg p-3 text-purple transition-all hover:bg-purple-200 hover:ring-purple/20 active:bg-purple/40 active:ring-purple/40"
18
+ aria-label="Sluiten"
19
+ @click="close"
20
+ >
21
+ <Icon
22
+ name="eva:close-outline"
23
+ class="cursor-pointer"
24
+ />
25
+ </button>
26
+ </header>
27
+
28
+ <div class="dialog__content relative overflow-y-scroll">
29
+ <slot />
30
+ </div>
31
+
32
+ <div
33
+ v-if="$slots.footer"
34
+ class="flex flex-col justify-end gap-2 border-t border-purple-light px-4 py-4 tablet:flex-row tablet:gap-4 tablet:px-6"
35
+ >
36
+ <slot name="footer" />
37
+ </div>
38
+ </div>
39
+ </Transition>
40
+
41
+ <Transition name="backdrop-fade">
42
+ <div
43
+ v-if="isOpen"
44
+ class="fixed left-0 top-0 z-90 h-full w-full bg-black/30 backdrop-blur-sm"
45
+ @click="close"
46
+ />
47
+ </Transition>
48
+ </Teleport>
49
+ </template>
50
+
51
+ <script setup>
52
+ import { computed, onMounted, onUnmounted, watch } from "vue";
53
+ defineOptions({
54
+ name: "IndDialog"
55
+ });
56
+ const emit = defineEmits(["close"]);
57
+ const props = defineProps({
58
+ title: String,
59
+ show: {
60
+ type: Boolean,
61
+ default: false
62
+ },
63
+ size: {
64
+ type: String,
65
+ default: "medium",
66
+ validator: (value) => ["small", "medium"].includes(value)
67
+ },
68
+ classes: String,
69
+ backgroundColorClass: {
70
+ type: String,
71
+ default: "bg-white"
72
+ }
73
+ });
74
+ const isOpen = computed(() => props.show);
75
+ let previousBodyOverflow;
76
+ const setBodyLocked = (locked) => {
77
+ if (!import.meta.client) {
78
+ return;
79
+ }
80
+ if (locked) {
81
+ previousBodyOverflow = document.body.style.overflow;
82
+ document.body.style.overflow = "hidden";
83
+ return;
84
+ }
85
+ if (previousBodyOverflow !== void 0) {
86
+ document.body.style.overflow = previousBodyOverflow;
87
+ previousBodyOverflow = void 0;
88
+ }
89
+ };
90
+ watch(isOpen, setBodyLocked, { immediate: true });
91
+ onMounted(() => {
92
+ window.addEventListener("keydown", handleEscape);
93
+ });
94
+ onUnmounted(() => {
95
+ window.removeEventListener("keydown", handleEscape);
96
+ setBodyLocked(false);
97
+ });
98
+ const close = () => {
99
+ emit("close");
100
+ };
101
+ function handleEscape(event) {
102
+ if (event.key === "Escape" && isOpen.value) {
103
+ close();
104
+ }
105
+ }
106
+ const sizeClasses = computed(() => {
107
+ return {
108
+ small: "small",
109
+ medium: "medium"
110
+ }[props.size];
111
+ });
112
+ </script>
113
+
114
+ <style>
115
+ @reference "../assets/style.css";.dialog.small{left:1rem;max-height:calc(100dvh - 2rem);width:calc(100% - 32px)}@media screen and (min-width:1136px){.dialog.small{@apply left-1/2 w-[424px]}}.dialog.medium{left:1rem;max-height:calc(100dvh - 2rem);width:calc(100% - 32px)}@media screen and (min-width:1136px){.dialog.medium{@apply left-1/2 desktop:w-[780px]}}.dialog__header{grid-template-columns:3rem minmax(0,1fr) 3rem}.dialog__content{max-height:calc(100dvh - 6rem)}@media screen and (min-width:1136px){.dialog__content{max-height:48rem}}.dialog-fade-enter-active,.dialog-fade-leave-active{@apply transition-all ease-out duration-300 transform-gpu}.dialog-fade-enter-from,.dialog-fade-leave-to{@apply translate-y-full opacity-0 desktop:-translate-y-1/2 desktop:scale-90}.backdrop-fade-enter-active,.backdrop-fade-leave-active{@apply transition-all ease-out duration-400 transform-gpu}.backdrop-fade-enter-from,.backdrop-fade-leave-to{@apply opacity-0}
116
+ </style>
@@ -0,0 +1,52 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
4
+ type __VLS_WithSlots<T, S> = T & (new () => {
5
+ $slots: S;
6
+ });
7
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ title: StringConstructor;
9
+ show: {
10
+ type: BooleanConstructor;
11
+ default: boolean;
12
+ };
13
+ size: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ validator: (value: unknown) => boolean;
17
+ };
18
+ classes: StringConstructor;
19
+ backgroundColorClass: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ close: (...args: any[]) => void;
25
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ title: StringConstructor;
27
+ show: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ size: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ validator: (value: unknown) => boolean;
35
+ };
36
+ classes: StringConstructor;
37
+ backgroundColorClass: {
38
+ type: StringConstructor;
39
+ default: string;
40
+ };
41
+ }>> & Readonly<{
42
+ onClose?: ((...args: any[]) => any) | undefined;
43
+ }>, {
44
+ show: boolean;
45
+ size: string;
46
+ backgroundColorClass: string;
47
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
48
+ type __VLS_Slots = {
49
+ default?: ((props: {}) => any) | undefined;
50
+ } & {
51
+ footer?: ((props: {}) => any) | undefined;
52
+ };