yuyeon 0.0.14 → 0.0.16

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 (205) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +15 -0
  3. package/dist/style.css +1 -1
  4. package/dist/yuyeon.mjs +3224 -2342
  5. package/dist/yuyeon.umd.js +29 -1
  6. package/lib/abstract/items.mjs +20 -0
  7. package/lib/abstract/items.mjs.map +1 -0
  8. package/lib/components/button/YButton.mjs +2 -2
  9. package/lib/components/button/YButton.mjs.map +1 -1
  10. package/lib/components/button/YButton.scss +1 -1
  11. package/lib/components/card/YCard.mjs.map +1 -1
  12. package/lib/components/card/YCard.scss +3 -2
  13. package/lib/components/checkbox/YInputCheckbox.scss +1 -1
  14. package/lib/components/chip/YChip.mjs +2 -2
  15. package/lib/components/chip/YChip.mjs.map +1 -1
  16. package/lib/components/dialog/YDialog.mjs +2 -2
  17. package/lib/components/dialog/YDialog.mjs.map +1 -1
  18. package/lib/components/dropdown/YDropdown.mjs +83 -2
  19. package/lib/components/dropdown/YDropdown.mjs.map +1 -1
  20. package/lib/components/dropdown/YDropdown.scss +33 -0
  21. package/lib/components/field-input/YFieldInput.mjs +57 -49
  22. package/lib/components/field-input/YFieldInput.mjs.map +1 -1
  23. package/lib/components/icons/YIconCheckbox.scss +1 -1
  24. package/lib/components/icons/YIconDropdown.mjs +16 -0
  25. package/lib/components/icons/YIconDropdown.mjs.map +1 -0
  26. package/lib/components/index.mjs +2 -0
  27. package/lib/components/index.mjs.map +1 -1
  28. package/lib/components/input/YInput.mjs +83 -49
  29. package/lib/components/input/YInput.mjs.map +1 -1
  30. package/lib/components/input/YInput.scss +50 -23
  31. package/lib/components/layer/YLayer.mjs +21 -9
  32. package/lib/components/layer/YLayer.mjs.map +1 -1
  33. package/lib/components/layer/YLayer.scss +1 -0
  34. package/lib/components/layer/scroll-strategies.mjs +1 -1
  35. package/lib/components/layer/scroll-strategies.mjs.map +1 -1
  36. package/lib/components/list/YList.mjs +40 -2
  37. package/lib/components/list/YList.mjs.map +1 -1
  38. package/lib/components/list/YListItem.mjs +31 -11
  39. package/lib/components/list/YListItem.mjs.map +1 -1
  40. package/lib/components/list/YListItem.scss +5 -2
  41. package/lib/components/menu/YMenu.mjs +29 -18
  42. package/lib/components/menu/YMenu.mjs.map +1 -1
  43. package/lib/components/menu/YMenu.scss +22 -7
  44. package/lib/components/pagination/YPagination.mjs +8 -8
  45. package/lib/components/pagination/YPagination.mjs.map +1 -1
  46. package/lib/components/panel/YDividePanel.scss +4 -4
  47. package/lib/components/progress-bar/YProgressBar.mjs +20 -3
  48. package/lib/components/progress-bar/YProgressBar.mjs.map +1 -1
  49. package/lib/components/progress-bar/YProgressBar.scss +109 -40
  50. package/lib/components/select/YSelect.mjs +196 -0
  51. package/lib/components/select/YSelect.mjs.map +1 -0
  52. package/lib/components/select/YSelect.scss +43 -0
  53. package/lib/components/select/index.mjs +2 -0
  54. package/lib/components/select/index.mjs.map +1 -0
  55. package/lib/components/switch/YSwitch.scss +1 -1
  56. package/lib/components/table/YTable.scss +2 -2
  57. package/lib/components/tree-view/YTreeView.mjs +76 -18
  58. package/lib/components/tree-view/YTreeView.mjs.map +1 -1
  59. package/lib/components/tree-view/YTreeViewNode.mjs +21 -18
  60. package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -1
  61. package/lib/components/tree-view/types.mjs.map +1 -1
  62. package/lib/components/tree-view/util.mjs +24 -0
  63. package/lib/components/tree-view/util.mjs.map +1 -1
  64. package/lib/composables/coordinate/arrangement.mjs.map +1 -1
  65. package/lib/composables/coordinate/index.mjs.map +1 -1
  66. package/lib/composables/coordinate/levitation.mjs +1 -1
  67. package/lib/composables/coordinate/levitation.mjs.map +1 -1
  68. package/lib/composables/coordinate/utils/point.mjs.map +1 -1
  69. package/lib/composables/dimension.mjs +26 -0
  70. package/lib/composables/dimension.mjs.map +1 -0
  71. package/lib/composables/focus.mjs +29 -0
  72. package/lib/composables/focus.mjs.map +1 -0
  73. package/lib/composables/list-items.mjs +58 -0
  74. package/lib/composables/list-items.mjs.map +1 -0
  75. package/lib/composables/theme/factory.mjs +45 -0
  76. package/lib/composables/theme/factory.mjs.map +1 -0
  77. package/lib/composables/theme/helper.mjs +14 -0
  78. package/lib/composables/theme/helper.mjs.map +1 -0
  79. package/lib/composables/theme/index.mjs +144 -10
  80. package/lib/composables/theme/index.mjs.map +1 -1
  81. package/lib/composables/theme/setting.mjs +58 -9
  82. package/lib/composables/theme/setting.mjs.map +1 -1
  83. package/lib/composables/theme/types.mjs +2 -0
  84. package/lib/composables/theme/types.mjs.map +1 -0
  85. package/lib/directives/complement-click/index.mjs.map +1 -1
  86. package/lib/directives/theme-class.mjs +4 -4
  87. package/lib/directives/theme-class.mjs.map +1 -1
  88. package/lib/index.mjs +7 -5
  89. package/lib/index.mjs.map +1 -1
  90. package/lib/mixins/di.mjs +0 -3
  91. package/lib/mixins/di.mjs.map +1 -1
  92. package/lib/styles/_elevation.scss +15 -0
  93. package/lib/styles/base.scss +11 -5
  94. package/lib/styles/settings/_elevation.scss +20 -0
  95. package/lib/styles/theme/light.scss +1 -1
  96. package/lib/styles/util/_helper.scss +12 -0
  97. package/lib/styles/util/_var.scss +18 -0
  98. package/lib/util/color/apca.mjs +201 -0
  99. package/lib/util/color/apca.mjs.map +1 -0
  100. package/lib/util/color/const.mjs +6 -0
  101. package/lib/util/color/const.mjs.map +1 -0
  102. package/lib/util/color/contrast/contrast.mjs +149 -0
  103. package/lib/util/color/contrast/contrast.mjs.map +1 -0
  104. package/lib/util/color/conversion.mjs +310 -0
  105. package/lib/util/color/conversion.mjs.map +1 -0
  106. package/lib/util/color/hct/cam16.mjs +349 -0
  107. package/lib/util/color/hct/cam16.mjs.map +1 -0
  108. package/lib/util/color/hct/hct-solver.mjs +389 -0
  109. package/lib/util/color/hct/hct-solver.mjs.map +1 -0
  110. package/lib/util/color/hct/hct.mjs +153 -0
  111. package/lib/util/color/hct/hct.mjs.map +1 -0
  112. package/lib/util/color/hct/viewing-conditions.mjs +110 -0
  113. package/lib/util/color/hct/viewing-conditions.mjs.map +1 -0
  114. package/lib/util/color/index.mjs +24 -0
  115. package/lib/util/color/index.mjs.map +1 -0
  116. package/lib/util/color/palettes/core-palette.mjs +99 -0
  117. package/lib/util/color/palettes/core-palette.mjs.map +1 -0
  118. package/lib/util/color/palettes/tonal-palette.mjs +112 -0
  119. package/lib/util/color/palettes/tonal-palette.mjs.map +1 -0
  120. package/lib/util/color/types.mjs +2 -0
  121. package/lib/util/color/types.mjs.map +1 -0
  122. package/lib/util/color/utils/math-utils.mjs +139 -0
  123. package/lib/util/color/utils/math-utils.mjs.map +1 -0
  124. package/lib/util/common.mjs +11 -6
  125. package/lib/util/common.mjs.map +1 -1
  126. package/lib/util/debounce.mjs +114 -0
  127. package/lib/util/debounce.mjs.map +1 -0
  128. package/lib/util/{FrameScheduler.mjs → frame-scheduler.mjs} +1 -1
  129. package/lib/util/frame-scheduler.mjs.map +1 -0
  130. package/lib/util/{Rect.mjs → rect.mjs} +1 -1
  131. package/lib/util/{Rect.mjs.map → rect.mjs.map} +1 -1
  132. package/lib/util/string.mjs +6 -0
  133. package/lib/util/string.mjs.map +1 -1
  134. package/lib/util/ui.mjs +11 -36
  135. package/lib/util/ui.mjs.map +1 -1
  136. package/package.json +12 -1
  137. package/types/abstract/items.d.ts +48 -0
  138. package/types/components/card/YCard.d.ts +1 -1
  139. package/types/components/checkbox/YInputCheckbox.d.ts +2 -2
  140. package/types/components/dialog/YDialog.d.ts +23 -8
  141. package/types/components/dropdown/YDropdown.d.ts +219 -0
  142. package/types/components/dropdown/index.d.ts +1 -0
  143. package/types/components/field-input/YFieldInput.d.ts +238 -25
  144. package/types/components/icons/YIconCheckbox.d.ts +1 -1
  145. package/types/components/icons/YIconDropdown.d.ts +1 -0
  146. package/types/components/index.d.ts +2 -0
  147. package/types/components/input/YInput.d.ts +156 -42
  148. package/types/components/layer/YLayer.d.ts +67 -17
  149. package/types/components/list/YList.d.ts +22 -1
  150. package/types/components/list/YListItem.d.ts +28 -2
  151. package/types/components/menu/YMenu.d.ts +132 -16
  152. package/types/components/pagination/YPagination.d.ts +10 -10
  153. package/types/components/progress-bar/YProgressBar.d.ts +18 -1
  154. package/types/components/select/YSelect.d.ts +701 -0
  155. package/types/components/select/index.d.ts +1 -0
  156. package/types/components/table/YDataTable.d.ts +1 -1
  157. package/types/components/table/YDataTableServer.d.ts +1 -1
  158. package/types/components/text-highlighter/YTextHighlighter.d.ts +40 -0
  159. package/types/components/tooltip/YTooltip.d.ts +20 -5
  160. package/types/components/tree-view/YTreeView.d.ts +47 -22
  161. package/types/components/tree-view/YTreeViewNode.d.ts +72 -26
  162. package/types/components/tree-view/types.d.ts +1 -0
  163. package/types/components/tree-view/util.d.ts +4 -1
  164. package/types/composables/coordinate/arrangement.d.ts +1 -1
  165. package/types/composables/coordinate/index.d.ts +3 -3
  166. package/types/composables/coordinate/levitation.d.ts +1 -1
  167. package/types/composables/coordinate/utils/point.d.ts +1 -1
  168. package/types/composables/dimension.d.ts +53 -0
  169. package/types/composables/focus.d.ts +27 -0
  170. package/types/composables/list-items.d.ts +117 -0
  171. package/types/composables/theme/factory.d.ts +3 -0
  172. package/types/composables/theme/helper.d.ts +3 -0
  173. package/types/composables/theme/index.d.ts +45 -5
  174. package/types/composables/theme/setting.d.ts +3 -6
  175. package/types/composables/theme/types.d.ts +28 -0
  176. package/types/directives/complement-click/index.d.ts +1 -1
  177. package/types/directives/theme-class.d.ts +1 -1
  178. package/types/index.d.ts +2 -0
  179. package/types/shims.d.ts +4 -0
  180. package/types/util/color/apca.d.ts +29 -0
  181. package/types/util/color/const.d.ts +5 -0
  182. package/types/util/color/conversion.d.ts +130 -0
  183. package/types/util/color/hct/cam16.d.ts +131 -0
  184. package/types/util/color/hct/hct.d.ts +86 -0
  185. package/types/util/color/hct/hct_solver.d.ts +146 -0
  186. package/types/util/color/hct/viewing_conditions.d.ts +74 -0
  187. package/types/util/color/index.d.ts +4 -0
  188. package/types/util/color/palettes/tonal_palette.d.ts +55 -0
  189. package/types/util/color/types.d.ts +14 -0
  190. package/types/util/color/utils/math-utils.d.ts +82 -0
  191. package/types/util/color/utils/math_utils.d.ts +82 -0
  192. package/types/util/common.d.ts +2 -1
  193. package/types/util/debounce.d.ts +11 -0
  194. package/types/util/string.d.ts +1 -0
  195. package/types/util/ui.d.ts +1 -6
  196. package/lib/components/input/index.scss +0 -2
  197. package/lib/components/table/pagination.mjs +0 -80
  198. package/lib/components/table/pagination.mjs.map +0 -1
  199. package/lib/composables/collections.mjs +0 -2
  200. package/lib/composables/collections.mjs.map +0 -1
  201. package/lib/composables/levitation.mjs +0 -135
  202. package/lib/composables/levitation.mjs.map +0 -1
  203. package/lib/styles/util/helper.scss +0 -6
  204. package/lib/util/FrameScheduler.mjs.map +0 -1
  205. /package/lib/styles/settings/{provided.scss → _provided.scss} +0 -0
@@ -0,0 +1,117 @@
1
+ import type { ExtractPropTypes, Ref } from 'vue';
2
+ export interface ListItem<T = any> {
3
+ value: any;
4
+ text: string;
5
+ props: {
6
+ [key: string]: any;
7
+ value: any;
8
+ text: string;
9
+ };
10
+ children?: ListItem<T>[];
11
+ raw: T;
12
+ }
13
+ declare const listItemsPropsOptions: {
14
+ returnItem: BooleanConstructor;
15
+ items: {
16
+ type: import("vue").PropType<any[]>;
17
+ default: () => never[];
18
+ };
19
+ itemKey: Omit<{
20
+ type: import("vue").PropType<string>;
21
+ default: string;
22
+ }, "default" | "type"> & {
23
+ type: import("vue").PropType<string>;
24
+ default: string;
25
+ };
26
+ itemText: {
27
+ type: import("vue").PropType<string>;
28
+ default: string;
29
+ };
30
+ itemChildren: Omit<{
31
+ type: import("vue").PropType<string | boolean>;
32
+ default: string;
33
+ }, "default" | "type"> & {
34
+ type: import("vue").PropType<NonNullable<string | boolean>>;
35
+ default: NonNullable<string | boolean>;
36
+ };
37
+ };
38
+ type ListItemProps = ExtractPropTypes<typeof listItemsPropsOptions>;
39
+ export declare const pressListItemsPropsOptions: <Defaults extends {
40
+ returnItem?: unknown;
41
+ items?: unknown;
42
+ itemKey?: unknown;
43
+ itemText?: unknown;
44
+ itemChildren?: unknown;
45
+ } = {}>(defaults?: Defaults | undefined) => {
46
+ returnItem: unknown extends Defaults["returnItem"] ? BooleanConstructor : {
47
+ type: import("vue").PropType<unknown extends Defaults ? "returnItem" : "returnItem" | Defaults>;
48
+ default: unknown extends Defaults["returnItem"] ? boolean : boolean | Defaults["returnItem"];
49
+ };
50
+ items: unknown extends Defaults["items"] ? {
51
+ type: import("vue").PropType<any[]>;
52
+ default: () => never[];
53
+ } : Omit<{
54
+ type: import("vue").PropType<any[]>;
55
+ default: () => never[];
56
+ }, "default" | "type"> & {
57
+ type: import("vue").PropType<unknown extends Defaults["items"] ? any[] : any[] | Defaults["items"]>;
58
+ default: unknown extends Defaults["items"] ? any[] : any[] | Defaults["items"];
59
+ };
60
+ itemKey: unknown extends Defaults["itemKey"] ? Omit<{
61
+ type: import("vue").PropType<string>;
62
+ default: string;
63
+ }, "default" | "type"> & {
64
+ type: import("vue").PropType<string>;
65
+ default: string;
66
+ } : Omit<Omit<{
67
+ type: import("vue").PropType<string>;
68
+ default: string;
69
+ }, "default" | "type"> & {
70
+ type: import("vue").PropType<string>;
71
+ default: string;
72
+ }, "default" | "type"> & {
73
+ type: import("vue").PropType<unknown extends Defaults["itemKey"] ? string : string | Defaults["itemKey"]>;
74
+ default: unknown extends Defaults["itemKey"] ? string : string | Defaults["itemKey"];
75
+ };
76
+ itemText: unknown extends Defaults["itemText"] ? {
77
+ type: import("vue").PropType<string>;
78
+ default: string;
79
+ } : Omit<{
80
+ type: import("vue").PropType<string>;
81
+ default: string;
82
+ }, "default" | "type"> & {
83
+ type: import("vue").PropType<unknown extends Defaults["itemText"] ? string : string | Defaults["itemText"]>;
84
+ default: unknown extends Defaults["itemText"] ? string : string | Defaults["itemText"];
85
+ };
86
+ itemChildren: unknown extends Defaults["itemChildren"] ? Omit<{
87
+ type: import("vue").PropType<string | boolean>;
88
+ default: string;
89
+ }, "default" | "type"> & {
90
+ type: import("vue").PropType<NonNullable<string | boolean>>;
91
+ default: NonNullable<string | boolean>;
92
+ } : Omit<Omit<{
93
+ type: import("vue").PropType<string | boolean>;
94
+ default: string;
95
+ }, "default" | "type"> & {
96
+ type: import("vue").PropType<NonNullable<string | boolean>>;
97
+ default: NonNullable<string | boolean>;
98
+ }, "default" | "type"> & {
99
+ type: import("vue").PropType<unknown extends Defaults["itemChildren"] ? NonNullable<string | boolean> : Defaults["itemChildren"] | NonNullable<NonNullable<string | boolean>>>;
100
+ default: unknown extends Defaults["itemChildren"] ? NonNullable<string | boolean> : Defaults["itemChildren"] | NonNullable<NonNullable<string | boolean>>;
101
+ };
102
+ };
103
+ export declare function refineListItems(props: Omit<ListItemProps, 'items'>, items: any[]): ListItem<any>[];
104
+ export declare function refineListItem(props: Omit<ListItemProps, 'items'>, item: any): ListItem;
105
+ export declare function useItems(props: ListItemProps): {
106
+ items: Ref<ListItem<any>[]>;
107
+ toEmitItems: (items: ListItem<any>[]) => unknown[];
108
+ toRefineItems: (values: any[]) => ListItem<any>[];
109
+ };
110
+ export declare function useRefineListItems<T extends {
111
+ value: unknown;
112
+ }>(items: Ref<T[]>, refine: (value: unknown) => T): {
113
+ items: Ref<T[]>;
114
+ toEmitItems: (items: T[]) => unknown[];
115
+ toRefineItems: (values: any[]) => T[];
116
+ };
117
+ export {};
@@ -0,0 +1,3 @@
1
+ import { ThemeDefinition } from './types';
2
+ export declare function createThemes(options: Record<string, any>): Record<string, ThemeDefinition>;
3
+ export declare function createPalette(options: Record<string, string | any>): Record<string, string>;
@@ -0,0 +1,3 @@
1
+ export declare function cssClass(selector: string, content: string[]): string[];
2
+ export declare function cssVariables(variables: Record<string, string>, prefix?: string): string[];
3
+ export declare function cssVariable(property: string, value: string): string;
@@ -1,15 +1,55 @@
1
- import type { App } from 'vue';
2
- import type { ThemeOptions } from "./setting";
1
+ import type { App, ComputedRef, Ref } from 'vue';
2
+ import { ThemeScheme } from './setting';
3
+ import type { ThemeOptions } from './types';
4
+ export type { ThemeOptions };
3
5
  export declare const Y_THEME_PREFIX = "y-theme";
6
+ export interface ThemeModuleInstance {
7
+ scheme: keyof typeof ThemeScheme | 'auto';
8
+ theme: Ref<[string, string?]>;
9
+ readonly themes: any;
10
+ readonly global: {
11
+ scheme: keyof typeof ThemeScheme | 'auto';
12
+ theme: Ref<[string, string?]>;
13
+ };
14
+ readonly currentThemeKey: Readonly<ComputedRef<string>>;
15
+ readonly themeClasses: Readonly<ComputedRef<string | undefined>>;
16
+ readonly computedThemes: Readonly<ComputedRef<any>>;
17
+ readonly computedPalette: Readonly<ComputedRef<any>>;
18
+ readonly supportedAutoMode: Readonly<Ref<boolean>>;
19
+ readonly preferColorScheme: Readonly<Ref<'light' | 'dark'>>;
20
+ }
4
21
  export declare const YUYEON_THEME_KEY: unique symbol;
22
+ export declare const pressThemePropsOptions: <Defaults extends {
23
+ theme?: unknown;
24
+ } = {}>(defaults?: Defaults | undefined) => {
25
+ theme: unknown extends Defaults["theme"] ? StringConstructor : {
26
+ type: import("vue").PropType<unknown extends Defaults ? "theme" : "theme" | Defaults>;
27
+ default: unknown extends Defaults["theme"] ? string : string | Defaults["theme"];
28
+ };
29
+ };
30
+ export declare function isDarkMode(): boolean;
31
+ export declare function isSupportAutoScheme(): boolean;
5
32
  export declare function createThemeModule(options: ThemeOptions): {
6
33
  install: (app: App) => void;
7
34
  init: (yuyeon: any) => void;
8
35
  scope: import("vue").EffectScope;
9
36
  instance: {
10
- scheme: any;
11
- theme: [string, string];
37
+ global: {
38
+ scheme: Ref<string>;
39
+ theme: Ref<[string, string]>;
40
+ };
12
41
  themes: any;
13
- mode: any;
42
+ scheme: Ref<string>;
43
+ theme: Ref<[string, string]>;
44
+ currentThemeKey: ComputedRef<string>;
45
+ themeClasses: ComputedRef<string>;
46
+ computedThemes: ComputedRef<Record<string, import("./types").ThemeDefinition>>;
47
+ computedPalette: ComputedRef<Record<string, string>>;
48
+ supportedAutoMode: Readonly<Ref<boolean>>;
49
+ preferColorScheme: Readonly<Ref<string>>;
14
50
  };
15
51
  };
52
+ export declare function useLocalTheme(props: {
53
+ theme?: string;
54
+ }): ThemeModuleInstance;
55
+ export declare function useTheme(): ThemeModuleInstance;
@@ -1,12 +1,9 @@
1
+ import { PaletteOption, ThemeOptions } from './types';
1
2
  export declare const ThemeScheme: {
2
3
  readonly light: "light";
3
4
  readonly dark: "dark";
4
5
  };
5
- export interface ThemeOptions {
6
- mode: 'manual';
7
- scheme: keyof typeof ThemeScheme | 'normal';
8
- theme: string | [string, string];
9
- themes: any;
10
- }
6
+ export declare const defaultTonalLuminance: number[];
7
+ export declare const defaultPalette: PaletteOption;
11
8
  export declare const defaultThemesValues: any;
12
9
  export declare function configureOptions(options?: ThemeOptions): any;
@@ -0,0 +1,28 @@
1
+ export interface ThemeOptions {
2
+ scheme: 'light' | 'dark' | 'auto';
3
+ theme: [string, string?];
4
+ themes: Record<string, ThemeDefinition>;
5
+ palette?: PaletteOption;
6
+ cspNonce?: string;
7
+ }
8
+ export interface PaletteOption {
9
+ scaleMethod: 'manual' | 'luma' | 'tonal';
10
+ colors: Record<string, string | PaletteLevelColorOption | PaletteLumaColorOption>;
11
+ defaultLamaScale?: {
12
+ darken?: 0 | 1 | 2 | 3 | 4;
13
+ lighten?: 0 | 1 | 2 | 3 | 4 | 5;
14
+ };
15
+ }
16
+ type ScaleLevel = number;
17
+ export type PaletteLevelColorOption = Record<ScaleLevel, string>;
18
+ export type PaletteLumaColorOption = {
19
+ value: string;
20
+ darken?: 0 | 1 | 2 | 3 | 4;
21
+ lighten?: 0 | 1 | 2 | 3 | 4 | 5;
22
+ };
23
+ export interface ThemeDefinition {
24
+ isDark: boolean;
25
+ colors: Record<string, string>;
26
+ variables: Record<string, string>;
27
+ }
28
+ export {};
@@ -13,7 +13,7 @@ declare global {
13
13
  export interface ComplementClickBindingOptions {
14
14
  handler: (mouseEvent: MouseEvent) => void;
15
15
  determine?: (event: Event) => boolean;
16
- include?: () => HTMLElement[];
16
+ include?: () => (HTMLElement | undefined)[];
17
17
  }
18
18
  export interface ComplementClickBinding extends DirectiveBinding {
19
19
  value: ((mouseEvent: MouseEvent) => void) | ComplementClickBindingOptions;
@@ -1,3 +1,3 @@
1
- import { FunctionDirective } from "vue";
1
+ import { FunctionDirective } from 'vue';
2
2
  declare const bindThemeClass: FunctionDirective;
3
3
  export default bindThemeClass;
package/types/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { App } from 'vue';
2
+ import { useTheme } from './composables/theme';
2
3
  declare module 'vue' {
3
4
  interface ComponentCustomProperties {
4
5
  $yuyeon: any;
@@ -7,3 +8,4 @@ declare module 'vue' {
7
8
  export declare function init(options?: any): {
8
9
  install: (app: App) => any;
9
10
  };
11
+ export { useTheme };
package/types/shims.d.ts CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  YDataTableServer,
13
13
  YDialog,
14
14
  YDividePanel,
15
+ YDropdown,
15
16
  YExpandHTransition,
16
17
  YExpandVTransition,
17
18
  YFieldInput,
@@ -31,6 +32,7 @@ import {
31
32
  YTooltip,
32
33
  YTreeView,
33
34
  YTreeViewNode,
35
+ YSelect,
34
36
  } from 'yuyeon/types/components';
35
37
 
36
38
  declare module '@vue/runtime-core' {
@@ -67,5 +69,7 @@ declare module '@vue/runtime-core' {
67
69
  YInputCheckbox: typeof YInputCheckbox;
68
70
  YCheckbox: typeof YCheckbox;
69
71
  YSwitch: typeof YSwitch;
72
+ YDropdown: typeof YDropdown;
73
+ YSelect: typeof YSelect;
70
74
  }
71
75
  }
@@ -0,0 +1,29 @@
1
+ /** @preserve
2
+ ///// SAPC APCA - Advanced Perceptual Contrast Algorithm
3
+ ///// Beta 0.1.9 W3 • contrast function only
4
+ ///// DIST: W3 • Revision date: July 3, 2022
5
+ ///// Function to parse color values and determine Lc contrast
6
+ ///// Copyright © 2019-2022 by Andrew Somers. All Rights Reserved.
7
+ ///// LICENSE: W3 LICENSE
8
+ ///// CONTACT: Please use the ISSUES or DISCUSSIONS tab at:
9
+ ///// https://github.com/Myndex/SAPC-APCA/
10
+ /////
11
+ ///////////////////////////////////////////////////////////////////////////////
12
+ /////
13
+ ///// MINIMAL IMPORTS:
14
+ ///// import { APCAcontrast, sRGBtoY, displayP3toY,
15
+ ///// calcAPCA, fontLookupAPCA } from 'apca-w3';
16
+ ///// import { colorParsley } from 'colorparsley';
17
+ /////
18
+ ///// FORWARD CONTRAST USAGE:
19
+ ///// Lc = APCAcontrast( sRGBtoY( TEXTcolor ) , sRGBtoY( BACKGNDcolor ) );
20
+ ///// Where the colors are sent as an rgba array [255,255,255,1]
21
+ /////
22
+ ///// Retrieving an array of font sizes for the contrast:
23
+ ///// fontArray = fontLookupAPCA(Lc);
24
+ /////
25
+ ///// Live Demonstrator at https://www.myndex.com/APCA/
26
+ // */
27
+ export declare function sRGBtoY(rgb?: number[]): number;
28
+ export declare function APCAcontrast(txtY: number, bgY: number, places?: number): string | number;
29
+ export declare function alphaBlend(rgbaFG?: number[], rgbBG?: number[], round?: boolean): (number | boolean)[];
@@ -0,0 +1,5 @@
1
+ export declare const RGBA_REGEX: RegExp;
2
+ export declare const HEX_COLOR_REGEX: RegExp;
3
+ export declare const SRGB_TO_XYZ: number[][];
4
+ export declare const XYZ_TO_SRGB: number[][];
5
+ export declare const WHITE_POINT_D65: number[];
@@ -0,0 +1,130 @@
1
+ import { Rgba } from './types';
2
+ export declare function rgbFromHex(color: string): number[] | undefined;
3
+ export declare function hexFromRgb(red: number, green: number, blue: number): string;
4
+ export declare function hexFromArgb(argb: number): string;
5
+ /**
6
+ * Converts a color from RGB components to ARGB format.
7
+ */
8
+ export declare function argbFromRgb(red: number, green: number, blue: number): number;
9
+ /**
10
+ * Converts a color from linear RGB components to ARGB format.
11
+ */
12
+ export declare function argbFromLinrgb(linrgb: number[]): number;
13
+ /**
14
+ * Returns the alpha component of a color in ARGB format.
15
+ */
16
+ export declare function alphaFromArgb(argb: number): number;
17
+ /**
18
+ * Returns the red component of a color in ARGB format.
19
+ */
20
+ export declare function redFromArgb(argb: number): number;
21
+ /**
22
+ * Returns the green component of a color in ARGB format.
23
+ */
24
+ export declare function greenFromArgb(argb: number): number;
25
+ /**
26
+ * Returns the blue component of a color in ARGB format.
27
+ */
28
+ export declare function blueFromArgb(argb: number): number;
29
+ /**
30
+ * Returns whether a color in ARGB format is opaque.
31
+ */
32
+ export declare function isOpaque(argb: number): boolean;
33
+ /**
34
+ * Converts a color from ARGB to XYZ.
35
+ */
36
+ export declare function argbFromXyz(x: number, y: number, z: number): number;
37
+ /**
38
+ * Converts a color from XYZ to ARGB.
39
+ */
40
+ export declare function xyzFromArgb(argb: number): number[];
41
+ /**
42
+ * Converts a color represented in Lab color space into an ARGB
43
+ * integer.
44
+ */
45
+ export declare function argbFromLab(l: number, a: number, b: number): number;
46
+ /**
47
+ * Converts a color from ARGB representation to L*a*b*
48
+ * representation.
49
+ *
50
+ * @param argb the ARGB representation of a color
51
+ * @return a Lab object representing the color
52
+ */
53
+ export declare function labFromArgb(argb: number): number[];
54
+ /**
55
+ * Converts an L* value to an ARGB representation.
56
+ *
57
+ * @param lstar L* in L*a*b*
58
+ * @return ARGB representation of grayscale color with lightness
59
+ * matching L*
60
+ */
61
+ export declare function argbFromLstar(lstar: number): number;
62
+ /**
63
+ * Computes the L* value of a color in ARGB representation.
64
+ *
65
+ * @param argb ARGB representation of a color
66
+ * @return L*, from L*a*b*, coordinate of the color
67
+ */
68
+ export declare function lstarFromArgb(argb: number): number;
69
+ /**
70
+ * Converts an L* value to a Y value.
71
+ *
72
+ * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.
73
+ *
74
+ * L* measures perceptual luminance, a linear scale. Y in XYZ
75
+ * measures relative luminance, a logarithmic scale.
76
+ *
77
+ * @param lstar L* in L*a*b*
78
+ * @return Y in XYZ
79
+ */
80
+ export declare function yFromLstar(lstar: number): number;
81
+ /**
82
+ * Converts a Y value to an L* value.
83
+ *
84
+ * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.
85
+ *
86
+ * L* measures perceptual luminance, a linear scale. Y in XYZ
87
+ * measures relative luminance, a logarithmic scale.
88
+ *
89
+ * @param y Y in XYZ
90
+ * @return L* in L*a*b*
91
+ */
92
+ export declare function lstarFromY(y: number): number;
93
+ /**
94
+ * Linearizes an RGB component.
95
+ *
96
+ * @param rgbComponent 0 <= rgb_component <= 255, represents R/G/B
97
+ * channel
98
+ * @return 0.0 <= output <= 100.0, color channel converted to
99
+ * linear RGB space
100
+ */
101
+ export declare function linearized(rgbComponent: number): number;
102
+ /**
103
+ * Delinearizes an RGB component.
104
+ *
105
+ * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
106
+ * linear R/G/B channel
107
+ * @return 0 <= output <= 255, color channel converted to regular
108
+ * RGB space
109
+ */
110
+ export declare function delinearized(rgbComponent: number): number;
111
+ /**
112
+ * Returns the standard white point; white on a sunny day.
113
+ *
114
+ * @return The white point
115
+ */
116
+ export declare function whitePointD65(): number[];
117
+ /**
118
+ * Return RGBA from a given int32 color
119
+ *
120
+ * @param argb ARGB representation of a int32 color.
121
+ * @return RGBA representation of a int32 color.
122
+ */
123
+ export declare function rgbaFromArgb(argb: number): Rgba;
124
+ /**
125
+ * Return int32 color from a given RGBA component
126
+ *
127
+ * @param rgba RGBA representation of a int32 color.
128
+ * @returns ARGB representation of a int32 color.
129
+ */
130
+ export declare function argbFromRgba({ r, g, b, a }: Rgba): number;
@@ -0,0 +1,131 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { ViewingConditions } from './viewing_conditions';
18
+ /**
19
+ * CAM16, a color appearance model. Colors are not just defined by their hex
20
+ * code, but rather, a hex code and viewing conditions.
21
+ *
22
+ * CAM16 instances also have coordinates in the CAM16-UCS space, called J*, a*,
23
+ * b*, or jstar, astar, bstar in code. CAM16-UCS is included in the CAM16
24
+ * specification, and should be used when measuring distances between colors.
25
+ *
26
+ * In traditional color spaces, a color can be identified solely by the
27
+ * observer's measurement of the color. Color appearance models such as CAM16
28
+ * also use information about the environment where the color was
29
+ * observed, known as the viewing conditions.
30
+ *
31
+ * For example, white under the traditional assumption of a midday sun white
32
+ * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,
33
+ * hue 203, chroma 3, lightness 100)
34
+ */
35
+ export declare class Cam16 {
36
+ readonly hue: number;
37
+ readonly chroma: number;
38
+ readonly j: number;
39
+ readonly q: number;
40
+ readonly m: number;
41
+ readonly s: number;
42
+ readonly jstar: number;
43
+ readonly astar: number;
44
+ readonly bstar: number;
45
+ /**
46
+ * All of the CAM16 dimensions can be calculated from 3 of the dimensions, in
47
+ * the following combinations:
48
+ * - {j or q} and {c, m, or s} and hue
49
+ * - jstar, astar, bstar
50
+ * Prefer using a static method that constructs from 3 of those dimensions.
51
+ * This constructor is intended for those methods to use to return all
52
+ * possible dimensions.
53
+ *
54
+ * @param hue
55
+ * @param chroma informally, colorfulness / color intensity. like saturation
56
+ * in HSL, except perceptually accurate.
57
+ * @param j lightness
58
+ * @param q brightness; ratio of lightness to white point's lightness
59
+ * @param m colorfulness
60
+ * @param s saturation; ratio of chroma to white point's chroma
61
+ * @param jstar CAM16-UCS J coordinate
62
+ * @param astar CAM16-UCS a coordinate
63
+ * @param bstar CAM16-UCS b coordinate
64
+ */
65
+ constructor(hue: number, chroma: number, j: number, q: number, m: number, s: number, jstar: number, astar: number, bstar: number);
66
+ /**
67
+ * CAM16 instances also have coordinates in the CAM16-UCS space, called J*,
68
+ * a*, b*, or jstar, astar, bstar in code. CAM16-UCS is included in the CAM16
69
+ * specification, and is used to measure distances between colors.
70
+ */
71
+ distance(other: Cam16): number;
72
+ /**
73
+ * @param argb ARGB representation of a color.
74
+ * @return CAM16 color, assuming the color was viewed in default viewing
75
+ * conditions.
76
+ */
77
+ static fromInt(argb: number): Cam16;
78
+ /**
79
+ * @param argb ARGB representation of a color.
80
+ * @param viewingConditions Information about the environment where the color
81
+ * was observed.
82
+ * @return CAM16 color.
83
+ */
84
+ static fromIntInViewingConditions(argb: number, viewingConditions: ViewingConditions): Cam16;
85
+ /**
86
+ * @param j CAM16 lightness
87
+ * @param c CAM16 chroma
88
+ * @param h CAM16 hue
89
+ */
90
+ static fromJch(j: number, c: number, h: number): Cam16;
91
+ /**
92
+ * @param j CAM16 lightness
93
+ * @param c CAM16 chroma
94
+ * @param h CAM16 hue
95
+ * @param viewingConditions Information about the environment where the color
96
+ * was observed.
97
+ */
98
+ static fromJchInViewingConditions(j: number, c: number, h: number, viewingConditions: ViewingConditions): Cam16;
99
+ /**
100
+ * @param jstar CAM16-UCS lightness.
101
+ * @param astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian
102
+ * coordinate on the Y axis.
103
+ * @param bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian
104
+ * coordinate on the X axis.
105
+ */
106
+ static fromUcs(jstar: number, astar: number, bstar: number): Cam16;
107
+ /**
108
+ * @param jstar CAM16-UCS lightness.
109
+ * @param astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian
110
+ * coordinate on the Y axis.
111
+ * @param bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian
112
+ * coordinate on the X axis.
113
+ * @param viewingConditions Information about the environment where the color
114
+ * was observed.
115
+ */
116
+ static fromUcsInViewingConditions(jstar: number, astar: number, bstar: number, viewingConditions: ViewingConditions): Cam16;
117
+ /**
118
+ * @return ARGB representation of color, assuming the color was viewed in
119
+ * default viewing conditions, which are near-identical to the default
120
+ * viewing conditions for sRGB.
121
+ */
122
+ toInt(): number;
123
+ /**
124
+ * @param viewingConditions Information about the environment where the color
125
+ * will be viewed.
126
+ * @return ARGB representation of color
127
+ */
128
+ viewed(viewingConditions: ViewingConditions): number;
129
+ static fromXyzInViewingConditions(x: number, y: number, z: number, viewingConditions: ViewingConditions): Cam16;
130
+ xyzInViewingConditions(viewingConditions: ViewingConditions): number[];
131
+ }
@@ -0,0 +1,86 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { ViewingConditions } from './viewing_conditions';
18
+ /**
19
+ * HCT, hue, chroma, and tone. A color system that provides a perceptually
20
+ * accurate color measurement system that can also accurately render what colors
21
+ * will appear as in different lighting environments.
22
+ */
23
+ export declare class Hct {
24
+ private argb;
25
+ /**
26
+ * @param hue 0 <= hue < 360; invalid values are corrected.
27
+ * @param chroma 0 <= chroma < ?; Informally, colorfulness. The color
28
+ * returned may be lower than the requested chroma. Chroma has a different
29
+ * maximum for any given hue and tone.
30
+ * @param tone 0 <= tone <= 100; invalid values are corrected.
31
+ * @return HCT representation of a color in default viewing conditions.
32
+ */
33
+ internalHue: number;
34
+ internalChroma: number;
35
+ internalTone: number;
36
+ static from(hue: number, chroma: number, tone: number): Hct;
37
+ /**
38
+ * @param argb ARGB representation of a color.
39
+ * @return HCT representation of a color in default viewing conditions
40
+ */
41
+ static fromInt(argb: number): Hct;
42
+ toInt(): number;
43
+ /**
44
+ * A number, in degrees, representing ex. red, orange, yellow, etc.
45
+ * Ranges from 0 <= hue < 360.
46
+ */
47
+ get hue(): number;
48
+ /**
49
+ * @param newHue 0 <= newHue < 360; invalid values are corrected.
50
+ * Chroma may decrease because chroma has a different maximum for any given
51
+ * hue and tone.
52
+ */
53
+ set hue(newHue: number);
54
+ get chroma(): number;
55
+ /**
56
+ * @param newChroma 0 <= newChroma < ?
57
+ * Chroma may decrease because chroma has a different maximum for any given
58
+ * hue and tone.
59
+ */
60
+ set chroma(newChroma: number);
61
+ /** Lightness. Ranges from 0 to 100. */
62
+ get tone(): number;
63
+ /**
64
+ * @param newTone 0 <= newTone <= 100; invalid valids are corrected.
65
+ * Chroma may decrease because chroma has a different maximum for any given
66
+ * hue and tone.
67
+ */
68
+ set tone(newTone: number);
69
+ private constructor();
70
+ private setInternalState;
71
+ /**
72
+ * Translates a color into different [ViewingConditions].
73
+ *
74
+ * Colors change appearance. They look different with lights on versus off,
75
+ * the same color, as in hex code, on white looks different when on black.
76
+ * This is called color relativity, most famously explicated by Josef Albers
77
+ * in Interaction of Color.
78
+ *
79
+ * In color science, color appearance models can account for this and
80
+ * calculate the appearance of a color in different settings. HCT is based on
81
+ * CAM16, a color appearance model, and uses it to make these calculations.
82
+ *
83
+ * See [ViewingConditions.make] for parameters affecting color appearance.
84
+ */
85
+ inViewingConditions(vc: ViewingConditions): Hct;
86
+ }