dendelion-ui 0.0.7 → 0.0.10
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/dist/dendelion-ui.cjs.js +2 -2
- package/dist/dendelion-ui.es.js +494 -331
- package/dist/dendelion-ui.umd.js +2 -2
- package/dist/types/components/button/Button.vue.d.ts +17 -14
- package/dist/types/components/button/SimpleButton.vue.d.ts +1 -1
- package/dist/types/components/button/interface.d.ts +3 -2
- package/dist/types/components/card/Card.vue.d.ts +18 -14
- package/dist/types/components/card/CardBody.vue.d.ts +9 -12
- package/dist/types/components/card/interface.d.ts +3 -3
- package/dist/types/components/container/Container.vue.d.ts +15 -12
- package/dist/types/components/modal/Modal.vue.d.ts +28 -16
- package/dist/types/components/modal/interface.d.ts +2 -0
- package/dist/types/components/search/SearchBar.vue.d.ts +1 -3
- package/dist/types/components/stepper/Step.vue.d.ts +13 -12
- package/dist/types/components/stepper/StepList.vue.d.ts +9 -12
- package/dist/types/components/stepper/StepPanel.vue.d.ts +14 -12
- package/dist/types/components/stepper/StepPanels.vue.d.ts +15 -12
- package/dist/types/components/stepper/Stepper.vue.d.ts +16 -12
- package/dist/types/components/table/interface.d.ts +2 -2
- package/dist/types/types/backgroundColor.d.ts +25 -0
- package/dist/types/types/buttonColor.d.ts +25 -0
- package/dist/types/types/buttonSize.d.ts +12 -0
- package/dist/types/types/index.d.ts +6 -2
- package/dist/types/types/roundedSize.d.ts +12 -0
- package/dist/types/types/tableSize.d.ts +12 -0
- package/dist/types/types/{color.d.ts → textColor.d.ts} +3 -3
- package/package.json +1 -1
- package/src/components/button/Button.vue +3 -3
- package/src/components/button/interface.ts +2 -2
- package/src/components/card/Card.vue +4 -4
- package/src/components/card/interface.ts +3 -3
- package/src/components/modal/Modal.vue +12 -4
- package/src/components/modal/interface.ts +2 -0
- package/src/components/table/Table.vue +3 -3
- package/src/components/table/interface.ts +2 -2
- package/src/shims-vue.d.ts +0 -1
- package/src/types/backgroundColor.ts +71 -0
- package/src/types/buttonColor.ts +73 -0
- package/src/types/buttonSize.ts +32 -0
- package/src/types/index.ts +6 -2
- package/src/types/roundedSize.ts +32 -0
- package/src/types/tableSize.ts +32 -0
- package/src/types/textColor.ts +71 -0
- package/dist/types/types/size.d.ts +0 -12
- package/src/types/color.ts +0 -72
- package/src/types/size.ts +0 -32
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare enum
|
|
1
|
+
export declare enum TextColor {
|
|
2
2
|
Primary = 0,
|
|
3
3
|
PrimaryContent = 1,
|
|
4
4
|
Secondary = 2,
|
|
@@ -20,6 +20,6 @@ export declare enum Color {
|
|
|
20
20
|
Error = 18,
|
|
21
21
|
ErrorContent = 19
|
|
22
22
|
}
|
|
23
|
-
export declare class
|
|
24
|
-
static toClassName(color:
|
|
23
|
+
export declare class TextColorUtils {
|
|
24
|
+
static toClassName(color: TextColor): string;
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dendelion-ui",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "Simpel component library using Tailwind css and DaisyUI",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.10",
|
|
6
6
|
"author": "ThatzOkay",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/ThatzOkay/DendelionUI#readme",
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script setup lang="ts">
|
|
9
|
-
import {
|
|
9
|
+
import { ButtonColor, ButtonColorUtils } from '@/types';
|
|
10
10
|
import { ButtonProps } from './interface';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { computed } from 'vue';
|
|
13
13
|
|
|
14
14
|
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
15
15
|
type: 'button',
|
|
16
|
-
color:
|
|
16
|
+
color: ButtonColor.Neutral
|
|
17
17
|
})
|
|
18
18
|
|
|
19
19
|
const classes = computed(() => classNames('btn',
|
|
20
20
|
'group',
|
|
21
|
-
|
|
21
|
+
ButtonColorUtils.toClassName(props.color),
|
|
22
22
|
props.loading ? 'is-loading' : '',
|
|
23
23
|
props.disabled ? 'disabled' : ''
|
|
24
24
|
))
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonColor } from "@/types";
|
|
2
2
|
|
|
3
3
|
export type Type = 'button' | 'submit' | 'reset';
|
|
4
4
|
|
|
5
5
|
export type ButtonProps = {
|
|
6
6
|
type?: Type,
|
|
7
7
|
loading?: boolean,
|
|
8
|
-
color?:
|
|
8
|
+
color?: ButtonColor,
|
|
9
9
|
disabled?: boolean,
|
|
10
10
|
click?: () => void,
|
|
11
11
|
};
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { ref } from 'vue';
|
|
10
10
|
import { CardProps } from './interface';
|
|
11
|
-
import {
|
|
11
|
+
import { BackgroundColor, BackgroundColorUtils, RoundedSizeUtils } from '@/types';
|
|
12
12
|
|
|
13
13
|
const props = withDefaults(defineProps<CardProps>(), {
|
|
14
|
-
backgroundColor:
|
|
14
|
+
backgroundColor: BackgroundColor.Primary,
|
|
15
15
|
shadow: false,
|
|
16
16
|
fullWidth: false,
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const classes = ref(classNames('card',
|
|
20
|
-
|
|
20
|
+
BackgroundColorUtils.toClassName(props.backgroundColor),
|
|
21
21
|
props.shadow ? 'shadow-lg' : '',
|
|
22
22
|
props.fullWidth ? 'w-full' : '',
|
|
23
|
-
props.rounded && !props.roundedSize ? 'rounded' : props.roundedSize ?
|
|
23
|
+
props.rounded && !props.roundedSize ? 'rounded' : props.roundedSize ? RoundedSizeUtils.toClassName(props.roundedSize) : '',
|
|
24
24
|
));
|
|
25
25
|
</script>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BackgroundColor, RoundedSize } from "@/types";
|
|
2
2
|
|
|
3
3
|
export type CardProps = {
|
|
4
|
-
backgroundColor?:
|
|
4
|
+
backgroundColor?: BackgroundColor,
|
|
5
5
|
shadow?: boolean,
|
|
6
6
|
fullWidth?: boolean,
|
|
7
7
|
rounded?: boolean,
|
|
8
|
-
roundedSize?:
|
|
8
|
+
roundedSize?: RoundedSize
|
|
9
9
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<dialog ref="modal" :class="classes" aria-modal="true" aria-hidden="true" role="dialog"
|
|
3
|
-
|
|
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">
|
|
4
5
|
<form v-if="closeButton" method="dialog">
|
|
5
|
-
<button
|
|
6
|
+
<button :class="closeButtonClasses">✕</button>
|
|
6
7
|
</form>
|
|
7
8
|
<slot></slot>
|
|
8
9
|
</div>
|
|
10
|
+
<form method="dialog" class="modal-backdrop">
|
|
11
|
+
<button>close</button>
|
|
12
|
+
</form>
|
|
9
13
|
</dialog>
|
|
10
14
|
</template>
|
|
11
15
|
|
|
@@ -13,6 +17,7 @@
|
|
|
13
17
|
import { ref } from 'vue';
|
|
14
18
|
import { ModalProps } from './interface';
|
|
15
19
|
import classNames from 'classnames';
|
|
20
|
+
import { ButtonSize, ButtonSizeUtils } from '@/types';
|
|
16
21
|
|
|
17
22
|
const modal = ref<HTMLDialogElement | null>(null);
|
|
18
23
|
|
|
@@ -20,13 +25,16 @@ const emit = defineEmits(['close']);
|
|
|
20
25
|
|
|
21
26
|
const props = withDefaults(defineProps<ModalProps>(), {
|
|
22
27
|
closeButton: true,
|
|
23
|
-
overflow: false
|
|
28
|
+
overflow: false,
|
|
29
|
+
closeButtonSize: ButtonSize.SM
|
|
24
30
|
});
|
|
25
31
|
|
|
26
32
|
const classes = ref(classNames('modal', {
|
|
27
33
|
'overflow-visible': props.overflow
|
|
28
34
|
}));
|
|
29
35
|
|
|
36
|
+
const closeButtonClasses = ref(classNames('btn', ButtonSizeUtils.toClassName(props.closeButtonSize), 'btn-circle', 'btn-ghost', 'absolute', 'right-2', 'top-2'));
|
|
37
|
+
|
|
30
38
|
const showModal = () => {
|
|
31
39
|
modal.value?.showModal();
|
|
32
40
|
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
import { onMounted, ref, watch } from 'vue';
|
|
34
34
|
import { TableProps } from './interface';
|
|
35
35
|
import classNames from 'classnames';
|
|
36
|
-
import {
|
|
36
|
+
import { TableSize, TableSizeUtils } from '@/types';
|
|
37
37
|
import createFuzzySearch from '@nozbe/microfuzz'
|
|
38
38
|
|
|
39
39
|
const originalDataSource = ref<T[]>([]);
|
|
@@ -42,13 +42,13 @@ const filteredDataSource = ref<T[]>([]);
|
|
|
42
42
|
const table = ref<HTMLTableElement | null>(null)
|
|
43
43
|
|
|
44
44
|
const props = withDefaults(defineProps<TableProps<T>>(), {
|
|
45
|
-
size:
|
|
45
|
+
size: TableSize.MD,
|
|
46
46
|
zebra: false,
|
|
47
47
|
pinRows: false,
|
|
48
48
|
pinCols: false,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
const tableClasses = ref(classNames('table',
|
|
51
|
+
const tableClasses = ref(classNames('table', TableSizeUtils.toClassName(props.size), {
|
|
52
52
|
'table-zebra': props.zebra,
|
|
53
53
|
'table-pin-rows': props.pinRows,
|
|
54
54
|
'table-pin-cols ': props.pinCols,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TableSize } from "@/types";
|
|
2
2
|
import { Component, VNode } from "vue";
|
|
3
3
|
|
|
4
4
|
export type TableProps<T> = {
|
|
5
5
|
zebra?: boolean;
|
|
6
6
|
pinRows?: boolean;
|
|
7
7
|
pinCols?: boolean;
|
|
8
|
-
size?:
|
|
8
|
+
size?: TableSize
|
|
9
9
|
columns: Column<T>[];
|
|
10
10
|
dataSource: T[];
|
|
11
11
|
ajax?: (params: object) => Promise<object> | string;
|
package/src/shims-vue.d.ts
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export enum BackgroundColor {
|
|
2
|
+
Primary,
|
|
3
|
+
PrimaryContent,
|
|
4
|
+
Secondary,
|
|
5
|
+
SecondaryContent,
|
|
6
|
+
Accent,
|
|
7
|
+
AccentContent,
|
|
8
|
+
Neutral,
|
|
9
|
+
NeutralContent,
|
|
10
|
+
Base100,
|
|
11
|
+
Base200,
|
|
12
|
+
Base300,
|
|
13
|
+
BaseContent,
|
|
14
|
+
Info,
|
|
15
|
+
InfoContent,
|
|
16
|
+
Success,
|
|
17
|
+
SuccessContent,
|
|
18
|
+
Warning,
|
|
19
|
+
WarningContent,
|
|
20
|
+
Error,
|
|
21
|
+
ErrorContent,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class BackgroundColorUtils {
|
|
25
|
+
public static toClassName(color: BackgroundColor): string {
|
|
26
|
+
switch (color) {
|
|
27
|
+
case BackgroundColor.Primary:
|
|
28
|
+
return "bg-primary";
|
|
29
|
+
case BackgroundColor.PrimaryContent:
|
|
30
|
+
return "bg-primary-content";
|
|
31
|
+
case BackgroundColor.Secondary:
|
|
32
|
+
return "bg-secondary";
|
|
33
|
+
case BackgroundColor.SecondaryContent:
|
|
34
|
+
return "bg-secondary-content";
|
|
35
|
+
case BackgroundColor.Accent:
|
|
36
|
+
return "bg-accent";
|
|
37
|
+
case BackgroundColor.AccentContent:
|
|
38
|
+
return "bg-accent-content";
|
|
39
|
+
case BackgroundColor.Neutral:
|
|
40
|
+
return "bg-neutral";
|
|
41
|
+
case BackgroundColor.NeutralContent:
|
|
42
|
+
return "bg-neutral-content";
|
|
43
|
+
case BackgroundColor.Base100:
|
|
44
|
+
return "base-100";
|
|
45
|
+
case BackgroundColor.Base200:
|
|
46
|
+
return "bg-base-200";
|
|
47
|
+
case BackgroundColor.Base300:
|
|
48
|
+
return "bg-base-300";
|
|
49
|
+
case BackgroundColor.BaseContent:
|
|
50
|
+
return "bg-base-content";
|
|
51
|
+
case BackgroundColor.Info:
|
|
52
|
+
return "bg-info";
|
|
53
|
+
case BackgroundColor.InfoContent:
|
|
54
|
+
return "bg-info-content";
|
|
55
|
+
case BackgroundColor.Success:
|
|
56
|
+
return "bg-success";
|
|
57
|
+
case BackgroundColor.SuccessContent:
|
|
58
|
+
return "bg-success-content";
|
|
59
|
+
case BackgroundColor.Warning:
|
|
60
|
+
return "bg-warning";
|
|
61
|
+
case BackgroundColor.WarningContent:
|
|
62
|
+
return "bg-warning-content";
|
|
63
|
+
case BackgroundColor.Error:
|
|
64
|
+
return "bg-error";
|
|
65
|
+
case BackgroundColor.ErrorContent:
|
|
66
|
+
return "bg-error-content";
|
|
67
|
+
default:
|
|
68
|
+
return "bg-base-content";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export enum ButtonColor {
|
|
2
|
+
Primary,
|
|
3
|
+
PrimaryContent,
|
|
4
|
+
Secondary,
|
|
5
|
+
SecondaryContent,
|
|
6
|
+
Accent,
|
|
7
|
+
AccentContent,
|
|
8
|
+
Neutral,
|
|
9
|
+
NeutralContent,
|
|
10
|
+
Base100,
|
|
11
|
+
Base200,
|
|
12
|
+
Base300,
|
|
13
|
+
BaseContent,
|
|
14
|
+
Info,
|
|
15
|
+
InfoContent,
|
|
16
|
+
Success,
|
|
17
|
+
SuccessContent,
|
|
18
|
+
Warning,
|
|
19
|
+
WarningContent,
|
|
20
|
+
Error,
|
|
21
|
+
ErrorContent,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class ButtonColorUtils {
|
|
25
|
+
public static toClassName(color: ButtonColor): string {
|
|
26
|
+
switch (color) {
|
|
27
|
+
case ButtonColor.Primary:
|
|
28
|
+
return "btn-primary";
|
|
29
|
+
case ButtonColor.PrimaryContent:
|
|
30
|
+
return "btn-primary-content";
|
|
31
|
+
case ButtonColor.Secondary:
|
|
32
|
+
return "btn-secondary";
|
|
33
|
+
case ButtonColor.SecondaryContent:
|
|
34
|
+
return "btn-secondary-content";
|
|
35
|
+
case ButtonColor.Accent:
|
|
36
|
+
return "btn-accent";
|
|
37
|
+
case ButtonColor.AccentContent:
|
|
38
|
+
return "btn-accent-content";
|
|
39
|
+
case ButtonColor.Neutral:
|
|
40
|
+
return "btn-neutral";
|
|
41
|
+
case ButtonColor.NeutralContent:
|
|
42
|
+
return "btn-neutral-content";
|
|
43
|
+
case ButtonColor.Base100:
|
|
44
|
+
return "base-100";
|
|
45
|
+
case ButtonColor.Base200:
|
|
46
|
+
return "btn-base-200";
|
|
47
|
+
case ButtonColor.Base300:
|
|
48
|
+
return "btn-base-300";
|
|
49
|
+
case ButtonColor.BaseContent:
|
|
50
|
+
return "btn-base-content";
|
|
51
|
+
case ButtonColor.Info:
|
|
52
|
+
return "btn-info";
|
|
53
|
+
case ButtonColor.InfoContent:
|
|
54
|
+
return "btn-info-content";
|
|
55
|
+
case ButtonColor.Success:
|
|
56
|
+
return "btn-success";
|
|
57
|
+
case ButtonColor.SuccessContent:
|
|
58
|
+
return "btn-success-content";
|
|
59
|
+
case ButtonColor.Warning:
|
|
60
|
+
return "btn-warning";
|
|
61
|
+
case ButtonColor.WarningContent:
|
|
62
|
+
return "btn-warning-content";
|
|
63
|
+
case ButtonColor.Error:
|
|
64
|
+
return "btn-error";
|
|
65
|
+
case ButtonColor.ErrorContent:
|
|
66
|
+
return "btn-error-content";
|
|
67
|
+
default:
|
|
68
|
+
return "btn-base-content";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export enum ButtonSize {
|
|
2
|
+
XS,
|
|
3
|
+
SM,
|
|
4
|
+
MD,
|
|
5
|
+
LG,
|
|
6
|
+
XL,
|
|
7
|
+
TWOXL,
|
|
8
|
+
THREEXL
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class ButtonSizeUtils {
|
|
12
|
+
public static toClassName(size: ButtonSize): string {
|
|
13
|
+
switch (size) {
|
|
14
|
+
case ButtonSize.XS:
|
|
15
|
+
return 'btn-xs'
|
|
16
|
+
case ButtonSize.SM:
|
|
17
|
+
return 'btn-sm'
|
|
18
|
+
case ButtonSize.MD:
|
|
19
|
+
return 'btn-md'
|
|
20
|
+
case ButtonSize.LG:
|
|
21
|
+
return 'btn-lg'
|
|
22
|
+
case ButtonSize.XL:
|
|
23
|
+
return 'btn-xl'
|
|
24
|
+
case ButtonSize.TWOXL:
|
|
25
|
+
return 'btn-2xl'
|
|
26
|
+
case ButtonSize.THREEXL:
|
|
27
|
+
return 'btn-3xl'
|
|
28
|
+
default:
|
|
29
|
+
return 'btn-md'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export enum RoundedSize {
|
|
2
|
+
XS,
|
|
3
|
+
SM,
|
|
4
|
+
MD,
|
|
5
|
+
LG,
|
|
6
|
+
XL,
|
|
7
|
+
TWOXL,
|
|
8
|
+
THREEXL
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class RoundedSizeUtils {
|
|
12
|
+
public static toClassName(size: RoundedSize): string {
|
|
13
|
+
switch (size) {
|
|
14
|
+
case RoundedSize.XS:
|
|
15
|
+
return 'rounded-xs'
|
|
16
|
+
case RoundedSize.SM:
|
|
17
|
+
return 'rounded-sm'
|
|
18
|
+
case RoundedSize.MD:
|
|
19
|
+
return 'rounded-md'
|
|
20
|
+
case RoundedSize.LG:
|
|
21
|
+
return 'rounded-lg'
|
|
22
|
+
case RoundedSize.XL:
|
|
23
|
+
return 'rounded-xl'
|
|
24
|
+
case RoundedSize.TWOXL:
|
|
25
|
+
return 'rounded-2xl'
|
|
26
|
+
case RoundedSize.THREEXL:
|
|
27
|
+
return 'rounded-3xl'
|
|
28
|
+
default:
|
|
29
|
+
return 'rounded-md'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export enum TableSize {
|
|
2
|
+
XS,
|
|
3
|
+
SM,
|
|
4
|
+
MD,
|
|
5
|
+
LG,
|
|
6
|
+
XL,
|
|
7
|
+
TWOXL,
|
|
8
|
+
THREEXL
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class TableSizeUtils {
|
|
12
|
+
public static toClassName(size: TableSize): string {
|
|
13
|
+
switch (size) {
|
|
14
|
+
case TableSize.XS:
|
|
15
|
+
return 'table-xs'
|
|
16
|
+
case TableSize.SM:
|
|
17
|
+
return 'table-sm'
|
|
18
|
+
case TableSize.MD:
|
|
19
|
+
return 'table-md'
|
|
20
|
+
case TableSize.LG:
|
|
21
|
+
return 'table-lg'
|
|
22
|
+
case TableSize.XL:
|
|
23
|
+
return 'table-xl'
|
|
24
|
+
case TableSize.TWOXL:
|
|
25
|
+
return 'table-2xl'
|
|
26
|
+
case TableSize.THREEXL:
|
|
27
|
+
return 'table-3xl'
|
|
28
|
+
default:
|
|
29
|
+
return 'table-md'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export enum TextColor {
|
|
2
|
+
Primary,
|
|
3
|
+
PrimaryContent,
|
|
4
|
+
Secondary,
|
|
5
|
+
SecondaryContent,
|
|
6
|
+
Accent,
|
|
7
|
+
AccentContent,
|
|
8
|
+
Neutral,
|
|
9
|
+
NeutralContent,
|
|
10
|
+
Base100,
|
|
11
|
+
Base200,
|
|
12
|
+
Base300,
|
|
13
|
+
BaseContent,
|
|
14
|
+
Info,
|
|
15
|
+
InfoContent,
|
|
16
|
+
Success,
|
|
17
|
+
SuccessContent,
|
|
18
|
+
Warning,
|
|
19
|
+
WarningContent,
|
|
20
|
+
Error,
|
|
21
|
+
ErrorContent,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class TextColorUtils {
|
|
25
|
+
public static toClassName(color: TextColor): string {
|
|
26
|
+
switch (color) {
|
|
27
|
+
case TextColor.Primary:
|
|
28
|
+
return "text-primary";
|
|
29
|
+
case TextColor.PrimaryContent:
|
|
30
|
+
return "text-primary-content";
|
|
31
|
+
case TextColor.Secondary:
|
|
32
|
+
return "text-secondary";
|
|
33
|
+
case TextColor.SecondaryContent:
|
|
34
|
+
return "text-secondary-content";
|
|
35
|
+
case TextColor.Accent:
|
|
36
|
+
return "text-accent";
|
|
37
|
+
case TextColor.AccentContent:
|
|
38
|
+
return "text-accent-content";
|
|
39
|
+
case TextColor.Neutral:
|
|
40
|
+
return "text-neutral";
|
|
41
|
+
case TextColor.NeutralContent:
|
|
42
|
+
return "text-neutral-content";
|
|
43
|
+
case TextColor.Base100:
|
|
44
|
+
return "base-100";
|
|
45
|
+
case TextColor.Base200:
|
|
46
|
+
return "text-base-200";
|
|
47
|
+
case TextColor.Base300:
|
|
48
|
+
return "text-base-300";
|
|
49
|
+
case TextColor.BaseContent:
|
|
50
|
+
return "text-base-content";
|
|
51
|
+
case TextColor.Info:
|
|
52
|
+
return "text-info";
|
|
53
|
+
case TextColor.InfoContent:
|
|
54
|
+
return "text-info-content";
|
|
55
|
+
case TextColor.Success:
|
|
56
|
+
return "text-success";
|
|
57
|
+
case TextColor.SuccessContent:
|
|
58
|
+
return "text-success-content";
|
|
59
|
+
case TextColor.Warning:
|
|
60
|
+
return "text-warning";
|
|
61
|
+
case TextColor.WarningContent:
|
|
62
|
+
return "text-warning-content";
|
|
63
|
+
case TextColor.Error:
|
|
64
|
+
return "text-error";
|
|
65
|
+
case TextColor.ErrorContent:
|
|
66
|
+
return "text-error-content";
|
|
67
|
+
default:
|
|
68
|
+
return "text-base-content";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
package/src/types/color.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export enum Color {
|
|
2
|
-
Primary,
|
|
3
|
-
PrimaryContent,
|
|
4
|
-
Secondary,
|
|
5
|
-
SecondaryContent,
|
|
6
|
-
Accent,
|
|
7
|
-
AccentContent,
|
|
8
|
-
Neutral,
|
|
9
|
-
NeutralContent,
|
|
10
|
-
Base100,
|
|
11
|
-
Base200,
|
|
12
|
-
Base300,
|
|
13
|
-
BaseContent,
|
|
14
|
-
Info,
|
|
15
|
-
InfoContent,
|
|
16
|
-
Success,
|
|
17
|
-
SuccessContent,
|
|
18
|
-
Warning,
|
|
19
|
-
WarningContent,
|
|
20
|
-
Error,
|
|
21
|
-
ErrorContent,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export class ColorUtils {
|
|
25
|
-
public static toClassName(color: Color): string {
|
|
26
|
-
switch (color) {
|
|
27
|
-
case Color.Primary:
|
|
28
|
-
return 'primary'
|
|
29
|
-
case Color.PrimaryContent:
|
|
30
|
-
return 'primary-content'
|
|
31
|
-
case Color.Secondary:
|
|
32
|
-
return 'secondary'
|
|
33
|
-
case Color.SecondaryContent:
|
|
34
|
-
return 'secondary-content'
|
|
35
|
-
case Color.Accent:
|
|
36
|
-
return 'accent'
|
|
37
|
-
case Color.AccentContent:
|
|
38
|
-
return 'accent-content'
|
|
39
|
-
case Color.Neutral:
|
|
40
|
-
return 'neutral'
|
|
41
|
-
case Color.NeutralContent:
|
|
42
|
-
return 'neutral-content'
|
|
43
|
-
case Color.Base100:
|
|
44
|
-
return 'base-100'
|
|
45
|
-
case Color.Base200:
|
|
46
|
-
return 'base-200'
|
|
47
|
-
case Color.Base300:
|
|
48
|
-
return 'base-300'
|
|
49
|
-
case Color.BaseContent:
|
|
50
|
-
return 'base-content'
|
|
51
|
-
case Color.Info:
|
|
52
|
-
return 'info'
|
|
53
|
-
case Color.InfoContent:
|
|
54
|
-
return 'info-content'
|
|
55
|
-
case Color.Success:
|
|
56
|
-
return 'success'
|
|
57
|
-
case Color.SuccessContent:
|
|
58
|
-
return 'success-content'
|
|
59
|
-
case Color.Warning:
|
|
60
|
-
return 'warning'
|
|
61
|
-
case Color.WarningContent:
|
|
62
|
-
return 'warning-content'
|
|
63
|
-
case Color.Error:
|
|
64
|
-
return 'error'
|
|
65
|
-
case Color.ErrorContent:
|
|
66
|
-
return 'error-content'
|
|
67
|
-
default:
|
|
68
|
-
return 'primary'
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|