prime-ui-kit 0.2.5 → 0.3.1

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 (244) hide show
  1. package/README.md +161 -35
  2. package/dist/components/accordion/Accordion.d.ts +70 -0
  3. package/dist/components/accordion/Accordion.d.ts.map +1 -0
  4. package/dist/components/avatar/Avatar.d.ts +58 -0
  5. package/dist/components/avatar/Avatar.d.ts.map +1 -0
  6. package/dist/components/badge/Badge.d.ts +51 -0
  7. package/dist/components/badge/Badge.d.ts.map +1 -0
  8. package/dist/components/banner/Banner.d.ts +78 -0
  9. package/dist/components/banner/Banner.d.ts.map +1 -0
  10. package/dist/components/breadcrumb/Breadcrumb.d.ts +47 -0
  11. package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -0
  12. package/dist/components/button/Button.d.ts +57 -0
  13. package/dist/components/button/Button.d.ts.map +1 -0
  14. package/dist/components/button-group/ButtonGroup.d.ts +34 -0
  15. package/dist/components/button-group/ButtonGroup.d.ts.map +1 -0
  16. package/dist/components/card/Card.d.ts +234 -0
  17. package/dist/components/card/Card.d.ts.map +1 -0
  18. package/dist/components/checkbox/Checkbox.d.ts +42 -0
  19. package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
  20. package/dist/components/code-block/CodeBlock.d.ts +17 -0
  21. package/dist/components/code-block/CodeBlock.d.ts.map +1 -0
  22. package/dist/components/color-picker/ColorPicker.d.ts +76 -0
  23. package/dist/components/color-picker/ColorPicker.d.ts.map +1 -0
  24. package/dist/components/color-picker/ColorPickerRac.d.ts +76 -0
  25. package/dist/components/color-picker/ColorPickerRac.d.ts.map +1 -0
  26. package/dist/components/command-menu/CommandMenu.d.ts +74 -0
  27. package/dist/components/command-menu/CommandMenu.d.ts.map +1 -0
  28. package/dist/components/data-table/DataTable.d.ts +78 -0
  29. package/dist/components/data-table/DataTable.d.ts.map +1 -0
  30. package/dist/components/datepicker/Datepicker.d.ts +104 -0
  31. package/dist/components/datepicker/Datepicker.d.ts.map +1 -0
  32. package/dist/components/digit-input/DigitInput.d.ts +21 -0
  33. package/dist/components/digit-input/DigitInput.d.ts.map +1 -0
  34. package/dist/components/divider/Divider.d.ts +26 -0
  35. package/dist/components/divider/Divider.d.ts.map +1 -0
  36. package/dist/components/drawer/Drawer.d.ts +71 -0
  37. package/dist/components/drawer/Drawer.d.ts.map +1 -0
  38. package/dist/components/dropdown/Dropdown.d.ts +147 -0
  39. package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
  40. package/dist/components/dropdown/dropdownGeometry.d.ts +10 -0
  41. package/dist/components/dropdown/dropdownGeometry.d.ts.map +1 -0
  42. package/dist/components/dropdown/menuKeyboard.d.ts +4 -0
  43. package/dist/components/dropdown/menuKeyboard.d.ts.map +1 -0
  44. package/dist/components/dropdown/useDropdownPosition.d.ts +18 -0
  45. package/dist/components/dropdown/useDropdownPosition.d.ts.map +1 -0
  46. package/dist/components/example-frame/ExampleFrame.d.ts +53 -0
  47. package/dist/components/example-frame/ExampleFrame.d.ts.map +1 -0
  48. package/dist/components/file-upload/FileUpload.d.ts +176 -0
  49. package/dist/components/file-upload/FileUpload.d.ts.map +1 -0
  50. package/dist/components/hint/Hint.d.ts +27 -0
  51. package/dist/components/hint/Hint.d.ts.map +1 -0
  52. package/dist/components/index.css +6101 -5759
  53. package/dist/components/index.css.map +4 -4
  54. package/dist/components/index.d.ts +95 -2679
  55. package/dist/components/index.d.ts.map +1 -0
  56. package/dist/components/index.js +8510 -7659
  57. package/dist/components/index.js.map +4 -4
  58. package/dist/components/input/Input.d.ts +73 -0
  59. package/dist/components/input/Input.d.ts.map +1 -0
  60. package/dist/components/kbd/Kbd.d.ts +15 -0
  61. package/dist/components/kbd/Kbd.d.ts.map +1 -0
  62. package/dist/components/label/Label.d.ts +29 -0
  63. package/dist/components/label/Label.d.ts.map +1 -0
  64. package/dist/components/link-button/LinkButton.d.ts +18 -0
  65. package/dist/components/link-button/LinkButton.d.ts.map +1 -0
  66. package/dist/components/modal/Modal.d.ts +58 -0
  67. package/dist/components/modal/Modal.d.ts.map +1 -0
  68. package/dist/components/notification/Notification.d.ts +42 -0
  69. package/dist/components/notification/Notification.d.ts.map +1 -0
  70. package/dist/components/notification/NotificationStore.d.ts +18 -0
  71. package/dist/components/notification/NotificationStore.d.ts.map +1 -0
  72. package/dist/components/page-content/PageContent.d.ts +51 -0
  73. package/dist/components/page-content/PageContent.d.ts.map +1 -0
  74. package/dist/components/pagination/Pagination.d.ts +19 -0
  75. package/dist/components/pagination/Pagination.d.ts.map +1 -0
  76. package/dist/components/popover/Popover.d.ts +48 -0
  77. package/dist/components/popover/Popover.d.ts.map +1 -0
  78. package/dist/components/popover/popoverGeometry.d.ts +6 -0
  79. package/dist/components/popover/popoverGeometry.d.ts.map +1 -0
  80. package/dist/components/popover/usePopoverPosition.d.ts +18 -0
  81. package/dist/components/popover/usePopoverPosition.d.ts.map +1 -0
  82. package/dist/components/progress-bar/ProgressBar.d.ts +14 -0
  83. package/dist/components/progress-bar/ProgressBar.d.ts.map +1 -0
  84. package/dist/components/progress-circle/ProgressCircle.d.ts +33 -0
  85. package/dist/components/progress-circle/ProgressCircle.d.ts.map +1 -0
  86. package/dist/components/radio/Radio.d.ts +40 -0
  87. package/dist/components/radio/Radio.d.ts.map +1 -0
  88. package/dist/components/scroll-container/ScrollContainer.d.ts +42 -0
  89. package/dist/components/scroll-container/ScrollContainer.d.ts.map +1 -0
  90. package/dist/components/segmented-control/SegmentedControl.d.ts +40 -0
  91. package/dist/components/segmented-control/SegmentedControl.d.ts.map +1 -0
  92. package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +22 -0
  93. package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts.map +1 -0
  94. package/dist/components/select/Select.d.ts +84 -0
  95. package/dist/components/select/Select.d.ts.map +1 -0
  96. package/dist/components/select/selectListbox.d.ts +13 -0
  97. package/dist/components/select/selectListbox.d.ts.map +1 -0
  98. package/dist/components/slider/Slider.d.ts +23 -0
  99. package/dist/components/slider/Slider.d.ts.map +1 -0
  100. package/dist/components/stepper/HorizontalStepper.d.ts +41 -0
  101. package/dist/components/stepper/HorizontalStepper.d.ts.map +1 -0
  102. package/dist/components/stepper/Stepper.d.ts +77 -0
  103. package/dist/components/stepper/Stepper.d.ts.map +1 -0
  104. package/dist/components/stepper/VerticalStepper.d.ts +41 -0
  105. package/dist/components/stepper/VerticalStepper.d.ts.map +1 -0
  106. package/dist/components/stepper/stepperAlignContext.d.ts +11 -0
  107. package/dist/components/stepper/stepperAlignContext.d.ts.map +1 -0
  108. package/dist/components/switch/Switch.d.ts +48 -0
  109. package/dist/components/switch/Switch.d.ts.map +1 -0
  110. package/dist/components/tabs/Tabs.d.ts +69 -0
  111. package/dist/components/tabs/Tabs.d.ts.map +1 -0
  112. package/dist/components/tag/Tag.d.ts +29 -0
  113. package/dist/components/tag/Tag.d.ts.map +1 -0
  114. package/dist/components/textarea/Textarea.d.ts +43 -0
  115. package/dist/components/textarea/Textarea.d.ts.map +1 -0
  116. package/dist/components/tooltip/Tooltip.d.ts +47 -0
  117. package/dist/components/tooltip/Tooltip.d.ts.map +1 -0
  118. package/dist/components/typography/Typography.d.ts +30 -0
  119. package/dist/components/typography/Typography.d.ts.map +1 -0
  120. package/dist/hooks/useControllableState.d.ts +8 -0
  121. package/dist/hooks/useControllableState.d.ts.map +1 -0
  122. package/dist/hooks/useEscapeKey.d.ts +7 -0
  123. package/dist/hooks/useEscapeKey.d.ts.map +1 -0
  124. package/dist/hooks/useFieldIds.d.ts +17 -0
  125. package/dist/hooks/useFieldIds.d.ts.map +1 -0
  126. package/dist/hooks/useFocusTrap.d.ts +16 -0
  127. package/dist/hooks/useFocusTrap.d.ts.map +1 -0
  128. package/dist/hooks/useMergedRefs.d.ts +3 -0
  129. package/dist/hooks/useMergedRefs.d.ts.map +1 -0
  130. package/dist/hooks/useOutsideClick.d.ts +16 -0
  131. package/dist/hooks/useOutsideClick.d.ts.map +1 -0
  132. package/dist/hooks/useOverlayModal.d.ts +7 -0
  133. package/dist/hooks/useOverlayModal.d.ts.map +1 -0
  134. package/dist/hooks/usePosition.d.ts +41 -0
  135. package/dist/hooks/usePosition.d.ts.map +1 -0
  136. package/dist/hooks/useResponsiveMonths.d.ts +18 -0
  137. package/dist/hooks/useResponsiveMonths.d.ts.map +1 -0
  138. package/dist/hooks/useScrollLock.d.ts +8 -0
  139. package/dist/hooks/useScrollLock.d.ts.map +1 -0
  140. package/dist/icons/Icon.d.ts +13 -0
  141. package/dist/icons/Icon.d.ts.map +1 -0
  142. package/dist/icons/index.d.ts +40 -0
  143. package/dist/icons/index.d.ts.map +1 -0
  144. package/dist/index.css +6101 -5759
  145. package/dist/index.css.map +4 -4
  146. package/dist/index.d.ts +4 -8
  147. package/dist/index.d.ts.map +1 -0
  148. package/dist/index.js +8509 -7660
  149. package/dist/index.js.map +4 -4
  150. package/dist/internal/ControlSizeContext.d.ts +17 -0
  151. package/dist/internal/ControlSizeContext.d.ts.map +1 -0
  152. package/dist/internal/DividerContentContext.d.ts +4 -0
  153. package/dist/internal/DividerContentContext.d.ts.map +1 -0
  154. package/dist/internal/OverlayPortalLayerContext.d.ts +13 -0
  155. package/dist/internal/OverlayPortalLayerContext.d.ts.map +1 -0
  156. package/dist/internal/Portal.d.ts +8 -0
  157. package/dist/internal/Portal.d.ts.map +1 -0
  158. package/dist/internal/context.d.ts +11 -0
  159. package/dist/internal/context.d.ts.map +1 -0
  160. package/dist/internal/cx.d.ts +2 -0
  161. package/dist/internal/cx.d.ts.map +1 -0
  162. package/dist/internal/data-attributes.d.ts +6 -0
  163. package/dist/internal/data-attributes.d.ts.map +1 -0
  164. package/dist/internal/highlightTsxHtml.d.ts +3 -0
  165. package/dist/internal/highlightTsxHtml.d.ts.map +1 -0
  166. package/dist/internal/layoutPxFromPrimitives.d.ts +13 -0
  167. package/dist/internal/layoutPxFromPrimitives.d.ts.map +1 -0
  168. package/dist/internal/mergeRefs.d.ts +4 -0
  169. package/dist/internal/mergeRefs.d.ts.map +1 -0
  170. package/dist/internal/runtimeUnits.d.ts +3 -0
  171. package/dist/internal/runtimeUnits.d.ts.map +1 -0
  172. package/dist/internal/scrollAncestors.d.ts +3 -0
  173. package/dist/internal/scrollAncestors.d.ts.map +1 -0
  174. package/dist/internal/slot.d.ts +19 -0
  175. package/dist/internal/slot.d.ts.map +1 -0
  176. package/dist/internal/states.d.ts +87 -0
  177. package/dist/internal/states.d.ts.map +1 -0
  178. package/dist/layout/app-shell/AppShell.d.ts +54 -0
  179. package/dist/layout/app-shell/AppShell.d.ts.map +1 -0
  180. package/dist/layout/index.d.ts +7 -0
  181. package/dist/layout/index.d.ts.map +1 -0
  182. package/dist/layout/sidebar/Sidebar.d.ts +241 -0
  183. package/dist/layout/sidebar/Sidebar.d.ts.map +1 -0
  184. package/dist/layout/sidebar/SidebarRoot.d.ts +51 -0
  185. package/dist/layout/sidebar/SidebarRoot.d.ts.map +1 -0
  186. package/dist/layout/sidebar/sidebar-context.d.ts +19 -0
  187. package/dist/layout/sidebar/sidebar-context.d.ts.map +1 -0
  188. package/dist/layout/sidebar/sidebarLayout.d.ts +12 -0
  189. package/dist/layout/sidebar/sidebarLayout.d.ts.map +1 -0
  190. package/dist/tokens/primitives.d.ts +390 -0
  191. package/dist/tokens/primitives.d.ts.map +1 -0
  192. package/dist/tokens/semantic.d.ts +732 -0
  193. package/dist/tokens/semantic.d.ts.map +1 -0
  194. package/dist/tokens/themes/dark.d.ts +143 -0
  195. package/dist/tokens/themes/dark.d.ts.map +1 -0
  196. package/dist/tokens/themes/light.d.ts +16 -0
  197. package/dist/tokens/themes/light.d.ts.map +1 -0
  198. package/package.json +9 -4
  199. package/src/components/accordion/COMPONENT.md +137 -0
  200. package/src/components/avatar/COMPONENT.md +100 -0
  201. package/src/components/badge/COMPONENT.md +78 -0
  202. package/src/components/banner/COMPONENT.md +118 -0
  203. package/src/components/breadcrumb/COMPONENT.md +94 -0
  204. package/src/components/button/COMPONENT.md +80 -0
  205. package/src/components/button-group/COMPONENT.md +83 -0
  206. package/src/components/card/COMPONENT.md +489 -0
  207. package/src/components/checkbox/COMPONENT.md +98 -0
  208. package/src/components/code-block/COMPONENT.md +58 -0
  209. package/src/components/color-picker/COMPONENT.md +149 -0
  210. package/src/components/command-menu/COMPONENT.md +167 -0
  211. package/src/components/data-table/COMPONENT.md +113 -0
  212. package/src/components/datepicker/COMPONENT.md +137 -0
  213. package/src/components/digit-input/COMPONENT.md +68 -0
  214. package/src/components/divider/COMPONENT.md +70 -0
  215. package/src/components/drawer/COMPONENT.md +149 -0
  216. package/src/components/dropdown/COMPONENT.md +192 -0
  217. package/src/components/file-upload/COMPONENT.md +200 -0
  218. package/src/components/hint/COMPONENT.md +67 -0
  219. package/src/components/input/COMPONENT.md +119 -0
  220. package/src/components/kbd/COMPONENT.md +59 -0
  221. package/src/components/label/COMPONENT.md +94 -0
  222. package/src/components/link-button/COMPONENT.md +60 -0
  223. package/src/components/modal/COMPONENT.md +105 -0
  224. package/src/components/notification/COMPONENT.md +120 -0
  225. package/src/components/pagination/COMPONENT.md +61 -0
  226. package/src/components/popover/COMPONENT.md +93 -0
  227. package/src/components/progress-bar/COMPONENT.md +59 -0
  228. package/src/components/progress-circle/COMPONENT.md +63 -0
  229. package/src/components/radio/COMPONENT.md +95 -0
  230. package/src/components/segmented-control/COMPONENT.md +86 -0
  231. package/src/components/segmented-progress-bar/COMPONENT.md +75 -0
  232. package/src/components/select/COMPONENT.md +175 -0
  233. package/src/components/slider/COMPONENT.md +62 -0
  234. package/src/components/stepper/COMPONENT.md +186 -0
  235. package/src/components/switch/COMPONENT.md +98 -0
  236. package/src/components/tabs/COMPONENT.md +114 -0
  237. package/src/components/tag/COMPONENT.md +67 -0
  238. package/src/components/textarea/COMPONENT.md +98 -0
  239. package/src/components/tooltip/COMPONENT.md +87 -0
  240. package/src/components/typography/COMPONENT.md +89 -0
  241. package/src/styles/theme-dark.css +43 -0
  242. package/src/styles/theme-light.css +43 -0
  243. package/src/styles/tokens.css +23 -4
  244. package/src/styles/tokens.test.ts +0 -27
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../tokens/semantic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwGvB,2FAA2F;;;;;;;;;;;;;;;;;;QAkB3F;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2FH;;;;;;WAMG;;YAED,yEAAyE;;;;;YAKzE,sEAAsE;;;;;YAKtE,sEAAsE;;;;;YAKtE,qEAAqE;;;;;YAKrE,mEAAmE;;;;;YAKnE,+FAA+F;;;;;YAK/F,mEAAmE;;;;;YAKnE,4EAA4E;;;;;YAK5E,6DAA6D;;;;;YAK7D,0GAA0G;;;;;YAK1G,+CAA+C;;;;;YAK/C,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;IAuBlD;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;IAwBH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsCD;;;;;;WAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAkHH,wEAAwE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuExE,yGAAyG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsEzG,mFAAmF;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BnF,2FAA2F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAmC3F,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;CAuBzD,CAAC"}
@@ -0,0 +1,143 @@
1
+ export declare const darkThemeOverrides: {
2
+ readonly color: {
3
+ readonly status: {
4
+ readonly information: {
5
+ readonly background: "{color.blue.950}";
6
+ readonly backgroundEmphasis: "{color.blue.500}";
7
+ readonly foreground: "{color.blue.200}";
8
+ readonly border: "{color.blue.800}";
9
+ };
10
+ readonly warning: {
11
+ readonly background: "{color.orange.950}";
12
+ readonly backgroundEmphasis: "{color.orange.500}";
13
+ readonly foreground: "{color.orange.200}";
14
+ readonly border: "{color.orange.800}";
15
+ };
16
+ readonly success: {
17
+ readonly background: "{color.green.950}";
18
+ readonly backgroundEmphasis: "{color.green.500}";
19
+ readonly foreground: "{color.green.200}";
20
+ readonly border: "{color.green.800}";
21
+ };
22
+ readonly away: {
23
+ readonly background: "{color.yellow.950}";
24
+ readonly backgroundEmphasis: "{color.yellow.500}";
25
+ readonly foreground: "{color.yellow.200}";
26
+ readonly border: "{color.yellow.800}";
27
+ };
28
+ readonly feature: {
29
+ readonly background: "{color.purple.950}";
30
+ readonly backgroundEmphasis: "{color.purple.500}";
31
+ readonly foreground: "{color.purple.200}";
32
+ readonly border: "{color.purple.800}";
33
+ };
34
+ readonly verified: {
35
+ readonly background: "{color.sky.950}";
36
+ readonly backgroundEmphasis: "{color.sky.500}";
37
+ readonly foreground: "{color.sky.200}";
38
+ readonly border: "{color.sky.800}";
39
+ };
40
+ readonly error: {
41
+ readonly background: "{color.red.950}";
42
+ readonly backgroundEmphasis: "{color.red.500}";
43
+ readonly foreground: "{color.red.200}";
44
+ readonly border: "{color.red.800}";
45
+ };
46
+ };
47
+ readonly surface: {
48
+ readonly default: "{color.gray.950}";
49
+ readonly raised: "{color.gray.900}";
50
+ readonly elevated: "{color.gray.800}";
51
+ readonly accentSoft: "{color.gray.800}";
52
+ readonly dangerSoft: "{color.red.950}";
53
+ readonly overlay: "{color.overlay.scrimDark}";
54
+ };
55
+ readonly content: {
56
+ readonly primary: "{color.gray.50}";
57
+ readonly secondary: "{color.gray.300}";
58
+ readonly muted: "{color.gray.400}";
59
+ readonly disabled: "{color.gray.600}";
60
+ readonly inverse: "{color.gray.950}";
61
+ readonly accent: "{color.gray.200}";
62
+ readonly danger: "{color.red.200}";
63
+ };
64
+ readonly border: {
65
+ readonly subtle: "{color.gray.800}";
66
+ readonly separator: "{color.gray.500}";
67
+ readonly strong: "{color.gray.600}";
68
+ readonly emphasis: "{color.gray.50}";
69
+ readonly muted: "{color.gray.700}";
70
+ readonly accent: "{color.gray.500}";
71
+ readonly danger: "{color.red.400}";
72
+ readonly disabled: "{color.gray.800}";
73
+ readonly inverse: "{color.white}";
74
+ };
75
+ readonly action: {
76
+ readonly primaryBackground: "{color.gray.50}";
77
+ readonly primaryBackgroundHover: "{color.gray.200}";
78
+ readonly primaryForeground: "{color.gray.950}";
79
+ readonly primarySoftBackground: "color-mix(in srgb, var(--prime-ref-color-gray-50) 42%, var(--prime-ref-color-gray-950))";
80
+ readonly primarySoftForeground: "{color.gray.50}";
81
+ readonly neutralBackground: "{color.gray.900}";
82
+ readonly neutralBackgroundHover: "{color.gray.800}";
83
+ readonly neutralForeground: "{color.gray.50}";
84
+ readonly errorBackground: "{color.red.500}";
85
+ readonly errorBackgroundHover: "{color.red.600}";
86
+ readonly errorForeground: "{color.white}";
87
+ };
88
+ readonly focus: {
89
+ readonly ring: "{color.gray.100}";
90
+ };
91
+ readonly field: {
92
+ readonly bg: "{color.gray.900}";
93
+ readonly text: "{color.gray.50}";
94
+ readonly placeholder: "{color.gray.500}";
95
+ readonly border: "{color.gray.700}";
96
+ readonly borderHover: "{color.gray.600}";
97
+ readonly borderFocus: "{color.gray.300}";
98
+ readonly borderError: "{color.red.400}";
99
+ };
100
+ readonly tooltip: {
101
+ readonly background: "{color.gray.100}";
102
+ readonly foreground: "{color.gray.950}";
103
+ readonly border: "{color.gray.300}";
104
+ };
105
+ readonly dataTable: {
106
+ readonly dividerVertical: "color-mix(in srgb, var(--prime-sys-color-border-subtle) 78%, transparent)";
107
+ readonly dividerHorizontal: "color-mix(in srgb, var(--prime-sys-color-border-subtle) 86%, transparent)";
108
+ readonly headBackground: "{color.surface.elevated}";
109
+ readonly rowBackground: "{color.surface.default}";
110
+ };
111
+ readonly badge: {
112
+ readonly grayFilled: {
113
+ readonly background: "{color.gray.500}";
114
+ };
115
+ readonly pink: {
116
+ readonly backgroundSoft: "{color.pink.950}";
117
+ readonly foregroundOnSoft: "{color.pink.200}";
118
+ readonly backgroundEmphasis: "{color.pink.500}";
119
+ readonly border: "{color.pink.800}";
120
+ };
121
+ readonly teal: {
122
+ readonly backgroundSoft: "{color.teal.950}";
123
+ readonly foregroundOnSoft: "{color.teal.200}";
124
+ readonly backgroundEmphasis: "{color.teal.500}";
125
+ readonly border: "{color.teal.800}";
126
+ };
127
+ };
128
+ };
129
+ readonly elevation: {
130
+ readonly shadow: {
131
+ readonly surface: "0 1px 2px rgba(8, 10, 14, 0.35)";
132
+ readonly modal: "0 24px 48px rgba(8, 10, 14, 0.45)";
133
+ readonly tooltip: "0 14px 30px rgba(8, 10, 14, 0.5), 0 4px 10px rgba(8, 10, 14, 0.4)";
134
+ readonly buttonFocus: "0 0 0 2px rgba(244, 244, 245, 0.28)";
135
+ readonly primaryFocus: "0 0 0 2px rgba(244, 244, 245, 0.4)";
136
+ readonly errorFocus: "0 0 0 2px rgba(248, 113, 113, 0.38)";
137
+ readonly fancyButtonNeutral: "0 1px 2px rgba(8, 10, 14, 0.45), 0 0 0 1px var(--prime-sys-color-content-primary)";
138
+ readonly fancyButtonPrimary: "0 1px 2px rgba(8, 10, 14, 0.45), 0 0 0 1px var(--prime-sys-color-action-primaryBackground)";
139
+ readonly fancyButtonError: "0 1px 2px rgba(8, 10, 14, 0.45), 0 0 0 1px var(--prime-sys-color-action-errorBackground)";
140
+ };
141
+ };
142
+ };
143
+ //# sourceMappingURL=dark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../../tokens/themes/dark.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkJrB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const lightThemeOverrides: {
2
+ readonly color: {
3
+ readonly focus: {
4
+ readonly ring: "{color.gray.950}";
5
+ };
6
+ };
7
+ readonly elevation: {
8
+ readonly shadow: {
9
+ readonly tooltip: "0 12px 28px rgba(15, 17, 21, 0.22), 0 4px 10px rgba(15, 17, 21, 0.16)";
10
+ readonly buttonFocus: "0 0 0 2px rgba(15, 17, 21, 0.14)";
11
+ readonly primaryFocus: "0 0 0 2px rgba(15, 17, 21, 0.2)";
12
+ readonly errorFocus: "0 0 0 2px rgba(220, 38, 38, 0.2)";
13
+ };
14
+ };
15
+ };
16
+ //# sourceMappingURL=light.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../../tokens/themes/light.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;CActB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "prime-ui-kit",
3
- "version": "0.2.5",
3
+ "version": "0.3.1",
4
4
  "description": "React 19 UI kit: CSS Modules, semantic design tokens (--prime-sys-*), composable components — forms, modals, selects, tables, navigation, overlays. TypeScript, ESM, a11y-oriented.",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
5
8
  "keywords": [
6
9
  "a11y",
7
10
  "accessible",
@@ -59,7 +62,8 @@
59
62
  "homepage": "https://github.com/esurkov1/prime-ui#readme",
60
63
  "files": [
61
64
  "dist",
62
- "src/styles",
65
+ "src/styles/*.css",
66
+ "src/components/**/COMPONENT.md",
63
67
  "LICENSE"
64
68
  ],
65
69
  "publishConfig": {
@@ -80,7 +84,6 @@
80
84
  "@vitest/coverage-v8": "^4.1.0",
81
85
  "jsdom": "latest",
82
86
  "esbuild": "^0.27.0",
83
- "tsup": "latest",
84
87
  "typescript": "^5",
85
88
  "vite": "^7",
86
89
  "vitest": "latest"
@@ -109,8 +112,10 @@
109
112
  "./components.css": "./dist/components/index.css"
110
113
  },
111
114
  "scripts": {
115
+ "clean": "rm -rf dist .dts-stage coverage playground/dist",
112
116
  "tokens:build": "bun run scripts/build-tokens.ts",
113
- "build": "bun run tokens:build && tsup --dts-only --config tsup.dts.config.ts && bun run scripts/rm-dist.ts && bun run scripts/bundle-lib.ts && bun run scripts/copy-dts-to-dist.ts",
117
+ "build": "bun run tokens:build && bun run scripts/bundle-lib.ts",
118
+ "prepublishOnly": "bun run clean && bun run build",
114
119
  "dev": "bun run scripts/bundle-lib.ts --watch",
115
120
  "playground:dev": "vite playground --config playground/vite.config.ts",
116
121
  "check": "biome check .",
@@ -0,0 +1,137 @@
1
+ # Accordion
2
+
3
+ **Проектирование по умолчанию:** при проектировании экранов и примеров изначально выбирай **`m`** для `size` (где есть ось размера), если явно не оговорено иное.
4
+
5
+ ## About
6
+
7
+ A compound disclosure pattern: each item has a header trigger and expandable body content, with optional height animation. Use it to stack optional sections (FAQ, settings groups, legal blocks) without leaving the page.
8
+
9
+ **When to use**
10
+
11
+ - Long pages where users open only the sections they need: FAQs, delivery and return copy, grouped settings, order or project detail blocks, knowledge-base articles, sidebars and narrow columns.
12
+ - One-at-a-time expansion (`type="single"`) or several open panels (`type="multiple"`) when comparing sections side by side.
13
+ - Visual density control via `layout="grouped"` (single frame) vs `layout="separate"` (card-like items).
14
+
15
+ **When not to use**
16
+
17
+ - Switching one shared panel with a horizontal tab list — prefer [Tabs](../tabs/COMPONENT.md).
18
+ - When every section must stay visible without extra interaction.
19
+ - Deep hierarchical navigation — prefer a flat list, tree, or separate routes instead of nested accordions.
20
+ - Very heavy bodies inside animated panels (large lists, charts) if `ResizeObserver`-driven height updates become costly.
21
+
22
+ ## Composition
23
+
24
+ - **`Accordion.Root`** wraps all items and supplies `size`, `type`, `layout`, and open-state (`value` / `defaultValue` / `onValueChange`).
25
+ - Per item the order is: **`Accordion.Item`** (required `value`) → **`Accordion.Header`** → **`Accordion.Trigger`** (native `button`) as a **direct** child of the header → **`Accordion.Content`** as a **sibling** of the header (same item), not nested inside the trigger.
26
+ - Put label text, optional **`Accordion.Icon`**, and optional **`Accordion.Arrow`** inside the trigger as needed.
27
+ - **`Accordion.Content`** renders an outer **`section`** (ARIA region) and an inner padded block; `className` applies to the inner block; `style` is merged onto the outer node with the animation height variable.
28
+
29
+ ### Minimal example
30
+
31
+ ```tsx
32
+ import { Accordion } from "prime-ui-kit";
33
+
34
+ export function Example() {
35
+ return (
36
+ <Accordion.Root type="single">
37
+ <Accordion.Item value="one">
38
+ <Accordion.Header>
39
+ <Accordion.Trigger>Section title</Accordion.Trigger>
40
+ </Accordion.Header>
41
+ <Accordion.Content>Section body.</Accordion.Content>
42
+ </Accordion.Item>
43
+ </Accordion.Root>
44
+ );
45
+ }
46
+ ```
47
+
48
+ ## Rules
49
+
50
+ - Use **`type="single"`** for at most one open item, **`type="multiple"`** for any subset open; `defaultValue` is a string or string array matching the type.
51
+ - **Controlled:** pass **`value`** (`string` or `string[]`); updates go through **`onValueChange`**. In `single`, the callback receives a string; closing the open item yields **`""`**. In `multiple`, the callback receives the open id array.
52
+ - **Uncontrolled:** omit `value` and optionally set **`defaultValue`**.
53
+ - **`collapsible`** applies only to **`type="single"`**; set **`collapsible={false}`** to keep at least one item open once opened (cannot collapse to none).
54
+ - **`disabled`** on **`Accordion.Item`** disables the trigger and blocks toggling for that item.
55
+ - **`Accordion.Trigger`:** custom **`onClick`** runs first; call **`preventDefault()`** on the event if you need to cancel the built-in toggle. Prefer **`type="button"`** (default) inside forms.
56
+ - **`Accordion.Arrow`** icons use **`aria-hidden`**; the accessible name must come from trigger text (or an explicit label pattern you add).
57
+ - Keyboard: trigger is a button — **Enter** / **Space** activate; focus ring follows **`focus-visible`** from the theme.
58
+ - **`data-state`** is **`open` | `closed`** on item, trigger, and content wrapper; **`data-disabled`** when the item is disabled.
59
+ - **`AccordionContentProps`** is typed from **`HTMLDivElement`** attributes even though the outer DOM node is **`section`** — target the real **`section`** in tests and CSS when needed.
60
+
61
+ ## API
62
+
63
+ ### Accordion.Root
64
+
65
+ | Prop | Type | Default | Required | Description |
66
+ |------|------|---------|----------|-------------|
67
+ | type | `"single" \| "multiple"` | `"single"` | No | One open item vs many. |
68
+ | value | `string \| string[]` | — | No | Controlled open value(s). |
69
+ | defaultValue | `string \| string[]` | — | No | Initial open value(s) when uncontrolled. |
70
+ | onValueChange | `(value: string \| string[]) => void` | — | No | `single`: string (empty string if none open). `multiple`: string array. |
71
+ | collapsible | `boolean` | `true` | No | `single` only: if `false`, the open item cannot be closed to leave none open. |
72
+ | size | `"s" \| "m" \| "l" \| "xl"` | `"m"` | No | Trigger, icons, and content spacing. |
73
+ | layout | `"grouped" \| "separate"` | `"grouped"` | No | Shared frame vs card-like items. |
74
+ | className | `string` | — | No | Root wrapper class. |
75
+ | children | `React.ReactNode` | — | No | `Accordion.Item` nodes. |
76
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Passed to the root `div`. |
77
+
78
+ ### Accordion.Item
79
+
80
+ | Prop | Type | Default | Required | Description |
81
+ |------|------|---------|----------|-------------|
82
+ | value | `string` | — | Yes | Unique id among siblings under one root. |
83
+ | disabled | `boolean` | `false` | No | Item cannot open; trigger disabled. |
84
+ | className | `string` | — | No | Item wrapper class. |
85
+ | children | `React.ReactNode` | — | No | Header + content. |
86
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Passed to the item `div`. |
87
+
88
+ ### Accordion.Header
89
+
90
+ | Prop | Type | Default | Required | Description |
91
+ |------|------|---------|----------|-------------|
92
+ | className | `string` | — | No | Header class. |
93
+ | children | `React.ReactNode` | — | No | Typically one `Accordion.Trigger`. |
94
+ | …rest | `React.HTMLAttributes<HTMLHeadingElement>` | — | No | Rendered as `h3`. |
95
+
96
+ ### Accordion.Trigger
97
+
98
+ | Prop | Type | Default | Required | Description |
99
+ |------|------|---------|----------|-------------|
100
+ | type | `"button" \| "submit" \| "reset"` | `"button"` | No | Prefer `button` in forms. |
101
+ | className | `string` | — | No | Button class. |
102
+ | children | `React.ReactNode` | — | No | Label and optional icon/arrow slots. |
103
+ | …rest | `React.ButtonHTMLAttributes<HTMLButtonElement>` | — | No | `onClick` invoked before internal toggle. |
104
+
105
+ ### Accordion.Icon
106
+
107
+ | Prop | Type | Default | Required | Description |
108
+ |------|------|---------|----------|-------------|
109
+ | as | `React.ElementType` | `"div"` | No | Polymorphic element for the icon wrapper. |
110
+ | className | `string` | — | No | Wrapper class. |
111
+ | children | `React.ReactNode` | — | No | Icon content when using a text-only element. |
112
+ | …rest | Depends on `as` | — | No | Props for the chosen element (except `as` / `className`). |
113
+
114
+ ### Accordion.Arrow
115
+
116
+ | Prop | Type | Default | Required | Description |
117
+ |------|------|---------|----------|-------------|
118
+ | openIcon | `React.ElementType` | `ChevronDown` | No | Default chevron rotates when closed vs open; or paired with `closeIcon`. |
119
+ | closeIcon | `React.ElementType` | — | No | If set and differs from `openIcon`, shows two icons without rotation. |
120
+ | className | `string` | — | No | `span` wrapper class. |
121
+ | …rest | `React.HTMLAttributes<HTMLSpanElement>` | — | No | Icons are `aria-hidden`. |
122
+
123
+ ### Accordion.Content
124
+
125
+ | Prop | Type | Default | Required | Description |
126
+ |------|------|---------|----------|-------------|
127
+ | className | `string` | — | No | Class on the inner padded block. |
128
+ | style | `React.CSSProperties` | — | No | Merged on the outer `section` with the animated height CSS variable. |
129
+ | children | `React.ReactNode` | — | No | Panel body. |
130
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Spread on the outer `section`; `aria-labelledby` / `aria-hidden` come from context. |
131
+
132
+ ## Related
133
+
134
+ - [Typography](../typography/COMPONENT.md) — body copy inside `Accordion.Content`.
135
+ - [Button](../button/COMPONENT.md) — external actions coordinated with controlled `value` on the root.
136
+ - [Tabs](../tabs/COMPONENT.md) — alternative when one panel switches without a vertical stack of headers.
137
+ - [Modal](../modal/COMPONENT.md) and [Drawer](../drawer/COMPONENT.md) — often host accordions in limited vertical space.
@@ -0,0 +1,100 @@
1
+ # Avatar
2
+
3
+ **Проектирование по умолчанию:** при проектировании экранов и примеров изначально выбирай **`m`** для `size` (где есть ось размера), если явно не оговорено иное.
4
+
5
+ ## About
6
+
7
+ Circular avatar with an optional photo (`Avatar.Image`), a fallback layer (`Avatar.Fallback`), and an optional horizontal stack (`Avatar.Group`) with an overflow cell.
8
+
9
+ - **Use** for profile pictures, participant lists, assignees in tables, and compact identity in headers or comments when a face or initials aid recognition.
10
+ - **Use** `Avatar.Group` when several avatars should overlap in one row and you may show a “+N” overflow.
11
+ - **Do not use** as the only focusable control without a wrapping `button` or `link` when the avatar itself must be actionable.
12
+ - **Do not use** for non-circular crops or rich media cards; keep this primitive for round avatars and short fallback content.
13
+ - **Do not use** expecting an external “controlled” image load state; status lives inside `Avatar.Root` and resets when `src` changes (see Rules).
14
+
15
+ ## Composition
16
+
17
+ - **`Avatar.Root`** — outer `div` with `data-size`, provides context (`size`, internal image status). Place **`Avatar.Image`** (optional) and **`Avatar.Fallback`** inside; image is painted above the fallback in the layout.
18
+ - **`Avatar.Image`** — `img` with `data-status` (`loading` \| `loaded` \| `error`). Requires **`src`**; the implementation remounts when **`src`** changes, which restarts loading and context status.
19
+ - **`Avatar.Fallback`** — `span` shown when the image is absent, loading, or in error; when the image has loaded successfully, the fallback gets **`aria-hidden`**.
20
+ - **`Avatar.Group.Root`** — horizontal flex row; passes its **`size`** into child **`Avatar.Root`** and **`Avatar.Group.Overflow`** that omit their own **`size`** (including through **`React.Fragment`** children).
21
+ - **`Avatar.Group.Overflow`** — cell matching avatar dimensions for text such as `+3`.
22
+
23
+ ### Minimal example
24
+
25
+ ```tsx
26
+ import { Avatar } from "prime-ui-kit";
27
+
28
+ export function Example() {
29
+ return (
30
+ <Avatar.Root>
31
+ <Avatar.Image src="/avatar.png" alt="" />
32
+ <Avatar.Fallback>AB</Avatar.Fallback>
33
+ </Avatar.Root>
34
+ );
35
+ }
36
+ ```
37
+
38
+ ## Rules
39
+
40
+ - Image lifecycle is **internal**: context status is `idle` \| `loading` \| `loaded` \| `error`; there is no prop to control it from outside—change **`src`** (or remove **`Avatar.Image`**) to reset behavior.
41
+ - Put **`Avatar.Image`** and **`Avatar.Fallback`** only under **`Avatar.Root`**; **`Avatar.Fallback`** does not accept a **`src`**—photos go through **`Avatar.Image`** only.
42
+ - Give **`Avatar.Root`** or a wrapper a clear name for assistive tech (**`aria-label`**, **`aria-labelledby`**, or nearby visible text). On **`Avatar.Image`**, use a non-empty **`alt`** when the photo conveys meaning; use **`alt=""`** when it duplicates a visible name.
43
+ - After a successful load, **`Avatar.Fallback`** is **`aria-hidden`** so screen readers do not double-announce initials and alt text.
44
+ - For **`Avatar.Group.Root`** and **`Avatar.Group.Overflow`**, prefer summary labels (**`aria-label`**) when the stack or “+N” needs context.
45
+ - There is no **`disabled`** prop; mute or disable via the parent (e.g. button **`disabled`**, link **`aria-disabled`**, reduced opacity).
46
+ - **`Avatar.Group`** is laid out as a **horizontal** row only; nesting **`Avatar.Root`** inside another **`Avatar.Root`** is not a supported pattern.
47
+
48
+ ## API
49
+
50
+ ### Avatar.Root
51
+
52
+ | Prop | Type | Default | Required | Description |
53
+ |------|------|---------|----------|-------------|
54
+ | size | `"s" \| "m" \| "l" \| "xl" \| "2xl" \| "3xl" \| "4xl" \| "5xl" \| "6xl"` | `"m"` | No | Diameter, radius, and fallback typography scale |
55
+ | children | `React.ReactNode` | — | No | Typically `Avatar.Image` and `Avatar.Fallback` |
56
+ | className | `string` | — | No | Additional class on the root |
57
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Other root attributes |
58
+
59
+ ### Avatar.Image
60
+
61
+ | Prop | Type | Default | Required | Description |
62
+ |------|------|---------|----------|-------------|
63
+ | src | `string` | — | Yes | Image URL; changing `src` remounts the image and resets status |
64
+ | alt | `string` | `""` | No | Alternative text for the image |
65
+ | className | `string` | — | No | Class on the `img` |
66
+ | …rest | `Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src" \| "alt">` | — | No | e.g. `loading`, `decoding`, event handlers |
67
+
68
+ ### Avatar.Fallback
69
+
70
+ | Prop | Type | Default | Required | Description |
71
+ |------|------|---------|----------|-------------|
72
+ | children | `React.ReactNode` | — | No | Initials, icon, or placeholder |
73
+ | className | `string` | — | No | Class on the `span` |
74
+ | …rest | `React.HTMLAttributes<HTMLSpanElement>` | — | No | Other attributes |
75
+
76
+ ### Avatar.Group.Root
77
+
78
+ | Prop | Type | Default | Required | Description |
79
+ |------|------|---------|----------|-------------|
80
+ | size | same as `Avatar.Root` | `"m"` | No | Size applied to child `Avatar.Root` and `Avatar.Group.Overflow` without their own `size` |
81
+ | children | `React.ReactNode` | — | No | `Avatar.Root` nodes and optional `Avatar.Group.Overflow` |
82
+ | className | `string` | — | No | Class on the group container |
83
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Other attributes |
84
+
85
+ ### Avatar.Group.Overflow
86
+
87
+ | Prop | Type | Default | Required | Description |
88
+ |------|------|---------|----------|-------------|
89
+ | size | same as `Avatar.Root` | `"m"` | No | Local size when not inherited from the group |
90
+ | children | `React.ReactNode` | — | No | e.g. `+3` |
91
+ | className | `string` | — | No | Class on the overflow cell |
92
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Other attributes |
93
+
94
+ ## Related
95
+
96
+ - [Button](../button/COMPONENT.md)
97
+ - [Dropdown](../dropdown/COMPONENT.md)
98
+ - [Label](../label/COMPONENT.md)
99
+ - [Tooltip](../tooltip/COMPONENT.md)
100
+ - [Typography](../typography/COMPONENT.md)
@@ -0,0 +1,78 @@
1
+ # Badge
2
+
3
+ **Проектирование по умолчанию:** при проектировании экранов и примеров изначально выбирай **`m`** для `size` (где есть ось размера), если явно не оговорено иное.
4
+
5
+ ## About
6
+
7
+ A compact, non-interactive label for status, category, or counts. Optional `Badge.Dot` and `Badge.Icon` slots align a decorative dot or an icon with text; `variant="status"` adds a built-in presence dot and live-region semantics.
8
+
9
+ - **When to use:** surface short metadata next to headings, table rows, or list items (stage, environment, stock, role).
10
+ - **When to use:** show presence or mode with `variant="status"` when short visible copy fits the layout; use `label` when screen readers need more than `children` alone (see Rules).
11
+ - **When to use:** pair a semantic `color` and `variant` (`filled`, `light`, `lighter`, `stroke`) with density and emphasis needs on dashboards and catalogs.
12
+ - **When to use:** combine `Badge.Icon` with text or icon-only content when the icon should inherit badge sizing from `ControlSizeProvider`.
13
+ - **When not to use:** as the primary control for a click or navigation — use [Button](../button/COMPONENT.md) or [LinkButton](../link-button/COMPONENT.md) instead.
14
+ - **When not to use:** for removable or selectable tags — use [Tag](../tag/COMPONENT.md).
15
+ - **When not to use:** for keyboard shortcut glyphs — use [Kbd](../kbd/COMPONENT.md).
16
+
17
+ ## Composition
18
+
19
+ - **`Badge.Root`** — root `div`; wraps `children` in `ControlSizeProvider` so nested icons can inherit control size. With **`variant="status"`**, renders a built-in status dot (`aria-hidden`), sets `role="status"`, optional `aria-label` from `label`, and ignores `color` for styling (dot color follows `status`).
20
+ - **`Badge.Dot`** — optional decorative dot inside the label (`span`, `aria-hidden`); use with non-status variants when you need a manual indicator next to text or icons.
21
+ - **`Badge.Icon`** — optional `span` wrapper for an icon node; place it before or after text, or use it alone for icon-only badges. Order of `Dot`, `Icon`, and text is up to layout needs.
22
+
23
+ ### Minimal example
24
+
25
+ ```tsx
26
+ import { Badge } from "prime-ui-kit";
27
+
28
+ export function Example() {
29
+ return <Badge.Root>New</Badge.Root>;
30
+ }
31
+ ```
32
+
33
+ ## Rules
34
+
35
+ - Omit `size` to inherit from the nearest `ControlSizeProvider` / control-surface context; if none is present, the effective size is **`m`**. Context value **`xs`** maps to badge size **`s`**.
36
+ - With **`variant="status"`**, pass **`label`** when visible `children` alone are not enough for assistive tech (e.g. a generic word without whose status it is).
37
+ - **`Badge.Dot`** (both manual and the built-in status dot) is **`aria-hidden`** — do not rely on it alone to communicate state.
38
+ - **`disabled`** dims the badge via `data-disabled`; there is no loading, error, or focus ring — the badge is not keyboard-operable.
39
+ - **`color`** applies only when **`variant` is not `"status"`**; for status mode, dot appearance is driven by **`status`** (default **`online`** when unset).
40
+
41
+ ## API
42
+
43
+ ### Badge.Root
44
+
45
+ | Prop | Type | Default | Required | Description |
46
+ |------|------|---------|----------|-------------|
47
+ | `color` | `"gray" \| "red" \| "blue" \| "green" \| "orange" \| "yellow" \| "purple" \| "sky" \| "pink" \| "teal"` | `"gray"` | No | Semantic palette; ignored for styling when `variant="status"`. |
48
+ | `variant` | `"filled" \| "light" \| "lighter" \| "stroke" \| "status"` | `"light"` | No | Fill, stroke, or status layout with built-in dot. |
49
+ | `size` | `"s" \| "m" \| "l" \| "xl"` | from context or `"m"` | No | Explicit size; otherwise derived from control surface context, else `"m"`. |
50
+ | `disabled` | `boolean` | — | No | Muted look; sets `data-disabled`. |
51
+ | `status` | `"online" \| "offline" \| "away" \| "busy"` | `"online"` | No | Dot semantics when `variant="status"`; ignored otherwise. |
52
+ | `label` | `string` | — | No | `aria-label` on the root when `variant="status"`. |
53
+ | `children` | `React.ReactNode` | — | No | Text, `Badge.Dot`, `Badge.Icon`, or icons. |
54
+ | `className` | `string` | — | No | Extra class on the root. |
55
+ | … | `React.HTMLAttributes<HTMLDivElement>` | — | No | Other attributes and `ref` on the root `div`. |
56
+
57
+ ### Badge.Icon
58
+
59
+ | Prop | Type | Default | Required | Description |
60
+ |------|------|---------|----------|-------------|
61
+ | `children` | `React.ReactNode` | — | Yes | Icon node. |
62
+ | `className` | `string` | — | No | Wrapper class. |
63
+ | … | `Omit<React.HTMLAttributes<HTMLDivElement>, "children">` | — | No | Other wrapper attributes. |
64
+
65
+ ### Badge.Dot
66
+
67
+ | Prop | Type | Default | Required | Description |
68
+ |------|------|---------|----------|-------------|
69
+ | `className` | `string` | — | No | Extra class on the dot. |
70
+ | … | `React.HTMLAttributes<HTMLSpanElement>` | — | No | Other `span` attributes; node is `aria-hidden`. |
71
+
72
+ ## Related
73
+
74
+ - [Tag](../tag/COMPONENT.md)
75
+ - [Typography](../typography/COMPONENT.md)
76
+ - [Button](../button/COMPONENT.md)
77
+ - [LinkButton](../link-button/COMPONENT.md)
78
+ - [Kbd](../kbd/COMPONENT.md)
@@ -0,0 +1,118 @@
1
+ # Banner
2
+
3
+ **Проектирование по умолчанию:** при проектировании экранов и примеров изначально выбирай **`m`** для `size` (где есть ось размера), если явно не оговорено иное.
4
+
5
+ ## About
6
+
7
+ An in-flow announcement strip: a root grid with a central content column and an optional dismiss control on the right. Use `status` and `variant` for semantic color and density; optional slots cover icon, title, description, and actions.
8
+
9
+ - **Use** for persistent page- or section-level messages (policy, incident, feature, validation summary) where the user should read the text in context.
10
+ - **Use** when you need optional actions (`Banner.Actions`) or dismiss without leaving the page.
11
+ - **Use** `size` to align spacing and typography with surrounding controls (`ControlSizeProvider` context applies to `Banner.CloseButton`).
12
+ - **Do not use** for transient overlay feedback; prefer [Notification](../notification/COMPONENT.md) or similar patterns.
13
+ - **Do not use** as a substitute for [Modal](../modal/COMPONENT.md) or [Drawer](../drawer/COMPONENT.md) when the user must complete a blocking task.
14
+ - **Do not use** decorative icons without `aria-hidden` (or an accessible name) when the icon is not redundant with the title.
15
+
16
+ ## Composition
17
+
18
+ - `Banner.Root` is the outer `div` and size provider; pass `variant`, `status`, `size`, and optionally `onDismiss`.
19
+ - Put primary copy inside `Banner.Content`. Typical order: `Banner.Icon` (optional), `Banner.Title`, `Banner.Description` (optional), `Banner.Actions` (optional).
20
+ - `Banner.CloseButton` must be a **direct child** of `Banner.Root` (a sibling of `Banner.Content`, not nested inside `Content`). The implementation only scans **direct** children to decide whether to inject a default close button when `onDismiss` is set; a close control placed only inside `Banner.Content` does not suppress injection.
21
+ - If `onDismiss` is provided and no direct child is `Banner.CloseButton`, the root appends a default close button that calls `onDismiss`.
22
+
23
+ ### Minimal example
24
+
25
+ ```tsx
26
+ import { Banner } from "prime-ui-kit";
27
+
28
+ export function Example() {
29
+ return (
30
+ <Banner.Root>
31
+ <Banner.Content>
32
+ <Banner.Title>Title</Banner.Title>
33
+ </Banner.Content>
34
+ </Banner.Root>
35
+ );
36
+ }
37
+ ```
38
+
39
+ ## Rules
40
+
41
+ - There is no `open` / `visible` prop: mount or unmount the root (or hide it with parent state) to show or hide the strip.
42
+ - `variant` defaults to `filled`; `status` to `information`; `size` to `m`. `stroke` uses a neutral surface with a status-colored bottom accent bar.
43
+ - Decorative icons: pass `aria-hidden` on the underlying SVG/component when the title already conveys the message.
44
+ - For a meaningful page-level region, set `role="region"` and `aria-label` or `aria-labelledby` on `Banner.Root` via standard HTML attributes.
45
+ - The auto-injected dismiss control uses `aria-label="Dismiss"`; set an explicit `aria-label` (or equivalent) on a custom `Banner.CloseButton` in the product language.
46
+ - `Banner.Title` and `Banner.Description` render as `span` elements; keep markup intentional if you nest interactive elements.
47
+ - `Banner.Icon` is driven by the `as` prop (not `asChild` on the root).
48
+
49
+ ## API
50
+
51
+ ### Banner.Root
52
+
53
+ | Prop | Type | Default | Required | Description |
54
+ |------|------|---------|----------|-------------|
55
+ | variant | `"filled" \| "light" \| "lighter" \| "stroke"` | `"filled"` | No | Background density and accent treatment (`stroke` adds a status-colored bottom bar). |
56
+ | status | `"information" \| "warning" \| "error" \| "success" \| "feature"` | `"information"` | No | Semantic palette for the strip. |
57
+ | size | `"s" \| "m" \| "l" \| "xl"` | `"m"` | No | Spacing and type scale; feeds `Banner.CloseButton` via control-size context. |
58
+ | onDismiss | `() => void` | — | No | When set and no direct `Banner.CloseButton` child exists, renders a default close button that invokes this callback. |
59
+ | className | `string` | — | No | Additional class on the root `div`. |
60
+ | children | `React.ReactNode` | — | No | Typically `Banner.Content` and optionally `Banner.CloseButton`. |
61
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Native attributes on the root `div` (e.g. `id`, `role`, ARIA). |
62
+
63
+ ### Banner.Content
64
+
65
+ | Prop | Type | Default | Required | Description |
66
+ |------|------|---------|----------|-------------|
67
+ | className | `string` | — | No | Additional class on the content column `div`. |
68
+ | children | `React.ReactNode` | — | No | Icon, title, description, and/or actions. |
69
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Native attributes on the inner `div`. |
70
+
71
+ ### Banner.Icon
72
+
73
+ | Prop | Type | Default | Required | Description |
74
+ |------|------|---------|----------|-------------|
75
+ | as | `React.ElementType` | `"div"` | No | Element or component to render (often an icon component). |
76
+ | className | `string` | — | No | Additional class on the wrapper. |
77
+ | children | `React.ReactNode` | — | No | Content when using the default element or a custom wrapper. |
78
+ | …rest | props of `T` without `as` and `className` | — | No | Forwarded to the element chosen by `as`. |
79
+
80
+ ### Banner.Title
81
+
82
+ | Prop | Type | Default | Required | Description |
83
+ |------|------|---------|----------|-------------|
84
+ | className | `string` | — | No | Additional class on the `span`. |
85
+ | children | `React.ReactNode` | — | No | Primary heading text. |
86
+ | …rest | `React.HTMLAttributes<HTMLSpanElement>` | — | No | Native `span` attributes. |
87
+
88
+ ### Banner.Description
89
+
90
+ | Prop | Type | Default | Required | Description |
91
+ |------|------|---------|----------|-------------|
92
+ | className | `string` | — | No | Additional class on the `span`. |
93
+ | children | `React.ReactNode` | — | No | Supporting text. |
94
+ | …rest | `React.HTMLAttributes<HTMLSpanElement>` | — | No | Native `span` attributes. |
95
+
96
+ ### Banner.Actions
97
+
98
+ | Prop | Type | Default | Required | Description |
99
+ |------|------|---------|----------|-------------|
100
+ | className | `string` | — | No | Additional class on the actions row `div`. |
101
+ | children | `React.ReactNode` | — | No | Action controls (e.g. `Button`, `LinkButton`). |
102
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Native attributes on the row `div`. |
103
+
104
+ ### Banner.CloseButton
105
+
106
+ | Prop | Type | Default | Required | Description |
107
+ |------|------|---------|----------|-------------|
108
+ | type | `"button" \| "submit" \| "reset"` | `"button"` | No | Native `button` type. |
109
+ | className | `string` | — | No | Additional class on the button. |
110
+ | children | `React.ReactNode` | — | No | Button content; defaults to a cross icon when omitted. |
111
+ | …rest | `Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size">` | — | No | Other button props; `size` is derived from banner context. |
112
+
113
+ ## Related
114
+
115
+ - [Button](../button/COMPONENT.md) — actions inside `Banner.Actions`; `Banner.CloseButton` wraps `Button.Root` (ghost neutral).
116
+ - [LinkButton](../link-button/COMPONENT.md) — text-style navigation actions in the strip.
117
+ - [Typography](../typography/COMPONENT.md) — surrounding captions or body copy outside the banner slots.
118
+ - [Notification](../notification/COMPONENT.md) — transient or stacked overlay messages instead of an in-flow strip.