dendelion-ui 0.0.11 → 0.0.13

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 (49) hide show
  1. package/dist/dendelion-ui.cjs.js +2 -2
  2. package/dist/dendelion-ui.es.js +321 -315
  3. package/dist/dendelion-ui.umd.js +2 -2
  4. package/dist/types/components/button/Button.vue.d.ts +2 -12
  5. package/dist/types/components/card/Card.vue.d.ts +2 -11
  6. package/dist/types/components/card/CardBody.vue.d.ts +2 -4
  7. package/dist/types/components/container/Container.vue.d.ts +2 -10
  8. package/dist/types/components/modal/Modal.vue.d.ts +2 -21
  9. package/dist/types/components/modal/interface.d.ts +1 -0
  10. package/dist/types/components/stepper/Step.vue.d.ts +2 -8
  11. package/dist/types/components/stepper/StepList.vue.d.ts +2 -4
  12. package/dist/types/components/stepper/StepPanel.vue.d.ts +2 -9
  13. package/dist/types/components/stepper/StepPanels.vue.d.ts +2 -10
  14. package/dist/types/components/stepper/Stepper.vue.d.ts +2 -11
  15. package/dist/types/components/table/interface.d.ts +10 -2
  16. package/package.json +79 -75
  17. package/src/components/button/Button.vue +32 -29
  18. package/src/components/button/SimpleButton.vue +5 -8
  19. package/src/components/button/index.ts +3 -3
  20. package/src/components/button/interface.ts +13 -13
  21. package/src/components/card/Card.vue +32 -25
  22. package/src/components/card/CardBody.vue +7 -9
  23. package/src/components/card/CardTitle.vue +20 -18
  24. package/src/components/card/index.ts +4 -4
  25. package/src/components/card/interface.ts +9 -9
  26. package/src/components/container/Container.vue +20 -21
  27. package/src/components/container/index.ts +2 -2
  28. package/src/components/container/interface.ts +4 -5
  29. package/src/components/modal/Modal.vue +70 -50
  30. package/src/components/modal/index.ts +2 -2
  31. package/src/components/modal/interface.ts +12 -11
  32. package/src/components/search/SearchBar.vue +62 -53
  33. package/src/components/search/index.ts +1 -1
  34. package/src/components/stepper/Step.vue +37 -35
  35. package/src/components/stepper/StepList.vue +7 -8
  36. package/src/components/stepper/StepPanel.vue +29 -30
  37. package/src/components/stepper/StepPanels.vue +16 -17
  38. package/src/components/stepper/Stepper.vue +35 -33
  39. package/src/components/stepper/index.ts +6 -6
  40. package/src/components/stepper/interface.ts +3 -4
  41. package/src/components/table/Table.vue +135 -104
  42. package/src/components/table/index.ts +2 -2
  43. package/src/components/table/interface.ts +39 -31
  44. package/src/components.ts +7 -7
  45. package/src/index.ts +91 -91
  46. package/src/shims-vue.d.ts +7 -11
  47. package/src/types/color.ts +169 -170
  48. package/src/types/index.ts +2 -2
  49. package/src/types/size.ts +78 -78
@@ -1,13 +1,13 @@
1
- import { Color } from "@/types";
2
-
3
- export type Type = 'button' | 'submit' | 'reset';
4
-
5
- export type ButtonProps = {
6
- type?: Type,
7
- loading?: boolean,
8
- color?: Color,
9
- soft?: boolean,
10
- outline?: boolean,
11
- disabled?: boolean,
12
- click?: () => void,
13
- };
1
+ import { Color } from '@/types';
2
+
3
+ export type Type = 'button' | 'submit' | 'reset';
4
+
5
+ export type ButtonProps = {
6
+ type?: Type;
7
+ loading?: boolean;
8
+ color?: Color;
9
+ soft?: boolean;
10
+ outline?: boolean;
11
+ disabled?: boolean;
12
+ click?: () => void;
13
+ };
@@ -1,25 +1,32 @@
1
- <template>
2
- <div :class="classes" >
3
- <slot></slot>
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import classNames from 'classnames';
9
- import { ref } from 'vue';
10
- import { CardProps } from './interface';
11
- import { Color, BackgroundColorUtils, RoundedSizeUtils } from '@/types';
12
-
13
- const props = withDefaults(defineProps<CardProps>(), {
14
- backgroundColor: Color.Primary,
15
- shadow: false,
16
- fullWidth: false,
17
- });
18
-
19
- const classes = ref(classNames('card',
20
- BackgroundColorUtils.toClassName(props.backgroundColor),
21
- props.shadow ? 'shadow-lg' : '',
22
- props.fullWidth ? 'w-full' : '',
23
- props.rounded && !props.roundedSize ? 'rounded' : props.roundedSize ? RoundedSizeUtils.toClassName(props.roundedSize) : '',
24
- ));
25
- </script>
1
+ <template>
2
+ <div :class="classes">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import classNames from 'classnames';
9
+ import { ref } from 'vue';
10
+ import { CardProps } from './interface';
11
+ import { Color, BackgroundColorUtils, RoundedSizeUtils } from '@/types';
12
+
13
+ const props = withDefaults(defineProps<CardProps>(), {
14
+ backgroundColor: Color.Primary,
15
+ shadow: false,
16
+ fullWidth: false,
17
+ });
18
+
19
+ const classes = ref(
20
+ classNames(
21
+ 'card',
22
+ BackgroundColorUtils.toClassName(props.backgroundColor),
23
+ props.shadow ? 'shadow-lg' : '',
24
+ props.fullWidth ? 'w-full' : '',
25
+ props.rounded && !props.roundedSize
26
+ ? 'rounded'
27
+ : props.roundedSize
28
+ ? RoundedSizeUtils.toClassName(props.roundedSize)
29
+ : '',
30
+ ),
31
+ );
32
+ </script>
@@ -1,9 +1,7 @@
1
- <template>
2
- <div class="card-body">
3
- <slot></slot>
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
-
9
- </script>
1
+ <template>
2
+ <div class="card-body">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts"></script>
@@ -1,18 +1,20 @@
1
- <template>
2
- <component :is="is" class="card-title">
3
- {{ text }}
4
- </component>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import type { Component } from 'vue';
9
-
10
- withDefaults(defineProps<{
11
- is?: string | object | Component,
12
- text: string
13
- }>(), {
14
- is: 'h1',
15
- text: ''
16
- })
17
- </script>
18
-
1
+ <template>
2
+ <component :is="is" class="card-title">
3
+ {{ text }}
4
+ </component>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import type { Component } from 'vue';
9
+
10
+ withDefaults(
11
+ defineProps<{
12
+ is?: string | object | Component;
13
+ text: string;
14
+ }>(),
15
+ {
16
+ is: 'h1',
17
+ text: '',
18
+ },
19
+ );
20
+ </script>
@@ -1,4 +1,4 @@
1
- export { default as Card } from './Card.vue';
2
- export { default as CardBody } from './CardBody.vue';
3
- export { default as CardTitle } from './CardTitle.vue';
4
- export type { CardProps } from './interface';
1
+ export { default as Card } from './Card.vue';
2
+ export { default as CardBody } from './CardBody.vue';
3
+ export { default as CardTitle } from './CardTitle.vue';
4
+ export type { CardProps } from './interface';
@@ -1,9 +1,9 @@
1
- import { Color, Size } from "@/types";
2
-
3
- export type CardProps = {
4
- backgroundColor?: Color,
5
- shadow?: boolean,
6
- fullWidth?: boolean,
7
- rounded?: boolean,
8
- roundedSize?: Size
9
- };
1
+ import { Color, Size } from '@/types';
2
+
3
+ export type CardProps = {
4
+ backgroundColor?: Color;
5
+ shadow?: boolean;
6
+ fullWidth?: boolean;
7
+ rounded?: boolean;
8
+ roundedSize?: Size;
9
+ };
@@ -1,21 +1,20 @@
1
- <template>
2
- <div :class="classes">
3
- <slot></slot>
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { ref } from 'vue';
9
- import { ContainerProps } from './interface';
10
-
11
-
12
- const props = withDefaults(defineProps<ContainerProps>(), {
13
- container: true,
14
- padding: true
15
- });
16
-
17
- const classes = ref([
18
- props.container ? 'container' : '', //To disable the max width in some cases
19
- props.padding ? 'p-6' : ''
20
- ]);
21
- </script>
1
+ <template>
2
+ <div :class="classes">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { ref } from 'vue';
9
+ import { ContainerProps } from './interface';
10
+
11
+ const props = withDefaults(defineProps<ContainerProps>(), {
12
+ container: true,
13
+ padding: true,
14
+ });
15
+
16
+ const classes = ref([
17
+ props.container ? 'container' : '', //To disable the max width in some cases
18
+ props.padding ? 'p-6' : '',
19
+ ]);
20
+ </script>
@@ -1,2 +1,2 @@
1
- export { default as Container } from './Container.vue';
2
- export type { ContainerProps } from './interface';
1
+ export { default as Container } from './Container.vue';
2
+ export type { ContainerProps } from './interface';
@@ -1,5 +1,4 @@
1
-
2
- export type ContainerProps = {
3
- container?: boolean,
4
- padding?: boolean
5
- };
1
+ export type ContainerProps = {
2
+ container?: boolean;
3
+ padding?: boolean;
4
+ };
@@ -1,50 +1,70 @@
1
- <template>
2
- <dialog ref="modal" :class="classes" aria-modal="true" aria-hidden="true" role="dialog"
3
- @close="(e) => emit('close', e)">
4
- <div class="modal-box">
5
- <form v-if="closeButton" method="dialog">
6
- <button :class="closeButtonClasses">✕</button>
7
- </form>
8
- <slot></slot>
9
- </div>
10
- <form method="dialog" class="modal-backdrop">
11
- <button>close</button>
12
- </form>
13
- </dialog>
14
- </template>
15
-
16
- <script setup lang="ts">
17
- import { ref } from 'vue';
18
- import { ModalProps } from './interface';
19
- import classNames from 'classnames';
20
- import { Size, ButtonSizeUtils } from '@/types';
21
-
22
- const modal = ref<HTMLDialogElement | null>(null);
23
-
24
- const emit = defineEmits(['close']);
25
-
26
- const props = withDefaults(defineProps<ModalProps>(), {
27
- closeButton: true,
28
- overflow: false,
29
- closeButtonSize: Size.SM
30
- });
31
-
32
- const classes = ref(classNames('modal', {
33
- 'overflow-visible': props.overflow
34
- }));
35
-
36
- const closeButtonClasses = ref(classNames('btn', ButtonSizeUtils.toClassName(props.closeButtonSize), 'btn-circle', 'btn-ghost', 'absolute', 'right-2', 'top-2'));
37
-
38
- const showModal = () => {
39
- modal.value?.showModal();
40
- }
41
-
42
- const closeModal = () => {
43
- modal.value?.close();
44
- }
45
-
46
- defineExpose({
47
- showModal,
48
- closeModal
49
- })
50
- </script>
1
+ <template>
2
+ <dialog
3
+ ref="modal"
4
+ :class="[classes, $attrs.class]"
5
+ aria-modal="true"
6
+ aria-hidden="true"
7
+ role="dialog"
8
+ @close="(e) => emit('close', e)"
9
+ >
10
+ <div :class="boxClasses">
11
+ <form v-if="closeButton" method="dialog">
12
+ <button :class="closeButtonClasses">✕</button>
13
+ </form>
14
+ <slot></slot>
15
+ </div>
16
+ <form method="dialog" class="modal-backdrop">
17
+ <button>close</button>
18
+ </form>
19
+ </dialog>
20
+ </template>
21
+
22
+ <script setup lang="ts">
23
+ import { ref } from 'vue';
24
+ import { ModalProps } from './interface';
25
+ import classNames from 'classnames';
26
+ import { Size, ButtonSizeUtils } from '@/types';
27
+
28
+ const modal = ref<HTMLDialogElement | null>(null);
29
+
30
+ const emit = defineEmits(['close']);
31
+
32
+ const props = withDefaults(defineProps<ModalProps>(), {
33
+ closeButton: true,
34
+ overflow: false,
35
+ closeButtonSize: Size.SM,
36
+ });
37
+
38
+ const boxClasses = ref(classNames('modal-box', props.extraBoxClasses));
39
+
40
+ const classes = ref(
41
+ classNames('modal', {
42
+ 'overflow-visible': props.overflow,
43
+ }),
44
+ );
45
+
46
+ const closeButtonClasses = ref(
47
+ classNames(
48
+ 'btn',
49
+ ButtonSizeUtils.toClassName(props.closeButtonSize),
50
+ 'btn-circle',
51
+ 'btn-ghost',
52
+ 'absolute',
53
+ 'right-2',
54
+ 'top-2',
55
+ ),
56
+ );
57
+
58
+ const showModal = () => {
59
+ modal.value?.showModal();
60
+ };
61
+
62
+ const closeModal = () => {
63
+ modal.value?.close();
64
+ };
65
+
66
+ defineExpose({
67
+ showModal,
68
+ closeModal,
69
+ });
70
+ </script>
@@ -1,2 +1,2 @@
1
- export {default as Modal} from './Modal.vue';
2
- export type {ModalProps} from './interface';
1
+ export { default as Modal } from './Modal.vue';
2
+ export type { ModalProps } from './interface';
@@ -1,11 +1,12 @@
1
- import { Size } from "@/types";
2
-
3
- export type ModalProps = {
4
- closeButton?: boolean;
5
- overflow?: boolean;
6
- closeButtonSize?: Size;
7
- }
8
-
9
- export interface Modal {
10
- showModal: () => void;
11
- }
1
+ import { Size } from '@/types';
2
+
3
+ export type ModalProps = {
4
+ closeButton?: boolean;
5
+ overflow?: boolean;
6
+ closeButtonSize?: Size;
7
+ extraBoxClasses?: string;
8
+ };
9
+
10
+ export interface Modal {
11
+ showModal: () => void;
12
+ }
@@ -1,53 +1,62 @@
1
- <template>
2
- <div class="hidden w-full max-w-sm lg:flex">
3
- <label class="relative mx-3 w-full">
4
- <svg class="pointer-events-none absolute z-10 my-3.5 ms-4 opacity-60 text-base-content" aria-hidden="true"
5
- width="16" height="16" viewBox="0.48 0.48 23.04 23.04" fill="currentColor">
6
- <path fill="none" d="M0 0h24v24H0z"></path>
7
- <path
8
- d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z">
9
- </path>
10
- </svg>
11
- <div class="w-full max-w-full relative">
12
- <form>
13
- <input ref="searchInput" type="search" placeholder="Zoeken..." :value="props.modelValue" @input="emit('update:modelValue', ($event.target as HTMLInputElement).value)"
14
- class="bg-transparent color-[inherit] border-[2px] border-solid border-transparent focus:border-[2px] focus:border-base-200 focus:outline-none rounded-xl w-full px-3 py-2 ps-10">
15
- </form>
16
- </div>
17
- <div
18
- class="pointer-events-none absolute end-10 top-2.5 gap-1 opacity-50 rtl:flex-row-reverse hidden lg:flex">
19
- <kbd class="kbd kbd-sm">ctrl</kbd>
20
- <kbd class="kbd kbd-sm">K</kbd>
21
- </div>
22
- </label>
23
- </div>
24
- </template>
25
-
26
- <script setup lang="ts">
27
- import { onMounted, onUnmounted, ref } from 'vue';
28
-
29
- const props = defineProps(['modelValue']);
30
-
31
- const searchInput = ref<HTMLInputElement | null>(null);
32
-
33
- const emit = defineEmits(['update:modelValue']);
34
-
35
- const handleKeyPress = (event: KeyboardEvent) => {
36
- if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'k') {
37
- event.preventDefault();
38
- if (searchInput.value) {
39
- searchInput.value.focus();
40
- }
41
- }
42
- };
43
-
44
-
45
- onMounted(() => {
46
- document.addEventListener('keydown', handleKeyPress);
47
- })
48
-
49
- onUnmounted(() => {
50
- document.removeEventListener('keydown', handleKeyPress);
51
- });
52
-
53
- </script>
1
+ <template>
2
+ <div class="hidden w-full max-w-sm lg:flex">
3
+ <label class="relative mx-3 w-full">
4
+ <svg
5
+ class="pointer-events-none absolute z-10 my-3.5 ms-4 text-base-content opacity-60"
6
+ aria-hidden="true"
7
+ width="16"
8
+ height="16"
9
+ viewBox="0.48 0.48 23.04 23.04"
10
+ fill="currentColor"
11
+ >
12
+ <path fill="none" d="M0 0h24v24H0z"></path>
13
+ <path
14
+ d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"
15
+ ></path>
16
+ </svg>
17
+ <div class="relative w-full max-w-full">
18
+ <form>
19
+ <input
20
+ ref="searchInput"
21
+ type="search"
22
+ placeholder="Zoeken..."
23
+ :value="props.modelValue"
24
+ @input="emit('update:modelValue', ($event.target as HTMLInputElement).value)"
25
+ class="color-[inherit] w-full rounded-xl border-[2px] border-solid border-transparent bg-transparent px-3 py-2 ps-10 focus:border-[2px] focus:border-base-200 focus:outline-none"
26
+ />
27
+ </form>
28
+ </div>
29
+ <div class="pointer-events-none absolute end-10 top-2.5 hidden gap-1 opacity-50 lg:flex rtl:flex-row-reverse">
30
+ <kbd class="kbd kbd-sm">ctrl</kbd>
31
+ <kbd class="kbd kbd-sm">K</kbd>
32
+ </div>
33
+ </label>
34
+ </div>
35
+ </template>
36
+
37
+ <script setup lang="ts">
38
+ import { onMounted, onUnmounted, ref } from 'vue';
39
+
40
+ const props = defineProps(['modelValue']);
41
+
42
+ const searchInput = ref<HTMLInputElement | null>(null);
43
+
44
+ const emit = defineEmits(['update:modelValue']);
45
+
46
+ const handleKeyPress = (event: KeyboardEvent) => {
47
+ if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'k') {
48
+ event.preventDefault();
49
+ if (searchInput.value) {
50
+ searchInput.value.focus();
51
+ }
52
+ }
53
+ };
54
+
55
+ onMounted(() => {
56
+ document.addEventListener('keydown', handleKeyPress);
57
+ });
58
+
59
+ onUnmounted(() => {
60
+ document.removeEventListener('keydown', handleKeyPress);
61
+ });
62
+ </script>
@@ -1 +1 @@
1
- export { default as SearchBar } from './SearchBar.vue';
1
+ export { default as SearchBar } from './SearchBar.vue';
@@ -1,35 +1,37 @@
1
- <template>
2
- <li class="step" :class="activeClass">
3
- <slot></slot>
4
- </li>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { inject, onMounted, ref, watch, type Ref } from 'vue';
9
- import { StepperProps } from './interface';
10
-
11
- const props = defineProps<StepperProps>()
12
-
13
- const stepper = inject<{
14
- value: Ref<string>
15
- updateValue: (value: string) => void
16
- }>("stepper");
17
-
18
- const activeClass = ref('');
19
-
20
- watch(() => stepper?.value.value, (value) => {
21
- if (value && props.value) {
22
- activeClass.value = Number(value) >= Number(props.value) ? 'step-primary' : '';
23
- }
24
- })
25
-
26
- onMounted(() => {
27
- if (stepper) {
28
- activeClass.value = stepper.value.value === props.value ? 'step-primary' : '';
29
- if (Number(stepper.value.value) >= Number(props.value)) {
30
- activeClass.value = 'step-primary';
31
- }
32
- }
33
- })
34
-
35
- </script>
1
+ <template>
2
+ <li class="step" :class="activeClass">
3
+ <slot></slot>
4
+ </li>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { inject, onMounted, ref, watch, type Ref } from 'vue';
9
+ import { StepperProps } from './interface';
10
+
11
+ const props = defineProps<StepperProps>();
12
+
13
+ const stepper = inject<{
14
+ value: Ref<string>;
15
+ updateValue: (value: string) => void;
16
+ }>('stepper');
17
+
18
+ const activeClass = ref('');
19
+
20
+ watch(
21
+ () => stepper?.value.value,
22
+ (value) => {
23
+ if (value && props.value) {
24
+ activeClass.value = Number(value) >= Number(props.value) ? 'step-primary' : '';
25
+ }
26
+ },
27
+ );
28
+
29
+ onMounted(() => {
30
+ if (stepper) {
31
+ activeClass.value = stepper.value.value === props.value ? 'step-primary' : '';
32
+ if (Number(stepper.value.value) >= Number(props.value)) {
33
+ activeClass.value = 'step-primary';
34
+ }
35
+ }
36
+ });
37
+ </script>
@@ -1,8 +1,7 @@
1
- <template>
2
- <ul class="steps">
3
- <slot></slot>
4
- </ul>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- </script>
1
+ <template>
2
+ <ul class="steps">
3
+ <slot></slot>
4
+ </ul>
5
+ </template>
6
+
7
+ <script setup lang="ts"></script>