@lanfermann/ui 0.4.0 → 0.6.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 (177) hide show
  1. package/dist/components/action-bar/action-bar.d.ts +59 -0
  2. package/dist/components/action-bar/action-bar.js +116 -0
  3. package/dist/components/alert/alert.d.ts +1 -1
  4. package/dist/components/alert/alert.js +3 -17
  5. package/dist/components/alert-dialog/alert-dialog.d.ts +1 -1
  6. package/dist/components/app-shell/app-shell.d.ts +33 -0
  7. package/dist/components/app-shell/app-shell.js +93 -0
  8. package/dist/components/attachment/attachment.d.ts +46 -0
  9. package/dist/components/attachment/attachment.js +222 -0
  10. package/dist/components/attachment/kinds.d.ts +7 -0
  11. package/dist/components/attachment/kinds.js +100 -0
  12. package/dist/components/avatar/avatar.d.ts +14 -4
  13. package/dist/components/avatar/avatar.js +57 -13
  14. package/dist/components/avatar-group/avatar-group.d.ts +33 -0
  15. package/dist/components/avatar-group/avatar-group.js +110 -0
  16. package/dist/components/avatar-group/people.d.ts +12 -0
  17. package/dist/components/avatar-group/people.js +24 -0
  18. package/dist/components/badge/badge.d.ts +9 -3
  19. package/dist/components/badge/badge.js +21 -6
  20. package/dist/components/banner/banner.d.ts +39 -0
  21. package/dist/components/banner/banner.js +149 -0
  22. package/dist/components/card/card.d.ts +11 -3
  23. package/dist/components/card/card.js +18 -4
  24. package/dist/components/checkbox-card/checkbox-card.d.ts +21 -0
  25. package/dist/components/checkbox-card/checkbox-card.js +49 -0
  26. package/dist/components/chip/chip-group.d.ts +15 -0
  27. package/dist/components/chip/chip-group.js +44 -0
  28. package/dist/components/chip/chip-variants.d.ts +6 -0
  29. package/dist/components/chip/chip-variants.js +28 -0
  30. package/dist/components/chip/chip.d.ts +39 -0
  31. package/dist/components/chip/chip.js +71 -0
  32. package/dist/components/code-block/code-block-live.d.ts +13 -1
  33. package/dist/components/code-block/code-block-live.js +10 -4
  34. package/dist/components/code-block/code-block.d.ts +1 -0
  35. package/dist/components/code-block/code-copy.d.ts +3 -11
  36. package/dist/components/code-block/code-copy.js +15 -62
  37. package/dist/components/code-block/code-keys.js +10 -22
  38. package/dist/components/code-block/code-lines-live.d.ts +7 -0
  39. package/dist/components/code-block/code-lines-live.js +167 -0
  40. package/dist/components/code-block/code-lines-view.d.ts +1 -0
  41. package/dist/components/code-block/code-lines-view.js +50 -18
  42. package/dist/components/code-block/code-lines.d.ts +3 -0
  43. package/dist/components/code-block/code-tabs.d.ts +1 -0
  44. package/dist/components/code-block/highlight.d.ts +1 -0
  45. package/dist/components/code-block/line-diff.js +135 -0
  46. package/dist/components/combobox/combobox.d.ts +50 -2
  47. package/dist/components/combobox/combobox.js +178 -9
  48. package/dist/components/command/command.d.ts +131 -0
  49. package/dist/components/command/command.js +335 -0
  50. package/dist/components/consent/consent-card.js +365 -0
  51. package/dist/components/consent/consent-embed.d.ts +21 -0
  52. package/dist/components/consent/consent-embed.js +111 -0
  53. package/dist/components/consent/consent-labels.d.ts +70 -0
  54. package/dist/components/consent/consent-labels.js +61 -0
  55. package/dist/components/consent/consent-record.d.ts +95 -0
  56. package/dist/components/consent/consent-record.js +112 -0
  57. package/dist/components/consent/consent-store.d.ts +26 -0
  58. package/dist/components/consent/consent-store.js +240 -0
  59. package/dist/components/consent/consent.d.ts +86 -0
  60. package/dist/components/consent/consent.js +306 -0
  61. package/dist/components/container/container.d.ts +1 -1
  62. package/dist/components/context-menu/context-menu.d.ts +23 -0
  63. package/dist/components/context-menu/context-menu.js +50 -0
  64. package/dist/components/conversation/conversation.d.ts +45 -0
  65. package/dist/components/conversation/conversation.js +295 -0
  66. package/dist/components/conversation/stick.js +23 -0
  67. package/dist/components/copy-button/copy-button.d.ts +50 -0
  68. package/dist/components/copy-button/copy-button.js +65 -0
  69. package/dist/components/copy-page/copy-page.js +7 -17
  70. package/dist/components/copy-pill/copy-pill.js +1 -1
  71. package/dist/components/description-list/description-list.d.ts +32 -0
  72. package/dist/components/description-list/description-list.js +51 -0
  73. package/dist/components/empty/empty.d.ts +38 -0
  74. package/dist/components/empty/empty.js +57 -0
  75. package/dist/components/field/field.js +1 -1
  76. package/dist/components/file-upload/file-upload.d.ts +96 -0
  77. package/dist/components/file-upload/file-upload.js +347 -0
  78. package/dist/components/file-upload/files.d.ts +39 -0
  79. package/dist/components/file-upload/files.js +74 -0
  80. package/dist/components/grow/grow.d.ts +15 -3
  81. package/dist/components/grow/grow.js +31 -10
  82. package/dist/components/heading/heading.d.ts +1 -1
  83. package/dist/components/icon/icon.d.ts +1 -1
  84. package/dist/components/input/input.js +1 -1
  85. package/dist/components/message/message.d.ts +73 -0
  86. package/dist/components/message/message.js +196 -0
  87. package/dist/components/otp-field/otp-field.d.ts +37 -0
  88. package/dist/components/otp-field/otp-field.js +126 -0
  89. package/dist/components/pagination/pagination.d.ts +50 -0
  90. package/dist/components/pagination/pagination.js +188 -0
  91. package/dist/components/prompt-input/keys.js +15 -0
  92. package/dist/components/prompt-input/prompt-input.d.ts +89 -0
  93. package/dist/components/prompt-input/prompt-input.js +331 -0
  94. package/dist/components/radio-card/radio-card.d.ts +23 -0
  95. package/dist/components/radio-card/radio-card.js +48 -0
  96. package/dist/components/rolling-number/rolling-number.d.ts +30 -0
  97. package/dist/components/rolling-number/rolling-number.js +149 -0
  98. package/dist/components/seam/seam.d.ts +1 -1
  99. package/dist/components/secret-field/secret-field.d.ts +53 -0
  100. package/dist/components/secret-field/secret-field.js +121 -0
  101. package/dist/components/section/section.d.ts +1 -1
  102. package/dist/components/select/select.d.ts +1 -1
  103. package/dist/components/select/select.js +1 -1
  104. package/dist/components/shortcut/shortcut.d.ts +46 -0
  105. package/dist/components/shortcut/shortcut.js +87 -0
  106. package/dist/components/sidebar/sidebar-context.js +16 -0
  107. package/dist/components/sidebar/sidebar.d.ts +161 -0
  108. package/dist/components/sidebar/sidebar.js +588 -0
  109. package/dist/components/site-header/site-header.js +1 -1
  110. package/dist/components/skeleton/loaded.d.ts +21 -0
  111. package/dist/components/skeleton/loaded.js +57 -0
  112. package/dist/components/skeleton/skeleton.d.ts +43 -0
  113. package/dist/components/skeleton/skeleton.js +48 -0
  114. package/dist/components/sources/source-list.d.ts +17 -0
  115. package/dist/components/sources/source-list.js +26 -0
  116. package/dist/components/sources/sources.d.ts +45 -0
  117. package/dist/components/sources/sources.js +167 -0
  118. package/dist/components/stat/stat.d.ts +57 -0
  119. package/dist/components/stat/stat.js +110 -0
  120. package/dist/components/steps/steps.d.ts +57 -0
  121. package/dist/components/steps/steps.js +131 -0
  122. package/dist/components/table/table.d.ts +18 -9
  123. package/dist/components/table/table.js +21 -13
  124. package/dist/components/text/text.d.ts +1 -1
  125. package/dist/components/theme-switch/theme-switch.js +1 -1
  126. package/dist/components/time-field/time-field.js +1 -1
  127. package/dist/components/timeline/timeline.d.ts +45 -0
  128. package/dist/components/timeline/timeline.js +86 -0
  129. package/dist/components/toast/toast.js +10 -26
  130. package/dist/components/toggle/toggle.d.ts +24 -0
  131. package/dist/components/toggle/toggle.js +53 -0
  132. package/dist/components/toggle-group/toggle-group.d.ts +27 -0
  133. package/dist/components/toggle-group/toggle-group.js +38 -0
  134. package/dist/components/toolbar/toolbar-context.js +12 -0
  135. package/dist/components/toolbar/toolbar.d.ts +45 -0
  136. package/dist/components/toolbar/toolbar.js +92 -0
  137. package/dist/components/trace/trace.d.ts +2 -1
  138. package/dist/components/trace/trace.js +14 -26
  139. package/dist/index.d.ts +46 -3
  140. package/dist/index.js +44 -3
  141. package/dist/internal/arriving-pieces.js +56 -0
  142. package/dist/internal/arriving.js +171 -0
  143. package/dist/internal/avatar-cut.d.ts +15 -0
  144. package/dist/internal/avatar-cut.js +83 -0
  145. package/dist/internal/choice-card.d.ts +15 -0
  146. package/dist/internal/choice-card.js +65 -0
  147. package/dist/internal/clipboard.js +37 -0
  148. package/dist/internal/copy.js +58 -0
  149. package/dist/internal/field.js +24 -4
  150. package/dist/internal/glyphs.js +26 -1
  151. package/dist/internal/live-list.js +41 -0
  152. package/dist/internal/number-places.js +156 -0
  153. package/dist/internal/picker-sheet.js +1 -1
  154. package/dist/internal/presence-dot.js +24 -0
  155. package/dist/internal/presence.js +104 -0
  156. package/dist/internal/rail-mark.d.ts +3 -0
  157. package/dist/internal/rail-mark.js +33 -0
  158. package/dist/internal/status-icon.js +22 -0
  159. package/dist/internal/travelling-mark.js +204 -0
  160. package/dist/lib/cn.js +4 -0
  161. package/dist/lib/shortcut.d.ts +11 -0
  162. package/dist/lib/shortcut.js +165 -0
  163. package/package.json +1 -1
  164. package/src/styles/action-bar.css +28 -0
  165. package/src/styles/assistant.css +83 -0
  166. package/src/styles/avatar.css +24 -0
  167. package/src/styles/code.css +89 -1
  168. package/src/styles/consent.css +65 -0
  169. package/src/styles/copy.css +12 -11
  170. package/src/styles/depth.css +46 -2
  171. package/src/styles/marks.css +20 -2
  172. package/src/styles/rail.css +49 -0
  173. package/src/styles/rolling-number.css +94 -0
  174. package/src/styles/steps.css +98 -0
  175. package/src/styles/timeline.css +48 -0
  176. package/src/styles/travel.css +36 -0
  177. package/src/styles.css +9 -0
@@ -0,0 +1,161 @@
1
+ import { ButtonProps } from "../button/button.js";
2
+ import { IconSvgElement } from "../icon/icon.js";
3
+ import { ComponentProps, ReactNode } from "react";
4
+ import { Menu } from "@base-ui/react/menu";
5
+ import { useRender } from "@base-ui/react/use-render";
6
+ export type SidebarProps = Omit<ComponentProps<"div">, "aria-label"> & {
7
+ /** The name of the navigation for assistive tech ("Hauptnavigation"). */
8
+ "aria-label": string;
9
+ /**
10
+ * What is left of it when it is collapsed. `rail` (the default): the symbols stay, each named
11
+ * by a tooltip. `hidden`: nothing, and the page has the whole window.
12
+ */
13
+ collapse?: "rail" | "hidden";
14
+ };
15
+ /**
16
+ * The navigation of an app, beside its pages: the places one works in, in groups, each with a
17
+ * symbol. It is read and it leads somewhere, so it is flat: no shadow, a hairline to the page.
18
+ * The page one is on stands on the tint, and the tint travels there when the page changes; on a
19
+ * subpage it goes down to the subpage. By default it stands on the page's ground; `bg-well` as
20
+ * its class makes it a plate of its own beside the page.
21
+ *
22
+ * Put a `SidebarHeader`, a `SidebarContent` with the entries and a `SidebarFooter` inside, and
23
+ * the sidebar inside an `AppShell`. The shell keeps whether it is open; a `SidebarTrigger`
24
+ * anywhere in the shell collapses it, and so does ⌘B. Collapsed, the symbols stay where they
25
+ * are and what stands to their right leaves. On a narrow window the same sidebar comes in from
26
+ * the left as a drawer that can be swiped back.
27
+ *
28
+ * Word an entry as the place, a noun of one or two words ("Angebote", "Einstellungen"). An
29
+ * entry that does something instead of leading somewhere belongs in a menu or the page.
30
+ */
31
+ export declare function Sidebar({ "aria-label": label, collapse, className, children, ...props }: SidebarProps): import("react").JSX.Element;
32
+ /** What stands above the entries and stays there: the workspace, the product's mark. */
33
+ export declare function SidebarHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
34
+ /** What stands below the entries and stays there: the person who is signed in. */
35
+ export declare function SidebarFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
36
+ /**
37
+ * The entries: `SidebarGroup`s, or `SidebarItem`s without a group. It is the navigation, named
38
+ * by the sidebar's `aria-label`, and it scrolls inside itself when the entries do not fit,
39
+ * fading at the end that has more.
40
+ */
41
+ export declare function SidebarContent({ className, children, ...props }: ComponentProps<"nav">): import("react").JSX.Element;
42
+ export type SidebarGroupProps = Omit<ComponentProps<"li">, "title"> & {
43
+ /** What the entries below have in common: a noun ("Arbeit", "Verwaltung"). */
44
+ title?: ReactNode;
45
+ /** The group can be folded under its name. */
46
+ collapsible?: boolean;
47
+ /** Whether a group that folds is open (controlled). */
48
+ open?: boolean;
49
+ /** Whether a group that folds is open at first. Open unless said otherwise. */
50
+ defaultOpen?: boolean;
51
+ onOpenChange?: (open: boolean) => void;
52
+ };
53
+ /**
54
+ * Entries that belong together, under their name. Without a `title` they simply stand apart
55
+ * from the group before. A group that is `collapsible` folds under its name; use it for a
56
+ * group that is long and not needed every day, and leave the main one alone.
57
+ */
58
+ export declare function SidebarGroup({ title, collapsible, open, defaultOpen, onOpenChange, className, children, ...props }: SidebarGroupProps): import("react").JSX.Element;
59
+ /** What the symbol does under the pointer, besides darkening. */
60
+ declare const symbolMotion: {
61
+ /** Nothing. The default: a symbol is not sized up just so that something happens. */
62
+ readonly none: "";
63
+ /** It turns by a sixth: for what turns, a gear, a wheel, something that reloads. */
64
+ readonly turn: "motion-safe:group-hover/row:rotate-60";
65
+ /** It leans, the way a sheet is picked up by its corner: for a page, a note, a letter. */
66
+ readonly tilt: "motion-safe:group-hover/row:-rotate-8";
67
+ };
68
+ type RowParts = {
69
+ /** The symbol in front of the name, from `@hugeicons/core-free-icons`. */
70
+ icon?: IconSvgElement;
71
+ /**
72
+ * What the symbol does under the pointer besides darkening: `none` (the default), `turn` for
73
+ * what turns (a gear), `tilt` for a sheet or a note. Give it only to a symbol that has such a
74
+ * motion in it. A press makes every symbol dip and seat back.
75
+ */
76
+ iconMotion?: keyof typeof symbolMotion;
77
+ /** A picture in place of the symbol: an `Avatar size="sm"`. */
78
+ media?: ReactNode;
79
+ /** A quiet fact at the end of the row: how many wait there (a number), a `Shortcut`. */
80
+ detail?: ReactNode;
81
+ };
82
+ export type SidebarItemProps = Omit<useRender.ComponentProps<"a">, "className"> & RowParts & {
83
+ className?: string;
84
+ /** The page this entry leads to is the one being worked on. */
85
+ current?: boolean;
86
+ /**
87
+ * What lies under this page, as `SidebarSubItem`s. Shown under the current page, or under
88
+ * any page that is `open`. They fold open under their page and fold away again, and what
89
+ * stands below moves with them.
90
+ */
91
+ sub?: ReactNode;
92
+ /**
93
+ * The reader is on one of its subpages, which then wears `current` itself: `sub` shows
94
+ * although this page is not the current one, and the page stays in the text colour. Say it
95
+ * only then. Where the subpage cannot wear the tint (folded away on the rail), this page
96
+ * wears it in its place.
97
+ */
98
+ open?: boolean;
99
+ };
100
+ /**
101
+ * One place of the app: a symbol and its name. For a router's link, pass it as `render`. On
102
+ * the rail the name is a tooltip beside the symbol.
103
+ */
104
+ export declare function SidebarItem({ icon, iconMotion, media, detail, current, sub, open, render, className, children, onClick, ...props }: SidebarItemProps): import("react").JSX.Element;
105
+ export type SidebarSubItemProps = Omit<useRender.ComponentProps<"a">, "className"> & Pick<RowParts, "icon" | "iconMotion"> & {
106
+ className?: string;
107
+ /** The subpage this entry leads to is the one being worked on. */
108
+ current?: boolean;
109
+ };
110
+ /**
111
+ * A subpage under an entry, with a 14px symbol if the subpages have them (all of them, or none:
112
+ * the names should start on one line). The one being worked on stands on the tint, which comes
113
+ * down to it from the page above; that page stays in the text colour, so the part of the app
114
+ * one is in can still be told.
115
+ */
116
+ export declare function SidebarSubItem({ icon, iconMotion, current, render, className, onClick, children, ...props }: SidebarSubItemProps): import("react").JSX.Element;
117
+ export type SidebarMenuProps = Omit<useRender.ComponentProps<"button">, "className"> & Omit<RowParts, "detail"> & Pick<Menu.Root.Props, "open" | "defaultOpen" | "onOpenChange" | "modal"> & {
118
+ className?: string;
119
+ /**
120
+ * What the menu holds: a `MenuLinkItem` for each place, with its 16px symbol before the
121
+ * name, or `MenuItem`s for things to do.
122
+ */
123
+ items: ReactNode;
124
+ /** One of the places in the menu is the page being worked on: the entry stands on the tint. */
125
+ current?: boolean;
126
+ };
127
+ /**
128
+ * An entry that opens a menu beside the sidebar instead of leading somewhere: the places that
129
+ * are needed now and then and would make the list too long ("Mehr"). A chevron at its end
130
+ * points to where the menu opens. On the rail the menu opens from the symbol alone, and in the
131
+ * drawer of a narrow window it opens below the entry.
132
+ *
133
+ * Name it as what the menu holds, a noun, and put the places inside as `items`. What is needed
134
+ * every day stays in the list as a `SidebarItem`.
135
+ */
136
+ export declare function SidebarMenu({ icon, iconMotion, media, items, current, open, defaultOpen, onOpenChange, modal, render, className, children, ...props }: SidebarMenuProps): import("react").JSX.Element;
137
+ export type SidebarButtonProps = Omit<useRender.ComponentProps<"button">, "className"> & RowParts & {
138
+ className?: string;
139
+ /**
140
+ * The row opens a menu: two small chevrons at its end say so. They part a little under the
141
+ * pointer, and stay parted while the menu is open. Takes the place of `detail`.
142
+ */
143
+ menu?: boolean;
144
+ };
145
+ /**
146
+ * A row that is pressed instead of leading somewhere, for the header and the footer: the
147
+ * workspace or the person, as the trigger of a `Menu`
148
+ * (`<MenuTrigger render={<SidebarButton menu media={…}>…</SidebarButton>} />`). Not for the
149
+ * list of places: those are `SidebarItem`s.
150
+ */
151
+ export declare function SidebarButton({ icon, iconMotion, media, detail, menu, render, className, children, ...props }: SidebarButtonProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
152
+ export type SidebarTriggerProps = Omit<ButtonProps, "iconOnly" | "aria-label" | "children"> & {
153
+ /** The accessible name. It names the thing; whether it is open is said separately. */
154
+ "aria-label"?: string;
155
+ };
156
+ /**
157
+ * The button that collapses and expands the sidebar, usually the first thing in the page's bar.
158
+ * On a narrow window it opens the sidebar as a drawer. Its tooltip names the shortcut.
159
+ */
160
+ export declare function SidebarTrigger({ "aria-label": label, className, onClick, ...props }: SidebarTriggerProps): import("react").JSX.Element;
161
+ export {};