@adula/ui 2.1.0 → 2.3.0
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 +14 -3
- package/build/attachment-preview.json +21 -0
- package/build/breadcrumb.json +18 -0
- package/build/calendar.json +1 -1
- package/build/checkbox.json +1 -1
- package/build/command.json +1 -1
- package/build/confirm-action.json +3 -2
- package/build/copy-button.json +21 -0
- package/build/data-table.json +8 -2
- package/build/dialog-param.json +17 -0
- package/build/dialog.json +3 -2
- package/build/dropdown-menu.json +1 -1
- package/build/file-input.json +21 -0
- package/build/form.json +1 -1
- package/build/hijri-calendar.json +1 -1
- package/build/label.json +1 -1
- package/build/list-filters.json +34 -0
- package/build/long-dialog.json +17 -0
- package/build/manifest.json +146 -76
- package/build/messages.json +21 -0
- package/build/pagination.json +3 -2
- package/build/popover.json +1 -1
- package/build/radio-group.json +1 -1
- package/build/record-assignments.json +3 -2
- package/build/record-collaboration.json +4 -2
- package/build/record-print.json +24 -0
- package/build/record-workflows.json +3 -2
- package/build/resource-actions.json +3 -2
- package/build/resource-bulk.json +27 -0
- package/build/resource-dashboard.json +27 -0
- package/build/resource-field.json +7 -2
- package/build/resource-form.json +4 -2
- package/build/resource-import.json +7 -3
- package/build/resource-page.json +4 -2
- package/build/resource-show.json +6 -2
- package/build/resource-surface.json +4 -2
- package/build/resource-value.json +11 -2
- package/build/select.json +1 -1
- package/build/separator.json +1 -1
- package/build/sheet.json +1 -1
- package/build/slider.json +17 -0
- package/build/sonner.json +1 -1
- package/build/sortable-list.json +20 -0
- package/build/switch.json +1 -1
- package/build/table.json +1 -1
- package/build/tabs.json +1 -1
- package/build/theme.css +48 -2
- package/build/tooltip.json +1 -1
- package/build/user-avatar.json +17 -0
- package/package.json +5 -2
package/build/theme.css
CHANGED
|
@@ -6,14 +6,17 @@
|
|
|
6
6
|
@import '@fontsource/ibm-plex-sans-arabic/700.css';
|
|
7
7
|
@source "../";
|
|
8
8
|
|
|
9
|
+
/* Dark mode follows the `dark` class the server renders on <html> (ADR 049). */
|
|
10
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
11
|
+
|
|
9
12
|
@theme inline {
|
|
10
13
|
--font-sans: var(--brand-font, 'IBM Plex Sans Arabic'), sans-serif;
|
|
11
14
|
--color-background: var(--background);
|
|
12
15
|
--color-foreground: var(--foreground);
|
|
13
16
|
--color-card: var(--card);
|
|
14
17
|
--color-card-foreground: var(--foreground);
|
|
15
|
-
--color-popover: var(--
|
|
16
|
-
--color-popover-foreground: var(--foreground);
|
|
18
|
+
--color-popover: var(--popover);
|
|
19
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
17
20
|
--color-primary: var(--primary);
|
|
18
21
|
--color-primary-foreground: var(--primary-foreground);
|
|
19
22
|
--color-secondary: var(--secondary);
|
|
@@ -23,6 +26,11 @@
|
|
|
23
26
|
--color-accent: var(--accent);
|
|
24
27
|
--color-accent-foreground: var(--primary);
|
|
25
28
|
--color-destructive: var(--destructive);
|
|
29
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
30
|
+
/* Status colors for text, icons and tinted backgrounds (bg-success/10), in both themes. */
|
|
31
|
+
--color-success: var(--success);
|
|
32
|
+
--color-warning: var(--warning);
|
|
33
|
+
--color-info: var(--info);
|
|
26
34
|
--color-border: var(--border);
|
|
27
35
|
--color-input: var(--border);
|
|
28
36
|
--color-ring: var(--ring);
|
|
@@ -34,12 +42,19 @@
|
|
|
34
42
|
|
|
35
43
|
/* Identity tokens: override any of these (and --brand-font) in the project-owned brand.css. */
|
|
36
44
|
:root {
|
|
45
|
+
color-scheme: light;
|
|
37
46
|
--background: oklch(1 0 0);
|
|
38
47
|
--foreground: oklch(0.145 0 0);
|
|
39
48
|
--card: oklch(1 0 0);
|
|
49
|
+
--popover: oklch(1 0 0);
|
|
50
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
40
51
|
--primary: oklch(0.205 0 0);
|
|
41
52
|
--primary-foreground: oklch(0.985 0 0);
|
|
42
53
|
--destructive: oklch(0.577 0.245 27.325);
|
|
54
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
55
|
+
--success: oklch(0.527 0.154 150.069);
|
|
56
|
+
--warning: oklch(0.555 0.163 48.998);
|
|
57
|
+
--info: oklch(0.488 0.243 264.376);
|
|
43
58
|
--ring: oklch(0.708 0 0);
|
|
44
59
|
--secondary: oklch(0.97 0 0);
|
|
45
60
|
--muted-foreground: oklch(0.556 0 0);
|
|
@@ -48,6 +63,28 @@
|
|
|
48
63
|
--radius: 0.625rem;
|
|
49
64
|
}
|
|
50
65
|
|
|
66
|
+
/* The dark theme (#155): every token above, with text at 4.5:1 or more on its surfaces. */
|
|
67
|
+
.dark {
|
|
68
|
+
color-scheme: dark;
|
|
69
|
+
--background: oklch(0.145 0 0);
|
|
70
|
+
--foreground: oklch(0.985 0 0);
|
|
71
|
+
--card: oklch(0.205 0 0);
|
|
72
|
+
--popover: oklch(0.205 0 0);
|
|
73
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
74
|
+
--primary: oklch(0.922 0 0);
|
|
75
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
76
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
77
|
+
--destructive-foreground: oklch(0.145 0 0);
|
|
78
|
+
--success: oklch(0.792 0.209 151.711);
|
|
79
|
+
--warning: oklch(0.828 0.189 84.429);
|
|
80
|
+
--info: oklch(0.707 0.165 254.624);
|
|
81
|
+
--ring: oklch(0.556 0 0);
|
|
82
|
+
--secondary: oklch(0.269 0 0);
|
|
83
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
84
|
+
--accent: oklch(0.269 0 0);
|
|
85
|
+
--border: oklch(1 0 0 / 12%);
|
|
86
|
+
}
|
|
87
|
+
|
|
51
88
|
@layer base {
|
|
52
89
|
*,
|
|
53
90
|
::before,
|
|
@@ -74,6 +111,15 @@
|
|
|
74
111
|
body {
|
|
75
112
|
font-family: var(--font-sans);
|
|
76
113
|
}
|
|
114
|
+
/* A dialog locks page scrolling (react-remove-scroll), which hides the page's scrollbar and
|
|
115
|
+
pads the body by its width on the right so nothing moves. The side of the page's scrollbar
|
|
116
|
+
is the browser's, not the direction's (Chromium keeps it on the right in a right-to-left
|
|
117
|
+
page, Firefox moves it left): dialog.tsx measures it, and where it is on the left the room
|
|
118
|
+
moves there. */
|
|
119
|
+
html[data-root-scrollbar='left'] body[data-scroll-locked] {
|
|
120
|
+
margin-right: 0 !important;
|
|
121
|
+
margin-left: var(--removed-body-scroll-bar-size, 0px) !important;
|
|
122
|
+
}
|
|
77
123
|
|
|
78
124
|
@media (prefers-reduced-motion: reduce) {
|
|
79
125
|
*,
|
package/build/tooltip.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
{
|
|
10
10
|
"path": "registry/ui/tooltip.tsx",
|
|
11
11
|
"type": "registry:ui",
|
|
12
|
-
"content": "
|
|
12
|
+
"content": "import * as React from \"react\"\nimport { cn } from \"cn\"\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\"\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n )\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n",
|
|
13
13
|
"target": "inertia/components/ui/tooltip.tsx"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "user-avatar",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"dependencies": [
|
|
5
|
+
"cn@0.3.0",
|
|
6
|
+
"radix-ui@1.6.7"
|
|
7
|
+
],
|
|
8
|
+
"files": [
|
|
9
|
+
{
|
|
10
|
+
"path": "registry/ui/user-avatar.tsx",
|
|
11
|
+
"type": "registry:ui",
|
|
12
|
+
"content": "import { cn } from \"cn\"\nimport { Avatar as AvatarPrimitive } from \"radix-ui\"\n\nexport type UserAvatarUser = {\n id: number\n /** The name the initials come from; shown as the image's accessible name when alone. */\n name?: string | null\n /**\n * The picture URL. Omitted: `/users/:id/avatar` (any signed-in user may read it). `null`: the\n * user has no picture, so only the initials show and nothing is requested.\n */\n avatarUrl?: string | null\n}\n\nconst SIZES = {\n xs: \"size-5 text-[9px]\",\n sm: \"size-7 text-[11px]\",\n md: \"size-9 text-xs\",\n lg: \"size-16 text-lg\",\n} as const\n\n/** Two initials like the server's `User.initials`: first and last word, or one word's first two letters. */\nexport function initialsOf(name?: string | null) {\n const words = String(name ?? \"\").trim().split(/\\s+/).filter(Boolean)\n if (!words.length) return \"؟\"\n const letters =\n words.length > 1\n ? [Array.from(words[0])[0], Array.from(words.at(-1) as string)[0]]\n : Array.from(words[0]).slice(0, 2)\n return letters.join(\"\").toUpperCase()\n}\n\n/**\n * A user's profile picture (ADR 050) with their initials while it loads and when there is none.\n * Next to a visible name it is decorative; pass `labelled` when it stands alone.\n */\nexport function UserAvatar({\n user,\n size = \"sm\",\n labelled = false,\n className,\n}: {\n user: UserAvatarUser\n size?: keyof typeof SIZES\n labelled?: boolean\n className?: string\n}) {\n const src =\n user.avatarUrl === null ? undefined : (user.avatarUrl ?? `/users/${user.id}/avatar`)\n return (\n <AvatarPrimitive.Root\n data-slot=\"user-avatar\"\n role={labelled ? \"img\" : undefined}\n aria-label={labelled ? (user.name ?? undefined) : undefined}\n aria-hidden={labelled ? undefined : true}\n className={cn(\n \"relative inline-flex shrink-0 overflow-hidden rounded-full bg-muted align-middle\",\n SIZES[size],\n className\n )}\n >\n {src ? (\n <AvatarPrimitive.Image\n data-slot=\"user-avatar-image\"\n src={src}\n alt=\"\"\n loading=\"lazy\"\n className=\"aspect-square size-full object-cover\"\n />\n ) : null}\n <AvatarPrimitive.Fallback\n data-slot=\"user-avatar-fallback\"\n className=\"flex size-full items-center justify-center rounded-full font-semibold text-muted-foreground\"\n >\n {initialsOf(user.name)}\n </AvatarPrimitive.Fallback>\n </AvatarPrimitive.Root>\n )\n}\n",
|
|
13
|
+
"target": "inertia/components/ui/user-avatar.tsx"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json"
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adula/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Arabic RTL shadcn registry copied into AdonisJS applications",
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"./package.json": "./package.json",
|
|
16
16
|
"./registry/*": "./build/*.json"
|
|
17
17
|
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"shadcn": "4.21.0"
|
|
20
|
+
},
|
|
18
21
|
"publishConfig": {
|
|
19
22
|
"access": "public",
|
|
20
23
|
"provenance": true
|
|
@@ -42,6 +45,6 @@
|
|
|
42
45
|
],
|
|
43
46
|
"scripts": {
|
|
44
47
|
"test": "node --test tests/*.test.mjs",
|
|
45
|
-
"build": "node ../../scripts/
|
|
48
|
+
"build": "node ../../scripts/ui-registry.mjs build"
|
|
46
49
|
}
|
|
47
50
|
}
|