@qeetrix/react 0.0.1 → 0.0.4

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 (263) hide show
  1. package/CHANGELOG.md +288 -0
  2. package/README.md +240 -4
  3. package/dist/accordion/accordion.d.ts +42 -0
  4. package/dist/accordion/accordion.js +72 -0
  5. package/dist/accordion/index.d.ts +2 -0
  6. package/dist/accordion/index.js +1 -0
  7. package/dist/avatar/avatar.d.ts +21 -0
  8. package/dist/avatar/avatar.js +43 -0
  9. package/dist/avatar/index.d.ts +2 -0
  10. package/dist/avatar/index.js +1 -0
  11. package/dist/badge/badge.d.ts +14 -0
  12. package/dist/badge/badge.js +25 -0
  13. package/dist/badge/index.d.ts +2 -0
  14. package/dist/badge/index.js +1 -0
  15. package/dist/box/box.d.ts +27 -0
  16. package/dist/box/box.js +21 -0
  17. package/dist/box/index.d.ts +2 -0
  18. package/dist/box/index.js +1 -0
  19. package/dist/button/button.d.ts +50 -0
  20. package/dist/button/button.js +78 -0
  21. package/dist/button/index.d.ts +2 -0
  22. package/dist/button/index.js +1 -0
  23. package/dist/card/card.d.ts +30 -0
  24. package/dist/card/card.js +56 -0
  25. package/dist/card/index.d.ts +2 -0
  26. package/dist/card/index.js +1 -0
  27. package/dist/checkbox/checkbox.d.ts +33 -0
  28. package/dist/checkbox/checkbox.js +61 -0
  29. package/dist/checkbox/index.d.ts +2 -0
  30. package/dist/checkbox/index.js +1 -0
  31. package/dist/css/accordion.css +73 -0
  32. package/dist/css/avatar.css +50 -0
  33. package/dist/css/badge.css +59 -0
  34. package/dist/css/box.css +163 -0
  35. package/dist/css/button.css +243 -0
  36. package/dist/css/card.css +75 -0
  37. package/dist/css/checkbox.css +67 -0
  38. package/dist/css/dialog.css +128 -0
  39. package/dist/css/drawer.css +129 -0
  40. package/dist/css/experimental/alert.css +89 -0
  41. package/dist/css/experimental/app-shell.css +258 -0
  42. package/dist/css/experimental/breadcrumb.css +67 -0
  43. package/dist/css/experimental/copy-button.css +13 -0
  44. package/dist/css/experimental/empty-state.css +63 -0
  45. package/dist/css/experimental/otp-input.css +84 -0
  46. package/dist/css/experimental/page-header.css +110 -0
  47. package/dist/css/experimental/password-input.css +21 -0
  48. package/dist/css/experimental/sidebar.css +234 -0
  49. package/dist/css/experimental/stat.css +115 -0
  50. package/dist/css/experimental/top-bar.css +299 -0
  51. package/dist/css/field.css +121 -0
  52. package/dist/css/fieldset.css +37 -0
  53. package/dist/css/grid.css +86 -0
  54. package/dist/css/heading.css +93 -0
  55. package/dist/css/inline.css +85 -0
  56. package/dist/css/input.css +108 -0
  57. package/dist/css/link.css +45 -0
  58. package/dist/css/menu.css +166 -0
  59. package/dist/css/popover.css +72 -0
  60. package/dist/css/progress.css +102 -0
  61. package/dist/css/radio.css +54 -0
  62. package/dist/css/scroll-area.css +70 -0
  63. package/dist/css/select.css +189 -0
  64. package/dist/css/separator.css +35 -0
  65. package/dist/css/skeleton.css +39 -0
  66. package/dist/css/skip-link.css +33 -0
  67. package/dist/css/slider.css +108 -0
  68. package/dist/css/spinner.css +55 -0
  69. package/dist/css/stack.css +76 -0
  70. package/dist/css/switch.css +112 -0
  71. package/dist/css/table.css +68 -0
  72. package/dist/css/tabs.css +123 -0
  73. package/dist/css/text-field.css +4 -0
  74. package/dist/css/text.css +106 -0
  75. package/dist/css/toast.css +115 -0
  76. package/dist/css/toggle.css +125 -0
  77. package/dist/css/tooltip.css +47 -0
  78. package/dist/css/visually-hidden.css +15 -0
  79. package/dist/dialog/dialog.d.ts +54 -0
  80. package/dist/dialog/dialog.js +121 -0
  81. package/dist/dialog/index.d.ts +2 -0
  82. package/dist/dialog/index.js +1 -0
  83. package/dist/drawer/drawer.d.ts +49 -0
  84. package/dist/drawer/drawer.js +102 -0
  85. package/dist/drawer/index.d.ts +2 -0
  86. package/dist/drawer/index.js +1 -0
  87. package/dist/experimental/alert/alert.d.ts +29 -0
  88. package/dist/experimental/alert/alert.js +72 -0
  89. package/dist/experimental/alert/index.d.ts +2 -0
  90. package/dist/experimental/app-shell/app-shell.d.ts +60 -0
  91. package/dist/experimental/app-shell/app-shell.js +224 -0
  92. package/dist/experimental/app-shell/index.d.ts +2 -0
  93. package/dist/experimental/breadcrumb/breadcrumb.d.ts +27 -0
  94. package/dist/experimental/breadcrumb/breadcrumb.js +48 -0
  95. package/dist/experimental/breadcrumb/index.d.ts +2 -0
  96. package/dist/experimental/copy-button/copy-button.d.ts +27 -0
  97. package/dist/experimental/copy-button/copy-button.js +61 -0
  98. package/dist/experimental/copy-button/index.d.ts +2 -0
  99. package/dist/experimental/empty-state/data-state.d.ts +23 -0
  100. package/dist/experimental/empty-state/data-state.js +40 -0
  101. package/dist/experimental/empty-state/empty-state.d.ts +26 -0
  102. package/dist/experimental/empty-state/empty-state.js +46 -0
  103. package/dist/experimental/empty-state/index.d.ts +3 -0
  104. package/dist/experimental/index.d.ts +24 -0
  105. package/dist/experimental/index.js +13 -0
  106. package/dist/experimental/otp-input/index.d.ts +2 -0
  107. package/dist/experimental/otp-input/otp-input.d.ts +27 -0
  108. package/dist/experimental/otp-input/otp-input.js +39 -0
  109. package/dist/experimental/page-header/index.d.ts +2 -0
  110. package/dist/experimental/page-header/page-header.d.ts +32 -0
  111. package/dist/experimental/page-header/page-header.js +73 -0
  112. package/dist/experimental/password-input/index.d.ts +2 -0
  113. package/dist/experimental/password-input/password-input.d.ts +26 -0
  114. package/dist/experimental/password-input/password-input.js +103 -0
  115. package/dist/experimental/sidebar/index.d.ts +2 -0
  116. package/dist/experimental/sidebar/sidebar.d.ts +64 -0
  117. package/dist/experimental/sidebar/sidebar.js +200 -0
  118. package/dist/experimental/stat/index.d.ts +2 -0
  119. package/dist/experimental/stat/stat.d.ts +31 -0
  120. package/dist/experimental/stat/stat.js +90 -0
  121. package/dist/experimental/top-bar/index.d.ts +2 -0
  122. package/dist/experimental/top-bar/top-bar.d.ts +60 -0
  123. package/dist/experimental/top-bar/top-bar.js +162 -0
  124. package/dist/field/choice.d.ts +21 -0
  125. package/dist/field/choice.js +67 -0
  126. package/dist/field/field.d.ts +31 -0
  127. package/dist/field/field.js +78 -0
  128. package/dist/field/index.d.ts +3 -0
  129. package/dist/field/index.js +1 -0
  130. package/dist/fieldset/fieldset.d.ts +19 -0
  131. package/dist/fieldset/fieldset.js +29 -0
  132. package/dist/fieldset/index.d.ts +2 -0
  133. package/dist/fieldset/index.js +1 -0
  134. package/dist/format/format.d.ts +12 -0
  135. package/dist/format/format.js +50 -0
  136. package/dist/format/index.d.ts +2 -0
  137. package/dist/format/index.js +1 -0
  138. package/dist/grid/grid.d.ts +30 -0
  139. package/dist/grid/grid.js +36 -0
  140. package/dist/grid/index.d.ts +2 -0
  141. package/dist/grid/index.js +1 -0
  142. package/dist/heading/heading.d.ts +23 -0
  143. package/dist/heading/heading.js +30 -0
  144. package/dist/heading/index.d.ts +2 -0
  145. package/dist/heading/index.js +1 -0
  146. package/dist/index.d.ts +84 -1
  147. package/dist/index.js +40 -0
  148. package/dist/inline/index.d.ts +2 -0
  149. package/dist/inline/index.js +1 -0
  150. package/dist/inline/inline.d.ts +19 -0
  151. package/dist/inline/inline.js +16 -0
  152. package/dist/input/index.d.ts +2 -0
  153. package/dist/input/index.js +1 -0
  154. package/dist/input/input.d.ts +37 -0
  155. package/dist/input/input.js +63 -0
  156. package/dist/internal/control.d.ts +9 -0
  157. package/dist/internal/control.js +4 -0
  158. package/dist/internal/cx.js +7 -0
  159. package/dist/internal/media.js +15 -0
  160. package/dist/internal/messages.d.ts +75 -0
  161. package/dist/internal/messages.js +61 -0
  162. package/dist/internal/refs.js +23 -0
  163. package/dist/internal/render.d.ts +6 -0
  164. package/dist/internal/render.js +22 -0
  165. package/dist/internal/space.d.ts +9 -0
  166. package/dist/internal/text.d.ts +5 -0
  167. package/dist/internal/text.js +18 -0
  168. package/dist/link/index.d.ts +2 -0
  169. package/dist/link/index.js +1 -0
  170. package/dist/link/link.d.ts +19 -0
  171. package/dist/link/link.js +32 -0
  172. package/dist/locales/hi.d.ts +8 -0
  173. package/dist/locales/hi.js +60 -0
  174. package/dist/menu/index.d.ts +2 -0
  175. package/dist/menu/index.js +1 -0
  176. package/dist/menu/menu.d.ts +76 -0
  177. package/dist/menu/menu.js +172 -0
  178. package/dist/popover/index.d.ts +2 -0
  179. package/dist/popover/index.js +1 -0
  180. package/dist/popover/popover.d.ts +33 -0
  181. package/dist/popover/popover.js +48 -0
  182. package/dist/progress/index.d.ts +2 -0
  183. package/dist/progress/index.js +1 -0
  184. package/dist/progress/progress.d.ts +26 -0
  185. package/dist/progress/progress.js +62 -0
  186. package/dist/provider/index.d.ts +3 -0
  187. package/dist/provider/index.js +1 -0
  188. package/dist/provider/provider.d.ts +46 -0
  189. package/dist/provider/provider.js +90 -0
  190. package/dist/radio/index.d.ts +2 -0
  191. package/dist/radio/index.js +1 -0
  192. package/dist/radio/radio.d.ts +31 -0
  193. package/dist/radio/radio.js +47 -0
  194. package/dist/scroll-area/index.d.ts +2 -0
  195. package/dist/scroll-area/index.js +1 -0
  196. package/dist/scroll-area/scroll-area.d.ts +18 -0
  197. package/dist/scroll-area/scroll-area.js +39 -0
  198. package/dist/select/index.d.ts +2 -0
  199. package/dist/select/index.js +1 -0
  200. package/dist/select/select.d.ts +36 -0
  201. package/dist/select/select.js +82 -0
  202. package/dist/separator/index.d.ts +2 -0
  203. package/dist/separator/index.js +1 -0
  204. package/dist/separator/separator.d.ts +16 -0
  205. package/dist/separator/separator.js +16 -0
  206. package/dist/skeleton/index.d.ts +2 -0
  207. package/dist/skeleton/index.js +1 -0
  208. package/dist/skeleton/skeleton.d.ts +12 -0
  209. package/dist/skeleton/skeleton.js +18 -0
  210. package/dist/skip-link/index.d.ts +2 -0
  211. package/dist/skip-link/index.js +1 -0
  212. package/dist/skip-link/skip-link.d.ts +13 -0
  213. package/dist/skip-link/skip-link.js +18 -0
  214. package/dist/slider/index.d.ts +2 -0
  215. package/dist/slider/index.js +1 -0
  216. package/dist/slider/slider.d.ts +20 -0
  217. package/dist/slider/slider.js +58 -0
  218. package/dist/spinner/index.d.ts +2 -0
  219. package/dist/spinner/index.js +1 -0
  220. package/dist/spinner/spinner.d.ts +15 -0
  221. package/dist/spinner/spinner.js +19 -0
  222. package/dist/stack/index.d.ts +2 -0
  223. package/dist/stack/index.js +1 -0
  224. package/dist/stack/stack.d.ts +17 -0
  225. package/dist/stack/stack.js +15 -0
  226. package/dist/styles.css +4548 -0
  227. package/dist/switch/index.d.ts +2 -0
  228. package/dist/switch/index.js +1 -0
  229. package/dist/switch/switch.d.ts +18 -0
  230. package/dist/switch/switch.js +31 -0
  231. package/dist/table/index.d.ts +2 -0
  232. package/dist/table/index.js +1 -0
  233. package/dist/table/table.d.ts +36 -0
  234. package/dist/table/table.js +69 -0
  235. package/dist/tabs/index.d.ts +2 -0
  236. package/dist/tabs/index.js +1 -0
  237. package/dist/tabs/tabs.d.ts +43 -0
  238. package/dist/tabs/tabs.js +66 -0
  239. package/dist/text/index.d.ts +3 -0
  240. package/dist/text/index.js +1 -0
  241. package/dist/text/text.d.ts +24 -0
  242. package/dist/text/text.js +24 -0
  243. package/dist/text-field/index.d.ts +2 -0
  244. package/dist/text-field/index.js +1 -0
  245. package/dist/text-field/text-field.d.ts +15 -0
  246. package/dist/text-field/text-field.js +43 -0
  247. package/dist/toast/index.d.ts +2 -0
  248. package/dist/toast/index.js +1 -0
  249. package/dist/toast/toast.d.ts +57 -0
  250. package/dist/toast/toast.js +124 -0
  251. package/dist/toggle/index.d.ts +2 -0
  252. package/dist/toggle/index.js +1 -0
  253. package/dist/toggle/toggle.d.ts +48 -0
  254. package/dist/toggle/toggle.js +54 -0
  255. package/dist/tooltip/index.d.ts +2 -0
  256. package/dist/tooltip/index.js +1 -0
  257. package/dist/tooltip/tooltip.d.ts +26 -0
  258. package/dist/tooltip/tooltip.js +39 -0
  259. package/dist/visually-hidden/index.d.ts +2 -0
  260. package/dist/visually-hidden/index.js +1 -0
  261. package/dist/visually-hidden/visually-hidden.d.ts +8 -0
  262. package/dist/visually-hidden/visually-hidden.js +12 -0
  263. package/package.json +170 -2
@@ -0,0 +1,30 @@
1
+ import { cx } from "../internal/cx.js";
2
+ import { renderElement } from "../internal/render.js";
3
+ import { truncation } from "../internal/text.js";
4
+ // src/heading/heading.tsx
5
+ const DEFAULT_SIZE = {
6
+ 1: "heading-lg",
7
+ 2: "heading-md",
8
+ 3: "heading-sm",
9
+ 4: "title-lg",
10
+ 5: "title-md",
11
+ 6: "title-sm"
12
+ };
13
+ /** A section heading: the level sets the element, the size sets the look. */
14
+ function Heading({ level, size, tone, truncate, align, render, className, style, ...props }) {
15
+ const clamp = truncation(truncate);
16
+ return renderElement(`h${level}`, render, {
17
+ ...props,
18
+ className: cx("qx-heading", className),
19
+ style: clamp.style || style ? {
20
+ ...clamp.style,
21
+ ...style
22
+ } : void 0,
23
+ "data-slot": "heading",
24
+ "data-size": size ?? DEFAULT_SIZE[level],
25
+ "data-tone": tone,
26
+ "data-truncate": clamp.attribute,
27
+ "data-align": align
28
+ });
29
+ }
30
+ export { Heading };
@@ -0,0 +1,2 @@
1
+ import { Heading, HeadingLevel, HeadingProps, HeadingSize, HeadingTone } from "./heading.js";
2
+ export { Heading, type HeadingLevel, type HeadingProps, type HeadingSize, type HeadingTone };
@@ -0,0 +1 @@
1
+ export { Heading } from "./heading.js";
package/dist/index.d.ts CHANGED
@@ -1 +1,84 @@
1
- export {}
1
+ import { RenderProp } from "./internal/render.js";
2
+ import { Inset, Space, TextAlign } from "./internal/space.js";
3
+ import { TextTone, Truncate } from "./internal/text.js";
4
+ import { Heading, HeadingLevel, HeadingProps, HeadingSize, HeadingTone } from "./heading/heading.js";
5
+ import { Accordion, AccordionItem, AccordionItemProps, AccordionProps, Collapsible, CollapsiblePanel, CollapsiblePanelProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps } from "./accordion/accordion.js";
6
+ import "./accordion/index.js";
7
+ import { Avatar, AvatarProps, AvatarSize } from "./avatar/avatar.js";
8
+ import "./avatar/index.js";
9
+ import { ControlSize, QeetrixIcon } from "./internal/control.js";
10
+ import { Badge, BadgeProps, BadgeTone } from "./badge/badge.js";
11
+ import "./badge/index.js";
12
+ import { Box, BoxBackground, BoxBorder, BoxProps, BoxRadius } from "./box/box.js";
13
+ import "./box/index.js";
14
+ import { Button, ButtonProps, ButtonTone, ButtonVariant, IconButton, IconButtonProps } from "./button/button.js";
15
+ import "./button/index.js";
16
+ import { Card, CardProps } from "./card/card.js";
17
+ import "./card/index.js";
18
+ import { QeetrixMessages, QeetrixMessagesInput } from "./internal/messages.js";
19
+ import { Field, FieldMessageProps, FieldProps } from "./field/field.js";
20
+ import { ChoiceLabelProps, ChoiceOrientation } from "./field/choice.js";
21
+ import { Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps } from "./checkbox/checkbox.js";
22
+ import "./checkbox/index.js";
23
+ import { Dialog, DialogBody, DialogBodyProps, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogFooter, DialogFooterProps, DialogIntent, DialogProps, DialogSize, DialogTrigger, DialogTriggerProps } from "./dialog/dialog.js";
24
+ import "./dialog/index.js";
25
+ import { Drawer, DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerFooter, DrawerFooterProps, DrawerProps, DrawerSide, DrawerSize, DrawerTrigger, DrawerTriggerProps } from "./drawer/drawer.js";
26
+ import "./drawer/index.js";
27
+ import { Input, InputProps, Textarea, TextareaProps } from "./input/input.js";
28
+ import "./field/index.js";
29
+ import { Fieldset, FieldsetProps } from "./fieldset/fieldset.js";
30
+ import "./fieldset/index.js";
31
+ import { formatCurrency, formatNumber, formatRelativeTime } from "./format/format.js";
32
+ import { Grid, GridAlign, GridColumnCount, GridColumns, GridProps } from "./grid/grid.js";
33
+ import "./grid/index.js";
34
+ import "./heading/index.js";
35
+ import { FlowJustify, Stack, StackAlign, StackProps } from "./stack/stack.js";
36
+ import { Inline, InlineAlign, InlineProps } from "./inline/inline.js";
37
+ import "./inline/index.js";
38
+ import "./input/index.js";
39
+ import { Link, LinkProps, LinkTone } from "./link/link.js";
40
+ import "./link/index.js";
41
+ import { Menu, MenuCheckboxItem, MenuCheckboxItemProps, MenuContent, MenuContentProps, MenuGroup, MenuGroupLabel, MenuGroupLabelProps, MenuGroupProps, MenuItem, MenuItemProps, MenuItemTone, MenuProps, MenuRadioGroup, MenuRadioGroupProps, MenuRadioItem, MenuRadioItemProps, MenuSeparator, MenuSeparatorProps, MenuSubmenu, MenuSubmenuProps, MenuSubmenuTrigger, MenuSubmenuTriggerProps, MenuTrigger, MenuTriggerProps } from "./menu/menu.js";
42
+ import "./menu/index.js";
43
+ import { Popover, PopoverClose, PopoverCloseProps, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps } from "./popover/popover.js";
44
+ import "./popover/index.js";
45
+ import { Meter, MeterProps, MeterTone, Progress, ProgressProps } from "./progress/progress.js";
46
+ import "./progress/index.js";
47
+ import { ColorScheme, ColorSchemeState, Direction, QeetrixProvider, QeetrixProviderProps, ResolvedColorScheme, useColorScheme, useLocale } from "./provider/provider.js";
48
+ import "./provider/index.js";
49
+ import { Radio, RadioGroup, RadioGroupProps, RadioProps } from "./radio/radio.js";
50
+ import "./radio/index.js";
51
+ import { ScrollArea, ScrollAreaOrientation, ScrollAreaProps } from "./scroll-area/scroll-area.js";
52
+ import "./scroll-area/index.js";
53
+ import { Select, SelectItem, SelectItemGroup, SelectProps } from "./select/select.js";
54
+ import "./select/index.js";
55
+ import { Separator, SeparatorOrientation, SeparatorProps, SeparatorTone } from "./separator/separator.js";
56
+ import "./separator/index.js";
57
+ import { Skeleton, SkeletonProps, SkeletonVariant } from "./skeleton/skeleton.js";
58
+ import "./skeleton/index.js";
59
+ import { SkipLink, SkipLinkProps } from "./skip-link/skip-link.js";
60
+ import "./skip-link/index.js";
61
+ import { Slider, SliderProps } from "./slider/slider.js";
62
+ import "./slider/index.js";
63
+ import { Spinner, SpinnerProps, SpinnerSize, SpinnerTone } from "./spinner/spinner.js";
64
+ import "./spinner/index.js";
65
+ import "./stack/index.js";
66
+ import { Switch, SwitchProps } from "./switch/switch.js";
67
+ import "./switch/index.js";
68
+ import { Table, TableAlign, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps } from "./table/table.js";
69
+ import "./table/index.js";
70
+ import { Tab, TabProps, Tabs, TabsList, TabsListProps, TabsPanel, TabsPanelProps, TabsProps } from "./tabs/tabs.js";
71
+ import "./tabs/index.js";
72
+ import { Text, TextProps, TextSize, TextWeight } from "./text/text.js";
73
+ import "./text/index.js";
74
+ import { TextField, TextFieldProps } from "./text-field/text-field.js";
75
+ import "./text-field/index.js";
76
+ import { ToastApi, ToastOptions, ToastPromiseOptions, ToastProvider, ToastProviderProps, ToastTone, useToast } from "./toast/toast.js";
77
+ import "./toast/index.js";
78
+ import { Toggle, ToggleGroup, ToggleGroupProps, ToggleGroupVariant, ToggleProps } from "./toggle/toggle.js";
79
+ import "./toggle/index.js";
80
+ import { Tooltip, TooltipProps, TooltipProvider, TooltipProviderProps } from "./tooltip/tooltip.js";
81
+ import "./tooltip/index.js";
82
+ import { VisuallyHidden, VisuallyHiddenProps } from "./visually-hidden/visually-hidden.js";
83
+ import "./visually-hidden/index.js";
84
+ export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeTone, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, Button, type ButtonProps, type ButtonTone, type ButtonVariant, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type ChoiceLabelProps, type ChoiceOrientation, Collapsible, CollapsiblePanel, type CollapsiblePanelProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, type ColorScheme, type ColorSchemeState, type ControlSize, Dialog, DialogBody, type DialogBodyProps, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogFooter, type DialogFooterProps, type DialogIntent, type DialogProps, type DialogSize, DialogTrigger, type DialogTriggerProps, type Direction, Drawer, DrawerBody, type DrawerBodyProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerFooter, type DrawerFooterProps, type DrawerProps, type DrawerSide, type DrawerSize, DrawerTrigger, type DrawerTriggerProps, Field, type FieldMessageProps, type FieldProps, Fieldset, type FieldsetProps, type FlowJustify, Grid, type GridAlign, type GridColumnCount, type GridColumns, type GridProps, Heading, type HeadingLevel, type HeadingProps, type HeadingSize, type HeadingTone, IconButton, type IconButtonProps, Inline, type InlineAlign, type InlineProps, Input, type InputProps, type Inset, Link, type LinkProps, type LinkTone, Menu, MenuCheckboxItem, type MenuCheckboxItemProps, MenuContent, type MenuContentProps, MenuGroup, MenuGroupLabel, type MenuGroupLabelProps, type MenuGroupProps, MenuItem, type MenuItemProps, type MenuItemTone, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuSubmenu, type MenuSubmenuProps, MenuSubmenuTrigger, type MenuSubmenuTriggerProps, MenuTrigger, type MenuTriggerProps, Meter, type MeterProps, type MeterTone, Popover, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, Progress, type ProgressProps, type QeetrixIcon, type QeetrixMessages, type QeetrixMessagesInput, QeetrixProvider, type QeetrixProviderProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RenderProp, type ResolvedColorScheme, ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps, Select, type SelectItem, type SelectItemGroup, type SelectProps, Separator, type SeparatorOrientation, type SeparatorProps, type SeparatorTone, Skeleton, type SkeletonProps, type SkeletonVariant, SkipLink, type SkipLinkProps, Slider, type SliderProps, type Space, Spinner, type SpinnerProps, type SpinnerSize, type SpinnerTone, Stack, type StackAlign, type StackProps, Switch, type SwitchProps, Tab, type TabProps, Table, type TableAlign, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, type TabsProps, Text, type TextAlign, TextField, type TextFieldProps, type TextProps, type TextSize, type TextTone, type TextWeight, Textarea, type TextareaProps, type ToastApi, type ToastOptions, type ToastPromiseOptions, ToastProvider, type ToastProviderProps, type ToastTone, Toggle, ToggleGroup, type ToggleGroupProps, type ToggleGroupVariant, type ToggleProps, Tooltip, type TooltipProps, TooltipProvider, type TooltipProviderProps, type Truncate, VisuallyHidden, type VisuallyHiddenProps, formatCurrency, formatNumber, formatRelativeTime, useColorScheme, useLocale, useToast };
package/dist/index.js CHANGED
@@ -0,0 +1,40 @@
1
+ import { Accordion, AccordionItem, Collapsible, CollapsiblePanel, CollapsibleTrigger } from "./accordion/accordion.js";
2
+ import { Avatar } from "./avatar/avatar.js";
3
+ import { Badge } from "./badge/badge.js";
4
+ import { Box } from "./box/box.js";
5
+ import { Spinner } from "./spinner/spinner.js";
6
+ import { Tooltip, TooltipProvider } from "./tooltip/tooltip.js";
7
+ import { Button, IconButton } from "./button/button.js";
8
+ import { Heading } from "./heading/heading.js";
9
+ import { Card } from "./card/card.js";
10
+ import { QeetrixProvider, useColorScheme, useLocale } from "./provider/provider.js";
11
+ import { Field } from "./field/field.js";
12
+ import { Checkbox, CheckboxGroup } from "./checkbox/checkbox.js";
13
+ import { Dialog, DialogBody, DialogClose, DialogContent, DialogFooter, DialogTrigger } from "./dialog/dialog.js";
14
+ import { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerFooter, DrawerTrigger } from "./drawer/drawer.js";
15
+ import { Fieldset } from "./fieldset/fieldset.js";
16
+ import { formatCurrency, formatNumber, formatRelativeTime } from "./format/format.js";
17
+ import { Grid } from "./grid/grid.js";
18
+ import { Inline } from "./inline/inline.js";
19
+ import { Input, Textarea } from "./input/input.js";
20
+ import { VisuallyHidden } from "./visually-hidden/visually-hidden.js";
21
+ import { Link } from "./link/link.js";
22
+ import { Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSubmenu, MenuSubmenuTrigger, MenuTrigger } from "./menu/menu.js";
23
+ import { Popover, PopoverClose, PopoverContent, PopoverTrigger } from "./popover/popover.js";
24
+ import { Meter, Progress } from "./progress/progress.js";
25
+ import { Radio, RadioGroup } from "./radio/radio.js";
26
+ import { ScrollArea } from "./scroll-area/scroll-area.js";
27
+ import { Select } from "./select/select.js";
28
+ import { Separator } from "./separator/separator.js";
29
+ import { Skeleton } from "./skeleton/skeleton.js";
30
+ import { SkipLink } from "./skip-link/skip-link.js";
31
+ import { Slider } from "./slider/slider.js";
32
+ import { Stack } from "./stack/stack.js";
33
+ import { Switch } from "./switch/switch.js";
34
+ import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "./table/table.js";
35
+ import { Tab, Tabs, TabsList, TabsPanel } from "./tabs/tabs.js";
36
+ import { Text } from "./text/text.js";
37
+ import { TextField } from "./text-field/text-field.js";
38
+ import { ToastProvider, useToast } from "./toast/toast.js";
39
+ import { Toggle, ToggleGroup } from "./toggle/toggle.js";
40
+ export { Accordion, AccordionItem, Avatar, Badge, Box, Button, Card, Checkbox, CheckboxGroup, Collapsible, CollapsiblePanel, CollapsibleTrigger, Dialog, DialogBody, DialogClose, DialogContent, DialogFooter, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerFooter, DrawerTrigger, Field, Fieldset, Grid, Heading, IconButton, Inline, Input, Link, Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSubmenu, MenuSubmenuTrigger, MenuTrigger, Meter, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, QeetrixProvider, Radio, RadioGroup, ScrollArea, Select, Separator, Skeleton, SkipLink, Slider, Spinner, Stack, Switch, Tab, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsList, TabsPanel, Text, TextField, Textarea, ToastProvider, Toggle, ToggleGroup, Tooltip, TooltipProvider, VisuallyHidden, formatCurrency, formatNumber, formatRelativeTime, useColorScheme, useLocale, useToast };
@@ -0,0 +1,2 @@
1
+ import { Inline, InlineAlign, InlineProps } from "./inline.js";
2
+ export { Inline, type InlineAlign, type InlineProps };
@@ -0,0 +1 @@
1
+ export { Inline } from "./inline.js";
@@ -0,0 +1,19 @@
1
+ import { RenderProp } from "../internal/render.js";
2
+ import { Space } from "../internal/space.js";
3
+ import { FlowJustify } from "../stack/stack.js";
4
+ import { ComponentProps, ReactElement } from "react";
5
+ export type InlineAlign = "start" | "center" | "end" | "baseline" | "stretch";
6
+ export interface InlineProps extends ComponentProps<"div"> {
7
+ /** Space between children, from the space scale. Default `sm` (8px). */
8
+ gap?: Space;
9
+ /** Cross-axis alignment. Default `center`. */
10
+ align?: InlineAlign;
11
+ /** Main-axis distribution. */
12
+ justify?: FlowJustify;
13
+ /** Wrap onto new lines when space runs out. Default `true`. */
14
+ wrap?: boolean;
15
+ /** Render a different element, e.g. `<ul />`. */
16
+ render?: RenderProp;
17
+ }
18
+ /** A horizontal flow with token gaps that wraps by default. */
19
+ export declare function Inline({ gap, align, justify, wrap, render, className, ...props }: InlineProps): ReactElement;
@@ -0,0 +1,16 @@
1
+ import { cx } from "../internal/cx.js";
2
+ import { renderElement } from "../internal/render.js";
3
+ // src/inline/inline.tsx
4
+ /** A horizontal flow with token gaps that wraps by default. */
5
+ function Inline({ gap = "sm", align, justify, wrap = true, render, className, ...props }) {
6
+ return renderElement("div", render, {
7
+ ...props,
8
+ className: cx("qx-inline", className),
9
+ "data-slot": "inline",
10
+ "data-gap": gap,
11
+ "data-align": align,
12
+ "data-justify": justify,
13
+ "data-wrap": wrap ? void 0 : "false"
14
+ });
15
+ }
16
+ export { Inline };
@@ -0,0 +1,2 @@
1
+ import { Input, InputProps, Textarea, TextareaProps } from "./input.js";
2
+ export { Input, type InputProps, Textarea, type TextareaProps };
@@ -0,0 +1 @@
1
+ export { Input, Textarea } from "./input.js";
@@ -0,0 +1,37 @@
1
+ import { QeetrixIcon } from "../internal/control.js";
2
+ import { CSSProperties, ComponentProps, ReactElement, ReactNode } from "react";
3
+ import { Input } from "@base-ui/react/input";
4
+ export interface InputProps extends Omit<Input.Props, "className" | "style" | "render"> {
5
+ /** A leading icon from `@qeetrix/icons` (search, mail): sharp, 16px, decorative. */
6
+ icon?: QeetrixIcon;
7
+ /** Before the value: a text affix such as ₹. */
8
+ startAdornment?: ReactNode;
9
+ /** After the value: an affix such as % or .qeet.in, or a tool such as a show-password button. */
10
+ endAdornment?: ReactNode;
11
+ /** Placement of the box only (margin, width, grid placement). */
12
+ className?: string;
13
+ style?: CSSProperties;
14
+ }
15
+ /**
16
+ * The single-line text control: a filled box with a bottom line (06-component-specs.md §2). `ref`
17
+ * and every other prop go to the `<input>`; `className` and `style` place the box.
18
+ */
19
+ declare function Input$1({ icon: Icon, startAdornment, endAdornment, className, style, ...props }: InputProps): ReactElement;
20
+ export interface TextareaProps extends Omit<ComponentProps<"textarea">, "defaultValue" | "value" | "rows" | "children"> {
21
+ /** Controlled value. */
22
+ value?: string;
23
+ /** Initial value when uncontrolled. */
24
+ defaultValue?: string;
25
+ /** Called with the new value and Base UI's event details. */
26
+ onValueChange?: Input.Props["onValueChange"];
27
+ /** The height before it grows, in lines. Default 3. */
28
+ rows?: number;
29
+ /** The most lines it grows to; after that it scrolls. Default: no limit. */
30
+ maxRows?: number;
31
+ }
32
+ /**
33
+ * Multi-line text with the Input look. It grows with its content where the browser supports CSS
34
+ * `field-sizing`; elsewhere it keeps `rows` and can be dragged taller. No script measures it.
35
+ */
36
+ export declare function Textarea({ rows, maxRows, className, style, ...props }: TextareaProps): ReactElement;
37
+ export { Input$1 as Input };
@@ -0,0 +1,63 @@
1
+ "use client";
2
+ import { cx } from "../internal/cx.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Field } from "@base-ui/react/field";
5
+ import { Input } from "@base-ui/react/input";
6
+ // src/input/input.tsx
7
+ /**
8
+ * The single-line text control: a filled box with a bottom line (06-component-specs.md §2). `ref`
9
+ * and every other prop go to the `<input>`; `className` and `style` place the box.
10
+ */
11
+ function Input$1({ icon: Icon, startAdornment, endAdornment, className, style, ...props }) {
12
+ return /* @__PURE__ */ jsxs("div", {
13
+ className: cx("qx-input", className),
14
+ style,
15
+ "data-slot": "input",
16
+ children: [
17
+ Icon && /* @__PURE__ */ jsx(Icon, {
18
+ shape: "sharp",
19
+ size: 16,
20
+ "aria-hidden": true,
21
+ className: "qx-input-icon",
22
+ "data-slot": "input-icon"
23
+ }),
24
+ startAdornment != null && /* @__PURE__ */ jsx("span", {
25
+ className: "qx-input-adornment",
26
+ "data-slot": "input-start",
27
+ children: startAdornment
28
+ }),
29
+ /* @__PURE__ */ jsx(Input, {
30
+ ...props,
31
+ className: "qx-input-control",
32
+ "data-slot": "input-control"
33
+ }),
34
+ endAdornment != null && /* @__PURE__ */ jsx("span", {
35
+ className: "qx-input-adornment",
36
+ "data-slot": "input-end",
37
+ children: endAdornment
38
+ })
39
+ ]
40
+ });
41
+ }
42
+ /**
43
+ * Multi-line text with the Input look. It grows with its content where the browser supports CSS
44
+ * `field-sizing`; elsewhere it keeps `rows` and can be dragged taller. No script measures it.
45
+ */
46
+ function Textarea({ rows = 3, maxRows, className, style, ...props }) {
47
+ const lines = {
48
+ "--qx-textarea-rows": rows,
49
+ ...maxRows === void 0 ? {} : { "--qx-textarea-max-rows": maxRows }
50
+ };
51
+ return /* @__PURE__ */ jsx(Field.Control, {
52
+ ...props,
53
+ render: /* @__PURE__ */ jsx("textarea", { rows }),
54
+ className: cx("qx-input qx-textarea", className),
55
+ style: {
56
+ ...lines,
57
+ ...style
58
+ },
59
+ "data-slot": "textarea",
60
+ "data-max-rows": maxRows === void 0 ? void 0 : ""
61
+ });
62
+ }
63
+ export { Input$1 as Input, Textarea };
@@ -0,0 +1,9 @@
1
+ import { ComponentType } from "react";
2
+ import { IconProps } from "@qeetrix/icons";
3
+ /** The control heights: sm, md and lg follow the density tokens (size.control.*). */
4
+ export type ControlSize = "sm" | "md" | "lg";
5
+ /**
6
+ * A component from `@qeetrix/icons`: every icon has an outline drawing, so any icon fits. Qeetrix
7
+ * renders it in the sharp shape at the right size.
8
+ */
9
+ export type QeetrixIcon = ComponentType<IconProps<"outline">>;
@@ -0,0 +1,4 @@
1
+ // src/internal/control.ts
2
+ /** Icon size inside a control: 16px, or 20px in a large control. */
3
+ const iconSize = (size) => size === "lg" ? 20 : 16;
4
+ export { iconSize };
@@ -0,0 +1,7 @@
1
+ // src/internal/cx.ts
2
+ /** Join class names, skipping empty values. */
3
+ function cx(...names) {
4
+ const joined = names.filter(Boolean).join(" ");
5
+ return joined === "" ? void 0 : joined;
6
+ }
7
+ export { cx };
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { useSyncExternalStore } from "react";
3
+ // src/internal/media.ts
4
+ /**
5
+ * Whether a media query matches, kept in sync as it changes. On the server, and in the first client
6
+ * render, it's `serverValue`, so server and client markup agree.
7
+ */
8
+ function useMediaQuery(query, serverValue) {
9
+ return useSyncExternalStore((onChange) => {
10
+ const list = window.matchMedia(query);
11
+ list.addEventListener("change", onChange);
12
+ return () => list.removeEventListener("change", onChange);
13
+ }, () => window.matchMedia(query).matches, () => serverValue);
14
+ }
15
+ export { useMediaQuery };
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Every user-facing string in the library, in English (decision D-13). A string resolves from the
3
+ * component's own `messages` prop, then QeetrixProvider, then these defaults. Locale packs
4
+ * (src/locales/) are typed as the complete catalogue, so a missing key fails the typecheck.
5
+ */
6
+ export declare const messages: {
7
+ readonly skipLink: {
8
+ readonly label: "Skip to main content";
9
+ };
10
+ readonly spinner: {
11
+ readonly label: "Loading";
12
+ };
13
+ readonly link: {
14
+ readonly external: "(opens in a new tab)";
15
+ };
16
+ readonly field: {
17
+ readonly optional: "(optional)";
18
+ };
19
+ readonly overlay: {
20
+ readonly close: "Close";
21
+ };
22
+ readonly toast: {
23
+ readonly close: "Dismiss";
24
+ readonly region: "Notifications";
25
+ };
26
+ readonly slider: {
27
+ readonly minimum: "Minimum";
28
+ readonly maximum: "Maximum";
29
+ };
30
+ readonly appShell: {
31
+ readonly collapse: "Collapse";
32
+ readonly expand: "Expand";
33
+ readonly open: "Open navigation";
34
+ readonly navigation: "Navigation";
35
+ readonly tools: "Tools";
36
+ readonly closePanel: "Close panel";
37
+ };
38
+ readonly sidebar: {
39
+ readonly filter: "Filter navigation";
40
+ readonly noMatches: "No pages match";
41
+ };
42
+ readonly breadcrumb: {
43
+ readonly label: "Breadcrumb";
44
+ };
45
+ readonly dataState: {
46
+ readonly errorTitle: "Couldn't load this";
47
+ readonly errorDescription: "Try again, or check your connection.";
48
+ readonly retry: "Try again";
49
+ };
50
+ readonly copyButton: {
51
+ readonly copy: "Copy";
52
+ readonly copied: "Copied";
53
+ readonly failed: "Couldn't copy";
54
+ };
55
+ readonly alert: {
56
+ readonly dismiss: "Dismiss";
57
+ readonly info: "Information";
58
+ readonly success: "Success";
59
+ readonly warning: "Warning";
60
+ readonly danger: "Error";
61
+ };
62
+ readonly passwordInput: {
63
+ readonly show: "Show password";
64
+ readonly shown: "Password shown";
65
+ readonly hidden: "Password hidden";
66
+ readonly capsLock: "Caps Lock is on";
67
+ };
68
+ readonly otpInput: {
69
+ readonly character: "Character {index} of {length}";
70
+ };
71
+ };
72
+ /** The complete catalogue, as a locale pack provides it. */
73
+ export type QeetrixMessages = { [Group in keyof typeof messages]: { [Key in keyof (typeof messages)[Group]]: string; }; };
74
+ /** Any subset of the catalogue, group by group: what a provider or a component takes. */
75
+ export type QeetrixMessagesInput = { [Group in keyof QeetrixMessages]?: Partial<QeetrixMessages[Group]>; };
@@ -0,0 +1,61 @@
1
+ // src/internal/messages.ts
2
+ /**
3
+ * Every user-facing string in the library, in English (decision D-13). A string resolves from the
4
+ * component's own `messages` prop, then QeetrixProvider, then these defaults. Locale packs
5
+ * (src/locales/) are typed as the complete catalogue, so a missing key fails the typecheck.
6
+ */
7
+ const messages = {
8
+ skipLink: { label: "Skip to main content" },
9
+ spinner: { label: "Loading" },
10
+ link: { external: "(opens in a new tab)" },
11
+ field: { optional: "(optional)" },
12
+ overlay: { close: "Close" },
13
+ toast: {
14
+ close: "Dismiss",
15
+ region: "Notifications"
16
+ },
17
+ slider: {
18
+ minimum: "Minimum",
19
+ maximum: "Maximum"
20
+ },
21
+ appShell: {
22
+ collapse: "Collapse",
23
+ expand: "Expand",
24
+ open: "Open navigation",
25
+ navigation: "Navigation",
26
+ tools: "Tools",
27
+ closePanel: "Close panel"
28
+ },
29
+ sidebar: {
30
+ filter: "Filter navigation",
31
+ noMatches: "No pages match"
32
+ },
33
+ breadcrumb: { label: "Breadcrumb" },
34
+ dataState: {
35
+ errorTitle: "Couldn't load this",
36
+ errorDescription: "Try again, or check your connection.",
37
+ retry: "Try again"
38
+ },
39
+ copyButton: {
40
+ copy: "Copy",
41
+ copied: "Copied",
42
+ failed: "Couldn't copy"
43
+ },
44
+ alert: {
45
+ dismiss: "Dismiss",
46
+ info: "Information",
47
+ success: "Success",
48
+ warning: "Warning",
49
+ danger: "Error"
50
+ },
51
+ passwordInput: {
52
+ show: "Show password",
53
+ shown: "Password shown",
54
+ hidden: "Password hidden",
55
+ capsLock: "Caps Lock is on"
56
+ },
57
+ otpInput: { character: "Character {index} of {length}" }
58
+ };
59
+ /** The default locale: English with Indian number grouping (lakh, crore). */
60
+ const DEFAULT_LOCALE = "en-IN";
61
+ export { DEFAULT_LOCALE, messages };
@@ -0,0 +1,23 @@
1
+ // src/internal/refs.ts
2
+ /** One ref callback that sets every given ref, and clears them all on detach. */
3
+ function mergeRefs(...refs) {
4
+ return (node) => {
5
+ const cleanups = refs.map((ref) => {
6
+ if (typeof ref === "function") {
7
+ const cleanup = ref(node);
8
+ return typeof cleanup === "function" ? cleanup : () => ref(null);
9
+ }
10
+ if (ref) {
11
+ ref.current = node;
12
+ return () => {
13
+ ref.current = null;
14
+ };
15
+ }
16
+ return () => {};
17
+ });
18
+ return () => {
19
+ for (const cleanup of cleanups) cleanup();
20
+ };
21
+ };
22
+ }
23
+ export { mergeRefs };
@@ -0,0 +1,6 @@
1
+ import { ReactElement } from "react";
2
+ /**
3
+ * An element to render instead of a component's default one: `render={<section />}`. It receives the
4
+ * component's props; its own props win, and class names and styles merge (decision D-12).
5
+ */
6
+ export type RenderProp = ReactElement<Record<string, unknown>>;
@@ -0,0 +1,22 @@
1
+ import { cx } from "./cx.js";
2
+ import { cloneElement, createElement, isValidElement } from "react";
3
+ // src/internal/render.ts
4
+ /**
5
+ * Render `tag`, or the `render` element with the props merged in. Built on cloneElement rather than a
6
+ * hook, so server-safe primitives stay server-safe.
7
+ */
8
+ function renderElement(tag, render, props) {
9
+ if (render === void 0 || !isValidElement(render)) return createElement(tag, props);
10
+ const own = render.props;
11
+ return cloneElement(render, {
12
+ ...props,
13
+ ...own,
14
+ className: cx(props.className, own.className),
15
+ style: props.style || own.style ? {
16
+ ...props.style,
17
+ ...own.style
18
+ } : void 0,
19
+ children: own.children ?? props.children
20
+ });
21
+ }
22
+ export { renderElement };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The space scale shared by Box, Stack, Inline and Grid: none, then the gap tokens (xs–xl), then the
3
+ * layout tokens (2xl–4xl). 0 · 4 · 8 · 12 · 16 · 24 · 32 · 48 · 64px.
4
+ */
5
+ export type Space = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
6
+ /** Padding inside a surface: the inset tokens. 0 · 4 · 8 · 12 · 16 · 24px. */
7
+ export type Inset = "none" | "xs" | "sm" | "md" | "lg" | "xl";
8
+ /** Text alignment, in logical directions so it follows right-to-left layouts. */
9
+ export type TextAlign = "start" | "center" | "end";
@@ -0,0 +1,5 @@
1
+ import { CSSProperties } from "react";
2
+ /** Text colours from the tokens; unset means the text inherits its colour. */
3
+ export type TextTone = "default" | "subtle" | "subtlest" | "disabled" | "inverse" | "brand" | "danger" | "success" | "warning" | "info";
4
+ /** `true` for one line with an ellipsis, or a number of lines (2 or more) before clamping. */
5
+ export type Truncate = boolean | number;
@@ -0,0 +1,18 @@
1
+ // src/internal/text.ts
2
+ /** The data attribute and line-count variable for a truncate prop. */
3
+ function truncation(truncate) {
4
+ if (truncate === void 0 || truncate === false) return {
5
+ attribute: void 0,
6
+ style: void 0
7
+ };
8
+ const lines = truncate === true ? 1 : Math.max(1, Math.trunc(truncate) || 1);
9
+ if (lines === 1) return {
10
+ attribute: "line",
11
+ style: void 0
12
+ };
13
+ return {
14
+ attribute: "lines",
15
+ style: { "--qx-text-lines": lines }
16
+ };
17
+ }
18
+ export { truncation };
@@ -0,0 +1,2 @@
1
+ import { Link, LinkProps, LinkTone } from "./link.js";
2
+ export { Link, type LinkProps, type LinkTone };
@@ -0,0 +1 @@
1
+ export { Link } from "./link.js";
@@ -0,0 +1,19 @@
1
+ import { RenderProp } from "../internal/render.js";
2
+ import { QeetrixMessages } from "../internal/messages.js";
3
+ import { ComponentProps, ReactElement } from "react";
4
+ export type LinkTone = "default" | "subtle" | "inherit";
5
+ export interface LinkProps extends ComponentProps<"a"> {
6
+ /** `default` (link colour), `subtle` (footers, metadata) or `inherit`. */
7
+ tone?: LinkTone;
8
+ /** Opens in a new tab: adds `rel="noopener noreferrer"`, an arrow and "(opens in a new tab)". */
9
+ external?: boolean;
10
+ /** Render a router link, e.g. `render={<RouterLink to="/x" />}`. */
11
+ render?: RenderProp;
12
+ /**
13
+ * The screen-reader note on an external link, in place of "(opens in a new tab)". Link is
14
+ * server-safe, so QeetrixProvider's strings don't reach it: pass them here.
15
+ */
16
+ messages?: Partial<QeetrixMessages["link"]>;
17
+ }
18
+ /** Navigation to a page, a section, a file or a site. An action that changes data is a Button. */
19
+ export declare function Link({ tone, external, render, rel, messages, className, children, ...props }: LinkProps): ReactElement;