@heyramzi/ui 1.53.0 → 1.54.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.md +6 -0
- package/package.json +2 -2
- package/scripts/lib/sync-core.mjs +1 -1
- package/scripts/sync-shadcn.mjs +11 -11
- package/scripts/sync-transitions.mjs +7 -7
- package/src/agents/agent-avatar.svelte +14 -15
- package/src/agents/agent-cast.svelte +2 -2
- package/src/agents/demo.svelte +1 -1
- package/src/agents/helpers.ts +10 -1
- package/src/agents/index.ts +2 -2
- package/src/agents/page-state.ts +1 -1
- package/src/agents/types.ts +3 -3
- package/src/components/copy/copy-button.test.ts +3 -1
- package/src/components/data-table/infinite-scroll.svelte +1 -1
- package/src/components/data-table/pagination.svelte +1 -1
- package/src/components/data-table/row-arrow.svelte +1 -1
- package/src/components/data-table/row-context-menu.svelte +1 -1
- package/src/components/data-table/sortable-head.svelte +2 -2
- package/src/components/data-table/table-skeleton.svelte +1 -1
- package/src/components/docs/doc-page.svelte +161 -0
- package/src/components/docs/index.ts +12 -0
- package/src/components/docs/on-this-page.svelte +217 -0
- package/src/components/docs/scroll-spy.svelte.ts +97 -0
- package/src/components/field-row/field-row.svelte +57 -0
- package/src/components/field-row/index.ts +1 -0
- package/src/components/hold-to-confirm/hold-to-confirm.svelte +2 -2
- package/src/components/icon/icon.svelte +1 -1
- package/src/components/list-page/detail-empty.svelte +1 -1
- package/src/components/list-page/detail-header.svelte +1 -1
- package/src/components/list-page/detail-panel.svelte +1 -1
- package/src/components/list-page/detail-row.svelte +1 -1
- package/src/components/list-page/detail-stack.svelte +1 -1
- package/src/components/list-page/filter-item.svelte +1 -1
- package/src/components/list-page/filter-popover.svelte +1 -1
- package/src/components/list-page/grouped-list.svelte +1 -1
- package/src/components/list-page/list-page-shell.svelte +1 -1
- package/src/components/list-page/master-detail.svelte +1 -1
- package/src/components/list-page/prev-next.svelte +1 -1
- package/src/components/list-page/rail-body.svelte +1 -1
- package/src/components/list-page/rail-head.svelte +1 -1
- package/src/components/list-page/rail-row.svelte +1 -1
- package/src/components/list-page/section-label.svelte +1 -1
- package/src/components/list-page/toolbar-search.svelte +2 -2
- package/src/components/list-page/toolbar-trigger.ts +1 -1
- package/src/components/locale-switch/locale-switch.svelte +1 -1
- package/src/components/mark/mark.svelte +1 -1
- package/src/components/picker/mark-picker.svelte +1 -1
- package/src/components/picker/picker.svelte +1 -1
- package/src/components/picker/trigger.ts +2 -2
- package/src/components/section-card/index.ts +1 -0
- package/src/components/section-card/section-card.svelte +43 -0
- package/src/components/section-header/index.ts +1 -0
- package/src/components/section-header/section-header.svelte +54 -0
- package/src/components/section-header/section-header.test.ts +25 -0
- package/src/components/segmented/animated-tabs.svelte +2 -2
- package/src/components/segmented/collapse.test.ts +10 -0
- package/src/components/segmented/collapse.ts +5 -0
- package/src/components/segmented/segment.svelte +2 -2
- package/src/components/segmented/segmented-filter.svelte +6 -5
- package/src/components/segmented/segmented-nav.svelte +1 -1
- package/src/components/segmented/segmented-overflow.svelte +1 -1
- package/src/components/segmented/segmented-track.svelte +29 -4
- package/src/components/segmented/segmented.test.ts +1 -1
- package/src/components/segmented/segmented.ts +2 -2
- package/src/components/star-rating-input/star-rating-input.svelte +11 -4
- package/src/components/table-view/index.ts +3 -0
- package/src/components/table-view/table-view.svelte +103 -0
- package/src/components/table-view/table-view.test.ts +53 -0
- package/src/components/table-view/types.ts +14 -0
- package/src/components/theme/index.ts +17 -0
- package/src/components/theme/theme-provider.svelte +47 -0
- package/src/components/theme/theme-provider.test.ts +61 -0
- package/src/effects/animated-beam/diagrams/BeamSvg.svelte +1 -1
- package/src/effects/animated-beam/path-calculator.svelte.ts +1 -1
- package/src/effects/border-beam/types.ts +1 -1
- package/src/effects/interactive-hover-button/InteractiveHoverButton.svelte +1 -1
- package/src/effects/shader-gradient/shaders.ts +1 -1
- package/src/effects/spotlight/Spotlight.svelte +1 -2
- package/src/icons/trades.ts +3 -3
- package/src/lib/sliding-pill.ts +3 -3
- package/src/lib/tone.test.ts +10 -0
- package/src/lib/tone.ts +1 -1
- package/src/shadcn/badge/badge.svelte +1 -1
- package/src/shadcn/button/button.svelte +10 -1
- package/src/shadcn/button/button.test.ts +19 -0
- package/src/shadcn/checkbox/checkbox.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-separator.svelte +4 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-separator.svelte +4 -1
- package/src/shadcn/input/input.svelte +2 -2
- package/src/shadcn/progress/progress.svelte +8 -2
- package/src/shadcn/progress/tone.test.ts +13 -0
- package/src/shadcn/progress/tone.ts +15 -0
- package/src/shadcn/sidebar/sidebar-group-label.svelte +1 -1
- package/src/shadcn/table/table-cell.svelte +21 -1
- package/src/shadcn/table/table-cell.test.ts +16 -0
- package/src/tokens/base.css +183 -0
- package/src/tokens/craft.css +179 -0
- package/src/tokens/index.css +19 -0
- package/src/tokens/palette.css +410 -0
- package/src/tokens/primitives.css +223 -0
- package/scripts/relative-imports.mjs +0 -39
- package/src/tokens.css +0 -993
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/* The bits-ui state variants every primitive in `./shadcn` is written against.
|
|
2
|
+
*
|
|
3
|
+
* bits-ui v2 writes `data-checked` / `data-open` and v1 wrote
|
|
4
|
+
* `data-state="checked"`, so each variant matches both and a component does not
|
|
5
|
+
* have to know which it is talking to. They live here rather than in a
|
|
6
|
+
* consumer's stylesheet because the classes that need them ship in this
|
|
7
|
+
* package: an app that defines only the palette would render a switch that
|
|
8
|
+
* never moves. */
|
|
9
|
+
@custom-variant data-open {
|
|
10
|
+
&:where([data-state="open"]),
|
|
11
|
+
&:where([data-open]:not([data-open="false"])) {
|
|
12
|
+
@slot;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@custom-variant data-closed {
|
|
17
|
+
&:where([data-state="closed"]),
|
|
18
|
+
&:where([data-closed]:not([data-closed="false"])) {
|
|
19
|
+
@slot;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@custom-variant data-checked {
|
|
24
|
+
&:where([data-state="checked"]),
|
|
25
|
+
&:where([data-checked]:not([data-checked="false"])) {
|
|
26
|
+
@slot;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@custom-variant data-unchecked {
|
|
31
|
+
&:where([data-state="unchecked"]),
|
|
32
|
+
&:where([data-unchecked]:not([data-unchecked="false"])) {
|
|
33
|
+
@slot;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@custom-variant data-selected {
|
|
38
|
+
&:where([data-selected]) {
|
|
39
|
+
@slot;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@custom-variant data-disabled {
|
|
44
|
+
&:where([data-disabled="true"]),
|
|
45
|
+
&:where([data-disabled]:not([data-disabled="false"])) {
|
|
46
|
+
@slot;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@custom-variant data-active {
|
|
51
|
+
&:where([data-state="active"]),
|
|
52
|
+
&:where([data-active]:not([data-active="false"])) {
|
|
53
|
+
@slot;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@custom-variant data-horizontal {
|
|
58
|
+
&:where([data-orientation="horizontal"]) {
|
|
59
|
+
@slot;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@custom-variant data-vertical {
|
|
64
|
+
&:where([data-orientation="vertical"]) {
|
|
65
|
+
@slot;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@layer base {
|
|
70
|
+
/* One ring for the whole kit. `:where` keeps it at specificity zero on top of
|
|
71
|
+
the layer, so a control that needs a different ring writes one and wins. */
|
|
72
|
+
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
|
|
73
|
+
outline: none;
|
|
74
|
+
box-shadow: var(--ring-focus);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* The accent at a low alpha, not the browser blue, because a selected word is
|
|
78
|
+
the one moment the palette shows up inside running text. */
|
|
79
|
+
::selection {
|
|
80
|
+
background: color-mix(in oklab, var(--ring-color) 24%, transparent);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* A default macOS overlay scrollbar paints a black bar on a dark panel. Track
|
|
84
|
+
transparent, thumb on the line token, so it belongs to whatever surface it
|
|
85
|
+
is over. The border is what insets the thumb without a second element. */
|
|
86
|
+
:where(html) {
|
|
87
|
+
scrollbar-color: var(--color-border, var(--border)) transparent;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
::-webkit-scrollbar {
|
|
91
|
+
width: 10px;
|
|
92
|
+
height: 10px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
::-webkit-scrollbar-track {
|
|
96
|
+
background: transparent;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
::-webkit-scrollbar-thumb {
|
|
100
|
+
border: 3px solid transparent;
|
|
101
|
+
background-clip: padding-box;
|
|
102
|
+
border-radius: 999px;
|
|
103
|
+
background-color: var(--color-border, var(--border));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media (hover: hover) and (pointer: fine) {
|
|
107
|
+
::-webkit-scrollbar-thumb:hover {
|
|
108
|
+
background-color: var(--color-muted-foreground, var(--muted-foreground));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@layer components {
|
|
114
|
+
/* Three moves the kit repeats. They are classes rather than tokens because a
|
|
115
|
+
component wants one name, not four declarations, and because the reduced
|
|
116
|
+
motion guard then lives in one place instead of in every component.
|
|
117
|
+
|
|
118
|
+
Namespaced `t-` to match the transitions-dev snippets, which these sit
|
|
119
|
+
beside rather than duplicate. */
|
|
120
|
+
|
|
121
|
+
/* A control that reads as a key: it travels down a pixel under the finger.
|
|
122
|
+
The travel is what sells it, because a colour change alone reads as a hover
|
|
123
|
+
state, not as a press. */
|
|
124
|
+
.t-press {
|
|
125
|
+
transition:
|
|
126
|
+
background-color var(--duration-quick) var(--ease-smooth-out),
|
|
127
|
+
border-color var(--duration-quick) var(--ease-smooth-out),
|
|
128
|
+
color var(--duration-quick) var(--ease-smooth-out),
|
|
129
|
+
box-shadow var(--duration-quick) var(--ease-smooth-out),
|
|
130
|
+
transform var(--duration-micro) var(--ease-smooth-out);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.t-press:active:not(:disabled, [aria-disabled="true"]) {
|
|
134
|
+
transform: translateY(1px);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* A card that answers the pointer. It rises by a pixel and gains the next
|
|
138
|
+
step of elevation, so the hover reads as the card coming forward rather
|
|
139
|
+
than as its border changing colour. */
|
|
140
|
+
.t-lift {
|
|
141
|
+
transition:
|
|
142
|
+
box-shadow var(--duration-fast) var(--ease-smooth-out),
|
|
143
|
+
transform var(--duration-fast) var(--ease-smooth-out);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* Only where a pointer hovers: on a phone a tap would leave the card lifted. */
|
|
147
|
+
@media (hover: hover) and (pointer: fine) {
|
|
148
|
+
.t-lift:hover {
|
|
149
|
+
transform: translateY(-1px);
|
|
150
|
+
box-shadow: var(--elev-raised);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* A surface arriving. The open carries the distance, the scale and the blur;
|
|
155
|
+
the close drops all three and takes less time, per the open/close
|
|
156
|
+
asymmetry rule in transitions-dev. */
|
|
157
|
+
.t-enter {
|
|
158
|
+
animation: t-enter var(--duration-fast) var(--ease-smooth-out) both;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.t-exit {
|
|
162
|
+
animation: t-exit var(--duration-quick) var(--ease-smooth-out) both;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@media (prefers-reduced-motion: reduce) {
|
|
166
|
+
.t-press,
|
|
167
|
+
.t-lift {
|
|
168
|
+
transition: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.t-press:active {
|
|
172
|
+
transform: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@media (hover: hover) and (pointer: fine) {
|
|
176
|
+
.t-lift:hover {
|
|
177
|
+
transform: none;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.t-enter,
|
|
182
|
+
.t-exit {
|
|
183
|
+
animation-duration: 1ms;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@keyframes t-enter {
|
|
189
|
+
from {
|
|
190
|
+
opacity: 0;
|
|
191
|
+
transform: translateY(var(--distance-micro)) scale(var(--scale-medium));
|
|
192
|
+
filter: blur(var(--blur-small));
|
|
193
|
+
}
|
|
194
|
+
to {
|
|
195
|
+
opacity: 1;
|
|
196
|
+
transform: none;
|
|
197
|
+
filter: none;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* A mark confirming a state that has already changed: it arrives after the box
|
|
202
|
+
it sits in, so it grows into place instead of fading. */
|
|
203
|
+
@keyframes t-check {
|
|
204
|
+
from {
|
|
205
|
+
opacity: 0;
|
|
206
|
+
transform: scale(0.4);
|
|
207
|
+
}
|
|
208
|
+
to {
|
|
209
|
+
opacity: 1;
|
|
210
|
+
transform: scale(1);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@keyframes t-exit {
|
|
215
|
+
from {
|
|
216
|
+
opacity: 1;
|
|
217
|
+
transform: none;
|
|
218
|
+
}
|
|
219
|
+
to {
|
|
220
|
+
opacity: 0;
|
|
221
|
+
transform: scale(var(--scale-tiny));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Rewrites every `#src/` and `#scripts/` specifier to a relative path, in place, before publish.
|
|
2
|
-
// WHY: Vite cannot resolve a package's own `#` imports inside node_modules (ai-doc/references/publishing-packages.md).
|
|
3
|
-
// It edits the source tree, so only scripts/release.sh runs it, right before `pnpm publish`, and restores the tree after.
|
|
4
|
-
// It is not a `build` script: `pnpm -r build` would rewrite the working tree.
|
|
5
|
-
import { readdir, readFile, writeFile } from "node:fs/promises";
|
|
6
|
-
import { dirname, join, relative, resolve } from "node:path";
|
|
7
|
-
|
|
8
|
-
const root = resolve(import.meta.dirname, "..");
|
|
9
|
-
const targets = { src: join(root, "src"), scripts: join(root, "scripts") };
|
|
10
|
-
const TEXT = /\.(ts|js|mjs|svelte|css)$/;
|
|
11
|
-
const SPECIFIER = /(["'`])#(src|scripts)\/([^"'`]+)\1/g;
|
|
12
|
-
|
|
13
|
-
async function* walk(dir) {
|
|
14
|
-
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
15
|
-
if (entry.name === "node_modules") continue;
|
|
16
|
-
const full = join(dir, entry.name);
|
|
17
|
-
if (entry.isDirectory()) yield* walk(full);
|
|
18
|
-
else if (TEXT.test(entry.name)) yield full;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let files = 0;
|
|
23
|
-
let specifiers = 0;
|
|
24
|
-
for (const dir of Object.values(targets)) {
|
|
25
|
-
for await (const file of walk(dir)) {
|
|
26
|
-
const text = await readFile(file, "utf8");
|
|
27
|
-
const next = text.replace(SPECIFIER, (_, quote, base, rest) => {
|
|
28
|
-
specifiers++;
|
|
29
|
-
let rel = relative(dirname(file), join(targets[base], rest));
|
|
30
|
-
if (!rel.startsWith(".")) rel = `./${rel}`;
|
|
31
|
-
return `${quote}${rel}${quote}`;
|
|
32
|
-
});
|
|
33
|
-
if (next !== text) {
|
|
34
|
-
await writeFile(file, next);
|
|
35
|
-
files++;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
console.log(`relative-imports: ${specifiers} specifiers in ${files} files`);
|