@gouno/ui 0.3.2

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 (231) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/LICENSE +21 -0
  3. package/README.md +144 -0
  4. package/dist/base.css +239 -0
  5. package/dist/bootstrap.js +22 -0
  6. package/dist/components/primitives/alert-dialog.d.ts +18 -0
  7. package/dist/components/primitives/alert-dialog.js +43 -0
  8. package/dist/components/primitives/alert.d.ts +9 -0
  9. package/dist/components/primitives/alert.js +25 -0
  10. package/dist/components/primitives/avatar.d.ts +14 -0
  11. package/dist/components/primitives/avatar.js +42 -0
  12. package/dist/components/primitives/badge.d.ts +9 -0
  13. package/dist/components/primitives/badge.js +25 -0
  14. package/dist/components/primitives/button.d.ts +10 -0
  15. package/dist/components/primitives/button.js +36 -0
  16. package/dist/components/primitives/checkbox.d.ts +4 -0
  17. package/dist/components/primitives/checkbox.js +10 -0
  18. package/dist/components/primitives/dialog.d.ts +20 -0
  19. package/dist/components/primitives/dialog.js +37 -0
  20. package/dist/components/primitives/dropdown-menu.d.ts +25 -0
  21. package/dist/components/primitives/dropdown-menu.js +51 -0
  22. package/dist/components/primitives/empty.d.ts +11 -0
  23. package/dist/components/primitives/empty.js +33 -0
  24. package/dist/components/primitives/field.d.ts +24 -0
  25. package/dist/components/primitives/field.js +75 -0
  26. package/dist/components/primitives/input.d.ts +3 -0
  27. package/dist/components/primitives/input.js +7 -0
  28. package/dist/components/primitives/label.d.ts +4 -0
  29. package/dist/components/primitives/label.js +8 -0
  30. package/dist/components/primitives/popover.d.ts +16 -0
  31. package/dist/components/primitives/popover.js +31 -0
  32. package/dist/components/primitives/radio-group.d.ts +5 -0
  33. package/dist/components/primitives/radio-group.js +13 -0
  34. package/dist/components/primitives/select.d.ts +15 -0
  35. package/dist/components/primitives/select.js +38 -0
  36. package/dist/components/primitives/separator.d.ts +4 -0
  37. package/dist/components/primitives/separator.js +8 -0
  38. package/dist/components/primitives/sheet.d.ts +17 -0
  39. package/dist/components/primitives/sheet.js +41 -0
  40. package/dist/components/primitives/skeleton.d.ts +2 -0
  41. package/dist/components/primitives/skeleton.js +6 -0
  42. package/dist/components/primitives/switch.d.ts +6 -0
  43. package/dist/components/primitives/switch.js +8 -0
  44. package/dist/components/primitives/table.d.ts +28 -0
  45. package/dist/components/primitives/table.js +44 -0
  46. package/dist/components/primitives/tabs.d.ts +11 -0
  47. package/dist/components/primitives/tabs.js +30 -0
  48. package/dist/components/primitives/textarea.d.ts +3 -0
  49. package/dist/components/primitives/textarea.js +7 -0
  50. package/dist/components/primitives/tooltip.d.ts +13 -0
  51. package/dist/components/primitives/tooltip.js +24 -0
  52. package/dist/core/affix.d.ts +14 -0
  53. package/dist/core/affix.js +29 -0
  54. package/dist/core/alert.d.ts +54 -0
  55. package/dist/core/alert.js +56 -0
  56. package/dist/core/anchor.d.ts +16 -0
  57. package/dist/core/anchor.js +31 -0
  58. package/dist/core/app.d.ts +5 -0
  59. package/dist/core/app.js +5 -0
  60. package/dist/core/aspect-ratio.d.ts +6 -0
  61. package/dist/core/aspect-ratio.js +6 -0
  62. package/dist/core/autocomplete.d.ts +24 -0
  63. package/dist/core/autocomplete.js +139 -0
  64. package/dist/core/avatar.d.ts +26 -0
  65. package/dist/core/avatar.js +20 -0
  66. package/dist/core/badge.d.ts +16 -0
  67. package/dist/core/badge.js +22 -0
  68. package/dist/core/breadcrumb.d.ts +55 -0
  69. package/dist/core/breadcrumb.js +69 -0
  70. package/dist/core/button.d.ts +49 -0
  71. package/dist/core/button.js +66 -0
  72. package/dist/core/calendar.d.ts +48 -0
  73. package/dist/core/calendar.js +179 -0
  74. package/dist/core/card.d.ts +30 -0
  75. package/dist/core/card.js +12 -0
  76. package/dist/core/carousel.d.ts +49 -0
  77. package/dist/core/carousel.js +166 -0
  78. package/dist/core/cascader.d.ts +19 -0
  79. package/dist/core/cascader.js +45 -0
  80. package/dist/core/code-block.d.ts +16 -0
  81. package/dist/core/code-block.js +47 -0
  82. package/dist/core/collapse.d.ts +49 -0
  83. package/dist/core/collapse.js +96 -0
  84. package/dist/core/color-picker.d.ts +9 -0
  85. package/dist/core/color-picker.js +8 -0
  86. package/dist/core/config-provider.d.ts +10 -0
  87. package/dist/core/config-provider.js +14 -0
  88. package/dist/core/control-types.d.ts +2 -0
  89. package/dist/core/control-types.js +7 -0
  90. package/dist/core/date-picker.d.ts +13 -0
  91. package/dist/core/date-picker.js +14 -0
  92. package/dist/core/date-range-picker.d.ts +26 -0
  93. package/dist/core/date-range-picker.js +10 -0
  94. package/dist/core/descriptions.d.ts +41 -0
  95. package/dist/core/descriptions.js +133 -0
  96. package/dist/core/drawer.d.ts +9 -0
  97. package/dist/core/drawer.js +58 -0
  98. package/dist/core/empty.d.ts +8 -0
  99. package/dist/core/empty.js +5 -0
  100. package/dist/core/feedback.d.ts +5 -0
  101. package/dist/core/feedback.js +5 -0
  102. package/dist/core/field.d.ts +15 -0
  103. package/dist/core/field.js +19 -0
  104. package/dist/core/float-button.d.ts +13 -0
  105. package/dist/core/float-button.js +22 -0
  106. package/dist/core/form.d.ts +19 -0
  107. package/dist/core/form.js +56 -0
  108. package/dist/core/icon-button.d.ts +7 -0
  109. package/dist/core/icon-button.js +4 -0
  110. package/dist/core/icon.d.ts +17 -0
  111. package/dist/core/icon.js +35 -0
  112. package/dist/core/image.d.ts +76 -0
  113. package/dist/core/image.js +189 -0
  114. package/dist/core/index.d.ts +79 -0
  115. package/dist/core/index.js +77 -0
  116. package/dist/core/input-number.d.ts +24 -0
  117. package/dist/core/input-number.js +70 -0
  118. package/dist/core/input-otp.d.ts +14 -0
  119. package/dist/core/input-otp.js +76 -0
  120. package/dist/core/input.d.ts +14 -0
  121. package/dist/core/input.js +51 -0
  122. package/dist/core/kbd.d.ts +8 -0
  123. package/dist/core/kbd.js +11 -0
  124. package/dist/core/layout-primitives.d.ts +11 -0
  125. package/dist/core/layout-primitives.js +8 -0
  126. package/dist/core/layout.d.ts +71 -0
  127. package/dist/core/layout.js +119 -0
  128. package/dist/core/list.d.ts +37 -0
  129. package/dist/core/list.js +35 -0
  130. package/dist/core/locale.d.ts +48 -0
  131. package/dist/core/locale.js +32 -0
  132. package/dist/core/mentions.d.ts +10 -0
  133. package/dist/core/mentions.js +112 -0
  134. package/dist/core/menu.d.ts +79 -0
  135. package/dist/core/menu.js +265 -0
  136. package/dist/core/message.d.ts +16 -0
  137. package/dist/core/message.js +36 -0
  138. package/dist/core/modal.d.ts +40 -0
  139. package/dist/core/modal.js +67 -0
  140. package/dist/core/notification.d.ts +15 -0
  141. package/dist/core/notification.js +39 -0
  142. package/dist/core/page-layout.d.ts +6 -0
  143. package/dist/core/page-layout.js +7 -0
  144. package/dist/core/pagination.d.ts +28 -0
  145. package/dist/core/pagination.js +69 -0
  146. package/dist/core/popconfirm.d.ts +13 -0
  147. package/dist/core/popconfirm.js +42 -0
  148. package/dist/core/progress.d.ts +6 -0
  149. package/dist/core/progress.js +8 -0
  150. package/dist/core/public-props.d.ts +82 -0
  151. package/dist/core/public-props.js +1 -0
  152. package/dist/core/qrcode.d.ts +14 -0
  153. package/dist/core/qrcode.js +17 -0
  154. package/dist/core/rate.d.ts +11 -0
  155. package/dist/core/rate.js +48 -0
  156. package/dist/core/result.d.ts +12 -0
  157. package/dist/core/result.js +19 -0
  158. package/dist/core/segmented.d.ts +29 -0
  159. package/dist/core/segmented.js +38 -0
  160. package/dist/core/select.d.ts +27 -0
  161. package/dist/core/select.js +143 -0
  162. package/dist/core/selection-controls.d.ts +12 -0
  163. package/dist/core/selection-controls.js +23 -0
  164. package/dist/core/separator.d.ts +24 -0
  165. package/dist/core/separator.js +17 -0
  166. package/dist/core/slider.d.ts +2 -0
  167. package/dist/core/slider.js +6 -0
  168. package/dist/core/spin.d.ts +7 -0
  169. package/dist/core/spin.js +7 -0
  170. package/dist/core/spinner.d.ts +3 -0
  171. package/dist/core/spinner.js +6 -0
  172. package/dist/core/splitter.d.ts +44 -0
  173. package/dist/core/splitter.js +208 -0
  174. package/dist/core/statistic.d.ts +12 -0
  175. package/dist/core/statistic.js +6 -0
  176. package/dist/core/steps.d.ts +54 -0
  177. package/dist/core/steps.js +106 -0
  178. package/dist/core/tabs.d.ts +40 -0
  179. package/dist/core/tabs.js +80 -0
  180. package/dist/core/tag.d.ts +19 -0
  181. package/dist/core/tag.js +29 -0
  182. package/dist/core/textarea.d.ts +8 -0
  183. package/dist/core/textarea.js +14 -0
  184. package/dist/core/time-picker.d.ts +9 -0
  185. package/dist/core/time-picker.js +8 -0
  186. package/dist/core/timeline.d.ts +37 -0
  187. package/dist/core/timeline.js +48 -0
  188. package/dist/core/tour.d.ts +18 -0
  189. package/dist/core/tour.js +51 -0
  190. package/dist/core/transfer.d.ts +16 -0
  191. package/dist/core/transfer.js +46 -0
  192. package/dist/core/tree-select.d.ts +19 -0
  193. package/dist/core/tree-select.js +19 -0
  194. package/dist/core/tree.d.ts +89 -0
  195. package/dist/core/tree.js +386 -0
  196. package/dist/core/typography.d.ts +20 -0
  197. package/dist/core/typography.js +12 -0
  198. package/dist/core/upload.d.ts +20 -0
  199. package/dist/core/upload.js +72 -0
  200. package/dist/core/watermark.d.ts +10 -0
  201. package/dist/core/watermark.js +21 -0
  202. package/dist/fonts/inter-LICENSE +93 -0
  203. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  204. package/dist/fonts/jetbrains-mono-LICENSE +93 -0
  205. package/dist/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  206. package/dist/gouno/app-shell.d.ts +22 -0
  207. package/dist/gouno/app-shell.js +27 -0
  208. package/dist/gouno/index.d.ts +4 -0
  209. package/dist/gouno/index.js +4 -0
  210. package/dist/gouno/page-container.d.ts +4 -0
  211. package/dist/gouno/page-container.js +6 -0
  212. package/dist/gouno/page-header.d.ts +8 -0
  213. package/dist/gouno/page-header.js +6 -0
  214. package/dist/hooks/use-overlay-body.d.ts +6 -0
  215. package/dist/hooks/use-overlay-body.js +18 -0
  216. package/dist/index.d.ts +5 -0
  217. package/dist/index.js +5 -0
  218. package/dist/lib/utils.d.ts +2 -0
  219. package/dist/lib/utils.js +5 -0
  220. package/dist/patterns/bulk-action-bar.d.ts +8 -0
  221. package/dist/patterns/bulk-action-bar.js +7 -0
  222. package/dist/patterns/index.d.ts +5 -0
  223. package/dist/patterns/index.js +5 -0
  224. package/dist/theme/index.d.ts +2 -0
  225. package/dist/theme/index.js +2 -0
  226. package/dist/theme/provider.d.ts +22 -0
  227. package/dist/theme/provider.js +76 -0
  228. package/dist/theme/theme-toggle.d.ts +6 -0
  229. package/dist/theme/theme-toggle.js +10 -0
  230. package/dist/tokens.css +164 -0
  231. package/package.json +111 -0
@@ -0,0 +1,93 @@
1
+ Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) JetBrainsMono-Italic[wght].ttf: Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,22 @@
1
+ import { type ReactNode } from "react";
2
+ export interface AppShellProps {
3
+ brand: ReactNode;
4
+ navigation: (close: () => void) => ReactNode;
5
+ toolbar?: ReactNode;
6
+ breadcrumbs?: ReactNode;
7
+ account?: ReactNode;
8
+ footer?: ReactNode;
9
+ children: ReactNode;
10
+ navigationLabel?: string;
11
+ }
12
+ /**
13
+ * Application-level chrome for Gouno product surfaces. Routing, permissions,
14
+ * authentication and product state remain owned by the consuming application.
15
+ */
16
+ export declare function AppShell({ brand, navigation, toolbar, breadcrumbs, account, footer, children, navigationLabel, }: AppShellProps): import("react").JSX.Element;
17
+ export interface NavigationGroupProps {
18
+ label?: string;
19
+ children: ReactNode;
20
+ }
21
+ export declare function NavigationGroup({ label, children }: NavigationGroupProps): import("react").JSX.Element;
22
+ export declare const navigationItemClass = "flex min-h-10 min-w-0 items-center gap-2 rounded-md px-3 py-2 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0 aria-[current=page]:bg-accent aria-[current=page]:font-semibold aria-[current=page]:text-accent-foreground";
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useRef, useState } from "react";
3
+ import { Menu } from "lucide-react";
4
+ import { IconButton } from "../core/icon-button.js";
5
+ import { Sheet, SheetContent, SheetHeader, SheetTitle, } from "../components/primitives/sheet.js";
6
+ /**
7
+ * Application-level chrome for Gouno product surfaces. Routing, permissions,
8
+ * authentication and product state remain owned by the consuming application.
9
+ */
10
+ export function AppShell({ brand, navigation, toolbar, breadcrumbs, account, footer, children, navigationLabel = "应用导航", }) {
11
+ const [open, setOpen] = useState(false);
12
+ const navigationTrigger = useRef(null);
13
+ const instanceId = useId().replaceAll(":", "");
14
+ const mainId = `app-shell-main-${instanceId}`;
15
+ return (_jsxs("div", { "data-slot": "app-shell", className: "min-h-dvh bg-canvas text-foreground", children: [_jsx("a", { href: `#${mainId}`, className: "sr-only focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-50 focus:rounded-md focus:bg-popover focus:p-3", children: "\u8DF3\u81F3\u4E3B\u8981\u5185\u5BB9" }), _jsxs("header", { className: "sticky top-0 z-30 flex h-16 items-center gap-4 border-b bg-background px-4 lg:px-6", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3 lg:w-[264px]", children: [_jsx(IconButton, { ref: navigationTrigger, className: "lg:hidden", label: navigationLabel, icon: _jsx(Menu, {}), onClick: () => setOpen(true) }), _jsx("div", { className: "min-w-0 truncate text-base font-semibold tracking-tight text-primary", children: brand })] }), _jsx("div", { className: "hidden min-w-0 flex-1 text-sm text-muted-foreground md:block", children: breadcrumbs }), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [toolbar, account] })] }), _jsxs("div", { className: "grid min-h-[calc(100dvh-64px)] lg:grid-cols-[288px_minmax(0,1fr)]", children: [_jsxs("aside", { className: "sticky top-16 hidden h-[calc(100dvh-64px)] flex-col border-r bg-sidebar px-3 py-5 lg:flex", children: [_jsx("nav", { "aria-label": navigationLabel, className: "min-h-0 flex-1 overflow-y-auto", children: navigation(() => { }) }), footer ? _jsx("div", { className: "mt-4 border-t pt-4", children: footer }) : null] }), _jsx("main", { id: mainId, tabIndex: -1, className: "min-w-0 px-4 py-6 outline-none md:px-6 xl:px-8", children: children })] }), _jsx(Sheet, { open: open, onOpenChange: setOpen, children: _jsxs(SheetContent, { side: "left", className: "flex w-[320px] max-w-[calc(100vw-1rem)] flex-col bg-sidebar", "aria-describedby": undefined, onCloseAutoFocus: (event) => {
16
+ event.preventDefault();
17
+ navigationTrigger.current?.focus();
18
+ }, children: [_jsx(SheetHeader, { children: _jsx(SheetTitle, { children: brand }) }), _jsx("nav", { "aria-label": navigationLabel, className: "flex-1 overflow-auto px-3", children: navigation(() => setOpen(false)) }), footer ? _jsx("div", { className: "p-4", children: footer }) : null] }) })] }));
19
+ }
20
+ const navigationGroupClass = "mb-6 flex flex-col gap-1";
21
+ export function NavigationGroup({ label, children }) {
22
+ if (!label) {
23
+ return (_jsx("div", { "data-slot": "navigation-group", className: navigationGroupClass, children: children }));
24
+ }
25
+ return (_jsxs("section", { "data-slot": "navigation-group", className: navigationGroupClass, children: [_jsx("h2", { className: "px-3 pb-2 text-xs font-medium text-muted-foreground", children: label }), children] }));
26
+ }
27
+ export const navigationItemClass = "flex min-h-10 min-w-0 items-center gap-2 rounded-md px-3 py-2 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0 aria-[current=page]:bg-accent aria-[current=page]:font-semibold aria-[current=page]:text-accent-foreground";
@@ -0,0 +1,4 @@
1
+ /** Canonical Gouno product-family application structure. */
2
+ export { AppShell, NavigationGroup, navigationItemClass, type AppShellProps, type NavigationGroupProps, } from "./app-shell.js";
3
+ export { PageContainer, type PageContainerProps } from "./page-container.js";
4
+ export { PageHeader, type PageHeaderProps } from "./page-header.js";
@@ -0,0 +1,4 @@
1
+ /** Canonical Gouno product-family application structure. */
2
+ export { AppShell, NavigationGroup, navigationItemClass, } from "./app-shell.js";
3
+ export { PageContainer } from "./page-container.js";
4
+ export { PageHeader } from "./page-header.js";
@@ -0,0 +1,4 @@
1
+ import type { HTMLAttributes } from "react";
2
+ export type PageContainerProps = HTMLAttributes<HTMLDivElement>;
3
+ /** Standard content-width and vertical-rhythm container for Gouno product pages. */
4
+ export declare function PageContainer({ className, ...props }: PageContainerProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ /** Standard content-width and vertical-rhythm container for Gouno product pages. */
4
+ export function PageContainer({ className, ...props }) {
5
+ return (_jsx("div", { ...props, "data-slot": "page-container", className: cn("mx-auto flex w-full min-w-0 max-w-[1440px] flex-col gap-6", className) }));
6
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from "react";
2
+ export interface PageHeaderProps {
3
+ title: ReactNode;
4
+ description?: ReactNode;
5
+ actions?: ReactNode;
6
+ className?: string;
7
+ }
8
+ export declare function PageHeader({ title, description, actions, className, }: PageHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Heading, Text } from "../core/typography.js";
3
+ import { cn } from "../lib/utils.js";
4
+ export function PageHeader({ title, description, actions, className, }) {
5
+ return (_jsxs("header", { "data-slot": "page-header", className: cn("flex flex-col gap-4 md:flex-row md:items-start md:justify-between", className), children: [_jsxs("div", { className: "min-w-0", children: [_jsx(Heading, { level: 1, className: "text-2xl leading-tight tracking-tight", children: title }), description ? (_jsx(Text, { tone: "muted", size: "sm", className: "mt-2 max-w-3xl leading-relaxed", children: description })) : null] }), actions ? (_jsx("div", { className: "flex shrink-0 flex-wrap items-center gap-2", children: actions })) : null] }));
6
+ }
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from "react";
2
+ /** A detached portal retains form state without keeping a closed focus scope mounted. */
3
+ export declare function useOverlayBody(children: ReactNode, open: boolean, destroyOnClose: boolean): {
4
+ body: import("react").JSX.Element;
5
+ portal: import("react").ReactPortal | null;
6
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useState } from "react";
3
+ import { createPortal } from "react-dom";
4
+ /** A detached portal retains form state without keeping a closed focus scope mounted. */
5
+ export function useOverlayBody(children, open, destroyOnClose) {
6
+ const [host] = useState(() => typeof document === "undefined" ? null : document.createElement("div"));
7
+ const [visited, setVisited] = useState(open);
8
+ useEffect(() => { if (open)
9
+ setVisited(true); }, [open]);
10
+ const attach = useCallback((node) => {
11
+ if (node && host)
12
+ node.appendChild(host);
13
+ }, [host]);
14
+ return {
15
+ body: _jsx("div", { ref: attach }),
16
+ portal: host && (open || (visited && !destroyOnClose)) ? createPortal(children, host) : null,
17
+ };
18
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./core/index.js";
2
+ export * from "./patterns/index.js";
3
+ export * from "./gouno/index.js";
4
+ export * from "./theme/index.js";
5
+ export { cn } from "./lib/utils.js";
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./core/index.js";
2
+ export * from "./patterns/index.js";
3
+ export * from "./gouno/index.js";
4
+ export * from "./theme/index.js";
5
+ export { cn } from "./lib/utils.js";
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,5 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export interface BulkActionBarProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "role"> {
3
+ selectionLabel: ReactNode;
4
+ onCancel: () => void;
5
+ cancelLabel?: ReactNode;
6
+ children?: ReactNode;
7
+ }
8
+ export declare function BulkActionBar({ selectionLabel, onCancel, cancelLabel, children, className, "aria-label": ariaLabel, ...props }: BulkActionBarProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "../core/button.js";
3
+ import { Text } from "../core/typography.js";
4
+ import { cn } from "../lib/utils.js";
5
+ export function BulkActionBar({ selectionLabel, onCancel, cancelLabel = "取消", children, className, "aria-label": ariaLabel = "批量操作", ...props }) {
6
+ return (_jsxs("div", { ...props, role: "toolbar", "aria-label": ariaLabel, "data-slot": "bulk-action-bar", className: cn("sticky bottom-4 z-20 flex flex-col gap-3 rounded-lg border border-primary/30 bg-card p-4 sm:flex-row sm:items-center", className), children: [_jsx(Text, { size: "sm", className: "font-medium sm:mr-auto", children: selectionLabel }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", "data-slot": "bulk-action-bar-actions", children: [children, _jsx(Button, { size: "small", variant: "text", onClick: onCancel, children: cancelLabel })] })] }));
7
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Canonical reusable compound interaction patterns admitted through
3
+ * docs/product-driven-development.md evidence review.
4
+ */
5
+ export { BulkActionBar, type BulkActionBarProps } from "./bulk-action-bar.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Canonical reusable compound interaction patterns admitted through
3
+ * docs/product-driven-development.md evidence review.
4
+ */
5
+ export { BulkActionBar } from "./bulk-action-bar.js";
@@ -0,0 +1,2 @@
1
+ export { ThemeProvider, useTheme, resolveMode, readMode, brandNames, type ThemeProviderProps, type ThemeMode, type Brand, type Density, } from "./provider.js";
2
+ export { ThemeToggle, type ThemeToggleProps } from "./theme-toggle.js";
@@ -0,0 +1,2 @@
1
+ export { ThemeProvider, useTheme, resolveMode, readMode, brandNames, } from "./provider.js";
2
+ export { ThemeToggle } from "./theme-toggle.js";
@@ -0,0 +1,22 @@
1
+ import { type ReactNode } from "react";
2
+ export type ThemeMode = "light" | "dark" | "system";
3
+ export type Brand = "blog" | "blog-admin" | "gosso-admin";
4
+ export type Density = "comfortable" | "compact";
5
+ export declare const brandNames: Record<Brand, string>;
6
+ export declare function resolveMode(mode: ThemeMode, systemDark: boolean): "light" | "dark";
7
+ export declare function readMode(key: string): ThemeMode;
8
+ interface ThemeContextValue {
9
+ mode: ThemeMode;
10
+ resolvedMode: "light" | "dark";
11
+ brand: Brand;
12
+ setMode: (mode: ThemeMode) => void;
13
+ }
14
+ export declare const useTheme: () => ThemeContextValue;
15
+ export interface ThemeProviderProps {
16
+ children: ReactNode;
17
+ brand: Brand;
18
+ storageKey: string;
19
+ density?: Density;
20
+ }
21
+ export declare function ThemeProvider({ children, brand, storageKey, density, }: ThemeProviderProps): import("react").JSX.Element;
22
+ export {};
@@ -0,0 +1,76 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useState, } from "react";
3
+ export const brandNames = {
4
+ blog: "Blog",
5
+ "blog-admin": "Blog Admin",
6
+ "gosso-admin": "Gosso Admin",
7
+ };
8
+ export function resolveMode(mode, systemDark) {
9
+ return mode === "system" ? (systemDark ? "dark" : "light") : mode;
10
+ }
11
+ export function readMode(key) {
12
+ try {
13
+ const value = localStorage.getItem(key);
14
+ return value === "light" || value === "dark" ? value : "system";
15
+ }
16
+ catch {
17
+ return "system";
18
+ }
19
+ }
20
+ const ThemeContext = createContext({
21
+ mode: "system",
22
+ resolvedMode: "light",
23
+ brand: "blog",
24
+ setMode: () => { },
25
+ });
26
+ export const useTheme = () => useContext(ThemeContext);
27
+ export function ThemeProvider({ children, brand, storageKey, density = "comfortable", }) {
28
+ const [mode, updateMode] = useState(() => readMode(storageKey));
29
+ const [systemDark, setSystemDark] = useState(() => typeof matchMedia === "function" &&
30
+ matchMedia("(prefers-color-scheme: dark)").matches);
31
+ const resolvedMode = resolveMode(mode, systemDark);
32
+ useEffect(() => {
33
+ if (typeof window.matchMedia !== "function")
34
+ return;
35
+ const query = window.matchMedia("(prefers-color-scheme: dark)");
36
+ const update = () => setSystemDark(query.matches);
37
+ const storage = (event) => {
38
+ if (event.key === storageKey || event.key === null)
39
+ updateMode(readMode(storageKey));
40
+ };
41
+ update();
42
+ query.addEventListener("change", update);
43
+ window.addEventListener("storage", storage);
44
+ return () => {
45
+ query.removeEventListener("change", update);
46
+ window.removeEventListener("storage", storage);
47
+ };
48
+ }, [storageKey]);
49
+ useLayoutEffect(() => {
50
+ const root = document.documentElement;
51
+ root.dataset.theme = resolvedMode;
52
+ root.dataset.density = density;
53
+ root.style.colorScheme = resolvedMode;
54
+ document
55
+ .querySelector('meta[name="theme-color"]')
56
+ ?.setAttribute("content", resolvedMode === "dark" ? "#11151b" : "#ffffff");
57
+ }, [resolvedMode, density]);
58
+ useLayoutEffect(() => {
59
+ document.documentElement.dataset.brand = brand;
60
+ }, [brand]);
61
+ const value = useMemo(() => ({
62
+ mode,
63
+ resolvedMode,
64
+ brand,
65
+ setMode: (next) => {
66
+ updateMode(next);
67
+ try {
68
+ localStorage.setItem(storageKey, next);
69
+ }
70
+ catch {
71
+ /* In-memory preference still works. */
72
+ }
73
+ },
74
+ }), [mode, resolvedMode, brand, storageKey]);
75
+ return (_jsx(ThemeContext.Provider, { value: value, children: children }));
76
+ }
@@ -0,0 +1,6 @@
1
+ import { type ThemeMode } from "./provider.js";
2
+ export interface ThemeToggleProps {
3
+ label?: string;
4
+ labels?: Record<ThemeMode, string>;
5
+ }
6
+ export declare function ThemeToggle({ label, labels, }: ThemeToggleProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Monitor, Moon, Sun } from "lucide-react";
3
+ import { IconButton } from "../core/icon-button.js";
4
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger, } from "../components/primitives/dropdown-menu.js";
5
+ import { useTheme } from "./provider.js";
6
+ export function ThemeToggle({ label = "主题", labels = { light: "浅色", dark: "深色", system: "跟随系统" }, }) {
7
+ const { mode, resolvedMode, setMode } = useTheme();
8
+ const Icon = mode === "system" ? Monitor : resolvedMode === "dark" ? Moon : Sun;
9
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(IconButton, { label: label, icon: _jsx(Icon, {}), "aria-pressed": resolvedMode === "dark" }) }), _jsx(DropdownMenuContent, { align: "end", children: _jsx(DropdownMenuGroup, { children: _jsx(DropdownMenuRadioGroup, { value: mode, onValueChange: (next) => setMode(next), children: ["light", "dark", "system"].map((value) => (_jsx(DropdownMenuRadioItem, { value: value, children: labels[value] }, value))) }) }) })] }));
10
+ }