@rimelight/ui 0.0.34 → 0.0.36
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 -0
- package/package.json +19 -24
- package/src/components/astro/RLAAccordion.astro +94 -18
- package/src/components/astro/RLAAvatar.astro +135 -68
- package/src/components/astro/RLABadge.astro +4 -2
- package/src/components/astro/RLABanner.astro +138 -23
- package/src/components/astro/RLABreadcrumb.astro +13 -0
- package/src/components/astro/RLAButton.astro +8 -4
- package/src/components/astro/RLACallout.astro +112 -0
- package/src/components/astro/RLACard.astro +6 -5
- package/src/components/astro/RLACarousel.astro +104 -75
- package/src/components/astro/RLAChart.astro +4 -1
- package/src/components/astro/RLAChip.astro +11 -5
- package/src/components/astro/RLACollapsible.astro +4 -1
- package/src/components/astro/RLAColorArea.astro +432 -0
- package/src/components/astro/RLAColorField.astro +300 -0
- package/src/components/astro/RLAColorSlider.astro +413 -0
- package/src/components/astro/RLAConfirm.astro +13 -11
- package/src/components/astro/RLACopyMarkdown.astro +78 -0
- package/src/components/astro/RLADate.astro +30 -0
- package/src/components/astro/RLADrawer.astro +50 -3
- package/src/components/astro/RLADropdownMenu.astro +78 -51
- package/src/components/astro/RLAFieldGroup.astro +4 -1
- package/src/components/astro/RLAFileUpload.astro +114 -100
- package/src/components/astro/RLAFooter.astro +2 -1
- package/src/components/astro/RLAFormField.astro +10 -6
- package/src/components/astro/RLAGrid.astro +31 -39
- package/src/components/astro/RLAHead.astro +139 -39
- package/src/components/astro/RLAHeader.astro +2 -1
- package/src/components/astro/RLAImage.astro +274 -251
- package/src/components/astro/RLAInput.astro +14 -9
- package/src/components/astro/RLAInputMenu.astro +119 -83
- package/src/components/astro/RLAKbd.astro +5 -5
- package/src/components/astro/RLALayoutGrid.astro +395 -0
- package/src/components/astro/RLALink.astro +23 -1
- package/src/components/astro/RLALinkGroup.astro +99 -99
- package/src/components/astro/RLALocaleSelector.astro +34 -41
- package/src/components/astro/RLALogo.astro +117 -90
- package/src/components/astro/RLAModal.astro +48 -18
- package/src/components/astro/RLANavigationMenu.astro +381 -326
- package/src/components/astro/{RLADocsPackageManagers.astro → RLAPackageManagers.astro} +81 -87
- package/src/components/astro/RLAPageSection.astro +4 -2
- package/src/components/astro/RLAPopover.astro +4 -3
- package/src/components/astro/RLAPost.astro +11 -2
- package/src/components/astro/RLAScrollArea.astro +4 -1
- package/src/components/astro/RLAScrollToTop.astro +200 -172
- package/src/components/astro/RLASearch.astro +282 -0
- package/src/components/astro/RLASelect.astro +78 -55
- package/src/components/astro/RLASeparator.astro +11 -6
- package/src/components/astro/RLAShare.astro +60 -0
- package/src/components/astro/RLAShortcuts.astro +429 -0
- package/src/components/astro/RLASidebar.astro +158 -212
- package/src/components/astro/RLASlideover.astro +47 -17
- package/src/components/astro/RLASplitter.astro +194 -141
- package/src/components/astro/RLASteps.astro +118 -71
- package/src/components/astro/RLASurround.astro +39 -0
- package/src/components/astro/RLATable.astro +4 -1
- package/src/components/astro/RLATableOfContents.astro +109 -23
- package/src/components/astro/RLATabs.astro +147 -133
- package/src/components/astro/RLATextarea.astro +4 -1
- package/src/components/astro/RLAThemeSelector.astro +105 -76
- package/src/components/astro/RLAToast.astro +35 -21
- package/src/components/vue/RLVBanner.vue +230 -0
- package/src/components/vue/RLVButton.vue +3 -2
- package/src/components/vue/RLVCheckbox.vue +4 -2
- package/src/components/vue/RLVFooter.vue +3 -2
- package/src/components/vue/RLVHeader.vue +3 -2
- package/src/components/vue/RLVIcon.vue +4 -2
- package/src/components/vue/RLVInput.vue +5 -4
- package/src/components/vue/RLVLogo.vue +25 -3
- package/src/components/vue/RLVPlaceholder.vue +3 -2
- package/src/components/vue/RLVPost.vue +8 -2
- package/src/components/vue/RLVProgress.vue +60 -0
- package/src/components/vue/RLVScrollToTop.vue +65 -52
- package/src/components/vue/RLVSection.vue +14 -13
- package/src/components/vue/RLVToast.vue +17 -4
- package/src/composables/index.ts +1 -0
- package/src/composables/useHeaderStore.ts +1 -0
- package/src/composables/useShortcuts.ts +11 -0
- package/src/config/security.ts +43 -36
- package/src/config/site.config.ts +1 -0
- package/src/docs/components/ApiChangelog.astro +147 -0
- package/src/{plugins/starlightDocsApi → docs}/components/ApiEmits.astro +4 -4
- package/src/{plugins/starlightDocsApi → docs}/components/ApiProps.astro +4 -4
- package/src/{plugins/starlightDocsApi → docs}/components/ApiSlots.astro +4 -4
- package/src/docs/components/ApiTheme.astro +100 -0
- package/src/docs/extractAll.ts +94 -0
- package/src/docs/extractors/extractAstro.ts +69 -0
- package/src/docs/extractors/extractTheme.ts +56 -0
- package/src/{plugins/starlightDocsApi/extract-vue.ts → docs/extractors/extractVue.ts} +164 -15
- package/src/{plugins/starlightDocsApi → docs}/utils.ts +1 -2
- package/src/env.d.ts +0 -12
- package/src/integrations/ui.ts +35 -19
- package/src/middleware/security.ts +75 -19
- package/src/presets/index.ts +118 -293
- package/src/styles/index.css +0 -2
- package/src/themes/accordion.theme.ts +29 -3
- package/src/themes/aspect-ratio.theme.ts +1 -1
- package/src/themes/avatar-group.theme.ts +1 -1
- package/src/themes/avatar.theme.ts +2 -2
- package/src/themes/badge.theme.ts +2 -3
- package/src/themes/banner.theme.ts +40 -4
- package/src/themes/breadcrumb.theme.ts +1 -1
- package/src/themes/button.theme.ts +21 -22
- package/src/themes/{alert.theme.ts → callout.theme.ts} +12 -39
- package/src/themes/card.theme.ts +17 -9
- package/src/themes/carousel.theme.ts +1 -1
- package/src/themes/checkbox.theme.ts +1 -2
- package/src/themes/chip.theme.ts +2 -3
- package/src/themes/color-area.theme.ts +33 -0
- package/src/themes/color-field.theme.ts +32 -0
- package/src/themes/color-slider.theme.ts +34 -0
- package/src/themes/confirm.theme.ts +1 -1
- package/src/themes/container.theme.ts +1 -1
- package/src/themes/drawer.theme.ts +1 -1
- package/src/themes/footer.theme.ts +2 -2
- package/src/themes/grid.theme.ts +38 -0
- package/src/themes/header.theme.ts +4 -3
- package/src/themes/hover-card.theme.ts +1 -1
- package/src/themes/image.theme.ts +11 -1
- package/src/themes/input.theme.ts +7 -1
- package/src/themes/kbd.theme.ts +2 -3
- package/src/themes/label.theme.ts +1 -1
- package/src/themes/layout-grid.theme.ts +16 -0
- package/src/themes/link-group.theme.ts +0 -4
- package/src/themes/marquee.theme.ts +1 -1
- package/src/themes/modal.theme.ts +1 -1
- package/src/themes/navigation-menu.theme.ts +2 -2
- package/src/themes/page-section.theme.ts +4 -2
- package/src/themes/pagination.theme.ts +1 -1
- package/src/themes/pin-input.theme.ts +1 -1
- package/src/themes/popover.theme.ts +1 -1
- package/src/themes/post.theme.ts +23 -3
- package/src/themes/progress.theme.ts +1 -2
- package/src/themes/scroll-to-top.theme.ts +2 -3
- package/src/themes/search.theme.ts +64 -0
- package/src/themes/separator.theme.ts +1 -1
- package/src/themes/slideover.theme.ts +1 -1
- package/src/themes/slider.theme.ts +1 -2
- package/src/themes/spinner.theme.ts +1 -2
- package/src/themes/{megamenu.theme.ts → steps.theme.ts} +3 -3
- package/src/themes/sticky-surface.theme.ts +1 -1
- package/src/themes/switch.theme.ts +1 -2
- package/src/themes/table-of-contents.theme.ts +21 -2
- package/src/themes/timeline.theme.ts +7 -2
- package/src/themes/toast.theme.ts +1 -1
- package/src/types/components/accordion.ts +35 -2
- package/src/types/components/avatar.ts +16 -0
- package/src/types/components/banner.ts +42 -0
- package/src/types/components/button.ts +3 -4
- package/src/types/components/{alert.ts → callout.ts} +6 -6
- package/src/types/components/color-area.ts +19 -0
- package/src/types/components/color-field.ts +21 -0
- package/src/types/components/color-slider.ts +20 -0
- package/src/types/components/grid.ts +23 -0
- package/src/types/components/input.ts +4 -0
- package/src/types/components/layout-grid.ts +145 -0
- package/src/types/components/link-group.ts +4 -2
- package/src/types/components/link.ts +15 -0
- package/src/types/components/logo.ts +3 -3
- package/src/types/components/post.ts +12 -0
- package/src/types/components/search.ts +29 -0
- package/src/types/components/sidebar.ts +2 -6
- package/src/types/components/{megamenu.ts → steps.ts} +7 -1
- package/src/types/components/table-of-contents.ts +22 -0
- package/src/types/components/toast.ts +4 -0
- package/src/types/docs.ts +40 -0
- package/src/types/index.ts +151 -1
- package/src/types/theme.ts +6 -6
- package/src/utils/color.ts +165 -0
- package/src/utils/docs.ts +260 -110
- package/src/utils/headerStack.ts +24 -4
- package/src/utils/index.ts +2 -0
- package/src/utils/shortcuts.ts +322 -0
- package/src/components/TableOfContents.astro +0 -107
- package/src/components/astro/RLAAlert.astro +0 -93
- package/src/components/astro/RLAChangelog.astro +0 -23
- package/src/components/astro/RLAMegamenu.astro +0 -23
- package/src/plugins/index.ts +0 -2
- package/src/plugins/starlightDocsApi/components/ApiTheme.astro +0 -27
- package/src/plugins/starlightDocsApi/index.ts +0 -272
- package/src/styles/prism.css +0 -42
- package/src/themes/changelog.theme.ts +0 -13
- package/src/types/components/index.ts +0 -134
- /package/src/{plugins/starlightDocsApi → docs}/types.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const createBadgeTheme = (colors: string[] = defaultColors) =>
|
|
4
|
+
export const createBadgeTheme = (colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
6
|
slots: ["root", "label", "leadingIcon", "leadingAvatar", "leadingAvatarSize", "trailingIcon"],
|
|
7
7
|
base: {
|
|
@@ -22,7 +22,7 @@ export const createBadgeTheme = (colors: string[] = defaultColors) =>
|
|
|
22
22
|
color: {
|
|
23
23
|
...Object.fromEntries(colors.map((color) => [color, { root: "" }])),
|
|
24
24
|
neutral: { root: "" }
|
|
25
|
-
},
|
|
25
|
+
} as Record<string, { root: string }>,
|
|
26
26
|
size: {
|
|
27
27
|
xs: {
|
|
28
28
|
root: "text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm",
|
|
@@ -64,7 +64,6 @@ export const createBadgeTheme = (colors: string[] = defaultColors) =>
|
|
|
64
64
|
true: { root: "" }
|
|
65
65
|
},
|
|
66
66
|
theme: {
|
|
67
|
-
flat: { root: "rl-flat" },
|
|
68
67
|
light: { root: "rl-light" },
|
|
69
68
|
dark: { root: "rl-dark" }
|
|
70
69
|
}
|
|
@@ -2,12 +2,48 @@ import { defineTheme } from "../utils/defineTheme"
|
|
|
2
2
|
|
|
3
3
|
export const createBannerTheme = () =>
|
|
4
4
|
defineTheme({
|
|
5
|
-
slots: ["root"],
|
|
5
|
+
slots: ["root", "content", "container", "center", "left", "side", "actions", "dismiss"],
|
|
6
6
|
base: {
|
|
7
|
-
root: ""
|
|
7
|
+
root: "w-full",
|
|
8
|
+
content: "w-full",
|
|
9
|
+
container:
|
|
10
|
+
"relative flex flex-row items-center min-h-12 md:h-14 px-xs sm:px-md md:px-xl lg:px-xl text-sm gap-2",
|
|
11
|
+
left: "absolute left-0 inset-y-0 flex items-center px-4 max-w-[30%] truncate",
|
|
12
|
+
center: "absolute left-1/2 -translate-x-1/2 max-w-[50%] truncate text-center",
|
|
13
|
+
side: "flex-none flex items-center gap-2",
|
|
14
|
+
actions: "flex-none flex items-center gap-2xs",
|
|
15
|
+
dismiss:
|
|
16
|
+
"flex-none flex items-center justify-center size-8 rounded-md hover:bg-black/10 dark:hover:bg-white/10 transition-colors cursor-pointer"
|
|
8
17
|
},
|
|
9
|
-
variants: {
|
|
10
|
-
|
|
18
|
+
variants: {
|
|
19
|
+
contain: {
|
|
20
|
+
true: {
|
|
21
|
+
container: "mx-auto max-w-90rem"
|
|
22
|
+
},
|
|
23
|
+
false: {
|
|
24
|
+
container: "max-w-none"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
sticky: {
|
|
28
|
+
true: {
|
|
29
|
+
root: "sticky top-0 inset-x-0 z-50"
|
|
30
|
+
},
|
|
31
|
+
false: {
|
|
32
|
+
root: ""
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
fixed: {
|
|
36
|
+
true: {
|
|
37
|
+
root: "fixed left-0 right-0 transition-[top,opacity] duration-200 ease-in-out"
|
|
38
|
+
},
|
|
39
|
+
false: {}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
contain: true,
|
|
44
|
+
sticky: false,
|
|
45
|
+
fixed: true
|
|
46
|
+
}
|
|
11
47
|
})
|
|
12
48
|
|
|
13
49
|
export default createBannerTheme()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const createBreadcrumbTheme = (
|
|
4
|
+
export const createBreadcrumbTheme = (_colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
6
|
slots: ["root", "list", "item", "link", "separator", "page"],
|
|
7
7
|
base: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const createButtonTheme = (colors: string[] = defaultColors) =>
|
|
4
|
+
export const createButtonTheme = (colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
6
|
slots: ["root", "label", "leadingIcon", "leadingAvatar", "leadingAvatarSize", "trailingIcon"],
|
|
7
7
|
base: {
|
|
8
8
|
root: [
|
|
9
|
-
"group inline-flex items-center justify-center font-medium ws-nowrap disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75",
|
|
9
|
+
"group inline-flex items-center justify-center font-medium ws-nowrap no-underline disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75",
|
|
10
10
|
"transition-colors outline-none",
|
|
11
11
|
"aria-invalid:border-error-500 aria-invalid:ring-error-500/20"
|
|
12
12
|
],
|
|
@@ -14,7 +14,7 @@ export const createButtonTheme = (colors: string[] = defaultColors) =>
|
|
|
14
14
|
leadingIcon: "shrink-0 flex items-center justify-center",
|
|
15
15
|
leadingAvatar: "shrink-0",
|
|
16
16
|
leadingAvatarSize: "",
|
|
17
|
-
trailingIcon: "shrink-0"
|
|
17
|
+
trailingIcon: "shrink-0 flex items-center justify-center"
|
|
18
18
|
},
|
|
19
19
|
variants: {
|
|
20
20
|
variant: {
|
|
@@ -28,7 +28,7 @@ export const createButtonTheme = (colors: string[] = defaultColors) =>
|
|
|
28
28
|
color: {
|
|
29
29
|
...Object.fromEntries(colors.map((color) => [color, { root: "" }])),
|
|
30
30
|
neutral: { root: "" }
|
|
31
|
-
},
|
|
31
|
+
} as Record<string, { root: string | string[] }>,
|
|
32
32
|
size: {
|
|
33
33
|
xs: {
|
|
34
34
|
root: "text-xs gap-1 [&_svg]:size-4",
|
|
@@ -37,28 +37,28 @@ export const createButtonTheme = (colors: string[] = defaultColors) =>
|
|
|
37
37
|
trailingIcon: "size-4"
|
|
38
38
|
},
|
|
39
39
|
sm: {
|
|
40
|
-
root: "text-
|
|
40
|
+
root: "text-sm gap-1.5 [&_svg]:size-4",
|
|
41
41
|
leadingIcon: "size-4",
|
|
42
|
-
leadingAvatarSize: "
|
|
42
|
+
leadingAvatarSize: "2xs",
|
|
43
43
|
trailingIcon: "size-4"
|
|
44
44
|
},
|
|
45
45
|
md: {
|
|
46
|
-
root: "text-
|
|
46
|
+
root: "text-base gap-2 [&_svg]:size-5",
|
|
47
47
|
leadingIcon: "size-5",
|
|
48
|
-
leadingAvatarSize: "
|
|
48
|
+
leadingAvatarSize: "xs",
|
|
49
49
|
trailingIcon: "size-5"
|
|
50
50
|
},
|
|
51
51
|
lg: {
|
|
52
|
-
root: "text-
|
|
52
|
+
root: "text-lg gap-2.5 [&_svg]:size-5",
|
|
53
53
|
leadingIcon: "size-5",
|
|
54
|
-
leadingAvatarSize: "
|
|
54
|
+
leadingAvatarSize: "sm",
|
|
55
55
|
trailingIcon: "size-5"
|
|
56
56
|
},
|
|
57
57
|
xl: {
|
|
58
|
-
root: "text-
|
|
59
|
-
leadingIcon: "size-
|
|
60
|
-
leadingAvatarSize: "
|
|
61
|
-
trailingIcon: "size-
|
|
58
|
+
root: "text-2xl gap-3 [&_svg]:size-7",
|
|
59
|
+
leadingIcon: "size-7",
|
|
60
|
+
leadingAvatarSize: "lg",
|
|
61
|
+
trailingIcon: "size-7"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
block: {
|
|
@@ -80,7 +80,6 @@ export const createButtonTheme = (colors: string[] = defaultColors) =>
|
|
|
80
80
|
false: { root: "" }
|
|
81
81
|
},
|
|
82
82
|
theme: {
|
|
83
|
-
flat: { root: "rl-flat" },
|
|
84
83
|
light: { root: "rl-light" },
|
|
85
84
|
dark: { root: "rl-dark" }
|
|
86
85
|
}
|
|
@@ -178,7 +177,7 @@ export const createButtonTheme = (colors: string[] = defaultColors) =>
|
|
|
178
177
|
color: "neutral",
|
|
179
178
|
variant: "ghost",
|
|
180
179
|
classNames: {
|
|
181
|
-
root: "text-default hover:bg-
|
|
180
|
+
root: "text-default hover:bg-hover active:bg-hover/80 focus:outline-none focus-visible:bg-hover hover:disabled:bg-transparent hover:aria-disabled:bg-transparent"
|
|
182
181
|
}
|
|
183
182
|
},
|
|
184
183
|
{
|
|
@@ -192,12 +191,12 @@ export const createButtonTheme = (colors: string[] = defaultColors) =>
|
|
|
192
191
|
{ square: true, size: "xs", classNames: { root: "p-1" } },
|
|
193
192
|
{ square: false, size: "sm", classNames: { root: "px-2.5 py-1.5" } },
|
|
194
193
|
{ square: true, size: "sm", classNames: { root: "p-1.5" } },
|
|
195
|
-
{ square: false, size: "md", classNames: { root: "px-
|
|
196
|
-
{ square: true, size: "md", classNames: { root: "p-
|
|
197
|
-
{ square: false, size: "lg", classNames: { root: "px-3 py-2" } },
|
|
198
|
-
{ square: true, size: "lg", classNames: { root: "p-2" } },
|
|
199
|
-
{ square: false, size: "xl", classNames: { root: "px-
|
|
200
|
-
{ square: true, size: "xl", classNames: { root: "p-
|
|
194
|
+
{ square: false, size: "md", classNames: { root: "px-3 py-2" } },
|
|
195
|
+
{ square: true, size: "md", classNames: { root: "p-2" } },
|
|
196
|
+
{ square: false, size: "lg", classNames: { root: "px-3.5 py-2.5" } },
|
|
197
|
+
{ square: true, size: "lg", classNames: { root: "p-2.5" } },
|
|
198
|
+
{ square: false, size: "xl", classNames: { root: "px-5 py-3.5" } },
|
|
199
|
+
{ square: true, size: "xl", classNames: { root: "p-3.5" } },
|
|
201
200
|
{
|
|
202
201
|
loading: true,
|
|
203
202
|
leading: true,
|
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const createCalloutTheme = (colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
|
-
slots: [
|
|
7
|
-
"root",
|
|
8
|
-
"wrapper",
|
|
9
|
-
"title",
|
|
10
|
-
"description",
|
|
11
|
-
"icon",
|
|
12
|
-
"avatar",
|
|
13
|
-
"avatarSize",
|
|
14
|
-
"actions",
|
|
15
|
-
"close"
|
|
16
|
-
],
|
|
6
|
+
slots: ["root", "body", "icon", "title", "content", "avatar", "avatarSize", "actions", "close"],
|
|
17
7
|
base: {
|
|
18
|
-
root: "relative overflow-hidden w-full rounded-lg p-4 flex gap-2.5",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
root: "relative overflow-hidden w-full rounded-lg p-4 flex gap-2.5 items-start",
|
|
9
|
+
body: "flex flex-col gap-2.5 flex-1 min-w-0",
|
|
10
|
+
icon: "shrink-0 size-6 inline-flex items-center justify-center",
|
|
11
|
+
title: "text-sm font-bold",
|
|
12
|
+
content: "text-sm opacity-90 leading-relaxed [&>:first-child]:mt-0 [&>:last-child]:mb-0",
|
|
23
13
|
avatar: "shrink-0",
|
|
24
14
|
avatarSize: "2xl",
|
|
25
|
-
actions: "flex flex-wrap gap-1.5
|
|
26
|
-
close: "p-0"
|
|
15
|
+
actions: "flex flex-wrap gap-1.5",
|
|
16
|
+
close: "p-0 ml-auto"
|
|
27
17
|
},
|
|
28
18
|
variants: {
|
|
29
19
|
variant: {
|
|
@@ -35,24 +25,8 @@ export const createAlertTheme = (colors: string[] = defaultColors) =>
|
|
|
35
25
|
color: {
|
|
36
26
|
...Object.fromEntries(colors.map((color) => [color, { root: "" }])),
|
|
37
27
|
neutral: { root: "" }
|
|
38
|
-
},
|
|
39
|
-
orientation: {
|
|
40
|
-
horizontal: {
|
|
41
|
-
root: "items-center",
|
|
42
|
-
actions: "items-center"
|
|
43
|
-
},
|
|
44
|
-
vertical: {
|
|
45
|
-
root: "items-start",
|
|
46
|
-
actions: "items-start mt-2.5"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
title: {
|
|
50
|
-
true: {
|
|
51
|
-
description: "mt-1"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
28
|
+
} as Record<string, { root: string }>,
|
|
54
29
|
theme: {
|
|
55
|
-
flat: { root: "rl-flat" },
|
|
56
30
|
light: { root: "rl-light" },
|
|
57
31
|
dark: { root: "rl-dark" }
|
|
58
32
|
}
|
|
@@ -123,9 +97,8 @@ export const createAlertTheme = (colors: string[] = defaultColors) =>
|
|
|
123
97
|
],
|
|
124
98
|
defaultVariants: {
|
|
125
99
|
color: "primary",
|
|
126
|
-
variant: "solid"
|
|
127
|
-
orientation: "horizontal"
|
|
100
|
+
variant: "solid"
|
|
128
101
|
}
|
|
129
102
|
})
|
|
130
103
|
|
|
131
|
-
export default
|
|
104
|
+
export default createCalloutTheme()
|
package/src/themes/card.theme.ts
CHANGED
|
@@ -2,14 +2,17 @@ import { defineTheme } from "../utils/defineTheme"
|
|
|
2
2
|
|
|
3
3
|
export const createCardTheme = () =>
|
|
4
4
|
defineTheme({
|
|
5
|
-
slots: ["root", "header", "title", "description", "body", "footer"],
|
|
5
|
+
slots: ["root", "header", "title", "description", "body", "footer", "overlay", "media"],
|
|
6
6
|
base: {
|
|
7
|
-
root: "rounded-lg overflow-hidden
|
|
8
|
-
header: "p-4 sm:px-6",
|
|
7
|
+
root: "rounded-lg overflow-hidden",
|
|
8
|
+
header: "p-4 sm:px-6 border-default",
|
|
9
9
|
title: "text-highlighted font-semibold",
|
|
10
|
-
description: "mt-1 text-muted text-sm",
|
|
11
|
-
body: "p-4 sm:p-6",
|
|
12
|
-
footer: "p-4 sm:px-6"
|
|
10
|
+
description: "mt-1 text-muted-foreground text-sm",
|
|
11
|
+
body: "p-4 sm:p-6 border-default",
|
|
12
|
+
footer: "p-4 sm:px-6 border-default",
|
|
13
|
+
overlay:
|
|
14
|
+
"absolute inset-0 z-10 flex flex-col justify-end p-4 bg-gradient-to-t from-black/80 to-transparent text-white",
|
|
15
|
+
media: "relative border-default"
|
|
13
16
|
},
|
|
14
17
|
variants: {
|
|
15
18
|
variant: {
|
|
@@ -19,23 +22,28 @@ export const createCardTheme = () =>
|
|
|
19
22
|
description: "text-dimmed"
|
|
20
23
|
},
|
|
21
24
|
outline: {
|
|
22
|
-
root: "bg-default
|
|
25
|
+
root: "bg-default border border-default divide-y divide-default"
|
|
23
26
|
},
|
|
24
27
|
soft: {
|
|
25
28
|
root: "bg-elevated/50 divide-y divide-default"
|
|
26
29
|
},
|
|
27
30
|
subtle: {
|
|
28
|
-
root: "bg-elevated/50
|
|
31
|
+
root: "bg-elevated/50 border border-default divide-y divide-default"
|
|
29
32
|
}
|
|
30
33
|
},
|
|
31
34
|
interactive: {
|
|
32
35
|
true: { root: "hover:shadow-md cursor-pointer" },
|
|
33
36
|
false: { root: "" }
|
|
37
|
+
},
|
|
38
|
+
overlay: {
|
|
39
|
+
true: { root: "relative" },
|
|
40
|
+
false: {}
|
|
34
41
|
}
|
|
35
42
|
},
|
|
36
43
|
defaultVariants: {
|
|
37
44
|
variant: "outline",
|
|
38
|
-
interactive: false
|
|
45
|
+
interactive: false,
|
|
46
|
+
overlay: false
|
|
39
47
|
}
|
|
40
48
|
})
|
|
41
49
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const createCarouselTheme = (
|
|
4
|
+
export const createCarouselTheme = (_colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
6
|
slots: ["root", "viewport", "container", "slide", "buttonPrev", "buttonNext", "dots", "dot"],
|
|
7
7
|
base: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const createCheckboxTheme = (colors: string[] = defaultColors) =>
|
|
4
|
+
export const createCheckboxTheme = (colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
6
|
slots: ["root", "input", "box", "indicator", "label"],
|
|
7
7
|
base: {
|
|
@@ -35,7 +35,6 @@ export const createCheckboxTheme = (colors: string[] = defaultColors) =>
|
|
|
35
35
|
false: { indicator: "scale-0" }
|
|
36
36
|
},
|
|
37
37
|
theme: {
|
|
38
|
-
flat: { root: "rl-flat" },
|
|
39
38
|
light: { root: "rl-light" },
|
|
40
39
|
dark: { root: "rl-dark" }
|
|
41
40
|
}
|
package/src/themes/chip.theme.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const createChipTheme = (colors: string[] = defaultColors) =>
|
|
4
|
+
export const createChipTheme = (colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
6
|
slots: ["root", "base"],
|
|
7
7
|
base: {
|
|
@@ -12,7 +12,7 @@ export const createChipTheme = (colors: string[] = defaultColors) =>
|
|
|
12
12
|
color: {
|
|
13
13
|
...Object.fromEntries(colors.map((color) => [color, { base: `bg-${color}` }])),
|
|
14
14
|
neutral: { base: "bg-inverted" }
|
|
15
|
-
},
|
|
15
|
+
} as Record<string, { base: string }>,
|
|
16
16
|
size: {
|
|
17
17
|
"3xs": { base: "h-[4px] min-w-[4px] text-[4px]" },
|
|
18
18
|
"2xs": { base: "h-[5px] min-w-[5px] text-[5px]" },
|
|
@@ -37,7 +37,6 @@ export const createChipTheme = (colors: string[] = defaultColors) =>
|
|
|
37
37
|
false: { base: "absolute" }
|
|
38
38
|
},
|
|
39
39
|
theme: {
|
|
40
|
-
flat: { root: "rl-flat" },
|
|
41
40
|
light: { root: "rl-light" },
|
|
42
41
|
dark: { root: "rl-dark" }
|
|
43
42
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defaultColors } from "../presets/defaults"
|
|
2
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
3
|
+
|
|
4
|
+
export const createColorAreaTheme = (colors: readonly string[] = defaultColors) =>
|
|
5
|
+
defineTheme({
|
|
6
|
+
slots: ["root", "area", "thumb"],
|
|
7
|
+
base: {
|
|
8
|
+
root: "relative block touch-none select-none rounded-lg w-full aspect-square outline-none",
|
|
9
|
+
area: "relative w-full h-full rounded-lg cursor-crosshair bg-muted outline-none",
|
|
10
|
+
thumb:
|
|
11
|
+
"absolute block size-4 rounded-full border-2 border-white shadow-md -translate-x-1/2 -translate-y-1/2 cursor-grab active:cursor-grabbing focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
color: Object.fromEntries(
|
|
15
|
+
colors.map((color) => [
|
|
16
|
+
color,
|
|
17
|
+
{
|
|
18
|
+
root: "rl-color-" + color,
|
|
19
|
+
thumb: `focus-visible:ring-[var(--rl-ring)]/50`
|
|
20
|
+
}
|
|
21
|
+
])
|
|
22
|
+
),
|
|
23
|
+
theme: {
|
|
24
|
+
light: { root: "rl-light" },
|
|
25
|
+
dark: { root: "rl-dark" }
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
color: "primary"
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
export default createColorAreaTheme()
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defaultColors } from "../presets/defaults"
|
|
2
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
3
|
+
|
|
4
|
+
export const createColorFieldTheme = (colors: readonly string[] = defaultColors) =>
|
|
5
|
+
defineTheme({
|
|
6
|
+
slots: ["root", "input"],
|
|
7
|
+
base: {
|
|
8
|
+
root: "relative flex items-center border border-border rounded-lg bg-background shadow-sm px-3 py-1.5 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
9
|
+
input:
|
|
10
|
+
"w-full bg-transparent border-0 p-0 text-sm focus:outline-none focus:ring-0 text-foreground placeholder-muted-foreground"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
color: Object.fromEntries(
|
|
14
|
+
colors.map((color) => [
|
|
15
|
+
color,
|
|
16
|
+
{
|
|
17
|
+
root: "rl-color-" + color,
|
|
18
|
+
input: `focus:ring-0`
|
|
19
|
+
}
|
|
20
|
+
])
|
|
21
|
+
),
|
|
22
|
+
theme: {
|
|
23
|
+
light: { root: "rl-light" },
|
|
24
|
+
dark: { root: "rl-dark" }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
color: "primary"
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export default createColorFieldTheme()
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defaultColors } from "../presets/defaults"
|
|
2
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
3
|
+
|
|
4
|
+
export const createColorSliderTheme = (colors: readonly string[] = defaultColors) =>
|
|
5
|
+
defineTheme({
|
|
6
|
+
slots: ["root", "track", "thumb"],
|
|
7
|
+
base: {
|
|
8
|
+
root: "relative flex w-full touch-none select-none items-center outline-none",
|
|
9
|
+
track:
|
|
10
|
+
"relative h-3 w-full grow rounded-full border border-border bg-muted cursor-pointer outline-none",
|
|
11
|
+
thumb:
|
|
12
|
+
"absolute block size-5 rounded-full border-2 border-white shadow-md cursor-grab active:cursor-grabbing focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
color: Object.fromEntries(
|
|
16
|
+
colors.map((color) => [
|
|
17
|
+
color,
|
|
18
|
+
{
|
|
19
|
+
root: "rl-color-" + color,
|
|
20
|
+
thumb: `focus-visible:ring-[var(--rl-ring)]/50`
|
|
21
|
+
}
|
|
22
|
+
])
|
|
23
|
+
),
|
|
24
|
+
theme: {
|
|
25
|
+
light: { root: "rl-light" },
|
|
26
|
+
dark: { root: "rl-dark" }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
color: "primary"
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
export default createColorSliderTheme()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const createConfirmTheme = (
|
|
4
|
+
export const createConfirmTheme = (_colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
6
|
slots: [
|
|
7
7
|
"root",
|
|
@@ -4,7 +4,7 @@ export const createContainerTheme = () =>
|
|
|
4
4
|
defineTheme({
|
|
5
5
|
slots: ["root"],
|
|
6
6
|
base: {
|
|
7
|
-
root: "w-full max-w-(--rl-container) mx-auto px-
|
|
7
|
+
root: "w-full max-w-[var(--rl-container)] mx-auto px-xs sm:px-md md:px-xl lg:px-xl"
|
|
8
8
|
},
|
|
9
9
|
variants: {},
|
|
10
10
|
defaultVariants: {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const createDrawerTheme = (
|
|
4
|
+
export const createDrawerTheme = (_colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
6
|
slots: [
|
|
7
7
|
"root",
|
|
@@ -6,7 +6,7 @@ export const createFooterTheme = () =>
|
|
|
6
6
|
base: {
|
|
7
7
|
root: "py-8 lg:py-12 overflow-hidden",
|
|
8
8
|
container:
|
|
9
|
-
"box-border flex flex-col justify-between gap-xl lg:flex-row lg:items-stretch px-
|
|
9
|
+
"box-border flex flex-col justify-between gap-xl lg:flex-row lg:items-stretch px-xs sm:px-md md:px-xl lg:px-xl w-full",
|
|
10
10
|
left: "order-last flex flex-col items-center justify-between gap-xl lg:order-1 lg:flex-none lg:items-start",
|
|
11
11
|
center: "flex flex-col items-center justify-start lg:order-2 lg:flex-1",
|
|
12
12
|
right:
|
|
@@ -15,7 +15,7 @@ export const createFooterTheme = () =>
|
|
|
15
15
|
variants: {
|
|
16
16
|
contain: {
|
|
17
17
|
true: {
|
|
18
|
-
container: "mx-auto max-w-
|
|
18
|
+
container: "mx-auto max-w-(--rl-container)"
|
|
19
19
|
},
|
|
20
20
|
false: {
|
|
21
21
|
container: "w-full"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export const createGridTheme = () =>
|
|
4
|
+
defineTheme({
|
|
5
|
+
slots: ["root"],
|
|
6
|
+
base: {
|
|
7
|
+
root: "grid w-full [&>*]:mt-0!"
|
|
8
|
+
},
|
|
9
|
+
variants: {
|
|
10
|
+
cols: {
|
|
11
|
+
1: { root: "grid-cols-1" },
|
|
12
|
+
2: { root: "grid-cols-1 sm:grid-cols-2" },
|
|
13
|
+
3: { root: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3" },
|
|
14
|
+
4: { root: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4" },
|
|
15
|
+
5: { root: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5" },
|
|
16
|
+
6: { root: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6" }
|
|
17
|
+
},
|
|
18
|
+
gap: {
|
|
19
|
+
none: { root: "gap-0" },
|
|
20
|
+
xs: { root: "gap-1 sm:gap-2" },
|
|
21
|
+
sm: { root: "gap-2 sm:gap-4" },
|
|
22
|
+
md: { root: "gap-4 sm:gap-6" },
|
|
23
|
+
lg: { root: "gap-6 sm:gap-8" },
|
|
24
|
+
xl: { root: "gap-8 sm:gap-12" }
|
|
25
|
+
},
|
|
26
|
+
stagger: {
|
|
27
|
+
true: { root: "pb-20 [&>:nth-child(2n)]:translate-y-20" },
|
|
28
|
+
false: { root: "" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
cols: 2,
|
|
33
|
+
gap: "md",
|
|
34
|
+
stagger: false
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export default createGridTheme()
|
|
@@ -7,14 +7,15 @@ export const createHeaderTheme = () =>
|
|
|
7
7
|
root: "w-full",
|
|
8
8
|
content: "w-full",
|
|
9
9
|
container:
|
|
10
|
-
"flex flex-row items-center justify-between gap-4xs h-16 md:h-18 px-
|
|
10
|
+
"flex flex-row items-center justify-between gap-4xs h-16 md:h-18 px-xs sm:px-md md:px-xl lg:px-xl",
|
|
11
11
|
left: "flex-1 min-w-0 flex items-center justify-start truncate",
|
|
12
12
|
center: "flex-none flex items-center justify-center mx-4",
|
|
13
|
-
right: "flex-1 min-w-0 flex items-center justify-end truncate"
|
|
13
|
+
right: "flex-1 min-w-0 flex items-center justify-end truncate"
|
|
14
|
+
},
|
|
14
15
|
variants: {
|
|
15
16
|
contain: {
|
|
16
17
|
true: {
|
|
17
|
-
container: "mx-auto max-w-
|
|
18
|
+
container: "mx-auto max-w-90rem"
|
|
18
19
|
},
|
|
19
20
|
false: {
|
|
20
21
|
container: "max-w-none"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultColors } from "../presets/defaults"
|
|
2
2
|
import { defineTheme } from "../utils/defineTheme"
|
|
3
3
|
|
|
4
|
-
export const createHoverCardTheme = (
|
|
4
|
+
export const createHoverCardTheme = (_colors: readonly string[] = defaultColors) =>
|
|
5
5
|
defineTheme({
|
|
6
6
|
slots: ["root", "trigger", "content"],
|
|
7
7
|
base: {
|
|
@@ -2,11 +2,21 @@ import { defineTheme } from "../utils/defineTheme"
|
|
|
2
2
|
|
|
3
3
|
export const createImageTheme = () =>
|
|
4
4
|
defineTheme({
|
|
5
|
-
slots: [
|
|
5
|
+
slots: [
|
|
6
|
+
"root",
|
|
7
|
+
"trigger",
|
|
8
|
+
"triggerImage",
|
|
9
|
+
"dialog",
|
|
10
|
+
"image",
|
|
11
|
+
"fileInfo",
|
|
12
|
+
"download",
|
|
13
|
+
"closeButton"
|
|
14
|
+
],
|
|
6
15
|
base: {
|
|
7
16
|
root: "relative inline-block group/image",
|
|
8
17
|
trigger:
|
|
9
18
|
"cursor-pointer overflow-hidden rounded-lg block hover:scale-[1.02] active:scale-95 transition-transform duration-300",
|
|
19
|
+
triggerImage: "",
|
|
10
20
|
dialog:
|
|
11
21
|
"backdrop:bg-black/60 max-w-[98vw] sm:max-w-[95vw] w-fit max-h-[90vh] rounded-xl p-0 overflow-hidden border-0 m-auto",
|
|
12
22
|
image: "object-contain max-w-full max-h-[65vh] rounded-lg",
|
|
@@ -11,6 +11,12 @@ export const createInputTheme = () =>
|
|
|
11
11
|
trailing: "absolute right-3 flex items-center justify-center text-muted-foreground"
|
|
12
12
|
},
|
|
13
13
|
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
default: {},
|
|
16
|
+
ghost: {
|
|
17
|
+
root: "bg-transparent border-none shadow-none focus-within:ring-0"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
14
20
|
size: {
|
|
15
21
|
sm: { input: "py-1 text-xs", leading: "left-2.5", trailing: "right-2.5" },
|
|
16
22
|
md: { input: "py-1.5 text-sm", leading: "left-3", trailing: "right-3" },
|
|
@@ -26,12 +32,12 @@ export const createInputTheme = () =>
|
|
|
26
32
|
true: { root: "border-error-500 focus-within:ring-error-500/50" }
|
|
27
33
|
},
|
|
28
34
|
theme: {
|
|
29
|
-
flat: { root: "rl-flat" },
|
|
30
35
|
light: { root: "rl-light" },
|
|
31
36
|
dark: { root: "rl-dark" }
|
|
32
37
|
}
|
|
33
38
|
},
|
|
34
39
|
defaultVariants: {
|
|
40
|
+
variant: "default",
|
|
35
41
|
size: "md",
|
|
36
42
|
hasLeading: false,
|
|
37
43
|
hasTrailing: false,
|