@yenio-pld/blocks 1.2.0-rc.26 → 1.2.0-rc.28
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 +20 -1
- package/dist/brand.cjs +211 -0
- package/dist/brand.cjs.map +1 -0
- package/dist/brand.d.cts +16 -0
- package/dist/brand.d.ts +16 -0
- package/dist/brand.js +199 -0
- package/dist/brand.js.map +1 -0
- package/dist/gem-loader-BFxCP0pU.d.cts +43 -0
- package/dist/gem-loader-BFxCP0pU.d.ts +43 -0
- package/dist/index.cjs +195 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +193 -1
- package/dist/index.js.map +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/input.js +1 -1
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/textarea.js.map +1 -1
- package/package.json +11 -1
- package/scripts/check-theme.mjs +6 -5
- package/src/theme.css +172 -60
package/dist/ui/button.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { Button as Button$1 } from '@base-ui/react/button';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" |
|
|
8
|
-
size?: "default" | "
|
|
7
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | "xs" | "lg" | "touch" | "xl" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-touch" | "icon-xl" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): React.JSX.Element;
|
|
11
11
|
|
package/dist/ui/input.js
CHANGED
|
@@ -15,7 +15,7 @@ function Input({ className, type, ...props }) {
|
|
|
15
15
|
type,
|
|
16
16
|
"data-slot": "input",
|
|
17
17
|
className: cn(
|
|
18
|
-
"h-8 w-full min-w-0 rounded-lg border border-input bg-
|
|
18
|
+
"h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
19
19
|
className
|
|
20
20
|
),
|
|
21
21
|
...props
|
package/dist/ui/input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/input.tsx"],"names":["InputPrimitive"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACAA,SAAS,MAAM,EAAE,SAAA,EAAW,IAAA,EAAM,GAAG,OAAM,EAAkC;AAC5E,EAAA,uBACC,GAAA;AAAA,IAACA,OAAA;AAAA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAA,EAAU,OAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/input.tsx"],"names":["InputPrimitive"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACAA,SAAS,MAAM,EAAE,SAAA,EAAW,IAAA,EAAM,GAAG,OAAM,EAAkC;AAC5E,EAAA,uBACC,GAAA;AAAA,IAACA,OAAA;AAAA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAA,EAAU,OAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,4oBAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"input.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 * as React from \"react\";\nimport { Input as InputPrimitive } from \"@base-ui/react/input\";\n\nimport { cn } from \"../lib/utils\";\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n\treturn (\n\t\t<InputPrimitive\n\t\t\ttype={type}\n\t\t\tdata-slot=\"input\"\n\t\t\tclassName={cn(\n\t\t\t\t\"h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Input };\n"]}
|
package/dist/ui/select.js
CHANGED
|
@@ -24,7 +24,7 @@ function parseOptionChildren(children) {
|
|
|
24
24
|
});
|
|
25
25
|
return options;
|
|
26
26
|
}
|
|
27
|
-
var triggerClassName = "flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-
|
|
27
|
+
var triggerClassName = "flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-background px-2.5 py-1 text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
|
|
28
28
|
var popupClassName = "pointer-events-auto z-[100] max-h-(--available-height) min-w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95";
|
|
29
29
|
var itemClassName = "relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none pointer-events-auto data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-accent data-highlighted:text-accent-foreground data-selected:bg-accent/50";
|
|
30
30
|
function optionsSignature(options) {
|
package/dist/ui/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/select.tsx"],"names":["SelectPrimitive"],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACUA,SAAS,oBAAoB,QAAA,EAA2C;AACvE,EAAA,MAAM,UAA0B,EAAC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x\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\";\nimport { CheckIcon, ChevronDownIcon } from \"lucide-react\";\n\nimport { cn } from \"../lib/utils\";\nimport { useDialogPortalContainer } from \"./dialog\";\n\ntype ParsedOption = {\n\tvalue: string;\n\tlabel: React.ReactNode;\n\tdisabled?: boolean;\n};\n\nfunction parseOptionChildren(children: React.ReactNode): ParsedOption[] {\n\tconst options: ParsedOption[] = [];\n\tReact.Children.forEach(children, (child) => {\n\t\tif (!React.isValidElement(child) || child.type !== \"option\") return;\n\t\tconst props = child.props as React.OptionHTMLAttributes<HTMLOptionElement>;\n\t\tif (props.value === undefined || props.value === null) return;\n\t\toptions.push({\n\t\t\tvalue: String(props.value),\n\t\t\tlabel: props.children ?? String(props.value),\n\t\t\tdisabled: props.disabled,\n\t\t});\n\t});\n\treturn options;\n}\n\nconst triggerClassName =\n\t\"flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40\";\n\nconst popupClassName =\n\t\"pointer-events-auto z-[100] max-h-(--available-height) min-w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95\";\n\nconst itemClassName =\n\t\"relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none pointer-events-auto data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-accent data-highlighted:text-accent-foreground data-selected:bg-accent/50\";\n\ntype SelectProps = Omit<\n\tReact.ComponentProps<\"select\">,\n\t\"onChange\" | \"children\" | \"size\" | \"multiple\"\n> & {\n\tonChange?: React.ChangeEventHandler<HTMLSelectElement>;\n\tchildren?: React.ReactNode;\n};\n\nfunction optionsSignature(options: ParsedOption[]): string {\n\treturn options\n\t\t.map(\n\t\t\t(option) =>\n\t\t\t\t`${option.value}\\0${option.disabled ? \"1\" : \"0\"}\\0${\n\t\t\t\t\ttypeof option.label === \"string\" ? option.label : \"\"\n\t\t\t\t}`,\n\t\t)\n\t\t.join(\"\\n\");\n}\n\nfunction Select({\n\tclassName,\n\tchildren,\n\tvalue,\n\tdefaultValue,\n\tonChange,\n\tdisabled,\n\trequired,\n\tname,\n\tid,\n\tautoFocus,\n\ttabIndex,\n\t\"aria-label\": ariaLabel,\n\t\"aria-labelledby\": ariaLabelledby,\n\t\"aria-describedby\": ariaDescribedby,\n\t\"aria-invalid\": ariaInvalid,\n}: SelectProps) {\n\tconst dialogPortalContainer = useDialogPortalContainer();\n\t// `children` is a new element tree every parent render; keep the same options\n\t// array when value/label/disabled are unchanged so an open list does not remount.\n\tconst optionsRef = React.useRef<ParsedOption[]>([]);\n\tconst nextOptions = parseOptionChildren(children);\n\tif (optionsSignature(optionsRef.current) !== optionsSignature(nextOptions)) {\n\t\toptionsRef.current = nextOptions;\n\t}\n\tconst options = optionsRef.current;\n\tconst items = React.useMemo(\n\t\t() =>\n\t\t\toptions.map((option) => ({ value: option.value, label: option.label })),\n\t\t[options],\n\t);\n\n\tconst handleValueChange = React.useCallback(\n\t\t(next: string | null) => {\n\t\t\tif (!onChange) return;\n\t\t\tconst nextValue = next ?? \"\";\n\t\t\tonChange({\n\t\t\t\ttarget: { value: nextValue },\n\t\t\t\tcurrentTarget: { value: nextValue },\n\t\t\t} as React.ChangeEvent<HTMLSelectElement>);\n\t\t},\n\t\t[onChange],\n\t);\n\n\t// Base UI rejects \"\" as a controlled value (throws → workspace error boundary).\n\tconst controlledValue =\n\t\tvalue === undefined || value === null || value === \"\"\n\t\t\t? null\n\t\t\t: String(value);\n\tconst uncontrolledDefault =\n\t\tdefaultValue === undefined || defaultValue === null || defaultValue === \"\"\n\t\t\t? undefined\n\t\t\t: String(defaultValue);\n\n\tif (options.length === 0) {\n\t\treturn (\n\t\t\t<select\n\t\t\t\tdata-slot=\"select\"\n\t\t\t\tclassName={cn(triggerClassName, className)}\n\t\t\t\tdisabled\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SelectPrimitive.Root\n\t\t\tname={name}\n\t\t\trequired={required}\n\t\t\tdisabled={disabled}\n\t\t\t// Keep the Base UI default (modal). `modal={false}` leaves the popup under\n\t\t\t// Radix Dialog's body `pointer-events: none`, so options cannot be clicked\n\t\t\t// and the list appears to blur/collapse immediately.\n\t\t\titems={items}\n\t\t\tvalue={controlledValue}\n\t\t\tdefaultValue={uncontrolledDefault}\n\t\t\tonValueChange={handleValueChange}\n\t\t>\n\t\t\t<SelectPrimitive.Trigger\n\t\t\t\tdata-slot=\"select\"\n\t\t\t\tid={id}\n\t\t\t\tautoFocus={autoFocus}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\taria-describedby={ariaDescribedby}\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tclassName={cn(triggerClassName, className)}\n\t\t\t>\n\t\t\t\t<SelectPrimitive.Value className=\"truncate text-left\" />\n\t\t\t\t<SelectPrimitive.Icon className=\"pointer-events-none shrink-0 text-muted-foreground\">\n\t\t\t\t\t<ChevronDownIcon className=\"size-4\" />\n\t\t\t\t</SelectPrimitive.Icon>\n\t\t\t</SelectPrimitive.Trigger>\n\t\t\t{/* Prefer Dialog content as portal root so Radix focus trap keeps the list\n\t\t\t open; fall back to body with pointer-events/z overrides. */}\n\t\t\t<SelectPrimitive.Portal container={dialogPortalContainer ?? undefined}>\n\t\t\t\t<SelectPrimitive.Positioner\n\t\t\t\t\talignItemWithTrigger={false}\n\t\t\t\t\tdata-slot=\"select-positioner\"\n\t\t\t\t\tclassName=\"pointer-events-auto isolate z-[100] outline-none\"\n\t\t\t\t\tsideOffset={4}\n\t\t\t\t>\n\t\t\t\t\t<SelectPrimitive.Popup\n\t\t\t\t\t\tdata-slot=\"select-popup\"\n\t\t\t\t\t\tclassName={popupClassName}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectPrimitive.List onWheel={(event) => event.stopPropagation()}>\n\t\t\t\t\t\t\t{options.map((option) => (\n\t\t\t\t\t\t\t\t<SelectPrimitive.Item\n\t\t\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\ttypeof option.label === \"string\"\n\t\t\t\t\t\t\t\t\t\t\t? option.label\n\t\t\t\t\t\t\t\t\t\t\t: option.value\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdisabled={option.disabled}\n\t\t\t\t\t\t\t\t\tclassName={itemClassName}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<SelectPrimitive.ItemText>\n\t\t\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t\t\t</SelectPrimitive.ItemText>\n\t\t\t\t\t\t\t\t\t<SelectPrimitive.ItemIndicator className=\"pointer-events-none absolute right-1.5 flex size-4 items-center justify-center\">\n\t\t\t\t\t\t\t\t\t\t<CheckIcon className=\"size-4\" />\n\t\t\t\t\t\t\t\t\t</SelectPrimitive.ItemIndicator>\n\t\t\t\t\t\t\t\t</SelectPrimitive.Item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</SelectPrimitive.List>\n\t\t\t\t\t</SelectPrimitive.Popup>\n\t\t\t\t</SelectPrimitive.Positioner>\n\t\t\t</SelectPrimitive.Portal>\n\t\t</SelectPrimitive.Root>\n\t);\n}\n\nexport { Select };\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/select.tsx"],"names":["SelectPrimitive"],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACUA,SAAS,oBAAoB,QAAA,EAA2C;AACvE,EAAA,MAAM,UAA0B,EAAC;AACjC,EAAM,KAAA,CAAA,QAAA,CAAS,OAAA,CAAQ,QAAA,EAAU,CAAC,KAAA,KAAU;AAC3C,IAAA,IAAI,CAAO,KAAA,CAAA,cAAA,CAAe,KAAK,CAAA,IAAK,KAAA,CAAM,SAAS,QAAA,EAAU;AAC7D,IAAA,MAAM,QAAQ,KAAA,CAAM,KAAA;AACpB,IAAA,IAAI,KAAA,CAAM,KAAA,KAAU,MAAA,IAAa,KAAA,CAAM,UAAU,IAAA,EAAM;AACvD,IAAA,OAAA,CAAQ,IAAA,CAAK;AAAA,MACZ,KAAA,EAAO,MAAA,CAAO,KAAA,CAAM,KAAK,CAAA;AAAA,MACzB,KAAA,EAAO,KAAA,CAAM,QAAA,IAAY,MAAA,CAAO,MAAM,KAAK,CAAA;AAAA,MAC3C,UAAU,KAAA,CAAM;AAAA,KAChB,CAAA;AAAA,EACF,CAAC,CAAA;AACD,EAAA,OAAO,OAAA;AACR;AAEA,IAAM,gBAAA,GACL,miBAAA;AAED,IAAM,cAAA,GACL,qpBAAA;AAED,IAAM,aAAA,GACL,sSAAA;AAUD,SAAS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AAO,QACP,MAAA,CAAO,KAAA;AAAA,oBAEX,UAAU,MAAA,CAAO,QAAA;AAAA,oBACjB,SAAA,EAAW,aAAA;AAAA,oBAEX,QAAA,EAAA;AAAA,sCAAA,GAAA,CAACA,QAAA,CAAgB,QAAA,EAAhB,EACC,QAAA,EAAA,MAAA,CAAO,KAAA,EACT,CAAA;AAAA,sCACA,GAAA,CAACA,QAAA,CAAgB,aAAA,EAAhB,EAA8B,SAAA,EAAU,kFACxC,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,SAAA,EAAU,QAAA,EAAS,CAAA,EAC/B;AAAA;AAAA,mBAAA;AAAA,kBAfK,MAAA,CAAO;AAAA,iBAiBb,CAAA,EACF;AAAA;AAAA;AACD;AAAA,SACD,EACD;AAAA;AAAA;AAAA,GACD;AAEF","file":"select.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","\"use client\";\n\nimport * as React from \"react\";\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\";\nimport { CheckIcon, ChevronDownIcon } from \"lucide-react\";\n\nimport { cn } from \"../lib/utils\";\nimport { useDialogPortalContainer } from \"./dialog\";\n\ntype ParsedOption = {\n\tvalue: string;\n\tlabel: React.ReactNode;\n\tdisabled?: boolean;\n};\n\nfunction parseOptionChildren(children: React.ReactNode): ParsedOption[] {\n\tconst options: ParsedOption[] = [];\n\tReact.Children.forEach(children, (child) => {\n\t\tif (!React.isValidElement(child) || child.type !== \"option\") return;\n\t\tconst props = child.props as React.OptionHTMLAttributes<HTMLOptionElement>;\n\t\tif (props.value === undefined || props.value === null) return;\n\t\toptions.push({\n\t\t\tvalue: String(props.value),\n\t\t\tlabel: props.children ?? String(props.value),\n\t\t\tdisabled: props.disabled,\n\t\t});\n\t});\n\treturn options;\n}\n\nconst triggerClassName =\n\t\"flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-background px-2.5 py-1 text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40\";\n\nconst popupClassName =\n\t\"pointer-events-auto z-[100] max-h-(--available-height) min-w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95\";\n\nconst itemClassName =\n\t\"relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none pointer-events-auto data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-accent data-highlighted:text-accent-foreground data-selected:bg-accent/50\";\n\ntype SelectProps = Omit<\n\tReact.ComponentProps<\"select\">,\n\t\"onChange\" | \"children\" | \"size\" | \"multiple\"\n> & {\n\tonChange?: React.ChangeEventHandler<HTMLSelectElement>;\n\tchildren?: React.ReactNode;\n};\n\nfunction optionsSignature(options: ParsedOption[]): string {\n\treturn options\n\t\t.map(\n\t\t\t(option) =>\n\t\t\t\t`${option.value}\\0${option.disabled ? \"1\" : \"0\"}\\0${\n\t\t\t\t\ttypeof option.label === \"string\" ? option.label : \"\"\n\t\t\t\t}`,\n\t\t)\n\t\t.join(\"\\n\");\n}\n\nfunction Select({\n\tclassName,\n\tchildren,\n\tvalue,\n\tdefaultValue,\n\tonChange,\n\tdisabled,\n\trequired,\n\tname,\n\tid,\n\tautoFocus,\n\ttabIndex,\n\t\"aria-label\": ariaLabel,\n\t\"aria-labelledby\": ariaLabelledby,\n\t\"aria-describedby\": ariaDescribedby,\n\t\"aria-invalid\": ariaInvalid,\n}: SelectProps) {\n\tconst dialogPortalContainer = useDialogPortalContainer();\n\t// `children` is a new element tree every parent render; keep the same options\n\t// array when value/label/disabled are unchanged so an open list does not remount.\n\tconst optionsRef = React.useRef<ParsedOption[]>([]);\n\tconst nextOptions = parseOptionChildren(children);\n\tif (optionsSignature(optionsRef.current) !== optionsSignature(nextOptions)) {\n\t\toptionsRef.current = nextOptions;\n\t}\n\tconst options = optionsRef.current;\n\tconst items = React.useMemo(\n\t\t() =>\n\t\t\toptions.map((option) => ({ value: option.value, label: option.label })),\n\t\t[options],\n\t);\n\n\tconst handleValueChange = React.useCallback(\n\t\t(next: string | null) => {\n\t\t\tif (!onChange) return;\n\t\t\tconst nextValue = next ?? \"\";\n\t\t\tonChange({\n\t\t\t\ttarget: { value: nextValue },\n\t\t\t\tcurrentTarget: { value: nextValue },\n\t\t\t} as React.ChangeEvent<HTMLSelectElement>);\n\t\t},\n\t\t[onChange],\n\t);\n\n\t// Base UI rejects \"\" as a controlled value (throws → workspace error boundary).\n\tconst controlledValue =\n\t\tvalue === undefined || value === null || value === \"\"\n\t\t\t? null\n\t\t\t: String(value);\n\tconst uncontrolledDefault =\n\t\tdefaultValue === undefined || defaultValue === null || defaultValue === \"\"\n\t\t\t? undefined\n\t\t\t: String(defaultValue);\n\n\tif (options.length === 0) {\n\t\treturn (\n\t\t\t<select\n\t\t\t\tdata-slot=\"select\"\n\t\t\t\tclassName={cn(triggerClassName, className)}\n\t\t\t\tdisabled\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SelectPrimitive.Root\n\t\t\tname={name}\n\t\t\trequired={required}\n\t\t\tdisabled={disabled}\n\t\t\t// Keep the Base UI default (modal). `modal={false}` leaves the popup under\n\t\t\t// Radix Dialog's body `pointer-events: none`, so options cannot be clicked\n\t\t\t// and the list appears to blur/collapse immediately.\n\t\t\titems={items}\n\t\t\tvalue={controlledValue}\n\t\t\tdefaultValue={uncontrolledDefault}\n\t\t\tonValueChange={handleValueChange}\n\t\t>\n\t\t\t<SelectPrimitive.Trigger\n\t\t\t\tdata-slot=\"select\"\n\t\t\t\tid={id}\n\t\t\t\tautoFocus={autoFocus}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\taria-describedby={ariaDescribedby}\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tclassName={cn(triggerClassName, className)}\n\t\t\t>\n\t\t\t\t<SelectPrimitive.Value className=\"truncate text-left\" />\n\t\t\t\t<SelectPrimitive.Icon className=\"pointer-events-none shrink-0 text-muted-foreground\">\n\t\t\t\t\t<ChevronDownIcon className=\"size-4\" />\n\t\t\t\t</SelectPrimitive.Icon>\n\t\t\t</SelectPrimitive.Trigger>\n\t\t\t{/* Prefer Dialog content as portal root so Radix focus trap keeps the list\n\t\t\t open; fall back to body with pointer-events/z overrides. */}\n\t\t\t<SelectPrimitive.Portal container={dialogPortalContainer ?? undefined}>\n\t\t\t\t<SelectPrimitive.Positioner\n\t\t\t\t\talignItemWithTrigger={false}\n\t\t\t\t\tdata-slot=\"select-positioner\"\n\t\t\t\t\tclassName=\"pointer-events-auto isolate z-[100] outline-none\"\n\t\t\t\t\tsideOffset={4}\n\t\t\t\t>\n\t\t\t\t\t<SelectPrimitive.Popup\n\t\t\t\t\t\tdata-slot=\"select-popup\"\n\t\t\t\t\t\tclassName={popupClassName}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectPrimitive.List onWheel={(event) => event.stopPropagation()}>\n\t\t\t\t\t\t\t{options.map((option) => (\n\t\t\t\t\t\t\t\t<SelectPrimitive.Item\n\t\t\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\ttypeof option.label === \"string\"\n\t\t\t\t\t\t\t\t\t\t\t? option.label\n\t\t\t\t\t\t\t\t\t\t\t: option.value\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdisabled={option.disabled}\n\t\t\t\t\t\t\t\t\tclassName={itemClassName}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<SelectPrimitive.ItemText>\n\t\t\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t\t\t</SelectPrimitive.ItemText>\n\t\t\t\t\t\t\t\t\t<SelectPrimitive.ItemIndicator className=\"pointer-events-none absolute right-1.5 flex size-4 items-center justify-center\">\n\t\t\t\t\t\t\t\t\t\t<CheckIcon className=\"size-4\" />\n\t\t\t\t\t\t\t\t\t</SelectPrimitive.ItemIndicator>\n\t\t\t\t\t\t\t\t</SelectPrimitive.Item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</SelectPrimitive.List>\n\t\t\t\t\t</SelectPrimitive.Popup>\n\t\t\t\t</SelectPrimitive.Positioner>\n\t\t\t</SelectPrimitive.Portal>\n\t\t</SelectPrimitive.Root>\n\t);\n}\n\nexport { Select };\n"]}
|
package/dist/ui/textarea.js
CHANGED
|
@@ -12,7 +12,7 @@ function Textarea({ className, ...props }) {
|
|
|
12
12
|
{
|
|
13
13
|
"data-slot": "textarea",
|
|
14
14
|
className: cn(
|
|
15
|
-
"min-h-24 w-full min-w-0 rounded-lg border border-input bg-
|
|
15
|
+
"min-h-24 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
16
16
|
className
|
|
17
17
|
),
|
|
18
18
|
...props
|
package/dist/ui/textarea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/textarea.tsx"],"names":[],"mappings":";;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACCA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqC;AAC5E,EAAA,uBACC,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/textarea.tsx"],"names":[],"mappings":";;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACCA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqC;AAC5E,EAAA,uBACC,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,kiBAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"textarea.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","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../lib/utils\";\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n\treturn (\n\t\t<textarea\n\t\t\tdata-slot=\"textarea\"\n\t\t\tclassName={cn(\n\t\t\t\t\"min-h-24 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Textarea };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yenio-pld/blocks",
|
|
3
|
-
"version": "1.2.0-rc.
|
|
3
|
+
"version": "1.2.0-rc.28",
|
|
4
4
|
"description": "Shared UI components for Yenio applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -27,6 +27,16 @@
|
|
|
27
27
|
"default": "./dist/avatar.cjs"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
+
"./brand": {
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/brand.d.ts",
|
|
33
|
+
"default": "./dist/brand.js"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/brand.d.cts",
|
|
37
|
+
"default": "./dist/brand.cjs"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
30
40
|
"./consent": {
|
|
31
41
|
"import": {
|
|
32
42
|
"types": "./dist/consent.d.ts",
|
package/scripts/check-theme.mjs
CHANGED
|
@@ -13,10 +13,8 @@ const SKIP_DIRS = new Set([
|
|
|
13
13
|
const TOKEN_DECLARATION =
|
|
14
14
|
/--(?:background|foreground|card|popover|primary|secondary|muted|accent|destructive|border|input|ring|skeleton|sidebar|chart-[1-5])\s*:/;
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
"../src/theme.css",
|
|
19
|
-
);
|
|
16
|
+
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
17
|
+
const canonical = resolve(packageRoot, "src/theme.css");
|
|
20
18
|
|
|
21
19
|
function identity(path) {
|
|
22
20
|
const resolved = resolve(path);
|
|
@@ -46,7 +44,10 @@ function walk(dir, out) {
|
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
const roots = process.argv.slice(2);
|
|
49
|
-
|
|
47
|
+
// Default to the package root (not process.cwd()) so a caller that cds
|
|
48
|
+
// elsewhere cannot poison the scan. Explicit roots (unit tests / app
|
|
49
|
+
// `theme:check src`) still win.
|
|
50
|
+
const scanRoots = roots.length > 0 ? roots : [packageRoot];
|
|
50
51
|
const files = [];
|
|
51
52
|
for (const root of scanRoots) {
|
|
52
53
|
walk(resolve(root), files);
|
package/src/theme.css
CHANGED
|
@@ -1,45 +1,77 @@
|
|
|
1
|
-
/* Alhajero Onyx & Gold palette.
|
|
1
|
+
/* Alhajero Onyx & Gold palette (brand kit).
|
|
2
2
|
Light: cream surfaces + onyx primary. Dark: gold primary.
|
|
3
3
|
This file is the only color-token source.
|
|
4
4
|
Import it after `tailwindcss`. Do not copy these values into an app.
|
|
5
|
-
CSS only: no JavaScript and no client boundary.
|
|
5
|
+
CSS only: no JavaScript and no client boundary.
|
|
6
|
+
Gold #C99A3B is never used as text on cream/white (use gold-700+). */
|
|
6
7
|
|
|
7
8
|
@custom-variant dark (&:is(.dark *));
|
|
8
9
|
|
|
9
10
|
:root {
|
|
10
|
-
|
|
11
|
-
--
|
|
11
|
+
/* Brand scales (hex source of truth in brand kit). */
|
|
12
|
+
--onyx-50: oklch(0.97 0.003 84.56);
|
|
13
|
+
--onyx-100: oklch(0.925 0.006 84.57);
|
|
14
|
+
--onyx-200: oklch(0.846 0.011 81.79);
|
|
15
|
+
--onyx-300: oklch(0.724 0.016 80.69);
|
|
16
|
+
--onyx-400: oklch(0.596 0.02 81.29);
|
|
17
|
+
--onyx-500: oklch(0.49 0.02 75.94);
|
|
18
|
+
--onyx-600: oklch(0.402 0.017 74.17);
|
|
19
|
+
--onyx-700: oklch(0.323 0.017 63.38);
|
|
20
|
+
--onyx-800: oklch(0.249 0.017 66.93);
|
|
21
|
+
--onyx-900: oklch(0.185 0.008 67.32);
|
|
22
|
+
--onyx-950: oklch(0.146 0.006 69.2);
|
|
23
|
+
|
|
24
|
+
--gold-50: oklch(0.981 0.027 93.1);
|
|
25
|
+
--gold-100: oklch(0.954 0.073 94.87);
|
|
26
|
+
--gold-200: oklch(0.899 0.105 91.66);
|
|
27
|
+
--gold-300: oklch(0.837 0.123 87.99);
|
|
28
|
+
--gold-400: oklch(0.753 0.127 79.85);
|
|
29
|
+
--gold-500: oklch(0.713 0.123 81.73);
|
|
30
|
+
--gold-600: oklch(0.611 0.113 78.37);
|
|
31
|
+
--gold-700: oklch(0.523 0.099 76.27);
|
|
32
|
+
--gold-800: oklch(0.435 0.081 75.18);
|
|
33
|
+
--gold-900: oklch(0.349 0.062 74.63);
|
|
34
|
+
--gold-950: oklch(0.247 0.041 76.16);
|
|
35
|
+
|
|
36
|
+
--cream-50: oklch(0.989 0.013 86.83);
|
|
37
|
+
--cream-100: oklch(0.968 0.022 87.15);
|
|
38
|
+
--cream-200: oklch(0.933 0.035 87.08);
|
|
39
|
+
|
|
40
|
+
/* Semantic tokens */
|
|
41
|
+
--background: var(--cream-50);
|
|
42
|
+
--foreground: var(--onyx-900);
|
|
12
43
|
--card: oklch(1 0 0);
|
|
13
|
-
--card-foreground:
|
|
44
|
+
--card-foreground: var(--onyx-900);
|
|
14
45
|
--popover: oklch(1 0 0);
|
|
15
|
-
--popover-foreground:
|
|
16
|
-
--primary:
|
|
46
|
+
--popover-foreground: var(--onyx-900);
|
|
47
|
+
--primary: var(--onyx-900);
|
|
17
48
|
--primary-foreground: oklch(1 0 0);
|
|
18
|
-
--secondary:
|
|
19
|
-
--secondary-foreground:
|
|
20
|
-
--muted:
|
|
21
|
-
--muted-foreground:
|
|
49
|
+
--secondary: var(--cream-100);
|
|
50
|
+
--secondary-foreground: var(--onyx-900);
|
|
51
|
+
--muted: var(--cream-100);
|
|
52
|
+
--muted-foreground: var(--onyx-500);
|
|
22
53
|
--skeleton: oklch(0.9 0 0);
|
|
23
|
-
--accent:
|
|
24
|
-
--accent-foreground:
|
|
54
|
+
--accent: var(--gold-500);
|
|
55
|
+
--accent-foreground: var(--onyx-950);
|
|
25
56
|
--destructive: oklch(0.52 0.16 25);
|
|
26
57
|
--destructive-foreground: oklch(0.98 0.01 95);
|
|
27
|
-
--border:
|
|
28
|
-
--
|
|
29
|
-
--
|
|
30
|
-
--
|
|
31
|
-
--chart-
|
|
32
|
-
--chart-
|
|
33
|
-
--chart-
|
|
34
|
-
--chart-
|
|
35
|
-
--
|
|
36
|
-
--sidebar
|
|
37
|
-
--sidebar-
|
|
58
|
+
--border: var(--cream-200);
|
|
59
|
+
/* Stronger than --border so fields keep a visible edge on cream. */
|
|
60
|
+
--input: var(--onyx-200);
|
|
61
|
+
--ring: var(--gold-500);
|
|
62
|
+
--chart-1: var(--gold-500);
|
|
63
|
+
--chart-2: var(--onyx-500);
|
|
64
|
+
--chart-3: var(--gold-300);
|
|
65
|
+
--chart-4: var(--onyx-700);
|
|
66
|
+
--chart-5: var(--gold-600);
|
|
67
|
+
--sidebar: var(--cream-100);
|
|
68
|
+
--sidebar-foreground: var(--onyx-900);
|
|
69
|
+
--sidebar-primary: var(--onyx-900);
|
|
38
70
|
--sidebar-primary-foreground: oklch(1 0 0);
|
|
39
|
-
--sidebar-accent:
|
|
40
|
-
--sidebar-accent-foreground:
|
|
41
|
-
--sidebar-border:
|
|
42
|
-
--sidebar-ring:
|
|
71
|
+
--sidebar-accent: var(--cream-200);
|
|
72
|
+
--sidebar-accent-foreground: var(--onyx-900);
|
|
73
|
+
--sidebar-border: var(--cream-200);
|
|
74
|
+
--sidebar-ring: var(--gold-500);
|
|
43
75
|
--font-sans: var(--font-inter), Inter, ui-sans-serif, sans-serif, system-ui;
|
|
44
76
|
--font-serif:
|
|
45
77
|
var(--font-outfit), Outfit, ui-sans-serif, sans-serif, system-ui;
|
|
@@ -76,39 +108,40 @@
|
|
|
76
108
|
}
|
|
77
109
|
|
|
78
110
|
.dark {
|
|
79
|
-
--background:
|
|
80
|
-
--foreground:
|
|
81
|
-
--card:
|
|
82
|
-
--card-foreground:
|
|
83
|
-
--popover:
|
|
84
|
-
--popover-foreground:
|
|
85
|
-
--primary:
|
|
86
|
-
--primary-foreground:
|
|
87
|
-
--secondary:
|
|
88
|
-
--secondary-foreground:
|
|
89
|
-
--muted:
|
|
90
|
-
--muted-foreground:
|
|
111
|
+
--background: var(--onyx-950);
|
|
112
|
+
--foreground: var(--cream-50);
|
|
113
|
+
--card: var(--onyx-900);
|
|
114
|
+
--card-foreground: var(--cream-50);
|
|
115
|
+
--popover: var(--onyx-900);
|
|
116
|
+
--popover-foreground: var(--cream-50);
|
|
117
|
+
--primary: var(--gold-500);
|
|
118
|
+
--primary-foreground: var(--onyx-950);
|
|
119
|
+
--secondary: var(--onyx-800);
|
|
120
|
+
--secondary-foreground: var(--cream-50);
|
|
121
|
+
--muted: var(--onyx-800);
|
|
122
|
+
--muted-foreground: var(--onyx-300);
|
|
91
123
|
--skeleton: oklch(0.32 0 0);
|
|
92
|
-
--accent:
|
|
93
|
-
--accent-foreground:
|
|
124
|
+
--accent: var(--gold-300);
|
|
125
|
+
--accent-foreground: var(--onyx-950);
|
|
94
126
|
--destructive: oklch(0.65 0.15 25);
|
|
95
127
|
--destructive-foreground: oklch(0.98 0.005 250);
|
|
96
|
-
--border:
|
|
97
|
-
--
|
|
98
|
-
--
|
|
99
|
-
--
|
|
100
|
-
--chart-
|
|
101
|
-
--chart-
|
|
102
|
-
--chart-
|
|
103
|
-
--chart-
|
|
104
|
-
--
|
|
105
|
-
--sidebar
|
|
106
|
-
--sidebar-
|
|
107
|
-
--sidebar-primary
|
|
108
|
-
--sidebar-
|
|
109
|
-
--sidebar-accent
|
|
110
|
-
--sidebar-
|
|
111
|
-
--sidebar-
|
|
128
|
+
--border: var(--onyx-700);
|
|
129
|
+
/* Slightly lighter than --border so filled fields still read. */
|
|
130
|
+
--input: var(--onyx-600);
|
|
131
|
+
--ring: var(--gold-500);
|
|
132
|
+
--chart-1: var(--gold-500);
|
|
133
|
+
--chart-2: var(--onyx-300);
|
|
134
|
+
--chart-3: var(--gold-300);
|
|
135
|
+
--chart-4: var(--onyx-500);
|
|
136
|
+
--chart-5: var(--gold-600);
|
|
137
|
+
--sidebar: var(--onyx-900);
|
|
138
|
+
--sidebar-foreground: var(--cream-50);
|
|
139
|
+
--sidebar-primary: var(--gold-500);
|
|
140
|
+
--sidebar-primary-foreground: var(--onyx-950);
|
|
141
|
+
--sidebar-accent: var(--onyx-800);
|
|
142
|
+
--sidebar-accent-foreground: var(--cream-50);
|
|
143
|
+
--sidebar-border: var(--onyx-700);
|
|
144
|
+
--sidebar-ring: var(--gold-500);
|
|
112
145
|
--font-sans: var(--font-inter), Inter, ui-sans-serif, sans-serif, system-ui;
|
|
113
146
|
--font-serif:
|
|
114
147
|
var(--font-outfit), Outfit, ui-sans-serif, sans-serif, system-ui;
|
|
@@ -138,6 +171,34 @@
|
|
|
138
171
|
}
|
|
139
172
|
|
|
140
173
|
@theme inline {
|
|
174
|
+
--color-onyx-50: var(--onyx-50);
|
|
175
|
+
--color-onyx-100: var(--onyx-100);
|
|
176
|
+
--color-onyx-200: var(--onyx-200);
|
|
177
|
+
--color-onyx-300: var(--onyx-300);
|
|
178
|
+
--color-onyx-400: var(--onyx-400);
|
|
179
|
+
--color-onyx-500: var(--onyx-500);
|
|
180
|
+
--color-onyx-600: var(--onyx-600);
|
|
181
|
+
--color-onyx-700: var(--onyx-700);
|
|
182
|
+
--color-onyx-800: var(--onyx-800);
|
|
183
|
+
--color-onyx-900: var(--onyx-900);
|
|
184
|
+
--color-onyx-950: var(--onyx-950);
|
|
185
|
+
|
|
186
|
+
--color-gold-50: var(--gold-50);
|
|
187
|
+
--color-gold-100: var(--gold-100);
|
|
188
|
+
--color-gold-200: var(--gold-200);
|
|
189
|
+
--color-gold-300: var(--gold-300);
|
|
190
|
+
--color-gold-400: var(--gold-400);
|
|
191
|
+
--color-gold-500: var(--gold-500);
|
|
192
|
+
--color-gold-600: var(--gold-600);
|
|
193
|
+
--color-gold-700: var(--gold-700);
|
|
194
|
+
--color-gold-800: var(--gold-800);
|
|
195
|
+
--color-gold-900: var(--gold-900);
|
|
196
|
+
--color-gold-950: var(--gold-950);
|
|
197
|
+
|
|
198
|
+
--color-cream-50: var(--cream-50);
|
|
199
|
+
--color-cream-100: var(--cream-100);
|
|
200
|
+
--color-cream-200: var(--cream-200);
|
|
201
|
+
|
|
141
202
|
--color-background: var(--background);
|
|
142
203
|
--color-foreground: var(--foreground);
|
|
143
204
|
--color-card: var(--card);
|
|
@@ -196,6 +257,49 @@
|
|
|
196
257
|
--tracking-wide: calc(var(--tracking-normal) + 0.025em);
|
|
197
258
|
--tracking-wider: calc(var(--tracking-normal) + 0.05em);
|
|
198
259
|
--tracking-widest: calc(var(--tracking-normal) + 0.1em);
|
|
260
|
+
|
|
261
|
+
--animate-gem-in: gem-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
|
|
262
|
+
--animate-gem-shimmer: gem-shimmer 3.2s ease-in-out infinite;
|
|
263
|
+
--animate-gem-glint: gem-glint 3.2s ease-in-out infinite;
|
|
264
|
+
|
|
265
|
+
@keyframes gem-in {
|
|
266
|
+
from {
|
|
267
|
+
opacity: 0;
|
|
268
|
+
transform: scale(0.2) rotate(-25deg);
|
|
269
|
+
}
|
|
270
|
+
to {
|
|
271
|
+
opacity: 1;
|
|
272
|
+
transform: none;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@keyframes gem-shimmer {
|
|
277
|
+
0%,
|
|
278
|
+
70%,
|
|
279
|
+
100% {
|
|
280
|
+
filter: none;
|
|
281
|
+
}
|
|
282
|
+
80% {
|
|
283
|
+
filter: brightness(1.18);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@keyframes gem-glint {
|
|
288
|
+
0%,
|
|
289
|
+
70%,
|
|
290
|
+
100% {
|
|
291
|
+
opacity: 0;
|
|
292
|
+
transform: scale(0.2) rotate(0);
|
|
293
|
+
}
|
|
294
|
+
80% {
|
|
295
|
+
opacity: 1;
|
|
296
|
+
transform: scale(1.1) rotate(45deg);
|
|
297
|
+
}
|
|
298
|
+
90% {
|
|
299
|
+
opacity: 0;
|
|
300
|
+
transform: scale(0.3) rotate(90deg);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
199
303
|
}
|
|
200
304
|
|
|
201
305
|
/*
|
|
@@ -275,7 +379,15 @@
|
|
|
275
379
|
.bg-onyx-velvet {
|
|
276
380
|
background: radial-gradient(
|
|
277
381
|
ellipse at 30% 20%,
|
|
278
|
-
|
|
279
|
-
|
|
382
|
+
var(--onyx-700) 0%,
|
|
383
|
+
var(--onyx-900) 62%
|
|
280
384
|
);
|
|
281
385
|
}
|
|
386
|
+
|
|
387
|
+
@media (prefers-reduced-motion: reduce) {
|
|
388
|
+
.animate-gem-in,
|
|
389
|
+
.animate-gem-shimmer,
|
|
390
|
+
.animate-gem-glint {
|
|
391
|
+
animation: none;
|
|
392
|
+
}
|
|
393
|
+
}
|