yuyeon 0.1.0-rc.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/yuyeon.js +4606 -4024
  3. package/dist/yuyeon.umd.cjs +17 -13
  4. package/lib/components/badge/YBadge.scss +0 -1
  5. package/lib/components/card/YCard.mjs +16 -9
  6. package/lib/components/card/YCard.mjs.map +1 -1
  7. package/lib/components/dialog/YDialog.mjs +4 -1
  8. package/lib/components/dialog/YDialog.mjs.map +1 -1
  9. package/lib/components/dropdown/YDropdown.mjs +10 -4
  10. package/lib/components/dropdown/YDropdown.mjs.map +1 -1
  11. package/lib/components/field-input/YFieldInput.mjs.map +1 -1
  12. package/lib/components/field-input/YFieldInput.scss +1 -1
  13. package/lib/components/hover/YHover.mjs +11 -4
  14. package/lib/components/hover/YHover.mjs.map +1 -1
  15. package/lib/components/hover/index.mjs +2 -0
  16. package/lib/components/hover/index.mjs.map +1 -0
  17. package/lib/components/index.mjs +3 -0
  18. package/lib/components/index.mjs.map +1 -1
  19. package/lib/components/input/YInput.scss +1 -1
  20. package/lib/components/ip-field/YIpField.scss +74 -0
  21. package/lib/components/ip-field/YIpv4Field.mjs +297 -0
  22. package/lib/components/ip-field/YIpv4Field.mjs.map +1 -0
  23. package/lib/components/ip-field/index.mjs +2 -0
  24. package/lib/components/ip-field/index.mjs.map +1 -0
  25. package/lib/components/layer/YLayer.mjs +32 -12
  26. package/lib/components/layer/YLayer.mjs.map +1 -1
  27. package/lib/components/layer/base.mjs +1 -1
  28. package/lib/components/layer/base.mjs.map +1 -1
  29. package/lib/components/layer/content.mjs +22 -0
  30. package/lib/components/layer/content.mjs.map +1 -0
  31. package/lib/components/layer/scroll-strategies.mjs +1 -1
  32. package/lib/components/layer/scroll-strategies.mjs.map +1 -1
  33. package/lib/components/list/YListItem.mjs +1 -0
  34. package/lib/components/list/YListItem.mjs.map +1 -1
  35. package/lib/components/menu/YMenu.mjs +6 -11
  36. package/lib/components/menu/YMenu.mjs.map +1 -1
  37. package/lib/components/panel/YDividePanel.scss +1 -1
  38. package/lib/components/select/YSelect.mjs +8 -5
  39. package/lib/components/select/YSelect.mjs.map +1 -1
  40. package/lib/components/snackbar/YSnackbar.mjs +42 -37
  41. package/lib/components/snackbar/YSnackbar.mjs.map +1 -1
  42. package/lib/components/tab/YTab.scss +3 -3
  43. package/lib/components/tab/types.mjs.map +1 -1
  44. package/lib/components/table/YDataTableBody.mjs +1 -1
  45. package/lib/components/table/YDataTableBody.mjs.map +1 -1
  46. package/lib/components/table/YDataTableRow.mjs +30 -3
  47. package/lib/components/table/YDataTableRow.mjs.map +1 -1
  48. package/lib/components/table/composibles/header.mjs +1 -1
  49. package/lib/components/table/composibles/header.mjs.map +1 -1
  50. package/lib/components/table/composibles/items.mjs +3 -1
  51. package/lib/components/table/composibles/items.mjs.map +1 -1
  52. package/lib/components/table/composibles/selection.mjs.map +1 -1
  53. package/lib/components/table/composibles/sorting.mjs.map +1 -1
  54. package/lib/components/table/types/common.mjs.map +1 -1
  55. package/lib/components/table/types/header.mjs.map +1 -1
  56. package/lib/components/text-interpolation/YTi.mjs +46 -0
  57. package/lib/components/text-interpolation/YTi.mjs.map +1 -0
  58. package/lib/components/text-interpolation/index.mjs +2 -0
  59. package/lib/components/text-interpolation/index.mjs.map +1 -0
  60. package/lib/components/textarea/YTextarea.mjs +3 -1
  61. package/lib/components/textarea/YTextarea.mjs.map +1 -1
  62. package/lib/components/tooltip/YTooltip.mjs +1 -0
  63. package/lib/components/tooltip/YTooltip.mjs.map +1 -1
  64. package/lib/components/tree-view/YTreeViewNode.mjs +47 -21
  65. package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -1
  66. package/lib/composables/coordinate/index.mjs.map +1 -1
  67. package/lib/composables/coordinate/levitation.mjs.map +1 -1
  68. package/lib/composables/icon.mjs.map +1 -1
  69. package/lib/composables/index.mjs +1 -0
  70. package/lib/composables/index.mjs.map +1 -1
  71. package/lib/composables/theme/index.mjs +6 -3
  72. package/lib/composables/theme/index.mjs.map +1 -1
  73. package/lib/index.mjs +1 -1
  74. package/lib/index.mjs.map +1 -1
  75. package/lib/util/parser.mjs +31 -0
  76. package/lib/util/parser.mjs.map +1 -0
  77. package/lib/util/string.mjs +30 -0
  78. package/lib/util/string.mjs.map +1 -1
  79. package/package.json +12 -11
  80. package/types/abstract/items.d.ts +5 -4
  81. package/types/components/alert/YAlert.d.ts +3 -2
  82. package/types/components/app/YApp.d.ts +3 -2
  83. package/types/components/badge/YBadge.d.ts +9 -8
  84. package/types/components/bench/YBench.d.ts +4 -0
  85. package/types/components/bench/index.d.ts +1 -0
  86. package/types/components/button/YButton.d.ts +27 -29
  87. package/types/components/card/YCard.d.ts +6 -3
  88. package/types/components/card/YCardBody.d.ts +1 -1
  89. package/types/components/card/YCardFooter.d.ts +1 -1
  90. package/types/components/card/YCardHeader.d.ts +1 -1
  91. package/types/components/checkbox/YCheckbox.d.ts +4 -3
  92. package/types/components/checkbox/YInputCheckbox.d.ts +7 -6
  93. package/types/components/checkbox/index.d.ts +1 -1
  94. package/types/components/chip/YChip.d.ts +3 -2
  95. package/types/components/date-picker/YDateCalendar.d.ts +16 -15
  96. package/types/components/date-picker/YDatePicker.d.ts +41 -40
  97. package/types/components/date-picker/YDatePickerControl.d.ts +29 -28
  98. package/types/components/date-picker/YMonthPicker.d.ts +6 -5
  99. package/types/components/date-picker/YYearPicker.d.ts +3 -2
  100. package/types/components/default-provider/YDefaultProvider.d.ts +0 -0
  101. package/types/components/default-provider/index.d.ts +0 -0
  102. package/types/components/dialog/YDialog.d.ts +416 -335
  103. package/types/components/divider/YDivider.d.ts +4 -3
  104. package/types/components/dropdown/YDropdown.d.ts +507 -61
  105. package/types/components/field-input/YFieldInput.d.ts +27 -26
  106. package/types/components/form/YForm.d.ts +9 -8
  107. package/types/components/hover/YHover.d.ts +79 -0
  108. package/types/components/hover/index.d.ts +1 -0
  109. package/types/components/icon/YIcon.d.ts +5 -4
  110. package/types/components/icons/YIconCheckbox.d.ts +5 -4
  111. package/types/components/icons/YIconClear.d.ts +1 -1
  112. package/types/components/icons/YIconDropdown.d.ts +1 -1
  113. package/types/components/icons/YIconExpand.d.ts +1 -1
  114. package/types/components/icons/YIconPageControl.d.ts +6 -5
  115. package/types/components/icons/YIconSort.d.ts +5 -4
  116. package/types/components/icons/index.d.ts +26 -26
  117. package/types/components/index.d.ts +3 -0
  118. package/types/components/input/YInput.d.ts +21 -20
  119. package/types/components/ip-field/YIpv4Field.d.ts +133 -0
  120. package/types/components/ip-field/index.d.ts +1 -0
  121. package/types/components/layer/YLayer.d.ts +154 -106
  122. package/types/components/layer/active-stack.d.ts +3 -2
  123. package/types/components/layer/base.d.ts +8 -7
  124. package/types/components/layer/content.d.ts +21 -0
  125. package/types/components/layer/scroll-strategies.d.ts +41 -0
  126. package/types/components/list/YList.d.ts +8 -7
  127. package/types/components/list/YListItem.d.ts +19 -13
  128. package/types/components/loading/YSpinnerRing.d.ts +2 -1
  129. package/types/components/menu/YMenu.d.ts +175 -125
  130. package/types/components/navigation/YNavigation.d.ts +1 -0
  131. package/types/components/navigation/index.d.ts +1 -0
  132. package/types/components/pagination/YPagination.d.ts +20 -19
  133. package/types/components/panel/YDividePanel.d.ts +4 -3
  134. package/types/components/plate/YPlate.d.ts +3 -2
  135. package/types/components/progress-bar/YProgressBar.d.ts +5 -4
  136. package/types/components/select/YSelect.d.ts +1304 -944
  137. package/types/components/snackbar/YSnackbar.d.ts +494 -30
  138. package/types/components/switch/YSwitch.d.ts +4 -3
  139. package/types/components/tab/YTab.d.ts +30 -29
  140. package/types/components/tab/YTabs.d.ts +12 -11
  141. package/types/components/tab/index.d.ts +1 -1
  142. package/types/components/tab/shared.d.ts +1 -0
  143. package/types/components/tab/types.d.ts +1 -1
  144. package/types/components/table/YDataTable.d.ts +225 -62
  145. package/types/components/table/YDataTableBody.d.ts +10 -9
  146. package/types/components/table/YDataTableCell.d.ts +6 -5
  147. package/types/components/table/YDataTableControl.d.ts +5 -4
  148. package/types/components/table/YDataTableHead.d.ts +10 -10
  149. package/types/components/table/YDataTableLayer.d.ts +4 -3
  150. package/types/components/table/YDataTableRow.d.ts +3 -2
  151. package/types/components/table/YDataTableServer.d.ts +225 -62
  152. package/types/components/table/YTable.d.ts +7 -6
  153. package/types/components/table/composibles/header.d.ts +103 -12
  154. package/types/components/table/composibles/items.d.ts +5 -4
  155. package/types/components/table/composibles/options.d.ts +2 -1
  156. package/types/components/table/composibles/pagination.d.ts +6 -5
  157. package/types/components/table/composibles/selection.d.ts +7 -5
  158. package/types/components/table/composibles/sorting.d.ts +26 -7
  159. package/types/components/table/types/common.d.ts +1 -0
  160. package/types/components/table/types/header.d.ts +3 -2
  161. package/types/components/table/types/index.d.ts +5 -4
  162. package/types/components/table/types/item.d.ts +1 -0
  163. package/types/components/table/types/row.d.ts +1 -0
  164. package/types/components/text-ellipsis/YTextEllipsis.d.ts +3 -2
  165. package/types/components/text-highlighter/YTextHighlighter.d.ts +3 -2
  166. package/types/components/text-highlighter/index.d.ts +1 -0
  167. package/types/components/text-interpolation/YTi.d.ts +20 -0
  168. package/types/components/text-interpolation/index.d.ts +1 -0
  169. package/types/components/textarea/YTextarea.d.ts +39 -39
  170. package/types/components/toggle-button/YToggleButton.d.ts +1 -0
  171. package/types/components/tooltip/YTooltip.d.ts +217 -150
  172. package/types/components/transitions/expand-transition.d.ts +4 -3
  173. package/types/components/transitions/index.d.ts +10 -10
  174. package/types/components/tree-view/YTreeView.d.ts +20 -13
  175. package/types/components/tree-view/YTreeViewNode.d.ts +42 -20
  176. package/types/components/tree-view/types.d.ts +2 -1
  177. package/types/components/tree-view/util.d.ts +1 -0
  178. package/types/composables/choice-link.d.ts +2 -1
  179. package/types/composables/choice.d.ts +3 -2
  180. package/types/composables/communication.d.ts +2 -1
  181. package/types/composables/component.d.ts +1 -0
  182. package/types/composables/coordinate/arrangement.d.ts +2 -1
  183. package/types/composables/coordinate/index.d.ts +23 -22
  184. package/types/composables/coordinate/levitation.d.ts +2 -1
  185. package/types/composables/coordinate/types.d.ts +2 -1
  186. package/types/composables/coordinate/utils/point.d.ts +1 -0
  187. package/types/composables/date/factory.d.ts +1 -0
  188. package/types/composables/date/index.d.ts +1 -0
  189. package/types/composables/date/setting.d.ts +2 -1
  190. package/types/composables/date/types.d.ts +2 -1
  191. package/types/composables/dimension.d.ts +4 -3
  192. package/types/composables/focus.d.ts +4 -3
  193. package/types/composables/form.d.ts +7 -6
  194. package/types/composables/i18n/index.d.ts +1 -0
  195. package/types/composables/i18n/locale.d.ts +2 -1
  196. package/types/composables/i18n/rtl.d.ts +2 -1
  197. package/types/composables/icon.d.ts +9 -10
  198. package/types/composables/index.d.ts +1 -0
  199. package/types/composables/layer-group.d.ts +3 -2
  200. package/types/composables/layout.d.ts +10 -0
  201. package/types/composables/list-items.d.ts +36 -35
  202. package/types/composables/progress.d.ts +1 -1
  203. package/types/composables/ref.d.ts +2 -1
  204. package/types/composables/resize-observer.d.ts +2 -2
  205. package/types/composables/scope.d.ts +2 -1
  206. package/types/composables/theme/factory.d.ts +1 -0
  207. package/types/composables/theme/index.d.ts +5 -4
  208. package/types/composables/theme/setting.d.ts +1 -0
  209. package/types/composables/timing.d.ts +2 -1
  210. package/types/composables/transition.d.ts +2 -1
  211. package/types/composables/validation.d.ts +19 -18
  212. package/types/composables/vue-router.d.ts +3 -3
  213. package/types/directives/complement-click/index.d.ts +1 -0
  214. package/types/directives/plate-wave/index.d.ts +2 -1
  215. package/types/directives/theme-class.d.ts +1 -0
  216. package/types/globals.d.ts +1 -1
  217. package/types/i18n/built-in.d.ts +2 -1
  218. package/types/i18n/types.d.ts +2 -1
  219. package/types/index.d.ts +2 -1
  220. package/types/locales/index.d.ts +2 -0
  221. package/types/locales/ko.d.ts +6 -0
  222. package/types/mixins/di.d.ts +1 -1
  223. package/types/mixins/rebind-attrs.d.ts +2 -2
  224. package/types/shims.d.ts +5 -45
  225. package/types/types/index.d.ts +2 -1
  226. package/types/util/anchor.d.ts +1 -1
  227. package/types/util/color/contrast/contrast.d.ts +74 -0
  228. package/types/util/color/conversion.d.ts +1 -0
  229. package/types/util/color/hct/cam16.d.ts +2 -17
  230. package/types/util/color/hct/hct-solver.d.ts +131 -0
  231. package/types/util/color/hct/hct.d.ts +2 -17
  232. package/types/util/color/hct/viewing-conditions.d.ts +58 -0
  233. package/types/util/color/index.d.ts +1 -1
  234. package/types/util/color/palettes/core-palette.d.ts +44 -0
  235. package/types/util/color/palettes/tonal-palette.d.ts +40 -0
  236. package/types/util/date/adapters/yuyeon-date-adapter.d.ts +1 -0
  237. package/types/util/date/built-in.d.ts +2 -1
  238. package/types/util/date/index.d.ts +1 -1
  239. package/types/util/parser.d.ts +4 -0
  240. package/types/util/reactivity.d.ts +3 -2
  241. package/types/util/string.d.ts +4 -0
  242. package/types/util/vue-component.d.ts +4 -3
package/types/shims.d.ts CHANGED
@@ -1,48 +1,5 @@
1
- import {
2
- YAlert,
3
- YApp,
4
- YBadge,
5
- YButton,
6
- YCard,
7
- YCardBody,
8
- YCardFooter,
9
- YCardHeader,
10
- YCheckbox,
11
- YChip,
12
- YDataTable,
13
- YDataTableServer,
14
- YDateCalendar,
15
- YDatePicker,
16
- YDialog,
17
- YDividePanel,
18
- YDivider,
19
- YDropdown,
20
- YExpandHTransition,
21
- YExpandVTransition,
22
- YFieldInput,
23
- YForm,
24
- YIcon,
25
- YInput,
26
- YInputCheckbox,
27
- YLayer,
28
- YList,
29
- YListItem,
30
- YMenu,
31
- YMonthPicker,
32
- YPagination,
33
- YProgressBar,
34
- YSelect,
35
- YSnackbar,
36
- YSpinnerRing,
37
- YSwitch,
38
- YTab,
39
- YTable,
40
- YTabs,
41
- YTextarea,
42
- YTooltip,
43
- YTreeView,
44
- YTreeViewNode,
45
- } from 'yuyeon/components';
1
+ import { YAlert, YApp, YBadge, YButton, YCard, YCardBody, YCardFooter, YCardHeader, YCheckbox, YChip, YDataTable, YDataTableServer, YDateCalendar, YDatePicker, YDialog, YDividePanel, YDivider, YDropdown, YExpandHTransition, YExpandVTransition, YFieldInput, YForm, YHover, YIcon, YInput, YInputCheckbox, YIpv4Field, YLayer, YList, YListItem, YMenu, YMonthPicker, YPagination, YProgressBar, YSelect, YSnackbar, YSpinnerRing, YSwitch, YTab, YTable, YTabs, YTextarea, YTooltip, YTreeView, YTreeViewNode, YTi } from 'yuyeon/components';
2
+
46
3
 
47
4
  declare module '@vue/runtime-core' {
48
5
  export interface GlobalComponents {
@@ -90,5 +47,8 @@ declare module '@vue/runtime-core' {
90
47
  YDatePicker: typeof YDatePicker;
91
48
  YMonthPicker: typeof YMonthPicker;
92
49
  YBadge: typeof YBadge;
50
+ YIpv4Field: typeof YIpv4Field;
51
+ YHover: typeof YHover;
52
+ YTi: typeof YTi;
93
53
  }
94
54
  }
@@ -1,5 +1,6 @@
1
1
  import { HTMLAttributes } from '@vue/runtime-dom';
2
- import type { ComponentPublicInstance, FunctionalComponent } from 'vue';
2
+ import { ComponentPublicInstance, FunctionalComponent } from 'vue';
3
+
3
4
  export type CandidateKey = string | number;
4
5
  export type JSXComponent<Props = any> = FunctionalComponent<Props | Props & HTMLAttributes> | {
5
6
  new (): ComponentPublicInstance<Props | Props & HTMLAttributes>;
@@ -15,7 +15,7 @@ export type ParsedAnchor = {
15
15
  };
16
16
  /** Parse a raw anchor string into an object */
17
17
  export declare function parseAnchor(anchor: Anchor, isRtl: boolean): ParsedAnchor;
18
- export declare function toPhysical(str: 'center' | Tblock | Tinline, isRtl: boolean): "top" | "right" | "bottom" | "left" | "center";
18
+ export declare function toPhysical(str: 'center' | Tblock | Tinline, isRtl: boolean): "top" | "bottom" | "left" | "right" | "center";
19
19
  export declare function flipSide(anchor: ParsedAnchor): ParsedAnchor;
20
20
  export declare function flipAlign(anchor: ParsedAnchor): ParsedAnchor;
21
21
  export declare function flipCorner(anchor: ParsedAnchor): ParsedAnchor;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Utility methods for calculating contrast given two colors, or calculating a
3
+ * color given one color and a contrast ratio.
4
+ *
5
+ * Contrast ratio is calculated using XYZ's Y. When linearized to match human
6
+ * perception, Y becomes HCT's tone and L*a*b*'s' L*. Informally, this is the
7
+ * lightness of a color.
8
+ *
9
+ * Methods refer to tone, T in the the HCT color space.
10
+ * Tone is equivalent to L* in the L*a*b* color space, or L in the LCH color
11
+ * space.
12
+ */
13
+ export declare class Contrast {
14
+ /**
15
+ * Returns a contrast ratio, which ranges from 1 to 21.
16
+ *
17
+ * @param toneA Tone between 0 and 100. Values outside will be clamped.
18
+ * @param toneB Tone between 0 and 100. Values outside will be clamped.
19
+ */
20
+ static ratioOfTones(toneA: number, toneB: number): number;
21
+ static ratioOfYs(y1: number, y2: number): number;
22
+ /**
23
+ * Returns a tone >= tone parameter that ensures ratio parameter.
24
+ * Return value is between 0 and 100.
25
+ * Returns -1 if ratio cannot be achieved with tone parameter.
26
+ *
27
+ * @param tone Tone return value must contrast with.
28
+ * Range is 0 to 100. Invalid values will result in -1 being returned.
29
+ * @param ratio Contrast ratio of return value and tone.
30
+ * Range is 1 to 21, invalid values have undefined behavior.
31
+ */
32
+ static lighter(tone: number, ratio: number): number;
33
+ /**
34
+ * Returns a tone <= tone parameter that ensures ratio parameter.
35
+ * Return value is between 0 and 100.
36
+ * Returns -1 if ratio cannot be achieved with tone parameter.
37
+ *
38
+ * @param tone Tone return value must contrast with.
39
+ * Range is 0 to 100. Invalid values will result in -1 being returned.
40
+ * @param ratio Contrast ratio of return value and tone.
41
+ * Range is 1 to 21, invalid values have undefined behavior.
42
+ */
43
+ static darker(tone: number, ratio: number): number;
44
+ /**
45
+ * Returns a tone >= tone parameter that ensures ratio parameter.
46
+ * Return value is between 0 and 100.
47
+ * Returns 100 if ratio cannot be achieved with tone parameter.
48
+ *
49
+ * This method is unsafe because the returned value is guaranteed to be in
50
+ * bounds for tone, i.e. between 0 and 100. However, that value may not reach
51
+ * the ratio with tone. For example, there is no color lighter than T100.
52
+ *
53
+ * @param tone Tone return value must contrast with.
54
+ * Range is 0 to 100. Invalid values will result in 100 being returned.
55
+ * @param ratio Desired contrast ratio of return value and tone parameter.
56
+ * Range is 1 to 21, invalid values have undefined behavior.
57
+ */
58
+ static lighterUnsafe(tone: number, ratio: number): number;
59
+ /**
60
+ * Returns a tone >= tone parameter that ensures ratio parameter.
61
+ * Return value is between 0 and 100.
62
+ * Returns 100 if ratio cannot be achieved with tone parameter.
63
+ *
64
+ * This method is unsafe because the returned value is guaranteed to be in
65
+ * bounds for tone, i.e. between 0 and 100. However, that value may not reach
66
+ * the [ratio with [tone]. For example, there is no color darker than T0.
67
+ *
68
+ * @param tone Tone return value must contrast with.
69
+ * Range is 0 to 100. Invalid values will result in 0 being returned.
70
+ * @param ratio Desired contrast ratio of return value and tone parameter.
71
+ * Range is 1 to 21, invalid values have undefined behavior.
72
+ */
73
+ static darkerUnsafe(tone: number, ratio: number): number;
74
+ }
@@ -1,4 +1,5 @@
1
1
  import { Rgba } from './types';
2
+
2
3
  export declare function rgbFromHex(color: string): number[] | undefined;
3
4
  export declare function hexFromRgb(red: number, green: number, blue: number): string;
4
5
  export declare function hexFromArgb(argb: number): string;
@@ -1,20 +1,5 @@
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';
1
+ import { ViewingConditions } from './viewing-conditions';
2
+
18
3
  /**
19
4
  * CAM16, a color appearance model. Colors are not just defined by their hex
20
5
  * code, but rather, a hex code and viewing conditions.
@@ -0,0 +1,131 @@
1
+ import { Cam16 } from './cam16';
2
+
3
+ /**
4
+ * A class that solves the HCT equation.
5
+ */
6
+ export declare class HctSolver {
7
+ static SCALED_DISCOUNT_FROM_LINRGB: number[][];
8
+ static LINRGB_FROM_SCALED_DISCOUNT: number[][];
9
+ static Y_FROM_LINRGB: number[];
10
+ static CRITICAL_PLANES: number[];
11
+ /**
12
+ * Sanitizes a small enough angle in radians.
13
+ *
14
+ * @param angle An angle in radians; must not deviate too much
15
+ * from 0.
16
+ * @return A coterminal angle between 0 and 2pi.
17
+ */
18
+ private static sanitizeRadians;
19
+ /**
20
+ * Delinearizes an RGB component, returning a floating-point
21
+ * number.
22
+ *
23
+ * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
24
+ * linear R/G/B channel
25
+ * @return 0.0 <= output <= 255.0, color channel converted to
26
+ * regular RGB space
27
+ */
28
+ private static trueDelinearized;
29
+ private static chromaticAdaptation;
30
+ /**
31
+ * Returns the hue of a linear RGB color in CAM16.
32
+ *
33
+ * @param linrgb The linear RGB coordinates of a color.
34
+ * @return The hue of the color in CAM16, in radians.
35
+ */
36
+ private static hueOf;
37
+ private static areInCyclicOrder;
38
+ /**
39
+ * Solves the lerp equation.
40
+ *
41
+ * @param source The starting number.
42
+ * @param mid The number in the middle.
43
+ * @param target The ending number.
44
+ * @return A number t such that lerp(source, target, t) = mid.
45
+ */
46
+ private static intercept;
47
+ private static lerpPoint;
48
+ /**
49
+ * Intersects a segment with a plane.
50
+ *
51
+ * @param source The coordinates of point A.
52
+ * @param coordinate The R-, G-, or B-coordinate of the plane.
53
+ * @param target The coordinates of point B.
54
+ * @param axis The axis the plane is perpendicular with. (0: R, 1:
55
+ * G, 2: B)
56
+ * @return The intersection point of the segment AB with the plane
57
+ * R=coordinate, G=coordinate, or B=coordinate
58
+ */
59
+ private static setCoordinate;
60
+ private static isBounded;
61
+ /**
62
+ * Returns the nth possible vertex of the polygonal intersection.
63
+ *
64
+ * @param y The Y value of the plane.
65
+ * @param n The zero-based index of the point. 0 <= n <= 11.
66
+ * @return The nth possible vertex of the polygonal intersection
67
+ * of the y plane and the RGB cube, in linear RGB coordinates, if
68
+ * it exists. If this possible vertex lies outside of the cube,
69
+ * [-1.0, -1.0, -1.0] is returned.
70
+ */
71
+ private static nthVertex;
72
+ /**
73
+ * Finds the segment containing the desired color.
74
+ *
75
+ * @param y The Y value of the color.
76
+ * @param targetHue The hue of the color.
77
+ * @return A list of two sets of linear RGB coordinates, each
78
+ * corresponding to an endpoint of the segment containing the
79
+ * desired color.
80
+ */
81
+ private static bisectToSegment;
82
+ private static midpoint;
83
+ private static criticalPlaneBelow;
84
+ private static criticalPlaneAbove;
85
+ /**
86
+ * Finds a color with the given Y and hue on the boundary of the
87
+ * cube.
88
+ *
89
+ * @param y The Y value of the color.
90
+ * @param targetHue The hue of the color.
91
+ * @return The desired color, in linear RGB coordinates.
92
+ */
93
+ private static bisectToLimit;
94
+ private static inverseChromaticAdaptation;
95
+ /**
96
+ * Finds a color with the given hue, chroma, and Y.
97
+ *
98
+ * @param hueRadians The desired hue in radians.
99
+ * @param chroma The desired chroma.
100
+ * @param y The desired Y.
101
+ * @return The desired color as a hexadecimal integer, if found; 0
102
+ * otherwise.
103
+ */
104
+ private static findResultByJ;
105
+ /**
106
+ * Finds an sRGB color with the given hue, chroma, and L*, if
107
+ * possible.
108
+ *
109
+ * @param hueDegrees The desired hue, in degrees.
110
+ * @param chroma The desired chroma.
111
+ * @param lstar The desired L*.
112
+ * @return A hexadecimal representing the sRGB color. The color
113
+ * has sufficiently close hue, chroma, and L* to the desired
114
+ * values, if possible; otherwise, the hue and L* will be
115
+ * sufficiently close, and chroma will be maximized.
116
+ */
117
+ static solveToInt(hueDegrees: number, chroma: number, lstar: number): number;
118
+ /**
119
+ * Finds an sRGB color with the given hue, chroma, and L*, if
120
+ * possible.
121
+ *
122
+ * @param hueDegrees The desired hue, in degrees.
123
+ * @param chroma The desired chroma.
124
+ * @param lstar The desired L*.
125
+ * @return An CAM16 object representing the sRGB color. The color
126
+ * has sufficiently close hue, chroma, and L* to the desired
127
+ * values, if possible; otherwise, the hue and L* will be
128
+ * sufficiently close, and chroma will be maximized.
129
+ */
130
+ static solveToCam(hueDegrees: number, chroma: number, lstar: number): Cam16;
131
+ }
@@ -1,20 +1,5 @@
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';
1
+ import { ViewingConditions } from './viewing-conditions';
2
+
18
3
  /**
19
4
  * HCT, hue, chroma, and tone. A color system that provides a perceptually
20
5
  * accurate color measurement system that can also accurately render what colors
@@ -0,0 +1,58 @@
1
+ /**
2
+ * In traditional color spaces, a color can be identified solely by the
3
+ * observer's measurement of the color. Color appearance models such as CAM16
4
+ * also use information about the environment where the color was
5
+ * observed, known as the viewing conditions.
6
+ *
7
+ * For example, white under the traditional assumption of a midday sun white
8
+ * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,
9
+ * hue 203, chroma 3, lightness 100)
10
+ *
11
+ * This class caches intermediate values of the CAM16 conversion process that
12
+ * depend only on viewing conditions, enabling speed ups.
13
+ */
14
+ export declare class ViewingConditions {
15
+ n: number;
16
+ aw: number;
17
+ nbb: number;
18
+ ncb: number;
19
+ c: number;
20
+ nc: number;
21
+ rgbD: number[];
22
+ fl: number;
23
+ fLRoot: number;
24
+ z: number;
25
+ /** sRGB-like viewing conditions. */
26
+ static DEFAULT: ViewingConditions;
27
+ /**
28
+ * Create ViewingConditions from a simple, physically relevant, set of
29
+ * parameters.
30
+ *
31
+ * @param whitePoint White point, measured in the XYZ color space.
32
+ * default = D65, or sunny day afternoon
33
+ * @param adaptingLuminance The luminance of the adapting field. Informally,
34
+ * how bright it is in the room where the color is viewed. Can be
35
+ * calculated from lux by multiplying lux by 0.0586. default = 11.72,
36
+ * or 200 lux.
37
+ * @param backgroundLstar The lightness of the area surrounding the color.
38
+ * measured by L* in L*a*b*. default = 50.0
39
+ * @param surround A general description of the lighting surrounding the
40
+ * color. 0 is pitch dark, like watching a movie in a theater. 1.0 is a
41
+ * dimly light room, like watching TV at home at night. 2.0 means there
42
+ * is no difference between the lighting on the color and around it.
43
+ * default = 2.0
44
+ * @param discountingIlluminant Whether the eye accounts for the tint of the
45
+ * ambient lighting, such as knowing an apple is still red in green light.
46
+ * default = false, the eye does not perform this process on
47
+ * self-luminous objects like displays.
48
+ */
49
+ static make(whitePoint?: number[], adaptingLuminance?: number, backgroundLstar?: number, surround?: number, discountingIlluminant?: boolean): ViewingConditions;
50
+ /**
51
+ * Parameters are intermediate values of the CAM16 conversion process. Their
52
+ * names are shorthand for technical color science terminology, this class
53
+ * would not benefit from documenting them individually. A brief overview
54
+ * is available in the CAM16 specification, and a complete overview requires
55
+ * a color science textbook, such as Fairchild's Color Appearance Models.
56
+ */
57
+ private constructor();
58
+ }
@@ -1,4 +1,4 @@
1
1
  export declare function isColorValue(value: string): boolean;
2
2
  export declare function isTextColorIsLight(r: number, g: number, b: number): boolean;
3
3
  export * from './const';
4
- export * from "./conversion";
4
+ export * from './conversion';
@@ -0,0 +1,44 @@
1
+ import { TonalPalette } from './tonal-palette';
2
+
3
+ /**
4
+ * Set of colors to generate a [CorePalette] from
5
+ */
6
+ export interface CorePaletteColors {
7
+ primary: number;
8
+ secondary?: number;
9
+ tertiary?: number;
10
+ neutral?: number;
11
+ neutralVariant?: number;
12
+ error?: number;
13
+ }
14
+ /**
15
+ * An intermediate concept between the key color for a UI theme, and a full
16
+ * color scheme. 5 sets of tones are generated, all except one use the same hue
17
+ * as the key color, and all vary in chroma.
18
+ */
19
+ export declare class CorePalette {
20
+ a1: TonalPalette;
21
+ a2: TonalPalette;
22
+ a3: TonalPalette;
23
+ n1: TonalPalette;
24
+ n2: TonalPalette;
25
+ error: TonalPalette;
26
+ /**
27
+ * @param argb ARGB representation of a color
28
+ */
29
+ static of(argb: number): CorePalette;
30
+ /**
31
+ * @param argb ARGB representation of a color
32
+ */
33
+ static contentOf(argb: number): CorePalette;
34
+ /**
35
+ * Create a [CorePalette] from a set of colors
36
+ */
37
+ static fromColors(colors: CorePaletteColors): CorePalette;
38
+ /**
39
+ * Create a content [CorePalette] from a set of colors
40
+ */
41
+ static contentFromColors(colors: CorePaletteColors): CorePalette;
42
+ private static createPaletteFromColors;
43
+ private constructor();
44
+ }
@@ -0,0 +1,40 @@
1
+ import { Hct } from '../hct/hct';
2
+
3
+ /**
4
+ * A convenience class for retrieving colors that are constant in hue and
5
+ * chroma, but vary in tone.
6
+ */
7
+ export declare class TonalPalette {
8
+ readonly hue: number;
9
+ readonly chroma: number;
10
+ readonly keyColor: Hct;
11
+ private readonly cache;
12
+ /**
13
+ * @param argb ARGB representation of a color
14
+ * @return Tones matching that color's hue and chroma.
15
+ */
16
+ static fromInt(argb: number): TonalPalette;
17
+ /**
18
+ * @param hct Hct
19
+ * @return Tones matching that color's hue and chroma.
20
+ */
21
+ static fromHct(hct: Hct): TonalPalette;
22
+ /**
23
+ * @param hue HCT hue
24
+ * @param chroma HCT chroma
25
+ * @return Tones matching hue and chroma.
26
+ */
27
+ static fromHueAndChroma(hue: number, chroma: number): TonalPalette;
28
+ private constructor();
29
+ private static createKeyColor;
30
+ /**
31
+ * @param tone HCT tone, measured from 0 to 100.
32
+ * @return ARGB representation of a color with that tone.
33
+ */
34
+ tone(tone: number): number;
35
+ /**
36
+ * @param tone HCT tone.
37
+ * @return HCT representation of a color with that tone.
38
+ */
39
+ getHct(tone: number): Hct;
40
+ }
@@ -1,4 +1,5 @@
1
1
  import { DateAdapter, DateFormatOptions } from '../types';
2
+
2
3
  export declare class YuyeonDateAdapter implements DateAdapter<Date> {
3
4
  locale: string;
4
5
  formats?: Record<string, DateFormatOptions>;
@@ -1,4 +1,5 @@
1
- import type { DateAdapter, DateFormatOptions } from './types';
1
+ import { DateAdapter, DateFormatOptions } from './types';
2
+
2
3
  export declare const ONE_DAY: number;
3
4
  export declare const YYYY_MM_DD_REGEX: RegExp;
4
5
  export declare const FIRST_SUNDAY: Date;
@@ -1,3 +1,3 @@
1
1
  export * from './built-in';
2
- export { YuyeonDateAdapter } from "./adapters/yuyeon-date-adapter";
2
+ export { YuyeonDateAdapter } from './adapters/yuyeon-date-adapter';
3
3
  export declare function createDateAdapter(): void;
@@ -0,0 +1,4 @@
1
+ export declare function simpleBraceParse(input: string): {
2
+ type: string;
3
+ content: string;
4
+ }[];
@@ -1,6 +1,7 @@
1
- import type { ComputedGetter } from 'vue';
1
+ import { ComputedGetter } from 'vue';
2
+
2
3
  /**
3
4
  * For Destructuring assignment
4
5
  * @param getter
5
6
  */
6
- export declare function $computed<T extends object>(getter: ComputedGetter<T>): import("vue").ToRefs<T>;
7
+ export declare function $computed<T extends object>(getter: ComputedGetter<T>): import('vue').ToRefs<T>;
@@ -2,3 +2,7 @@ export declare function camelToPascal(str: string): string;
2
2
  export declare function toKebabCase(str: string, from?: 'camel' | 'pascal'): string;
3
3
  export declare function kebabToCamel(str: string): string;
4
4
  export declare function randomCharOne(str: string): string;
5
+ export declare function simpleBraceParse(input: string): {
6
+ type: string;
7
+ content: string;
8
+ }[];
@@ -1,13 +1,14 @@
1
1
  import { ComponentInternalInstance } from '@vue/runtime-core';
2
- import type { IfAny } from '@vue/shared';
3
- import type { ComponentObjectPropsOptions, ComponentPublicInstance, ExtractPropTypes, InjectionKey, Prop, PropType, VNode, VNodeChild } from 'vue';
2
+ import { IfAny } from '@vue/shared';
3
+ import { ComponentObjectPropsOptions, ComponentPublicInstance, ExtractPropTypes, InjectionKey, Prop, PropType, VNode, VNodeChild } from 'vue';
4
+
4
5
  export declare function getSlot(vm: ComponentPublicInstance | any, name?: string, data?: any | (() => any), optional?: boolean): VNode[] | undefined;
5
6
  export declare function getUid(): number | undefined;
6
7
  export declare function chooseProps<PropsOptions extends ComponentObjectPropsOptions>(props: any, target: PropsOptions): ExtractPropTypes<PropsOptions>;
7
8
  export declare function bindClasses(classes: string | string[] | Record<string, any> | undefined): Record<string, boolean>;
8
9
  export declare function getHtmlElement<N extends object | undefined>(node: N): Exclude<N, ComponentPublicInstance> | HTMLElement;
9
10
  export declare function findChildrenWithProvide(key: InjectionKey<any> | symbol, vnode?: VNodeChild): ComponentInternalInstance[];
10
- export declare function propsFactory<PropsOptions extends ComponentObjectPropsOptions>(props: PropsOptions, source: string): <Defaults extends PartialKeys<PropsOptions> = {}>(defaults?: Defaults | undefined) => OverwrittenPropOptions<PropsOptions, Defaults>;
11
+ export declare function propsFactory<PropsOptions extends ComponentObjectPropsOptions>(props: PropsOptions, source: string): <Defaults extends PartialKeys<PropsOptions> = {}>(defaults?: Defaults) => OverwrittenPropOptions<PropsOptions, Defaults>;
11
12
  export declare function hasEventProp(props: Record<string, any>, type: string): boolean;
12
13
  type OverwrittenPropOptions<T extends ComponentObjectPropsOptions, D extends PartialKeys<T>> = {
13
14
  [P in keyof T]-?: unknown extends D[P] ? T[P] : T[P] extends Record<string, unknown> ? Omit<T[P], 'type' | 'default'> & {