@bobbykim/manguito-theme 0.15.0 → 0.16.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.
@@ -0,0 +1,63 @@
1
+ import type { ColorPalette } from '../../';
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
+ bgColor?: ColorPalette | undefined;
4
+ drawerBtnColor?: ColorPalette | undefined;
5
+ drawerBtnBorder?: boolean | undefined;
6
+ headerWidth?: number | undefined;
7
+ }>, {
8
+ bgColor: string;
9
+ drawerBtnColor: string;
10
+ drawerBtnBorder: boolean;
11
+ headerWidth: number;
12
+ }>, {
13
+ headerClose: () => void;
14
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ "toggle-drawer": (event: Event, open: boolean) => void;
16
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
17
+ bgColor?: ColorPalette | undefined;
18
+ drawerBtnColor?: ColorPalette | undefined;
19
+ drawerBtnBorder?: boolean | undefined;
20
+ headerWidth?: number | undefined;
21
+ }>, {
22
+ bgColor: string;
23
+ drawerBtnColor: string;
24
+ drawerBtnBorder: boolean;
25
+ headerWidth: number;
26
+ }>>> & {
27
+ "onToggle-drawer"?: ((event: Event, open: boolean) => any) | undefined;
28
+ }, {
29
+ bgColor: ColorPalette;
30
+ drawerBtnColor: ColorPalette;
31
+ drawerBtnBorder: boolean;
32
+ headerWidth: number;
33
+ }, {}>, Readonly<{
34
+ default: any;
35
+ content: any;
36
+ 'content-bottom': any;
37
+ 'mobile-content'(props: {
38
+ headerClose: () => void;
39
+ }): any;
40
+ }>>;
41
+ export default _default;
42
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
43
+ type __VLS_TypePropsToRuntimeProps<T> = {
44
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
45
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
46
+ } : {
47
+ type: import('vue').PropType<T[K]>;
48
+ required: true;
49
+ };
50
+ };
51
+ type __VLS_WithDefaults<P, D> = {
52
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
53
+ default: D[K];
54
+ }> : P[K];
55
+ };
56
+ type __VLS_Prettify<T> = {
57
+ [K in keyof T]: T[K];
58
+ } & {};
59
+ type __VLS_WithTemplateSlots<T, S> = T & {
60
+ new (): {
61
+ $slots: S;
62
+ };
63
+ };
@@ -0,0 +1,121 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ import type { ColorPalette } from '../../'
4
+ import generateClass from '../../'
5
+
6
+ const props = withDefaults(
7
+ defineProps<{
8
+ color?: ColorPalette
9
+ displayBorder?: boolean
10
+ toggle: boolean
11
+ navColor: ColorPalette
12
+ }>(),
13
+ {
14
+ color: 'dark-2',
15
+ displayBorder: true,
16
+ }
17
+ )
18
+
19
+ const emit = defineEmits(['hbg-click'])
20
+
21
+ const handleButtonToggle = (e: Event): void => {
22
+ emit('hbg-click', e)
23
+ }
24
+
25
+ const hamburgetButtonState = computed({
26
+ get() {
27
+ return props.toggle
28
+ },
29
+ set(value) {
30
+ return value
31
+ },
32
+ })
33
+
34
+ const getBorderClass = (
35
+ bColor: ColorPalette,
36
+ border: boolean,
37
+ nColor: ColorPalette
38
+ ): string => {
39
+ /**
40
+ * @bColor - color
41
+ * @border - displayBorder
42
+ * @nColor - navColor
43
+ */
44
+
45
+ const classArray: string[] = [
46
+ generateClass('RINGCOLOR', bColor),
47
+ generateClass('OFFSETRING', nColor),
48
+ ]
49
+
50
+ if (border) {
51
+ classArray.push(generateClass('BORDER', bColor))
52
+ classArray.push('border')
53
+ }
54
+ return classArray.join(' ')
55
+ }
56
+
57
+ const getHamburgerButtonClass = (color: ColorPalette): string => {
58
+ /**
59
+ * @color - color
60
+ */
61
+ const classArray: string[] = [
62
+ generateClass('BGCOLOR', color),
63
+ generateClass('BEFOREBG', color),
64
+ generateClass('AFTERBG', color),
65
+ ]
66
+
67
+ return classArray.join(' ')
68
+ }
69
+ </script>
70
+
71
+ <template>
72
+ <button
73
+ class="p-3xs rounded-md aspect-square outline-none focus:ring-4 ring-offset-2 transition-all duration-300 ease-linear hover:opacity-70 focus:opacity-70 hamburger__button"
74
+ :class="getBorderClass(color, displayBorder, navColor)"
75
+ @click="handleButtonToggle"
76
+ >
77
+ <input
78
+ type="checkbox"
79
+ v-model="hamburgetButtonState"
80
+ class="hidden hamburger__checkbox"
81
+ />
82
+ <div
83
+ class="relative h-[3px] w-sm hamburger__icon before:w-sm after:w-sm before:h-[3px] after:h-[3px] transition-all duration-300 ease-linear"
84
+ :class="getHamburgerButtonClass(color)"
85
+ ></div>
86
+ </button>
87
+ </template>
88
+
89
+ <style lang="scss" scoped>
90
+ .hamburger__icon {
91
+ &::before,
92
+ &::after {
93
+ position: absolute;
94
+ left: 0;
95
+ transition: all 0.3s linear;
96
+ }
97
+ &::before {
98
+ top: -0.5rem;
99
+ }
100
+ &::after {
101
+ top: 0.5rem;
102
+ }
103
+ }
104
+ .hamburger__button {
105
+ &:focus .hamburger__icon,
106
+ &:hover .hamburger__icon {
107
+ scale: 1.05;
108
+ }
109
+ }
110
+ .hamburger__checkbox:checked + .hamburger__icon {
111
+ background-color: transparent;
112
+ }
113
+ .hamburger__checkbox:checked + .hamburger__icon::before {
114
+ top: 0;
115
+ transform: rotate(135deg);
116
+ }
117
+ .hamburger__checkbox:checked + .hamburger__icon::after {
118
+ top: 0;
119
+ transform: rotate(-135deg);
120
+ }
121
+ </style>
@@ -0,0 +1,43 @@
1
+ import type { ColorPalette } from '../../';
2
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
+ color?: ColorPalette | undefined;
4
+ displayBorder?: boolean | undefined;
5
+ toggle: boolean;
6
+ navColor: ColorPalette;
7
+ }>, {
8
+ color: string;
9
+ displayBorder: boolean;
10
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "hbg-click": (...args: any[]) => void;
12
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
13
+ color?: ColorPalette | undefined;
14
+ displayBorder?: boolean | undefined;
15
+ toggle: boolean;
16
+ navColor: ColorPalette;
17
+ }>, {
18
+ color: string;
19
+ displayBorder: boolean;
20
+ }>>> & {
21
+ "onHbg-click"?: ((...args: any[]) => any) | undefined;
22
+ }, {
23
+ color: ColorPalette;
24
+ displayBorder: boolean;
25
+ }, {}>;
26
+ export default _default;
27
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
28
+ type __VLS_TypePropsToRuntimeProps<T> = {
29
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
30
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
31
+ } : {
32
+ type: import('vue').PropType<T[K]>;
33
+ required: true;
34
+ };
35
+ };
36
+ type __VLS_WithDefaults<P, D> = {
37
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
38
+ default: D[K];
39
+ }> : P[K];
40
+ };
41
+ type __VLS_Prettify<T> = {
42
+ [K in keyof T]: T[K];
43
+ } & {};
@@ -0,0 +1 @@
1
+ export type HeaderStickyOptionType = 'none' | 'tablet' | 'pc' | 'all';
@@ -0,0 +1 @@
1
+ export type HeaderStickyOptionType = 'none' | 'tablet' | 'pc' | 'all'
@@ -1,15 +1,15 @@
1
1
  <script setup lang="ts">
2
2
  import {
3
- ref,
4
- computed,
5
- watch,
6
3
  Transition,
7
- onMounted,
4
+ computed,
8
5
  onBeforeUnmount,
6
+ onMounted,
7
+ ref,
8
+ watch,
9
9
  } from 'vue'
10
- import generateClass, { vClickOutside } from '../../index.js'
11
- import type { ColorPalette, VerticalAlignment } from '../../index.js'
12
- import { observeVisibleAttr } from '../composables/index.js'
10
+ import type { ColorPalette, VerticalAlignment } from '../../'
11
+ import generateClass, { vClickOutside } from '../../'
12
+ import { observeVisibleAttr } from '../composables'
13
13
 
14
14
  const props = withDefaults(
15
15
  defineProps<{
@@ -35,7 +35,15 @@ const props = withDefaults(
35
35
  }
36
36
  )
37
37
 
38
- const emit = defineEmits(['open', 'close'])
38
+ const slots = defineSlots<{
39
+ header(props: { close: () => void; status: boolean }): any
40
+ body(props: { close: () => void; status: boolean }): any
41
+ footer(props: { close: () => void; status: boolean }): any
42
+ }>()
43
+ const emit = defineEmits<{
44
+ (e: 'open', visible: boolean): void
45
+ (e: 'close', visible: boolean): void
46
+ }>()
39
47
  const modalRef = ref<HTMLElement | undefined>()
40
48
  const toggle = ref<boolean>(props.visible)
41
49
  const toggleComplete = ref<boolean>(false)
@@ -52,10 +60,10 @@ const closeModal = (): void => {
52
60
  }
53
61
  }
54
62
  const emitOpenEvent = () => {
55
- emit('open', { visible: true })
63
+ emit('open', true)
56
64
  }
57
65
  const emitCloseEvent = () => {
58
- emit('close', { visible: false })
66
+ emit('close', false)
59
67
  }
60
68
  const handlePlacementVar = computed(() => {
61
69
  let placementVariable: number
@@ -172,7 +180,7 @@ onBeforeUnmount(() => {
172
180
  </slot>
173
181
  </div>
174
182
  <slot name="body" :close="closeModal" :status="toggle" />
175
- <div class="sticky bottom-0">
183
+ <div class="sticky bottom-0" v-if="slots['footer']">
176
184
  <slot name="footer" :close="closeModal" :status="toggle" />
177
185
  </div>
178
186
  </div>
@@ -1,4 +1,4 @@
1
- import type { ColorPalette, VerticalAlignment } from '../../index.js';
1
+ import type { ColorPalette, VerticalAlignment } from '../../';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
3
  title?: string | undefined;
4
4
  titleColor?: ColorPalette | undefined;
@@ -23,8 +23,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
23
23
  close: () => void;
24
24
  open: () => void;
25
25
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
- open: (...args: any[]) => void;
27
- close: (...args: any[]) => void;
26
+ open: (visible: boolean) => void;
27
+ close: (visible: boolean) => void;
28
28
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
29
29
  title?: string | undefined;
30
30
  titleColor?: ColorPalette | undefined;
@@ -45,31 +45,31 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
45
45
  backdropColor: string;
46
46
  placement: string;
47
47
  }>>> & {
48
- onOpen?: ((...args: any[]) => any) | undefined;
49
- onClose?: ((...args: any[]) => any) | undefined;
48
+ onOpen?: ((visible: boolean) => any) | undefined;
49
+ onClose?: ((visible: boolean) => any) | undefined;
50
50
  }, {
51
51
  visible: boolean;
52
52
  className: string;
53
+ color: ColorPalette;
53
54
  titleColor: ColorPalette;
54
55
  noBackdrop: boolean;
55
56
  noHeader: boolean;
56
- color: ColorPalette;
57
57
  backdropColor: ColorPalette;
58
58
  placement: VerticalAlignment;
59
- }, {}>, {
60
- header?(_: {
59
+ }, {}>, Readonly<{
60
+ header(props: {
61
61
  close: () => void;
62
- status: true;
62
+ status: boolean;
63
63
  }): any;
64
- body?(_: {
64
+ body(props: {
65
65
  close: () => void;
66
- status: true;
66
+ status: boolean;
67
67
  }): any;
68
- footer?(_: {
68
+ footer(props: {
69
69
  close: () => void;
70
- status: true;
70
+ status: boolean;
71
71
  }): any;
72
- }>;
72
+ }>>;
73
73
  export default _default;
74
74
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
75
75
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,15 +1,15 @@
1
1
  <script setup lang="ts">
2
2
  import {
3
- ref,
4
- computed,
5
- watch,
6
3
  Transition,
7
- onMounted,
4
+ computed,
8
5
  onBeforeUnmount,
6
+ onMounted,
7
+ ref,
8
+ watch,
9
9
  } from 'vue'
10
- import generateClass, { vClickOutside } from '../../index.js'
11
- import type { ColorPalette, DirectionX } from '../../index.js'
12
- import { observeVisibleAttr } from '../composables/index.js'
10
+ import type { ColorPalette, DirectionX } from '../../'
11
+ import generateClass, { vClickOutside } from '../../'
12
+ import { observeVisibleAttr } from '../composables'
13
13
 
14
14
  const props = withDefaults(
15
15
  defineProps<{
@@ -37,7 +37,15 @@ const props = withDefaults(
37
37
  }
38
38
  )
39
39
 
40
- const emit = defineEmits(['open', 'close'])
40
+ const slots = defineSlots<{
41
+ header(props: { close: () => void; status: boolean }): any
42
+ body(props: { close: () => void; status: boolean }): any
43
+ footer(props: { close: () => void; status: boolean }): any
44
+ }>()
45
+ const emit = defineEmits<{
46
+ (e: 'open', visible: boolean): void
47
+ (e: 'close', visible: boolean): void
48
+ }>()
41
49
  const toggle = ref<boolean>(props.visible)
42
50
  const toggleComplete = ref<boolean>(false)
43
51
  const sidebarRef = ref<HTMLElement | undefined>()
@@ -50,16 +58,16 @@ const toggleSidebar = (): void => {
50
58
  const openSidebar = (): void => {
51
59
  toggle.value = true
52
60
  }
53
- const closeSidebar = (e: Event): void => {
61
+ const closeSidebar = (): void => {
54
62
  if (toggleComplete.value === true) {
55
63
  toggle.value = false
56
64
  }
57
65
  }
58
66
  const emitOpenEvent = () => {
59
- emit('open', { visible: true })
67
+ emit('open', true)
60
68
  }
61
69
  const emitCloseEvent = () => {
62
- emit('close', { visible: false })
70
+ emit('close', false)
63
71
  }
64
72
  const handleStyleVariables = computed(() => {
65
73
  return {
@@ -185,7 +193,7 @@ onBeforeUnmount(() => {
185
193
  <slot name="body" :close="closeSidebar" :status="toggle" />
186
194
  </div>
187
195
 
188
- <div class="sticky bottom-0" ref="footerRef">
196
+ <div class="sticky bottom-0" ref="footerRef" v-if="slots['footer']">
189
197
  <slot name="footer" :close="closeSidebar" :status="toggle" />
190
198
  </div>
191
199
  </div>
@@ -1,4 +1,4 @@
1
- import type { ColorPalette, DirectionX } from '../../index.js';
1
+ import type { ColorPalette, DirectionX } from '../../';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
3
  title?: string | undefined;
4
4
  titleColor?: ColorPalette | undefined;
@@ -23,10 +23,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
23
23
  }>, {
24
24
  toggle: () => void;
25
25
  open: () => void;
26
- close: (e: Event) => void;
26
+ close: () => void;
27
27
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
- open: (...args: any[]) => void;
29
- close: (...args: any[]) => void;
28
+ open: (visible: boolean) => void;
29
+ close: (visible: boolean) => void;
30
30
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
31
31
  title?: string | undefined;
32
32
  titleColor?: ColorPalette | undefined;
@@ -49,32 +49,32 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
49
49
  placement: string;
50
50
  width: number;
51
51
  }>>> & {
52
- onOpen?: ((...args: any[]) => any) | undefined;
53
- onClose?: ((...args: any[]) => any) | undefined;
52
+ onOpen?: ((visible: boolean) => any) | undefined;
53
+ onClose?: ((visible: boolean) => any) | undefined;
54
54
  }, {
55
55
  visible: boolean;
56
56
  className: string;
57
+ color: ColorPalette;
57
58
  titleColor: ColorPalette;
58
59
  noBackdrop: boolean;
59
60
  noHeader: boolean;
60
- color: ColorPalette;
61
61
  backdropColor: ColorPalette;
62
62
  placement: DirectionX;
63
63
  width: string | number;
64
- }, {}>, {
65
- header?(_: {
66
- close: (e: Event) => void;
67
- status: true;
64
+ }, {}>, Readonly<{
65
+ header(props: {
66
+ close: () => void;
67
+ status: boolean;
68
68
  }): any;
69
- body?(_: {
70
- close: (e: Event) => void;
71
- status: true;
69
+ body(props: {
70
+ close: () => void;
71
+ status: boolean;
72
72
  }): any;
73
- footer?(_: {
74
- close: (e: Event) => void;
75
- status: true;
73
+ footer(props: {
74
+ close: () => void;
75
+ status: boolean;
76
76
  }): any;
77
- }>;
77
+ }>>;
78
78
  export default _default;
79
79
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
80
80
  type __VLS_TypePropsToRuntimeProps<T> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobbykim/manguito-theme",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "main theme file for manguito components library. Other MCL components will need to import this file to run.",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -8,7 +8,7 @@
8
8
  "access": "public"
9
9
  },
10
10
  "scripts": {
11
- "build": "vue-tsc --project tsconfig.vue.json && tsc"
11
+ "build": "vue-tsc --project tsconfig.vue.json && tsc --project tsconfig.ts.json"
12
12
  },
13
13
  "dependencies": {
14
14
  "@vueuse/core": "^10.8.0",
@@ -30,5 +30,5 @@
30
30
  "url": "https://github.com/bobbykim89/manguito-component-library.git"
31
31
  },
32
32
  "license": "MIT",
33
- "gitHead": "69d6ee1c4f91a74b226cb46182845201141805fa"
33
+ "gitHead": "5b81953e5108fd166c0b89ebc6a24e6de9499635"
34
34
  }
package/theme/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import MCLTheme from './theme.js';
2
- import type { ColorPalette, HeadingSize, BodyText, FontWeight, Range, OpacityRange, SpacingLevel, Alignment } from './theme.types.js';
2
+ import type { Alignment, BodyText, ColorPalette, FontWeight, HeadingSize, OpacityRange, Range, SpacingLevel } from './theme.types.js';
3
3
  /**
4
4
  * @TailwindCSS - Good practice is to let all of used classes to be in full instead of generated dynamically using methods such as string literal.
5
5
  * @Interface - ClassType to define the case, and Input type to generate tailwind clssname.
6
6
  * @Export GenerateMCLClass - extends MCLTheme class
7
7
  */
8
- export declare const colorType: readonly ["BGCOLOR", "BEFOREBG", "AFTERBG", "HVBGCOLOR", "FCBGCOLOR", "ACTIVEBG", "TEXTCOLOR", "HVTEXTCOLOR", "DISABLEDTEXTCOLOR", "SVGFILL", "RINGCOLOR", "FOCUSRING", "ACTIVERING", "OFFSETRING", "DUMMYCOLOR", "BTNCOLOR", "LISTCOLOR", "BORDER", "BORDERX", "BORDERY", "BORDERT", "BORDERB", "BORDERL", "BORDERR"];
8
+ export declare const colorType: readonly ["BGCOLOR", "BEFOREBG", "AFTERBG", "HVBGCOLOR", "FCBGCOLOR", "ACTIVEBG", "TEXTCOLOR", "HVTEXTCOLOR", "FCTEXTCOLOR", "DISABLEDTEXTCOLOR", "SVGFILL", "RINGCOLOR", "FOCUSRING", "ACTIVERING", "OFFSETRING", "DUMMYCOLOR", "BTNCOLOR", "LISTCOLOR", "BORDER", "BORDERX", "BORDERY", "BORDERT", "BORDERB", "BORDERL", "BORDERR"];
9
9
  export declare const textType: readonly ["H1", "H2", "H3", "H4", "BODYTEXT", "FONTWEIGHT", "TEXTALIGN"];
10
10
  export declare const borderWidthType: readonly ["BORDERW", "BORDERXW", "BORDERYW", "BORDERTW", "BORDERBW", "BORDERLW", "BORDERRW"];
11
11
  export declare const scaleType: readonly ["BGOPACITY", "OPACITY"];
12
12
  export declare const spacingType: readonly ["MARGIN", "MARGINX", "MARGINY", "MARGINT", "MARGINB", "MARGINL", "MARGINR", "PADDING", "PADDINGX", "PADDINGY", "PADDINGT", "PADDINGB", "PADDINGL", "PADDINGR", "GAP"];
13
- declare const allType: readonly ["BGCOLOR", "BEFOREBG", "AFTERBG", "HVBGCOLOR", "FCBGCOLOR", "ACTIVEBG", "TEXTCOLOR", "HVTEXTCOLOR", "DISABLEDTEXTCOLOR", "SVGFILL", "RINGCOLOR", "FOCUSRING", "ACTIVERING", "OFFSETRING", "DUMMYCOLOR", "BTNCOLOR", "LISTCOLOR", "BORDER", "BORDERX", "BORDERY", "BORDERT", "BORDERB", "BORDERL", "BORDERR", "H1", "H2", "H3", "H4", "BODYTEXT", "FONTWEIGHT", "TEXTALIGN", "BORDERW", "BORDERXW", "BORDERYW", "BORDERTW", "BORDERBW", "BORDERLW", "BORDERRW", "BGOPACITY", "OPACITY", "MARGIN", "MARGINX", "MARGINY", "MARGINT", "MARGINB", "MARGINL", "MARGINR", "PADDING", "PADDINGX", "PADDINGY", "PADDINGT", "PADDINGB", "PADDINGL", "PADDINGR", "GAP"];
13
+ declare const allType: readonly ["BGCOLOR", "BEFOREBG", "AFTERBG", "HVBGCOLOR", "FCBGCOLOR", "ACTIVEBG", "TEXTCOLOR", "HVTEXTCOLOR", "FCTEXTCOLOR", "DISABLEDTEXTCOLOR", "SVGFILL", "RINGCOLOR", "FOCUSRING", "ACTIVERING", "OFFSETRING", "DUMMYCOLOR", "BTNCOLOR", "LISTCOLOR", "BORDER", "BORDERX", "BORDERY", "BORDERT", "BORDERB", "BORDERL", "BORDERR", "H1", "H2", "H3", "H4", "BODYTEXT", "FONTWEIGHT", "TEXTALIGN", "BORDERW", "BORDERXW", "BORDERYW", "BORDERTW", "BORDERBW", "BORDERLW", "BORDERRW", "BGOPACITY", "OPACITY", "MARGIN", "MARGINX", "MARGINY", "MARGINT", "MARGINB", "MARGINL", "MARGINR", "PADDING", "PADDINGX", "PADDINGY", "PADDINGT", "PADDINGB", "PADDINGL", "PADDINGR", "GAP"];
14
14
  export type ClassType = (typeof allType)[number];
15
15
  export type ColorClassType = (typeof colorType)[number];
16
16
  export type TextClassType = (typeof textType)[number];
@@ -35,6 +35,7 @@ declare class GenerateMCLClass extends MCLTheme {
35
35
  getActiveBgColorClass(): string;
36
36
  getTextColorClass(): string;
37
37
  getHoverTextColorClass(): string;
38
+ getFocusTextColorClass(): string;
38
39
  getDisabledTextColorClass(): string;
39
40
  getSvgFillColorClass(): string;
40
41
  getRingColorClass(): string;
package/theme/index.js CHANGED
@@ -13,6 +13,7 @@ export const colorType = [
13
13
  'ACTIVEBG',
14
14
  'TEXTCOLOR',
15
15
  'HVTEXTCOLOR',
16
+ 'FCTEXTCOLOR',
16
17
  'DISABLEDTEXTCOLOR',
17
18
  'SVGFILL',
18
19
  'RINGCOLOR',
@@ -100,6 +101,8 @@ class GenerateMCLClass extends MCLTheme {
100
101
  return this.getTextColorClass();
101
102
  case 'HVTEXTCOLOR':
102
103
  return this.getHoverTextColorClass();
104
+ case 'FCTEXTCOLOR':
105
+ return this.getFocusTextColorClass();
103
106
  case 'DISABLEDTEXTCOLOR':
104
107
  return this.getDisabledTextColorClass();
105
108
  case 'SVGFILL':
@@ -282,6 +285,12 @@ class GenerateMCLClass extends MCLTheme {
282
285
  }
283
286
  return MCLTheme.hoverTextColor[this.classValue];
284
287
  }
288
+ getFocusTextColorClass() {
289
+ if (!this.validateColorType) {
290
+ return ' ';
291
+ }
292
+ return MCLTheme.focusTextColor[this.classValue];
293
+ }
285
294
  getDisabledTextColorClass() {
286
295
  if (!this.validateColorType) {
287
296
  return ' ';
package/theme/index.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import MCLTheme from './theme.js'
2
2
  import type {
3
- ColorPalette,
4
- HeadingSize,
3
+ Alignment,
5
4
  BodyText,
5
+ ColorPalette,
6
6
  FontWeight,
7
- Range,
7
+ HeadingSize,
8
8
  OpacityRange,
9
+ Range,
9
10
  SpacingLevel,
10
- Alignment,
11
11
  } from './theme.types.js'
12
12
 
13
13
  /**
@@ -25,6 +25,7 @@ export const colorType = [
25
25
  'ACTIVEBG',
26
26
  'TEXTCOLOR',
27
27
  'HVTEXTCOLOR',
28
+ 'FCTEXTCOLOR',
28
29
  'DISABLEDTEXTCOLOR',
29
30
  'SVGFILL',
30
31
  'RINGCOLOR',
@@ -132,6 +133,8 @@ class GenerateMCLClass extends MCLTheme {
132
133
  return this.getTextColorClass()
133
134
  case 'HVTEXTCOLOR':
134
135
  return this.getHoverTextColorClass()
136
+ case 'FCTEXTCOLOR':
137
+ return this.getFocusTextColorClass()
135
138
  case 'DISABLEDTEXTCOLOR':
136
139
  return this.getDisabledTextColorClass()
137
140
  case 'SVGFILL':
@@ -314,6 +317,12 @@ class GenerateMCLClass extends MCLTheme {
314
317
  }
315
318
  return MCLTheme.hoverTextColor[this.classValue as ColorPalette]
316
319
  }
320
+ getFocusTextColorClass(): string {
321
+ if (!this.validateColorType) {
322
+ return ' '
323
+ }
324
+ return MCLTheme.focusTextColor[this.classValue as ColorPalette]
325
+ }
317
326
  getDisabledTextColorClass(): string {
318
327
  if (!this.validateColorType) {
319
328
  return ' '
package/theme/theme.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * @Interface - Classes for color, header text, body text, border color, border width(top, left).
4
4
  * @Export RDSTheme - an abstract class
5
5
  */
6
- import type { ColorPalette, HeadingSize, BodyText, FontWeight, Range, OpacityRange, SpacingLevel, Alignment as Position } from './theme.types.js';
6
+ import type { BodyText, ColorPalette, FontWeight, HeadingSize, OpacityRange, Alignment as Position, Range, SpacingLevel } from './theme.types.js';
7
7
  export type ColorClass = {
8
8
  [key in ColorPalette]: string;
9
9
  };
@@ -37,6 +37,7 @@ declare abstract class MCLTheme {
37
37
  protected static bgActiveColor: ColorClass;
38
38
  protected static textColor: ColorClass;
39
39
  protected static hoverTextColor: ColorClass;
40
+ protected static focusTextColor: ColorClass;
40
41
  protected static disabledTextColor: ColorClass;
41
42
  protected static svgFillColor: ColorClass;
42
43
  protected static ringColor: ColorClass;
package/theme/theme.js CHANGED
@@ -159,6 +159,26 @@ class MCLTheme {
159
159
  white: 'hover:text-white',
160
160
  transparent: 'hover:text-transparent',
161
161
  };
162
+ // focus text color class
163
+ static focusTextColor = {
164
+ primary: 'focus:text-primary',
165
+ secondary: 'focus:text-secondary',
166
+ success: 'focus:text-success',
167
+ danger: 'focus:text-danger',
168
+ info: 'focus:text-info',
169
+ warning: 'focus:text-warning',
170
+ 'light-1': 'focus:text-light-1',
171
+ 'light-2': 'focus:text-light-2',
172
+ 'light-3': 'focus:text-light-3',
173
+ 'light-4': 'focus:text-light-4',
174
+ 'dark-1': 'focus:text-dark-1',
175
+ 'dark-2': 'focus:text-dark-2',
176
+ 'dark-3': 'focus:text-dark-3',
177
+ 'dark-4': 'focus:text-dark-4',
178
+ black: 'focus:text-black',
179
+ white: 'focus:text-white',
180
+ transparent: 'focus:text-transparent',
181
+ };
162
182
  // disabled text color class
163
183
  static disabledTextColor = {
164
184
  primary: 'disabled:text-primary',