@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.
- package/components/code-snippet/CodeSnippet.d.ts +9 -0
- package/components/code-snippet/CodeSnippet.js +14 -4
- package/components/code-snippet/CodeSnippet.js.map +1 -1
- package/components/code-snippet/code-snippet.css +18 -0
- package/components/segmented-control/SegmentedControl.d.ts +16 -0
- package/components/segmented-control/SegmentedControl.js +18 -0
- package/components/segmented-control/SegmentedControl.js.map +1 -0
- package/components/segmented-control/SegmentedControl.styles.d.ts +46 -0
- package/components/segmented-control/SegmentedControl.styles.js +20 -0
- package/components/segmented-control/SegmentedControl.styles.js.map +1 -0
- package/components/segmented-control/segmented-control.css +41 -0
- package/fragments/empty-state/EmptyState.d.ts +12 -0
- package/fragments/empty-state/EmptyState.js +12 -0
- package/fragments/empty-state/EmptyState.js.map +1 -0
- package/fragments/empty-state/EmptyState.styles.d.ts +55 -0
- package/fragments/empty-state/EmptyState.styles.js +23 -0
- package/fragments/empty-state/EmptyState.styles.js.map +1 -0
- package/fragments/empty-state/empty-state.css +39 -0
- package/fragments/form/FormCard.d.ts +14 -0
- package/fragments/form/FormCard.js +14 -0
- package/fragments/form/FormCard.js.map +1 -0
- package/fragments/form/FormCard.styles.d.ts +49 -0
- package/fragments/form/FormCard.styles.js +23 -0
- package/fragments/form/FormCard.styles.js.map +1 -0
- package/fragments/form/FormSection.d.ts +3 -1
- package/fragments/form/FormSection.js +2 -2
- package/fragments/form/FormSection.js.map +1 -1
- package/fragments/form/FormSection.styles.d.ts +6 -0
- package/fragments/form/FormSection.styles.js +2 -0
- package/fragments/form/FormSection.styles.js.map +1 -1
- package/fragments/form/form-card.css +42 -0
- package/fragments/form/form-section.css +22 -10
- package/fragments/form/form.css +1 -1
- package/fragments/page/PageHeader.d.ts +7 -2
- package/fragments/page/PageHeader.js +3 -3
- package/fragments/page/PageHeader.js.map +1 -1
- package/fragments/page/PageHeader.styles.d.ts +30 -21
- package/fragments/page/PageHeader.styles.js +10 -0
- package/fragments/page/PageHeader.styles.js.map +1 -1
- package/fragments/page/page-header.css +23 -3
- package/fragments/save-bar/SaveBar.d.ts +12 -0
- package/fragments/save-bar/SaveBar.js +15 -0
- package/fragments/save-bar/SaveBar.js.map +1 -0
- package/fragments/save-bar/SaveBar.styles.d.ts +37 -0
- package/fragments/save-bar/SaveBar.styles.js +16 -0
- package/fragments/save-bar/SaveBar.styles.js.map +1 -0
- package/fragments/save-bar/save-bar.css +28 -0
- package/fragments/shell/shell.css +8 -4
- package/fragments/sidebar/Sidebar.js +4 -1
- package/fragments/sidebar/Sidebar.js.map +1 -1
- package/fragments/sidebar/sidebar.css +41 -24
- package/fragments/stat/StatCard.d.ts +29 -0
- package/fragments/stat/StatCard.js +20 -0
- package/fragments/stat/StatCard.js.map +1 -0
- package/fragments/stat/StatCard.styles.d.ts +85 -0
- package/fragments/stat/StatCard.styles.js +26 -0
- package/fragments/stat/StatCard.styles.js.map +1 -0
- package/fragments/stat/stat-card.css +64 -0
- package/fragments/widget/Widget.d.ts +9 -2
- package/fragments/widget/Widget.js +4 -3
- package/fragments/widget/Widget.js.map +1 -1
- package/fragments/widget/Widget.styles.d.ts +51 -0
- package/fragments/widget/Widget.styles.js +12 -0
- package/fragments/widget/Widget.styles.js.map +1 -1
- package/fragments/widget/widget.css +49 -4
- package/index.css +112 -38
- package/index.d.ts +5 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/code-snippet/code-snippet.css +18 -0
- package/src/components/segmented-control/segmented-control.css +41 -0
- package/src/fragments/empty-state/empty-state.css +39 -0
- package/src/fragments/form/form-card.css +42 -0
- package/src/fragments/form/form-section.css +22 -10
- package/src/fragments/form/form.css +1 -1
- package/src/fragments/page/page-header.css +23 -3
- package/src/fragments/save-bar/save-bar.css +28 -0
- package/src/fragments/shell/shell.css +8 -4
- package/src/fragments/sidebar/sidebar.css +41 -24
- package/src/fragments/stat/stat-card.css +64 -0
- package/src/fragments/widget/widget.css +49 -4
- package/src/index.css +112 -38
package/src/index.css
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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-
|
|
36
|
+
@apply text-2xl font-semibold tracking-tight;
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
h2 {
|
|
31
|
-
@apply text-
|
|
40
|
+
@apply text-lg font-semibold tracking-tight;
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
h3 {
|
|
35
|
-
@apply text-
|
|
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
|
|
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
|
|
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-
|
|
84
|
-
|
|
85
|
-
border-radius: calc(var(--radius-
|
|
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
|
|
94
|
+
@apply bg-surface shadow-sm;
|
|
90
95
|
}
|
|
91
96
|
|
|
92
97
|
.tabs__tab {
|
|
93
98
|
&[data-selected="true"] {
|
|
94
|
-
@apply text-surface-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
121
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
@apply h-12 px-6;
|
|
155
|
+
.table__column {
|
|
156
|
+
@apply py-2.5 whitespace-nowrap;
|
|
127
157
|
|
|
128
|
-
|
|
129
|
-
|
|
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,
|