@fragment-build/ui 3.3.0 → 4.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 (83) hide show
  1. package/components/code-snippet/CodeSnippet.d.ts +9 -0
  2. package/components/code-snippet/CodeSnippet.js +14 -4
  3. package/components/code-snippet/CodeSnippet.js.map +1 -1
  4. package/components/code-snippet/code-snippet.css +18 -0
  5. package/components/segmented-control/SegmentedControl.d.ts +16 -0
  6. package/components/segmented-control/SegmentedControl.js +18 -0
  7. package/components/segmented-control/SegmentedControl.js.map +1 -0
  8. package/components/segmented-control/SegmentedControl.styles.d.ts +46 -0
  9. package/components/segmented-control/SegmentedControl.styles.js +20 -0
  10. package/components/segmented-control/SegmentedControl.styles.js.map +1 -0
  11. package/components/segmented-control/segmented-control.css +41 -0
  12. package/fragments/empty-state/EmptyState.d.ts +12 -0
  13. package/fragments/empty-state/EmptyState.js +12 -0
  14. package/fragments/empty-state/EmptyState.js.map +1 -0
  15. package/fragments/empty-state/EmptyState.styles.d.ts +55 -0
  16. package/fragments/empty-state/EmptyState.styles.js +23 -0
  17. package/fragments/empty-state/EmptyState.styles.js.map +1 -0
  18. package/fragments/empty-state/empty-state.css +39 -0
  19. package/fragments/form/FormCard.d.ts +14 -0
  20. package/fragments/form/FormCard.js +14 -0
  21. package/fragments/form/FormCard.js.map +1 -0
  22. package/fragments/form/FormCard.styles.d.ts +49 -0
  23. package/fragments/form/FormCard.styles.js +23 -0
  24. package/fragments/form/FormCard.styles.js.map +1 -0
  25. package/fragments/form/FormSection.d.ts +3 -1
  26. package/fragments/form/FormSection.js +2 -2
  27. package/fragments/form/FormSection.js.map +1 -1
  28. package/fragments/form/FormSection.styles.d.ts +6 -0
  29. package/fragments/form/FormSection.styles.js +2 -0
  30. package/fragments/form/FormSection.styles.js.map +1 -1
  31. package/fragments/form/form-card.css +42 -0
  32. package/fragments/form/form-section.css +22 -10
  33. package/fragments/form/form.css +1 -1
  34. package/fragments/page/PageHeader.d.ts +7 -2
  35. package/fragments/page/PageHeader.js +3 -3
  36. package/fragments/page/PageHeader.js.map +1 -1
  37. package/fragments/page/PageHeader.styles.d.ts +30 -21
  38. package/fragments/page/PageHeader.styles.js +10 -0
  39. package/fragments/page/PageHeader.styles.js.map +1 -1
  40. package/fragments/page/page-header.css +23 -3
  41. package/fragments/save-bar/SaveBar.d.ts +12 -0
  42. package/fragments/save-bar/SaveBar.js +15 -0
  43. package/fragments/save-bar/SaveBar.js.map +1 -0
  44. package/fragments/save-bar/SaveBar.styles.d.ts +37 -0
  45. package/fragments/save-bar/SaveBar.styles.js +16 -0
  46. package/fragments/save-bar/SaveBar.styles.js.map +1 -0
  47. package/fragments/save-bar/save-bar.css +28 -0
  48. package/fragments/shell/shell.css +8 -4
  49. package/fragments/sidebar/Sidebar.js +4 -1
  50. package/fragments/sidebar/Sidebar.js.map +1 -1
  51. package/fragments/sidebar/sidebar.css +41 -24
  52. package/fragments/stat/StatCard.d.ts +29 -0
  53. package/fragments/stat/StatCard.js +20 -0
  54. package/fragments/stat/StatCard.js.map +1 -0
  55. package/fragments/stat/StatCard.styles.d.ts +85 -0
  56. package/fragments/stat/StatCard.styles.js +26 -0
  57. package/fragments/stat/StatCard.styles.js.map +1 -0
  58. package/fragments/stat/stat-card.css +64 -0
  59. package/fragments/widget/Widget.d.ts +9 -2
  60. package/fragments/widget/Widget.js +4 -3
  61. package/fragments/widget/Widget.js.map +1 -1
  62. package/fragments/widget/Widget.styles.d.ts +51 -0
  63. package/fragments/widget/Widget.styles.js +12 -0
  64. package/fragments/widget/Widget.styles.js.map +1 -1
  65. package/fragments/widget/widget.css +49 -4
  66. package/index.css +112 -38
  67. package/index.d.ts +5 -0
  68. package/index.js +5 -0
  69. package/index.js.map +1 -1
  70. package/package.json +1 -1
  71. package/src/components/code-snippet/code-snippet.css +18 -0
  72. package/src/components/segmented-control/segmented-control.css +41 -0
  73. package/src/fragments/empty-state/empty-state.css +39 -0
  74. package/src/fragments/form/form-card.css +42 -0
  75. package/src/fragments/form/form-section.css +22 -10
  76. package/src/fragments/form/form.css +1 -1
  77. package/src/fragments/page/page-header.css +23 -3
  78. package/src/fragments/save-bar/save-bar.css +28 -0
  79. package/src/fragments/shell/shell.css +8 -4
  80. package/src/fragments/sidebar/sidebar.css +41 -24
  81. package/src/fragments/stat/stat-card.css +64 -0
  82. package/src/fragments/widget/widget.css +49 -4
  83. package/src/index.css +112 -38
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * A single headline number: label, value, an optional change against a named period and a hint.
5
+ */
6
+ import { Card, Skeleton, Tooltip } from '@heroui/react';
7
+ import { IconArrowDownRight, IconArrowUpRight, IconInfoCircle, IconMinus } from '@tabler/icons-react';
8
+ import { statCard } from './StatCard.styles';
9
+ const deltaIcon = {
10
+ up: IconArrowUpRight,
11
+ down: IconArrowDownRight,
12
+ flat: IconMinus,
13
+ };
14
+ export const StatCard = ({ label, value, icon, delta, hint, help, helpLabel = 'More information', isLoading, emphasis, className, }) => {
15
+ const sentiment = delta?.sentiment ?? (delta?.direction === 'up' ? 'positive' : delta?.direction === 'down' ? 'negative' : 'neutral');
16
+ const v = statCard({ emphasis, sentiment });
17
+ const DeltaIcon = delta ? deltaIcon[delta.direction] : null;
18
+ return (_jsxs(Card, { className: v.base({ className }), children: [_jsxs("div", { className: v.top(), children: [_jsxs("span", { className: v.label(), children: [label, help && (_jsxs(Tooltip, { delay: 0, children: [_jsx(Tooltip.Trigger, { className: v.help(), "aria-label": helpLabel, tabIndex: 0, children: _jsx(IconInfoCircle, { size: 14, stroke: 1.75 }) }), _jsx(Tooltip.Content, { className: "max-w-xs", children: help })] }))] }), icon && _jsx("span", { className: v.icon(), children: icon })] }), isLoading ? (_jsx(Skeleton, { className: v.skeleton() })) : (_jsxs("div", { className: v.valueRow(), children: [_jsx("span", { className: v.value(), children: value }), delta && DeltaIcon && (_jsxs("span", { className: v.delta(), children: [_jsx(DeltaIcon, { size: 14, stroke: 2 }), delta.value] }))] })), (hint || delta?.label) && !isLoading && (_jsx("p", { className: v.hint(), children: hint ?? delta?.label }))] }));
19
+ };
20
+ //# sourceMappingURL=StatCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatCard.js","sourceRoot":"","sources":["../../src/fragments/stat/StatCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAgC7C,MAAM,SAAS,GAAG;IAChB,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,SAAS;CACP,CAAC;AAEX,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAChD,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,GAAG,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,GACtG,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,KAAK,EAAE,SAAS,IAAI,CACpC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAC9F,CAAC;IACF,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE5D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AC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,85 @@
1
+ export declare const statCard: import("tailwind-variants").TVReturnType<{
2
+ emphasis: {
3
+ true: {
4
+ base: string;
5
+ };
6
+ };
7
+ sentiment: {
8
+ positive: {
9
+ delta: string;
10
+ };
11
+ negative: {
12
+ delta: string;
13
+ };
14
+ neutral: {
15
+ delta: string;
16
+ };
17
+ };
18
+ }, {
19
+ base: string;
20
+ top: string;
21
+ label: string;
22
+ help: string;
23
+ icon: string;
24
+ valueRow: string;
25
+ value: string;
26
+ delta: string;
27
+ hint: string;
28
+ skeleton: string;
29
+ }, undefined, {
30
+ emphasis: {
31
+ true: {
32
+ base: string;
33
+ };
34
+ };
35
+ sentiment: {
36
+ positive: {
37
+ delta: string;
38
+ };
39
+ negative: {
40
+ delta: string;
41
+ };
42
+ neutral: {
43
+ delta: string;
44
+ };
45
+ };
46
+ }, {
47
+ base: string;
48
+ top: string;
49
+ label: string;
50
+ help: string;
51
+ icon: string;
52
+ valueRow: string;
53
+ value: string;
54
+ delta: string;
55
+ hint: string;
56
+ skeleton: string;
57
+ }, import("tailwind-variants").TVReturnTypeLike<{
58
+ emphasis: {
59
+ true: {
60
+ base: string;
61
+ };
62
+ };
63
+ sentiment: {
64
+ positive: {
65
+ delta: string;
66
+ };
67
+ negative: {
68
+ delta: string;
69
+ };
70
+ neutral: {
71
+ delta: string;
72
+ };
73
+ };
74
+ }, {
75
+ base: string;
76
+ top: string;
77
+ label: string;
78
+ help: string;
79
+ icon: string;
80
+ valueRow: string;
81
+ value: string;
82
+ delta: string;
83
+ hint: string;
84
+ skeleton: string;
85
+ }>>;
@@ -0,0 +1,26 @@
1
+ import { tv } from 'tailwind-variants';
2
+ export const statCard = tv({
3
+ slots: {
4
+ base: 'fragment-stat-card',
5
+ top: 'fragment-stat-card__top',
6
+ label: 'fragment-stat-card__label',
7
+ help: 'fragment-stat-card__help',
8
+ icon: 'fragment-stat-card__icon',
9
+ valueRow: 'fragment-stat-card__value-row',
10
+ value: 'fragment-stat-card__value',
11
+ delta: 'fragment-stat-card__delta',
12
+ hint: 'fragment-stat-card__hint',
13
+ skeleton: 'fragment-stat-card__skeleton',
14
+ },
15
+ variants: {
16
+ emphasis: {
17
+ true: { base: 'fragment-stat-card--emphasis' },
18
+ },
19
+ sentiment: {
20
+ positive: { delta: 'fragment-stat-card__delta--positive' },
21
+ negative: { delta: 'fragment-stat-card__delta--negative' },
22
+ neutral: { delta: 'fragment-stat-card__delta--neutral' },
23
+ },
24
+ },
25
+ });
26
+ //# sourceMappingURL=StatCard.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatCard.styles.js","sourceRoot":"","sources":["../../src/fragments/stat/StatCard.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC;IACzB,KAAK,EAAE;QACL,IAAI,EAAE,oBAAoB;QAC1B,GAAG,EAAE,yBAAyB;QAC9B,KAAK,EAAE,2BAA2B;QAClC,IAAI,EAAE,0BAA0B;QAChC,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,+BAA+B;QACzC,KAAK,EAAE,2BAA2B;QAClC,KAAK,EAAE,2BAA2B;QAClC,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,8BAA8B;KACzC;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE;YACR,IAAI,EAAE,EAAE,IAAI,EAAE,8BAA8B,EAAE;SAC/C;QACD,SAAS,EAAE;YACT,QAAQ,EAAE,EAAE,KAAK,EAAE,qCAAqC,EAAE;YAC1D,QAAQ,EAAE,EAAE,KAAK,EAAE,qCAAqC,EAAE;YAC1D,OAAO,EAAE,EAAE,KAAK,EAAE,oCAAoC,EAAE;SACzD;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,64 @@
1
+ @layer components {
2
+ .fragment-stat-card {
3
+ @apply p-4 gap-2 min-w-0;
4
+ }
5
+
6
+ .fragment-stat-card__top {
7
+ @apply flex items-center justify-between gap-2;
8
+ }
9
+
10
+ .fragment-stat-card__label {
11
+ @apply flex items-center gap-1 text-xs font-medium text-muted min-w-0;
12
+ }
13
+
14
+ .fragment-stat-card__help {
15
+ @apply inline-flex text-muted/70 hover:text-foreground cursor-help rounded-full outline-none
16
+ focus-visible:ring-2 focus-visible:ring-focus;
17
+ }
18
+
19
+ .fragment-stat-card__icon {
20
+ @apply flex size-8 shrink-0 items-center justify-center rounded-lg bg-default text-muted;
21
+ & svg {
22
+ @apply size-4;
23
+ }
24
+ }
25
+
26
+ .fragment-stat-card__value-row {
27
+ @apply flex flex-wrap items-baseline gap-x-2 gap-y-1;
28
+ }
29
+
30
+ /* Proportional figures: a standalone number with tabular digits looks loosely set. */
31
+ .fragment-stat-card__value {
32
+ @apply text-2xl font-semibold tracking-tight text-foreground truncate;
33
+ }
34
+
35
+ .fragment-stat-card__delta {
36
+ @apply inline-flex items-center gap-0.5 rounded-md px-1.5 py-0.5 text-xs font-medium;
37
+ }
38
+
39
+ .fragment-stat-card__delta--positive {
40
+ @apply bg-success-soft text-success-soft-foreground;
41
+ }
42
+
43
+ .fragment-stat-card__delta--negative {
44
+ @apply bg-danger-soft text-danger-soft-foreground;
45
+ }
46
+
47
+ .fragment-stat-card__delta--neutral {
48
+ @apply bg-default text-muted;
49
+ }
50
+
51
+ .fragment-stat-card__hint {
52
+ @apply text-xs text-muted;
53
+ }
54
+
55
+ .fragment-stat-card__skeleton {
56
+ @apply h-8 w-24 rounded-lg;
57
+ }
58
+
59
+ .fragment-stat-card--emphasis {
60
+ .fragment-stat-card__value {
61
+ @apply text-3xl;
62
+ }
63
+ }
64
+ }
@@ -8,8 +8,15 @@ export interface WidgetProps {
8
8
  startContent?: React.ReactNode;
9
9
  endContent?: React.ReactNode;
10
10
  };
11
- title?: string;
12
- size?: 'sm' | 'md' | 'lg';
11
+ title?: React.ReactNode;
12
+ /** One line under the title saying what the widget measures. */
13
+ description?: React.ReactNode;
14
+ /** Pinned to the bottom of the card, behind a hairline: a "view all" link, a timestamp. */
15
+ footer?: React.ReactNode;
16
+ size?: 'sm' | 'md' | 'lg' | 'full';
17
+ /** `none` lets a table or a list run edge to edge inside the card. */
18
+ padding?: 'none' | 'sm' | 'md';
13
19
  variant?: CardProps['variant'];
20
+ className?: string;
14
21
  }
15
22
  export declare const Widget: React.FC<WidgetProps>;
@@ -5,8 +5,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  */
6
6
  import { Card } from '@heroui/react';
7
7
  import { widget } from './Widget.styles';
8
- export const Widget = ({ children, title, header, variant, ...props }) => {
9
- const { base, content, header: headerClasses, headerEndContent } = widget(props);
10
- return (_jsxs(Card, { className: base(), variant: variant, children: [(title || header?.endContent) && (_jsxs(Card.Header, { className: headerClasses(), children: [title && _jsx("h3", { children: title }), _jsx("div", { className: headerEndContent(), children: header?.endContent })] })), _jsx(Card.Content, { className: content(), children: children })] }));
8
+ export const Widget = ({ children, title, description, header, footer, variant, className, ...props }) => {
9
+ const v = widget(props);
10
+ const hasHeader = !!(title || description || header?.startContent || header?.endContent);
11
+ return (_jsxs(Card, { className: v.base({ className }), variant: variant, children: [hasHeader && (_jsxs(Card.Header, { className: v.header(), children: [header?.startContent && _jsx("div", { className: v.headerStartContent(), children: header.startContent }), _jsxs("div", { className: v.heading(), children: [title && _jsx("h3", { className: v.title(), children: title }), description && _jsx("p", { className: v.description(), children: description })] }), header?.endContent && _jsx("div", { className: v.headerEndContent(), children: header.endContent })] })), _jsx(Card.Content, { className: v.content(), children: children }), footer && _jsx(Card.Footer, { className: v.footer(), children: footer })] }));
11
12
  };
12
13
  //# sourceMappingURL=Widget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Widget.js","sourceRoot":"","sources":["../../src/fragments/widget/Widget.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAa,MAAM,eAAe,CAAC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EAAE,YAAY,IAAI,MAAM,EAAE,UAAU,CAAC,CAAC;IAEzF,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,aACrD,SAAS,IAAI,CACZ,MAAC,IAAI,CAAC,MAAM,IAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,aAC/B,MAAM,EAAE,YAAY,IAAI,cAAK,SAAS,EAAE,CAAC,CAAC,kBAAkB,EAAE,YAAG,MAAM,CAAC,YAAY,GAAO,EAC5F,eAAK,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,aACxB,KAAK,IAAI,aAAI,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,YAAG,KAAK,GAAM,EAC/C,WAAW,IAAI,YAAG,SAAS,EAAE,CAAC,CAAC,WAAW,EAAE,YAAG,WAAW,GAAK,IAC5D,EACL,MAAM,EAAE,UAAU,IAAI,cAAK,SAAS,EAAE,CAAC,CAAC,gBAAgB,EAAE,YAAG,MAAM,CAAC,UAAU,GAAO,IAC1E,CACf,EACD,KAAC,IAAI,CAAC,OAAO,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,YACjC,QAAQ,GACI,EACd,MAAM,IAAI,KAAC,IAAI,CAAC,MAAM,IAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,YAAG,MAAM,GAAe,IAChE,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -9,12 +9,29 @@ export declare const widget: import("tailwind-variants").TVReturnType<{
9
9
  lg: {
10
10
  base: string;
11
11
  };
12
+ full: {
13
+ base: string;
14
+ };
15
+ };
16
+ padding: {
17
+ none: {
18
+ base: string;
19
+ };
20
+ sm: {
21
+ base: string;
22
+ };
23
+ md: {};
12
24
  };
13
25
  }, {
14
26
  base: string;
15
27
  header: string;
28
+ headerStartContent: string;
29
+ heading: string;
30
+ title: string;
31
+ description: string;
16
32
  headerEndContent: string;
17
33
  content: string;
34
+ footer: string;
18
35
  }, undefined, {
19
36
  size: {
20
37
  sm: {
@@ -26,12 +43,29 @@ export declare const widget: import("tailwind-variants").TVReturnType<{
26
43
  lg: {
27
44
  base: string;
28
45
  };
46
+ full: {
47
+ base: string;
48
+ };
49
+ };
50
+ padding: {
51
+ none: {
52
+ base: string;
53
+ };
54
+ sm: {
55
+ base: string;
56
+ };
57
+ md: {};
29
58
  };
30
59
  }, {
31
60
  base: string;
32
61
  header: string;
62
+ headerStartContent: string;
63
+ heading: string;
64
+ title: string;
65
+ description: string;
33
66
  headerEndContent: string;
34
67
  content: string;
68
+ footer: string;
35
69
  }, import("tailwind-variants").TVReturnTypeLike<{
36
70
  size: {
37
71
  sm: {
@@ -43,10 +77,27 @@ export declare const widget: import("tailwind-variants").TVReturnType<{
43
77
  lg: {
44
78
  base: string;
45
79
  };
80
+ full: {
81
+ base: string;
82
+ };
83
+ };
84
+ padding: {
85
+ none: {
86
+ base: string;
87
+ };
88
+ sm: {
89
+ base: string;
90
+ };
91
+ md: {};
46
92
  };
47
93
  }, {
48
94
  base: string;
49
95
  header: string;
96
+ headerStartContent: string;
97
+ heading: string;
98
+ title: string;
99
+ description: string;
50
100
  headerEndContent: string;
51
101
  content: string;
102
+ footer: string;
52
103
  }>>;
@@ -3,18 +3,30 @@ export const widget = tv({
3
3
  slots: {
4
4
  base: 'fragment-widget',
5
5
  header: 'fragment-widget__header',
6
+ headerStartContent: 'fragment-widget__header-start',
7
+ heading: 'fragment-widget__heading',
8
+ title: 'fragment-widget__title',
9
+ description: 'fragment-widget__description',
6
10
  headerEndContent: 'fragment-widget__header-end',
7
11
  content: 'fragment-widget__content',
12
+ footer: 'fragment-widget__footer',
8
13
  },
9
14
  variants: {
10
15
  size: {
11
16
  sm: { base: 'fragment-widget--sm' },
12
17
  md: { base: 'fragment-widget--md' },
13
18
  lg: { base: 'fragment-widget--lg' },
19
+ full: { base: 'fragment-widget--full' },
20
+ },
21
+ padding: {
22
+ none: { base: 'fragment-widget--flush' },
23
+ sm: { base: 'fragment-widget--padding-sm' },
24
+ md: {},
14
25
  },
15
26
  },
16
27
  defaultVariants: {
17
28
  size: 'sm',
29
+ padding: 'md',
18
30
  },
19
31
  });
20
32
  //# sourceMappingURL=Widget.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Widget.styles.js","sourceRoot":"","sources":["../../src/fragments/widget/Widget.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,MAAM,MAAM,GAAG,EAAE,CAAC;IACvB,KAAK,EAAE;QACL,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,yBAAyB;QACjC,gBAAgB,EAAE,6BAA6B;QAC/C,OAAO,EAAE,0BAA0B;KACpC;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE;YACnC,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE;YACnC,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE;SACpC;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,IAAI;KACX;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"Widget.styles.js","sourceRoot":"","sources":["../../src/fragments/widget/Widget.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,MAAM,MAAM,GAAG,EAAE,CAAC;IACvB,KAAK,EAAE;QACL,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,yBAAyB;QACjC,kBAAkB,EAAE,+BAA+B;QACnD,OAAO,EAAE,0BAA0B;QACnC,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,8BAA8B;QAC3C,gBAAgB,EAAE,6BAA6B;QAC/C,OAAO,EAAE,0BAA0B;QACnC,MAAM,EAAE,yBAAyB;KAClC;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE;YACnC,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE;YACnC,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE;YACnC,IAAI,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE;SACxC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE;YACxC,EAAE,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE;YAC3C,EAAE,EAAE,EAAE;SACP;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;KACd;CACF,CAAC,CAAC"}
@@ -1,18 +1,59 @@
1
1
  @layer components {
2
2
  .fragment-widget {
3
- @apply px-7 py-5 gap-5;
3
+ @apply p-5 gap-4 min-w-0;
4
4
  }
5
5
 
6
6
  .fragment-widget__header {
7
- @apply p-0;
7
+ @apply p-0 flex flex-row items-start gap-3;
8
+ }
9
+
10
+ .fragment-widget__header-start {
11
+ @apply shrink-0;
12
+ }
13
+
14
+ .fragment-widget__heading {
15
+ @apply min-w-0 flex-1;
16
+ }
17
+
18
+ .fragment-widget__title {
19
+ @apply text-sm font-semibold;
20
+ }
21
+
22
+ .fragment-widget__description {
23
+ @apply mt-0.5 text-xs text-muted;
8
24
  }
9
25
 
10
26
  .fragment-widget__header-end {
11
- @apply ml-auto;
27
+ @apply ml-auto flex items-center gap-2 shrink-0;
12
28
  }
13
29
 
14
30
  .fragment-widget__content {
15
- @apply p-0 overflow-visible;
31
+ @apply p-0 overflow-visible min-w-0;
32
+ }
33
+
34
+ .fragment-widget__footer {
35
+ @apply -mx-5 -mb-5 mt-auto px-5 py-3 border-t border-separator text-xs text-muted;
36
+ }
37
+
38
+ .fragment-widget--padding-sm {
39
+ @apply p-4 gap-3;
40
+
41
+ .fragment-widget__footer {
42
+ @apply -mx-4 -mb-4 px-4;
43
+ }
44
+ }
45
+
46
+ /* Edge-to-edge content: the header keeps its inset, the body does not. */
47
+ .fragment-widget--flush {
48
+ @apply p-0 gap-0;
49
+
50
+ .fragment-widget__header {
51
+ @apply px-5 pt-5 pb-4;
52
+ }
53
+
54
+ .fragment-widget__footer {
55
+ @apply mx-0 mb-0;
56
+ }
16
57
  }
17
58
 
18
59
  .fragment-widget--sm {
@@ -26,4 +67,8 @@
26
67
  .fragment-widget--lg {
27
68
  @apply col-span-1 lg:col-span-2 2xl:col-span-3;
28
69
  }
70
+
71
+ .fragment-widget--full {
72
+ @apply col-span-full;
73
+ }
29
74
  }
package/index.css CHANGED
@@ -1,7 +1,12 @@
1
- @theme {
2
- --text-xs: 13px;
3
- --text-sm: 15px;
4
- }
1
+ /*
2
+ * Type scale.
3
+ *
4
+ * Tailwind's own steps (12 / 14 / 16). Fragment used to pin `text-xs` to 13px and `text-sm` to
5
+ * 15px, which made every HeroUI control one step larger than the component library was drawn for
6
+ * and pushed dashboards towards a consumer-app density. Body copy is set to `text-sm` below, which
7
+ * is the size HeroUI's fields, list boxes and tables already use, so running text and controls now
8
+ * share one size.
9
+ */
5
10
 
6
11
  /*
7
12
  * Fragment surface roles.
@@ -20,33 +25,41 @@
20
25
 
21
26
  @layer base {
22
27
  body {
23
- @apply bg-background text-foreground;
28
+ @apply bg-background text-foreground text-sm antialiased;
24
29
  }
25
30
 
31
+ /*
32
+ * Page title, section, card. A dashboard has many more card titles than page titles, so the
33
+ * steps are tight and the weight carries the hierarchy rather than the size.
34
+ */
26
35
  h1 {
27
- @apply text-3xl font-semibold;
36
+ @apply text-2xl font-semibold tracking-tight;
28
37
  }
29
38
 
30
39
  h2 {
31
- @apply text-2xl font-semibold;
40
+ @apply text-lg font-semibold tracking-tight;
32
41
  }
33
42
 
34
43
  h3 {
35
- @apply text-xl font-semibold;
44
+ @apply text-base font-semibold;
45
+ }
46
+
47
+ h4 {
48
+ @apply text-sm font-semibold;
36
49
  }
37
50
  }
38
51
 
39
52
  @layer components {
53
+ /*
54
+ * Fields keep HeroUI's own height and padding. They get a hairline border instead of the
55
+ * default shadow, so a form reads as a set of crisp boxes on a flat surface.
56
+ */
40
57
  .input, .textarea, .select__trigger {
41
- @apply border border-border px-6 py-4 shadow-none;
58
+ @apply border border-border shadow-none;
42
59
  }
43
60
 
44
- .input-group, .search-field__group, .number-field__group{
45
- @apply border border-border shadow-none h-auto;
46
-
47
- .input-group__input, .search-field__input, .number-field__input {
48
- @apply px-6 py-4;
49
- }
61
+ .input-group, .search-field__group, .number-field__group {
62
+ @apply border border-border shadow-none;
50
63
  }
51
64
 
52
65
  .slider {
@@ -65,14 +78,6 @@
65
78
  }
66
79
  }
67
80
 
68
- .select__indicator {
69
- @apply right-4;
70
- }
71
-
72
- .select__trigger:has(.select__indicator) {
73
- @apply pr-10;
74
- }
75
-
76
81
  .select__popover {
77
82
  @apply rounded-xl;
78
83
  }
@@ -80,18 +85,18 @@
80
85
  .tabs {
81
86
  &:not(.tabs--secondary) {
82
87
  .tabs__list {
83
- @apply bg-surface p-0;
84
-
85
- border-radius: calc(var(--radius-3xl) + 0.25rem);
88
+ @apply bg-default p-1;
89
+
90
+ border-radius: calc(var(--radius-xl) + 0.25rem);
86
91
  }
87
92
 
88
93
  .tabs__indicator {
89
- @apply shadow-none bg-surface-tertiary;
94
+ @apply bg-surface shadow-sm;
90
95
  }
91
96
 
92
97
  .tabs__tab {
93
98
  &[data-selected="true"] {
94
- @apply text-surface-tertiary-foreground;
99
+ @apply text-surface-foreground;
95
100
  }
96
101
  }
97
102
 
@@ -101,7 +106,7 @@
101
106
  }
102
107
 
103
108
  .tabs__tab {
104
- @apply h-10 px-6 text-xs text-nowrap;
109
+ @apply h-8 px-4 text-sm text-nowrap;
105
110
  }
106
111
 
107
112
  .tabs__list {
@@ -110,25 +115,89 @@
110
115
  }
111
116
  }
112
117
 
118
+ /* Underline tabs size to their label, so a short list sits left instead of spreading out. */
113
119
  &.tabs--secondary {
120
+ .tabs__list[data-orientation="horizontal"] {
121
+ @apply gap-6;
122
+ }
123
+
114
124
  .tabs__tab {
115
- @apply h-12 px-10;
125
+ @apply h-11 w-auto min-w-0 px-0.5 gap-2;
126
+ & svg {
127
+ @apply size-4;
128
+ }
129
+
130
+ /*
131
+ * A static underline for tab lists that render no <Tabs.Indicator>. The animated indicator
132
+ * slides from the previous tab with an inline translate, and when the selection is decided
133
+ * during hydration (a tab read from the URL) its first frame can stick, leaving the line
134
+ * under the wrong tab.
135
+ */
136
+ &[data-selected="true"]:not(:has(.tabs__indicator))::after {
137
+ content: '';
138
+ @apply absolute inset-x-0 bottom-0 h-0.5 bg-accent;
139
+ }
116
140
  }
117
141
  }
118
142
  }
119
143
 
120
- .card {
121
- @apply border border-border shadow-none;
122
- }
144
+ /*
145
+ * The primary table as one flat card: a hairline frame, a header band and row dividers, instead
146
+ * of HeroUI's grey frame with a white card inset in it — which on a tinted page reads as a box
147
+ * in a box. Rows get a visible hover, since the default (`surface` at 40%) vanishes on white.
148
+ */
149
+ .table-root--primary {
150
+ @apply border border-border bg-surface p-0;
151
+
152
+ border-radius: var(--radius-3xl);
153
+ box-shadow: var(--fragment-card-shadow, none);
123
154
 
124
- .button {
125
- &.button--md:not(.button--icon-only) {
126
- @apply h-12 px-6;
155
+ .table__column {
156
+ @apply py-2.5 whitespace-nowrap;
127
157
 
128
- @media (width >= 48rem) {
129
- @apply h-12 px-6;
158
+ &::after {
159
+ content: none;
130
160
  }
131
161
  }
162
+
163
+ .table__header {
164
+ @apply border-b border-separator;
165
+ }
166
+
167
+ .table__body tr td {
168
+ border-radius: 0 !important;
169
+ }
170
+
171
+ .table__cell {
172
+ @apply border-b border-separator;
173
+ }
174
+
175
+ .table__body tr:last-child .table__cell {
176
+ @apply border-b-0;
177
+ }
178
+
179
+ .table__row {
180
+ @media (hover: hover) {
181
+ &:hover .table__cell,
182
+ &[data-hovered="true"] .table__cell {
183
+ @apply bg-surface-secondary;
184
+ }
185
+ }
186
+ }
187
+
188
+ .table__footer {
189
+ @apply border-t border-separator;
190
+ }
191
+ }
192
+
193
+ /*
194
+ * Cards sit apart from the page by a hairline and an optional, very soft lift. The lift is a
195
+ * token so a theme on a white page (where the border is all there is) can turn it off.
196
+ */
197
+ .card {
198
+ @apply border border-border;
199
+
200
+ box-shadow: var(--fragment-card-shadow, none);
132
201
  }
133
202
  }
134
203
 
@@ -139,10 +208,15 @@
139
208
  @import "./fragments/widget/widget.css";
140
209
  @import "./components/grid/grid.css";
141
210
  @import "./components/multi-switch/multi-switch.css";
211
+ @import "./components/segmented-control/segmented-control.css";
142
212
  @import "./components/code/code.css";
143
213
  @import "./components/code-snippet/code-snippet.css";
144
214
  @import "./fragments/form/form.css";
145
215
  @import "./fragments/form/form-section.css";
216
+ @import "./fragments/form/form-card.css";
217
+ @import "./fragments/save-bar/save-bar.css";
218
+ @import "./fragments/stat/stat-card.css";
219
+ @import "./fragments/empty-state/empty-state.css";
146
220
 
147
221
  .light,
148
222
  .default,