banhaten 0.1.2 → 0.1.3
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 +93 -328
- package/banhaten.config.example.json +1 -1
- package/docs/design-system/README.md +11 -0
- package/docs/design-system/appearance-presets.md +184 -0
- package/docs/design-system/appearances/default.md +94 -0
- package/docs/design-system/appearances/rounded.md +95 -0
- package/docs/design-system/appearances/sharp.md +95 -0
- package/docs/design-system/component-showcase-consistency-report.md +217 -0
- package/docs/design-system/component-token-consistency-audit.md +163 -0
- package/docs/design-system/components/README.md +74 -0
- package/docs/design-system/components/accordion.md +51 -0
- package/docs/design-system/components/activity-feed.md +92 -0
- package/docs/design-system/components/alert-dialog.md +70 -0
- package/docs/design-system/components/alert.md +79 -0
- package/docs/design-system/components/aspect-ratio.md +44 -0
- package/docs/design-system/components/attribute.md +87 -0
- package/docs/design-system/components/autocomplete.md +74 -0
- package/docs/design-system/components/avatar.md +52 -0
- package/docs/design-system/components/badge.md +53 -0
- package/docs/design-system/components/banner.md +85 -0
- package/docs/design-system/components/breadcrumbs.md +174 -0
- package/docs/design-system/components/button-group.md +83 -0
- package/docs/design-system/components/button.md +77 -0
- package/docs/design-system/components/card.md +78 -0
- package/docs/design-system/components/carousel.md +44 -0
- package/docs/design-system/components/catalog-components.md +45 -0
- package/docs/design-system/components/chart.md +43 -0
- package/docs/design-system/components/checkbox.md +52 -0
- package/docs/design-system/components/collapsible.md +48 -0
- package/docs/design-system/components/command-bar.md +57 -0
- package/docs/design-system/components/command.md +60 -0
- package/docs/design-system/components/context-menu.md +44 -0
- package/docs/design-system/components/date-picker.md +77 -0
- package/docs/design-system/components/divider.md +101 -0
- package/docs/design-system/components/empty-state.md +55 -0
- package/docs/design-system/components/field.md +69 -0
- package/docs/design-system/components/file-upload.md +185 -0
- package/docs/design-system/components/hover-card.md +46 -0
- package/docs/design-system/components/icons.md +48 -0
- package/docs/design-system/components/input-group.md +56 -0
- package/docs/design-system/components/input-otp.md +55 -0
- package/docs/design-system/components/input.md +48 -0
- package/docs/design-system/components/kbd.md +44 -0
- package/docs/design-system/components/label.md +48 -0
- package/docs/design-system/components/menu.md +59 -0
- package/docs/design-system/components/menubar.md +45 -0
- package/docs/design-system/components/modal.md +98 -0
- package/docs/design-system/components/native-select.md +52 -0
- package/docs/design-system/components/navigation-menu.md +48 -0
- package/docs/design-system/components/onboarding-step-list-item.md +80 -0
- package/docs/design-system/components/page-header.md +84 -0
- package/docs/design-system/components/pagination.md +49 -0
- package/docs/design-system/components/popover.md +58 -0
- package/docs/design-system/components/progress-slider.md +48 -0
- package/docs/design-system/components/progress.md +75 -0
- package/docs/design-system/components/radio-card.md +49 -0
- package/docs/design-system/components/radio-group.md +55 -0
- package/docs/design-system/components/resizable.md +42 -0
- package/docs/design-system/components/scroll-area.md +45 -0
- package/docs/design-system/components/select.md +50 -0
- package/docs/design-system/components/sheet.md +65 -0
- package/docs/design-system/components/sidebar.md +68 -0
- package/docs/design-system/components/skeleton.md +73 -0
- package/docs/design-system/components/slideout.md +63 -0
- package/docs/design-system/components/slider.md +61 -0
- package/docs/design-system/components/social-button.md +47 -0
- package/docs/design-system/components/spinner.md +61 -0
- package/docs/design-system/components/steps.md +63 -0
- package/docs/design-system/components/table.md +397 -0
- package/docs/design-system/components/tabs.md +52 -0
- package/docs/design-system/components/tag.md +78 -0
- package/docs/design-system/components/textarea.md +48 -0
- package/docs/design-system/components/timeline.md +81 -0
- package/docs/design-system/components/toast.md +56 -0
- package/docs/design-system/components/toggle.md +79 -0
- package/docs/design-system/components/toolbar.md +85 -0
- package/docs/design-system/components/tooltip.md +90 -0
- package/docs/design-system/components/typography.md +18 -0
- package/docs/design-system/design-system-test-missing-items.md +368 -0
- package/docs/design-system/icons.md +69 -0
- package/docs/design-system/registry-and-cli.md +41 -0
- package/docs/design-system/tabs.md +53 -0
- package/docs/design-system/token-governance.md +38 -0
- package/package.json +83 -65
- package/registry/components/alert-dialog.tsx +297 -0
- package/registry/components/aspect-ratio.tsx +30 -0
- package/registry/components/carousel.tsx +234 -0
- package/registry/components/chart.tsx +170 -0
- package/registry/components/collapsible.tsx +69 -0
- package/registry/components/command.tsx +174 -0
- package/registry/components/context-menu.tsx +236 -0
- package/registry/components/date-picker.tsx +1 -1
- package/registry/components/expanded/PageHeader.tsx +1 -1
- package/registry/components/expanded/breadcrumbs.css +139 -139
- package/registry/components/expanded/catalogComponentsShowcase.css +83 -83
- package/registry/components/expanded/steps.css +274 -274
- package/registry/components/expanded/timeline.css +264 -264
- package/registry/components/field.tsx +230 -0
- package/registry/components/hover-card.tsx +48 -0
- package/registry/components/input-group.tsx +130 -0
- package/registry/components/input.tsx +2 -2
- package/registry/components/kbd.tsx +44 -0
- package/registry/components/label.tsx +78 -0
- package/registry/components/menu.tsx +3 -1
- package/registry/components/menubar.tsx +226 -0
- package/registry/components/modal.tsx +109 -76
- package/registry/components/native-select.tsx +205 -0
- package/registry/components/navigation-menu.tsx +171 -0
- package/registry/components/radio-group.tsx +1 -1
- package/registry/components/resizable.tsx +74 -0
- package/registry/components/scroll-area.tsx +67 -0
- package/registry/components/select.tsx +2 -4
- package/registry/components/sheet.tsx +305 -0
- package/registry/components/sidebar.tsx +352 -0
- package/registry/components/social-button.tsx +74 -10
- package/registry/components/{expanded/tabs.css → tabs.css} +127 -106
- package/registry/components/tabs.tsx +242 -0
- package/registry/components/textarea.tsx +1 -1
- package/registry/components/toast.tsx +131 -0
- package/registry/examples/alert-dialog-demo.tsx +42 -0
- package/registry/examples/aspect-ratio-demo.tsx +11 -0
- package/registry/examples/carousel-demo.tsx +25 -0
- package/registry/examples/chart-demo.tsx +33 -0
- package/registry/examples/collapsible-demo.tsx +16 -0
- package/registry/examples/command-demo.tsx +42 -0
- package/registry/examples/context-menu-demo.tsx +29 -0
- package/registry/examples/expanded/tabs-demo.tsx +1 -1
- package/registry/examples/field-demo.tsx +51 -0
- package/registry/examples/hover-card-demo.tsx +23 -0
- package/registry/examples/input-group-demo.tsx +16 -0
- package/registry/examples/kbd-demo.tsx +11 -0
- package/registry/examples/label-demo.tsx +20 -0
- package/registry/examples/menubar-demo.tsx +34 -0
- package/registry/examples/native-select-demo.tsx +16 -0
- package/registry/examples/navigation-menu-demo.tsx +29 -0
- package/registry/examples/resizable-demo.tsx +22 -0
- package/registry/examples/scroll-area-demo.tsx +15 -0
- package/registry/examples/sheet-demo.tsx +47 -0
- package/registry/examples/sidebar-demo.tsx +55 -0
- package/registry/examples/tabs-demo.tsx +13 -0
- package/registry/examples/toast-demo.tsx +35 -0
- package/registry/index.json +655 -11
- package/registry/styles/globals.css +4733 -4690
- package/registry.json +1612 -0
- package/schema/config.schema.json +48 -0
- package/schema/registry.schema.json +85 -0
- package/schema/tokens.schema.json +63 -0
- package/src/cli/index.js +312 -18
- package/tokens/banhaten.tokens.json +1 -1
- package/registry/assets/avatars/avatar-02.jpg +0 -0
- package/registry/assets/avatars/avatar-03.jpg +0 -0
- package/registry/assets/avatars/avatar-04.jpg +0 -0
- package/registry/assets/avatars/avatar-05.jpg +0 -0
- package/registry/assets/avatars/avatar-06.jpg +0 -0
- package/registry/assets/avatars/avatar-07.jpg +0 -0
- package/registry/assets/avatars/avatar-08.jpg +0 -0
- package/registry/assets/avatars/avatar-09.jpg +0 -0
- package/registry/assets/avatars/avatar-10.jpg +0 -0
- package/registry/assets/avatars/avatar-11.jpg +0 -0
- package/registry/assets/avatars/avatar-12.jpg +0 -0
- package/registry/assets/avatars/avatar-13.jpg +0 -0
- package/registry/assets/avatars/avatar-14.jpg +0 -0
- package/registry/assets/avatars/avatar-15.jpg +0 -0
- package/registry/assets/avatars/avatar-16.jpg +0 -0
- package/registry/assets/avatars/avatar-17.jpg +0 -0
- package/registry/assets/avatars/avatar-18.jpg +0 -0
- package/registry/assets/avatars/avatar-19.jpg +0 -0
- package/registry/assets/avatars/avatar-20.jpg +0 -0
- package/registry/assets/avatars/avatar-21.jpg +0 -0
- package/registry/assets/avatars/avatar-22.jpg +0 -0
- package/registry/assets/avatars/avatar-23.jpg +0 -0
- package/registry/assets/avatars/avatar-24.jpg +0 -0
- package/registry/assets/avatars/avatar-25.jpg +0 -0
- package/registry/assets/avatars/avatar-26.jpg +0 -0
- package/registry/assets/avatars/avatar-27.jpg +0 -0
- package/registry/assets/avatars/avatar-28.jpg +0 -0
- package/registry/assets/avatars/avatar-29.jpg +0 -0
- package/registry/assets/avatars/avatar-30.jpg +0 -0
- package/registry/assets/avatars/avatar-31.jpg +0 -0
- package/registry/assets/avatars/avatar-32.jpg +0 -0
- package/registry/assets/avatars/avatar-33.jpg +0 -0
- package/registry/assets/avatars/avatar-34.jpg +0 -0
- package/registry/assets/avatars/avatar-35.jpg +0 -0
- package/registry/assets/image-assets.json +0 -744
- package/registry/assets/images/art-02.jpg +0 -0
- package/registry/assets/images/art-03.jpg +0 -0
- package/registry/assets/images/art-04.jpg +0 -0
- package/registry/assets/images/art-05.jpg +0 -0
- package/registry/assets/images/art-06.jpg +0 -0
- package/registry/assets/images/art-07.jpg +0 -0
- package/registry/assets/images/art-08.jpg +0 -0
- package/registry/assets/images/art-09.jpg +0 -0
- package/registry/assets/images/art-10.jpg +0 -0
- package/registry/assets/images/art-11.jpg +0 -0
- package/registry/assets/images/art-12.jpg +0 -0
- package/registry/assets/images/art-13.jpg +0 -0
- package/registry/assets/images/art-14.jpg +0 -0
- package/registry/assets/images/art-15.jpg +0 -0
- package/registry/assets/images/art-16.jpg +0 -0
- package/registry/assets/images/art-17.jpg +0 -0
- package/registry/assets/images/art-18.jpg +0 -0
- package/registry/assets/images/art-19.jpg +0 -0
- package/registry/assets/images/art-20.jpg +0 -0
- package/registry/assets/images/art-21.jpg +0 -0
- package/registry/assets/images/art-22.jpg +0 -0
- package/registry/assets/images/art-23.jpg +0 -0
- package/registry/assets/images/art-24.jpg +0 -0
- package/registry/assets/images/art-25.jpg +0 -0
- package/registry/assets/images/art-26.jpg +0 -0
- package/registry/assets/images/art-27.jpg +0 -0
- package/registry/assets/images/nature-01.jpg +0 -0
- package/registry/assets/images/nature-02.jpg +0 -0
- package/registry/assets/images/nature-03.jpg +0 -0
- package/registry/assets/images/nature-04.jpg +0 -0
- package/registry/assets/images/nature-05.jpg +0 -0
- package/registry/assets/images/nature-06.jpg +0 -0
- package/registry/assets/images/nature-07.jpg +0 -0
- package/registry/assets/images/nature-08.jpg +0 -0
- package/registry/assets/images/nature-09.jpg +0 -0
- package/registry/assets/images/nature-10.jpg +0 -0
- package/registry/assets/images/nature-11.jpg +0 -0
- package/registry/assets/images/nature-12.jpg +0 -0
- package/registry/assets/images/nature-13.jpg +0 -0
- package/registry/assets/images/nature-14.jpg +0 -0
- package/registry/assets/images/nature-15.jpg +0 -0
- package/registry/assets/images/nature-16.jpg +0 -0
- package/registry/assets/images/nature-17.jpg +0 -0
- package/registry/assets/images/nature-18.jpg +0 -0
- package/registry/assets/images/nature-19.jpg +0 -0
- package/registry/assets/images/nature-20.jpg +0 -0
- package/registry/components/expanded/Tabs.tsx +0 -86
package/package.json
CHANGED
|
@@ -1,65 +1,83 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "banhaten",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Banhaten design system: an Arabic and English-first React design system with shadcn-style component installation.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"banhaten": "src/cli/index.js"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"src",
|
|
11
|
-
"registry",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
},
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "banhaten",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Banhaten design system: an Arabic and English-first React design system with shadcn-style component installation.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"banhaten": "src/cli/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"src",
|
|
11
|
+
"registry/index.json",
|
|
12
|
+
"registry/components",
|
|
13
|
+
"registry/examples",
|
|
14
|
+
"registry/hooks",
|
|
15
|
+
"registry/styles",
|
|
16
|
+
"registry/utils",
|
|
17
|
+
"registry/assets/activity-feed-avatar.png",
|
|
18
|
+
"registry/assets/avatars/avatar-01.jpg",
|
|
19
|
+
"registry/assets/images/art-01.jpg",
|
|
20
|
+
"registry.json",
|
|
21
|
+
"tokens/banhaten.tokens.json",
|
|
22
|
+
"tokens/Color mode.zip",
|
|
23
|
+
"tokens/Theme.zip",
|
|
24
|
+
"tokens/Numbers.zip",
|
|
25
|
+
"tokens/Radius.zip",
|
|
26
|
+
"schema",
|
|
27
|
+
"docs",
|
|
28
|
+
"banhaten.config.example.json",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "npm --prefix playground ci --include=dev --include=optional && npm --prefix playground run build",
|
|
34
|
+
"build:railway": "npm --prefix playground ci --include=dev --include=optional && npm --prefix playground run build:railway",
|
|
35
|
+
"start": "node playground/scripts/serve-static.mjs playground/dist",
|
|
36
|
+
"check": "node --check src/cli/index.js && node --check scripts/generate-shadcn-registry.mjs && node --check scripts/normalize-component-docs.mjs && npm run cli:test && npm run tokens:check && npm run registry:check && npm run docs:check && npm run playground:test && npm run playground:audit",
|
|
37
|
+
"cli:test": "node scripts/cli-integration-test.mjs",
|
|
38
|
+
"playground:build": "npm --prefix playground run build",
|
|
39
|
+
"playground:dev": "npm --prefix playground run dev",
|
|
40
|
+
"playground:test": "npm --prefix playground run test",
|
|
41
|
+
"playground:audit": "npm --prefix playground audit --audit-level=high",
|
|
42
|
+
"registry:check": "node scripts/check-registry-mirrors.mjs && node scripts/generate-shadcn-registry.mjs --check",
|
|
43
|
+
"registry:export": "node scripts/generate-shadcn-registry.mjs --write",
|
|
44
|
+
"registry:sync": "node scripts/check-registry-mirrors.mjs --write",
|
|
45
|
+
"components:tokens:check": "node scripts/check-component-token-usage.mjs",
|
|
46
|
+
"docs:check": "node scripts/check-component-docs.mjs && node scripts/normalize-component-docs.mjs",
|
|
47
|
+
"docs:normalize": "node scripts/normalize-component-docs.mjs --write",
|
|
48
|
+
"smoke": "node src/cli/index.js list",
|
|
49
|
+
"tokens:build": "node scripts/generate-token-css.mjs --write",
|
|
50
|
+
"tokens:check": "node scripts/generate-token-css.mjs --check && node scripts/check-token-contract.mjs && npm run components:tokens:check"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=18.18"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"react": ">=18.2.0 || >=19.0.0",
|
|
57
|
+
"react-dom": ">=18.2.0 || >=19.0.0",
|
|
58
|
+
"tailwindcss": "^4.0.0"
|
|
59
|
+
},
|
|
60
|
+
"keywords": [
|
|
61
|
+
"banhaten",
|
|
62
|
+
"design-system",
|
|
63
|
+
"react",
|
|
64
|
+
"shadcn",
|
|
65
|
+
"rtl",
|
|
66
|
+
"arabic",
|
|
67
|
+
"components"
|
|
68
|
+
],
|
|
69
|
+
"license": "MIT",
|
|
70
|
+
"repository": {
|
|
71
|
+
"type": "git",
|
|
72
|
+
"url": "git+https://github.com/AhmadGalal85/Banhaten-design-system.git"
|
|
73
|
+
},
|
|
74
|
+
"bugs": {
|
|
75
|
+
"url": "https://github.com/AhmadGalal85/Banhaten-design-system/issues"
|
|
76
|
+
},
|
|
77
|
+
"homepage": "https://github.com/AhmadGalal85/Banhaten-design-system/tree/main/docs",
|
|
78
|
+
"directories": {
|
|
79
|
+
"doc": "docs"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {},
|
|
82
|
+
"author": "Ahmad Galal"
|
|
83
|
+
}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
|
+
import { TriangleAlertIcon } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
import { Button, type ButtonProps } from "@/components/ui/button"
|
|
9
|
+
import { cn } from "@/lib/utils"
|
|
10
|
+
|
|
11
|
+
type AlertDialogIntent = "default" | "warning" | "danger"
|
|
12
|
+
type AlertDialogSize = "sm" | "default" | "lg"
|
|
13
|
+
|
|
14
|
+
const alertDialogContentVariants = cva(
|
|
15
|
+
[
|
|
16
|
+
"fixed left-1/2 top-1/2 z-[var(--bh-z-overlay)] flex max-h-[calc(100vh-(var(--bh-space-8xl-48)*2))] w-[var(--bh-alert-dialog-width)]",
|
|
17
|
+
"max-w-[calc(100vw-(var(--bh-space-4xl-20)*2))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden",
|
|
18
|
+
"rounded-[var(--bh-radius-2xl-12)] bg-[var(--bh-bg-raised)] text-[var(--bh-content-default)] shadow-[var(--shadow-modal)] outline-none",
|
|
19
|
+
"[--bh-alert-dialog-border:var(--bh-border-subtle)] [--shadow-modal:inset_0px_0px_0px_var(--bh-border-width-default)_var(--bh-alert-dialog-border),var(--shadow-component-default)]",
|
|
20
|
+
],
|
|
21
|
+
{
|
|
22
|
+
variants: {
|
|
23
|
+
size: {
|
|
24
|
+
default:
|
|
25
|
+
"[--bh-alert-dialog-width:calc(var(--bh-space-19xl-384)+var(--bh-space-12xl-128)+var(--bh-space-8xl-48))]",
|
|
26
|
+
lg: "[--bh-alert-dialog-width:calc(var(--bh-space-19xl-384)+var(--bh-space-16xl-256)+var(--bh-space-9xl-64)-var(--bh-space-xs-4))]",
|
|
27
|
+
sm: "[--bh-alert-dialog-width:calc(var(--bh-space-19xl-384)+var(--bh-space-8xl-48)+var(--bh-space-md-8))]",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
size: "sm",
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
const intentClassNames: Record<AlertDialogIntent, string> = {
|
|
37
|
+
danger:
|
|
38
|
+
"bg-[var(--bh-bg-danger-subtle)] text-[var(--bh-content-danger-default)]",
|
|
39
|
+
default:
|
|
40
|
+
"bg-[var(--bh-bg-neutral-subtle)] text-[var(--bh-content-subtle)]",
|
|
41
|
+
warning:
|
|
42
|
+
"bg-[var(--bh-bg-warning-subtle)] text-[var(--bh-content-warning-default)]",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type AlertDialogProps = React.ComponentProps<typeof AlertDialogPrimitive.Root>
|
|
46
|
+
type AlertDialogTriggerProps = React.ComponentProps<
|
|
47
|
+
typeof AlertDialogPrimitive.Trigger
|
|
48
|
+
>
|
|
49
|
+
type AlertDialogPortalProps = React.ComponentProps<
|
|
50
|
+
typeof AlertDialogPrimitive.Portal
|
|
51
|
+
>
|
|
52
|
+
type AlertDialogOverlayProps = React.ComponentPropsWithoutRef<
|
|
53
|
+
typeof AlertDialogPrimitive.Overlay
|
|
54
|
+
>
|
|
55
|
+
type AlertDialogContentProps = React.ComponentPropsWithoutRef<
|
|
56
|
+
typeof AlertDialogPrimitive.Content
|
|
57
|
+
> &
|
|
58
|
+
VariantProps<typeof alertDialogContentVariants> & {
|
|
59
|
+
overlayClassName?: string
|
|
60
|
+
}
|
|
61
|
+
type AlertDialogHeaderProps = React.ComponentProps<"header">
|
|
62
|
+
type AlertDialogBodyProps = React.ComponentProps<"div">
|
|
63
|
+
type AlertDialogFooterProps = React.ComponentProps<"footer">
|
|
64
|
+
type AlertDialogTitleProps = React.ComponentPropsWithoutRef<
|
|
65
|
+
typeof AlertDialogPrimitive.Title
|
|
66
|
+
>
|
|
67
|
+
type AlertDialogDescriptionProps = React.ComponentPropsWithoutRef<
|
|
68
|
+
typeof AlertDialogPrimitive.Description
|
|
69
|
+
>
|
|
70
|
+
type AlertDialogIconProps = React.ComponentProps<"span"> & {
|
|
71
|
+
intent?: AlertDialogIntent
|
|
72
|
+
}
|
|
73
|
+
type AlertDialogActionProps = ButtonProps
|
|
74
|
+
type AlertDialogCancelProps = ButtonProps
|
|
75
|
+
|
|
76
|
+
const AlertDialog = AlertDialogPrimitive.Root
|
|
77
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
78
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
79
|
+
|
|
80
|
+
const AlertDialogOverlay = React.forwardRef<
|
|
81
|
+
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
82
|
+
AlertDialogOverlayProps
|
|
83
|
+
>(function AlertDialogOverlay({ className, ...props }, ref) {
|
|
84
|
+
return (
|
|
85
|
+
<AlertDialogPrimitive.Overlay
|
|
86
|
+
data-slot="alert-dialog-overlay"
|
|
87
|
+
ref={ref}
|
|
88
|
+
className={cn(
|
|
89
|
+
"fixed inset-0 z-[var(--bh-z-overlay)] bg-[var(--bh-bg-backdrop)]",
|
|
90
|
+
className
|
|
91
|
+
)}
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
)
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const AlertDialogContent = React.forwardRef<
|
|
98
|
+
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
99
|
+
AlertDialogContentProps
|
|
100
|
+
>(function AlertDialogContent(
|
|
101
|
+
{ children, className, overlayClassName, size, ...props },
|
|
102
|
+
ref
|
|
103
|
+
) {
|
|
104
|
+
return (
|
|
105
|
+
<AlertDialogPortal>
|
|
106
|
+
<AlertDialogOverlay className={overlayClassName} />
|
|
107
|
+
<AlertDialogPrimitive.Content
|
|
108
|
+
data-size={size ?? "sm"}
|
|
109
|
+
data-slot="alert-dialog-content"
|
|
110
|
+
ref={ref}
|
|
111
|
+
className={cn(alertDialogContentVariants({ size, className }))}
|
|
112
|
+
{...props}
|
|
113
|
+
>
|
|
114
|
+
{children}
|
|
115
|
+
</AlertDialogPrimitive.Content>
|
|
116
|
+
</AlertDialogPortal>
|
|
117
|
+
)
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
const AlertDialogHeader = React.forwardRef<HTMLElement, AlertDialogHeaderProps>(
|
|
121
|
+
function AlertDialogHeader({ className, ...props }, ref) {
|
|
122
|
+
return (
|
|
123
|
+
<header
|
|
124
|
+
data-slot="alert-dialog-header"
|
|
125
|
+
ref={ref}
|
|
126
|
+
className={cn(
|
|
127
|
+
"flex w-full shrink-0 items-start gap-[var(--bh-space-sm-6)] px-[var(--bh-space-4xl-20)] pb-[var(--bh-space-md-8)] pt-[var(--bh-space-4xl-20)] text-start",
|
|
128
|
+
className
|
|
129
|
+
)}
|
|
130
|
+
{...props}
|
|
131
|
+
/>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
const AlertDialogBody = React.forwardRef<HTMLDivElement, AlertDialogBodyProps>(
|
|
137
|
+
function AlertDialogBody({ className, ...props }, ref) {
|
|
138
|
+
return (
|
|
139
|
+
<div
|
|
140
|
+
data-slot="alert-dialog-body"
|
|
141
|
+
ref={ref}
|
|
142
|
+
className={cn(
|
|
143
|
+
"flex w-full shrink-0 items-start px-[var(--bh-space-4xl-20)] pb-[var(--bh-space-4xl-20)] pt-[var(--bh-space-lg-10)]",
|
|
144
|
+
className
|
|
145
|
+
)}
|
|
146
|
+
{...props}
|
|
147
|
+
/>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
const AlertDialogFooter = React.forwardRef<
|
|
153
|
+
HTMLElement,
|
|
154
|
+
AlertDialogFooterProps
|
|
155
|
+
>(function AlertDialogFooter({ className, ...props }, ref) {
|
|
156
|
+
return (
|
|
157
|
+
<footer
|
|
158
|
+
data-slot="alert-dialog-footer"
|
|
159
|
+
ref={ref}
|
|
160
|
+
className={cn(
|
|
161
|
+
"flex w-full shrink-0 items-center justify-end gap-[var(--bh-space-lg-10)] border-t border-[var(--bh-border-subtle)] px-[var(--bh-space-4xl-20)] py-[var(--bh-space-3xl-16)]",
|
|
162
|
+
className
|
|
163
|
+
)}
|
|
164
|
+
{...props}
|
|
165
|
+
/>
|
|
166
|
+
)
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
const AlertDialogTitle = React.forwardRef<
|
|
170
|
+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
171
|
+
AlertDialogTitleProps
|
|
172
|
+
>(function AlertDialogTitle({ className, dir = "auto", ...props }, ref) {
|
|
173
|
+
return (
|
|
174
|
+
<AlertDialogPrimitive.Title
|
|
175
|
+
data-slot="alert-dialog-title"
|
|
176
|
+
dir={dir}
|
|
177
|
+
ref={ref}
|
|
178
|
+
className={cn(
|
|
179
|
+
"min-w-0 flex-1 text-start text-[length:var(--bh-text-heading-sm-semibold-font-size)] font-[var(--bh-text-heading-sm-semibold-font-weight)] leading-[var(--bh-text-heading-sm-semibold-line-height)] tracking-[var(--bh-text-heading-sm-semibold-letter-spacing)] text-[var(--bh-content-default)]",
|
|
180
|
+
className
|
|
181
|
+
)}
|
|
182
|
+
{...props}
|
|
183
|
+
/>
|
|
184
|
+
)
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
const AlertDialogDescription = React.forwardRef<
|
|
188
|
+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
189
|
+
AlertDialogDescriptionProps
|
|
190
|
+
>(function AlertDialogDescription({ className, dir = "auto", ...props }, ref) {
|
|
191
|
+
return (
|
|
192
|
+
<AlertDialogPrimitive.Description
|
|
193
|
+
data-slot="alert-dialog-description"
|
|
194
|
+
dir={dir}
|
|
195
|
+
ref={ref}
|
|
196
|
+
className={cn(
|
|
197
|
+
"min-w-0 flex-1 text-start text-[length:var(--bh-text-body-md-regular-font-size)] font-[var(--bh-text-body-md-regular-font-weight)] leading-[var(--bh-text-body-md-regular-line-height)] tracking-[var(--bh-text-body-md-regular-letter-spacing)] text-[var(--bh-content-subtle)]",
|
|
198
|
+
className
|
|
199
|
+
)}
|
|
200
|
+
{...props}
|
|
201
|
+
/>
|
|
202
|
+
)
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
function AlertDialogIcon({
|
|
206
|
+
children,
|
|
207
|
+
className,
|
|
208
|
+
intent = "danger",
|
|
209
|
+
...props
|
|
210
|
+
}: AlertDialogIconProps) {
|
|
211
|
+
return (
|
|
212
|
+
<span
|
|
213
|
+
aria-hidden="true"
|
|
214
|
+
data-intent={intent}
|
|
215
|
+
data-slot="alert-dialog-icon"
|
|
216
|
+
className={cn(
|
|
217
|
+
"inline-flex size-[var(--bh-space-5xl-24)] shrink-0 items-center justify-center rounded-[var(--bh-radius-full)]",
|
|
218
|
+
intentClassNames[intent],
|
|
219
|
+
className
|
|
220
|
+
)}
|
|
221
|
+
{...props}
|
|
222
|
+
>
|
|
223
|
+
{children ?? (
|
|
224
|
+
<TriangleAlertIcon
|
|
225
|
+
className="size-[var(--bh-space-3xl-16)]"
|
|
226
|
+
strokeWidth={2}
|
|
227
|
+
/>
|
|
228
|
+
)}
|
|
229
|
+
</span>
|
|
230
|
+
)
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const AlertDialogAction = React.forwardRef<
|
|
234
|
+
HTMLButtonElement,
|
|
235
|
+
AlertDialogActionProps
|
|
236
|
+
>(function AlertDialogAction(
|
|
237
|
+
{ asChild = false, children = "Confirm", size = "sm", variant = "danger", ...props },
|
|
238
|
+
ref
|
|
239
|
+
) {
|
|
240
|
+
return (
|
|
241
|
+
<AlertDialogPrimitive.Action asChild>
|
|
242
|
+
<Button asChild={asChild} ref={ref} size={size} variant={variant} {...props}>
|
|
243
|
+
{children}
|
|
244
|
+
</Button>
|
|
245
|
+
</AlertDialogPrimitive.Action>
|
|
246
|
+
)
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
const AlertDialogCancel = React.forwardRef<
|
|
250
|
+
HTMLButtonElement,
|
|
251
|
+
AlertDialogCancelProps
|
|
252
|
+
>(function AlertDialogCancel(
|
|
253
|
+
{ asChild = false, children = "Cancel", size = "sm", variant = "soft", ...props },
|
|
254
|
+
ref
|
|
255
|
+
) {
|
|
256
|
+
return (
|
|
257
|
+
<AlertDialogPrimitive.Cancel asChild>
|
|
258
|
+
<Button asChild={asChild} ref={ref} size={size} variant={variant} {...props}>
|
|
259
|
+
{children}
|
|
260
|
+
</Button>
|
|
261
|
+
</AlertDialogPrimitive.Cancel>
|
|
262
|
+
)
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
export {
|
|
266
|
+
AlertDialog,
|
|
267
|
+
AlertDialogAction,
|
|
268
|
+
AlertDialogBody,
|
|
269
|
+
AlertDialogCancel,
|
|
270
|
+
AlertDialogContent,
|
|
271
|
+
AlertDialogDescription,
|
|
272
|
+
AlertDialogFooter,
|
|
273
|
+
AlertDialogHeader,
|
|
274
|
+
AlertDialogIcon,
|
|
275
|
+
AlertDialogOverlay,
|
|
276
|
+
AlertDialogPortal,
|
|
277
|
+
AlertDialogTitle,
|
|
278
|
+
AlertDialogTrigger,
|
|
279
|
+
alertDialogContentVariants,
|
|
280
|
+
}
|
|
281
|
+
export type {
|
|
282
|
+
AlertDialogActionProps,
|
|
283
|
+
AlertDialogBodyProps,
|
|
284
|
+
AlertDialogCancelProps,
|
|
285
|
+
AlertDialogContentProps,
|
|
286
|
+
AlertDialogDescriptionProps,
|
|
287
|
+
AlertDialogFooterProps,
|
|
288
|
+
AlertDialogHeaderProps,
|
|
289
|
+
AlertDialogIconProps,
|
|
290
|
+
AlertDialogIntent,
|
|
291
|
+
AlertDialogOverlayProps,
|
|
292
|
+
AlertDialogPortalProps,
|
|
293
|
+
AlertDialogProps,
|
|
294
|
+
AlertDialogSize,
|
|
295
|
+
AlertDialogTitleProps,
|
|
296
|
+
AlertDialogTriggerProps,
|
|
297
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
type AspectRatioProps = React.ComponentPropsWithoutRef<
|
|
9
|
+
typeof AspectRatioPrimitive.Root
|
|
10
|
+
>
|
|
11
|
+
|
|
12
|
+
const AspectRatio = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof AspectRatioPrimitive.Root>,
|
|
14
|
+
AspectRatioProps
|
|
15
|
+
>(function AspectRatio({ className, ...props }, ref) {
|
|
16
|
+
return (
|
|
17
|
+
<AspectRatioPrimitive.Root
|
|
18
|
+
data-slot="aspect-ratio"
|
|
19
|
+
ref={ref}
|
|
20
|
+
className={cn(
|
|
21
|
+
"overflow-hidden rounded-[var(--bh-radius-xl-10)] bg-[var(--bh-bg-neutral-subtle)]",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
)
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
export { AspectRatio }
|
|
30
|
+
export type { AspectRatioProps }
|