@yenio-pld/blocks 1.2.0-rc.30 → 1.2.0-rc.31

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/ui/button.js CHANGED
@@ -16,8 +16,9 @@ var buttonVariantsCva = cva(
16
16
  {
17
17
  variants: {
18
18
  variant: {
19
- // Brighten on hover instead of /80 opacity (opacity on gold reads as disabled).
20
- default: "bg-primary text-primary-foreground hover:brightness-110 active:brightness-95",
19
+ // Theme --primary-hover: lighter onyx (light) / brighter gold (dark). Avoid /80
20
+ // opacity (washes gold) and bare brightness (invisible on near-black onyx).
21
+ default: "bg-primary text-primary-foreground hover:bg-primary-hover",
21
22
  outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
22
23
  secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
23
24
  ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/button.tsx"],"names":["ButtonPrimitive"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACAA,IAAM,iBAAA,GAAoB,GAAA;AAAA;AAAA;AAAA,EAGzB,8lBAAA;AAAA,EACA;AAAA,IACC,QAAA,EAAU;AAAA,MACT,OAAA,EAAS;AAAA;AAAA,QAER,OAAA,EACC,8EAAA;AAAA,QACD,OAAA,EACC,iLAAA;AAAA,QACD,SAAA,EACC,gLAAA;AAAA,QACD,KAAA,EACC,kHAAA;AAAA,QACD,WAAA,EACC,6NAAA;AAAA,QACD,IAAA,EAAM;AAAA,OACP;AAAA,MACA,IAAA,EAAM;AAAA,QACL,OAAA,EACC,sFAAA;AAAA,QACD,EAAA,EAAI,mIAAA;AAAA,QACJ,EAAA,EAAI,6IAAA;AAAA,QACJ,EAAA,EAAI,sFAAA;AAAA;AAAA,QAEJ,GAAA,EAAK,sIAAA;AAAA;AAAA,QAEL,KAAA,EACC,kIAAA;AAAA;AAAA,QAED,EAAA,EAAI,kIAAA;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,SAAA,EAAW,6CAAA;AAAA,QACX,SAAA,EAAW,+CAAA;AAAA,QACX,SAAA,EAAW,QAAA;AAAA,QACX,YAAA,EAAc,8CAAA;AAAA,QACd,SAAA,EAAW;AAAA;AACZ,KACD;AAAA,IACA,eAAA,EAAiB;AAAA,MAChB,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACP;AAEF,CAAA;AAOA,SAAS,eAAe,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,GAAwB,EAAC,EAAG;AACzE,EAAA,OAAO,EAAA,CAAG,iBAAA,CAAkB,KAAK,CAAA,EAAG,SAAS,CAAA;AAC9C;AAEA,SAAS,MAAA,CAAO;AAAA,EACf,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACJ,CAAA,EAAmE;AAClE,EAAA,uBACC,GAAA;AAAA,IAACA,QAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,QAAA;AAAA,MACV,WAAW,cAAA,CAAe;AAAA,QACzB,OAAA;AAAA,QACA,IAAA;AAAA,QACA,SAAA,EAAW,OAAO,SAAA,KAAc,QAAA,GAAW,SAAA,GAAY;AAAA,OACvD,CAAA;AAAA,MACA,GAAG;AAAA;AAAA,GACL;AAEF","file":"button.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","import { Button as ButtonPrimitive } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariantsCva = cva(\n\t// Pill radius is the default for every size. Prefer rounded-full over rounded-lg so\n\t// raw `buttonVariants()` consumers (anchors) never lose the pill to CSS source order.\n\t\"group/button inline-flex shrink-0 items-center justify-center rounded-full border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\t// Brighten on hover instead of /80 opacity (opacity on gold reads as disabled).\n\t\t\t\tdefault:\n\t\t\t\t\t\"bg-primary text-primary-foreground hover:brightness-110 active:brightness-95\",\n\t\t\t\toutline:\n\t\t\t\t\t\"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n\t\t\t\tsecondary:\n\t\t\t\t\t\"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n\t\t\t\tghost:\n\t\t\t\t\t\"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n\t\t\t\tlink: \"text-primary underline-offset-4 hover:underline\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault:\n\t\t\t\t\t\"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\txs: \"h-6 gap-1 px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\tsm: \"h-7 gap-1 px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\tlg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\t/** Marketing / empty-state tall pill CTA — not the product default height. */\n\t\t\t\tcta: \"min-h-12 gap-2 px-6 text-base has-data-[icon=inline-end]:pr-5 has-data-[icon=inline-start]:pl-5 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\t/** 44px touch target for POS register controls (WCAG AAA aim). */\n\t\t\t\ttouch:\n\t\t\t\t\t\"h-11 gap-2 px-4 text-base has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\t/** 56px primary till actions (Charge, Exact cash). */\n\t\t\t\txl: \"h-14 gap-2 px-5 text-base has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\ticon: \"size-8\",\n\t\t\t\t\"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\t\"icon-sm\": \"size-7 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\t\"icon-lg\": \"size-9\",\n\t\t\t\t\"icon-touch\": \"size-11 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\t\"icon-xl\": \"size-14 [&_svg:not([class*='size-'])]:size-6\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t\tsize: \"default\",\n\t\t},\n\t},\n);\n\ntype ButtonVariantProps = VariantProps<typeof buttonVariantsCva> & {\n\tclassName?: string;\n};\n\n/** Always twMerge so size/variant radius and consumer className cannot fight. */\nfunction buttonVariants({ className, ...props }: ButtonVariantProps = {}) {\n\treturn cn(buttonVariantsCva(props), className);\n}\n\nfunction Button({\n\tclassName,\n\tvariant = \"default\",\n\tsize = \"default\",\n\t...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariantsCva>) {\n\treturn (\n\t\t<ButtonPrimitive\n\t\t\tdata-slot=\"button\"\n\t\t\tclassName={buttonVariants({\n\t\t\t\tvariant,\n\t\t\t\tsize,\n\t\t\t\tclassName: typeof className === \"string\" ? className : undefined,\n\t\t\t})}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Button, buttonVariants };\n"]}
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/button.tsx"],"names":["ButtonPrimitive"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACAA,IAAM,iBAAA,GAAoB,GAAA;AAAA;AAAA;AAAA,EAGzB,8lBAAA;AAAA,EACA;AAAA,IACC,QAAA,EAAU;AAAA,MACT,OAAA,EAAS;AAAA;AAAA;AAAA,QAGR,OAAA,EAAS,2DAAA;AAAA,QACT,OAAA,EACC,iLAAA;AAAA,QACD,SAAA,EACC,gLAAA;AAAA,QACD,KAAA,EACC,kHAAA;AAAA,QACD,WAAA,EACC,6NAAA;AAAA,QACD,IAAA,EAAM;AAAA,OACP;AAAA,MACA,IAAA,EAAM;AAAA,QACL,OAAA,EACC,sFAAA;AAAA,QACD,EAAA,EAAI,mIAAA;AAAA,QACJ,EAAA,EAAI,6IAAA;AAAA,QACJ,EAAA,EAAI,sFAAA;AAAA;AAAA,QAEJ,GAAA,EAAK,sIAAA;AAAA;AAAA,QAEL,KAAA,EACC,kIAAA;AAAA;AAAA,QAED,EAAA,EAAI,kIAAA;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,SAAA,EAAW,6CAAA;AAAA,QACX,SAAA,EAAW,+CAAA;AAAA,QACX,SAAA,EAAW,QAAA;AAAA,QACX,YAAA,EAAc,8CAAA;AAAA,QACd,SAAA,EAAW;AAAA;AACZ,KACD;AAAA,IACA,eAAA,EAAiB;AAAA,MAChB,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACP;AAEF,CAAA;AAOA,SAAS,eAAe,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,GAAwB,EAAC,EAAG;AACzE,EAAA,OAAO,EAAA,CAAG,iBAAA,CAAkB,KAAK,CAAA,EAAG,SAAS,CAAA;AAC9C;AAEA,SAAS,MAAA,CAAO;AAAA,EACf,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACJ,CAAA,EAAmE;AAClE,EAAA,uBACC,GAAA;AAAA,IAACA,QAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,QAAA;AAAA,MACV,WAAW,cAAA,CAAe;AAAA,QACzB,OAAA;AAAA,QACA,IAAA;AAAA,QACA,SAAA,EAAW,OAAO,SAAA,KAAc,QAAA,GAAW,SAAA,GAAY;AAAA,OACvD,CAAA;AAAA,MACA,GAAG;AAAA;AAAA,GACL;AAEF","file":"button.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","import { Button as ButtonPrimitive } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariantsCva = cva(\n\t// Pill radius is the default for every size. Prefer rounded-full over rounded-lg so\n\t// raw `buttonVariants()` consumers (anchors) never lose the pill to CSS source order.\n\t\"group/button inline-flex shrink-0 items-center justify-center rounded-full border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\t// Theme --primary-hover: lighter onyx (light) / brighter gold (dark). Avoid /80\n\t\t\t\t// opacity (washes gold) and bare brightness (invisible on near-black onyx).\n\t\t\t\tdefault: \"bg-primary text-primary-foreground hover:bg-primary-hover\",\n\t\t\t\toutline:\n\t\t\t\t\t\"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n\t\t\t\tsecondary:\n\t\t\t\t\t\"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n\t\t\t\tghost:\n\t\t\t\t\t\"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n\t\t\t\tlink: \"text-primary underline-offset-4 hover:underline\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault:\n\t\t\t\t\t\"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\txs: \"h-6 gap-1 px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\tsm: \"h-7 gap-1 px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\tlg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\t/** Marketing / empty-state tall pill CTA — not the product default height. */\n\t\t\t\tcta: \"min-h-12 gap-2 px-6 text-base has-data-[icon=inline-end]:pr-5 has-data-[icon=inline-start]:pl-5 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\t/** 44px touch target for POS register controls (WCAG AAA aim). */\n\t\t\t\ttouch:\n\t\t\t\t\t\"h-11 gap-2 px-4 text-base has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\t/** 56px primary till actions (Charge, Exact cash). */\n\t\t\t\txl: \"h-14 gap-2 px-5 text-base has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\ticon: \"size-8\",\n\t\t\t\t\"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\t\"icon-sm\": \"size-7 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\t\"icon-lg\": \"size-9\",\n\t\t\t\t\"icon-touch\": \"size-11 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\t\"icon-xl\": \"size-14 [&_svg:not([class*='size-'])]:size-6\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t\tsize: \"default\",\n\t\t},\n\t},\n);\n\ntype ButtonVariantProps = VariantProps<typeof buttonVariantsCva> & {\n\tclassName?: string;\n};\n\n/** Always twMerge so size/variant radius and consumer className cannot fight. */\nfunction buttonVariants({ className, ...props }: ButtonVariantProps = {}) {\n\treturn cn(buttonVariantsCva(props), className);\n}\n\nfunction Button({\n\tclassName,\n\tvariant = \"default\",\n\tsize = \"default\",\n\t...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariantsCva>) {\n\treturn (\n\t\t<ButtonPrimitive\n\t\t\tdata-slot=\"button\"\n\t\t\tclassName={buttonVariants({\n\t\t\t\tvariant,\n\t\t\t\tsize,\n\t\t\t\tclassName: typeof className === \"string\" ? className : undefined,\n\t\t\t})}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Button, buttonVariants };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yenio-pld/blocks",
3
- "version": "1.2.0-rc.30",
3
+ "version": "1.2.0-rc.31",
4
4
  "description": "Shared UI components for Yenio applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
package/src/theme.css CHANGED
@@ -51,6 +51,8 @@
51
51
  --popover: oklch(1 0 0);
52
52
  --popover-foreground: var(--onyx-900);
53
53
  --primary: var(--onyx-900);
54
+ /* Lighter onyx so solid primary fills show a clear hover (brightness on black is invisible). */
55
+ --primary-hover: var(--onyx-700);
54
56
  --primary-foreground: oklch(1 0 0);
55
57
  --secondary: var(--cream-100);
56
58
  --secondary-foreground: var(--onyx-900);
@@ -136,6 +138,8 @@
136
138
  --popover-foreground: var(--cream-50);
137
139
  /* gold-400 reads active on onyx; gold-500 looked disabled as a solid fill. */
138
140
  --primary: var(--gold-400);
141
+ /* Brighter gold (not opacity washout) for solid primary hover. */
142
+ --primary-hover: var(--gold-300);
139
143
  --primary-foreground: var(--onyx-950);
140
144
  --secondary: var(--onyx-800);
141
145
  --secondary-foreground: var(--cream-50);
@@ -236,6 +240,7 @@
236
240
  --color-popover: var(--popover);
237
241
  --color-popover-foreground: var(--popover-foreground);
238
242
  --color-primary: var(--primary);
243
+ --color-primary-hover: var(--primary-hover);
239
244
  --color-primary-foreground: var(--primary-foreground);
240
245
  --color-secondary: var(--secondary);
241
246
  --color-secondary-foreground: var(--secondary-foreground);