@clubmed/trident-ui 1.2.0 → 1.3.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/CHANGELOG.md +961 -860
  2. package/README.md +11 -1
  3. package/assets/style.css +1 -1
  4. package/atoms/Clickable/Clickable.d.ts +5 -0
  5. package/atoms/Clickable/Clickable.js +25 -0
  6. package/atoms/Clickable/Clickable.js.map +1 -0
  7. package/atoms/Heading/Heading.d.ts +6 -0
  8. package/atoms/Heading/Heading.js +14 -0
  9. package/atoms/Heading/Heading.js.map +1 -0
  10. package/atoms/Heading/HeadingGroup.d.ts +7 -0
  11. package/atoms/Heading/HeadingGroup.js +15 -0
  12. package/atoms/Heading/HeadingGroup.js.map +1 -0
  13. package/atoms/Image/Image.d.ts +7 -0
  14. package/atoms/Image/Image.js +18 -0
  15. package/atoms/Image/Image.js.map +1 -0
  16. package/atoms/Prose/Prose.d.ts +5 -0
  17. package/atoms/Prose/Prose.js +18 -0
  18. package/atoms/Prose/Prose.js.map +1 -0
  19. package/chunks/ResizeObserver.js +287 -0
  20. package/chunks/ResizeObserver.js.map +1 -0
  21. package/chunks/_commonjsHelpers.js +24 -4
  22. package/chunks/_commonjsHelpers.js.map +1 -1
  23. package/chunks/index.js.map +1 -1
  24. package/chunks/plugin.js +53 -0
  25. package/chunks/plugin.js.map +1 -0
  26. package/contexts/Device.d.ts +2 -22
  27. package/contexts/Device.js +5 -59
  28. package/contexts/Device.js.map +1 -1
  29. package/contexts/Devices/Device.d.ts +11 -0
  30. package/contexts/Devices/Device.js +23 -0
  31. package/contexts/Devices/Device.js.map +1 -0
  32. package/contexts/Devices/hooks/useQueries.d.ts +6 -0
  33. package/contexts/Devices/hooks/useQueries.js +24 -0
  34. package/contexts/Devices/hooks/useQueries.js.map +1 -0
  35. package/contexts/Devices/reducers/reducer.d.ts +25 -0
  36. package/contexts/Devices/reducers/reducer.js +50 -0
  37. package/contexts/Devices/reducers/reducer.js.map +1 -0
  38. package/contexts/TridentUIConfig.js +228 -228
  39. package/contexts/TridentUIConfig.js.map +1 -1
  40. package/helpers/colors/colors.d.ts +108 -0
  41. package/helpers/colors/colors.js +132 -0
  42. package/helpers/colors/colors.js.map +1 -0
  43. package/hooks/keyboard.constants.js.map +1 -1
  44. package/hooks/useInternalStatus.js.map +1 -1
  45. package/hooks/useKeyboardControls.js.map +1 -1
  46. package/hooks/useResizeObserver.d.ts +2 -0
  47. package/hooks/useResizeObserver.js +84 -0
  48. package/hooks/useResizeObserver.js.map +1 -0
  49. package/hooks/useSafeBoop.js.map +1 -1
  50. package/hooks/useValue.js.map +1 -1
  51. package/molecules/Arrows/Arrows.d.ts +16 -0
  52. package/molecules/Arrows/Arrows.js +66 -0
  53. package/molecules/Arrows/Arrows.js.map +1 -0
  54. package/molecules/Arrows/ArrowsLabels.d.js +2 -0
  55. package/molecules/Arrows/ArrowsLabels.d.js.map +1 -0
  56. package/molecules/Arrows.d.ts +1 -50
  57. package/molecules/Arrows.js +2 -56
  58. package/molecules/Arrows.js.map +1 -1
  59. package/molecules/Avatar.js.map +1 -1
  60. package/molecules/Backdrop.js.map +1 -1
  61. package/molecules/Breadcrumb.js +8 -9
  62. package/molecules/Breadcrumb.js.map +1 -1
  63. package/molecules/Buttons/ArrowButton.d.ts +7 -0
  64. package/molecules/Buttons/ArrowButton.js +14 -0
  65. package/molecules/Buttons/ArrowButton.js.map +1 -0
  66. package/molecules/Buttons/Button.d.ts +15 -32
  67. package/molecules/Buttons/Button.js +52 -42
  68. package/molecules/Buttons/Button.js.map +1 -1
  69. package/molecules/Buttons/ButtonAnchor.d.ts +7 -3
  70. package/molecules/Buttons/ButtonAnchor.js +17 -36
  71. package/molecules/Buttons/ButtonAnchor.js.map +1 -1
  72. package/molecules/Buttons/ButtonContent.d.ts +12 -4
  73. package/molecules/Buttons/ButtonContent.js +14 -8
  74. package/molecules/Buttons/ButtonContent.js.map +1 -1
  75. package/molecules/Buttons/FakeButton.d.ts +8 -0
  76. package/molecules/Buttons/FakeButton.js +8 -0
  77. package/molecules/Buttons/FakeButton.js.map +1 -0
  78. package/molecules/Buttons/InertButton.d.ts +4 -0
  79. package/molecules/Buttons/InertButton.js +15 -31
  80. package/molecules/Buttons/InertButton.js.map +1 -1
  81. package/molecules/Buttons/v2/Button.d.ts +2289 -0
  82. package/molecules/Buttons/v2/Button.js +57 -0
  83. package/molecules/Buttons/v2/Button.js.map +1 -0
  84. package/molecules/Buttons/v2/Button.type.d.ts +57 -0
  85. package/molecules/Buttons/v2/Button.type.js +45 -0
  86. package/molecules/Buttons/v2/Button.type.js.map +1 -0
  87. package/molecules/Card.d.ts +1 -11
  88. package/molecules/Card.js +2 -35
  89. package/molecules/Card.js.map +1 -1
  90. package/molecules/Cards/Card.d.ts +13 -0
  91. package/molecules/Cards/Card.js +22 -0
  92. package/molecules/Cards/Card.js.map +1 -0
  93. package/molecules/Cards/CardAspectRatios.d.ts +6 -0
  94. package/molecules/Cards/CardAspectRatios.js +10 -0
  95. package/molecules/Cards/CardAspectRatios.js.map +1 -0
  96. package/molecules/Cards/CardBackground.d.ts +4 -0
  97. package/molecules/Cards/CardBackground.js +30 -0
  98. package/molecules/Cards/CardBackground.js.map +1 -0
  99. package/molecules/Cards/CardBackgroundContext.d.ts +6 -0
  100. package/molecules/Cards/CardBackgroundContext.js +10 -0
  101. package/molecules/Cards/CardBackgroundContext.js.map +1 -0
  102. package/molecules/Cards/CardClickable.d.ts +6 -0
  103. package/molecules/Cards/CardClickable.js +37 -0
  104. package/molecules/Cards/CardClickable.js.map +1 -0
  105. package/molecules/Cards/ExpandableCard.d.ts +14 -0
  106. package/molecules/Cards/ExpandableCard.js +80 -0
  107. package/molecules/Cards/ExpandableCard.js.map +1 -0
  108. package/molecules/Cards/v2/Card.d.ts +15 -0
  109. package/molecules/Cards/v2/Card.js +34 -0
  110. package/molecules/Cards/v2/Card.js.map +1 -0
  111. package/molecules/Chip.d.ts +9 -0
  112. package/molecules/Chip.js +31 -0
  113. package/molecules/Chip.js.map +1 -0
  114. package/molecules/Chip.themes.d.ts +12 -0
  115. package/molecules/Chip.themes.js +24 -0
  116. package/molecules/Chip.themes.js.map +1 -0
  117. package/molecules/ElasticHeight.d.ts +6 -27
  118. package/molecules/ElasticHeight.js +28 -33
  119. package/molecules/ElasticHeight.js.map +1 -1
  120. package/molecules/Forms/Checkboxes/Checkbox.js +12 -13
  121. package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
  122. package/molecules/Forms/Checkboxes/Checkboxes.js.map +1 -1
  123. package/molecules/Forms/DateField.d.ts +1 -1
  124. package/molecules/Forms/DateField.js +142 -116
  125. package/molecules/Forms/DateField.js.map +1 -1
  126. package/molecules/Forms/Filter.js +12 -13
  127. package/molecules/Forms/Filter.js.map +1 -1
  128. package/molecules/Forms/FormControl.js +15 -16
  129. package/molecules/Forms/FormControl.js.map +1 -1
  130. package/molecules/Forms/FormLabel.js.map +1 -1
  131. package/molecules/Forms/NumberField.d.ts +29 -29
  132. package/molecules/Forms/NumberField.js +68 -68
  133. package/molecules/Forms/NumberField.js.map +1 -1
  134. package/molecules/Forms/Password/Password.js +10 -11
  135. package/molecules/Forms/Password/Password.js.map +1 -1
  136. package/molecules/Forms/Password/ValidationMessage.js +8 -9
  137. package/molecules/Forms/Password/ValidationMessage.js.map +1 -1
  138. package/molecules/Forms/Radios/Radio.js.map +1 -1
  139. package/molecules/Forms/Radios/RadioGroup.js +2 -2
  140. package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
  141. package/molecules/Forms/Range.js +124 -406
  142. package/molecules/Forms/Range.js.map +1 -1
  143. package/molecules/Forms/Select.d.ts +1 -1
  144. package/molecules/Forms/Select.js +3 -4
  145. package/molecules/Forms/Select.js.map +1 -1
  146. package/molecules/Forms/Switch.js.map +1 -1
  147. package/molecules/Forms/TextField.d.ts +1 -1
  148. package/molecules/Forms/TextField.js +7 -8
  149. package/molecules/Forms/TextField.js.map +1 -1
  150. package/molecules/HamburgerIcon.js.map +1 -1
  151. package/molecules/Link.d.ts +1 -1
  152. package/molecules/Link.js +8 -9
  153. package/molecules/Link.js.map +1 -1
  154. package/molecules/Loader.js.map +1 -1
  155. package/molecules/Pagination.d.ts +38 -0
  156. package/molecules/Pagination.helper.d.ts +48 -0
  157. package/molecules/Pagination.helper.js +30 -0
  158. package/molecules/Pagination.helper.js.map +1 -0
  159. package/molecules/Pagination.js +154 -0
  160. package/molecules/Pagination.js.map +1 -0
  161. package/molecules/Popin.js +16 -16
  162. package/molecules/Popin.js.map +1 -1
  163. package/molecules/Spinner.js.map +1 -1
  164. package/molecules/Tabs/Tab.d.ts +1 -1
  165. package/molecules/Tabs/Tab.js +51 -49
  166. package/molecules/Tabs/Tab.js.map +1 -1
  167. package/molecules/Tabs/TabList.js.map +1 -1
  168. package/molecules/Tabs/TabPanel.js +31 -29
  169. package/molecules/Tabs/TabPanel.js.map +1 -1
  170. package/molecules/Tabs/Tabs.js +7 -9
  171. package/molecules/Tabs/Tabs.js.map +1 -1
  172. package/molecules/Tabs/TabsBody.js.map +1 -1
  173. package/molecules/Tabs/context/TabControl.d.ts +29 -27
  174. package/molecules/Tabs/context/TabControl.js +67 -66
  175. package/molecules/Tabs/context/TabControl.js.map +1 -1
  176. package/molecules/Tabs/hooks/tabControl.d.ts +25 -14
  177. package/molecules/Tabs/hooks/tabControl.js +26 -23
  178. package/molecules/Tabs/hooks/tabControl.js.map +1 -1
  179. package/molecules/Tabs/theme.js.map +1 -1
  180. package/molecules/Tag.d.ts +43 -0
  181. package/molecules/Tag.js +73 -0
  182. package/molecules/Tag.js.map +1 -0
  183. package/package.json +29 -5
  184. package/styles/globals.css +16 -15
  185. package/tailwind/colors.d.ts +38 -0
  186. package/tailwind/colors.js +44 -0
  187. package/tailwind/colors.js.map +1 -0
  188. package/tailwind/plugins/animationDelay.d.ts +4 -0
  189. package/tailwind/plugins/animationDelay.js +15 -0
  190. package/tailwind/plugins/animationDelay.js.map +1 -0
  191. package/tailwind/plugins/hocus.d.ts +4 -0
  192. package/tailwind/plugins/hocus.js +11 -0
  193. package/tailwind/plugins/hocus.js.map +1 -0
  194. package/tailwind/plugins/lineClampFix.d.ts +4 -0
  195. package/tailwind/plugins/lineClampFix.js +13 -0
  196. package/tailwind/plugins/lineClampFix.js.map +1 -0
  197. package/tailwind/plugins/popover.d.ts +4 -0
  198. package/tailwind/plugins/popover.js +8 -0
  199. package/tailwind/plugins/popover.js.map +1 -0
  200. package/tailwind/plugins/startingStyle.d.ts +4 -0
  201. package/tailwind/plugins/startingStyle.js +8 -0
  202. package/tailwind/plugins/startingStyle.js.map +1 -0
  203. package/tailwind/plugins/transitionBehavior.d.ts +4 -0
  204. package/tailwind/plugins/transitionBehavior.js +11 -0
  205. package/tailwind/plugins/transitionBehavior.js.map +1 -0
  206. package/tailwind/tailwind.preset.d.ts +733 -510
  207. package/tailwind/tailwind.preset.js +706 -629
  208. package/tailwind/tailwind.preset.js.map +1 -1
  209. package/types/Colors.d.js +2 -0
  210. package/types/Colors.d.js.map +1 -0
  211. package/types/Devices.d.ts +8 -0
  212. package/types/Devices.js +11 -0
  213. package/types/Devices.js.map +1 -0
  214. package/types/Direction.d.js +2 -0
  215. package/types/Direction.d.js.map +1 -0
  216. package/types/LiteralUnion.d.js +2 -0
  217. package/types/LiteralUnion.d.js.map +1 -0
  218. package/types/ScrollerLabels.d.js +2 -0
  219. package/types/ScrollerLabels.d.js.map +1 -0
  220. package/types/Theme.d.js +2 -0
  221. package/types/Theme.d.js.map +1 -0
  222. package/molecules/Buttons/Button.helpers.d.ts +0 -7
  223. package/molecules/Buttons/Button.helpers.js +0 -11
  224. package/molecules/Buttons/Button.helpers.js.map +0 -1
  225. package/molecules/Buttons/Button.themes.d.ts +0 -1
  226. package/molecules/Buttons/Button.themes.js +0 -25
  227. package/molecules/Buttons/Button.themes.js.map +0 -1
@@ -0,0 +1,108 @@
1
+ import type { Theme } from '../../types/Theme';
2
+ export declare enum Colors {
3
+ black = "black",
4
+ darkGrey = "darkGrey",
5
+ green = "green",
6
+ lavender = "lavender",
7
+ lightGrey = "lightGrey",
8
+ lightSand = "lightSand",
9
+ marygold = "marygold",
10
+ orange = "orange",
11
+ red = "red",
12
+ saffron = "saffron",
13
+ sand = "sand",
14
+ sienna = "sienna",
15
+ ultramarine = "ultramarine",
16
+ verdigris = "verdigris",
17
+ wave = "wave",
18
+ white = "white",
19
+ current = "current"
20
+ }
21
+ declare const BORDER_COLORS: {
22
+ readonly black: "border-black";
23
+ readonly darkGrey: "border-darkGrey";
24
+ readonly green: "border-green";
25
+ readonly lavender: "border-lavender";
26
+ readonly lightGrey: "border-lightGrey";
27
+ readonly lightSand: "border-lightSand";
28
+ readonly marygold: "border-marygold";
29
+ readonly orange: "border-orange";
30
+ readonly red: "border-red";
31
+ readonly saffron: "border-saffron";
32
+ readonly sand: "border-sand";
33
+ readonly sienna: "border-sienna";
34
+ readonly ultramarine: "border-ultramarine";
35
+ readonly verdigris: "border-verdigris";
36
+ readonly wave: "border-wave";
37
+ readonly white: "border-white";
38
+ readonly current: "border-current";
39
+ };
40
+ export type BorderColor = keyof typeof BORDER_COLORS;
41
+ declare const BG_COLORS: {
42
+ readonly black: "bg-black";
43
+ readonly darkGrey: "bg-darkGrey";
44
+ readonly green: "bg-green";
45
+ readonly lavender: "bg-lavender";
46
+ readonly lightGrey: "bg-lightGrey";
47
+ readonly lightSand: "bg-lightSand";
48
+ readonly marygold: "bg-marygold";
49
+ readonly orange: "bg-orange";
50
+ readonly red: "bg-red";
51
+ readonly saffron: "bg-saffron";
52
+ readonly sand: "bg-sand";
53
+ readonly sienna: "bg-sienna";
54
+ readonly ultramarine: "bg-ultramarine";
55
+ readonly verdigris: "bg-verdigris";
56
+ readonly wave: "bg-wave";
57
+ readonly white: "bg-white";
58
+ readonly current: "bg-current";
59
+ };
60
+ export type BgColor = keyof typeof BG_COLORS;
61
+ declare const TEXT_COLORS: {
62
+ readonly black: "text-black";
63
+ readonly green: "text-green";
64
+ readonly lavender: "text-lavender";
65
+ readonly lightSand: "text-lightSand";
66
+ readonly marygold: "text-marygold";
67
+ readonly orange: "text-orange";
68
+ readonly red: "text-red";
69
+ readonly saffron: "text-saffron";
70
+ readonly sand: "text-sand";
71
+ readonly sienna: "text-sienna";
72
+ readonly ultramarine: "text-ultramarine";
73
+ readonly verdigris: "text-verdigris";
74
+ readonly wave: "text-wave";
75
+ readonly white: "text-white";
76
+ readonly darkGrey: "text-darkGrey";
77
+ readonly lightGrey: "text-lightGrey";
78
+ readonly current: "text-current";
79
+ };
80
+ export type TextColor = keyof typeof TEXT_COLORS;
81
+ declare const TO_COLORS: {
82
+ readonly black: "to-black";
83
+ readonly green: "to-green";
84
+ readonly lavender: "to-lavender";
85
+ readonly lightSand: "to-lightSand";
86
+ readonly marygold: "to-marygold";
87
+ readonly orange: "to-orange";
88
+ readonly red: "to-red";
89
+ readonly saffron: "to-saffron";
90
+ readonly sand: "to-sand";
91
+ readonly sienna: "to-sienna";
92
+ readonly ultramarine: "to-ultramarine";
93
+ readonly verdigris: "to-verdigris";
94
+ readonly wave: "to-wave";
95
+ readonly white: "to-white";
96
+ readonly darkGrey: "to-darkGrey";
97
+ readonly lightGrey: "to-lightGrey";
98
+ readonly current: "to-current";
99
+ };
100
+ export type ToColor = keyof typeof TO_COLORS;
101
+ export declare const getBorderColor: (color: string) => `border-${string}`;
102
+ export declare const getBgColor: (color: string) => `bg-${string}`;
103
+ export declare const getTextColor: (color: string) => `text-${string}`;
104
+ export declare const getGradientToColor: (color: string) => `to-${string}`;
105
+ export declare const getComplementaryTextColor: (color: string) => `text-${string}`;
106
+ export declare const getComplementaryColor: (color: string) => Colors;
107
+ export declare const getThemeColor: (theme: Theme) => Colors;
108
+ export {};
@@ -0,0 +1,132 @@
1
+ var g = /* @__PURE__ */ ((e) => (e.black = "black", e.darkGrey = "darkGrey", e.green = "green", e.lavender = "lavender", e.lightGrey = "lightGrey", e.lightSand = "lightSand", e.marygold = "marygold", e.orange = "orange", e.red = "red", e.saffron = "saffron", e.sand = "sand", e.sienna = "sienna", e.ultramarine = "ultramarine", e.verdigris = "verdigris", e.wave = "wave", e.white = "white", e.current = "current", e))(g || {});
2
+ const t = {
3
+ black: "border-black",
4
+ darkGrey: "border-darkGrey",
5
+ green: "border-green",
6
+ lavender: "border-lavender",
7
+ lightGrey: "border-lightGrey",
8
+ lightSand: "border-lightSand",
9
+ marygold: "border-marygold",
10
+ orange: "border-orange",
11
+ red: "border-red",
12
+ saffron: "border-saffron",
13
+ sand: "border-sand",
14
+ sienna: "border-sienna",
15
+ ultramarine: "border-ultramarine",
16
+ verdigris: "border-verdigris",
17
+ wave: "border-wave",
18
+ white: "border-white",
19
+ current: "border-current"
20
+ }, a = {
21
+ black: "bg-black",
22
+ darkGrey: "bg-darkGrey",
23
+ green: "bg-green",
24
+ lavender: "bg-lavender",
25
+ lightGrey: "bg-lightGrey",
26
+ lightSand: "bg-lightSand",
27
+ marygold: "bg-marygold",
28
+ orange: "bg-orange",
29
+ red: "bg-red",
30
+ saffron: "bg-saffron",
31
+ sand: "bg-sand",
32
+ sienna: "bg-sienna",
33
+ ultramarine: "bg-ultramarine",
34
+ verdigris: "bg-verdigris",
35
+ wave: "bg-wave",
36
+ white: "bg-white",
37
+ current: "bg-current"
38
+ }, n = {
39
+ black: "text-black",
40
+ green: "text-green",
41
+ lavender: "text-lavender",
42
+ lightSand: "text-lightSand",
43
+ marygold: "text-marygold",
44
+ orange: "text-orange",
45
+ red: "text-red",
46
+ saffron: "text-saffron",
47
+ sand: "text-sand",
48
+ sienna: "text-sienna",
49
+ ultramarine: "text-ultramarine",
50
+ verdigris: "text-verdigris",
51
+ wave: "text-wave",
52
+ white: "text-white",
53
+ darkGrey: "text-darkGrey",
54
+ lightGrey: "text-lightGrey",
55
+ current: "text-current"
56
+ }, i = {
57
+ black: "to-black",
58
+ green: "to-green",
59
+ lavender: "to-lavender",
60
+ lightSand: "to-lightSand",
61
+ marygold: "to-marygold",
62
+ orange: "to-orange",
63
+ red: "to-red",
64
+ saffron: "to-saffron",
65
+ sand: "to-sand",
66
+ sienna: "to-sienna",
67
+ ultramarine: "to-ultramarine",
68
+ verdigris: "to-verdigris",
69
+ wave: "to-wave",
70
+ white: "to-white",
71
+ darkGrey: "to-darkGrey",
72
+ lightGrey: "to-lightGrey",
73
+ current: "to-current"
74
+ }, l = {
75
+ lightSand: "black",
76
+ marygold: "black",
77
+ saffron: "black",
78
+ sand: "black",
79
+ verdigris: "black",
80
+ white: "black",
81
+ black: "white",
82
+ green: "white",
83
+ lavender: "white",
84
+ orange: "white",
85
+ red: "white",
86
+ sienna: "white",
87
+ ultramarine: "white",
88
+ wave: "white",
89
+ darkGrey: "white",
90
+ lightGrey: "black",
91
+ current: "white"
92
+ /* white */
93
+ }, o = {
94
+ dark: "ultramarine",
95
+ exclusiveCollection: "ultramarine",
96
+ coreRange: "lightSand",
97
+ light: "lightSand",
98
+ happyToCare: "verdigris",
99
+ joyview: "wave",
100
+ urbanOasis: "marygold",
101
+ yellow: "saffron"
102
+ /* saffron */
103
+ }, b = {
104
+ lightSand: "text-black",
105
+ marygold: "text-black",
106
+ saffron: "text-black",
107
+ sand: "text-black",
108
+ verdigris: "text-black",
109
+ white: "text-black",
110
+ black: "text-white",
111
+ green: "text-white",
112
+ lavender: "text-white",
113
+ orange: "text-white",
114
+ red: "text-white",
115
+ sienna: "text-white",
116
+ ultramarine: "text-white",
117
+ wave: "text-white",
118
+ darkGrey: "text-white",
119
+ lightGrey: "text-black",
120
+ current: "text-current"
121
+ }, r = (e, d) => e in d, h = (e) => r(e, t) ? t[e] : `border-${e}`, s = (e) => r(e, a) ? a[e] : `bg-${e}`, c = (e) => r(e, n) ? n[e] : `text-${e}`, w = (e) => r(e, i) ? i[e] : `to-${e}`, u = (e) => b[e] || "text-white", y = (e) => l[e] || "white", v = (e) => o[e] || e;
122
+ export {
123
+ g as Colors,
124
+ s as getBgColor,
125
+ h as getBorderColor,
126
+ y as getComplementaryColor,
127
+ u as getComplementaryTextColor,
128
+ w as getGradientToColor,
129
+ c as getTextColor,
130
+ v as getThemeColor
131
+ };
132
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sources":["../../../lib/helpers/colors/colors.ts"],"sourcesContent":["import type { Theme } from '@/types/Theme';\n\nexport enum Colors {\n black = 'black',\n darkGrey = 'darkGrey',\n green = 'green',\n lavender = 'lavender',\n lightGrey = 'lightGrey',\n lightSand = 'lightSand',\n marygold = 'marygold',\n orange = 'orange',\n red = 'red',\n saffron = 'saffron',\n sand = 'sand',\n sienna = 'sienna',\n ultramarine = 'ultramarine',\n verdigris = 'verdigris',\n wave = 'wave',\n white = 'white',\n current = 'current',\n}\n\nconst BORDER_COLORS = {\n [Colors.black]: 'border-black',\n [Colors.darkGrey]: 'border-darkGrey',\n [Colors.green]: 'border-green',\n [Colors.lavender]: 'border-lavender',\n [Colors.lightGrey]: 'border-lightGrey',\n [Colors.lightSand]: 'border-lightSand',\n [Colors.marygold]: 'border-marygold',\n [Colors.orange]: 'border-orange',\n [Colors.red]: 'border-red',\n [Colors.saffron]: 'border-saffron',\n [Colors.sand]: 'border-sand',\n [Colors.sienna]: 'border-sienna',\n [Colors.ultramarine]: 'border-ultramarine',\n [Colors.verdigris]: 'border-verdigris',\n [Colors.wave]: 'border-wave',\n [Colors.white]: 'border-white',\n [Colors.current]: 'border-current',\n} as const satisfies Record<string, `border-${string}`>;\n\nexport type BorderColor = keyof typeof BORDER_COLORS;\n\nconst BG_COLORS = {\n [Colors.black]: 'bg-black',\n [Colors.darkGrey]: 'bg-darkGrey',\n [Colors.green]: 'bg-green',\n [Colors.lavender]: 'bg-lavender',\n [Colors.lightGrey]: 'bg-lightGrey',\n [Colors.lightSand]: 'bg-lightSand',\n [Colors.marygold]: 'bg-marygold',\n [Colors.orange]: 'bg-orange',\n [Colors.red]: 'bg-red',\n [Colors.saffron]: 'bg-saffron',\n [Colors.sand]: 'bg-sand',\n [Colors.sienna]: 'bg-sienna',\n [Colors.ultramarine]: 'bg-ultramarine',\n [Colors.verdigris]: 'bg-verdigris',\n [Colors.wave]: 'bg-wave',\n [Colors.white]: 'bg-white',\n [Colors.current]: 'bg-current',\n} as const satisfies Record<Colors, `bg-${string}`>;\n\nexport type BgColor = keyof typeof BG_COLORS;\n\nconst TEXT_COLORS = {\n [Colors.black]: 'text-black',\n [Colors.green]: 'text-green',\n [Colors.lavender]: 'text-lavender',\n [Colors.lightSand]: 'text-lightSand',\n [Colors.marygold]: 'text-marygold',\n [Colors.orange]: 'text-orange',\n [Colors.red]: 'text-red',\n [Colors.saffron]: 'text-saffron',\n [Colors.sand]: 'text-sand',\n [Colors.sienna]: 'text-sienna',\n [Colors.ultramarine]: 'text-ultramarine',\n [Colors.verdigris]: 'text-verdigris',\n [Colors.wave]: 'text-wave',\n [Colors.white]: 'text-white',\n [Colors.darkGrey]: 'text-darkGrey',\n [Colors.lightGrey]: 'text-lightGrey',\n [Colors.current]: 'text-current',\n} as const satisfies Record<Colors, `text-${string}`>;\n\nexport type TextColor = keyof typeof TEXT_COLORS;\n\nconst TO_COLORS = {\n [Colors.black]: `to-black`,\n [Colors.green]: `to-green`,\n [Colors.lavender]: `to-lavender`,\n [Colors.lightSand]: `to-lightSand`,\n [Colors.marygold]: `to-marygold`,\n [Colors.orange]: `to-orange`,\n [Colors.red]: `to-red`,\n [Colors.saffron]: `to-saffron`,\n [Colors.sand]: `to-sand`,\n [Colors.sienna]: `to-sienna`,\n [Colors.ultramarine]: `to-ultramarine`,\n [Colors.verdigris]: `to-verdigris`,\n [Colors.wave]: `to-wave`,\n [Colors.white]: `to-white`,\n [Colors.darkGrey]: `to-darkGrey`,\n [Colors.lightGrey]: `to-lightGrey`,\n [Colors.current]: `to-current`,\n} as const satisfies Record<keyof typeof Colors, `to-${string}`>;\n\nexport type ToColor = keyof typeof TO_COLORS;\n\nconst COMPLEMENTARY_COLORS = {\n [Colors.lightSand]: Colors.black,\n [Colors.marygold]: Colors.black,\n [Colors.saffron]: Colors.black,\n [Colors.sand]: Colors.black,\n [Colors.verdigris]: Colors.black,\n [Colors.white]: Colors.black,\n [Colors.black]: Colors.white,\n [Colors.green]: Colors.white,\n [Colors.lavender]: Colors.white,\n [Colors.orange]: Colors.white,\n [Colors.red]: Colors.white,\n [Colors.sienna]: Colors.white,\n [Colors.ultramarine]: Colors.white,\n [Colors.wave]: Colors.white,\n [Colors.darkGrey]: Colors.white,\n [Colors.lightGrey]: Colors.black,\n [Colors.current]: Colors.white,\n} as const satisfies Record<keyof typeof Colors, Colors.white | Colors.black>;\n\nconst THEME_TO_COLOR: Record<string, Colors> = {\n dark: Colors.ultramarine,\n exclusiveCollection: Colors.ultramarine,\n coreRange: Colors.lightSand,\n light: Colors.lightSand,\n happyToCare: Colors.verdigris,\n joyview: Colors.wave,\n urbanOasis: Colors.marygold,\n yellow: Colors.saffron,\n};\n\nconst COMPLEMENTARY_TEXT_COLOR_CONFIG = {\n [Colors.lightSand]: 'text-black',\n [Colors.marygold]: 'text-black',\n [Colors.saffron]: 'text-black',\n [Colors.sand]: 'text-black',\n [Colors.verdigris]: 'text-black',\n [Colors.white]: 'text-black',\n [Colors.black]: 'text-white',\n [Colors.green]: 'text-white',\n [Colors.lavender]: 'text-white',\n [Colors.orange]: 'text-white',\n [Colors.red]: 'text-white',\n [Colors.sienna]: 'text-white',\n [Colors.ultramarine]: 'text-white',\n [Colors.wave]: 'text-white',\n [Colors.darkGrey]: 'text-white',\n [Colors.lightGrey]: 'text-black',\n [Colors.current]: 'text-current',\n} as const satisfies Record<keyof typeof Colors, `text-${string}`>;\n\nconst colorGuard = <T extends Record<string, string>, K extends keyof T>(\n color: string | K,\n obj: T,\n): color is K => {\n return color in obj;\n};\n\nexport const getBorderColor = (color: string): `border-${string}` => {\n if (colorGuard(color, BORDER_COLORS)) {\n return BORDER_COLORS[color];\n }\n\n return `border-${color}`;\n};\n\nexport const getBgColor = (color: string): `bg-${string}` => {\n if (colorGuard(color, BG_COLORS)) {\n return BG_COLORS[color];\n }\n\n return `bg-${color}`;\n};\n\nexport const getTextColor = (color: string): `text-${string}` => {\n if (colorGuard(color, TEXT_COLORS)) {\n return TEXT_COLORS[color];\n }\n\n return `text-${color}`;\n};\n\nexport const getGradientToColor = (color: string): `to-${string}` => {\n if (colorGuard(color, TO_COLORS)) {\n return TO_COLORS[color];\n }\n\n return `to-${color}`;\n};\n\nexport const getComplementaryTextColor = (color: string): `text-${string}` => {\n return COMPLEMENTARY_TEXT_COLOR_CONFIG[color as Colors] || 'text-white';\n};\n\nexport const getComplementaryColor = (color: string): Colors => {\n return COMPLEMENTARY_COLORS[color as Colors] || 'white';\n};\n\nexport const getThemeColor = (theme: Theme): Colors => {\n return THEME_TO_COLOR[theme] || theme;\n};\n"],"names":["Colors","BORDER_COLORS","BG_COLORS","TEXT_COLORS","TO_COLORS","COMPLEMENTARY_COLORS","THEME_TO_COLOR","COMPLEMENTARY_TEXT_COLOR_CONFIG","colorGuard","color","obj","getBorderColor","getBgColor","getTextColor","getGradientToColor","getComplementaryTextColor","getComplementaryColor","getThemeColor","theme"],"mappings":"AAEO,IAAKA,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,MAAM,OACNA,EAAA,UAAU,WACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,YAAY,aACZA,EAAA,OAAO,QACPA,EAAA,QAAQ,SACRA,EAAA,UAAU,WAjBAA,IAAAA,KAAA,CAAA,CAAA;AAoBZ,MAAMC,IAAgB;AAAA,EACnB,OAAe;AAAA,EACf,UAAkB;AAAA,EAClB,OAAe;AAAA,EACf,UAAkB;AAAA,EAClB,WAAmB;AAAA,EACnB,WAAmB;AAAA,EACnB,UAAkB;AAAA,EAClB,QAAgB;AAAA,EAChB,KAAa;A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AAqBI,CAAe,KAAK,SAGrCQ,IAAgB,CAACC,MACrBZ,EAAeY,CAAK,KAAKA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"keyboard.constants.js","sources":["../../lib/hooks/keyboard.constants.ts"],"sourcesContent":["export const enum CODE {\n ENTER = 'Enter',\n ESCAPE = 'Escape',\n ARROW_LEFT = 'ArrowLeft',\n ARROW_UP = 'ArrowUp',\n ARROW_RIGHT = 'ArrowRight',\n ARROW_DOWN = 'ArrowDown',\n SPACE = 'Space',\n END = 'End',\n HOME = 'Home',\n}\n\nexport const enum KEY {\n ENTER = 'Enter',\n ESCAPE = 'Escape',\n ARROW_LEFT = 'ArrowLeft',\n ARROW_UP = 'ArrowUp',\n ARROW_RIGHT = 'ArrowRight',\n ARROW_DOWN = 'ArrowDown',\n END = 'End',\n HOME = 'Home',\n SPACE = ' ',\n /**\n * @deprecated\n * Used by old browers, see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#whitespace_keys\n */\n SPACEBAR = 'Spacebar',\n}\n\nexport const enum KEY_CODE {\n ENTER = 13,\n ESCAPE = 27,\n ARROW_LEFT = 37,\n ARROW_UP = 38,\n ARROW_RIGHT = 39,\n ARROW_DOWN = 40,\n SPACE = 32,\n END = 35,\n HOME = 36,\n}\n"],"names":["CODE","KEY","KEY_CODE"],"mappings":"AAAkB,IAAAA,sBAAAA,OAChBA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,aAAa,aACbA,EAAA,WAAW,WACXA,EAAA,cAAc,cACdA,EAAA,aAAa,aACbA,EAAA,QAAQ,SACRA,EAAA,MAAM,OACNA,EAAA,OAAO,QATSA,IAAAA,KAAA,CAAA,CAAA,GAYAC,sBAAAA,OAChBA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,aAAa,aACbA,EAAA,WAAW,WACXA,EAAA,cAAc,cACdA,EAAA,aAAa,aACbA,EAAA,MAAM,OACNA,EAAA,OAAO,QACPA,EAAA,QAAQ,KAKRA,EAAA,WAAW,YAdKA,IAAAA,KAAA,CAAA,CAAA,GAiBAC,sBAAAA,OAChBA,EAAAA,EAAA,QAAQ,EAAR,IAAA,SACAA,EAAAA,EAAA,SAAS,EAAT,IAAA,UACAA,EAAAA,EAAA,aAAa,EAAb,IAAA,cACAA,EAAAA,EAAA,WAAW,EAAX,IAAA,YACAA,EAAAA,EAAA,cAAc,EAAd,IAAA,eACAA,EAAAA,EAAA,aAAa,EAAb,IAAA,cACAA,EAAAA,EAAA,QAAQ,EAAR,IAAA,SACAA,EAAAA,EAAA,MAAM,EAAN,IAAA,OACAA,EAAAA,EAAA,OAAO,EAAP,IAAA,QATgBA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"keyboard.constants.js","sources":["../../lib/hooks/keyboard.constants.ts"],"sourcesContent":["export const enum CODE {\n ENTER = 'Enter',\n ESCAPE = 'Escape',\n ARROW_LEFT = 'ArrowLeft',\n ARROW_UP = 'ArrowUp',\n ARROW_RIGHT = 'ArrowRight',\n ARROW_DOWN = 'ArrowDown',\n SPACE = 'Space',\n END = 'End',\n HOME = 'Home',\n}\n\nexport const enum KEY {\n ENTER = 'Enter',\n ESCAPE = 'Escape',\n ARROW_LEFT = 'ArrowLeft',\n ARROW_UP = 'ArrowUp',\n ARROW_RIGHT = 'ArrowRight',\n ARROW_DOWN = 'ArrowDown',\n END = 'End',\n HOME = 'Home',\n SPACE = ' ',\n /**\n * @deprecated\n * Used by old browers, see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#whitespace_keys\n */\n SPACEBAR = 'Spacebar',\n}\n\nexport const enum KEY_CODE {\n ENTER = 13,\n ESCAPE = 27,\n ARROW_LEFT = 37,\n ARROW_UP = 38,\n ARROW_RIGHT = 39,\n ARROW_DOWN = 40,\n SPACE = 32,\n END = 35,\n HOME = 36,\n}\n"],"names":["CODE","KEY","KEY_CODE"],"mappings":"AAAO,IAAWA,sBAAAA,OAChBA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,aAAa,aACbA,EAAA,WAAW,WACXA,EAAA,cAAc,cACdA,EAAA,aAAa,aACbA,EAAA,QAAQ,SACRA,EAAA,MAAM,OACNA,EAAA,OAAO,QATSA,IAAAA,KAAA,CAAA,CAAA,GAYAC,sBAAAA,OAChBA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,aAAa,aACbA,EAAA,WAAW,WACXA,EAAA,cAAc,cACdA,EAAA,aAAa,aACbA,EAAA,MAAM,OACNA,EAAA,OAAO,QACPA,EAAA,QAAQ,KAKRA,EAAA,WAAW,YAdKA,IAAAA,KAAA,CAAA,CAAA,GAiBAC,sBAAAA,OAChBA,EAAAA,EAAA,QAAQ,EAAA,IAAR,SACAA,EAAAA,EAAA,SAAS,EAAA,IAAT,UACAA,EAAAA,EAAA,aAAa,EAAA,IAAb,cACAA,EAAAA,EAAA,WAAW,EAAA,IAAX,YACAA,EAAAA,EAAA,cAAc,EAAA,IAAd,eACAA,EAAAA,EAAA,aAAa,EAAA,IAAb,cACAA,EAAAA,EAAA,QAAQ,EAAA,IAAR,SACAA,EAAAA,EAAA,MAAM,EAAA,IAAN,OACAA,EAAAA,EAAA,OAAO,EAAA,IAAP,QATgBA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useInternalStatus.js","sources":["../../lib/hooks/useInternalStatus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport type ValidationStatus = 'default' | 'error' | 'success';\n\nexport const useInternalStatus = ({\n isDisabled,\n validationStatus,\n}: {\n isDisabled: boolean;\n validationStatus: ValidationStatus;\n}) => {\n const [internalStatus, setInternalStatus] = useState<ValidationStatus | 'disabled'>(\n getInternalStatus({ isDisabled, validationStatus }),\n );\n\n useEffect(() => {\n setInternalStatus(getInternalStatus({ isDisabled, validationStatus }));\n }, [isDisabled, validationStatus]);\n\n return internalStatus;\n};\n\nfunction getInternalStatus({\n isDisabled,\n validationStatus,\n}: {\n isDisabled: boolean;\n validationStatus: ValidationStatus;\n}) {\n return isDisabled ? 'disabled' : validationStatus;\n}\n"],"names":["useInternalStatus","isDisabled","validationStatus","internalStatus","setInternalStatus","useState","getInternalStatus","useEffect"],"mappings":";AAIO,MAAMA,IAAoB,CAAC;AAAA,EAChC,YAAAC;AAAA,EACA,kBAAAC;AACF,MAGM;AACE,QAAA,CAACC,GAAgBC,CAAiB,IAAIC;AAAA,IAC1CC,EAAkB,EAAE,YAAAL,GAAY,kBAAAC,GAAkB;AAAA,EAAA;AAGpD,SAAAK,EAAU,MAAM;AACd,IAAAH,EAAkBE,EAAkB,EAAE,YAAAL,GAAY,kBAAAC,EAAA,CAAkB,CAAC;AAAA,EAAA,GACpE,CAACD,GAAYC,CAAgB,CAAC,GAE1BC;AACT;AAEA,SAASG,EAAkB;AAAA,EACzB,YAAAL;AAAA,EACA,kBAAAC;AACF,GAGG;AACD,SAAOD,IAAa,aAAaC;AACnC;"}
1
+ {"version":3,"file":"useInternalStatus.js","sources":["../../lib/hooks/useInternalStatus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport type ValidationStatus = 'default' | 'error' | 'success';\n\nexport const useInternalStatus = ({\n isDisabled,\n validationStatus,\n}: {\n isDisabled: boolean;\n validationStatus: ValidationStatus;\n}) => {\n const [internalStatus, setInternalStatus] = useState<ValidationStatus | 'disabled'>(\n getInternalStatus({ isDisabled, validationStatus }),\n );\n\n useEffect(() => {\n setInternalStatus(getInternalStatus({ isDisabled, validationStatus }));\n }, [isDisabled, validationStatus]);\n\n return internalStatus;\n};\n\nfunction getInternalStatus({\n isDisabled,\n validationStatus,\n}: {\n isDisabled: boolean;\n validationStatus: ValidationStatus;\n}) {\n return isDisabled ? 'disabled' : validationStatus;\n}\n"],"names":["useInternalStatus","isDisabled","validationStatus","internalStatus","setInternalStatus","useState","getInternalStatus","useEffect"],"mappings":";AAIO,MAAMA,IAAoB,CAAC;AAAA,EAChC,YAAAC;AAAA,EACA,kBAAAC;AACF,MAGM;AACJ,QAAM,CAACC,GAAgBC,CAAiB,IAAIC;AAAA,IAC1CC,EAAkB,EAAE,YAAAL,GAAY,kBAAAC,EAAA,CAAkB;AAAA,EAAA;AAGpD,SAAAK,EAAU,MAAM;AACd,IAAAH,EAAkBE,EAAkB,EAAE,YAAAL,GAAY,kBAAAC,EAAA,CAAkB,CAAC;AAAA,EACvE,GAAG,CAACD,GAAYC,CAAgB,CAAC,GAE1BC;AACT;AAEA,SAASG,EAAkB;AAAA,EACzB,YAAAL;AAAA,EACA,kBAAAC;AACF,GAGG;AACD,SAAOD,IAAa,aAAaC;AACnC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyboardControls.js","sources":["../../lib/hooks/useKeyboardControls.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, type KeyboardEvent } from 'react';\nimport { CODE, KEY } from './keyboard.constants';\n\ninterface Options {\n up?: VoidFunction;\n down?: VoidFunction;\n left?: VoidFunction;\n right?: VoidFunction;\n start?: VoidFunction;\n end?: VoidFunction;\n activate?: VoidFunction;\n}\n\nconst isActivateKey = (event: KeyboardEvent<HTMLDivElement>) => {\n return (\n event.key === KEY.ENTER ||\n event.key === KEY.SPACE ||\n event.key === KEY.SPACEBAR ||\n event.code === CODE.ENTER ||\n event.code === CODE.SPACE\n );\n};\n\nconst voidFn = () => {};\n\nexport const useKeyboardControls = ({\n up = voidFn,\n down = voidFn,\n left = voidFn,\n right = voidFn,\n start = voidFn,\n end = voidFn,\n activate = voidFn,\n}: Options) => {\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (isActivateKey(event)) {\n return activate();\n }\n\n if (event.code === CODE.HOME) {\n event.preventDefault();\n\n return start();\n }\n\n if (event.code === CODE.END) {\n event.preventDefault();\n\n return end();\n }\n\n if (event.code === CODE.ARROW_UP) {\n event.preventDefault();\n\n return up();\n }\n\n if (event.code === CODE.ARROW_DOWN) {\n event.preventDefault();\n\n return down();\n }\n\n if (event.code === CODE.ARROW_RIGHT) {\n event.preventDefault();\n\n return right();\n }\n\n if (event.code === CODE.ARROW_LEFT) {\n event.preventDefault();\n\n return left();\n }\n },\n [activate, down, end, left, right, start, up],\n );\n\n return handleKeyDown;\n};\n"],"names":["isActivateKey","event","KEY","CODE","voidFn","useKeyboardControls","up","down","left","right","start","end","activate","useCallback"],"mappings":";;;AAeA,MAAMA,IAAgB,CAACC,MAEnBA,EAAM,QAAQC,EAAI,SAClBD,EAAM,QAAQC,EAAI,SAClBD,EAAM,QAAQC,EAAI,YAClBD,EAAM,SAASE,EAAK,SACpBF,EAAM,SAASE,EAAK,OAIlBC,IAAS,MAAM;AAAC,GAETC,IAAsB,CAAC;AAAA,EAClC,IAAAC,IAAKF;AAAA,EACL,MAAAG,IAAOH;AAAA,EACP,MAAAI,IAAOJ;AAAA,EACP,OAAAK,IAAQL;AAAA,EACR,OAAAM,IAAQN;AAAA,EACR,KAAAO,IAAMP;AAAA,EACN,UAAAQ,IAAWR;AACb,MACwBS;AAAA,EACpB,CAACZ,MAAyC;AACpC,QAAAD,EAAcC,CAAK;AACrB,aAAOW,EAAS;AAGd,QAAAX,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAe,GAEdS,EAAM;AAGX,QAAAT,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAe,GAEdU,EAAI;AAGT,QAAAV,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAe,GAEdK,EAAG;AAGR,QAAAL,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAe,GAEdM,EAAK;AAGV,QAAAN,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAe,GAEdQ,EAAM;AAGX,QAAAR,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAe,GAEdO,EAAK;AAAA,EAEhB;AAAA,EACA,CAACI,GAAUL,GAAMI,GAAKH,GAAMC,GAAOC,GAAOJ,CAAE;AAAA;"}
1
+ {"version":3,"file":"useKeyboardControls.js","sources":["../../lib/hooks/useKeyboardControls.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, type KeyboardEvent } from 'react';\nimport { CODE, KEY } from './keyboard.constants';\n\ninterface Options {\n up?: VoidFunction;\n down?: VoidFunction;\n left?: VoidFunction;\n right?: VoidFunction;\n start?: VoidFunction;\n end?: VoidFunction;\n activate?: VoidFunction;\n}\n\nconst isActivateKey = (event: KeyboardEvent<HTMLDivElement>) => {\n return (\n event.key === KEY.ENTER ||\n event.key === KEY.SPACE ||\n event.key === KEY.SPACEBAR ||\n event.code === CODE.ENTER ||\n event.code === CODE.SPACE\n );\n};\n\nconst voidFn = () => {};\n\nexport const useKeyboardControls = ({\n up = voidFn,\n down = voidFn,\n left = voidFn,\n right = voidFn,\n start = voidFn,\n end = voidFn,\n activate = voidFn,\n}: Options) => {\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (isActivateKey(event)) {\n return activate();\n }\n\n if (event.code === CODE.HOME) {\n event.preventDefault();\n\n return start();\n }\n\n if (event.code === CODE.END) {\n event.preventDefault();\n\n return end();\n }\n\n if (event.code === CODE.ARROW_UP) {\n event.preventDefault();\n\n return up();\n }\n\n if (event.code === CODE.ARROW_DOWN) {\n event.preventDefault();\n\n return down();\n }\n\n if (event.code === CODE.ARROW_RIGHT) {\n event.preventDefault();\n\n return right();\n }\n\n if (event.code === CODE.ARROW_LEFT) {\n event.preventDefault();\n\n return left();\n }\n },\n [activate, down, end, left, right, start, up],\n );\n\n return handleKeyDown;\n};\n"],"names":["isActivateKey","event","KEY","CODE","voidFn","useKeyboardControls","up","down","left","right","start","end","activate","useCallback"],"mappings":";;;AAeA,MAAMA,IAAgB,CAACC,MAEnBA,EAAM,QAAQC,EAAI,SAClBD,EAAM,QAAQC,EAAI,SAClBD,EAAM,QAAQC,EAAI,YAClBD,EAAM,SAASE,EAAK,SACpBF,EAAM,SAASE,EAAK,OAIlBC,IAAS,MAAM;AAAC,GAETC,IAAsB,CAAC;AAAA,EAClC,IAAAC,IAAKF;AAAA,EACL,MAAAG,IAAOH;AAAA,EACP,MAAAI,IAAOJ;AAAA,EACP,OAAAK,IAAQL;AAAA,EACR,OAAAM,IAAQN;AAAA,EACR,KAAAO,IAAMP;AAAA,EACN,UAAAQ,IAAWR;AACb,MACwBS;AAAA,EACpB,CAACZ,MAAyC;AACxC,QAAID,EAAcC,CAAK;AACrB,aAAOW,EAAA;AAGT,QAAIX,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECS,EAAA;AAGT,QAAIT,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECU,EAAA;AAGT,QAAIV,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECK,EAAA;AAGT,QAAIL,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECM,EAAA;AAGT,QAAIN,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECQ,EAAA;AAGT,QAAIR,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECO,EAAA;AAAA,EAEX;AAAA,EACA,CAACI,GAAUL,GAAMI,GAAKH,GAAMC,GAAOC,GAAOJ,CAAE;AAAA;"}
@@ -0,0 +1,2 @@
1
+ import useResizeObserver from 'use-resize-observer';
2
+ export default useResizeObserver;
@@ -0,0 +1,84 @@
1
+ import { R as E } from "../chunks/ResizeObserver.js";
2
+ import { useRef as f, useState as B, useEffect as h, useCallback as s, useMemo as k } from "react";
3
+ function C(e, t) {
4
+ var n = f(null), i = f(null);
5
+ i.current = t;
6
+ var r = f(null);
7
+ h(function() {
8
+ d();
9
+ });
10
+ var d = s(function() {
11
+ var u = r.current, o = i.current, c = u || (o ? o instanceof Element ? o : o.current : null);
12
+ n.current && n.current.element === c && n.current.subscriber === e || (n.current && n.current.cleanup && n.current.cleanup(), n.current = {
13
+ element: c,
14
+ subscriber: e,
15
+ // Only calling the subscriber, if there's an actual element to report.
16
+ // Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.
17
+ cleanup: c ? e(c) : void 0
18
+ });
19
+ }, [e]);
20
+ return h(function() {
21
+ return function() {
22
+ n.current && n.current.cleanup && (n.current.cleanup(), n.current = null);
23
+ };
24
+ }, []), s(function(u) {
25
+ r.current = u, d();
26
+ }, [d]);
27
+ }
28
+ function S(e, t, n) {
29
+ return e[t] ? e[t][0] ? e[t][0][n] : (
30
+ // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current
31
+ // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.
32
+ // @ts-ignore
33
+ e[t][n]
34
+ ) : t === "contentBoxSize" ? e.contentRect[n === "inlineSize" ? "width" : "height"] : void 0;
35
+ }
36
+ function W(e) {
37
+ e === void 0 && (e = {});
38
+ var t = e.onResize, n = f(void 0);
39
+ n.current = t;
40
+ var i = e.round || Math.round, r = f(), d = B({
41
+ width: void 0,
42
+ height: void 0
43
+ }), u = d[0], o = d[1], c = f(!1);
44
+ h(function() {
45
+ return c.current = !1, function() {
46
+ c.current = !0;
47
+ };
48
+ }, []);
49
+ var a = f({
50
+ width: void 0,
51
+ height: void 0
52
+ }), b = C(s(function(R) {
53
+ return (!r.current || r.current.box !== e.box || r.current.round !== i) && (r.current = {
54
+ box: e.box,
55
+ round: i,
56
+ instance: new ResizeObserver(function(O) {
57
+ var w = O[0], x = e.box === "border-box" ? "borderBoxSize" : e.box === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", z = S(w, x, "inlineSize"), m = S(w, x, "blockSize"), l = z ? i(z) : void 0, v = m ? i(m) : void 0;
58
+ if (a.current.width !== l || a.current.height !== v) {
59
+ var g = {
60
+ width: l,
61
+ height: v
62
+ };
63
+ a.current.width = l, a.current.height = v, n.current ? n.current(g) : c.current || o(g);
64
+ }
65
+ })
66
+ }), r.current.instance.observe(R, {
67
+ box: e.box
68
+ }), function() {
69
+ r.current && r.current.instance.unobserve(R);
70
+ };
71
+ }, [e.box, i]), e.ref);
72
+ return k(function() {
73
+ return {
74
+ ref: b,
75
+ width: u.width,
76
+ height: u.height
77
+ };
78
+ }, [b, u.width, u.height]);
79
+ }
80
+ typeof window < "u" && !window.ResizeObserver && (window.ResizeObserver = E);
81
+ export {
82
+ W as default
83
+ };
84
+ //# sourceMappingURL=useResizeObserver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizeObserver.js","sources":["../../node_modules/use-resize-observer/dist/bundle.esm.js","../../lib/hooks/useResizeObserver.ts"],"sourcesContent":["import { useRef, useEffect, useCallback, useState, useMemo } from 'react';\n\n// This could've been more streamlined with internal state instead of abusing\n// refs to such extent, but then composing hooks and components could not opt out of unnecessary renders.\nfunction useResolvedElement(subscriber, refOrElement) {\n var lastReportRef = useRef(null);\n var refOrElementRef = useRef(null);\n refOrElementRef.current = refOrElement;\n var cbElementRef = useRef(null); // Calling re-evaluation after each render without using a dep array,\n // as the ref object's current value could've changed since the last render.\n\n useEffect(function () {\n evaluateSubscription();\n });\n var evaluateSubscription = useCallback(function () {\n var cbElement = cbElementRef.current;\n var refOrElement = refOrElementRef.current; // Ugly ternary. But smaller than an if-else block.\n\n var element = cbElement ? cbElement : refOrElement ? refOrElement instanceof Element ? refOrElement : refOrElement.current : null;\n\n if (lastReportRef.current && lastReportRef.current.element === element && lastReportRef.current.subscriber === subscriber) {\n return;\n }\n\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n }\n\n lastReportRef.current = {\n element: element,\n subscriber: subscriber,\n // Only calling the subscriber, if there's an actual element to report.\n // Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.\n cleanup: element ? subscriber(element) : undefined\n };\n }, [subscriber]); // making sure we call the cleanup function on unmount\n\n useEffect(function () {\n return function () {\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n lastReportRef.current = null;\n }\n };\n }, []);\n return useCallback(function (element) {\n cbElementRef.current = element;\n evaluateSubscription();\n }, [evaluateSubscription]);\n}\n\n// We're only using the first element of the size sequences, until future versions of the spec solidify on how\n// exactly it'll be used for fragments in multi-column scenarios:\n// From the spec:\n// > The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments,\n// > which occur in multi-column scenarios. However the current definitions of content rect and border box do not\n// > mention how those boxes are affected by multi-column layout. In this spec, there will only be a single\n// > ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column.\n// > A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface)\n//\n// Also, testing these new box options revealed that in both Chrome and FF everything is returned in the callback,\n// regardless of the \"box\" option.\n// The spec states the following on this:\n// > This does not have any impact on which box dimensions are returned to the defined callback when the event\n// > is fired, it solely defines which box the author wishes to observe layout changes on.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// I'm not exactly clear on what this means, especially when you consider a later section stating the following:\n// > This section is non-normative. An author may desire to observe more than one CSS box.\n// > In this case, author will need to use multiple ResizeObservers.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// Which is clearly not how current browser implementations behave, and seems to contradict the previous quote.\n// For this reason I decided to only return the requested size,\n// even though it seems we have access to results for all box types.\n// This also means that we get to keep the current api, being able to return a simple { width, height } pair,\n// regardless of box option.\nfunction extractSize(entry, boxProp, sizeType) {\n if (!entry[boxProp]) {\n if (boxProp === \"contentBoxSize\") {\n // The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.\n // See the 6th step in the description for the RO algorithm:\n // https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h\n // > Set this.contentRect to logical this.contentBoxSize given target and observedBox of \"content-box\".\n // In real browser implementations of course these objects differ, but the width/height values should be equivalent.\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n\n return undefined;\n } // A couple bytes smaller than calling Array.isArray() and just as effective here.\n\n\n return entry[boxProp][0] ? entry[boxProp][0][sizeType] : // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current\n // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.\n // @ts-ignore\n entry[boxProp][sizeType];\n}\n\nfunction useResizeObserver(opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n // Saving the callback as a ref. With this, I don't need to put onResize in the\n // effect dep array, and just passing in an anonymous function without memoising\n // will not reinstantiate the hook's ResizeObserver.\n var onResize = opts.onResize;\n var onResizeRef = useRef(undefined);\n onResizeRef.current = onResize;\n var round = opts.round || Math.round; // Using a single instance throughout the hook's lifetime\n\n var resizeObserverRef = useRef();\n\n var _useState = useState({\n width: undefined,\n height: undefined\n }),\n size = _useState[0],\n setSize = _useState[1]; // In certain edge cases the RO might want to report a size change just after\n // the component unmounted.\n\n\n var didUnmount = useRef(false);\n useEffect(function () {\n didUnmount.current = false;\n return function () {\n didUnmount.current = true;\n };\n }, []); // Using a ref to track the previous width / height to avoid unnecessary renders.\n\n var previous = useRef({\n width: undefined,\n height: undefined\n }); // This block is kinda like a useEffect, only it's called whenever a new\n // element could be resolved based on the ref option. It also has a cleanup\n // function.\n\n var refCallback = useResolvedElement(useCallback(function (element) {\n // We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.\n // This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.\n if (!resizeObserverRef.current || resizeObserverRef.current.box !== opts.box || resizeObserverRef.current.round !== round) {\n resizeObserverRef.current = {\n box: opts.box,\n round: round,\n instance: new ResizeObserver(function (entries) {\n var entry = entries[0];\n var boxProp = opts.box === \"border-box\" ? \"borderBoxSize\" : opts.box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n var reportedWidth = extractSize(entry, boxProp, \"inlineSize\");\n var reportedHeight = extractSize(entry, boxProp, \"blockSize\");\n var newWidth = reportedWidth ? round(reportedWidth) : undefined;\n var newHeight = reportedHeight ? round(reportedHeight) : undefined;\n\n if (previous.current.width !== newWidth || previous.current.height !== newHeight) {\n var newSize = {\n width: newWidth,\n height: newHeight\n };\n previous.current.width = newWidth;\n previous.current.height = newHeight;\n\n if (onResizeRef.current) {\n onResizeRef.current(newSize);\n } else {\n if (!didUnmount.current) {\n setSize(newSize);\n }\n }\n }\n })\n };\n }\n\n resizeObserverRef.current.instance.observe(element, {\n box: opts.box\n });\n return function () {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.instance.unobserve(element);\n }\n };\n }, [opts.box, round]), opts.ref);\n return useMemo(function () {\n return {\n ref: refCallback,\n width: size.width,\n height: size.height\n };\n }, [refCallback, size.width, size.height]);\n}\n\nexport { useResizeObserver as default };\n","import { ResizeObserver } from '@juggle/resize-observer';\nimport useResizeObserver from 'use-resize-observer';\n\nif (typeof window !== 'undefined' && !window.ResizeObserver) {\n window.ResizeObserver = ResizeObserver;\n}\n\nexport default useResizeObserver;\n"],"names":["useResolvedElement","subscriber","refOrElement","lastReportRef","useRef","refOrElementRef","cbElementRef","useEffect","evaluateSubscription","useCallback","cbElement","element","extractSize","entry","boxProp","sizeType","useResizeObserver","opts","onResize","onResizeRef","round","resizeObserverRef","_useState","useState","size","setSize","didUnmount","previous","refCallback","entries","reportedWidth","reportedHeight","newWidth","newHeight","newSize","useMemo","ResizeObserver"],"mappings":";;AAIA,SAASA,EAAmBC,GAAYC,GAAc;AACpD,MAAIC,IAAgBC,EAAO,IAAI,GAC3BC,IAAkBD,EAAO,IAAI;AACjC,EAAAC,EAAgB,UAAUH;AAC1B,MAAII,IAAeF,EAAO,IAAI;AAG9B,EAAAG,EAAU,WAAY;AACpB,IAAAC,EAAoB;AAAA,EACtB,CAAC;AACD,MAAIA,IAAuBC,EAAY,WAAY;AACjD,QAAIC,IAAYJ,EAAa,SACzBJ,IAAeG,EAAgB,SAE/BM,IAAUD,MAAwBR,IAAeA,aAAwB,UAAUA,IAAeA,EAAa,UAAU;AAE7H,IAAIC,EAAc,WAAWA,EAAc,QAAQ,YAAYQ,KAAWR,EAAc,QAAQ,eA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OkB,EAAQ,WAAY;AACzB,WAAO;AAAA,MACL,KAAKP;AAAA,MACL,OAAOJ,EAAK;AAAA,MACZ,QAAQA,EAAK;AAAA,IACnB;AAAA,EACE,GAAG,CAACI,GAAaJ,EAAK,OAAOA,EAAK,MAAM,CAAC;AAC3C;ACxLI,OAAO,SAAW,OAAe,CAAC,OAAO,mBAC3C,OAAO,iBAAiBY;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"useSafeBoop.js","sources":["../../node_modules/use-boop/dist/index.es.js","../../lib/hooks/useSafeBoop.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react';\nimport { useSpring } from 'react-spring';\n\nvar QUERY = '(prefers-reduced-motion: no-preference)';\nvar getInitialState = function () {\n return typeof window === 'undefined' ? true : !window.matchMedia(QUERY).matches;\n};\nvar usePrefersReducedMotion = function () {\n var _a = useState(getInitialState), reduceMotion = _a[0], setReduceMotion = _a[1];\n useEffect(function () {\n var mediaQueryList = window.matchMedia('(prefers-reduced-motion: no-preference)');\n var listener = function (event) {\n setReduceMotion(!event.matches);\n };\n mediaQueryList.addEventListener('change', listener);\n return function () { return mediaQueryList.removeEventListener('change', listener); };\n }, []);\n return reduceMotion;\n};\n\nvar useBoop = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.x, x = _c === void 0 ? 0 : _c, _d = _b.y, y = _d === void 0 ? 0 : _d, _e = _b.z, z = _e === void 0 ? 0 : _e, _f = _b.rotation, rotation = _f === void 0 ? 0 : _f, _g = _b.rx, rx = _g === void 0 ? 0 : _g, _h = _b.ry, ry = _h === void 0 ? 0 : _h, _j = _b.rz, rz = _j === void 0 ? rotation : _j, _k = _b.scale, scale = _k === void 0 ? 1 : _k, _l = _b.sx, sx = _l === void 0 ? scale || 1 : _l, _m = _b.sy, sy = _m === void 0 ? scale || 1 : _m, _o = _b.sz, sz = _o === void 0 ? scale || 1 : _o, _p = _b.skewX, skewX = _p === void 0 ? 0 : _p, _q = _b.skewY, skewY = _q === void 0 ? 0 : _q, _r = _b.timing, timing = _r === void 0 ? 150 : _r, _s = _b.springConfig, springConfig = _s === void 0 ? {\n tension: 300,\n friction: 10,\n } : _s, _t = _b.delay, delay = _t === void 0 ? 0 : _t;\n var prefersReducedMotion = usePrefersReducedMotion();\n var _u = useState(false), isBooped = _u[0], setIsBooped = _u[1];\n var _v = useState(false), isTriggered = _v[0], setIsTriggered = _v[1];\n var style = useSpring(prefersReducedMotion ? {} : {\n transform: isBooped\n ? \"translate3D(\" + x + \"px, \" + y + \"px, \" + z + \"px)\\n rotateX(\" + rx + \"deg) rotateY(\" + ry + \"deg) rotateZ(\" + rz + \"deg)\\n scale3D(\" + sx + \",\" + sy + \",\" + sz + \")\\n skew(\" + skewX + \"deg, \" + skewY + \"deg)\"\n : \"translate3D(0px, 0px, 0px)\\n rotateX(0deg) rotateY(0deg) rotateZ(0deg)\\n scale3D(1, 1, 1)\\n skew(0deg, 0deg)\",\n config: springConfig,\n immediate: prefersReducedMotion,\n });\n var trigger = useCallback(function () {\n if (!prefersReducedMotion) {\n setIsTriggered(true);\n }\n }, [prefersReducedMotion]);\n useEffect(function () {\n if (!isTriggered)\n return;\n var timeoutId = window.setTimeout(function () {\n setIsBooped(true);\n setIsTriggered(false);\n }, delay);\n return function () { return window.clearTimeout(timeoutId); };\n }, [isTriggered, delay]);\n useEffect(function () {\n if (!isBooped)\n return;\n var timeoutId = window.setTimeout(function () { return setIsBooped(false); }, timing);\n return function () { return window.clearTimeout(timeoutId); };\n }, [isBooped, timing]);\n return [style, trigger];\n};\n\nexport default useBoop;\n//# sourceMappingURL=index.es.js.map\n","import type { CSSProperties } from 'react';\nimport useBoop from 'use-boop';\n\ntype Args = Parameters<typeof useBoop>[0];\n\nexport const useSafeBoop = (boopArgs: Args): [CSSProperties, () => void] => {\n const [{ transform }, boopTrigger] = useBoop(boopArgs);\n\n return [\n {\n '--transform':\n transform ||\n `translate3D(0px, 0px, 0px)\n rotateX(0deg) rotateY(0deg) rotateZ(0deg)\n scale3D(1, 1, 1)\n skew(0deg, 0deg)`,\n transform: 'var(--transform)',\n } as CSSProperties,\n boopTrigger,\n ];\n};\n"],"names":["QUERY","getInitialState","usePrefersReducedMotion","_a","useState","reduceMotion","setReduceMotion","useEffect","mediaQueryList","listener","event","useBoop","_b","_c","x","_d","y","_e","z","_f","rotation","_g","rx","_h","ry","_j","rz","_k","scale","_l","sx","_m","sy","_o","sz","_p","skewX","_q","skewY","_r","timing","_s","springConfig","_t","delay","prefersReducedMotion","_u","isBooped","setIsBooped","_v","isTriggered","setIsTriggered","style","useSpring","trigger","useCallback","timeoutId","useSafeBoop","boopArgs","transform","boopTrigger"],"mappings":";;AAGA,IAAIA,IAAQ,2CACRC,IAAkB,WAAY;AAC9B,SAAO,OAAO,SAAW,MAAc,KAAO,CAAC,OAAO,WAAWD,CAAK,EAAE;AAC5E,GACIE,IAA0B,WAAY;AACtC,MAAIC,IAAKC,EAASH,CAAe,GAAGI,IAAeF,EAAG,CAAC,GAAGG,IAAkBH,EAAG,CAAC;AAChF,SAAAI,EAAU,WAAY;AAClB,QAAIC,IAAiB,OAAO,WAAW,yCAAyC,GAC5EC,IAAW,SAAUC,GAAO;AAC5B,MAAAJ,EAAgB,CAACI,EAAM,OAAO;AAAA,IAC1C;AACQ,WAAAF,EAAe,iBAAiB,UAAUC,CAAQ,GAC3C,WAAY;AAAE,aAAOD,EAAe,oBAAoB,UAAUC,CAAQ;AAAA;EACpF,GAAE,CAAE,CAAA,GACEJ;AACX,GAEIM,IAAU,SAAUR,GAAI;AACxB,MAAIS,IAAKT,MAAO,SAAS,CAAE,IAAGA,GAAIU,IAAKD,EAAG,GAAGE,IAAID,MAAO,SAAS,IAAIA,GAAIE,IAAKH,EAAG,GAAGI,IAAID,MAAO,SAAS,IAAIA,GAAIE,IAAKL,EAAG,GAAGM,IAAID,MAAO,SAAS,IAAIA,GAAIE,IAAKP,EAAG,UAAUQ,IAAWD,MAAO,SAAS,IAAIA,GAAIE,IAAKT,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UC,EAAY,WAAY;AAClC,IAAKV,KACDM,EAAe,EAAI;AAAA,EAE/B,GAAO,CAACN,CAAoB,CAAC;AACzB,SAAAtC,EAAU,WAAY;AAClB,QAAK2C,GAEL;AAAA,UAAIM,IAAY,OAAO,WAAW,WAAY;AAC1C,QAAAR,EAAY,EAAI,GAChBG,EAAe,EAAK;AAAA,MACvB,GAAEP,CAAK;AACR,aAAO,WAAY;AAAE,eAAO,OAAO,aAAaY,CAAS;AAAA,MAAE;AAAA;AAAA,EACnE,GAAO,CAACN,GAAaN,CAAK,CAAC,GACvBrC,EAAU,WAAY;AAClB,QAAKwC,GAEL;AAAA,UAAIS,IAAY,OAAO,WAAW,WAAY;AAAE,eAAOR,EAAY,EAAK;AAAA,SAAMR,CAAM;AACpF,aAAO,WAAY;AAAE,eAAO,OAAO,aAAagB,CAAS;AAAA,MAAE;AAAA;AAAA,EACnE,GAAO,CAACT,GAAUP,CAAM,CAAC,GACd,CAACY,GAAOE,CAAO;AAC1B;ACnDa,MAAAG,KAAc,CAACC,MAAgD;AAC1E,QAAM,CAAC,EAAE,WAAAC,KAAaC,CAAW,IAAIjD,EAAQ+C,CAAQ;AAE9C,SAAA;AAAA,IACL;AAAA,MACE,eACEC,KACA;AAAA;AAAA;AAAA;AAAA,MAIF,WAAW;AAAA,IACb;AAAA,IACAC;AAAA,EAAA;AAEJ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"useSafeBoop.js","sources":["../../node_modules/use-boop/dist/index.es.js","../../lib/hooks/useSafeBoop.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react';\nimport { useSpring } from 'react-spring';\n\nvar QUERY = '(prefers-reduced-motion: no-preference)';\nvar getInitialState = function () {\n return typeof window === 'undefined' ? true : !window.matchMedia(QUERY).matches;\n};\nvar usePrefersReducedMotion = function () {\n var _a = useState(getInitialState), reduceMotion = _a[0], setReduceMotion = _a[1];\n useEffect(function () {\n var mediaQueryList = window.matchMedia('(prefers-reduced-motion: no-preference)');\n var listener = function (event) {\n setReduceMotion(!event.matches);\n };\n mediaQueryList.addEventListener('change', listener);\n return function () { return mediaQueryList.removeEventListener('change', listener); };\n }, []);\n return reduceMotion;\n};\n\nvar useBoop = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.x, x = _c === void 0 ? 0 : _c, _d = _b.y, y = _d === void 0 ? 0 : _d, _e = _b.z, z = _e === void 0 ? 0 : _e, _f = _b.rotation, rotation = _f === void 0 ? 0 : _f, _g = _b.rx, rx = _g === void 0 ? 0 : _g, _h = _b.ry, ry = _h === void 0 ? 0 : _h, _j = _b.rz, rz = _j === void 0 ? rotation : _j, _k = _b.scale, scale = _k === void 0 ? 1 : _k, _l = _b.sx, sx = _l === void 0 ? scale || 1 : _l, _m = _b.sy, sy = _m === void 0 ? scale || 1 : _m, _o = _b.sz, sz = _o === void 0 ? scale || 1 : _o, _p = _b.skewX, skewX = _p === void 0 ? 0 : _p, _q = _b.skewY, skewY = _q === void 0 ? 0 : _q, _r = _b.timing, timing = _r === void 0 ? 150 : _r, _s = _b.springConfig, springConfig = _s === void 0 ? {\n tension: 300,\n friction: 10,\n } : _s, _t = _b.delay, delay = _t === void 0 ? 0 : _t;\n var prefersReducedMotion = usePrefersReducedMotion();\n var _u = useState(false), isBooped = _u[0], setIsBooped = _u[1];\n var _v = useState(false), isTriggered = _v[0], setIsTriggered = _v[1];\n var style = useSpring(prefersReducedMotion ? {} : {\n transform: isBooped\n ? \"translate3D(\" + x + \"px, \" + y + \"px, \" + z + \"px)\\n rotateX(\" + rx + \"deg) rotateY(\" + ry + \"deg) rotateZ(\" + rz + \"deg)\\n scale3D(\" + sx + \",\" + sy + \",\" + sz + \")\\n skew(\" + skewX + \"deg, \" + skewY + \"deg)\"\n : \"translate3D(0px, 0px, 0px)\\n rotateX(0deg) rotateY(0deg) rotateZ(0deg)\\n scale3D(1, 1, 1)\\n skew(0deg, 0deg)\",\n config: springConfig,\n immediate: prefersReducedMotion,\n });\n var trigger = useCallback(function () {\n if (!prefersReducedMotion) {\n setIsTriggered(true);\n }\n }, [prefersReducedMotion]);\n useEffect(function () {\n if (!isTriggered)\n return;\n var timeoutId = window.setTimeout(function () {\n setIsBooped(true);\n setIsTriggered(false);\n }, delay);\n return function () { return window.clearTimeout(timeoutId); };\n }, [isTriggered, delay]);\n useEffect(function () {\n if (!isBooped)\n return;\n var timeoutId = window.setTimeout(function () { return setIsBooped(false); }, timing);\n return function () { return window.clearTimeout(timeoutId); };\n }, [isBooped, timing]);\n return [style, trigger];\n};\n\nexport default useBoop;\n//# sourceMappingURL=index.es.js.map\n","import type { CSSProperties } from 'react';\nimport useBoop from 'use-boop';\n\ntype Args = Parameters<typeof useBoop>[0];\n\nexport const useSafeBoop = (boopArgs: Args): [CSSProperties, () => void] => {\n const [{ transform }, boopTrigger] = useBoop(boopArgs);\n\n return [\n {\n '--transform':\n transform ||\n `translate3D(0px, 0px, 0px)\n rotateX(0deg) rotateY(0deg) rotateZ(0deg)\n scale3D(1, 1, 1)\n skew(0deg, 0deg)`,\n transform: 'var(--transform)',\n } as CSSProperties,\n boopTrigger,\n ];\n};\n"],"names":["QUERY","getInitialState","usePrefersReducedMotion","_a","useState","reduceMotion","setReduceMotion","useEffect","mediaQueryList","listener","event","useBoop","_b","_c","x","_d","y","_e","z","_f","rotation","_g","rx","_h","ry","_j","rz","_k","scale","_l","sx","_m","sy","_o","sz","_p","skewX","_q","skewY","_r","timing","_s","springConfig","_t","delay","prefersReducedMotion","_u","isBooped","setIsBooped","_v","isTriggered","setIsTriggered","style","useSpring","trigger","useCallback","timeoutId","useSafeBoop","boopArgs","transform","boopTrigger"],"mappings":";;AAGA,IAAIA,IAAQ,2CACRC,IAAkB,WAAY;AAC9B,SAAO,OAAO,SAAW,MAAc,KAAO,CAAC,OAAO,WAAWD,CAAK,EAAE;AAC5E,GACIE,IAA0B,WAAY;AACtC,MAAIC,IAAKC,EAASH,CAAe,GAAGI,IAAeF,EAAG,CAAC,GAAGG,IAAkBH,EAAG,CAAC;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O,MAAMG,KAAc,CAACC,MAAgD;AAC1E,QAAM,CAAC,EAAE,WAAAC,EAAA,GAAaC,CAAW,IAAIjD,EAAQ+C,CAAQ;AAErD,SAAO;AAAA,IACL;AAAA,MACE,eACEC,KACA;AAAA;AAAA;AAAA;AAAA,MAIF,WAAW;AAAA,IAAA;AAAA,IAEbC;AAAA,EAAA;AAEJ;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"useValue.js","sources":["../../lib/hooks/useValue.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport interface UseValueProps<Value = string, InitialValue = Value> {\n name: string;\n initialValue?: InitialValue;\n defaultValue?: Value | string;\n formatter?: (v: Value) => Value;\n onChange?: (name: string, value: Value) => void;\n}\n\nexport function useValue<Value = string, InitialValue = Value>({\n name,\n initialValue,\n onChange,\n defaultValue = '',\n formatter = (v: Value) => v as unknown as Value,\n}: UseValueProps<Value, InitialValue>) {\n const [value, setValue] = useState<Value>(formatter((initialValue || defaultValue) as Value));\n\n useEffect(() => {\n initialValue !== undefined && setValue(formatter(initialValue as Value));\n }, [initialValue]);\n\n function setNewValue(newValue: Value) {\n newValue = formatter(newValue);\n setValue(newValue);\n onChange && onChange(name, newValue);\n }\n\n function resetValue() {\n setValue(defaultValue as Value);\n }\n\n return {\n value,\n setValue: setNewValue,\n resetValue,\n };\n}\n"],"names":["useValue","name","initialValue","onChange","defaultValue","formatter","v","value","setValue","useState","useEffect","setNewValue","newValue","resetValue"],"mappings":";AAUO,SAASA,EAA+C;AAAA,EAC7D,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,WAAAC,IAAY,CAACC,MAAaA;AAC5B,GAAuC;AAC/B,QAAA,CAACC,GAAOC,CAAQ,IAAIC,EAAgBJ,EAAWH,KAAgBE,CAAsB,CAAC;AAE5F,EAAAM,EAAU,MAAM;AACd,IAAAR,MAAiB,UAAaM,EAASH,EAAUH,CAAqB,CAAC;AAAA,EAAA,GACtE,CAACA,CAAY,CAAC;AAEjB,WAASS,EAAYC,GAAiB;AACpC,IAAAA,IAAWP,EAAUO,CAAQ,GAC7BJ,EAASI,CAAQ,GACLT,KAAAA,EAASF,GAAMW,CAAQ;AAAA,EACrC;AAEA,WAASC,IAAa;AACpB,IAAAL,EAASJ,CAAqB;AAAA,EAChC;AAEO,SAAA;AAAA,IACL,OAAAG;AAAA,IACA,UAAUI;AAAA,IACV,YAAAE;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useValue.js","sources":["../../lib/hooks/useValue.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport interface UseValueProps<Value = string, InitialValue = Value> {\n name: string;\n initialValue?: InitialValue;\n defaultValue?: Value | string;\n formatter?: (v: Value) => Value;\n onChange?: (name: string, value: Value) => void;\n}\n\nexport function useValue<Value = string, InitialValue = Value>({\n name,\n initialValue,\n onChange,\n defaultValue = '',\n formatter = (v: Value) => v as unknown as Value,\n}: UseValueProps<Value, InitialValue>) {\n const [value, setValue] = useState<Value>(formatter((initialValue || defaultValue) as Value));\n\n useEffect(() => {\n initialValue !== undefined && setValue(formatter(initialValue as Value));\n }, [initialValue]);\n\n function setNewValue(newValue: Value) {\n newValue = formatter(newValue);\n setValue(newValue);\n onChange && onChange(name, newValue);\n }\n\n function resetValue() {\n setValue(defaultValue as Value);\n }\n\n return {\n value,\n setValue: setNewValue,\n resetValue,\n };\n}\n"],"names":["useValue","name","initialValue","onChange","defaultValue","formatter","v","value","setValue","useState","useEffect","setNewValue","newValue","resetValue"],"mappings":";AAUO,SAASA,EAA+C;AAAA,EAC7D,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,WAAAC,IAAY,CAACC,MAAaA;AAC5B,GAAuC;AACrC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAgBJ,EAAWH,KAAgBE,CAAsB,CAAC;AAE5F,EAAAM,EAAU,MAAM;AACd,IAAAR,MAAiB,UAAaM,EAASH,EAAUH,CAAqB,CAAC;AAAA,EACzE,GAAG,CAACA,CAAY,CAAC;AAEjB,WAASS,EAAYC,GAAiB;AACpC,IAAAA,IAAWP,EAAUO,CAAQ,GAC7BJ,EAASI,CAAQ,GACjBT,KAAYA,EAASF,GAAMW,CAAQ;AAAA,EACrC;AAEA,WAASC,IAAa;AACpB,IAAAL,EAASJ,CAAqB;AAAA,EAChC;AAEA,SAAO;AAAA,IACL,OAAAG;AAAA,IACA,UAAUI;AAAA,IACV,YAAAE;AAAA,EAAA;AAEJ;"}
@@ -0,0 +1,16 @@
1
+ import type { ComponentProps, ComponentPropsWithoutRef, FunctionComponent } from 'react';
2
+ import type { ArrowsLabels } from './ArrowsLabels';
3
+ import { ArrowButton } from '../Buttons/ArrowButton';
4
+ export interface ArrowsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
5
+ color?: ComponentProps<typeof ArrowButton>['color'];
6
+ iconType?: 'ArrowDefault' | 'ArrowTail';
7
+ isDisabledHidden?: boolean;
8
+ isNextDisabled?: boolean;
9
+ isPrevDisabled?: boolean;
10
+ labels?: ArrowsLabels;
11
+ onNext: ComponentProps<typeof ArrowButton>['onClick'];
12
+ onPrev: ComponentProps<typeof ArrowButton>['onClick'];
13
+ size?: ComponentProps<typeof ArrowButton>['size'];
14
+ theme?: ComponentProps<typeof ArrowButton>['theme'];
15
+ }
16
+ export declare const Arrows: FunctionComponent<ArrowsProps>;
@@ -0,0 +1,66 @@
1
+ import { jsxs as x, jsx as p } from "react/jsx-runtime";
2
+ import { c as t } from "../../chunks/index.js";
3
+ import { ArrowButton as l } from "../Buttons/ArrowButton.js";
4
+ const A = ({
5
+ className: f,
6
+ color: o,
7
+ iconType: e = "ArrowDefault",
8
+ isDisabledHidden: n = !1,
9
+ isNextDisabled: r = !1,
10
+ isPrevDisabled: a = !1,
11
+ labels: s = {
12
+ next: "",
13
+ previous: ""
14
+ },
15
+ onNext: m,
16
+ onPrev: u,
17
+ size: i,
18
+ theme: c,
19
+ ...w
20
+ }) => /* @__PURE__ */ x(
21
+ "div",
22
+ {
23
+ ...w,
24
+ className: t(
25
+ "pointer-events-none flex w-full items-center justify-between gap-x-20",
26
+ f
27
+ ),
28
+ "data-name": "Arrows",
29
+ children: [
30
+ /* @__PURE__ */ p(
31
+ l,
32
+ {
33
+ className: t("pointer-events-auto transition-opacity", {
34
+ "opacity-0": n && a
35
+ }),
36
+ color: o,
37
+ disabled: a,
38
+ icon: `${e}Left`,
39
+ onClick: u,
40
+ size: i,
41
+ theme: c,
42
+ children: s.previous
43
+ }
44
+ ),
45
+ /* @__PURE__ */ p(
46
+ l,
47
+ {
48
+ className: t("pointer-events-auto transition-opacity", {
49
+ "opacity-0": n && r
50
+ }),
51
+ color: o,
52
+ disabled: r,
53
+ icon: `${e}Right`,
54
+ onClick: m,
55
+ size: i,
56
+ theme: c,
57
+ children: s.next
58
+ }
59
+ )
60
+ ]
61
+ }
62
+ );
63
+ export {
64
+ A as Arrows
65
+ };
66
+ //# sourceMappingURL=Arrows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Arrows.js","sources":["../../../lib/molecules/Arrows/Arrows.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { ComponentProps, ComponentPropsWithoutRef, FunctionComponent } from 'react';\n\nimport type { ArrowsLabels } from './ArrowsLabels';\n\nimport { ArrowButton } from '../Buttons/ArrowButton';\n\nexport interface ArrowsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n color?: ComponentProps<typeof ArrowButton>['color'];\n iconType?: 'ArrowDefault' | 'ArrowTail';\n isDisabledHidden?: boolean;\n isNextDisabled?: boolean;\n isPrevDisabled?: boolean;\n labels?: ArrowsLabels;\n onNext: ComponentProps<typeof ArrowButton>['onClick'];\n onPrev: ComponentProps<typeof ArrowButton>['onClick'];\n size?: ComponentProps<typeof ArrowButton>['size'];\n theme?: ComponentProps<typeof ArrowButton>['theme'];\n}\n\nexport const Arrows: FunctionComponent<ArrowsProps> = ({\n className,\n color,\n iconType = 'ArrowDefault',\n isDisabledHidden = false,\n isNextDisabled = false,\n isPrevDisabled = false,\n labels = {\n next: '',\n previous: '',\n },\n onNext,\n onPrev,\n size,\n theme,\n ...attrs\n}) => {\n return (\n <div\n {...attrs}\n className={classnames(\n 'pointer-events-none flex w-full items-center justify-between gap-x-20',\n className,\n )}\n data-name=\"Arrows\"\n >\n <ArrowButton\n className={classnames('pointer-events-auto transition-opacity', {\n 'opacity-0': isDisabledHidden && isPrevDisabled,\n })}\n color={color}\n disabled={isPrevDisabled}\n icon={`${iconType}Left`}\n onClick={onPrev}\n size={size}\n theme={theme}\n >\n {labels.previous}\n </ArrowButton>\n <ArrowButton\n className={classnames('pointer-events-auto transition-opacity', {\n 'opacity-0': isDisabledHidden && isNextDisabled,\n })}\n color={color}\n disabled={isNextDisabled}\n icon={`${iconType}Right`}\n onClick={onNext}\n size={size}\n theme={theme}\n >\n {labels.next}\n </ArrowButton>\n </div>\n );\n};\n"],"names":["Arrows","className","color","iconType","isDisabledHidden","isNextDisabled","isPrevDisabled","labels","onNext","onPrev","size","theme","attrs","jsxs","classnames","jsx","ArrowButton"],"mappings":";;;AAoBO,MAAMA,IAAyC,CAAC;AAAA,EACrD,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AAAA,EACnB,gBAAAC,IAAiB;AAAA,EACjB,gBAAAC,IAAiB;AAAA,EACjB,QAAAC,IAAS;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,EAAA;AAAA,EAEZ,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACE,GAAGD;AAAA,IACJ,WAAWE;AAAA,MACT;AAAA,MACAb;AAAA,IAAA;AAAA,IAEF,aAAU;AAAA,IAEV,UAAA;AAAA,MAAA,gBAAAc;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,WAAWF,EAAW,0CAA0C;AAAA,YAC9D,aAAaV,KAAoBE;AAAA,UAAA,CAClC;AAAA,UACD,OAAAJ;AAAA,UACA,UAAUI;AAAA,UACV,MAAM,GAAGH,CAAQ;AAAA,UACjB,SAASM;AAAA,UACT,MAAAC;AAAA,UACA,OAAAC;AAAA,UAEC,UAAAJ,EAAO;AAAA,QAAA;AAAA,MAAA;AAAA,MAEV,gBAAAQ;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,WAAWF,EAAW,0CAA0C;AAAA,YAC9D,aAAaV,KAAoBC;AAAA,UAAA,CAClC;AAAA,UACD,OAAAH;AAAA,UACA,UAAUG;AAAA,UACV,MAAM,GAAGF,CAAQ;AAAA,UACjB,SAASK;AAAA,UACT,MAAAE;AAAA,UACA,OAAAC;AAAA,UAEC,UAAAJ,EAAO;AAAA,QAAA;AAAA,MAAA;AAAA,IACV;AAAA,EAAA;AAAA;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=ArrowsLabels.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowsLabels.d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,50 +1 @@
1
- import type { ComponentProps, FunctionComponent } from 'react';
2
- import { Button } from './Buttons/Button';
3
- interface ArrowsProps {
4
- /**
5
- * onNext handler
6
- */
7
- onNext: () => void;
8
- /**
9
- * onPrev handler
10
- */
11
- onPrev: () => void;
12
- /**
13
- * Next label
14
- */
15
- nextLabel?: string;
16
- /**
17
- * Prev label
18
- */
19
- prevLabel?: string;
20
- /**
21
- * Disable next button
22
- */
23
- disableNext?: boolean;
24
- /**
25
- * Disable prev button
26
- */
27
- disablePrev?: boolean;
28
- /**
29
- * Additional class names
30
- */
31
- className?: string;
32
- /**
33
- * Theme
34
- */
35
- theme?: ComponentProps<typeof Button>['theme'];
36
- /**
37
- * Variant
38
- */
39
- variant?: ComponentProps<typeof Button>['variant'];
40
- /**
41
- * Arrow icon type
42
- */
43
- iconType?: 'ArrowDefault' | 'ArrowTail';
44
- /**
45
- * Hide disabled arrows
46
- */
47
- hideDisabled?: boolean;
48
- }
49
- export declare const Arrows: FunctionComponent<ArrowsProps>;
50
- export {};
1
+ export { Arrows } from './Arrows/Arrows';