@jackbernnie/hiyf 0.1.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 (245) hide show
  1. package/LICENSE +191 -0
  2. package/NOTICE +12 -0
  3. package/README.md +47 -0
  4. package/dist/components/Accordion.d.ts +38 -0
  5. package/dist/components/Accordion.js +38 -0
  6. package/dist/components/Alert.d.ts +29 -0
  7. package/dist/components/Alert.js +39 -0
  8. package/dist/components/AlertDialog.d.ts +37 -0
  9. package/dist/components/AlertDialog.js +38 -0
  10. package/dist/components/AspectRatio.d.ts +15 -0
  11. package/dist/components/AspectRatio.js +15 -0
  12. package/dist/components/Avatar.d.ts +26 -0
  13. package/dist/components/Avatar.js +13 -0
  14. package/dist/components/Badge.d.ts +18 -0
  15. package/dist/components/Badge.js +17 -0
  16. package/dist/components/Box.d.ts +13 -0
  17. package/dist/components/Box.js +52 -0
  18. package/dist/components/Breadcrumb.d.ts +33 -0
  19. package/dist/components/Breadcrumb.js +16 -0
  20. package/dist/components/Button.d.ts +40 -0
  21. package/dist/components/Button.js +33 -0
  22. package/dist/components/ButtonGroup.d.ts +18 -0
  23. package/dist/components/ButtonGroup.js +8 -0
  24. package/dist/components/Card.d.ts +46 -0
  25. package/dist/components/Card.js +24 -0
  26. package/dist/components/Carousel.d.ts +27 -0
  27. package/dist/components/Carousel.js +13 -0
  28. package/dist/components/Chart.d.ts +17 -0
  29. package/dist/components/Chart.js +94 -0
  30. package/dist/components/Checkbox.d.ts +26 -0
  31. package/dist/components/Checkbox.js +9 -0
  32. package/dist/components/Collapsible.d.ts +27 -0
  33. package/dist/components/Collapsible.js +26 -0
  34. package/dist/components/Combobox.d.ts +36 -0
  35. package/dist/components/Combobox.js +41 -0
  36. package/dist/components/Command.d.ts +37 -0
  37. package/dist/components/Command.js +32 -0
  38. package/dist/components/ContextMenu.d.ts +34 -0
  39. package/dist/components/ContextMenu.js +23 -0
  40. package/dist/components/Dialog.d.ts +20 -0
  41. package/dist/components/Dialog.js +34 -0
  42. package/dist/components/Drawer.d.ts +28 -0
  43. package/dist/components/Drawer.js +25 -0
  44. package/dist/components/DropdownMenu.d.ts +42 -0
  45. package/dist/components/DropdownMenu.js +32 -0
  46. package/dist/components/Empty.d.ts +28 -0
  47. package/dist/components/Empty.js +15 -0
  48. package/dist/components/Field.d.ts +30 -0
  49. package/dist/components/Field.js +13 -0
  50. package/dist/components/Grid.d.ts +32 -0
  51. package/dist/components/Grid.js +37 -0
  52. package/dist/components/GridItem.d.ts +30 -0
  53. package/dist/components/GridItem.js +40 -0
  54. package/dist/components/HoverCard.d.ts +22 -0
  55. package/dist/components/HoverCard.js +12 -0
  56. package/dist/components/Input.d.ts +34 -0
  57. package/dist/components/Input.js +8 -0
  58. package/dist/components/InputGroup.d.ts +28 -0
  59. package/dist/components/InputGroup.js +13 -0
  60. package/dist/components/InputOTP.d.ts +26 -0
  61. package/dist/components/InputOTP.js +25 -0
  62. package/dist/components/Kbd.d.ts +26 -0
  63. package/dist/components/Kbd.js +11 -0
  64. package/dist/components/Label.d.ts +20 -0
  65. package/dist/components/Label.js +17 -0
  66. package/dist/components/Menubar.d.ts +35 -0
  67. package/dist/components/Menubar.js +19 -0
  68. package/dist/components/NativeSelect.d.ts +33 -0
  69. package/dist/components/NativeSelect.js +37 -0
  70. package/dist/components/NavigationMenu.d.ts +32 -0
  71. package/dist/components/NavigationMenu.js +14 -0
  72. package/dist/components/Pagination.d.ts +28 -0
  73. package/dist/components/Pagination.js +62 -0
  74. package/dist/components/Popover.d.ts +28 -0
  75. package/dist/components/Popover.js +19 -0
  76. package/dist/components/Progress.d.ts +25 -0
  77. package/dist/components/Progress.js +37 -0
  78. package/dist/components/RadioGroup.d.ts +35 -0
  79. package/dist/components/RadioGroup.js +44 -0
  80. package/dist/components/Resizable.d.ts +31 -0
  81. package/dist/components/Resizable.js +17 -0
  82. package/dist/components/ScrollArea.d.ts +8 -0
  83. package/dist/components/ScrollArea.js +14 -0
  84. package/dist/components/Select.d.ts +35 -0
  85. package/dist/components/Select.js +33 -0
  86. package/dist/components/Separator.d.ts +10 -0
  87. package/dist/components/Separator.js +30 -0
  88. package/dist/components/Sheet.d.ts +31 -0
  89. package/dist/components/Sheet.js +26 -0
  90. package/dist/components/Sidebar.d.ts +52 -0
  91. package/dist/components/Sidebar.js +96 -0
  92. package/dist/components/Skeleton.d.ts +40 -0
  93. package/dist/components/Skeleton.js +42 -0
  94. package/dist/components/Slider.d.ts +26 -0
  95. package/dist/components/Slider.js +9 -0
  96. package/dist/components/Spinner.d.ts +7 -0
  97. package/dist/components/Spinner.js +13 -0
  98. package/dist/components/Status.d.ts +30 -0
  99. package/dist/components/Status.js +27 -0
  100. package/dist/components/Switch.d.ts +27 -0
  101. package/dist/components/Switch.js +9 -0
  102. package/dist/components/Table.d.ts +39 -0
  103. package/dist/components/Table.js +22 -0
  104. package/dist/components/Tabs.d.ts +32 -0
  105. package/dist/components/Tabs.js +21 -0
  106. package/dist/components/Text.d.ts +2 -0
  107. package/dist/components/Text.js +5 -0
  108. package/dist/components/Textarea.d.ts +32 -0
  109. package/dist/components/Textarea.js +15 -0
  110. package/dist/components/Toaster.d.ts +30 -0
  111. package/dist/components/Toaster.js +9 -0
  112. package/dist/components/Toggle.d.ts +34 -0
  113. package/dist/components/Toggle.js +31 -0
  114. package/dist/components/ToggleGroup.d.ts +46 -0
  115. package/dist/components/ToggleGroup.js +26 -0
  116. package/dist/components/Tooltip.d.ts +25 -0
  117. package/dist/components/Tooltip.js +12 -0
  118. package/dist/components/ui/accordion.d.ts +7 -0
  119. package/dist/components/ui/accordion.js +81 -0
  120. package/dist/components/ui/alert-dialog.d.ts +18 -0
  121. package/dist/components/ui/alert-dialog.js +154 -0
  122. package/dist/components/ui/alert.d.ts +10 -0
  123. package/dist/components/ui/alert.js +64 -0
  124. package/dist/components/ui/aspect-ratio.d.ts +3 -0
  125. package/dist/components/ui/aspect-ratio.js +11 -0
  126. package/dist/components/ui/avatar.d.ts +11 -0
  127. package/dist/components/ui/avatar.js +57 -0
  128. package/dist/components/ui/badge.d.ts +9 -0
  129. package/dist/components/ui/badge.js +42 -0
  130. package/dist/components/ui/breadcrumb.d.ts +11 -0
  131. package/dist/components/ui/breadcrumb.js +87 -0
  132. package/dist/components/ui/button-group.d.ts +11 -0
  133. package/dist/components/ui/button-group.js +37 -0
  134. package/dist/components/ui/button.d.ts +10 -0
  135. package/dist/components/ui/button.js +55 -0
  136. package/dist/components/ui/card.d.ts +11 -0
  137. package/dist/components/ui/card.js +82 -0
  138. package/dist/components/ui/carousel.d.ts +28 -0
  139. package/dist/components/ui/carousel.js +196 -0
  140. package/dist/components/ui/chart.d.ts +44 -0
  141. package/dist/components/ui/chart.js +198 -0
  142. package/dist/components/ui/checkbox.d.ts +4 -0
  143. package/dist/components/ui/checkbox.js +33 -0
  144. package/dist/components/ui/collapsible.d.ts +5 -0
  145. package/dist/components/ui/collapsible.js +33 -0
  146. package/dist/components/ui/combobox.d.ts +24 -0
  147. package/dist/components/ui/combobox.js +160 -0
  148. package/dist/components/ui/command.d.ts +18 -0
  149. package/dist/components/ui/command.js +142 -0
  150. package/dist/components/ui/context-menu.d.ts +31 -0
  151. package/dist/components/ui/context-menu.js +73 -0
  152. package/dist/components/ui/dialog.d.ts +17 -0
  153. package/dist/components/ui/dialog.js +138 -0
  154. package/dist/components/ui/direction.d.ts +7 -0
  155. package/dist/components/ui/direction.js +14 -0
  156. package/dist/components/ui/drawer.d.ts +13 -0
  157. package/dist/components/ui/drawer.js +101 -0
  158. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  159. package/dist/components/ui/dropdown-menu.js +98 -0
  160. package/dist/components/ui/empty.d.ts +11 -0
  161. package/dist/components/ui/empty.js +97 -0
  162. package/dist/components/ui/field.d.ts +24 -0
  163. package/dist/components/ui/field.js +110 -0
  164. package/dist/components/ui/hover-card.d.ts +6 -0
  165. package/dist/components/ui/hover-card.js +37 -0
  166. package/dist/components/ui/input-group.d.ts +16 -0
  167. package/dist/components/ui/input-group.js +111 -0
  168. package/dist/components/ui/input-otp.d.ts +11 -0
  169. package/dist/components/ui/input-otp.js +66 -0
  170. package/dist/components/ui/input.d.ts +3 -0
  171. package/dist/components/ui/input.js +19 -0
  172. package/dist/components/ui/item.d.ts +23 -0
  173. package/dist/components/ui/item.js +181 -0
  174. package/dist/components/ui/kbd.d.ts +3 -0
  175. package/dist/components/ui/kbd.js +28 -0
  176. package/dist/components/ui/label.d.ts +4 -0
  177. package/dist/components/ui/label.js +23 -0
  178. package/dist/components/ui/menubar.d.ts +30 -0
  179. package/dist/components/ui/menubar.js +119 -0
  180. package/dist/components/ui/native-select.d.ts +8 -0
  181. package/dist/components/ui/native-select.js +49 -0
  182. package/dist/components/ui/navigation-menu.d.ts +14 -0
  183. package/dist/components/ui/navigation-menu.js +139 -0
  184. package/dist/components/ui/pagination.d.ts +17 -0
  185. package/dist/components/ui/pagination.js +120 -0
  186. package/dist/components/ui/popover.d.ts +10 -0
  187. package/dist/components/ui/popover.js +37 -0
  188. package/dist/components/ui/progress.d.ts +4 -0
  189. package/dist/components/ui/radio-group.d.ts +5 -0
  190. package/dist/components/ui/radio-group.js +44 -0
  191. package/dist/components/ui/resizable.d.ts +7 -0
  192. package/dist/components/ui/resizable.js +44 -0
  193. package/dist/components/ui/scroll-area.d.ts +5 -0
  194. package/dist/components/ui/scroll-area.js +59 -0
  195. package/dist/components/ui/select.d.ts +15 -0
  196. package/dist/components/ui/select.js +131 -0
  197. package/dist/components/ui/separator.d.ts +4 -0
  198. package/dist/components/ui/separator.js +27 -0
  199. package/dist/components/ui/sheet.d.ts +14 -0
  200. package/dist/components/ui/sheet.js +113 -0
  201. package/dist/components/ui/sidebar.d.ts +69 -0
  202. package/dist/components/ui/sidebar.js +459 -0
  203. package/dist/components/ui/skeleton.d.ts +2 -0
  204. package/dist/components/ui/slider.d.ts +4 -0
  205. package/dist/components/ui/slider.js +60 -0
  206. package/dist/components/ui/sonner.d.ts +3 -0
  207. package/dist/components/ui/sonner.js +38 -0
  208. package/dist/components/ui/spinner.d.ts +2 -0
  209. package/dist/components/ui/spinner.js +13 -0
  210. package/dist/components/ui/switch.d.ts +6 -0
  211. package/dist/components/ui/switch.js +32 -0
  212. package/dist/components/ui/table.d.ts +10 -0
  213. package/dist/components/ui/table.js +95 -0
  214. package/dist/components/ui/tabs.d.ts +11 -0
  215. package/dist/components/ui/tabs.js +87 -0
  216. package/dist/components/ui/textarea.d.ts +3 -0
  217. package/dist/components/ui/textarea.js +18 -0
  218. package/dist/components/ui/toggle-group.d.ts +10 -0
  219. package/dist/components/ui/toggle-group.js +76 -0
  220. package/dist/components/ui/toggle.d.ts +9 -0
  221. package/dist/components/ui/toggle.js +43 -0
  222. package/dist/components/ui/tooltip.d.ts +7 -0
  223. package/dist/components/ui/tooltip.js +53 -0
  224. package/dist/hooks/use-mobile.d.ts +1 -0
  225. package/dist/hooks/use-mobile.js +18 -0
  226. package/dist/index.d.ts +122 -0
  227. package/dist/index.js +61 -0
  228. package/dist/lib/utils.d.ts +2 -0
  229. package/dist/lib/utils.js +8 -0
  230. package/dist/primitives/createText.d.ts +103 -0
  231. package/dist/primitives/createText.js +183 -0
  232. package/dist/primitives/resolveProperties.d.ts +17 -0
  233. package/dist/stylex.css +1450 -0
  234. package/dist/tokens/animations.d.ts +126 -0
  235. package/dist/tokens/animations.js +61 -0
  236. package/dist/tokens/tokens.stylex.d.ts +85 -0
  237. package/dist/tokens/tokens.stylex.js +81 -0
  238. package/dist/utils/box-styles.d.ts +1117 -0
  239. package/dist/utils/box-styles.js +1455 -0
  240. package/dist/utils/grid.d.ts +4 -0
  241. package/dist/utils/resolvers.d.ts +10 -0
  242. package/dist/utils/resolvers.js +356 -0
  243. package/dist/utils/types.d.ts +133 -0
  244. package/package.json +80 -0
  245. package/src/theme.css +206 -0
@@ -0,0 +1,103 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import { type ComponentPropsWithoutRef, type JSX, type ReactNode } from 'react';
3
+ type TextTag = 'p' | 'span' | 'label' | 'strong' | 'em' | 'small' | 'code' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
4
+ declare const textVariants: (props?: ({
5
+ variant?: "default" | "label" | "body" | "caption" | "heading-2xl" | "heading-xl" | "heading-l" | "heading-m" | "heading-s" | "heading-xs" | "heading-xxs" | null | undefined;
6
+ color?: "default" | "inherit" | "disabled" | "black" | "white" | "error" | "muted" | "accent" | "danger" | "warning" | "success" | "inverse" | null | undefined;
7
+ align?: "left" | "right" | "center" | "justify" | null | undefined;
8
+ wrap?: "balance" | "nowrap" | "wrap" | "pretty" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ export type TextVariant = NonNullable<VariantProps<typeof textVariants>['variant']>;
11
+ export type TextColor = NonNullable<VariantProps<typeof textVariants>['color']>;
12
+ export type TextStyleProps = VariantProps<typeof textVariants>;
13
+ /**
14
+ * How to render the value passed as children. A named preset keeps the common
15
+ * cases discoverable; the function form is the escape hatch for the long tail
16
+ * (currency, units, locale-specific rules). Either way the output is a string,
17
+ * so no visual decision leaks out of the component.
18
+ */
19
+ export type TextFormatter = 'number' | 'compact' | ((value: string | number) => string);
20
+ type TextProps<E extends TextTag = 'p'> = TextStyleProps & {
21
+ /**
22
+ * The role this text plays, which decides its size, weight and font family.
23
+ * Headings use the display scale; `body`/`default`/`label`/`caption` cover
24
+ * supporting copy. Pick the role, never a raw size.
25
+ */
26
+ variant?: TextStyleProps['variant'];
27
+ /**
28
+ * Semantic foreground color that resolves for light and dark automatically.
29
+ * Use `inherit` to adopt the color of a parent Box.
30
+ */
31
+ color?: TextStyleProps['color'];
32
+ /**
33
+ * Underlying DOM element. Defaults to a sensible element per variant (heading
34
+ * variants render `h1`–`h6`, everything else `p`). Override to keep a correct
35
+ * document outline. DOM props for the element are typed and forwarded.
36
+ */
37
+ as?: E;
38
+ /**
39
+ * Horizontal text alignment.
40
+ */
41
+ align?: TextStyleProps['align'];
42
+ /**
43
+ * Line-wrapping behavior. Defaults are baked per role (headings `balance`,
44
+ * body `pretty`); set this to override. Ignored while truncating.
45
+ */
46
+ wrap?: TextStyleProps['wrap'];
47
+ /**
48
+ * The text to render. Prefer plain strings and numbers; inline elements are
49
+ * allowed where you genuinely need them (a `<br>`, an inline link), but reach
50
+ * for Box to compose layout rather than nesting containers inside Text.
51
+ */
52
+ children?: ReactNode;
53
+ /**
54
+ * Render a pulsing skeleton placeholder instead of children, for content that
55
+ * is still loading.
56
+ */
57
+ loading?: boolean;
58
+ /**
59
+ * Sizes the single-line loading skeleton. Falls back to children, then to
60
+ * "Loading...".
61
+ */
62
+ placeholderText?: string;
63
+ /**
64
+ * When greater than 1, renders a multi-line loading skeleton with that many
65
+ * lines.
66
+ */
67
+ placeholderNumberOfLines?: number;
68
+ /**
69
+ * Apply a line-through decoration, e.g. for a struck-out previous price.
70
+ */
71
+ lineThrough?: boolean;
72
+ /**
73
+ * Render in the monospace font family while keeping the variant's size and
74
+ * weight. Orthogonal to `variant`, so any text can be monospaced.
75
+ */
76
+ monospace?: boolean;
77
+ /**
78
+ * Align figures for vertical scanning in tables and stat readouts. Pairs well
79
+ * with a numeric `formatter`.
80
+ */
81
+ tabularNums?: boolean;
82
+ /**
83
+ * Truncate overflow. `true` clamps to a single line with an ellipsis; a
84
+ * number clamps to that many lines. The component owns the CSS, so callers
85
+ * never hand-roll line-clamp utilities.
86
+ */
87
+ truncate?: boolean | number;
88
+ /**
89
+ * Format the children value for display. 'number' adds grouping separators
90
+ * (3290033 → "3,290,033"), 'compact' shortens (3290033 → "3.3M"), or pass a
91
+ * function for full control. Pass the raw value as children, not a
92
+ * pre-formatted string.
93
+ */
94
+ formatter?: TextFormatter;
95
+ } & Omit<ComponentPropsWithoutRef<E>, keyof TextStyleProps | 'className' | 'loading' | 'children'>;
96
+ declare function Text<E extends TextTag = 'p'>({ as, variant, color, align, wrap, children, style, loading, placeholderText, placeholderNumberOfLines, lineThrough, monospace, tabularNums, truncate, formatter, ...props }: TextProps<E> & {
97
+ style?: React.CSSProperties;
98
+ }): JSX.Element;
99
+ declare namespace Text {
100
+ var displayName: string;
101
+ }
102
+ export declare function createText(): typeof Text;
103
+ export { Text };
@@ -0,0 +1,183 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { cva } from 'class-variance-authority';
3
+ import { twMerge } from 'tailwind-merge';
4
+
5
+ const textVariants = cva("", {
6
+ variants: {
7
+ variant: {
8
+ default: "text-sm",
9
+ body: "text-base",
10
+ label: "text-xs font-medium",
11
+ caption: "text-xs leading-snug",
12
+ "heading-2xl": `font-display text-6xl md:text-8xl`,
13
+ "heading-xl": `font-display text-5xl md:text-7xl`,
14
+ "heading-l": `font-display text-4xl md:text-5xl`,
15
+ "heading-m": `text-3xl md:text-4xl`,
16
+ "heading-s": `text-2xl md:text-3xl`,
17
+ "heading-xs": `text-xl md:text-2xl`,
18
+ "heading-xxs": `text-lg md:text-xl`
19
+ },
20
+ color: {
21
+ default: "text-black dark:text-white",
22
+ muted: "text-gray-500 dark:text-polar-500",
23
+ disabled: "text-gray-400 dark:text-polar-600",
24
+ accent: "text-indigo-500 dark:text-indigo-500",
25
+ danger: "text-red-500 dark:text-red-500",
26
+ error: "text-red-500 dark:text-red-500",
27
+ warning: "text-amber-500 dark:text-amber-500",
28
+ success: "text-emerald-500 dark:text-emerald-500",
29
+ inverse: "text-white dark:text-black",
30
+ white: "text-white dark:text-white",
31
+ black: "text-black dark:text-black",
32
+ inherit: ""
33
+ },
34
+ align: {
35
+ left: "text-left",
36
+ center: "text-center",
37
+ right: "text-right",
38
+ justify: "text-justify"
39
+ },
40
+ wrap: {
41
+ wrap: "text-wrap",
42
+ nowrap: "text-nowrap",
43
+ balance: "text-balance",
44
+ pretty: "text-pretty"
45
+ }
46
+ },
47
+ defaultVariants: {
48
+ variant: "default",
49
+ color: "default"
50
+ }
51
+ });
52
+ const VARIANT_DEFAULT_TAG = {
53
+ default: "p",
54
+ body: "p",
55
+ label: "p",
56
+ caption: "p",
57
+ "heading-2xl": "h1",
58
+ "heading-xl": "h2",
59
+ "heading-l": "h3",
60
+ "heading-m": "h4",
61
+ "heading-s": "h5",
62
+ "heading-xs": "h6",
63
+ "heading-xxs": "h6"
64
+ };
65
+ const VARIANT_DEFAULT_WRAP = {
66
+ body: "pretty",
67
+ "heading-2xl": "balance",
68
+ "heading-xl": "balance",
69
+ "heading-l": "balance"
70
+ };
71
+ const numberFormatter = new Intl.NumberFormat("en-US");
72
+ const compactFormatter = new Intl.NumberFormat("en-US", { notation: "compact" });
73
+ function applyFormatter(formatter, value) {
74
+ if (typeof formatter === "function") return formatter(value);
75
+ const n = typeof value === "number" ? value : Number(value);
76
+ if (Number.isNaN(n)) return String(value);
77
+ return formatter === "compact" ? compactFormatter.format(n) : numberFormatter.format(n);
78
+ }
79
+ const HEADING_FONT_FEATURES = "'ss07' 1, 'ss08' 1, 'zero' 1, 'liga' 0";
80
+ const SKELETON_CLASSES = "dark:bg-polar-700 animate-pulse rounded-sm bg-gray-100";
81
+ const renderMultiLineSkeleton = (lines) => Array.from({ length: lines }, (_, i) => /* @__PURE__ */ jsx(
82
+ "span",
83
+ {
84
+ "aria-hidden": true,
85
+ style: {
86
+ display: "flex",
87
+ alignItems: "center",
88
+ height: "1lh"
89
+ },
90
+ children: /* @__PURE__ */ jsx(
91
+ "span",
92
+ {
93
+ className: SKELETON_CLASSES,
94
+ style: {
95
+ display: "block",
96
+ height: "1em",
97
+ width: i === lines - 1 ? "60%" : "100%"
98
+ }
99
+ }
100
+ )
101
+ },
102
+ i
103
+ ));
104
+ const renderSingleLineSkeleton = (placeholder) => /* @__PURE__ */ jsxs(Fragment, { children: [
105
+ /* @__PURE__ */ jsx("span", { style: { visibility: "hidden" }, children: placeholder }),
106
+ /* @__PURE__ */ jsx(
107
+ "span",
108
+ {
109
+ "aria-hidden": true,
110
+ className: SKELETON_CLASSES,
111
+ style: { position: "absolute", inset: 0 }
112
+ }
113
+ )
114
+ ] });
115
+ function Text({
116
+ as,
117
+ variant,
118
+ color,
119
+ align,
120
+ wrap,
121
+ children,
122
+ style,
123
+ loading,
124
+ placeholderText,
125
+ placeholderNumberOfLines,
126
+ lineThrough,
127
+ monospace,
128
+ tabularNums,
129
+ truncate,
130
+ formatter,
131
+ ...props
132
+ }) {
133
+ const resolvedVariant = variant ?? "default";
134
+ const Tag = as ?? VARIANT_DEFAULT_TAG[resolvedVariant];
135
+ const isHeading = resolvedVariant.startsWith("heading-");
136
+ const resolvedWrap = wrap ?? (truncate ? void 0 : VARIANT_DEFAULT_WRAP[resolvedVariant]);
137
+ let content = formatter !== void 0 && (typeof children === "string" || typeof children === "number") ? applyFormatter(formatter, children) : children;
138
+ let loadingStyle;
139
+ if (loading) {
140
+ const lines = placeholderNumberOfLines ?? 1;
141
+ if (lines > 1) {
142
+ content = renderMultiLineSkeleton(lines);
143
+ loadingStyle = void 0;
144
+ } else {
145
+ content = renderSingleLineSkeleton(
146
+ placeholderText ?? children ?? "Loading..."
147
+ );
148
+ loadingStyle = { position: "relative", display: "inline-block" };
149
+ }
150
+ }
151
+ const mergedStyle = {
152
+ ...isHeading && { fontFeatureSettings: HEADING_FONT_FEATURES },
153
+ ...lineThrough ? { textDecoration: "line-through" } : {},
154
+ ...typeof truncate === "number" ? {
155
+ display: "-webkit-box",
156
+ WebkitLineClamp: truncate,
157
+ WebkitBoxOrient: "vertical",
158
+ overflow: "hidden"
159
+ } : {},
160
+ ...style,
161
+ ...loadingStyle
162
+ };
163
+ return /* @__PURE__ */ jsx(
164
+ Tag,
165
+ {
166
+ className: twMerge(
167
+ textVariants({ variant, color, align, wrap: resolvedWrap }),
168
+ monospace && "font-mono",
169
+ tabularNums && "tabular-nums",
170
+ truncate === true && "truncate"
171
+ ),
172
+ style: mergedStyle,
173
+ ...props,
174
+ children: content
175
+ }
176
+ );
177
+ }
178
+ Text.displayName = "Text";
179
+ function createText() {
180
+ return Text;
181
+ }
182
+
183
+ export { Text, createText };
@@ -0,0 +1,17 @@
1
+ export type Breakpoint = 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
2
+ export type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
3
+ export type FlexContainerProps = {
4
+ display?: Responsive<'flex' | 'block' | 'inline-flex' | 'grid' | 'inline-grid' | 'hidden'>;
5
+ flexDirection?: Responsive<'row' | 'column' | 'row-reverse' | 'column-reverse'>;
6
+ alignItems?: Responsive<'start' | 'end' | 'center' | 'stretch' | 'baseline'>;
7
+ justifyContent?: Responsive<'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'>;
8
+ flexWrap?: Responsive<'wrap' | 'nowrap' | 'wrap-reverse'>;
9
+ };
10
+ export type FlexChildProps = {
11
+ flex?: Responsive<'1' | 'auto' | 'none' | 'initial'>;
12
+ alignSelf?: Responsive<'auto' | 'start' | 'end' | 'center' | 'stretch' | 'baseline'>;
13
+ flexGrow?: '0' | '1';
14
+ flexShrink?: '0' | '1';
15
+ };
16
+ export declare function resolveContainerClasses(props: FlexContainerProps): string;
17
+ export declare function resolveFlexChildClasses(props: FlexChildProps): string;