@asanchez-sa/abby 0.1.3 → 0.3.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/README.md +1 -1
- package/dist/components/alert/alert.d.ts +1 -1
- package/dist/components/alert/alert.js +2 -1
- package/dist/components/alert-dialog/alert-dialog.d.ts +10 -1
- package/dist/components/alert-dialog/alert-dialog.js +80 -3
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +3 -2
- package/dist/components/dialog/dialog.d.ts +9 -1
- package/dist/components/dialog/dialog.js +82 -3
- package/dist/components/field/field.d.ts +5 -1
- package/dist/components/field/field.js +25 -21
- package/dist/components/input/input.d.ts +12 -2
- package/dist/components/input/input.js +33 -18
- package/dist/components/meter/meter.d.ts +52 -3
- package/dist/components/meter/meter.js +535 -33
- package/dist/components/note-editor/parts/suggestions.js +2 -2
- package/dist/components/otp-input/otp-input.d.ts +14 -4
- package/dist/components/otp-input/otp-input.js +74 -39
- package/dist/components/sheet/sheet.js +1 -1
- package/dist/components/switch/switch.d.ts +9 -2
- package/dist/components/switch/switch.js +23 -17
- package/dist/components/team-mark/team-mark.d.ts +26 -0
- package/dist/components/team-mark/team-mark.js +101 -0
- package/package.json +2 -1
- package/skills/agent-ready-ui/SKILL.md +1 -1
- package/skills/blocks/SKILL.md +1 -1
- package/skills/compose-screens/SKILL.md +89 -5
- package/skills/note-editor/SKILL.md +1 -1
- package/skills/note-status/SKILL.md +1 -1
- package/skills/setup/SKILL.md +1 -1
- package/skills/theming/SKILL.md +1 -1
- package/src/blocks/shell/parts/marks.tsx +18 -4
- package/src/blocks/shell/parts/rail.tsx +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cnState } from "../../utilities/cn/index.js";
|
|
2
|
+
import { cnState, cva } from "../../utilities/cn/index.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { OTPInput as OTPInput$1, OTPInputGroup as OTPInputGroup$1, OTPInputSeparator as OTPInputSeparator$1, OTPInputSlot as OTPInputSlot$1, createOTPInputController } from "@ui-sdk/react/otp-input";
|
|
@@ -19,7 +19,7 @@ function OTPInput(t0) {
|
|
|
19
19
|
}
|
|
20
20
|
let t1;
|
|
21
21
|
if ($[3] !== className) {
|
|
22
|
-
t1 = cnState("group/otp-input flex w-fit items-center gap-2 data-disabled:cursor-not-allowed data-disabled:opacity-50", className);
|
|
22
|
+
t1 = cnState("group/otp-input flex w-fit items-center gap-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 has-data-[size=lg]:gap-3", className);
|
|
23
23
|
$[3] = className;
|
|
24
24
|
$[4] = t1;
|
|
25
25
|
} else t1 = $[4];
|
|
@@ -50,7 +50,7 @@ function OTPInputGroup(t0) {
|
|
|
50
50
|
}
|
|
51
51
|
let t1;
|
|
52
52
|
if ($[3] !== className) {
|
|
53
|
-
t1 = cnState("flex items-center gap-1.5", className);
|
|
53
|
+
t1 = cnState("flex items-center gap-1.5 has-data-[size=lg]:gap-2", className);
|
|
54
54
|
$[3] = className;
|
|
55
55
|
$[4] = t1;
|
|
56
56
|
} else t1 = $[4];
|
|
@@ -66,71 +66,106 @@ function OTPInputGroup(t0) {
|
|
|
66
66
|
} else t2 = $[7];
|
|
67
67
|
return t2;
|
|
68
68
|
}
|
|
69
|
+
const otpInputSlotVariants = cva([
|
|
70
|
+
"relative flex items-center justify-center rounded-full border border-input bg-transparent transition-colors data-disabled:bg-input/50 dark:bg-input/30",
|
|
71
|
+
"outline-3 outline-offset-0 outline-transparent data-active:border-(--focus-ring,var(--ring)) data-active:outline-(--focus-halo)",
|
|
72
|
+
"group-has-aria-invalid/otp-input:border-destructive group-has-aria-invalid/otp-input:ring-3 group-has-aria-invalid/otp-input:ring-destructive/20 group-has-aria-invalid/otp-input:data-active:border-destructive group-has-aria-invalid/otp-input:data-active:outline-transparent",
|
|
73
|
+
"after:pointer-events-none after:absolute after:hidden after:w-px after:bg-foreground data-fake-caret:after:block data-fake-caret:after:caret-blink"
|
|
74
|
+
], {
|
|
75
|
+
variants: { size: {
|
|
76
|
+
default: "size-9 text-base after:h-4 md:text-sm",
|
|
77
|
+
lg: "size-12 text-xl leading-6 tabular-nums after:h-5"
|
|
78
|
+
} },
|
|
79
|
+
defaultVariants: { size: "default" }
|
|
80
|
+
});
|
|
69
81
|
/**
|
|
70
82
|
* One cell, with the look of `Input`: a one-character field, so a circle. The one real input sits over all the
|
|
71
|
-
* cells and takes focus, so the active cell draws
|
|
72
|
-
* caret itself.
|
|
83
|
+
* cells and takes focus, so the active cell draws a field's focus and the
|
|
84
|
+
* caret itself. `size="lg"` is the 48px cell of a screen that asks only for
|
|
85
|
+
* the code; the default stays at a field's 36px.
|
|
73
86
|
*/
|
|
74
87
|
function OTPInputSlot(t0) {
|
|
75
|
-
const $ = c(
|
|
88
|
+
const $ = c(11);
|
|
76
89
|
let className;
|
|
77
90
|
let props;
|
|
91
|
+
let size;
|
|
78
92
|
if ($[0] !== t0) {
|
|
79
|
-
({className, ...props} = t0);
|
|
93
|
+
({className, size, ...props} = t0);
|
|
80
94
|
$[0] = t0;
|
|
81
95
|
$[1] = className;
|
|
82
96
|
$[2] = props;
|
|
97
|
+
$[3] = size;
|
|
83
98
|
} else {
|
|
84
99
|
className = $[1];
|
|
85
100
|
props = $[2];
|
|
101
|
+
size = $[3];
|
|
86
102
|
}
|
|
87
|
-
|
|
88
|
-
if ($[3] !== className) {
|
|
89
|
-
t1 = cnState("relative flex size-9 items-center justify-center rounded-full border border-input bg-transparent text-base transition-colors focus-outline group-has-aria-invalid/otp-input:border-destructive group-has-aria-invalid/otp-input:ring-3 group-has-aria-invalid/otp-input:ring-destructive/20 after:pointer-events-none after:absolute after:hidden after:h-4 after:w-px after:bg-foreground data-active:focus-mark data-disabled:bg-input/50 data-fake-caret:after:block data-fake-caret:after:caret-blink md:text-sm dark:bg-input/30", className);
|
|
90
|
-
$[3] = className;
|
|
91
|
-
$[4] = t1;
|
|
92
|
-
} else t1 = $[4];
|
|
103
|
+
const t1 = size ?? "default";
|
|
93
104
|
let t2;
|
|
94
|
-
if ($[
|
|
95
|
-
t2 =
|
|
96
|
-
|
|
105
|
+
if ($[4] !== className || $[5] !== size) {
|
|
106
|
+
t2 = cnState(otpInputSlotVariants({ size }), className);
|
|
107
|
+
$[4] = className;
|
|
108
|
+
$[5] = size;
|
|
109
|
+
$[6] = t2;
|
|
110
|
+
} else t2 = $[6];
|
|
111
|
+
let t3;
|
|
112
|
+
if ($[7] !== props || $[8] !== t1 || $[9] !== t2) {
|
|
113
|
+
t3 = /* @__PURE__ */ jsx(OTPInputSlot$1, {
|
|
114
|
+
"data-size": t1,
|
|
115
|
+
className: t2,
|
|
97
116
|
...props
|
|
98
117
|
});
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
|
|
103
|
-
|
|
118
|
+
$[7] = props;
|
|
119
|
+
$[8] = t1;
|
|
120
|
+
$[9] = t2;
|
|
121
|
+
$[10] = t3;
|
|
122
|
+
} else t3 = $[10];
|
|
123
|
+
return t3;
|
|
104
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* The mark between two groups. With no children it draws Alma's: a short
|
|
127
|
+
* 8px bar, 1.5px thick, in a faint gray. Children replace it whole.
|
|
128
|
+
*/
|
|
105
129
|
function OTPInputSeparator(t0) {
|
|
106
|
-
const $ = c(
|
|
130
|
+
const $ = c(12);
|
|
131
|
+
let children;
|
|
107
132
|
let className;
|
|
108
133
|
let props;
|
|
109
134
|
if ($[0] !== t0) {
|
|
110
|
-
({className, ...props} = t0);
|
|
135
|
+
({className, children, ...props} = t0);
|
|
111
136
|
$[0] = t0;
|
|
112
|
-
$[1] =
|
|
113
|
-
$[2] =
|
|
137
|
+
$[1] = children;
|
|
138
|
+
$[2] = className;
|
|
139
|
+
$[3] = props;
|
|
114
140
|
} else {
|
|
115
|
-
|
|
116
|
-
|
|
141
|
+
children = $[1];
|
|
142
|
+
className = $[2];
|
|
143
|
+
props = $[3];
|
|
117
144
|
}
|
|
118
145
|
let t1;
|
|
119
|
-
if ($[
|
|
146
|
+
if ($[4] !== className) {
|
|
120
147
|
t1 = cnState("flex items-center text-muted-foreground", className);
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
} else t1 = $[
|
|
148
|
+
$[4] = className;
|
|
149
|
+
$[5] = t1;
|
|
150
|
+
} else t1 = $[5];
|
|
124
151
|
let t2;
|
|
125
|
-
if ($[
|
|
126
|
-
t2 = /* @__PURE__ */ jsx(
|
|
127
|
-
|
|
128
|
-
...props
|
|
129
|
-
});
|
|
130
|
-
$[5] = props;
|
|
131
|
-
$[6] = t1;
|
|
152
|
+
if ($[6] !== children) {
|
|
153
|
+
t2 = children ?? /* @__PURE__ */ jsx("span", { className: "block h-[--spacing(0.375)] w-2 rounded-full bg-foreground/22" });
|
|
154
|
+
$[6] = children;
|
|
132
155
|
$[7] = t2;
|
|
133
156
|
} else t2 = $[7];
|
|
134
|
-
|
|
157
|
+
let t3;
|
|
158
|
+
if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
|
|
159
|
+
t3 = /* @__PURE__ */ jsx(OTPInputSeparator$1, {
|
|
160
|
+
className: t1,
|
|
161
|
+
...props,
|
|
162
|
+
children: t2
|
|
163
|
+
});
|
|
164
|
+
$[8] = props;
|
|
165
|
+
$[9] = t1;
|
|
166
|
+
$[10] = t2;
|
|
167
|
+
$[11] = t3;
|
|
168
|
+
} else t3 = $[11];
|
|
169
|
+
return t3;
|
|
135
170
|
}
|
|
136
171
|
export { OTPInput, OTPInputGroup, OTPInputSeparator, OTPInputSlot, createOTPInputController };
|
|
@@ -4,8 +4,8 @@ import { Icon } from "../icon/icon.js";
|
|
|
4
4
|
import { buttonLook } from "../button/button.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Cancel01Icon } from "@hugeicons/core-free-icons";
|
|
8
7
|
import { Dialog, DialogBackdrop, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger, createDialogController } from "@ui-sdk/react/dialog";
|
|
8
|
+
import { Cancel01Icon } from "@hugeicons/core-free-icons";
|
|
9
9
|
// src/components/sheet/sheet.tsx
|
|
10
10
|
function Sheet(props) {
|
|
11
11
|
const $ = c(2);
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
2
|
import { Switch as Switch$1, SwitchThumb as SwitchThumb$1, createSwitchController } from "@ui-sdk/react/switch";
|
|
3
|
-
|
|
3
|
+
type SwitchProps = ComponentProps<typeof Switch$1> & {
|
|
4
|
+
/**
|
|
5
|
+
* `sm` is Alma's mini switch, 30×18 with a 14px thumb, for dense rows like
|
|
6
|
+
* a list of models. Its touch area still reaches 54×34.
|
|
7
|
+
*/
|
|
8
|
+
size?: "default" | "sm";
|
|
9
|
+
};
|
|
10
|
+
declare function Switch({ className, size, ...props }: SwitchProps): import("react").JSX.Element;
|
|
4
11
|
/** The thumb. It slides to the far end while the switch is on, mirrored under `dir="rtl"`. */
|
|
5
12
|
declare function SwitchThumb({ className, ...props }: ComponentProps<typeof SwitchThumb$1>): import("react").JSX.Element;
|
|
6
|
-
export { Switch, SwitchThumb, createSwitchController };
|
|
13
|
+
export { Switch, type SwitchProps, SwitchThumb, createSwitchController };
|
|
@@ -5,35 +5,41 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { Switch as Switch$1, SwitchThumb as SwitchThumb$1, createSwitchController } from "@ui-sdk/react/switch";
|
|
6
6
|
// src/components/switch/switch.tsx
|
|
7
7
|
function Switch(t0) {
|
|
8
|
-
const $ = c(
|
|
8
|
+
const $ = c(10);
|
|
9
9
|
let className;
|
|
10
10
|
let props;
|
|
11
|
+
let t1;
|
|
11
12
|
if ($[0] !== t0) {
|
|
12
|
-
({className, ...props} = t0);
|
|
13
|
+
({className, size: t1, ...props} = t0);
|
|
13
14
|
$[0] = t0;
|
|
14
15
|
$[1] = className;
|
|
15
16
|
$[2] = props;
|
|
17
|
+
$[3] = t1;
|
|
16
18
|
} else {
|
|
17
19
|
className = $[1];
|
|
18
20
|
props = $[2];
|
|
21
|
+
t1 = $[3];
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
if ($[3] !== className) {
|
|
22
|
-
t1 = cnState("peer relative inline-flex h-5 w-8 shrink-0 items-center rounded-full border border-transparent transition-colors focus-ring after:absolute after:-inset-x-3 after:-inset-y-2 data-checked:bg-brand data-disabled:cursor-not-allowed data-disabled:opacity-50 data-invalid:border-destructive data-invalid:ring-3 data-invalid:ring-destructive/20 data-unchecked:bg-input", className);
|
|
23
|
-
$[3] = className;
|
|
24
|
-
$[4] = t1;
|
|
25
|
-
} else t1 = $[4];
|
|
23
|
+
const size = t1 === void 0 ? "default" : t1;
|
|
26
24
|
let t2;
|
|
27
|
-
if ($[
|
|
28
|
-
t2 =
|
|
29
|
-
|
|
25
|
+
if ($[4] !== className) {
|
|
26
|
+
t2 = cnState("peer group/switch relative inline-flex h-5 w-8 shrink-0 items-center rounded-full border border-transparent transition-colors focus-ring after:absolute after:-inset-x-3 after:-inset-y-2 data-checked:bg-brand data-disabled:cursor-not-allowed data-disabled:opacity-50 data-invalid:border-destructive data-invalid:ring-3 data-invalid:ring-destructive/20 data-unchecked:bg-input data-[size=sm]:h-4.5 data-[size=sm]:w-7.5 data-[size=sm]:px-px", className);
|
|
27
|
+
$[4] = className;
|
|
28
|
+
$[5] = t2;
|
|
29
|
+
} else t2 = $[5];
|
|
30
|
+
let t3;
|
|
31
|
+
if ($[6] !== props || $[7] !== size || $[8] !== t2) {
|
|
32
|
+
t3 = /* @__PURE__ */ jsx(Switch$1, {
|
|
33
|
+
"data-size": size,
|
|
34
|
+
className: t2,
|
|
30
35
|
...props
|
|
31
36
|
});
|
|
32
|
-
$[
|
|
33
|
-
$[
|
|
34
|
-
$[
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
$[6] = props;
|
|
38
|
+
$[7] = size;
|
|
39
|
+
$[8] = t2;
|
|
40
|
+
$[9] = t3;
|
|
41
|
+
} else t3 = $[9];
|
|
42
|
+
return t3;
|
|
37
43
|
}
|
|
38
44
|
/** The thumb. It slides to the far end while the switch is on, mirrored under `dir="rtl"`. */
|
|
39
45
|
function SwitchThumb(t0) {
|
|
@@ -51,7 +57,7 @@ function SwitchThumb(t0) {
|
|
|
51
57
|
}
|
|
52
58
|
let t1;
|
|
53
59
|
if ($[3] !== className) {
|
|
54
|
-
t1 = cnState("pointer-events-none block size-4 rounded-full bg-background transition-transform ease-out data-checked:translate-x-[calc(100%-2px)] data-unchecked:translate-x-0 motion-reduce:transition-none rtl:data-checked:-translate-x-[calc(100%-2px)]", className);
|
|
60
|
+
t1 = cnState("pointer-events-none block size-4 rounded-full group-data-[size=sm]/switch:size-3.5 bg-background transition-transform ease-out data-checked:translate-x-[calc(100%-2px)] data-unchecked:translate-x-0 motion-reduce:transition-none rtl:data-checked:-translate-x-[calc(100%-2px)]", className);
|
|
55
61
|
$[3] = className;
|
|
56
62
|
$[4] = t1;
|
|
57
63
|
} else t1 = $[4];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
type TeamMarkProps = Omit<ComponentProps<"span">, "children" | "color"> & {
|
|
3
|
+
/** The team's name. The initials come from it when `initials` is missing. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Up to two letters drawn on the tile: "CN". */
|
|
6
|
+
initials?: string;
|
|
7
|
+
/** The team's color, any CSS color. Without one, the tile is Alma's neutral `track`. */
|
|
8
|
+
color?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A team's tile: its initials on Alma's 36px square with 10px corners. It has
|
|
12
|
+
* two looks, one per board in Paper:
|
|
13
|
+
*
|
|
14
|
+
* - With `color`, the rail's tile: the color at 22% over the surface and the
|
|
15
|
+
* letters the same color mixed toward the text's, at 12px. The surface is
|
|
16
|
+
* `--team-mark-surface`, the page's background by default: set it to
|
|
17
|
+
* `var(--sidebar)` on the sidebar's paper.
|
|
18
|
+
* - Without it, the tile of an invitation in Auth: Alma's neutral `track`
|
|
19
|
+
* with ink letters at 13px, for a team whose color the app doesn't know.
|
|
20
|
+
*
|
|
21
|
+
* It only repeats the name beside it (a row's title, a button's name), so it
|
|
22
|
+
* takes `aria-hidden`. Set the size with `className` (`size-full` to fill a
|
|
23
|
+
* button).
|
|
24
|
+
*/
|
|
25
|
+
declare function TeamMark({ name, initials, color, className, style, ...props }: TeamMarkProps): import("react").JSX.Element;
|
|
26
|
+
export { TeamMark, type TeamMarkProps };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utilities/cn/index.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/team-mark/team-mark.tsx
|
|
6
|
+
/** The first letter of the first and the last word: "Casa Norte" gives "CN". */
|
|
7
|
+
function initialsOf(name) {
|
|
8
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
9
|
+
return (words.length > 1 ? [words[0], words.at(-1)] : words).map((word) => word[0].toUpperCase()).join("");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A team's tile: its initials on Alma's 36px square with 10px corners. It has
|
|
13
|
+
* two looks, one per board in Paper:
|
|
14
|
+
*
|
|
15
|
+
* - With `color`, the rail's tile: the color at 22% over the surface and the
|
|
16
|
+
* letters the same color mixed toward the text's, at 12px. The surface is
|
|
17
|
+
* `--team-mark-surface`, the page's background by default: set it to
|
|
18
|
+
* `var(--sidebar)` on the sidebar's paper.
|
|
19
|
+
* - Without it, the tile of an invitation in Auth: Alma's neutral `track`
|
|
20
|
+
* with ink letters at 13px, for a team whose color the app doesn't know.
|
|
21
|
+
*
|
|
22
|
+
* It only repeats the name beside it (a row's title, a button's name), so it
|
|
23
|
+
* takes `aria-hidden`. Set the size with `className` (`size-full` to fill a
|
|
24
|
+
* button).
|
|
25
|
+
*/
|
|
26
|
+
function TeamMark(t0) {
|
|
27
|
+
const $ = c(22);
|
|
28
|
+
let className;
|
|
29
|
+
let color;
|
|
30
|
+
let initials;
|
|
31
|
+
let name;
|
|
32
|
+
let props;
|
|
33
|
+
let style;
|
|
34
|
+
if ($[0] !== t0) {
|
|
35
|
+
({name, initials, color, className, style, ...props} = t0);
|
|
36
|
+
$[0] = t0;
|
|
37
|
+
$[1] = className;
|
|
38
|
+
$[2] = color;
|
|
39
|
+
$[3] = initials;
|
|
40
|
+
$[4] = name;
|
|
41
|
+
$[5] = props;
|
|
42
|
+
$[6] = style;
|
|
43
|
+
} else {
|
|
44
|
+
className = $[1];
|
|
45
|
+
color = $[2];
|
|
46
|
+
initials = $[3];
|
|
47
|
+
name = $[4];
|
|
48
|
+
props = $[5];
|
|
49
|
+
style = $[6];
|
|
50
|
+
}
|
|
51
|
+
const t1 = color ? "team" : "neutral";
|
|
52
|
+
let t2;
|
|
53
|
+
if ($[7] !== className || $[8] !== color) {
|
|
54
|
+
t2 = cn("grid size-9 shrink-0 place-items-center rounded-lg font-semibold select-none", color ? [
|
|
55
|
+
"text-xs",
|
|
56
|
+
"bg-[color-mix(in_oklab,var(--team-color)_22%,var(--team-mark-surface,var(--background)))]",
|
|
57
|
+
"text-[color-mix(in_oklab,var(--team-color)_72%,var(--foreground))]",
|
|
58
|
+
"dark:text-[color-mix(in_oklab,var(--team-color)_64%,var(--foreground))]"
|
|
59
|
+
] : "bg-sidebar-accent text-sm leading-4 text-foreground", className);
|
|
60
|
+
$[7] = className;
|
|
61
|
+
$[8] = color;
|
|
62
|
+
$[9] = t2;
|
|
63
|
+
} else t2 = $[9];
|
|
64
|
+
let t3;
|
|
65
|
+
if ($[10] !== color || $[11] !== style) {
|
|
66
|
+
t3 = color ? {
|
|
67
|
+
"--team-color": color,
|
|
68
|
+
...style
|
|
69
|
+
} : style;
|
|
70
|
+
$[10] = color;
|
|
71
|
+
$[11] = style;
|
|
72
|
+
$[12] = t3;
|
|
73
|
+
} else t3 = $[12];
|
|
74
|
+
let t4;
|
|
75
|
+
if ($[13] !== initials || $[14] !== name) {
|
|
76
|
+
t4 = initials ?? initialsOf(name);
|
|
77
|
+
$[13] = initials;
|
|
78
|
+
$[14] = name;
|
|
79
|
+
$[15] = t4;
|
|
80
|
+
} else t4 = $[15];
|
|
81
|
+
let t5;
|
|
82
|
+
if ($[16] !== props || $[17] !== t1 || $[18] !== t2 || $[19] !== t3 || $[20] !== t4) {
|
|
83
|
+
t5 = /* @__PURE__ */ jsx("span", {
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
"data-slot": "team-mark",
|
|
86
|
+
"data-color": t1,
|
|
87
|
+
className: t2,
|
|
88
|
+
style: t3,
|
|
89
|
+
...props,
|
|
90
|
+
children: t4
|
|
91
|
+
});
|
|
92
|
+
$[16] = props;
|
|
93
|
+
$[17] = t1;
|
|
94
|
+
$[18] = t2;
|
|
95
|
+
$[19] = t3;
|
|
96
|
+
$[20] = t4;
|
|
97
|
+
$[21] = t5;
|
|
98
|
+
} else t5 = $[21];
|
|
99
|
+
return t5;
|
|
100
|
+
}
|
|
101
|
+
export { TeamMark };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asanchez-sa/abby",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Sistema de diseño para React sobre ui-sdk y Tailwind CSS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
"./table": "./dist/components/table/table.js",
|
|
144
144
|
"./tabs": "./dist/components/tabs/tabs.js",
|
|
145
145
|
"./task": "./dist/components/task/task.js",
|
|
146
|
+
"./team-mark": "./dist/components/team-mark/team-mark.js",
|
|
146
147
|
"./terminal": "./dist/components/terminal/terminal.js",
|
|
147
148
|
"./test-results": "./dist/components/test-results/test-results.js",
|
|
148
149
|
"./textarea": "./dist/components/textarea/textarea.js",
|
package/skills/blocks/SKILL.md
CHANGED
|
@@ -11,7 +11,7 @@ metadata:
|
|
|
11
11
|
accessible and usable by agents.
|
|
12
12
|
type: core
|
|
13
13
|
library: abby
|
|
14
|
-
library_version: 0.
|
|
14
|
+
library_version: 0.3.0
|
|
15
15
|
requires:
|
|
16
16
|
- setup
|
|
17
17
|
sources:
|
|
@@ -59,6 +59,8 @@ import {
|
|
|
59
59
|
DialogClose,
|
|
60
60
|
DialogContent,
|
|
61
61
|
DialogDescription,
|
|
62
|
+
DialogFooter,
|
|
63
|
+
DialogHeader,
|
|
62
64
|
DialogTitle,
|
|
63
65
|
DialogTrigger,
|
|
64
66
|
} from "abby/dialog";
|
|
@@ -70,12 +72,14 @@ export function EditProfile() {
|
|
|
70
72
|
<DialogTrigger variant="outline">Edit profile</DialogTrigger>
|
|
71
73
|
<DialogBackdrop />
|
|
72
74
|
<DialogContent>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
<DialogHeader>
|
|
76
|
+
<DialogTitle>Edit your profile</DialogTitle>
|
|
77
|
+
<DialogDescription>Save when you are done.</DialogDescription>
|
|
78
|
+
</DialogHeader>
|
|
79
|
+
<DialogFooter>
|
|
76
80
|
<DialogClose variant="outline">Cancel</DialogClose>
|
|
77
81
|
<DialogClose value="save">Save changes</DialogClose>
|
|
78
|
-
</
|
|
82
|
+
</DialogFooter>
|
|
79
83
|
<DialogClose
|
|
80
84
|
variant="ghost"
|
|
81
85
|
size="icon-sm"
|
|
@@ -90,6 +94,10 @@ export function EditProfile() {
|
|
|
90
94
|
}
|
|
91
95
|
```
|
|
92
96
|
|
|
97
|
+
A destructive action (delete a key, remove a person, close an organization) takes `variant="destructive-outline"`: a capsule with no fill, red text and a red edge at 30%. `variant="destructive"` is a red fill; keep it for an app that wants one, since Alma never fills a button red.
|
|
98
|
+
|
|
99
|
+
`DialogHeader` stacks the title and description; `DialogFooter` holds the actions, stacked on a phone and at the end from `sm` up. By default the footer is a band that bleeds to the dialog's edges on a muted fill under a hairline; `variant="inline"` keeps a plain row inside the padding. The band follows `--dialog-padding`, so change the padding with `className="[--dialog-padding:--spacing(6)]"` on `DialogContent`, never `p-6`, or the band stops short of the edges. `AlertDialogHeader` and `AlertDialogFooter` (`abby/alert-dialog`) work the same way.
|
|
100
|
+
|
|
93
101
|
Popups (dialog, popover, menu, select, tooltip) open in the browser's top layer and render in place: there are no Portal, Positioner or Overlay parts. Placement (`side`, `align`, `sideOffset`) goes on the Content part. `presentation="sheet"` on `Dialog` opens it as a sheet.
|
|
94
102
|
|
|
95
103
|
### Use the sizes, not classes that resize
|
|
@@ -102,6 +110,46 @@ import { Button } from "abby/button";
|
|
|
102
110
|
export const Small = () => <Button size="xs">Undo archive</Button>;
|
|
103
111
|
```
|
|
104
112
|
|
|
113
|
+
A `Switch` takes `size="sm"`, Alma's mini switch (30×18), for dense rows such as one switch per model in a list; its touch area stays larger than the track. The default switch is 32×20.
|
|
114
|
+
|
|
115
|
+
A screen that asks for one thing (a sign-in, a code) uses the touch size. An `Input` (or a `FieldControl`) with `size="lg"` measures what a `Button` with `size="lg"` does, 44px with 15px text, so a field and its button stack as one column. An `OTPInputSlot` with `size="lg"` is a 48px cell with the digit at 20px, and the groups and the separator space out with it. An `OTPInputSeparator` with no children draws Alma's short bar. The default sizes don't change.
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
import { Button } from "abby/button";
|
|
119
|
+
import { Field, FieldLabel } from "abby/field";
|
|
120
|
+
import { Input } from "abby/input";
|
|
121
|
+
import { OTPInput, OTPInputGroup, OTPInputSlot } from "abby/otp-input";
|
|
122
|
+
|
|
123
|
+
export function SignIn() {
|
|
124
|
+
return (
|
|
125
|
+
<form className="flex w-90 flex-col gap-3">
|
|
126
|
+
<Field>
|
|
127
|
+
<FieldLabel>Email</FieldLabel>
|
|
128
|
+
<Input size="lg" type="email" />
|
|
129
|
+
</Field>
|
|
130
|
+
<Button size="lg" type="submit">
|
|
131
|
+
Send code
|
|
132
|
+
</Button>
|
|
133
|
+
</form>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function Code() {
|
|
138
|
+
return (
|
|
139
|
+
<Field>
|
|
140
|
+
<FieldLabel>Code</FieldLabel>
|
|
141
|
+
<OTPInput maxLength={6}>
|
|
142
|
+
<OTPInputGroup>
|
|
143
|
+
{[0, 1, 2, 3, 4, 5].map((index) => (
|
|
144
|
+
<OTPInputSlot key={index} index={index} size="lg" />
|
|
145
|
+
))}
|
|
146
|
+
</OTPInputGroup>
|
|
147
|
+
</OTPInput>
|
|
148
|
+
</Field>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
105
153
|
### Draw icons with `Icon`
|
|
106
154
|
|
|
107
155
|
Icons come from `@hugeicons/core-free-icons` through `Icon`, which sets abby's size and stroke and hides the icon from screen readers. Pass `label` only when the icon says something no text around it says.
|
|
@@ -246,6 +294,41 @@ export function Toasts() {
|
|
|
246
294
|
}
|
|
247
295
|
```
|
|
248
296
|
|
|
297
|
+
### Show a budget or seats with `Meter`'s parts
|
|
298
|
+
|
|
299
|
+
Inside `MeterTrack`, `MeterThreshold` marks a value (an alert at 80%), `MeterForecast` fills where the value is heading behind `MeterIndicator`, and `MeterSegment`s replace the indicator with stacked parts (`variant` `default`, `muted`, `empty`). `MeterTrack variant="segmented"` draws one cell per unit, like one per seat. A meter's content is presentational, so name the segments in a `MeterLegend` inside the `Meter` and give the threshold or the forecast a `label`: the meter reads them after its value. Give the meter the sum of the segments as its `value`.
|
|
300
|
+
|
|
301
|
+
```tsx
|
|
302
|
+
import {
|
|
303
|
+
Meter,
|
|
304
|
+
MeterLabel,
|
|
305
|
+
MeterLegend,
|
|
306
|
+
MeterLegendItem,
|
|
307
|
+
MeterSegment,
|
|
308
|
+
MeterTrack,
|
|
309
|
+
MeterValue,
|
|
310
|
+
} from "abby/meter";
|
|
311
|
+
|
|
312
|
+
export function Seats() {
|
|
313
|
+
return (
|
|
314
|
+
<Meter value={8} max={10} format={(seats) => `${seats} of 10 seats`}>
|
|
315
|
+
<MeterLabel>Seats</MeterLabel>
|
|
316
|
+
<MeterValue />
|
|
317
|
+
<MeterTrack variant="segmented" className="h-2">
|
|
318
|
+
<MeterSegment value={6} />
|
|
319
|
+
<MeterSegment value={2} variant="muted" />
|
|
320
|
+
<MeterSegment value={2} variant="empty" />
|
|
321
|
+
</MeterTrack>
|
|
322
|
+
<MeterLegend>
|
|
323
|
+
<MeterLegendItem>6 people</MeterLegendItem>
|
|
324
|
+
<MeterLegendItem variant="muted">2 pending invitations</MeterLegendItem>
|
|
325
|
+
<MeterLegendItem variant="empty">2 free</MeterLegendItem>
|
|
326
|
+
</MeterLegend>
|
|
327
|
+
</Meter>
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
249
332
|
### Build a window with a rail and a column
|
|
250
333
|
|
|
251
334
|
An app's shell with two levels, Alma's, is shadcn's nested sidebars: one `Sidebar variant="inset" collapsible="icon"` holds a `SidebarTitlebar` and, in a row under it, a rail and a column as panels with `collapsible="none"`. The provider's width is both. Collapsed, the rail stays; with `peek`, the column floats out over the page while the pointer rests on the sidebar, and Escape sends it away. The column keeps its width (no `flex-1`): opening, the sidebar's edge uncovers it instead of squeezing its rows.
|
|
@@ -305,6 +388,7 @@ export function Shell() {
|
|
|
305
388
|
}
|
|
306
389
|
```
|
|
307
390
|
|
|
391
|
+
- A team's tile (its initials on its color, 36px with 10px corners) is `TeamMark` from `abby/team-mark`: `<TeamMark name="Casa Norte" color="#8b6a3e" />`. Without `color` it's Alma's neutral tile with ink letters, for a team whose color the app doesn't know, such as an invitation. It repeats the name beside it, so it's hidden from screen readers and agents. On the sidebar's paper set `--team-mark-surface` to `var(--sidebar)`, and inside a rail's button add `className="size-full"`.
|
|
308
392
|
- A rail's button is `size="icon"`: a 36px circle whose name shows only in its tooltip. Its badge is `variant="dot"`: a dot while the column is open, the count once collapsed. Put what the badge says in the button's `aria-describedby`.
|
|
309
393
|
- A two-line row (a name and a line under it) is `size="lg"`, 48px. A row that's a link takes `render={<a href="…" />}`: the button turns it into a link an agent follows, so don't pass `LinkPart` there.
|
|
310
394
|
- `SidebarInsetHeader` is the page's top bar, lined up with the window's controls; while the sidebar is collapsed, put a `SidebarTrigger` first in it.
|
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
and keep both usable by an agent without loading the editor.
|
|
13
13
|
type: core
|
|
14
14
|
library: abby
|
|
15
|
-
library_version: 0.
|
|
15
|
+
library_version: 0.3.0
|
|
16
16
|
sources:
|
|
17
17
|
- src/components/note-status/note-status.tsx
|
|
18
18
|
- src/components/note-place/note-place.tsx
|
package/skills/setup/SKILL.md
CHANGED
package/skills/theming/SKILL.md
CHANGED
|
@@ -20,13 +20,27 @@ export function tint(color: string, surface = "var(--background)"): CSSPropertie
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The assistant's logo: an ink tile with its violet core and white dots. It
|
|
25
|
+
* is a logo, so its colors are fixed and don't turn over in dark, as Alma's
|
|
26
|
+
* "Dark ink" asks: the tile stays #1D1D1F, and in dark a 1px white line at
|
|
27
|
+
* 14% sets it apart from the dark paper. The line is 1px at every size
|
|
28
|
+
* (`non-scaling-stroke`), and half of it, inside the edge, shows.
|
|
29
|
+
*/
|
|
24
30
|
export function AssistantMark({ className }: { className?: string }) {
|
|
25
31
|
return (
|
|
26
32
|
<svg viewBox="0 0 24 24" aria-hidden="true" className={className}>
|
|
27
|
-
<rect
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
<rect
|
|
34
|
+
width="24"
|
|
35
|
+
height="24"
|
|
36
|
+
rx="7"
|
|
37
|
+
fill="#1d1d1f"
|
|
38
|
+
strokeWidth="1"
|
|
39
|
+
vectorEffect="non-scaling-stroke"
|
|
40
|
+
className="stroke-transparent dark:stroke-[#ffffff24]"
|
|
41
|
+
/>
|
|
42
|
+
<circle cx="12" cy="12" r="2.6" fill="#8e5be0" />
|
|
43
|
+
<g fill="#ffffff">
|
|
30
44
|
<circle cx="16.2" cy="10.4" r="1" />
|
|
31
45
|
<circle cx="9.4" cy="15.8" r="1" />
|
|
32
46
|
<circle cx="8.6" cy="8.9" r="0.9" opacity="0.8" />
|