@liner-fe/prism 2.2.2 → 2.3.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 (192) hide show
  1. package/lib/illust.d.ts +2 -2
  2. package/lib/illust.js +1 -1
  3. package/lib/illust.js.map +1 -1
  4. package/lib/static/illust/dark/hero-gift.webp +0 -0
  5. package/lib/static/illust/dark/hero-search.webp +0 -0
  6. package/lib/static/illust/dark/mini-documents-2.webp +0 -0
  7. package/lib/static/illust/dark/mini-documents-3.webp +0 -0
  8. package/lib/static/illust/dark/mini-documents-4.webp +0 -0
  9. package/lib/static/illust/dark/mini-documents-5.webp +0 -0
  10. package/lib/static/illust/dark/mini-documents.webp +0 -0
  11. package/lib/static/illust/dark/mini-egg.webp +0 -0
  12. package/lib/static/illust/dark/mini-gift.webp +0 -0
  13. package/lib/static/illust/dark/mini-graduation_hat.webp +0 -0
  14. package/lib/static/illust/dark/mini-search.webp +0 -0
  15. package/lib/static/illust/dark/mini-ticket.webp +0 -0
  16. package/lib/static/illust/dark/mini-window.webp +0 -0
  17. package/lib/static/illust/dark/spot-catch_star.webp +0 -0
  18. package/lib/static/illust/dark/spot-clap.webp +0 -0
  19. package/lib/static/illust/dark/spot-empty.webp +0 -0
  20. package/lib/static/illust/dark/spot-no_search.webp +0 -0
  21. package/lib/static/illust/dark/spot-search-2.webp +0 -0
  22. package/lib/static/illust/dark/spot-search-3.webp +0 -0
  23. package/lib/static/illust/dark/spot-search-4.webp +0 -0
  24. package/lib/static/illust/dark/spot-search-5.webp +0 -0
  25. package/lib/static/illust/dark/spot-search.webp +0 -0
  26. package/lib/static/illust/dark/spot-write.webp +0 -0
  27. package/lib/static/illust/light/hero-gift.webp +0 -0
  28. package/lib/static/illust/light/hero-search.webp +0 -0
  29. package/lib/static/illust/light/mini-documents-2.webp +0 -0
  30. package/lib/static/illust/light/mini-documents-3.webp +0 -0
  31. package/lib/static/illust/light/mini-documents-4.webp +0 -0
  32. package/lib/static/illust/light/mini-documents-5.webp +0 -0
  33. package/lib/static/illust/light/mini-documents.webp +0 -0
  34. package/lib/static/illust/light/mini-egg.webp +0 -0
  35. package/lib/static/illust/light/mini-gift.webp +0 -0
  36. package/lib/static/illust/light/mini-graduation_hat.webp +0 -0
  37. package/lib/static/illust/light/mini-search.webp +0 -0
  38. package/lib/static/illust/light/mini-ticket.webp +0 -0
  39. package/lib/static/illust/light/mini-window.webp +0 -0
  40. package/lib/static/illust/light/spot-catch_star.webp +0 -0
  41. package/lib/static/illust/light/spot-clap.webp +0 -0
  42. package/lib/static/illust/light/spot-empty.webp +0 -0
  43. package/lib/static/illust/light/spot-no_search.webp +0 -0
  44. package/lib/static/illust/light/spot-search-2.webp +0 -0
  45. package/lib/static/illust/light/spot-search-3.webp +0 -0
  46. package/lib/static/illust/light/spot-search-4.webp +0 -0
  47. package/lib/static/illust/light/spot-search-5.webp +0 -0
  48. package/lib/static/illust/light/spot-search.webp +0 -0
  49. package/lib/static/illust/light/spot-write.webp +0 -0
  50. package/package.json +2 -2
  51. package/lib/static/illust/dark/decoration-airplane-1_1.webp +0 -0
  52. package/lib/static/illust/dark/decoration-bulb-1_1.webp +0 -0
  53. package/lib/static/illust/dark/decoration-car-1_1.webp +0 -0
  54. package/lib/static/illust/dark/decoration-flag-1_1.webp +0 -0
  55. package/lib/static/illust/dark/decoration-hourglass-1_1.webp +0 -0
  56. package/lib/static/illust/dark/decoration-rocket-1_1.webp +0 -0
  57. package/lib/static/illust/dark/decoration-star_01-1_1.webp +0 -0
  58. package/lib/static/illust/dark/decoration-star_02-1_1.webp +0 -0
  59. package/lib/static/illust/dark/decoration-star_03-1_1.webp +0 -0
  60. package/lib/static/illust/dark/decoration-star_04-1_1.webp +0 -0
  61. package/lib/static/illust/dark/decoration-star_05-1_1.webp +0 -0
  62. package/lib/static/illust/dark/decoration-star_06-1_1.webp +0 -0
  63. package/lib/static/illust/dark/decoration-star_07-1_1.webp +0 -0
  64. package/lib/static/illust/dark/decoration-star_08-1_1.webp +0 -0
  65. package/lib/static/illust/dark/decoration-star_09-1_1.webp +0 -0
  66. package/lib/static/illust/dark/decoration-star_10-1_1.webp +0 -0
  67. package/lib/static/illust/dark/decoration-star_11-1_1.webp +0 -0
  68. package/lib/static/illust/dark/object-bomb-1_1.webp +0 -0
  69. package/lib/static/illust/dark/object-brain-1_1.webp +0 -0
  70. package/lib/static/illust/dark/object-clap-1_1.webp +0 -0
  71. package/lib/static/illust/dark/object-documents_02-1_1.webp +0 -0
  72. package/lib/static/illust/dark/object-empty_box-1_1.webp +0 -0
  73. package/lib/static/illust/dark/object-empty_box-4_3.webp +0 -0
  74. package/lib/static/illust/dark/object-folder_01-1_1.webp +0 -0
  75. package/lib/static/illust/dark/object-folder_02-1_1.webp +0 -0
  76. package/lib/static/illust/dark/object-free_ticket-1_1.webp +0 -0
  77. package/lib/static/illust/dark/object-gift-1_1.webp +0 -0
  78. package/lib/static/illust/dark/object-give_gift-1_1.webp +0 -0
  79. package/lib/static/illust/dark/object-graduation_cap_pencil-4_3.webp +0 -0
  80. package/lib/static/illust/dark/object-lock-4_3.webp +0 -0
  81. package/lib/static/illust/dark/object-magnifying_glass-1_1.webp +0 -0
  82. package/lib/static/illust/dark/object-magnifying_glass-4_3.webp +0 -0
  83. package/lib/static/illust/dark/object-megaphone-1_1.webp +0 -0
  84. package/lib/static/illust/dark/object-paper-1_1.webp +0 -0
  85. package/lib/static/illust/dark/object-pencil_paper-16_9.webp +0 -0
  86. package/lib/static/illust/dark/object-puzzle-4_3.webp +0 -0
  87. package/lib/static/illust/dark/object-smoke-16_9.webp +0 -0
  88. package/lib/static/illust/dark/object_documents_01-1_1.webp +0 -0
  89. package/lib/static/illust/dark/object_find_man-1_1.webp +0 -0
  90. package/lib/static/illust/dark/person-bye-4_3.webp +0 -0
  91. package/lib/static/illust/dark/person-holding_a_book-1_1.webp +0 -0
  92. package/lib/static/illust/dark/person-introduce-1_1.webp +0 -0
  93. package/lib/static/illust/dark/person-introduce-pro-1_1.webp +0 -0
  94. package/lib/static/illust/dark/person-make_profile-1_1.webp +0 -0
  95. package/lib/static/illust/dark/person-raining-1_1.webp +0 -0
  96. package/lib/static/illust/dark/person-searching-16_9.webp +0 -0
  97. package/lib/static/illust/dark/person-searching_01-1_1.webp +0 -0
  98. package/lib/static/illust/dark/person-searching_01-4_3.webp +0 -0
  99. package/lib/static/illust/dark/person-searching_02-1_1.webp +0 -0
  100. package/lib/static/illust/dark/person-space_in_work-4_3.webp +0 -0
  101. package/lib/static/illust/dark/person-standing_with_a_star-16_9.webp +0 -0
  102. package/lib/static/illust/dark/person-time_out_01-1_1.webp +0 -0
  103. package/lib/static/illust/dark/person-time_out_02-1_1.webp +0 -0
  104. package/lib/static/illust/dark/person-time_out_03-1_1.webp +0 -0
  105. package/lib/static/illust/dark/person-time_out_04-1_1.webp +0 -0
  106. package/lib/static/illust/dark/person-time_out_05-1_1.webp +0 -0
  107. package/lib/static/illust/dark/person-working_01-4_3.webp +0 -0
  108. package/lib/static/illust/dark/person-worried-1_1.webp +0 -0
  109. package/lib/static/illust/dark/person-worried_01-4_3.webp +0 -0
  110. package/lib/static/illust/dark/person-worried_02-4_3.webp +0 -0
  111. package/lib/static/illust/dark/person-worried_03-4_3.webp +0 -0
  112. package/lib/static/illust/dark/person-worried_04-4_3.webp +0 -0
  113. package/lib/static/illust/dark/person-writing_01-1_1.webp +0 -0
  114. package/lib/static/illust/light/decoration-airplane-1_1.webp +0 -0
  115. package/lib/static/illust/light/decoration-bulb-1_1.webp +0 -0
  116. package/lib/static/illust/light/decoration-car-1_1.webp +0 -0
  117. package/lib/static/illust/light/decoration-coffee-1_1.webp +0 -0
  118. package/lib/static/illust/light/decoration-english-1_1.webp +0 -0
  119. package/lib/static/illust/light/decoration-flag-1_1.webp +0 -0
  120. package/lib/static/illust/light/decoration-hourglass-1_1.webp +0 -0
  121. package/lib/static/illust/light/decoration-money-1_1.webp +0 -0
  122. package/lib/static/illust/light/decoration-palm-1_1.webp +0 -0
  123. package/lib/static/illust/light/decoration-rocket-1_1.webp +0 -0
  124. package/lib/static/illust/light/decoration-shake_hands-1_1.webp +0 -0
  125. package/lib/static/illust/light/decoration-star_01-1_1.webp +0 -0
  126. package/lib/static/illust/light/decoration-star_02-1_1.webp +0 -0
  127. package/lib/static/illust/light/decoration-star_03-1_1.webp +0 -0
  128. package/lib/static/illust/light/decoration-star_04-1_1.webp +0 -0
  129. package/lib/static/illust/light/decoration-star_05-1_1.webp +0 -0
  130. package/lib/static/illust/light/decoration-star_06-1_1.webp +0 -0
  131. package/lib/static/illust/light/decoration-star_07-1_1.webp +0 -0
  132. package/lib/static/illust/light/decoration-star_08-1_1.webp +0 -0
  133. package/lib/static/illust/light/decoration-star_09-1_1.webp +0 -0
  134. package/lib/static/illust/light/decoration-star_10-1_1.webp +0 -0
  135. package/lib/static/illust/light/decoration-star_11-1_1.webp +0 -0
  136. package/lib/static/illust/light/decoration-tennis-1_1.webp +0 -0
  137. package/lib/static/illust/light/object-bomb-1_1.webp +0 -0
  138. package/lib/static/illust/light/object-book_pencil-4_3.webp +0 -0
  139. package/lib/static/illust/light/object-brain-1_1.webp +0 -0
  140. package/lib/static/illust/light/object-clap-1_1.webp +0 -0
  141. package/lib/static/illust/light/object-documents_02-1_1.webp +0 -0
  142. package/lib/static/illust/light/object-empty_box-1_1.webp +0 -0
  143. package/lib/static/illust/light/object-empty_box-4_3.webp +0 -0
  144. package/lib/static/illust/light/object-feather_pen-1_1.webp +0 -0
  145. package/lib/static/illust/light/object-folder_01-1_1.webp +0 -0
  146. package/lib/static/illust/light/object-folder_02-1_1.webp +0 -0
  147. package/lib/static/illust/light/object-free_ticket-1_1.webp +0 -0
  148. package/lib/static/illust/light/object-gift-1_1.webp +0 -0
  149. package/lib/static/illust/light/object-give_gift-1_1.webp +0 -0
  150. package/lib/static/illust/light/object-graduation_cap_pencil-4_3.webp +0 -0
  151. package/lib/static/illust/light/object-lock-4_3.webp +0 -0
  152. package/lib/static/illust/light/object-magnifying_glass-1_1.webp +0 -0
  153. package/lib/static/illust/light/object-magnifying_glass-4_3.webp +0 -0
  154. package/lib/static/illust/light/object-megaphone-1_1.webp +0 -0
  155. package/lib/static/illust/light/object-paper-1_1.webp +0 -0
  156. package/lib/static/illust/light/object-pencil_paper-16_9.webp +0 -0
  157. package/lib/static/illust/light/object-puzzle-4_3.webp +0 -0
  158. package/lib/static/illust/light/object-smoke-16_9.webp +0 -0
  159. package/lib/static/illust/light/object-university_01-1_1.webp +0 -0
  160. package/lib/static/illust/light/object-university_02-1_1.webp +0 -0
  161. package/lib/static/illust/light/object_documents_01-1_1.webp +0 -0
  162. package/lib/static/illust/light/object_find_man-1_1.webp +0 -0
  163. package/lib/static/illust/light/person-ai_writing-1_1.webp +0 -0
  164. package/lib/static/illust/light/person-bye-4_3.webp +0 -0
  165. package/lib/static/illust/light/person-cheerup-16_9.webp +0 -0
  166. package/lib/static/illust/light/person-cheerup-4_3.webp +0 -0
  167. package/lib/static/illust/light/person-holding_a_book-1_1.webp +0 -0
  168. package/lib/static/illust/light/person-introduce-1_1.webp +0 -0
  169. package/lib/static/illust/light/person-introduce-pro-1_1.webp +0 -0
  170. package/lib/static/illust/light/person-make_profile-1_1.webp +0 -0
  171. package/lib/static/illust/light/person-raining-1_1.webp +0 -0
  172. package/lib/static/illust/light/person-searching-16_9.webp +0 -0
  173. package/lib/static/illust/light/person-searching_01-1_1.webp +0 -0
  174. package/lib/static/illust/light/person-searching_01-4_3.webp +0 -0
  175. package/lib/static/illust/light/person-searching_02-1_1.webp +0 -0
  176. package/lib/static/illust/light/person-space_in_work-4_3.webp +0 -0
  177. package/lib/static/illust/light/person-standing_with_a_star-16_9.webp +0 -0
  178. package/lib/static/illust/light/person-time_out_01-1_1.webp +0 -0
  179. package/lib/static/illust/light/person-time_out_02-1_1.webp +0 -0
  180. package/lib/static/illust/light/person-time_out_03-1_1.webp +0 -0
  181. package/lib/static/illust/light/person-time_out_04-1_1.webp +0 -0
  182. package/lib/static/illust/light/person-time_out_05-1_1.webp +0 -0
  183. package/lib/static/illust/light/person-understand-1_1.webp +0 -0
  184. package/lib/static/illust/light/person-working_01-4_3.webp +0 -0
  185. package/lib/static/illust/light/person-working_02-4_3.webp +0 -0
  186. package/lib/static/illust/light/person-worried-1_1.webp +0 -0
  187. package/lib/static/illust/light/person-worried_01-4_3.webp +0 -0
  188. package/lib/static/illust/light/person-worried_02-4_3.webp +0 -0
  189. package/lib/static/illust/light/person-worried_03-4_3.webp +0 -0
  190. package/lib/static/illust/light/person-worried_04-4_3.webp +0 -0
  191. package/lib/static/illust/light/person-writing_01-1_1.webp +0 -0
  192. package/lib/static/illust/light/person-writing_02-1_1.webp +0 -0
package/lib/illust.d.ts CHANGED
@@ -2,8 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ImageProps } from 'next/image';
3
3
  import { Property } from 'csstype';
4
4
 
5
- type LightIllustType = "decoration-airplane-1_1" | "decoration-bulb-1_1" | "decoration-car-1_1" | "decoration-coffee-1_1" | "decoration-english-1_1" | "decoration-flag-1_1" | "decoration-hourglass-1_1" | "decoration-money-1_1" | "decoration-palm-1_1" | "decoration-rocket-1_1" | "decoration-shake_hands-1_1" | "decoration-star_01-1_1" | "decoration-star_02-1_1" | "decoration-star_03-1_1" | "decoration-star_04-1_1" | "decoration-star_05-1_1" | "decoration-star_06-1_1" | "decoration-star_07-1_1" | "decoration-star_08-1_1" | "decoration-star_09-1_1" | "decoration-star_10-1_1" | "decoration-star_11-1_1" | "decoration-tennis-1_1" | "object-bomb-1_1" | "object-book_pencil-4_3" | "object-brain-1_1" | "object-clap-1_1" | "object-documents_02-1_1" | "object-empty_box-1_1" | "object-empty_box-4_3" | "object-feather_pen-1_1" | "object-folder_01-1_1" | "object-folder_02-1_1" | "object-free_ticket-1_1" | "object-gift-1_1" | "object-give_gift-1_1" | "object-graduation_cap_pencil-4_3" | "object-lock-4_3" | "object-magnifying_glass-1_1" | "object-magnifying_glass-4_3" | "object-megaphone-1_1" | "object-paper-1_1" | "object-pencil_paper-16_9" | "object-puzzle-4_3" | "object-smoke-16_9" | "object-university_01-1_1" | "object-university_02-1_1" | "object_documents_01-1_1" | "object_find_man-1_1" | "person-ai_writing-1_1" | "person-bye-4_3" | "person-cheerup-16_9" | "person-cheerup-4_3" | "person-holding_a_book-1_1" | "person-introduce-1_1" | "person-introduce-pro-1_1" | "person-make_profile-1_1" | "person-raining-1_1" | "person-searching-16_9" | "person-searching_01-1_1" | "person-searching_01-4_3" | "person-searching_02-1_1" | "person-space_in_work-4_3" | "person-standing_with_a_star-16_9" | "person-time_out_01-1_1" | "person-time_out_02-1_1" | "person-time_out_03-1_1" | "person-time_out_04-1_1" | "person-time_out_05-1_1" | "person-understand-1_1" | "person-working_01-4_3" | "person-working_02-4_3" | "person-worried-1_1" | "person-worried_01-4_3" | "person-worried_02-4_3" | "person-worried_03-4_3" | "person-worried_04-4_3" | "person-writing_01-1_1" | "person-writing_02-1_1";
6
- type DarkIllustType = "decoration-airplane-1_1" | "decoration-bulb-1_1" | "decoration-car-1_1" | "decoration-flag-1_1" | "decoration-hourglass-1_1" | "decoration-rocket-1_1" | "decoration-star_01-1_1" | "decoration-star_02-1_1" | "decoration-star_03-1_1" | "decoration-star_04-1_1" | "decoration-star_05-1_1" | "decoration-star_06-1_1" | "decoration-star_07-1_1" | "decoration-star_08-1_1" | "decoration-star_09-1_1" | "decoration-star_10-1_1" | "decoration-star_11-1_1" | "object-bomb-1_1" | "object-brain-1_1" | "object-clap-1_1" | "object-documents_02-1_1" | "object-empty_box-1_1" | "object-empty_box-4_3" | "object-folder_01-1_1" | "object-folder_02-1_1" | "object-free_ticket-1_1" | "object-gift-1_1" | "object-give_gift-1_1" | "object-graduation_cap_pencil-4_3" | "object-lock-4_3" | "object-magnifying_glass-1_1" | "object-magnifying_glass-4_3" | "object-megaphone-1_1" | "object-paper-1_1" | "object-pencil_paper-16_9" | "object-puzzle-4_3" | "object-smoke-16_9" | "object_documents_01-1_1" | "object_find_man-1_1" | "person-bye-4_3" | "person-holding_a_book-1_1" | "person-introduce-1_1" | "person-introduce-pro-1_1" | "person-make_profile-1_1" | "person-raining-1_1" | "person-searching-16_9" | "person-searching_01-1_1" | "person-searching_01-4_3" | "person-searching_02-1_1" | "person-space_in_work-4_3" | "person-standing_with_a_star-16_9" | "person-time_out_01-1_1" | "person-time_out_02-1_1" | "person-time_out_03-1_1" | "person-time_out_04-1_1" | "person-time_out_05-1_1" | "person-working_01-4_3" | "person-worried-1_1" | "person-worried_01-4_3" | "person-worried_02-4_3" | "person-worried_03-4_3" | "person-worried_04-4_3" | "person-writing_01-1_1";
5
+ type LightIllustType = "hero-gift" | "hero-search" | "mini-documents-2" | "mini-documents-3" | "mini-documents-4" | "mini-documents-5" | "mini-documents" | "mini-egg" | "mini-gift" | "mini-graduation_hat" | "mini-search" | "mini-ticket" | "mini-window" | "spot-catch_star" | "spot-clap" | "spot-empty" | "spot-no_search" | "spot-search-2" | "spot-search-3" | "spot-search-4" | "spot-search-5" | "spot-search" | "spot-write";
6
+ type DarkIllustType = "hero-gift" | "hero-search" | "mini-documents-2" | "mini-documents-3" | "mini-documents-4" | "mini-documents-5" | "mini-documents" | "mini-egg" | "mini-gift" | "mini-graduation_hat" | "mini-search" | "mini-ticket" | "mini-window" | "spot-catch_star" | "spot-clap" | "spot-empty" | "spot-no_search" | "spot-search-2" | "spot-search-3" | "spot-search-4" | "spot-search-5" | "spot-search" | "spot-write";
7
7
  type IllustType = DarkIllustType | LightIllustType;
8
8
 
9
9
  interface Source<T extends false | true = true> {
package/lib/illust.js CHANGED
@@ -107,8 +107,8 @@ var Illust = /* @__PURE__ */ __name((props) => {
107
107
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: css, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
108
  import_image.default,
109
109
  {
110
- alt: currentSourceByColorTheme,
111
110
  ...props,
111
+ alt: currentSourceByColorTheme,
112
112
  src: source,
113
113
  width,
114
114
  height: aspectRatio ? width / aspectRatio : width
package/lib/illust.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/illust.ts","../src/constants/illust/size.ts","../src/components/Illust/index.tsx","../src/constants/illust/path.ts","../src/hooks/useIllust.ts","../src/utils/illust.ts"],"sourcesContent":["export * from './components/Illust';\nexport * from './utils/illust';\n","import { IllustType } from '@/types/illust';\n\nconst ratio = { '16:9': { width: 1344, height: 756 }, '4:3': { width: 1008, height: 756 } };\n\nexport const illustSize: Partial<Record<IllustType, { width: number; height: number }>> = {\n 'object-pencil_paper-16_9': ratio['16:9'],\n 'object-smoke-16_9': ratio['16:9'],\n 'person-standing_with_a_star-16_9': ratio['16:9'],\n 'person-searching-16_9': ratio['16:9'],\n 'person-cheerup-16_9': ratio['16:9'],\n 'object-graduation_cap_pencil-4_3': ratio['4:3'],\n 'object-book_pencil-4_3': ratio['4:3'],\n 'object-puzzle-4_3': ratio['4:3'],\n 'object-magnifying_glass-4_3': ratio['4:3'],\n 'object-lock-4_3': ratio['4:3'],\n 'object-empty_box-4_3': ratio['4:3'],\n 'person-working_01-4_3': ratio['4:3'],\n 'person-searching_01-4_3': ratio['4:3'],\n 'person-worried_01-4_3': ratio['4:3'],\n 'person-worried_02-4_3': ratio['4:3'],\n 'person-worried_03-4_3': ratio['4:3'],\n 'person-worried_04-4_3': ratio['4:3'],\n 'person-working_02-4_3': ratio['4:3'],\n 'person-bye-4_3': ratio['4:3'],\n 'person-space_in_work-4_3': ratio['4:3'],\n 'person-cheerup-4_3': ratio['4:3'],\n};\n","import { illustSize } from '@/constants/illust/size';\nimport Image, { ImageProps } from 'next/image';\nimport { CSSProperties } from 'react';\nimport { useIllust } from '@/hooks/useIllust';\nimport { IllustType } from '@/types/illust';\nimport { Property } from 'csstype';\n\nexport interface Source<T extends false | true = true> {\n name: IllustType;\n inverse?: T;\n}\n\ninterface IProps extends Omit<ImageProps, 'alt' | 'width' | 'height' | 'fill' | 'src'> {\n width: number;\n src: { light: Source<false>; dark?: Source };\n margin?: Property.Margin<string>;\n}\n\nexport const Illust = (props: IProps) => {\n const { src, width, margin } = props;\n const { sourcePrefix, currentSourceByColorTheme } = useIllust({\n darkSrc: src.dark,\n src: src.light,\n });\n\n const aspectRatio = illustSize[currentSourceByColorTheme]\n ? illustSize[currentSourceByColorTheme].width / illustSize[currentSourceByColorTheme].height\n : undefined;\n\n const css: CSSProperties = {\n width,\n margin,\n };\n\n const source = `${sourcePrefix}${currentSourceByColorTheme}.webp`;\n\n return (\n <div style={css}>\n <Image\n alt={currentSourceByColorTheme}\n {...props}\n src={source}\n width={width}\n height={aspectRatio ? width / aspectRatio : width}\n />\n </div>\n );\n};\n","export const ILLUST = '/illust';\n\nexport const DARK_MODE_ILLUST_PREFIX = `${ILLUST}/dark/`;\nexport const LIGHT_MODE_ILLUST_PREFIX = `${ILLUST}/light/`;\n","import { Source } from '@/components/Illust';\nimport { DARK_MODE_ILLUST_PREFIX, LIGHT_MODE_ILLUST_PREFIX } from '@/constants/illust/path';\nimport { useDarkTheme } from '@liner-fe/design-token';\n\nexport const useIllust = ({ darkSrc, src }: { darkSrc?: Source; src: Source<false> }) => {\n const { isDarkMode } = useDarkTheme();\n\n const sourcePrefix = (() => {\n if (isDarkMode) {\n if (darkSrc?.inverse) {\n return LIGHT_MODE_ILLUST_PREFIX;\n }\n\n return DARK_MODE_ILLUST_PREFIX;\n }\n\n if (src.inverse === false) {\n return DARK_MODE_ILLUST_PREFIX;\n }\n\n return LIGHT_MODE_ILLUST_PREFIX;\n })();\n\n const currentSourceByColorTheme = isDarkMode ? darkSrc?.name || src.name : src.name;\n\n return { sourcePrefix, currentSourceByColorTheme, isDarkMode };\n};\n","import { ILLUST } from '@/constants/illust/path';\nimport { IllustType } from '@/types/illust';\n\nexport const prefetchIllust = async ({ name, isDark = false }: { name: IllustType; isDark?: boolean }) =>\n await fetch(`${ILLUST}${isDark ? '/dark/' : '/light/'}${name}.webp`);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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zB,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT,GAAG;AAEH,QAAM,4BAA4B,aAAa,SAAS,QAAQ,IAAI,OAAO,IAAI;AAE/E,SAAO,EAAE,cAAc,2BAA2B,WAAW;AAC/D,GAtByB;;;AFkCnB;AApBC,IAAM,SAAS,wBAAC,UAAkB;AACvC,QAAM,EAAE,KAAK,OAAO,OAAO,IAAI;AAC/B,QAAM,EAAE,cAAc,0BAA0B,IAAI,UAAU;AAAA,IAC5D,SAAS,IAAI;AAAA,IACb,KAAK,IAAI;AAAA,EACX,CAAC;AAED,QAAM,cAAc,WAAW,yBAAyB,IACpD,WAAW,yBAAyB,EAAE,QAAQ,WAAW,yBAAyB,EAAE,SACpF;AAEJ,QAAM,MAAqB;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAAS,GAAG,YAAY,GAAG,yBAAyB;AAE1D,SACE,4CAAC,SAAI,OAAO,KACV;AAAA,IAAC,aAAAA;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACJ,GAAG;AAAA,MACJ,KAAK;AAAA,MACL;AAAA,MACA,QAAQ,cAAc,QAAQ,cAAc;AAAA;AAAA,EAC9C,GACF;AAEJ,GA7BsB;;;AGff,IAAM,iBAAiB,8BAAO,EAAE,MAAM,SAAS,MAAM,MAC1D,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS,WAAW,SAAS,GAAG,IAAI,OAAO,GADvC;","names":["Image"]}
1
+ {"version":3,"sources":["../src/illust.ts","../src/constants/illust/size.ts","../src/components/Illust/index.tsx","../src/constants/illust/path.ts","../src/hooks/useIllust.ts","../src/utils/illust.ts"],"sourcesContent":["export * from './components/Illust';\nexport * from './utils/illust';\n","import { IllustType } from '@/types/illust';\n\nconst ratio = { '16:9': { width: 1344, height: 756 }, '4:3': { width: 1008, height: 756 } };\n\nexport const illustSize: Partial<Record<IllustType, { width: number; height: number }>> = {\n 'object-pencil_paper-16_9': ratio['16:9'],\n 'object-smoke-16_9': ratio['16:9'],\n 'person-standing_with_a_star-16_9': ratio['16:9'],\n 'person-searching-16_9': ratio['16:9'],\n 'person-cheerup-16_9': ratio['16:9'],\n 'object-graduation_cap_pencil-4_3': ratio['4:3'],\n 'object-book_pencil-4_3': ratio['4:3'],\n 'object-puzzle-4_3': ratio['4:3'],\n 'object-magnifying_glass-4_3': ratio['4:3'],\n 'object-lock-4_3': ratio['4:3'],\n 'object-empty_box-4_3': ratio['4:3'],\n 'person-working_01-4_3': ratio['4:3'],\n 'person-searching_01-4_3': ratio['4:3'],\n 'person-worried_01-4_3': ratio['4:3'],\n 'person-worried_02-4_3': ratio['4:3'],\n 'person-worried_03-4_3': ratio['4:3'],\n 'person-worried_04-4_3': ratio['4:3'],\n 'person-working_02-4_3': ratio['4:3'],\n 'person-bye-4_3': ratio['4:3'],\n 'person-space_in_work-4_3': ratio['4:3'],\n 'person-cheerup-4_3': ratio['4:3'],\n};\n","import { illustSize } from '@/constants/illust/size';\nimport Image, { ImageProps } from 'next/image';\nimport { CSSProperties } from 'react';\nimport { useIllust } from '@/hooks/useIllust';\nimport { IllustType } from '@/types/illust';\nimport { Property } from 'csstype';\n\nexport interface Source<T extends false | true = true> {\n name: IllustType;\n inverse?: T;\n}\n\ninterface IProps extends Omit<ImageProps, 'alt' | 'width' | 'height' | 'fill' | 'src'> {\n width: number;\n src: { light: Source<false>; dark?: Source };\n margin?: Property.Margin<string>;\n}\n\nexport const Illust = (props: IProps) => {\n const { src, width, margin } = props;\n const { sourcePrefix, currentSourceByColorTheme } = useIllust({\n darkSrc: src.dark,\n src: src.light,\n });\n\n const aspectRatio = illustSize[currentSourceByColorTheme]\n ? illustSize[currentSourceByColorTheme].width / illustSize[currentSourceByColorTheme].height\n : undefined;\n\n const css: CSSProperties = {\n width,\n margin,\n };\n\n const source = `${sourcePrefix}${currentSourceByColorTheme}.webp`;\n\n return (\n <div style={css}>\n <Image\n {...props}\n alt={currentSourceByColorTheme}\n src={source}\n width={width}\n height={aspectRatio ? width / aspectRatio : width}\n />\n </div>\n );\n};\n","export const ILLUST = '/illust';\n\nexport const DARK_MODE_ILLUST_PREFIX = `${ILLUST}/dark/`;\nexport const LIGHT_MODE_ILLUST_PREFIX = `${ILLUST}/light/`;\n","import { Source } from '@/components/Illust';\nimport { DARK_MODE_ILLUST_PREFIX, LIGHT_MODE_ILLUST_PREFIX } from '@/constants/illust/path';\nimport { useDarkTheme } from '@liner-fe/design-token';\n\nexport const useIllust = ({ darkSrc, src }: { darkSrc?: Source; src: Source<false> }) => {\n const { isDarkMode } = useDarkTheme();\n\n const sourcePrefix = (() => {\n if (isDarkMode) {\n if (darkSrc?.inverse) {\n return LIGHT_MODE_ILLUST_PREFIX;\n }\n\n return DARK_MODE_ILLUST_PREFIX;\n }\n\n if (src.inverse === false) {\n return DARK_MODE_ILLUST_PREFIX;\n }\n\n return LIGHT_MODE_ILLUST_PREFIX;\n })();\n\n const currentSourceByColorTheme = isDarkMode ? darkSrc?.name || src.name : src.name;\n\n return { sourcePrefix, currentSourceByColorTheme, isDarkMode };\n};\n","import { ILLUST } from '@/constants/illust/path';\nimport { IllustType } from '@/types/illust';\n\nexport const prefetchIllust = async ({ name, isDark = false }: { name: IllustType; isDark?: boolean }) =>\n await fetch(`${ILLUST}${isDark ? '/dark/' : '/light/'}${name}.webp`);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,IAAM,QAAQ,EAAE,QAAQ,EAAE,OAAO,MAAM,QAAQ,IAAI,GAAG,OAAO,EAAE,OAAO,MAAM,QAAQ,IAAI,EAAE;AAEnF,IAAM,aAA6E;AAAA,EACxF,4BAA4B,MAAM,MAAM;AAAA,EACxC,qBAAqB,MAAM,MAAM;AAAA,EACjC,oCAAoC,MAAM,MAAM;AAAA,EAChD,yBAAyB,MAAM,MAAM;AAAA,EACrC,uBAAuB,MAAM,MAAM;AAAA,EACnC,oCAAoC,MAAM,KAAK;AAAA,EAC/C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B,IACpD,WAAW,yBAAyB,EAAE,QAAQ,WAAW,yBAAyB,EAAE,SACpF;AAEJ,QAAM,MAAqB;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAAS,GAAG,YAAY,GAAG,yBAAyB;AAE1D,SACE,4CAAC,SAAI,OAAO,KACV;AAAA,IAAC,aAAAA;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,KAAK;AAAA,MACL;AAAA,MACA,QAAQ,cAAc,QAAQ,cAAc;AAAA;AAAA,EAC9C,GACF;AAEJ,GA7BsB;;;AGff,IAAM,iBAAiB,8BAAO,EAAE,MAAM,SAAS,MAAM,MAC1D,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS,WAAW,SAAS,GAAG,IAAI,OAAO,GADvC;","names":["Image"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liner-fe/prism",
3
- "version": "2.2.2",
3
+ "version": "2.3.0",
4
4
  "packageManager": "yarn@3.6.0",
5
5
  "scripts": {
6
6
  "dev": "next dev",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@artsy/fresnel": "^7.1.4",
23
- "@liner-fe/design-token": "2.4.2",
23
+ "@liner-fe/design-token": "2.4.3",
24
24
  "@liner-fe/design-token-primitive": "workspace:^",
25
25
  "clsx": "^2.1.1",
26
26
  "cva": "beta",