@rimelight/ui 0.0.3 → 0.0.5
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/package.json +25 -5
- package/src/components/astro/RLAButton.astro +95 -0
- package/src/components/vue/RLVButton.vue +77 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useComponentUI.ts +27 -0
- package/src/config/site.config.ts +5 -23
- package/src/domain/i18n/fetcher.ts +14 -4
- package/src/domain/i18n/middleware/i18n.ts +2 -1
- package/src/domain/seo/constants.ts +2 -16
- package/src/domain/seo/services/llms.ts +13 -10
- package/src/domain/seo/utils.ts +3 -4
- package/src/env.d.ts +9 -42
- package/src/integrations/index.ts +2 -0
- package/src/integrations/sri.ts +2 -2
- package/src/integrations/ui.ts +81 -0
- package/src/middleware/index.ts +1 -0
- package/src/middleware/security.ts +15 -0
- package/src/middleware/sri.ts +4 -2
- package/src/themes/button.theme.ts +45 -0
- package/src/themes/index.ts +11 -0
- package/worker-configuration.d.ts +0 -14791
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ClassValue } from "css-variants"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared button theme configuration. Used by both RLAButton (Astro) and RLVButton (Vue) components.
|
|
5
|
+
*/
|
|
6
|
+
export const buttonTheme = {
|
|
7
|
+
base: [
|
|
8
|
+
"inline-flex items-center justify-center gap-4xs rounded-md font-medium ws-nowrap",
|
|
9
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
10
|
+
"transition-all outline-none focus-visible:ring-3",
|
|
11
|
+
"disabled:pointer-events-none disabled:op-50",
|
|
12
|
+
"aria-invalid:border-error aria-invalid:focus-visible:ring-error/40"
|
|
13
|
+
] satisfies ClassValue,
|
|
14
|
+
variants: {
|
|
15
|
+
variant: {
|
|
16
|
+
default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
|
|
17
|
+
primary:
|
|
18
|
+
"bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
|
|
19
|
+
secondary:
|
|
20
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/90 focus-visible:ring-secondary/50",
|
|
21
|
+
outline:
|
|
22
|
+
"dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground b shadow-xs",
|
|
23
|
+
ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
|
|
24
|
+
info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
|
|
25
|
+
success:
|
|
26
|
+
"bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/50",
|
|
27
|
+
warning:
|
|
28
|
+
"bg-warning text-warning-foreground hover:bg-warning/90 focus-visible:ring-warning/50",
|
|
29
|
+
error: "bg-error text-error-foreground hover:bg-error/90 focus-visible:ring-error/50"
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
"xs": "px-xs py-2xs text-xs has-[>svg]:px-xs [&_svg:not([class*='size-'])]:size-xs",
|
|
33
|
+
"sm": "px-sm py-3xs text-sm has-[>svg]:px-sm [&_svg:not([class*='size-'])]:size-sm",
|
|
34
|
+
"md": "px-md py-2xs text-md has-[>svg]:px-md [&_svg:not([class*='size-'])]:size-md",
|
|
35
|
+
"lg": "px-lg py-xs text-lg has-[>svg]:px-lg [&_svg:not([class*='size-'])]:size-lg",
|
|
36
|
+
"xl": "px-xl py-sm text-xl has-[>svg]:px-xl [&_svg:not([class*='size-'])]:size-xl",
|
|
37
|
+
"icon": "size-10 p-0",
|
|
38
|
+
"icon-sm": "size-8 p-0"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
variant: "default",
|
|
43
|
+
size: "md"
|
|
44
|
+
}
|
|
45
|
+
} as const
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { buttonTheme } from "./button.theme"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default UI configuration for all components. This is the baseline that gets merged with
|
|
5
|
+
* user-provided overrides via the Astro integration options.
|
|
6
|
+
*/
|
|
7
|
+
export const defaultUIConfig = {
|
|
8
|
+
button: buttonTheme
|
|
9
|
+
} as const
|
|
10
|
+
|
|
11
|
+
export type DefaultUIConfig = typeof defaultUIConfig
|