banhaten 0.1.0 → 0.1.1
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 -1
- package/package.json +1 -1
- package/registry/components/accordion.tsx +37 -1
- package/registry/components/alert.tsx +14 -28
- package/registry/components/attribute.tsx +6 -10
- package/registry/components/avatar.tsx +1 -2
- package/registry/components/button-group.tsx +1 -1
- package/registry/components/card.tsx +1 -1
- package/registry/components/checkbox.tsx +19 -16
- package/registry/components/expanded/ActivityFeed.tsx +37 -23
- package/registry/components/expanded/Banner.tsx +54 -19
- package/registry/components/expanded/Breadcrumbs.tsx +10 -38
- package/registry/components/expanded/CatalogComponentsShowcase.tsx +11 -16
- package/registry/components/expanded/CatalogTag.tsx +4 -11
- package/registry/components/expanded/CommandBar.tsx +33 -53
- package/registry/components/expanded/FileUpload.tsx +362 -59
- package/registry/components/expanded/OnboardingStepListItem.tsx +6 -10
- package/registry/components/expanded/PageHeader.tsx +2 -11
- package/registry/components/expanded/Slideout.tsx +12 -23
- package/registry/components/expanded/Steps.tsx +6 -8
- package/registry/components/expanded/Table.tsx +18 -40
- package/registry/components/expanded/Timeline.tsx +5 -24
- package/registry/components/expanded/activityFeed.css +10 -54
- package/registry/components/expanded/banner.css +8 -75
- package/registry/components/expanded/breadcrumbs.css +1 -1
- package/registry/components/expanded/commandBar.css +23 -26
- package/registry/components/expanded/divider.css +1 -1
- package/registry/components/expanded/fileUpload.css +304 -75
- package/registry/components/expanded/pageHeader.css +1 -1
- package/registry/components/expanded/steps.css +15 -51
- package/registry/components/expanded/table.css +5 -1
- package/registry/components/expanded/timeline.css +18 -15
- package/registry/components/input.tsx +125 -54
- package/registry/components/menu.tsx +99 -72
- package/registry/components/pagination.tsx +6 -18
- package/registry/components/radio-card.tsx +25 -31
- package/registry/components/select-content.tsx +28 -123
- package/registry/components/select.tsx +9 -9
- package/registry/components/social-button.tsx +24 -90
- package/registry/components/spinner.tsx +21 -5
- package/registry/components/textarea.tsx +20 -35
- package/registry/components/toggle.tsx +7 -23
- package/registry/components/tooltip.tsx +4 -4
- package/registry/examples/attribute-demo.tsx +2 -2
- package/registry/examples/checkbox-demo.tsx +3 -8
- package/registry/examples/date-picker-demo.tsx +75 -22
- package/registry/examples/expanded/banner-demo.tsx +31 -6
- package/registry/examples/expanded/breadcrumbs-demo.tsx +59 -0
- package/registry/examples/expanded/file-upload-demo.tsx +60 -0
- package/registry/examples/expanded/steps-demo.tsx +11 -0
- package/registry/examples/expanded/table-demo.tsx +142 -0
- package/registry/examples/progress-demo.tsx +2 -2
- package/registry/examples/select-demo.tsx +32 -18
- package/registry/examples/social-button-demo.tsx +33 -33
- package/registry/examples/spinner-demo.tsx +37 -0
- package/registry/examples/tag-demo.tsx +1 -1
- package/registry/index.json +26 -12
- package/registry/styles/globals.css +5 -3
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
|
|
3
|
+
import { UserIcon } from "lucide-react"
|
|
4
|
+
|
|
3
5
|
import { Checkbox, CheckboxCard } from "@/components/ui/checkbox"
|
|
4
6
|
|
|
5
7
|
export function CheckboxDemo() {
|
|
@@ -56,12 +58,5 @@ export function CheckboxDemo() {
|
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
function UserLineIcon() {
|
|
59
|
-
return
|
|
60
|
-
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24">
|
|
61
|
-
<path
|
|
62
|
-
fill="currentColor"
|
|
63
|
-
d="M4 22A8 8 0 0 1 20 22H18A6 6 0 0 0 6 22H4ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11Z"
|
|
64
|
-
/>
|
|
65
|
-
</svg>
|
|
66
|
-
)
|
|
61
|
+
return <UserIcon aria-hidden="true" focusable="false" strokeWidth={2.1} />
|
|
67
62
|
}
|
|
@@ -12,58 +12,111 @@ const selectedRange: CalendarRange = {
|
|
|
12
12
|
to: new Date(2050, 7, 23),
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
const staticPopoverClassName =
|
|
16
|
+
"static left-auto top-auto mt-2 translate-x-0"
|
|
17
|
+
const datePickerClassName =
|
|
18
|
+
"w-[var(--bh-date-surface-width-picker)] max-w-full"
|
|
19
|
+
const dateRangePickerClassName = "w-max max-w-none"
|
|
20
|
+
|
|
15
21
|
export function DatePickerDemo() {
|
|
16
22
|
return (
|
|
17
23
|
<div className="grid gap-8">
|
|
18
|
-
<div className="
|
|
19
|
-
<
|
|
20
|
-
|
|
24
|
+
<div className="grid gap-6 lg:grid-cols-[repeat(auto-fit,minmax(260px,max-content))]">
|
|
25
|
+
<div data-date-demo-item>
|
|
26
|
+
<Calendar value={selectedDate} />
|
|
27
|
+
</div>
|
|
28
|
+
<div data-date-demo-item>
|
|
29
|
+
<Calendar view="month-year" value={selectedDate} />
|
|
30
|
+
</div>
|
|
21
31
|
</div>
|
|
22
32
|
|
|
23
33
|
<div className="grid gap-6 xl:grid-cols-2">
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
<div data-date-demo-item>
|
|
35
|
+
<DatePicker
|
|
36
|
+
calendarProps={{ className: staticPopoverClassName }}
|
|
37
|
+
className={datePickerClassName}
|
|
38
|
+
defaultValue={selectedDate}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
<div data-date-demo-item dir="rtl">
|
|
27
42
|
<DatePicker
|
|
43
|
+
calendarProps={{ className: staticPopoverClassName }}
|
|
44
|
+
className={datePickerClassName}
|
|
28
45
|
dir="rtl"
|
|
29
|
-
placeholder="\u0627\u062e\u062a\u0631 \u062a\u0627\u0631\u064a\u062e"
|
|
46
|
+
placeholder={"\u0627\u062e\u062a\u0631 \u062a\u0627\u0631\u064a\u062e"}
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div className="grid gap-6 xl:grid-cols-2">
|
|
52
|
+
<div data-date-demo-item>
|
|
53
|
+
<DatePicker
|
|
54
|
+
calendarProps={{ className: staticPopoverClassName }}
|
|
55
|
+
className={datePickerClassName}
|
|
56
|
+
defaultOpen
|
|
57
|
+
defaultValue={selectedDate}
|
|
30
58
|
/>
|
|
31
59
|
</div>
|
|
32
|
-
<div dir="rtl">
|
|
60
|
+
<div data-date-demo-item dir="rtl">
|
|
33
61
|
<DatePicker
|
|
62
|
+
calendarProps={{ className: staticPopoverClassName }}
|
|
63
|
+
className={datePickerClassName}
|
|
34
64
|
defaultOpen
|
|
35
65
|
defaultValue={selectedDate}
|
|
36
66
|
dir="rtl"
|
|
37
|
-
placeholder="\u0627\u062e\u062a\u0631 \u062a\u0627\u0631\u064a\u062e"
|
|
67
|
+
placeholder={"\u0627\u062e\u062a\u0631 \u062a\u0627\u0631\u064a\u062e"}
|
|
38
68
|
/>
|
|
39
69
|
</div>
|
|
40
70
|
</div>
|
|
41
71
|
|
|
42
72
|
<div className="grid gap-6 overflow-x-auto">
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
73
|
+
<div data-date-demo-item>
|
|
74
|
+
<RangeCalendar value={selectedRange} />
|
|
75
|
+
</div>
|
|
76
|
+
<div data-date-demo-item>
|
|
77
|
+
<RangeCalendar type="double-with-presets" value={selectedRange} />
|
|
78
|
+
</div>
|
|
79
|
+
<div data-date-demo-item>
|
|
80
|
+
<RangeCalendar type="single" value={selectedRange} />
|
|
81
|
+
</div>
|
|
46
82
|
</div>
|
|
47
83
|
|
|
48
84
|
<div className="grid gap-6 xl:grid-cols-2">
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
85
|
+
<div data-date-demo-item className="overflow-x-auto pb-2">
|
|
86
|
+
<DateRangePicker
|
|
87
|
+
calendarProps={{ className: staticPopoverClassName }}
|
|
88
|
+
className={dateRangePickerClassName}
|
|
89
|
+
value={selectedRange}
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
<div data-date-demo-item className="overflow-x-auto pb-2" dir="rtl">
|
|
56
93
|
<DateRangePicker
|
|
94
|
+
calendarProps={{ className: staticPopoverClassName }}
|
|
95
|
+
className={dateRangePickerClassName}
|
|
57
96
|
dir="rtl"
|
|
58
|
-
placeholder="\u0627\u062e\u062a\u0631 \u0646\u0637\u0627\u0642 \u0627\u0644\u062a\u0627\u0631\u064a\u062e"
|
|
97
|
+
placeholder={"\u0627\u062e\u062a\u0631 \u0646\u0637\u0627\u0642 \u0627\u0644\u062a\u0627\u0631\u064a\u062e"}
|
|
98
|
+
value={selectedRange}
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<div className="grid gap-6">
|
|
104
|
+
<div data-date-demo-item className="overflow-x-auto pb-2">
|
|
105
|
+
<DateRangePicker
|
|
106
|
+
calendarProps={{ className: staticPopoverClassName }}
|
|
107
|
+
className={dateRangePickerClassName}
|
|
108
|
+
defaultOpen
|
|
109
|
+
type="double-with-presets"
|
|
59
110
|
value={selectedRange}
|
|
60
111
|
/>
|
|
61
112
|
</div>
|
|
62
|
-
<div dir="rtl">
|
|
113
|
+
<div data-date-demo-item className="overflow-x-auto pb-2" dir="rtl">
|
|
63
114
|
<DateRangePicker
|
|
115
|
+
calendarProps={{ className: staticPopoverClassName }}
|
|
116
|
+
className={dateRangePickerClassName}
|
|
64
117
|
defaultOpen
|
|
65
118
|
dir="rtl"
|
|
66
|
-
placeholder="\u064a\u0648\u0645 / \u0634\u0647\u0631 / \u0633\u0646\u0629"
|
|
119
|
+
placeholder={"\u064a\u0648\u0645 / \u0634\u0647\u0631 / \u0633\u0646\u0629"}
|
|
67
120
|
type="double-with-presets"
|
|
68
121
|
value={selectedRange}
|
|
69
122
|
/>
|
|
@@ -1,23 +1,48 @@
|
|
|
1
1
|
import { Banner } from "@/components/ui/expanded/Banner"
|
|
2
|
-
import { BannerBoard as ExpandedBannerBoard } from "@/components/ui/expanded/BannerBoard"
|
|
3
2
|
|
|
4
3
|
const bannerDemoCopy = {
|
|
5
4
|
actionLabel: "Button",
|
|
6
5
|
ariaLabel: "Announcement banner",
|
|
7
6
|
closeLabel: "Dismiss banner",
|
|
8
7
|
description: "Discover the Latest Updates in Our New Release",
|
|
9
|
-
inputAriaLabel: "Banner input",
|
|
10
|
-
inputPlaceholder: "Placeholder",
|
|
11
8
|
linkLabel: "Link button",
|
|
12
9
|
title: "Big news!",
|
|
13
10
|
}
|
|
14
11
|
|
|
12
|
+
const rtlBannerDemoCopy = {
|
|
13
|
+
actionLabel: "تطبيق",
|
|
14
|
+
ariaLabel: "شريط إعلان",
|
|
15
|
+
closeLabel: "إغلاق",
|
|
16
|
+
description: "اكتشف آخر التحديثات في إصدارنا الجديد",
|
|
17
|
+
linkLabel: "الرابط",
|
|
18
|
+
title: "أخبار مهمة!",
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
export function BannerDemo() {
|
|
16
22
|
return (
|
|
17
|
-
<div className="grid gap-
|
|
23
|
+
<div className="grid gap-4">
|
|
18
24
|
<Banner {...bannerDemoCopy} />
|
|
19
|
-
<Banner {...bannerDemoCopy} type="
|
|
20
|
-
<
|
|
25
|
+
<Banner {...bannerDemoCopy} type="single-action-inline" />
|
|
26
|
+
<Banner {...bannerDemoCopy} size="full-width" type="single-action" />
|
|
27
|
+
<Banner
|
|
28
|
+
{...bannerDemoCopy}
|
|
29
|
+
color="grey"
|
|
30
|
+
content="title-description"
|
|
31
|
+
size="full-width"
|
|
32
|
+
type="single-action"
|
|
33
|
+
/>
|
|
34
|
+
<Banner
|
|
35
|
+
{...bannerDemoCopy}
|
|
36
|
+
color="brand-light"
|
|
37
|
+
content="title-description"
|
|
38
|
+
type="single-action-inline"
|
|
39
|
+
/>
|
|
40
|
+
<Banner
|
|
41
|
+
{...rtlBannerDemoCopy}
|
|
42
|
+
content="title-description"
|
|
43
|
+
dir="rtl"
|
|
44
|
+
type="single-action-inline"
|
|
45
|
+
/>
|
|
21
46
|
</div>
|
|
22
47
|
)
|
|
23
48
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BreadcrumbFolderIcon,
|
|
3
|
+
BreadcrumbHomeIcon,
|
|
4
|
+
Breadcrumbs,
|
|
5
|
+
type BreadcrumbItem,
|
|
6
|
+
} from "@/components/ui/expanded/Breadcrumbs"
|
|
7
|
+
|
|
8
|
+
const breadcrumbItems: BreadcrumbItem[] = [
|
|
9
|
+
{ label: "Home", href: "#", icon: <BreadcrumbHomeIcon /> },
|
|
10
|
+
{ label: "Design system", href: "#", icon: <BreadcrumbFolderIcon /> },
|
|
11
|
+
{ label: "Components", href: "#" },
|
|
12
|
+
{ label: "Breadcrumbs", current: true },
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
const longBreadcrumbItems: BreadcrumbItem[] = [
|
|
16
|
+
{ label: "Home", href: "#", icon: <BreadcrumbHomeIcon /> },
|
|
17
|
+
{ label: "Workspace", href: "#", icon: <BreadcrumbFolderIcon /> },
|
|
18
|
+
{ label: "Design System", href: "#" },
|
|
19
|
+
{ label: "Components", href: "#" },
|
|
20
|
+
{ label: "Navigation", href: "#" },
|
|
21
|
+
{ label: "Breadcrumbs", current: true },
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
const rtlBreadcrumbItems: BreadcrumbItem[] = [
|
|
25
|
+
{ label: "\u0627\u0644\u0631\u0626\u064a\u0633\u064a\u0629", href: "#", icon: <BreadcrumbHomeIcon /> },
|
|
26
|
+
{ label: "\u0627\u0644\u0646\u0638\u0627\u0645", href: "#", icon: <BreadcrumbFolderIcon /> },
|
|
27
|
+
{ label: "\u0627\u0644\u0645\u0643\u0648\u0646\u0627\u062a", current: true },
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
export function BreadcrumbsDemo() {
|
|
31
|
+
return (
|
|
32
|
+
<div className="grid gap-4">
|
|
33
|
+
<Breadcrumbs aria-label="Breadcrumb" items={breadcrumbItems} overflowLabel="More" />
|
|
34
|
+
<Breadcrumbs
|
|
35
|
+
aria-label="Breadcrumb"
|
|
36
|
+
items={breadcrumbItems}
|
|
37
|
+
overflowLabel="More"
|
|
38
|
+
separator="chevron"
|
|
39
|
+
style="raised"
|
|
40
|
+
/>
|
|
41
|
+
<Breadcrumbs
|
|
42
|
+
aria-label="Breadcrumb"
|
|
43
|
+
items={longBreadcrumbItems}
|
|
44
|
+
maxItems={4}
|
|
45
|
+
overflowLabel="More"
|
|
46
|
+
separator="chevron"
|
|
47
|
+
style="raised"
|
|
48
|
+
/>
|
|
49
|
+
<Breadcrumbs
|
|
50
|
+
aria-label={"\u0627\u0644\u0645\u0633\u0627\u0631"}
|
|
51
|
+
dir="rtl"
|
|
52
|
+
items={rtlBreadcrumbItems}
|
|
53
|
+
overflowLabel={"\u0627\u0644\u0645\u0632\u064a\u062f"}
|
|
54
|
+
separator="chevron"
|
|
55
|
+
style="raised"
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FileUpload,
|
|
3
|
+
type FileUploadFile,
|
|
4
|
+
} from "@/components/ui/expanded/FileUpload"
|
|
5
|
+
|
|
6
|
+
const uploadFiles: FileUploadFile[] = [
|
|
7
|
+
{
|
|
8
|
+
id: "uploaded",
|
|
9
|
+
name: "file-name.pdf",
|
|
10
|
+
sizeLabel: "32mb",
|
|
11
|
+
status: "uploaded",
|
|
12
|
+
versionLabel: "v1.2.2",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "uploading",
|
|
16
|
+
name: "file-name.pdf",
|
|
17
|
+
sizeLabel: "32mb",
|
|
18
|
+
status: "uploading",
|
|
19
|
+
versionLabel: "v1.2.2",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "progress",
|
|
23
|
+
name: "file-name.pdf",
|
|
24
|
+
progress: 40,
|
|
25
|
+
sizeLabel: "32 KB",
|
|
26
|
+
status: "uploading-progress",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
errorLabel: "Upload failed",
|
|
30
|
+
id: "error",
|
|
31
|
+
name: "file-name.pdf",
|
|
32
|
+
sizeLabel: "32mb",
|
|
33
|
+
status: "error",
|
|
34
|
+
versionLabel: "v1.2.2",
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
export function FileUploadDemo() {
|
|
39
|
+
return (
|
|
40
|
+
<div className="grid items-start gap-5 xl:grid-cols-2">
|
|
41
|
+
<FileUpload
|
|
42
|
+
files={uploadFiles}
|
|
43
|
+
multiple
|
|
44
|
+
/>
|
|
45
|
+
<FileUpload
|
|
46
|
+
files={uploadFiles}
|
|
47
|
+
size="sm"
|
|
48
|
+
/>
|
|
49
|
+
<FileUpload
|
|
50
|
+
dropzoneState="hover"
|
|
51
|
+
files={uploadFiles.slice(0, 1)}
|
|
52
|
+
variant="button"
|
|
53
|
+
/>
|
|
54
|
+
<FileUpload
|
|
55
|
+
disabled
|
|
56
|
+
files={[]}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
import { Button } from "@/components/ui/button"
|
|
1
2
|
import { Steps, type StepItem } from "@/components/ui/expanded/Steps"
|
|
2
3
|
|
|
3
4
|
const stepItems: StepItem[] = Array.from({ length: 6 }, (_, index) => ({
|
|
5
|
+
actions: (
|
|
6
|
+
<>
|
|
7
|
+
<Button size="sm" type="button" variant="default">
|
|
8
|
+
Button
|
|
9
|
+
</Button>
|
|
10
|
+
<Button size="sm" type="button" variant="secondary">
|
|
11
|
+
Button
|
|
12
|
+
</Button>
|
|
13
|
+
</>
|
|
14
|
+
),
|
|
4
15
|
caption: "Caption",
|
|
5
16
|
label: "Label",
|
|
6
17
|
number: index + 1,
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DataTable,
|
|
5
|
+
type TableColumn,
|
|
6
|
+
type TableRowBase,
|
|
7
|
+
type TableSortState,
|
|
8
|
+
} from "@/components/ui/expanded/Table"
|
|
9
|
+
|
|
10
|
+
type ProjectRow = TableRowBase & {
|
|
11
|
+
owner: string
|
|
12
|
+
progress: number
|
|
13
|
+
project: string
|
|
14
|
+
status: "Ready" | "Review" | "Blocked"
|
|
15
|
+
updated: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const rows: ProjectRow[] = [
|
|
19
|
+
{
|
|
20
|
+
id: "token-contract",
|
|
21
|
+
owner: "Maya Chen",
|
|
22
|
+
progress: 92,
|
|
23
|
+
project: "Token contract",
|
|
24
|
+
status: "Ready",
|
|
25
|
+
updated: "Today",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "rtl-matrix",
|
|
29
|
+
owner: "Nora Ali",
|
|
30
|
+
progress: 74,
|
|
31
|
+
project: "RTL matrix",
|
|
32
|
+
status: "Review",
|
|
33
|
+
updated: "Yesterday",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "data-table",
|
|
37
|
+
owner: "Ahmed Galal",
|
|
38
|
+
progress: 58,
|
|
39
|
+
project: "Data table",
|
|
40
|
+
status: "Review",
|
|
41
|
+
updated: "Jun 12",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "audit-backgrounds",
|
|
45
|
+
owner: "Leila Haddad",
|
|
46
|
+
progress: 41,
|
|
47
|
+
project: "Audit backgrounds",
|
|
48
|
+
status: "Blocked",
|
|
49
|
+
updated: "Jun 10",
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
const columns: TableColumn<ProjectRow>[] = [
|
|
54
|
+
{ id: "selection", kind: "selection", width: 42 },
|
|
55
|
+
{
|
|
56
|
+
id: "project",
|
|
57
|
+
header: "Project",
|
|
58
|
+
item: (row) => ({ type: "text", value: row.project, weight: "medium" }),
|
|
59
|
+
minWidth: 220,
|
|
60
|
+
searchValue: (row) => row.project,
|
|
61
|
+
sortable: true,
|
|
62
|
+
sortValue: (row) => row.project,
|
|
63
|
+
width: "fill",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "owner",
|
|
67
|
+
header: "Owner",
|
|
68
|
+
item: (row) => ({ type: "avatarText", name: row.owner, caption: row.status }),
|
|
69
|
+
searchValue: (row) => row.owner,
|
|
70
|
+
sortable: true,
|
|
71
|
+
sortValue: (row) => row.owner,
|
|
72
|
+
width: 180,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "status",
|
|
76
|
+
header: "Status",
|
|
77
|
+
item: (row) => ({
|
|
78
|
+
type: "badges",
|
|
79
|
+
items: [
|
|
80
|
+
{
|
|
81
|
+
dot: true,
|
|
82
|
+
label: row.status,
|
|
83
|
+
tone:
|
|
84
|
+
row.status === "Ready"
|
|
85
|
+
? "success"
|
|
86
|
+
: row.status === "Review"
|
|
87
|
+
? "amber"
|
|
88
|
+
: "danger",
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
}),
|
|
92
|
+
searchValue: (row) => row.status,
|
|
93
|
+
sortable: true,
|
|
94
|
+
sortValue: (row) => row.status,
|
|
95
|
+
width: 132,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: "progress",
|
|
99
|
+
header: "Progress",
|
|
100
|
+
item: (row) => ({ type: "progress", value: row.progress, label: `${row.progress}%` }),
|
|
101
|
+
sortable: true,
|
|
102
|
+
sortValue: (row) => row.progress,
|
|
103
|
+
width: 150,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: "updated",
|
|
107
|
+
header: "Updated",
|
|
108
|
+
item: (row) => ({ type: "text", value: row.updated, tone: "subtle" }),
|
|
109
|
+
searchValue: (row) => row.updated,
|
|
110
|
+
sortable: true,
|
|
111
|
+
sortValue: (row) => row.updated,
|
|
112
|
+
width: 118,
|
|
113
|
+
},
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
export function TableDemo() {
|
|
117
|
+
const [selectedRows, setSelectedRows] = React.useState<string[]>(["token-contract"])
|
|
118
|
+
const [sort, setSort] = React.useState<TableSortState>({
|
|
119
|
+
columnId: "project",
|
|
120
|
+
direction: "asc",
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<DataTable
|
|
125
|
+
actions={[
|
|
126
|
+
{ label: "Export", variant: "soft" },
|
|
127
|
+
{ label: "Create", variant: "default" },
|
|
128
|
+
]}
|
|
129
|
+
bulkActions={[{ label: "Archive", variant: "outline" }]}
|
|
130
|
+
columns={columns}
|
|
131
|
+
description="Search, sort, select, paginate, and act on a compact operational dataset."
|
|
132
|
+
onSelectedRowIdsChange={setSelectedRows}
|
|
133
|
+
onSortChange={setSort}
|
|
134
|
+
pagination={{ pageSize: 3 }}
|
|
135
|
+
rows={rows}
|
|
136
|
+
search={{ label: "Search projects", placeholder: "Search projects..." }}
|
|
137
|
+
selectedRowIds={selectedRows}
|
|
138
|
+
sort={sort}
|
|
139
|
+
title="Component Operations"
|
|
140
|
+
/>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
@@ -24,8 +24,8 @@ export function ProgressDemo() {
|
|
|
24
24
|
<Progress
|
|
25
25
|
aria-label="Arabic upload progress"
|
|
26
26
|
indicator="40%"
|
|
27
|
-
label="\u0639\u0646\u0648\u0627\u0646"
|
|
28
|
-
optional="\u0028\u0627\u062e\u062a\u064a\u0627\u0631\u064a\u0029"
|
|
27
|
+
label={"\u0639\u0646\u0648\u0627\u0646"}
|
|
28
|
+
optional={"\u0028\u0627\u062e\u062a\u064a\u0627\u0631\u064a\u0029"}
|
|
29
29
|
showInfo
|
|
30
30
|
showSpinner
|
|
31
31
|
size="sm"
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Select,
|
|
3
|
-
SelectItemAvatar,
|
|
4
3
|
SelectItemCompanyLogo,
|
|
5
|
-
SelectItemFlag,
|
|
6
4
|
SelectItemPaymentIcon,
|
|
7
|
-
SelectItemStatusDot,
|
|
8
5
|
SelectMenuItem,
|
|
9
6
|
} from "@/components/ui/select"
|
|
10
7
|
|
|
@@ -14,14 +11,13 @@ export function SelectDemo() {
|
|
|
14
11
|
<Select
|
|
15
12
|
helperText="This is a hint text"
|
|
16
13
|
label="Label"
|
|
17
|
-
open
|
|
18
14
|
placeholder="Select User"
|
|
19
15
|
state="filled"
|
|
20
16
|
value="Username"
|
|
21
17
|
>
|
|
22
18
|
<SelectMenuItem itemType="default" label="Text option" addonText="Meta" />
|
|
19
|
+
<SelectMenuItem itemType="icon" label="Add item" addonText="Action" />
|
|
23
20
|
<SelectMenuItem itemType="avatar" label="User" addonText="Active" />
|
|
24
|
-
<SelectMenuItem itemType="flag" label="Egypt" addonText="+20" />
|
|
25
21
|
<SelectMenuItem itemType="company" label="Company" addonText="Workspace" />
|
|
26
22
|
<SelectMenuItem itemType="payment" label="Visa ending 2048" addonText="Default" />
|
|
27
23
|
<SelectMenuItem itemType="dot" label="Active status" addonText="Online" selected />
|
|
@@ -40,32 +36,50 @@ export function SelectDemo() {
|
|
|
40
36
|
/>
|
|
41
37
|
</Select>
|
|
42
38
|
|
|
43
|
-
<Select
|
|
39
|
+
<Select
|
|
40
|
+
dir="rtl"
|
|
41
|
+
helperText="هذا نص تلميح."
|
|
42
|
+
label="ملصق"
|
|
43
|
+
placeholder="اختر مستخدمًا"
|
|
44
|
+
state="filled"
|
|
45
|
+
value="اسم المستخدم"
|
|
46
|
+
>
|
|
44
47
|
<SelectMenuItem
|
|
45
48
|
dir="rtl"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
itemType="default"
|
|
50
|
+
label="خيار نصي"
|
|
51
|
+
addonText="بيانات"
|
|
52
|
+
/>
|
|
53
|
+
<SelectMenuItem
|
|
54
|
+
dir="rtl"
|
|
55
|
+
itemType="icon"
|
|
56
|
+
label="إضافة"
|
|
57
|
+
addonText="إجراء"
|
|
49
58
|
/>
|
|
50
59
|
<SelectMenuItem
|
|
51
60
|
dir="rtl"
|
|
61
|
+
itemType="avatar"
|
|
52
62
|
label="مستخدم"
|
|
53
63
|
addonText="نشط"
|
|
54
|
-
media={<SelectItemAvatar fallback="م" />}
|
|
55
|
-
selectionType="checkbox"
|
|
56
|
-
selected
|
|
57
64
|
/>
|
|
58
65
|
<SelectMenuItem
|
|
59
66
|
dir="rtl"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
itemType="company"
|
|
68
|
+
label="شركة"
|
|
69
|
+
addonText="مساحة عمل"
|
|
63
70
|
/>
|
|
64
71
|
<SelectMenuItem
|
|
65
72
|
dir="rtl"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
itemType="payment"
|
|
74
|
+
label="بطاقة تنتهي بـ 2048"
|
|
75
|
+
addonText="افتراضي"
|
|
76
|
+
/>
|
|
77
|
+
<SelectMenuItem
|
|
78
|
+
dir="rtl"
|
|
79
|
+
itemType="dot"
|
|
80
|
+
label="حالة نشطة"
|
|
81
|
+
addonText="متصل"
|
|
82
|
+
selected
|
|
69
83
|
/>
|
|
70
84
|
</Select>
|
|
71
85
|
</div>
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { SocialButton } from "@/components/ui/social-button"
|
|
1
|
+
import { SocialButton, type SocialPlatform } from "@/components/ui/social-button"
|
|
2
|
+
|
|
3
|
+
const socialPlatforms: SocialPlatform[] = [
|
|
4
|
+
"apple",
|
|
5
|
+
"facebook",
|
|
6
|
+
"google",
|
|
7
|
+
"linkedin",
|
|
8
|
+
"twitter",
|
|
9
|
+
"whatsapp",
|
|
10
|
+
]
|
|
2
11
|
|
|
3
12
|
export function SocialButtonDemo() {
|
|
4
13
|
return (
|
|
5
14
|
<div className="flex flex-col gap-6">
|
|
6
15
|
<div className="flex flex-wrap items-center gap-3">
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<SocialButton platform="linkedin" />
|
|
11
|
-
<SocialButton platform="twitter" />
|
|
12
|
-
<SocialButton platform="whatsapp" />
|
|
16
|
+
{socialPlatforms.map((platform) => (
|
|
17
|
+
<SocialButton key={platform} platform={platform} />
|
|
18
|
+
))}
|
|
13
19
|
</div>
|
|
14
20
|
|
|
15
21
|
<div className="flex flex-wrap items-center gap-3">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<SocialButton platform="linkedin" variant="outline" />
|
|
20
|
-
<SocialButton platform="twitter" variant="outline" />
|
|
21
|
-
<SocialButton platform="whatsapp" variant="outline" />
|
|
22
|
+
{socialPlatforms.map((platform) => (
|
|
23
|
+
<SocialButton key={platform} platform={platform} variant="outline" />
|
|
24
|
+
))}
|
|
22
25
|
</div>
|
|
23
26
|
|
|
24
27
|
<div className="flex flex-wrap items-center gap-3">
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
{socialPlatforms.map((platform) => (
|
|
29
|
+
<SocialButton key={platform} platform={platform} size="icon" />
|
|
30
|
+
))}
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div dir="rtl" className="flex flex-wrap items-center gap-3">
|
|
34
|
+
{socialPlatforms.map((platform) => (
|
|
35
|
+
<SocialButton key={platform} dir="rtl" platform={platform} />
|
|
36
|
+
))}
|
|
31
37
|
</div>
|
|
32
38
|
|
|
33
39
|
<div dir="rtl" className="flex flex-wrap items-center gap-3">
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/>
|
|
43
|
-
<SocialButton
|
|
44
|
-
label="تسجيل الدخول باستخدام جوجل"
|
|
45
|
-
platform="google"
|
|
46
|
-
variant="outline"
|
|
47
|
-
/>
|
|
40
|
+
{socialPlatforms.map((platform) => (
|
|
41
|
+
<SocialButton
|
|
42
|
+
key={platform}
|
|
43
|
+
dir="rtl"
|
|
44
|
+
platform={platform}
|
|
45
|
+
variant="outline"
|
|
46
|
+
/>
|
|
47
|
+
))}
|
|
48
48
|
</div>
|
|
49
49
|
</div>
|
|
50
50
|
)
|