@warmio/ui 1.4.0 → 2.0.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 (51) hide show
  1. package/LICENSES/fluid-functionalism.txt +24 -0
  2. package/README.md +23 -14
  3. package/dist/badge.js +2 -2
  4. package/dist/button.js +4 -1
  5. package/dist/chunks/chunk-A2PN77YE.js +42 -0
  6. package/dist/chunks/chunk-DHV2A22F.js +240 -0
  7. package/dist/chunks/chunk-DOOSH3V6.js +72 -0
  8. package/dist/chunks/chunk-EIEA5RJJ.js +97 -0
  9. package/dist/chunks/chunk-FKGHMPVW.js +875 -0
  10. package/dist/chunks/chunk-K36HD5J5.js +133 -0
  11. package/dist/chunks/chunk-L6L3GVGM.js +130 -0
  12. package/dist/chunks/chunk-MGX6ZL6Q.js +224 -0
  13. package/dist/chunks/chunk-MVUHHKBL.js +492 -0
  14. package/dist/chunks/chunk-PJUNSOJK.js +116 -0
  15. package/dist/chunks/chunk-RVVHR7RY.js +0 -0
  16. package/dist/chunks/chunk-U7D32UN3.js +0 -0
  17. package/dist/chunks/chunk-W24JGQWM.js +65 -0
  18. package/dist/dropdown-menu.js +4 -3
  19. package/dist/entries/badge.css +178 -0
  20. package/dist/entries/button.css +422 -0
  21. package/dist/entries/dropdown-menu.css +167 -0
  22. package/dist/entries/index.css +2789 -0
  23. package/dist/entries/logo.css +147 -0
  24. package/dist/entries/product-header.css +88 -0
  25. package/dist/entries/sheet.css +666 -0
  26. package/dist/entries/sidebar.css +2108 -0
  27. package/dist/entries/text.css +97 -0
  28. package/dist/index.js +17 -13
  29. package/dist/logo.js +2 -2
  30. package/dist/product-header.js +2 -2
  31. package/dist/product-header.types.d.ts +3 -2
  32. package/dist/sheet.js +5 -3
  33. package/dist/sidebar.css +129 -0
  34. package/dist/sidebar.js +7 -3
  35. package/dist/text.css +121 -0
  36. package/dist/text.js +2 -2
  37. package/package.json +15 -5
  38. package/types/badge.d.ts +10 -2
  39. package/types/button.d.ts +65 -9
  40. package/types/sidebar.d.ts +10 -2
  41. package/types/text.d.ts +10 -2
  42. package/dist/chunks/chunk-4RQCHKAW.js +0 -105
  43. package/dist/chunks/chunk-FW2EHGRK.js +0 -748
  44. package/dist/chunks/chunk-GKEYV2XW.js +0 -10
  45. package/dist/chunks/chunk-HDCV4ACN.js +0 -469
  46. package/dist/chunks/chunk-ICC7GQXS.js +0 -74
  47. package/dist/chunks/chunk-KN6WVLCR.js +0 -261
  48. package/dist/chunks/chunk-MIMC4M6W.js +0 -86
  49. package/dist/chunks/chunk-PBWF6BDE.js +0 -88
  50. package/dist/chunks/chunk-VIB7OX7D.js +0 -10
  51. package/dist/chunks/chunk-YTDMREDR.js +0 -201
@@ -11,6 +11,8 @@ export type SidebarProviderProps = WithoutChrome<ComponentProps<'div'>> & {
11
11
  onOpenChange?: (open: boolean) => void;
12
12
  forceIconAtTablet?: boolean;
13
13
  allowUserCollapse?: boolean;
14
+ allowDesktopCollapse?: boolean;
15
+ expandOnHover?: boolean;
14
16
  presentation?: 'mockup' | 'preview';
15
17
  };
16
18
 
@@ -50,7 +52,10 @@ export type SidebarGroupLabelProps = WithoutChrome<ComponentProps<'div'>> & {
50
52
  presentation?: 'mockup' | 'navigation';
51
53
  };
52
54
 
53
- export type SidebarMenuProps = WithoutChrome<ComponentProps<'ul'>>;
55
+ export type SidebarMenuProps = WithoutChrome<ComponentProps<'ul'>> & {
56
+ spacing?: 'default' | 'roomy' | 'collapsed';
57
+ fluidHighlights?: boolean;
58
+ };
54
59
  export type SidebarMenuItemProps = WithoutChrome<ComponentProps<'li'>>;
55
60
 
56
61
  export type SidebarMenuButtonProps = WithoutChrome<ComponentProps<'button'>> & {
@@ -61,7 +66,7 @@ export type SidebarMenuButtonProps = WithoutChrome<ComponentProps<'button'>> & {
61
66
  variant?: 'default' | 'outline' | null;
62
67
  size?: 'default' | null;
63
68
  collapsed?: boolean;
64
- presentation?: 'account' | 'disabled' | 'navigation' | 'previewCollapsed';
69
+ presentation?: 'account' | 'disabled' | 'navigation' | 'previewCollapsed' | 'sidebarIcon';
65
70
  };
66
71
 
67
72
  export type SidebarMenuBadgeProps = WithoutChrome<ComponentProps<'div'>> & {
@@ -76,6 +81,9 @@ export type SidebarContextValue = {
76
81
  setOpenMobile: (open: boolean | ((open: boolean) => boolean)) => void;
77
82
  isMobile: boolean;
78
83
  toggleSidebar: () => void;
84
+ sidebarMotionEnabled: boolean;
85
+ expandOnHover: boolean;
86
+ forceIconAtTablet: boolean;
79
87
  };
80
88
 
81
89
  export declare function SidebarProvider(props: SidebarProviderProps): ReactNode;
package/types/text.d.ts CHANGED
@@ -7,15 +7,17 @@ export type TextVariant =
7
7
  | 'display'
8
8
  | 'displayCompact'
9
9
  | 'displayHero'
10
+ | 'heading'
10
11
  | 'helper'
11
12
  | 'lede'
13
+ | 'metric'
12
14
  | 'micro'
13
15
  | 'microStrong'
14
16
  | 'overline'
15
17
  | 'sectionTitle';
16
18
  export type TextTone = 'default' | 'foreground' | 'muted' | 'primary' | 'success' | 'warning';
17
19
  export type TextAlign = 'center' | 'end' | 'start';
18
- export type TextProps = {
20
+ type TextBaseProps = {
19
21
  align?: TextAlign;
20
22
  as?: 'div' | 'h1' | 'h2' | 'h3' | 'p' | 'small' | 'span';
21
23
  children?: ReactNode;
@@ -24,8 +26,14 @@ export type TextProps = {
24
26
  style?: never;
25
27
  tone?: TextTone;
26
28
  truncate?: boolean;
27
- variant?: TextVariant;
28
29
  };
30
+ export type TextProps =
31
+ | (TextBaseProps & { size?: 'default' | 'large' | 'display'; variant: 'body' })
32
+ | (TextBaseProps & { size?: 'default' | 'display'; variant: 'heading' })
33
+ | (TextBaseProps & {
34
+ size?: never;
35
+ variant?: Exclude<TextVariant, 'body' | 'heading'>;
36
+ });
29
37
  export type StackedDisplayProps = {
30
38
  align?: TextAlign;
31
39
  className?: never;
@@ -1,105 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-VIB7OX7D.js";
4
-
5
- // ../ui/src/warmio/text.tsx
6
- import * as React from "react";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
- var textClassNameByVariant = {
9
- display: "block text-3xl font-normal leading-snug tracking-normal [font-family:var(--font-display)]",
10
- displayCompact: "block text-xl font-normal leading-snug tracking-normal [font-family:var(--font-display)] @3xl/main:text-2xl",
11
- displayHero: "block text-3xl font-bold leading-tight tracking-normal text-foreground sm:text-4xl lg:text-5xl",
12
- metricValue: "block text-2xl",
13
- metricValueLead: "block text-3xl",
14
- metricDisplay: "block text-5xl font-bold leading-none tracking-tight",
15
- metricDisplayCompact: "block text-4xl font-bold leading-none tracking-tight",
16
- overline: "block font-mono text-xs font-bold uppercase tracking-[0.18em]",
17
- micro: "text-xs font-normal leading-snug",
18
- microStrong: "text-xs font-bold leading-snug",
19
- body: "text-sm",
20
- lede: "text-[1.35rem] leading-snug",
21
- caption: "text-xs",
22
- helper: "text-xs",
23
- sectionTitle: "text-base font-bold leading-normal"
24
- };
25
- var defaultTextElementByVariant = {
26
- display: "span",
27
- displayCompact: "span",
28
- displayHero: "h1",
29
- metricValue: "span",
30
- metricValueLead: "span",
31
- metricDisplay: "span",
32
- metricDisplayCompact: "span",
33
- overline: "span",
34
- micro: "span",
35
- microStrong: "span",
36
- body: "p",
37
- lede: "p",
38
- caption: "span",
39
- helper: "small",
40
- sectionTitle: "h3"
41
- };
42
- var textClassNameByTone = {
43
- default: "",
44
- muted: "text-muted-foreground",
45
- foreground: "text-foreground",
46
- primary: "text-primary",
47
- success: "text-success",
48
- warning: "text-warning",
49
- financeCash: "text-finance-cash",
50
- financeDebt: "text-finance-debt",
51
- financeInvestment: "text-finance-investment"
52
- };
53
- var textClassNameByAlign = {
54
- start: "text-left",
55
- center: "text-center",
56
- end: "text-right"
57
- };
58
- function Text({
59
- as,
60
- variant = "caption",
61
- tone = "default",
62
- align,
63
- numeric = false,
64
- mono = false,
65
- truncate = false,
66
- animateNumber = false,
67
- className: _className,
68
- style: _style,
69
- ...props
70
- }) {
71
- const Component = as ?? defaultTextElementByVariant[variant];
72
- return React.createElement(Component, {
73
- ...props,
74
- "data-animate-number": animateNumber || void 0,
75
- className: cn(
76
- textClassNameByVariant[variant],
77
- variant === "sectionTitle" && Component === "h2" && "text-lg leading-snug",
78
- textClassNameByTone[tone],
79
- align && textClassNameByAlign[align],
80
- numeric && "tabular-nums",
81
- mono && "font-mono",
82
- truncate && "truncate"
83
- )
84
- });
85
- }
86
- Text.displayName = "WarmText";
87
- function StackedDisplay({
88
- align = "start",
89
- firstLine,
90
- presentation = "dashboard",
91
- secondLine
92
- }) {
93
- const firstLineClassName = presentation === "welcome" ? "block text-muted-foreground" : "block text-foreground";
94
- const secondLineClassName = presentation === "welcome" ? "block text-foreground" : "block text-muted-foreground";
95
- return /* @__PURE__ */ jsxs(Text, { as: "span", variant: "displayCompact", align, children: [
96
- /* @__PURE__ */ jsx("span", { className: firstLineClassName, children: firstLine }),
97
- /* @__PURE__ */ jsx("span", { className: secondLineClassName, children: secondLine })
98
- ] });
99
- }
100
- StackedDisplay.displayName = "WarmStackedDisplay";
101
-
102
- export {
103
- Text,
104
- StackedDisplay
105
- };