@adea-ai/ui 0.106.1 → 0.106.2
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/dist/components/ui/kbd/kbd.js +2 -2
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/r/src/components/ui/kbd/kbd.tsx +2 -2
- package/dist/r/src/styles/base.css +22 -0
- package/dist/r/src/styles/theme.css +0 -15
- package/package.json +1 -1
- package/src/components/ui/kbd/kbd.tsx +2 -2
- package/src/styles/base.css +22 -0
- package/src/styles/theme.css +0 -15
|
@@ -21,10 +21,10 @@ var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=kbd-group>`);
|
|
|
21
21
|
* `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`
|
|
22
22
|
* needs a gap between them that is a layout concern, not punctuation.
|
|
23
23
|
*/
|
|
24
|
-
var kbdVariants = cva("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none", {
|
|
24
|
+
var kbdVariants = cva("bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none", {
|
|
25
25
|
variants: { size: {
|
|
26
26
|
default: "",
|
|
27
|
-
compact: "h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none"
|
|
27
|
+
compact: "min-h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none"
|
|
28
28
|
} },
|
|
29
29
|
defaultVariants: { size: "default" }
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd.js","names":["ComponentProps","For","splitProps","cva","VariantProps","cn","kbdVariants","variants","size","default","compact","defaultVariants","KbdSize","NonNullable","Kbd","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","kbdGroupVariants","KbdGroup","_el$2","_tmpl$2","kbdChordKeys","keys","KbdChordProps","Omit","KbdChord","_$createComponent","children","each","key","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/ui/kbd/kbd.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Kbd.\n *\n * A keyboard key, in the order the user presses them. The element is a real\n * `<kbd>` so the semantics survive copy-paste, and the mono face is what makes\n * a shortcut visually distinct from the sentence around it.\n *\n * `size=\"compact\"` exists for the dense rows a default cap would outweigh — a\n * rail search row, a sidebar shortcut hint. It drops a height rung, and it\n * lightens the fill and weight with it because at that size a solid muted cap\n * reads heavier than the row text it sits in. The default rendering is every\n * cap that is not inside such a row, and it is untouched by the rung.\n *\n * `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`\n * needs a gap between them that is a layout concern, not punctuation.\n */\nexport const kbdVariants = cva(\n 'bg-muted text-muted-foreground pointer-events-none inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none',\n {\n variants: {\n size: {\n default: '',\n compact: 'h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>['size']>\n\nexport function Kbd(props: ComponentProps<'kbd'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <kbd data-slot=\"kbd\" class={cn(kbdVariants({ size: local.size }), local.class)} {...rest} />\n )\n}\n\nexport const kbdGroupVariants = cva('inline-flex items-center gap-1', {\n variants: {\n size: {\n default: '',\n /** The gap is what separates caps, so it tightens with them. */\n compact: 'gap-0.5',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n})\n\nexport function KbdGroup(props: ComponentProps<'span'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <span\n data-slot=\"kbd-group\"\n class={cn(kbdGroupVariants({ size: local.size }), local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * Split a written chord into one entry per key cap. Every character is a key:\n * `⌘K` renders as `⌘` + `K`, and a longer chord like `⇧⌘P` stays three caps\n * wide, which matches how the system draws chords in menus.\n */\nexport function kbdChordKeys(keys: string): string[] {\n return [...keys]\n}\n\nexport type KbdChordProps = Omit<ComponentProps<'span'>, 'children'> & {\n /** The chord as it is drawn, e.g. `\"⌘K\"` or `\"⇧⌘P\"`. One cap per character. */\n keys: string\n size?: KbdSize\n}\n\n/**\n * KbdChord.\n *\n * A written chord drawn as caps, one per character. Decoration only: the\n * composition renders `aria-hidden`, so the accessible name and the parseable\n * `aria-keyshortcuts` stay on the control the chord belongs to. That is why\n * there is no children — the chord says what was drawn, nothing more.\n */\nexport function KbdChord(props: KbdChordProps) {\n const [local, rest] = splitProps(props, ['keys', 'size', 'class'])\n\n return (\n <KbdGroup {...rest} size={local.size} class={local.class} aria-hidden=\"true\">\n <For each={kbdChordKeys(local.keys)}>{(key) => <Kbd size={local.size}>{key}</Kbd>}</For>\n </KbdGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAaM,cAAcH,IACzB,
|
|
1
|
+
{"version":3,"file":"kbd.js","names":["ComponentProps","For","splitProps","cva","VariantProps","cn","kbdVariants","variants","size","default","compact","defaultVariants","KbdSize","NonNullable","Kbd","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","kbdGroupVariants","KbdGroup","_el$2","_tmpl$2","kbdChordKeys","keys","KbdChordProps","Omit","KbdChord","_$createComponent","children","each","key","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/ui/kbd/kbd.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Kbd.\n *\n * A keyboard key, in the order the user presses them. The element is a real\n * `<kbd>` so the semantics survive copy-paste, and the mono face is what makes\n * a shortcut visually distinct from the sentence around it.\n *\n * `size=\"compact\"` exists for the dense rows a default cap would outweigh — a\n * rail search row, a sidebar shortcut hint. It drops a height rung, and it\n * lightens the fill and weight with it because at that size a solid muted cap\n * reads heavier than the row text it sits in. The default rendering is every\n * cap that is not inside such a row, and it is untouched by the rung.\n *\n * `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`\n * needs a gap between them that is a layout concern, not punctuation.\n */\nexport const kbdVariants = cva(\n 'bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none',\n {\n variants: {\n size: {\n default: '',\n compact: 'min-h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>['size']>\n\nexport function Kbd(props: ComponentProps<'kbd'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <kbd data-slot=\"kbd\" class={cn(kbdVariants({ size: local.size }), local.class)} {...rest} />\n )\n}\n\nexport const kbdGroupVariants = cva('inline-flex items-center gap-1', {\n variants: {\n size: {\n default: '',\n /** The gap is what separates caps, so it tightens with them. */\n compact: 'gap-0.5',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n})\n\nexport function KbdGroup(props: ComponentProps<'span'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <span\n data-slot=\"kbd-group\"\n class={cn(kbdGroupVariants({ size: local.size }), local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * Split a written chord into one entry per key cap. Every character is a key:\n * `⌘K` renders as `⌘` + `K`, and a longer chord like `⇧⌘P` stays three caps\n * wide, which matches how the system draws chords in menus.\n */\nexport function kbdChordKeys(keys: string): string[] {\n return [...keys]\n}\n\nexport type KbdChordProps = Omit<ComponentProps<'span'>, 'children'> & {\n /** The chord as it is drawn, e.g. `\"⌘K\"` or `\"⇧⌘P\"`. One cap per character. */\n keys: string\n size?: KbdSize\n}\n\n/**\n * KbdChord.\n *\n * A written chord drawn as caps, one per character. Decoration only: the\n * composition renders `aria-hidden`, so the accessible name and the parseable\n * `aria-keyshortcuts` stay on the control the chord belongs to. That is why\n * there is no children — the chord says what was drawn, nothing more.\n */\nexport function KbdChord(props: KbdChordProps) {\n const [local, rest] = splitProps(props, ['keys', 'size', 'class'])\n\n return (\n <KbdGroup {...rest} size={local.size} class={local.class} aria-hidden=\"true\">\n <For each={kbdChordKeys(local.keys)}>{(key) => <Kbd size={local.size}>{key}</Kbd>}</For>\n </KbdGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAaM,cAAcH,IACzB,qMACA;CACEI,UAAU,EACRC,MAAM;EACJC,SAAS;EACTC,SAAS;CACX,EACF;CACAC,iBAAiB,EACfH,MAAM,UACR;AACF,CACF;AAIA,SAAgBM,IAAIC,OAAmD;CACrE,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO,CAAC,QAAQ,OAAO,CAAC;CAEzD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAC8BhB,GAAGC,YAAY,EAAEE,MAAMQ,MAAMR,KAAK,CAAC,GAAGQ,MAAMM,KAAK;EAAC,EAAA,GAAML,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAE5F;AAEA,IAAaK,mBAAmBpB,IAAI,kCAAkC;CACpEI,UAAU,EACRC,MAAM;EACJC,SAAS;;EAETC,SAAS;CACX,EACF;CACAC,iBAAiB,EACfH,MAAM,UACR;AACF,CAAC;AAED,SAAgBgB,SAAST,OAAoD;CAC3E,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO,CAAC,QAAQ,OAAO,CAAC;CAEzD,cAAA;EAAA,IAAAU,QAAAC,QAAA;EAAAN,OAAAK,OAAAJ,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWhB,GAAGkB,iBAAiB,EAAEf,MAAMQ,MAAMR,KAAK,CAAC,GAAGQ,MAAMM,KAAK;EAAC,EAAA,GAC1DL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAQ;CAAA,EAAA,CAAA;AAGd;;;;;;AAOA,SAAgBE,aAAaC,MAAwB;CACnD,OAAO,CAAC,GAAGA,IAAI;AACjB;;;;;;;;;AAgBA,SAAgBG,SAAShB,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO;EAAC;EAAQ;EAAQ;CAAO,CAAC;CAEjE,OAAAiB,gBACGR,UAAQH,WAAKJ,MAAI;EAAA,IAAET,OAAI;GAAA,OAAEQ,MAAMR;EAAI;EAAA,KAAA,WAAA;GAAA,OAASQ,MAAMM;EAAK;EAAA,eAAA;EAAA,IAAAW,WAAA;GAAA,OAAAD,gBACrD/B,KAAG;IAAA,IAACiC,OAAI;KAAA,OAAEP,aAAaX,MAAMY,IAAI;IAAC;IAAAK,WAAIE,QAAGH,gBAAMlB,KAAG;KAAA,IAACN,OAAI;MAAA,OAAEQ,MAAMR;KAAI;KAAAyB,UAAGE;IAAG,CAAA;GAAO,CAAA;EAAA;CAAA,CAAA,CAAA;AAGvF"}
|
|
@@ -20,12 +20,12 @@ import { cn } from '../../../lib/utils'
|
|
|
20
20
|
* needs a gap between them that is a layout concern, not punctuation.
|
|
21
21
|
*/
|
|
22
22
|
export const kbdVariants = cva(
|
|
23
|
-
'bg-muted text-muted-foreground pointer-events-none inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none',
|
|
23
|
+
'bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none',
|
|
24
24
|
{
|
|
25
25
|
variants: {
|
|
26
26
|
size: {
|
|
27
27
|
default: '',
|
|
28
|
-
compact: 'h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',
|
|
28
|
+
compact: 'min-h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
defaultVariants: {
|
|
@@ -205,6 +205,28 @@
|
|
|
205
205
|
|
|
206
206
|
/* --- Named utilities ----------------------------------------------------- */
|
|
207
207
|
|
|
208
|
+
/* Role utilities use fallbacks directly instead of @theme aliases. Tailwind
|
|
209
|
+
emits every @theme variable globally, while these rules are emitted only
|
|
210
|
+
when a consumer uses that role. The optional Appearance sheet supplies the
|
|
211
|
+
selected role variables when its root marker is present. */
|
|
212
|
+
@utility font-content {
|
|
213
|
+
font-family: var(--font-content, var(--font-sans));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@utility font-code {
|
|
217
|
+
font-family: var(--font-code, var(--font-mono));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@utility text-content {
|
|
221
|
+
font-size: var(--text-content, var(--text-sm));
|
|
222
|
+
line-height: var(--tw-leading, var(--text-content--line-height, var(--text-sm--line-height)));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@utility text-code {
|
|
226
|
+
font-size: var(--text-code, 0.75rem);
|
|
227
|
+
line-height: var(--tw-leading, var(--text-code--line-height, 1.5));
|
|
228
|
+
}
|
|
229
|
+
|
|
208
230
|
/**
|
|
209
231
|
* Visible to a screen reader, invisible on screen.
|
|
210
232
|
*
|
|
@@ -525,15 +525,6 @@
|
|
|
525
525
|
--font-family-geist-mono: 'Geist Mono Variable', 'Geist Mono', monospace;
|
|
526
526
|
--font-family-system: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
527
527
|
--font-family-system-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
528
|
-
/* Lightweight role defaults keep conversation and code components useful for
|
|
529
|
-
consumers that have not opted into independent Appearance font settings. */
|
|
530
|
-
--font-content: var(--font-sans);
|
|
531
|
-
--font-code: var(--font-mono);
|
|
532
|
-
--text-content: var(--text-sm);
|
|
533
|
-
--text-content--line-height: var(--text-sm--line-height);
|
|
534
|
-
--text-code: 0.75rem;
|
|
535
|
-
--text-code--line-height: 1.5;
|
|
536
|
-
|
|
537
528
|
/* Width compensation for the mono UI fonts. `normal` on the proportional face,
|
|
538
529
|
tightened by the `[data-font]` blocks above when the UI font is monospace. */
|
|
539
530
|
--ui-tracking: normal;
|
|
@@ -784,8 +775,6 @@
|
|
|
784
775
|
|
|
785
776
|
--font-sans: var(--font-sans);
|
|
786
777
|
--font-mono: var(--font-mono);
|
|
787
|
-
--font-content: var(--font-content);
|
|
788
|
-
--font-code: var(--font-code);
|
|
789
778
|
--font-family-space-grotesk: var(--font-family-space-grotesk);
|
|
790
779
|
--font-family-jetbrains-mono: var(--font-family-jetbrains-mono);
|
|
791
780
|
--font-family-geist: var(--font-family-geist);
|
|
@@ -809,10 +798,6 @@
|
|
|
809
798
|
--text-2xl--line-height: var(--text-2xl--line-height);
|
|
810
799
|
--text-3xl: var(--text-3xl);
|
|
811
800
|
--text-3xl--line-height: var(--text-3xl--line-height);
|
|
812
|
-
--text-content: var(--text-content);
|
|
813
|
-
--text-content--line-height: var(--text-content--line-height);
|
|
814
|
-
--text-code: var(--text-code);
|
|
815
|
-
--text-code--line-height: var(--text-code--line-height);
|
|
816
801
|
|
|
817
802
|
--radius-sm: var(--radius-sm);
|
|
818
803
|
--radius-md: var(--radius-md);
|
package/package.json
CHANGED
|
@@ -20,12 +20,12 @@ import { cn } from '#lib/utils'
|
|
|
20
20
|
* needs a gap between them that is a layout concern, not punctuation.
|
|
21
21
|
*/
|
|
22
22
|
export const kbdVariants = cva(
|
|
23
|
-
'bg-muted text-muted-foreground pointer-events-none inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none',
|
|
23
|
+
'bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none',
|
|
24
24
|
{
|
|
25
25
|
variants: {
|
|
26
26
|
size: {
|
|
27
27
|
default: '',
|
|
28
|
-
compact: 'h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',
|
|
28
|
+
compact: 'min-h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
defaultVariants: {
|
package/src/styles/base.css
CHANGED
|
@@ -205,6 +205,28 @@
|
|
|
205
205
|
|
|
206
206
|
/* --- Named utilities ----------------------------------------------------- */
|
|
207
207
|
|
|
208
|
+
/* Role utilities use fallbacks directly instead of @theme aliases. Tailwind
|
|
209
|
+
emits every @theme variable globally, while these rules are emitted only
|
|
210
|
+
when a consumer uses that role. The optional Appearance sheet supplies the
|
|
211
|
+
selected role variables when its root marker is present. */
|
|
212
|
+
@utility font-content {
|
|
213
|
+
font-family: var(--font-content, var(--font-sans));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@utility font-code {
|
|
217
|
+
font-family: var(--font-code, var(--font-mono));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@utility text-content {
|
|
221
|
+
font-size: var(--text-content, var(--text-sm));
|
|
222
|
+
line-height: var(--tw-leading, var(--text-content--line-height, var(--text-sm--line-height)));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@utility text-code {
|
|
226
|
+
font-size: var(--text-code, 0.75rem);
|
|
227
|
+
line-height: var(--tw-leading, var(--text-code--line-height, 1.5));
|
|
228
|
+
}
|
|
229
|
+
|
|
208
230
|
/**
|
|
209
231
|
* Visible to a screen reader, invisible on screen.
|
|
210
232
|
*
|
package/src/styles/theme.css
CHANGED
|
@@ -525,15 +525,6 @@
|
|
|
525
525
|
--font-family-geist-mono: 'Geist Mono Variable', 'Geist Mono', monospace;
|
|
526
526
|
--font-family-system: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
527
527
|
--font-family-system-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
528
|
-
/* Lightweight role defaults keep conversation and code components useful for
|
|
529
|
-
consumers that have not opted into independent Appearance font settings. */
|
|
530
|
-
--font-content: var(--font-sans);
|
|
531
|
-
--font-code: var(--font-mono);
|
|
532
|
-
--text-content: var(--text-sm);
|
|
533
|
-
--text-content--line-height: var(--text-sm--line-height);
|
|
534
|
-
--text-code: 0.75rem;
|
|
535
|
-
--text-code--line-height: 1.5;
|
|
536
|
-
|
|
537
528
|
/* Width compensation for the mono UI fonts. `normal` on the proportional face,
|
|
538
529
|
tightened by the `[data-font]` blocks above when the UI font is monospace. */
|
|
539
530
|
--ui-tracking: normal;
|
|
@@ -784,8 +775,6 @@
|
|
|
784
775
|
|
|
785
776
|
--font-sans: var(--font-sans);
|
|
786
777
|
--font-mono: var(--font-mono);
|
|
787
|
-
--font-content: var(--font-content);
|
|
788
|
-
--font-code: var(--font-code);
|
|
789
778
|
--font-family-space-grotesk: var(--font-family-space-grotesk);
|
|
790
779
|
--font-family-jetbrains-mono: var(--font-family-jetbrains-mono);
|
|
791
780
|
--font-family-geist: var(--font-family-geist);
|
|
@@ -809,10 +798,6 @@
|
|
|
809
798
|
--text-2xl--line-height: var(--text-2xl--line-height);
|
|
810
799
|
--text-3xl: var(--text-3xl);
|
|
811
800
|
--text-3xl--line-height: var(--text-3xl--line-height);
|
|
812
|
-
--text-content: var(--text-content);
|
|
813
|
-
--text-content--line-height: var(--text-content--line-height);
|
|
814
|
-
--text-code: var(--text-code);
|
|
815
|
-
--text-code--line-height: var(--text-code--line-height);
|
|
816
801
|
|
|
817
802
|
--radius-sm: var(--radius-sm);
|
|
818
803
|
--radius-md: var(--radius-md);
|