@ozen-ui/kit 0.63.1 → 0.65.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 (261) hide show
  1. package/ChipGroup/package.json +5 -0
  2. package/InputOTP/package.json +5 -0
  3. package/Title/package.json +5 -0
  4. package/__inner__/cjs/components/ChipGroup/ChipGroup.css +16 -0
  5. package/__inner__/cjs/components/ChipGroup/ChipGroup.d.ts +4 -0
  6. package/__inner__/cjs/components/ChipGroup/ChipGroup.js +52 -0
  7. package/__inner__/cjs/components/ChipGroup/ChipGroupContext.d.ts +10 -0
  8. package/__inner__/cjs/components/ChipGroup/ChipGroupContext.js +5 -0
  9. package/__inner__/cjs/components/ChipGroup/constants.d.ts +5 -0
  10. package/__inner__/cjs/components/ChipGroup/constants.js +6 -0
  11. package/__inner__/cjs/components/ChipGroup/index.d.ts +2 -0
  12. package/__inner__/cjs/components/ChipGroup/index.js +5 -0
  13. package/__inner__/cjs/components/ChipGroup/types.d.ts +33 -0
  14. package/__inner__/cjs/components/ChipGroup/types.js +2 -0
  15. package/__inner__/cjs/components/ChipNext/Chip.css +50 -17
  16. package/__inner__/cjs/components/ChipNext/Chip.js +32 -5
  17. package/__inner__/cjs/components/ChipNext/types.d.ts +9 -5
  18. package/__inner__/cjs/components/ChipNext/types.js +9 -2
  19. package/__inner__/cjs/components/FormGroup/types.d.ts +2 -0
  20. package/__inner__/cjs/components/FormTitle/FormTitle.d.ts +1 -0
  21. package/__inner__/cjs/components/IconButtonNext/types.d.ts +4 -1
  22. package/__inner__/cjs/components/IconButtonNext/utils.d.ts +2 -2
  23. package/__inner__/cjs/components/InputOTP/InputOTP.css +60 -0
  24. package/__inner__/cjs/components/InputOTP/InputOTP.d.ts +4 -0
  25. package/__inner__/cjs/components/InputOTP/InputOTP.js +179 -0
  26. package/__inner__/cjs/components/InputOTP/constants.d.ts +8 -0
  27. package/__inner__/cjs/components/InputOTP/constants.js +13 -0
  28. package/__inner__/cjs/components/InputOTP/helper.d.ts +13 -0
  29. package/__inner__/cjs/components/InputOTP/helper.js +87 -0
  30. package/__inner__/cjs/components/InputOTP/hooks/index.d.ts +1 -0
  31. package/__inner__/cjs/components/InputOTP/hooks/index.js +4 -0
  32. package/__inner__/cjs/components/InputOTP/hooks/useInputOTPEvents.d.ts +20 -0
  33. package/__inner__/cjs/components/InputOTP/hooks/useInputOTPEvents.js +183 -0
  34. package/__inner__/cjs/components/InputOTP/index.d.ts +3 -0
  35. package/__inner__/cjs/components/InputOTP/index.js +6 -0
  36. package/__inner__/cjs/components/InputOTP/presets.d.ts +12 -0
  37. package/__inner__/cjs/components/InputOTP/presets.js +27 -0
  38. package/__inner__/cjs/components/InputOTP/types.d.ts +101 -0
  39. package/__inner__/cjs/components/InputOTP/types.js +7 -0
  40. package/__inner__/cjs/components/TagNext/types.d.ts +1 -1
  41. package/__inner__/cjs/components/TagNext/types.js +1 -0
  42. package/__inner__/cjs/components/ThemeProvider/types.d.ts +7 -2
  43. package/__inner__/cjs/components/Title/Title.d.ts +4 -0
  44. package/__inner__/cjs/components/Title/Title.js +27 -0
  45. package/__inner__/cjs/components/Title/TitleContext.d.ts +8 -0
  46. package/__inner__/cjs/components/Title/TitleContext.js +17 -0
  47. package/__inner__/cjs/components/Title/components/index.d.ts +1 -0
  48. package/__inner__/cjs/components/Title/components/index.js +4 -0
  49. package/__inner__/cjs/components/Title/components/variant/TitleVariant.d.ts +2 -0
  50. package/__inner__/cjs/components/Title/components/variant/TitleVariant.js +24 -0
  51. package/__inner__/cjs/components/Title/components/variant/index.d.ts +4 -0
  52. package/__inner__/cjs/components/Title/components/variant/index.js +7 -0
  53. package/__inner__/cjs/components/Title/components/variant/main/TitleMain.css +38 -0
  54. package/__inner__/cjs/components/Title/components/variant/main/TitleMain.d.ts +4 -0
  55. package/__inner__/cjs/components/Title/components/variant/main/TitleMain.js +35 -0
  56. package/__inner__/cjs/components/Title/components/variant/main/config.d.ts +3 -0
  57. package/__inner__/cjs/components/Title/components/variant/main/config.js +7 -0
  58. package/__inner__/cjs/components/Title/components/variant/main/index.d.ts +2 -0
  59. package/__inner__/cjs/components/Title/components/variant/main/index.js +5 -0
  60. package/__inner__/cjs/components/Title/components/variant/main/types.d.ts +13 -0
  61. package/__inner__/cjs/components/Title/components/variant/main/types.js +2 -0
  62. package/__inner__/cjs/components/Title/components/variant/secondary/TitleSecondary.css +26 -0
  63. package/__inner__/cjs/components/Title/components/variant/secondary/TitleSecondary.d.ts +4 -0
  64. package/__inner__/cjs/components/Title/components/variant/secondary/TitleSecondary.js +15 -0
  65. package/__inner__/cjs/components/Title/components/variant/secondary/index.d.ts +2 -0
  66. package/__inner__/cjs/components/Title/components/variant/secondary/index.js +5 -0
  67. package/__inner__/cjs/components/Title/components/variant/secondary/types.d.ts +10 -0
  68. package/__inner__/cjs/components/Title/components/variant/secondary/types.js +2 -0
  69. package/__inner__/cjs/components/Title/components/variant/types.d.ts +8 -0
  70. package/__inner__/cjs/components/Title/components/variant/types.js +2 -0
  71. package/__inner__/cjs/components/Title/constants.d.ts +4 -0
  72. package/__inner__/cjs/components/Title/constants.js +6 -0
  73. package/__inner__/cjs/components/Title/entities/icon.d.ts +3 -0
  74. package/__inner__/cjs/components/Title/entities/icon.js +2 -0
  75. package/__inner__/cjs/components/Title/entities/index.d.ts +3 -0
  76. package/__inner__/cjs/components/Title/entities/index.js +6 -0
  77. package/__inner__/cjs/components/Title/entities/size.d.ts +2 -0
  78. package/__inner__/cjs/components/Title/entities/size.js +4 -0
  79. package/__inner__/cjs/components/Title/entities/variant.d.ts +7 -0
  80. package/__inner__/cjs/components/Title/entities/variant.js +4 -0
  81. package/__inner__/cjs/components/Title/index.d.ts +4 -0
  82. package/__inner__/cjs/components/Title/index.js +7 -0
  83. package/__inner__/cjs/components/Title/modules/icon-button/TitleIconButton.d.ts +3 -0
  84. package/__inner__/cjs/components/Title/modules/icon-button/TitleIconButton.js +16 -0
  85. package/__inner__/cjs/components/Title/modules/icon-button/constants.d.ts +1 -0
  86. package/__inner__/cjs/components/Title/modules/icon-button/constants.js +4 -0
  87. package/__inner__/cjs/components/Title/modules/icon-button/index.d.ts +2 -0
  88. package/__inner__/cjs/components/Title/modules/icon-button/index.js +5 -0
  89. package/__inner__/cjs/components/Title/modules/icon-button/types.d.ts +6 -0
  90. package/__inner__/cjs/components/Title/modules/icon-button/types.js +2 -0
  91. package/__inner__/cjs/components/Title/modules/index.d.ts +2 -0
  92. package/__inner__/cjs/components/Title/modules/index.js +5 -0
  93. package/__inner__/cjs/components/Title/modules/tag/TitleTag.css +4 -0
  94. package/__inner__/cjs/components/Title/modules/tag/TitleTag.d.ts +3 -0
  95. package/__inner__/cjs/components/Title/modules/tag/TitleTag.js +11 -0
  96. package/__inner__/cjs/components/Title/modules/tag/constants.d.ts +1 -0
  97. package/__inner__/cjs/components/Title/modules/tag/constants.js +4 -0
  98. package/__inner__/cjs/components/Title/modules/tag/index.d.ts +2 -0
  99. package/__inner__/cjs/components/Title/modules/tag/index.js +5 -0
  100. package/__inner__/cjs/components/Title/modules/tag/types.d.ts +6 -0
  101. package/__inner__/cjs/components/Title/modules/tag/types.js +2 -0
  102. package/__inner__/cjs/components/Title/types.d.ts +10 -0
  103. package/__inner__/cjs/components/Title/types.js +2 -0
  104. package/__inner__/cjs/constants/environment/index.d.ts +2 -0
  105. package/__inner__/cjs/constants/environment/index.js +5 -0
  106. package/__inner__/cjs/constants/environment/isDev.d.ts +1 -0
  107. package/__inner__/cjs/constants/environment/isDev.js +5 -0
  108. package/__inner__/cjs/constants/environment/isProduction.d.ts +1 -0
  109. package/__inner__/cjs/constants/environment/isProduction.js +4 -0
  110. package/__inner__/cjs/hooks/useStoredValue/index.d.ts +3 -0
  111. package/__inner__/cjs/hooks/useStoredValue/index.js +6 -0
  112. package/__inner__/cjs/hooks/useStoredValue/types.d.ts +2 -0
  113. package/__inner__/cjs/hooks/useStoredValue/types.js +2 -0
  114. package/__inner__/cjs/hooks/useStoredValue/useStoredValue.d.ts +4 -0
  115. package/__inner__/cjs/hooks/useStoredValue/useStoredValue.js +16 -0
  116. package/__inner__/cjs/hooks/useStoredValue/utils.d.ts +2 -0
  117. package/__inner__/cjs/hooks/useStoredValue/utils.js +8 -0
  118. package/__inner__/cjs/types/object/withPartial.d.ts +3 -0
  119. package/__inner__/cjs/types/object/withPartial.js +2 -0
  120. package/__inner__/cjs/utils/array/create-empty/createEmptyArray.d.ts +1 -0
  121. package/__inner__/cjs/utils/array/create-empty/createEmptyArray.js +8 -0
  122. package/__inner__/cjs/utils/array/create-empty/index.d.ts +1 -0
  123. package/__inner__/cjs/utils/array/create-empty/index.js +4 -0
  124. package/__inner__/cjs/utils/array/create-filled/createFilledArray.d.ts +1 -0
  125. package/__inner__/cjs/utils/array/create-filled/createFilledArray.js +7 -0
  126. package/__inner__/cjs/utils/array/create-filled/index.d.ts +1 -0
  127. package/__inner__/cjs/utils/array/create-filled/index.js +4 -0
  128. package/__inner__/cjs/utils/array/index.d.ts +2 -0
  129. package/__inner__/cjs/utils/array/index.js +5 -0
  130. package/__inner__/cjs/utils/isFunction.d.ts +1 -0
  131. package/__inner__/cjs/utils/isFunction.js +8 -0
  132. package/__inner__/esm/components/ChipGroup/ChipGroup.css +16 -0
  133. package/__inner__/esm/components/ChipGroup/ChipGroup.d.ts +4 -0
  134. package/__inner__/esm/components/ChipGroup/ChipGroup.js +49 -0
  135. package/__inner__/esm/components/ChipGroup/ChipGroupContext.d.ts +10 -0
  136. package/__inner__/esm/components/ChipGroup/ChipGroupContext.js +2 -0
  137. package/__inner__/esm/components/ChipGroup/constants.d.ts +5 -0
  138. package/__inner__/esm/components/ChipGroup/constants.js +3 -0
  139. package/__inner__/esm/components/ChipGroup/index.d.ts +2 -0
  140. package/__inner__/esm/components/ChipGroup/index.js +2 -0
  141. package/__inner__/esm/components/ChipGroup/types.d.ts +33 -0
  142. package/__inner__/esm/components/ChipGroup/types.js +1 -0
  143. package/__inner__/esm/components/ChipNext/Chip.css +50 -17
  144. package/__inner__/esm/components/ChipNext/Chip.js +32 -5
  145. package/__inner__/esm/components/ChipNext/types.d.ts +9 -5
  146. package/__inner__/esm/components/ChipNext/types.js +8 -1
  147. package/__inner__/esm/components/FormGroup/types.d.ts +2 -0
  148. package/__inner__/esm/components/FormTitle/FormTitle.d.ts +1 -0
  149. package/__inner__/esm/components/IconButtonNext/types.d.ts +4 -1
  150. package/__inner__/esm/components/IconButtonNext/utils.d.ts +2 -2
  151. package/__inner__/esm/components/InputOTP/InputOTP.css +60 -0
  152. package/__inner__/esm/components/InputOTP/InputOTP.d.ts +4 -0
  153. package/__inner__/esm/components/InputOTP/InputOTP.js +176 -0
  154. package/__inner__/esm/components/InputOTP/constants.d.ts +8 -0
  155. package/__inner__/esm/components/InputOTP/constants.js +10 -0
  156. package/__inner__/esm/components/InputOTP/helper.d.ts +13 -0
  157. package/__inner__/esm/components/InputOTP/helper.js +79 -0
  158. package/__inner__/esm/components/InputOTP/hooks/index.d.ts +1 -0
  159. package/__inner__/esm/components/InputOTP/hooks/index.js +1 -0
  160. package/__inner__/esm/components/InputOTP/hooks/useInputOTPEvents.d.ts +20 -0
  161. package/__inner__/esm/components/InputOTP/hooks/useInputOTPEvents.js +179 -0
  162. package/__inner__/esm/components/InputOTP/index.d.ts +3 -0
  163. package/__inner__/esm/components/InputOTP/index.js +3 -0
  164. package/__inner__/esm/components/InputOTP/presets.d.ts +12 -0
  165. package/__inner__/esm/components/InputOTP/presets.js +24 -0
  166. package/__inner__/esm/components/InputOTP/types.d.ts +101 -0
  167. package/__inner__/esm/components/InputOTP/types.js +4 -0
  168. package/__inner__/esm/components/TagNext/types.d.ts +1 -1
  169. package/__inner__/esm/components/TagNext/types.js +1 -0
  170. package/__inner__/esm/components/ThemeProvider/types.d.ts +7 -2
  171. package/__inner__/esm/components/Title/Title.d.ts +4 -0
  172. package/__inner__/esm/components/Title/Title.js +24 -0
  173. package/__inner__/esm/components/Title/TitleContext.d.ts +8 -0
  174. package/__inner__/esm/components/Title/TitleContext.js +12 -0
  175. package/__inner__/esm/components/Title/components/index.d.ts +1 -0
  176. package/__inner__/esm/components/Title/components/index.js +1 -0
  177. package/__inner__/esm/components/Title/components/variant/TitleVariant.d.ts +2 -0
  178. package/__inner__/esm/components/Title/components/variant/TitleVariant.js +21 -0
  179. package/__inner__/esm/components/Title/components/variant/index.d.ts +4 -0
  180. package/__inner__/esm/components/Title/components/variant/index.js +4 -0
  181. package/__inner__/esm/components/Title/components/variant/main/TitleMain.css +38 -0
  182. package/__inner__/esm/components/Title/components/variant/main/TitleMain.d.ts +4 -0
  183. package/__inner__/esm/components/Title/components/variant/main/TitleMain.js +32 -0
  184. package/__inner__/esm/components/Title/components/variant/main/config.d.ts +3 -0
  185. package/__inner__/esm/components/Title/components/variant/main/config.js +4 -0
  186. package/__inner__/esm/components/Title/components/variant/main/index.d.ts +2 -0
  187. package/__inner__/esm/components/Title/components/variant/main/index.js +2 -0
  188. package/__inner__/esm/components/Title/components/variant/main/types.d.ts +13 -0
  189. package/__inner__/esm/components/Title/components/variant/main/types.js +1 -0
  190. package/__inner__/esm/components/Title/components/variant/secondary/TitleSecondary.css +26 -0
  191. package/__inner__/esm/components/Title/components/variant/secondary/TitleSecondary.d.ts +4 -0
  192. package/__inner__/esm/components/Title/components/variant/secondary/TitleSecondary.js +12 -0
  193. package/__inner__/esm/components/Title/components/variant/secondary/index.d.ts +2 -0
  194. package/__inner__/esm/components/Title/components/variant/secondary/index.js +2 -0
  195. package/__inner__/esm/components/Title/components/variant/secondary/types.d.ts +10 -0
  196. package/__inner__/esm/components/Title/components/variant/secondary/types.js +1 -0
  197. package/__inner__/esm/components/Title/components/variant/types.d.ts +8 -0
  198. package/__inner__/esm/components/Title/components/variant/types.js +1 -0
  199. package/__inner__/esm/components/Title/constants.d.ts +4 -0
  200. package/__inner__/esm/components/Title/constants.js +3 -0
  201. package/__inner__/esm/components/Title/entities/icon.d.ts +3 -0
  202. package/__inner__/esm/components/Title/entities/icon.js +1 -0
  203. package/__inner__/esm/components/Title/entities/index.d.ts +3 -0
  204. package/__inner__/esm/components/Title/entities/index.js +3 -0
  205. package/__inner__/esm/components/Title/entities/size.d.ts +2 -0
  206. package/__inner__/esm/components/Title/entities/size.js +1 -0
  207. package/__inner__/esm/components/Title/entities/variant.d.ts +7 -0
  208. package/__inner__/esm/components/Title/entities/variant.js +1 -0
  209. package/__inner__/esm/components/Title/index.d.ts +4 -0
  210. package/__inner__/esm/components/Title/index.js +4 -0
  211. package/__inner__/esm/components/Title/modules/icon-button/TitleIconButton.d.ts +3 -0
  212. package/__inner__/esm/components/Title/modules/icon-button/TitleIconButton.js +13 -0
  213. package/__inner__/esm/components/Title/modules/icon-button/constants.d.ts +1 -0
  214. package/__inner__/esm/components/Title/modules/icon-button/constants.js +1 -0
  215. package/__inner__/esm/components/Title/modules/icon-button/index.d.ts +2 -0
  216. package/__inner__/esm/components/Title/modules/icon-button/index.js +2 -0
  217. package/__inner__/esm/components/Title/modules/icon-button/types.d.ts +6 -0
  218. package/__inner__/esm/components/Title/modules/icon-button/types.js +1 -0
  219. package/__inner__/esm/components/Title/modules/index.d.ts +2 -0
  220. package/__inner__/esm/components/Title/modules/index.js +2 -0
  221. package/__inner__/esm/components/Title/modules/tag/TitleTag.css +4 -0
  222. package/__inner__/esm/components/Title/modules/tag/TitleTag.d.ts +3 -0
  223. package/__inner__/esm/components/Title/modules/tag/TitleTag.js +8 -0
  224. package/__inner__/esm/components/Title/modules/tag/constants.d.ts +1 -0
  225. package/__inner__/esm/components/Title/modules/tag/constants.js +1 -0
  226. package/__inner__/esm/components/Title/modules/tag/index.d.ts +2 -0
  227. package/__inner__/esm/components/Title/modules/tag/index.js +2 -0
  228. package/__inner__/esm/components/Title/modules/tag/types.d.ts +6 -0
  229. package/__inner__/esm/components/Title/modules/tag/types.js +1 -0
  230. package/__inner__/esm/components/Title/types.d.ts +10 -0
  231. package/__inner__/esm/components/Title/types.js +1 -0
  232. package/__inner__/esm/constants/environment/index.d.ts +2 -0
  233. package/__inner__/esm/constants/environment/index.js +2 -0
  234. package/__inner__/esm/constants/environment/isDev.d.ts +1 -0
  235. package/__inner__/esm/constants/environment/isDev.js +2 -0
  236. package/__inner__/esm/constants/environment/isProduction.d.ts +1 -0
  237. package/__inner__/esm/constants/environment/isProduction.js +1 -0
  238. package/__inner__/esm/hooks/useStoredValue/index.d.ts +3 -0
  239. package/__inner__/esm/hooks/useStoredValue/index.js +3 -0
  240. package/__inner__/esm/hooks/useStoredValue/types.d.ts +2 -0
  241. package/__inner__/esm/hooks/useStoredValue/types.js +1 -0
  242. package/__inner__/esm/hooks/useStoredValue/useStoredValue.d.ts +4 -0
  243. package/__inner__/esm/hooks/useStoredValue/useStoredValue.js +13 -0
  244. package/__inner__/esm/hooks/useStoredValue/utils.d.ts +2 -0
  245. package/__inner__/esm/hooks/useStoredValue/utils.js +5 -0
  246. package/__inner__/esm/types/object/withPartial.d.ts +3 -0
  247. package/__inner__/esm/types/object/withPartial.js +1 -0
  248. package/__inner__/esm/utils/array/create-empty/createEmptyArray.d.ts +1 -0
  249. package/__inner__/esm/utils/array/create-empty/createEmptyArray.js +4 -0
  250. package/__inner__/esm/utils/array/create-empty/index.d.ts +1 -0
  251. package/__inner__/esm/utils/array/create-empty/index.js +1 -0
  252. package/__inner__/esm/utils/array/create-filled/createFilledArray.d.ts +1 -0
  253. package/__inner__/esm/utils/array/create-filled/createFilledArray.js +3 -0
  254. package/__inner__/esm/utils/array/create-filled/index.d.ts +1 -0
  255. package/__inner__/esm/utils/array/create-filled/index.js +1 -0
  256. package/__inner__/esm/utils/array/index.d.ts +2 -0
  257. package/__inner__/esm/utils/array/index.js +2 -0
  258. package/__inner__/esm/utils/isFunction.d.ts +1 -0
  259. package/__inner__/esm/utils/isFunction.js +4 -0
  260. package/package.json +4 -4
  261. package/useStoredValue/package.json +5 -0
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./TitleIconButton"), exports);
5
+ tslib_1.__exportStar(require("./types"), exports);
@@ -0,0 +1,6 @@
1
+ import type { ElementType } from 'react';
2
+ import type { PolymorphicComponentPropsWithoutRef } from '../../../../utils/polymorphicComponentWithRef';
3
+ import type { IconButtonBaseProps } from '../../../IconButtonNext';
4
+ import type { TITLE_ICON_BUTTON_DEFAULT_TAG } from './constants';
5
+ export type TitleIconButtonBaseProps = Omit<IconButtonBaseProps, 'size'>;
6
+ export type TitleIconButtonProps<As extends ElementType = typeof TITLE_ICON_BUTTON_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleIconButtonBaseProps, As>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './icon-button';
2
+ export * from './tag';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./icon-button"), exports);
5
+ tslib_1.__exportStar(require("./tag"), exports);
@@ -0,0 +1,4 @@
1
+ .TitleTag {
2
+ background-color: var(--color-background-main);
3
+ color: var(--color-content-primary);
4
+ }
@@ -0,0 +1,3 @@
1
+ import type { TitleTagBaseProps } from '../../../Title/modules/tag/types';
2
+ export declare const cnTitleTag: import("@bem-react/classname").ClassNameFormatter;
3
+ export declare const TitleTag: import("../../../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<TitleTagBaseProps, "div">;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TitleTag = exports.cnTitleTag = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var react_1 = tslib_1.__importDefault(require("react"));
6
+ var classname_1 = require("../../../../utils/classname");
7
+ var polymorphicComponentWithRef_1 = require("../../../../utils/polymorphicComponentWithRef");
8
+ var TagNext_1 = require("../../../TagNext");
9
+ var constants_1 = require("../../../Title/modules/tag/constants");
10
+ exports.cnTitleTag = (0, classname_1.cn)('TitleTag');
11
+ exports.TitleTag = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (props, ref) { return (react_1.default.createElement(TagNext_1.Tag, tslib_1.__assign({ as: constants_1.TITLE_TAG_DEFAULT_TAG }, props, { ref: ref, size: "xs", variant: "primary", color: "uncolored", className: (0, exports.cnTitleTag)('', [props.className]) }))); });
@@ -0,0 +1 @@
1
+ export declare const TITLE_TAG_DEFAULT_TAG = "div";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TITLE_TAG_DEFAULT_TAG = void 0;
4
+ exports.TITLE_TAG_DEFAULT_TAG = 'div';
@@ -0,0 +1,2 @@
1
+ export * from './TitleTag';
2
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./TitleTag"), exports);
5
+ tslib_1.__exportStar(require("./types"), exports);
@@ -0,0 +1,6 @@
1
+ import type { ElementType } from 'react';
2
+ import type { PolymorphicComponentPropsWithoutRef } from '../../../../utils/polymorphicComponentWithRef';
3
+ import type { TagBaseProps } from '../../../TagNext';
4
+ import type { TITLE_TAG_DEFAULT_TAG } from './constants';
5
+ export type TitleTagBaseProps = Omit<TagBaseProps, 'size' | 'color' | 'variant'>;
6
+ export type TitleTagProps<As extends ElementType = typeof TITLE_TAG_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleTagBaseProps, As>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import type { ElementType } from 'react';
2
+ import type { WithPartial } from '../../types/object/withPartial';
3
+ import type { PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
4
+ import type { TitleMainBaseProps, TitleSecondaryBaseProps } from './components';
5
+ import type { TITLE_DEFAULT_TAG } from './constants';
6
+ import type { TitleVariantValue } from './entities';
7
+ export type TitleMainBasePartialProps = WithPartial<TitleMainBaseProps, 'size'>;
8
+ export type TitleSecondaryBasePartialProps = WithPartial<TitleSecondaryBaseProps, 'size'>;
9
+ export type TitleBaseProps = TitleVariantValue<'main', TitleMainBasePartialProps> | TitleVariantValue<'secondary', TitleSecondaryBasePartialProps> | TitleVariantValue<undefined, TitleMainBasePartialProps>;
10
+ export type TitleProps<As extends ElementType = typeof TITLE_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleBaseProps, As>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './isDev';
2
+ export * from './isProduction';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./isDev"), exports);
5
+ tslib_1.__exportStar(require("./isProduction"), exports);
@@ -0,0 +1 @@
1
+ export declare const IS_DEV: boolean;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IS_DEV = void 0;
4
+ var isProduction_1 = require("./isProduction");
5
+ exports.IS_DEV = !isProduction_1.IS_PRODUCTION;
@@ -0,0 +1 @@
1
+ export declare const IS_PRODUCTION: boolean;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IS_PRODUCTION = void 0;
4
+ exports.IS_PRODUCTION = process.env.NODE_ENV === 'production';
@@ -0,0 +1,3 @@
1
+ export * from './utils';
2
+ export * from './useStoredValue';
3
+ export * from './types';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./utils"), exports);
5
+ tslib_1.__exportStar(require("./useStoredValue"), exports);
6
+ tslib_1.__exportStar(require("./types"), exports);
@@ -0,0 +1,2 @@
1
+ import type { MutableRefObject } from 'react';
2
+ export type StoredValue<Value> = MutableRefObject<Value>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { StoredValue } from './types';
2
+ export declare function useStoredValue<Value>(
3
+ /** Изначальное значение */
4
+ initialValue: Value | (() => Value)): StoredValue<Value>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useStoredValue = useStoredValue;
4
+ var react_1 = require("react");
5
+ var isFunction_1 = require("../../utils/isFunction");
6
+ function useStoredValue(
7
+ /** Изначальное значение */
8
+ initialValue) {
9
+ var processedInitialValue = (0, react_1.useMemo)(function () {
10
+ if ((0, isFunction_1.isFunction)(initialValue)) {
11
+ return initialValue();
12
+ }
13
+ return initialValue;
14
+ }, []);
15
+ return (0, react_1.useRef)(processedInitialValue);
16
+ }
@@ -0,0 +1,2 @@
1
+ import type { StoredValue } from './types';
2
+ export declare function isStoredValue(valueToCheck: unknown): valueToCheck is StoredValue<unknown>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStoredValue = isStoredValue;
4
+ function isStoredValue(valueToCheck) {
5
+ return (!!valueToCheck &&
6
+ typeof valueToCheck === 'object' &&
7
+ Object.prototype.hasOwnProperty.call(valueToCheck, 'current'));
8
+ }
@@ -0,0 +1,3 @@
1
+ export type WithPartial<T, K extends keyof T> = Omit<T, K> & {
2
+ [P in K]?: T[P];
3
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export declare const createEmptyArray: (length: number) => null[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createEmptyArray = void 0;
4
+ var create_filled_1 = require("../create-filled");
5
+ var createEmptyArray = function (length) {
6
+ return (0, create_filled_1.createFilledArray)(length, null);
7
+ };
8
+ exports.createEmptyArray = createEmptyArray;
@@ -0,0 +1 @@
1
+ export * from './createEmptyArray';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./createEmptyArray"), exports);
@@ -0,0 +1 @@
1
+ export declare const createFilledArray: <Value>(length: number, value: Value) => Value[];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createFilledArray = void 0;
4
+ var createFilledArray = function (length, value) {
5
+ return new Array(length).fill(value);
6
+ };
7
+ exports.createFilledArray = createFilledArray;
@@ -0,0 +1 @@
1
+ export * from './createFilledArray';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./createFilledArray"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './create-empty';
2
+ export * from './create-filled';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./create-empty"), exports);
5
+ tslib_1.__exportStar(require("./create-filled"), exports);
@@ -0,0 +1 @@
1
+ export declare const isFunction: (data: unknown) => data is (...args: any[]) => any;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFunction = void 0;
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ var isFunction = function (data) {
6
+ return typeof data === 'function';
7
+ };
8
+ exports.isFunction = isFunction;
@@ -0,0 +1,16 @@
1
+ .ChipGroup {
2
+ display: flex;
3
+ flex-direction: column;
4
+ }
5
+
6
+ .ChipGroup .FormGroup {
7
+ align-items: flex-start;
8
+ }
9
+
10
+ .ChipGroup .FormGroup_size_xs, .ChipGroup .FormGroup_size_s {
11
+ --form-group-gap: var(--spacing-xs);
12
+ }
13
+
14
+ .ChipGroup .FormGroup_size_m, .ChipGroup .FormGroup_size_l {
15
+ --form-group-gap: var(--spacing-s);
16
+ }
@@ -0,0 +1,4 @@
1
+ import './ChipGroup.css';
2
+ import type { ChipGroupBaseProps } from './types';
3
+ export declare const cnChipGroup: import("@bem-react/classname").ClassNameFormatter;
4
+ export declare const ChipGroup: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<ChipGroupBaseProps, "div">;
@@ -0,0 +1,49 @@
1
+ import { __assign, __read, __rest, __spreadArray } from "tslib";
2
+ import './ChipGroup.css';
3
+ import React from 'react';
4
+ import { useControlled } from '../../hooks/useControlled';
5
+ import { useThemeProps } from '../../hooks/useThemeProps';
6
+ import { cn } from '../../utils/classname';
7
+ import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
8
+ import { FormGroup } from '../FormGroup';
9
+ import { FormTitle } from '../FormTitle';
10
+ import { ChipGroupContext } from './ChipGroupContext';
11
+ import { CHIP_GROUP_DEFAULT_AS, CHIP_GROUP_DEFAULT_DIRECTION, CHIP_GROUP_DEFAULT_SIZE, } from './constants';
12
+ export var cnChipGroup = cn('ChipGroup');
13
+ export var ChipGroup = polymorphicComponentWithRef(function (inProps, ref) {
14
+ var props = useThemeProps({
15
+ props: inProps,
16
+ name: 'ChipGroup',
17
+ });
18
+ var _a = props.direction, direction = _a === void 0 ? CHIP_GROUP_DEFAULT_DIRECTION : _a, _b = props.size, size = _b === void 0 ? CHIP_GROUP_DEFAULT_SIZE : _b, _c = props.as, Tag = _c === void 0 ? CHIP_GROUP_DEFAULT_AS : _c, color = props.color, title = props.title, className = props.className, children = props.children, valueProp = props.value, _d = props.defaultValue, defaultValue = _d === void 0 ? [] : _d, onChange = props.onChange, disabled = props.disabled, titleProps = props.titleProps, groupProps = props.groupProps, other = __rest(props, ["direction", "size", "as", "color", "title", "className", "children", "value", "defaultValue", "onChange", "disabled", "titleProps", "groupProps"]);
19
+ var _e = __read(useControlled({
20
+ value: valueProp,
21
+ defaultValue: defaultValue,
22
+ name: 'ChipGroup',
23
+ state: 'value',
24
+ }), 2), valueState = _e[0], setValueState = _e[1];
25
+ var onClick = function (event, payload) {
26
+ var itemValue = payload.value;
27
+ if (itemValue === undefined) {
28
+ return;
29
+ }
30
+ var requiredValueState = valueState !== null && valueState !== void 0 ? valueState : [];
31
+ var isValueAlreadyChecked = requiredValueState.includes(itemValue);
32
+ var value = isValueAlreadyChecked
33
+ ? requiredValueState.filter(function (item) { return item !== itemValue; })
34
+ : __spreadArray(__spreadArray([], __read(requiredValueState), false), [itemValue], false);
35
+ setValueState(value);
36
+ onChange === null || onChange === void 0 ? void 0 : onChange(value, event);
37
+ };
38
+ return (React.createElement(Tag, __assign({ className: cnChipGroup({ size: size }, [className]), role: "group" }, other, { ref: ref }),
39
+ React.createElement(ChipGroupContext.Provider, { value: {
40
+ value: valueState,
41
+ onClick: onClick,
42
+ size: size,
43
+ disabled: disabled,
44
+ color: color,
45
+ } },
46
+ title && (React.createElement(FormTitle, __assign({ size: size }, titleProps), title)),
47
+ React.createElement(FormGroup, __assign({ direction: direction, size: size }, groupProps), children))));
48
+ });
49
+ ChipGroup.displayName = 'ChipGroup';
@@ -0,0 +1,10 @@
1
+ import type { ChipColorVariant, ChipOnClick, ChipSizeVariant } from '../ChipNext';
2
+ import type { ChipGroupValue } from './types';
3
+ export type ChipGroupContextValue = {
4
+ onClick: ChipOnClick;
5
+ disabled?: boolean;
6
+ value?: ChipGroupValue;
7
+ size?: ChipSizeVariant;
8
+ color?: ChipColorVariant;
9
+ };
10
+ export declare const ChipGroupContext: import("react").Context<ChipGroupContextValue | undefined>;
@@ -0,0 +1,2 @@
1
+ import { createContext } from 'react';
2
+ export var ChipGroupContext = createContext(undefined);
@@ -0,0 +1,5 @@
1
+ import type { ChipSizeVariant } from '../ChipNext';
2
+ import type { FormGroupDirectionVariant } from '../FormGroup';
3
+ export declare const CHIP_GROUP_DEFAULT_DIRECTION: FormGroupDirectionVariant;
4
+ export declare const CHIP_GROUP_DEFAULT_SIZE: ChipSizeVariant;
5
+ export declare const CHIP_GROUP_DEFAULT_AS = "div";
@@ -0,0 +1,3 @@
1
+ export var CHIP_GROUP_DEFAULT_DIRECTION = 'row';
2
+ export var CHIP_GROUP_DEFAULT_SIZE = 'm';
3
+ export var CHIP_GROUP_DEFAULT_AS = 'div';
@@ -0,0 +1,2 @@
1
+ export * from './ChipGroup';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export * from './ChipGroup';
2
+ export * from './types';
@@ -0,0 +1,33 @@
1
+ import type { ElementType, MouseEvent, ReactNode } from 'react';
2
+ import type { PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
3
+ import type { ChipColorVariant, ChipSizeVariant } from '../ChipNext';
4
+ import type { FormGroupDirectionVariant, FormGroupProps } from '../FormGroup';
5
+ import type { FormTitleProps } from '../FormTitle';
6
+ import type { CHIP_GROUP_DEFAULT_AS } from './constants';
7
+ export type ChipGroupValue = string[];
8
+ export type ChipGroupOnChange = (value: ChipGroupValue, event: MouseEvent<HTMLElement>) => void;
9
+ export type ChipGroupBaseProps = {
10
+ /** Значение по умолчанию (неконтролируемое состояние) */
11
+ defaultValue?: ChipGroupValue;
12
+ /** Текущее значение */
13
+ value?: ChipGroupValue;
14
+ /** Вариант представления компонента */
15
+ color?: ChipColorVariant;
16
+ /** Размер */
17
+ size?: ChipSizeVariant;
18
+ /** Содержимое компонента */
19
+ children?: ReactNode;
20
+ /** Направление */
21
+ direction?: FormGroupDirectionVariant;
22
+ /** Событие изменения состояния */
23
+ onChange?: ChipGroupOnChange;
24
+ /** Если `true` делает элементы неактивными */
25
+ disabled?: boolean;
26
+ /** Идентификатор компонента для тестов */
27
+ 'data-testid'?: string;
28
+ /** Свойства FormTitle */
29
+ titleProps?: FormTitleProps;
30
+ /** Свойства FormGroup */
31
+ groupProps?: FormGroupProps;
32
+ };
33
+ export type ChipGroupProps<As extends ElementType = typeof CHIP_GROUP_DEFAULT_AS> = PolymorphicComponentPropsWithoutRef<ChipGroupBaseProps, As>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  /* stylelint-disable */
2
2
  .ChipNext {
3
+ --chip-outline: var(--shadow-outline-focused);
3
4
  --chip-border-radius: 24px;
4
5
  --chip-text-wrap: nowrap;
5
6
  background-color: var(--chip-bg-color);
@@ -72,17 +73,53 @@
72
73
  --chip-padding-x: var(--spacing-m);
73
74
  }
74
75
  .ChipNext_color_primary {
75
- --chip-bg-color: var(--color-background-action-light);
76
- --chip-bg-color-hover: var(--color-background-action-light-hover);
77
- --chip-bg-color-active: var(--color-background-action-light-pressed);
78
- --chip-text-color: var(--color-content-action-dark);
79
- }
76
+ --chip-bg-color: var(--color-background-action-light);
77
+ --chip-bg-color-hover: var(--color-background-action-light-hover);
78
+ --chip-bg-color-active: var(--color-background-action-light-pressed);
79
+ --chip-text-color: var(--color-content-action-dark);
80
+ }
80
81
  .ChipNext_color_secondary {
81
- --chip-bg-color: var(--color-background-secondary);
82
- --chip-bg-color-hover: var(--color-background-secondary-hover);
83
- --chip-bg-color-active: var(--color-background-secondary-pressed);
84
- --chip-text-color: var(--color-content-primary);
85
- }
82
+ --chip-bg-color: var(--color-background-secondary);
83
+ --chip-bg-color-hover: var(--color-background-secondary-hover);
84
+ --chip-bg-color-active: var(--color-background-secondary-pressed);
85
+ --chip-text-color: var(--color-content-primary);
86
+ }
87
+ .ChipNext_color_main {
88
+ --chip-bg-color: var(--color-background-main);
89
+ --chip-bg-color-hover: var(--color-background-main-hover);
90
+ --chip-bg-color-active: var(--color-background-main-pressed);
91
+ --chip-text-color: var(--color-content-primary);
92
+ }
93
+ .ChipNext_color_overlay {
94
+ --chip-bg-color: var(--color-background-overlay);
95
+ --chip-bg-color-hover: var(--color-background-overlay);
96
+ --chip-bg-color-active: var(--color-background-overlay);
97
+ --chip-text-color: var(--color-content-action-on);
98
+ }
99
+ .ChipNext_color_primary.ChipNext_checked {
100
+ --chip-bg-color: var(--color-background-action);
101
+ --chip-bg-color-hover: var(--color-background-action);
102
+ --chip-bg-color-active: var(--color-background-action);
103
+ --chip-text-color: var(--color-content-action-on);
104
+ }
105
+ .ChipNext_color_primary.ChipNext_checked.ChipNext_disabled {
106
+ --chip-bg-color: var(--color-background-action-active-disabled);
107
+ --chip-bg-color-hover: var(--color-background-action-active-disabled);
108
+ --chip-bg-color-active: var(--color-background-action-active-disabled);
109
+ --chip-text-color: var(--color-content-primary-inverse);
110
+ }
111
+ .ChipNext_color_secondary.ChipNext_checked, .ChipNext_color_main.ChipNext_checked, .ChipNext_color_overlay.ChipNext_checked {
112
+ --chip-bg-color: var(--color-background-action-secondary);
113
+ --chip-bg-color-hover: var(--color-background-action-secondary);
114
+ --chip-bg-color-active: var(--color-background-action-secondary);
115
+ --chip-text-color: var(--color-content-action-on);
116
+ }
117
+ .ChipNext_color_secondary.ChipNext_checked.ChipNext_disabled, .ChipNext_color_main.ChipNext_checked.ChipNext_disabled, .ChipNext_color_overlay.ChipNext_checked.ChipNext_disabled {
118
+ --chip-bg-color: var(--color-background-action-secondary-active-disabled);
119
+ --chip-bg-color-hover: var(--color-background-action-secondary-active-disabled);
120
+ --chip-bg-color-active: var(--color-background-action-secondary-active-disabled);
121
+ --chip-text-color: var(--color-content-primary-inverse);
122
+ }
86
123
  .ChipNext:hover {
87
124
  --chip-bg-color: var(--chip-bg-color-hover);
88
125
  }
@@ -90,19 +127,15 @@
90
127
  --chip-bg-color: var(--chip-bg-color-active);
91
128
  }
92
129
  .ChipNext:focus {
93
- box-shadow: var(--shadow-outline-focused);
130
+ box-shadow: var(--chip-outline);
94
131
  }
95
132
  .ChipNext:focus:not(:focus-visible) {
96
133
  box-shadow: none;
97
134
  }
98
- .ChipNext_checked,
99
- .ChipNext_checked:hover,
100
- .ChipNext_checked:active {
101
- --chip-bg-color: var(--color-background-action);
102
- --chip-text-color: var(--color-content-action-on);
103
- }
104
135
  .ChipNext_disabled {
105
136
  --chip-bg-color: var(--color-background-disabled);
137
+ --chip-bg-color-hover: var(--color-background-disabled);
138
+ --chip-bg-color-active: var(--color-background-disabled);
106
139
  --chip-text-color: var(--color-content-disabled);
107
140
  pointer-events: none;
108
141
  }
@@ -1,18 +1,43 @@
1
1
  import { __assign, __read, __rest } from "tslib";
2
2
  import './Chip.css';
3
- import React from 'react';
3
+ import React, { useContext } from 'react';
4
+ import { logger } from '@ozen-ui/logger';
5
+ import { IS_DEV } from '../../constants/environment';
4
6
  import { useControlled } from '../../hooks/useControlled';
5
7
  import { useThemeProps } from '../../hooks/useThemeProps';
6
8
  import { cn } from '../../utils/classname';
7
9
  import { getIconSizeToFormElement } from '../../utils/getIconSizeToFormElement';
8
10
  import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
9
11
  import { renderContent } from '../../utils/renderContent';
12
+ import { ChipGroupContext } from '../ChipGroup/ChipGroupContext';
10
13
  import { CHIP_DEFAULT_TAG, CHIP_DEFAULT_SIZE, CHIP_DEFAULT_VARIANT, CHIP_DEFAULT_DISABLED, } from './constants';
11
14
  export var cnChip = cn('ChipNext');
12
15
  export var Chip = polymorphicComponentWithRef(function (inProps, ref) {
13
- var _a = useThemeProps({ name: 'ChipNext', props: inProps }), _b = _a.size, size = _b === void 0 ? CHIP_DEFAULT_SIZE : _b, _c = _a.color, color = _c === void 0 ? CHIP_DEFAULT_VARIANT : _c, _d = _a.disabled, disabled = _d === void 0 ? CHIP_DEFAULT_DISABLED : _d, iconLeft = _a.iconLeft, iconRight = _a.iconRight, multiline = _a.multiline, className = _a.className, children = _a.children, onClick = _a.onClick, checkedProp = _a.checked, _e = _a.as, Tag = _e === void 0 ? CHIP_DEFAULT_TAG : _e, dataTestId = _a["data-testid"], other = __rest(_a, ["size", "color", "disabled", "iconLeft", "iconRight", "multiline", "className", "children", "onClick", "checked", "as", 'data-testid']);
16
+ var _a = useThemeProps({ name: 'ChipNext', props: inProps }), _b = _a.size, sizeProp = _b === void 0 ? CHIP_DEFAULT_SIZE : _b, _c = _a.color, colorProp = _c === void 0 ? CHIP_DEFAULT_VARIANT : _c, _d = _a.disabled, disabledProp = _d === void 0 ? CHIP_DEFAULT_DISABLED : _d, iconLeft = _a.iconLeft, iconRight = _a.iconRight, multiline = _a.multiline, className = _a.className, children = _a.children, onClick = _a.onClick, checkedProp = _a.checked, _e = _a.as, Tag = _e === void 0 ? CHIP_DEFAULT_TAG : _e, value = _a.value, dataTestId = _a["data-testid"], other = __rest(_a, ["size", "color", "disabled", "iconLeft", "iconRight", "multiline", "className", "children", "onClick", "checked", "as", "value", 'data-testid']);
17
+ var checked = checkedProp;
18
+ var size = sizeProp;
19
+ var disabled = disabledProp;
20
+ var color = colorProp;
21
+ var chipGroup = useContext(ChipGroupContext);
22
+ if (chipGroup) {
23
+ if (IS_DEV && value === undefined) {
24
+ logger.error('Отсутствует параметр "value" для Chip, находящегося в ChipGroup.');
25
+ }
26
+ if (checked === undefined && chipGroup.value) {
27
+ checked = chipGroup === null || chipGroup === void 0 ? void 0 : chipGroup.value.includes(value);
28
+ }
29
+ if (inProps.size === undefined && chipGroup.size) {
30
+ size = chipGroup.size;
31
+ }
32
+ if (inProps.disabled === undefined && chipGroup.disabled !== undefined) {
33
+ disabled = chipGroup.disabled;
34
+ }
35
+ if (inProps.color === undefined && chipGroup.color) {
36
+ color = chipGroup.color;
37
+ }
38
+ }
14
39
  var _f = __read(useControlled({
15
- value: checkedProp,
40
+ value: checked,
16
41
  defaultValue: false,
17
42
  name: 'ChipNext',
18
43
  state: 'open',
@@ -21,8 +46,10 @@ export var Chip = polymorphicComponentWithRef(function (inProps, ref) {
21
46
  if (disabled) {
22
47
  return;
23
48
  }
24
- setCheckedState(!checkedState);
25
- onClick === null || onClick === void 0 ? void 0 : onClick(event, { checked: !checkedState });
49
+ var newCheckedState = !checkedState;
50
+ setCheckedState(newCheckedState);
51
+ onClick === null || onClick === void 0 ? void 0 : onClick(event, { checked: newCheckedState, value: value });
52
+ chipGroup === null || chipGroup === void 0 ? void 0 : chipGroup.onClick(event, { checked: newCheckedState, value: value });
26
53
  };
27
54
  var renderIcon = function (content) {
28
55
  return renderContent({
@@ -3,11 +3,15 @@ import type { IconProps } from '@ozen-ui/icons';
3
3
  import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
4
4
  import type { RenderContentType } from '../../utils/renderContent';
5
5
  import type { CHIP_DEFAULT_TAG } from './constants';
6
+ export declare const chipColorVariant: readonly ["primary", "secondary", "main", "overlay"];
7
+ export type ChipColorVariant = (typeof chipColorVariant)[number];
6
8
  export declare const chipSizeVariant: readonly ["xs", "s", "m", "l"];
7
- export declare const chipColorVariant: readonly ["primary", "secondary"];
8
9
  export type ChipSizeVariant = (typeof chipSizeVariant)[number];
9
- export type ChipColorVariant = (typeof chipColorVariant)[number];
10
10
  export type ChipIcon = RenderContentType<IconProps>['content'];
11
+ export type ChipOnClick = (event: MouseEvent<HTMLElement>, payload: {
12
+ checked: boolean;
13
+ value: string | undefined;
14
+ }) => void;
11
15
  export type ChipBaseProps = {
12
16
  /** Размер компонента */
13
17
  size?: ChipSizeVariant;
@@ -18,9 +22,9 @@ export type ChipBaseProps = {
18
22
  /** Если `true` делает элемент выбранным */
19
23
  checked?: boolean;
20
24
  /** Обработчик нажатия */
21
- onClick?: (e: MouseEvent<HTMLElement>, payload: {
22
- checked: boolean;
23
- }) => void;
25
+ onClick?: ChipOnClick;
26
+ /** Значение chip */
27
+ value?: string;
24
28
  /** Иконка слева */
25
29
  iconLeft?: ChipIcon;
26
30
  /** Иконка справа */
@@ -1,2 +1,9 @@
1
+ // ---- COLOR ----
2
+ export var chipColorVariant = [
3
+ 'primary',
4
+ 'secondary',
5
+ 'main',
6
+ 'overlay',
7
+ ];
8
+ // ---- SIZE ----
1
9
  export var chipSizeVariant = ['xs', 's', 'm', 'l'];
2
- export var chipColorVariant = ['primary', 'secondary'];