@siyahi/ui 0.1.9-next.23 → 0.1.9-next.24

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.
@@ -2,12 +2,17 @@ import { Delta } from "@siyahi/ui";
2
2
 
3
3
  export default function DeltaExample() {
4
4
  return (
5
- <div className="flex flex-wrap items-center gap-6">
6
- <Delta value={0.0234} />
7
- <Delta value={-0.0108} />
8
- <Delta value={0} />
9
- <Delta value={18250} format="money" />
10
- <Delta value={-4300} format="money" />
5
+ <div className="flex flex-col gap-4">
6
+ <div className="flex flex-wrap items-center gap-6">
7
+ <Delta value={0.0234} />
8
+ <Delta value={-0.0108} />
9
+ <Delta value={0} />
10
+ <Delta value={18250} format="money" />
11
+ <Delta value={-4300} format="money" />
12
+ </div>
13
+ <p>
14
+ Revenue was <Delta value={0.031} /> on last month, and refunds <Delta value={-1200} format="money" />.
15
+ </p>
11
16
  </div>
12
17
  );
13
18
  }
@@ -17,11 +17,11 @@ function Delta({ value, format = "pct", className }) {
17
17
  return /* @__PURE__ */ jsxs("span", {
18
18
  "data-slot": "delta",
19
19
  "data-direction": direction,
20
- className: cn("inline-flex items-center gap-1 whitespace-nowrap", className),
20
+ className: cn("inline-flex items-baseline gap-1 whitespace-nowrap", className),
21
21
  children: [
22
22
  /* @__PURE__ */ jsx(Icon, {
23
23
  "aria-hidden": "true",
24
- className: cn("size-3.5 shrink-0", direction === "up" && "text-positive", direction === "down" && "text-negative", direction === "none" && "text-muted-foreground")
24
+ className: cn("size-3.5 shrink-0 self-center", direction === "up" && "text-positive", direction === "down" && "text-negative", direction === "none" && "text-muted-foreground")
25
25
  }),
26
26
  direction === "up" ? "+" : direction === "down" ? MINUS : "",
27
27
  size
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siyahi/ui",
3
- "version": "0.1.9-next.23",
3
+ "version": "0.1.9-next.24",
4
4
  "description": "Stock shadcn/ui on Base UI and Tailwind v4, a finance theme, a few compositions and formatters.",
5
5
  "keywords": [
6
6
  "base-ui",
package/styles/siyahi.css CHANGED
@@ -237,9 +237,11 @@
237
237
  * --input is the edge of a field, where the reader types or picks. A button,
238
238
  * a toggle and a code block are framed by their label or their content, so
239
239
  * their outline stays the faint divider colour; scoping the variable keeps
240
- * the fill each derives from it faint too.
240
+ * the fill each derives from it faint too. A button is matched by its own
241
+ * group/button class: rendered as a popover or menu trigger, it takes that
242
+ * trigger's data-slot instead of "button".
241
243
  */
242
- :is([data-slot="button"], [data-slot="toggle"], [data-slot="toggle-group-item"], [data-slot="code-block"]) {
244
+ :is([class~="group/button"], [data-slot="toggle"], [data-slot="toggle-group-item"], [data-slot="code-block"]) {
243
245
  --input: var(--border);
244
246
  }
245
247
 
@@ -263,7 +265,7 @@
263
265
  * hidden range input, so it shows the input's focus.
264
266
  */
265
267
  :is([data-slot="toggle"], [data-slot="toggle-group-item"], [data-slot="scroll-area-viewport"]):focus-visible,
266
- [data-slot="button"][data-day]:focus-visible {
268
+ [class~="group/button"][data-day]:focus-visible {
267
269
  --tw-ring-color: var(--ring);
268
270
  }
269
271
  [data-slot="slider-thumb"]:has(input:focus-visible) {
@@ -274,13 +276,13 @@
274
276
  * A destructive control focuses, and an invalid field is edged, in the full
275
277
  * destructive colour; stock fades both to 40-50%, under 3:1.
276
278
  */
277
- [data-slot="button"][class~="text-destructive"]:focus-visible,
279
+ [class~="group/button"][class~="text-destructive"]:focus-visible,
278
280
  [data-slot="code-block"][data-variant="destructive"]:has(> [data-slot="code-block-content"]:focus-visible),
279
281
  :is(
280
282
  [data-slot="input"],
281
283
  [data-slot="textarea"],
282
284
  [data-slot="select-trigger"],
283
- [data-slot="button"]
285
+ [class~="group/button"]
284
286
  )[aria-invalid="true"],
285
287
  [data-slot="input-group"]:has([data-slot][aria-invalid="true"]) {
286
288
  border-color: var(--destructive);