banhaten 0.1.3 → 0.2.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/CHANGELOG.md +45 -0
- package/CONTRIBUTING.md +44 -0
- package/README.md +65 -13
- package/SECURITY.md +15 -0
- package/banhaten.config.example.json +0 -2
- package/docs/design-system/README.md +9 -0
- package/docs/design-system/adoption-quality-remediation.md +87 -0
- package/docs/design-system/agent-usage.md +13 -0
- package/docs/design-system/appearance-presets.md +6 -1
- package/docs/design-system/component-docs-pattern.md +81 -0
- package/docs/design-system/component-token-consistency-audit.md +13 -3
- package/docs/design-system/components/README.md +3 -2
- package/docs/design-system/components/accordion.md +16 -0
- package/docs/design-system/components/activity-feed.md +15 -1
- package/docs/design-system/components/alert-dialog.md +17 -0
- package/docs/design-system/components/alert.md +46 -14
- package/docs/design-system/components/aspect-ratio.md +15 -0
- package/docs/design-system/components/attribute.md +16 -0
- package/docs/design-system/components/autocomplete.md +19 -0
- package/docs/design-system/components/avatar.md +18 -0
- package/docs/design-system/components/badge.md +19 -0
- package/docs/design-system/components/banner.md +15 -1
- package/docs/design-system/components/breadcrumbs.md +14 -0
- package/docs/design-system/components/button-group.md +34 -0
- package/docs/design-system/components/button.md +18 -0
- package/docs/design-system/components/card.md +18 -1
- package/docs/design-system/components/carousel.md +20 -3
- package/docs/design-system/components/catalog-components.md +15 -1
- package/docs/design-system/components/chart.md +15 -0
- package/docs/design-system/components/checkbox.md +16 -0
- package/docs/design-system/components/collapsible.md +15 -0
- package/docs/design-system/components/command.md +15 -0
- package/docs/design-system/components/context-menu.md +15 -0
- package/docs/design-system/components/date-picker.md +21 -1
- package/docs/design-system/components/divider.md +16 -0
- package/docs/design-system/components/empty-state.md +17 -0
- package/docs/design-system/components/field.md +17 -0
- package/docs/design-system/components/file-upload.md +14 -0
- package/docs/design-system/components/hover-card.md +15 -0
- package/docs/design-system/components/input-group.md +17 -0
- package/docs/design-system/components/input-otp.md +18 -0
- package/docs/design-system/components/input.md +43 -7
- package/docs/design-system/components/item.md +72 -0
- package/docs/design-system/components/kbd.md +18 -0
- package/docs/design-system/components/label.md +16 -0
- package/docs/design-system/components/menu.md +17 -0
- package/docs/design-system/components/menubar.md +15 -0
- package/docs/design-system/components/modal.md +25 -4
- package/docs/design-system/components/native-select.md +18 -0
- package/docs/design-system/components/navigation-menu.md +15 -0
- package/docs/design-system/components/onboarding-step-list-item.md +15 -1
- package/docs/design-system/components/page-header.md +15 -1
- package/docs/design-system/components/pagination.md +30 -8
- package/docs/design-system/components/popover.md +19 -0
- package/docs/design-system/components/progress-slider.md +18 -0
- package/docs/design-system/components/progress.md +17 -0
- package/docs/design-system/components/radio-card.md +16 -0
- package/docs/design-system/components/radio-group.md +17 -0
- package/docs/design-system/components/resizable.md +15 -0
- package/docs/design-system/components/scroll-area.md +15 -0
- package/docs/design-system/components/segmented-control.md +71 -0
- package/docs/design-system/components/select.md +44 -7
- package/docs/design-system/components/sheet.md +17 -0
- package/docs/design-system/components/sidebar.md +15 -0
- package/docs/design-system/components/skeleton.md +18 -0
- package/docs/design-system/components/slideout.md +14 -0
- package/docs/design-system/components/slider.md +20 -0
- package/docs/design-system/components/social-button.md +21 -3
- package/docs/design-system/components/spinner.md +16 -0
- package/docs/design-system/components/steps.md +14 -0
- package/docs/design-system/components/table.md +15 -1
- package/docs/design-system/components/tabs.md +17 -0
- package/docs/design-system/components/tag.md +17 -0
- package/docs/design-system/components/textarea.md +16 -0
- package/docs/design-system/components/timeline.md +14 -0
- package/docs/design-system/components/toast.md +17 -0
- package/docs/design-system/components/toggle.md +17 -0
- package/docs/design-system/components/toolbar.md +21 -1
- package/docs/design-system/components/tooltip.md +18 -1
- package/docs/design-system/density-and-elevation.md +44 -0
- package/docs/design-system/direction-and-localization.md +23 -0
- package/docs/design-system/form-recipes.md +73 -0
- package/docs/design-system/gap-promotion-policy.md +21 -0
- package/docs/design-system/gap-promotion-report.md +166 -0
- package/docs/design-system/installation.md +68 -0
- package/docs/design-system/launch-comparison-shadcn.md +98 -0
- package/docs/design-system/registry-and-cli.md +30 -7
- package/docs/design-system/release-policy.md +30 -0
- package/docs/design-system/roadmap.md +14 -0
- package/docs/design-system/support-matrix.md +23 -0
- package/docs/design-system/tabs.md +1 -1
- package/docs/design-system/token-governance.md +23 -1
- package/package.json +29 -15
- package/registry/component-contract.json +40 -0
- package/registry/components/alert-dialog.tsx +1 -1
- package/registry/components/alert.tsx +86 -65
- package/registry/components/autocomplete.tsx +23 -9
- package/registry/components/avatar.tsx +7 -7
- package/registry/components/badge.tsx +1 -1
- package/registry/components/button-group.tsx +321 -4
- package/registry/components/button.tsx +38 -17
- package/registry/components/card.tsx +68 -59
- package/registry/components/carousel.tsx +53 -5
- package/registry/components/chart.tsx +36 -3
- package/registry/components/checkbox.tsx +3 -3
- package/registry/components/collapsible.tsx +1 -1
- package/registry/components/command.tsx +1 -1
- package/registry/components/context-menu.tsx +1 -1
- package/registry/components/date-picker.tsx +245 -104
- package/registry/components/expanded/ActivityFeed.tsx +6 -15
- package/registry/components/expanded/Banner.tsx +3 -3
- package/registry/components/expanded/Breadcrumbs.tsx +5 -5
- package/registry/components/expanded/CatalogComponentsShowcase.tsx +13 -13
- package/registry/components/expanded/CatalogDivider.tsx +1 -1
- package/registry/components/expanded/EmptyState.tsx +1 -1
- package/registry/components/expanded/FileUpload.tsx +9 -2
- package/registry/components/expanded/OnboardingStepListItem.tsx +2 -4
- package/registry/components/expanded/PageHeader.tsx +13 -13
- package/registry/components/expanded/Slideout.tsx +15 -415
- package/registry/components/expanded/Steps.tsx +4 -4
- package/registry/components/expanded/Table.tsx +116 -69
- package/registry/components/expanded/Timeline.tsx +3 -3
- package/registry/components/expanded/activityFeed.css +1 -1
- package/registry/components/expanded/breadcrumbs.css +1 -1
- package/registry/components/expanded/divider.css +1 -1
- package/registry/components/expanded/emptyState.css +1 -1
- package/registry/components/expanded/fileUpload.css +6 -6
- package/registry/components/expanded/slideout.css +9 -685
- package/registry/components/expanded/steps.css +3 -3
- package/registry/components/expanded/table.css +2 -2
- package/registry/components/expanded/timeline.css +2 -2
- package/registry/components/input-content.ts +1 -0
- package/registry/components/input-otp.tsx +13 -3
- package/registry/components/input.tsx +68 -43
- package/registry/components/item.tsx +189 -0
- package/registry/components/kbd.tsx +111 -4
- package/registry/components/menu.tsx +31 -245
- package/registry/components/menubar.tsx +1 -1
- package/registry/components/modal.tsx +142 -102
- package/registry/components/native-select.tsx +2 -2
- package/registry/components/pagination.tsx +80 -58
- package/registry/components/popover.tsx +162 -664
- package/registry/components/radio-card.tsx +116 -87
- package/registry/components/segmented-control.tsx +87 -0
- package/registry/components/select-content.tsx +2 -2
- package/registry/components/select.tsx +52 -16
- package/registry/components/sheet.tsx +1 -1
- package/registry/components/sidebar.tsx +1 -1
- package/registry/components/skeleton.css +0 -3
- package/registry/components/social-button.tsx +47 -25
- package/registry/components/spinner.tsx +18 -55
- package/registry/components/tabs.css +1 -1
- package/registry/components/tabs.tsx +8 -4
- package/registry/components/tag.tsx +2 -2
- package/registry/components/textarea.tsx +3 -3
- package/registry/components/toast.tsx +16 -11
- package/registry/components/toggle.tsx +2 -2
- package/registry/components/toolbar.tsx +89 -17
- package/registry/components/tooltip.tsx +1 -1
- package/registry/examples/alert-demo.tsx +25 -5
- package/registry/examples/attribute-demo.tsx +1 -1
- package/registry/examples/autocomplete-demo.tsx +3 -3
- package/registry/examples/avatar-demo.tsx +7 -7
- package/registry/examples/badge-demo.tsx +1 -1
- package/registry/examples/button-demo.tsx +6 -6
- package/registry/examples/button-group-demo.tsx +23 -2
- package/registry/examples/card-demo.tsx +46 -8
- package/registry/examples/carousel-demo.tsx +20 -2
- package/registry/examples/chart-demo.tsx +1 -1
- package/registry/examples/checkbox-demo.tsx +5 -5
- package/registry/examples/collection-filter-bar-demo.tsx +135 -0
- package/registry/examples/command-demo.tsx +3 -3
- package/registry/examples/{expanded/command-bar-demo.tsx → command-palette-demo.tsx} +5 -15
- package/registry/examples/context-menu-demo.tsx +1 -1
- package/registry/examples/control-density-contract-demo.tsx +61 -0
- package/registry/examples/date-picker-demo.tsx +12 -12
- package/registry/examples/divider-demo.tsx +3 -3
- package/registry/examples/expanded/banner-demo.tsx +1 -1
- package/registry/examples/expanded/breadcrumbs-demo.tsx +1 -1
- package/registry/examples/expanded/empty-state-demo.tsx +1 -1
- package/registry/examples/expanded/file-upload-demo.tsx +1 -1
- package/registry/examples/expanded/onboarding-step-demo.tsx +1 -1
- package/registry/examples/expanded/slideout-demo.tsx +2 -2
- package/registry/examples/expanded/steps-demo.tsx +1 -1
- package/registry/examples/expanded/tabs-demo.tsx +1 -1
- package/registry/examples/expanded/timeline-demo.tsx +1 -1
- package/registry/examples/hover-card-demo.tsx +2 -2
- package/registry/examples/input-demo.tsx +6 -6
- package/registry/examples/input-otp-demo.tsx +4 -4
- package/registry/examples/item-demo.tsx +46 -0
- package/registry/examples/kbd-demo.tsx +1 -1
- package/registry/examples/label-demo.tsx +1 -1
- package/registry/examples/menu-demo.tsx +1 -1
- package/registry/examples/modal-demo.tsx +67 -9
- package/registry/examples/navigation-menu-demo.tsx +1 -1
- package/registry/examples/pagination-demo.tsx +6 -3
- package/registry/examples/popover-demo.tsx +19 -19
- package/registry/examples/progress-demo.tsx +1 -1
- package/registry/examples/progress-slider-demo.tsx +1 -1
- package/registry/examples/radio-card-demo.tsx +4 -4
- package/registry/examples/radio-group-demo.tsx +2 -2
- package/registry/examples/resizable-demo.tsx +1 -1
- package/registry/examples/results-toolbar-demo.tsx +44 -0
- package/registry/examples/scroll-area-demo.tsx +3 -3
- package/registry/examples/segmented-control-demo.tsx +39 -0
- package/registry/examples/select-demo.tsx +1 -1
- package/registry/examples/sidebar-demo.tsx +1 -1
- package/registry/examples/slider-demo.tsx +3 -3
- package/registry/examples/social-button-demo.tsx +18 -8
- package/registry/examples/spinner-demo.tsx +13 -13
- package/registry/examples/tabs-demo.tsx +1 -1
- package/registry/examples/tag-demo.tsx +1 -1
- package/registry/examples/textarea-demo.tsx +4 -4
- package/registry/examples/toast-demo.tsx +1 -1
- package/registry/examples/toggle-demo.tsx +6 -6
- package/registry/examples/tooltip-demo.tsx +4 -4
- package/registry/guidance/USAGE.md +27 -0
- package/registry/hooks/use-direction.ts +193 -13
- package/registry/index.json +5311 -377
- package/registry/styles/globals.css +2440 -4061
- package/registry.json +119 -149
- package/schema/config.schema.json +11 -8
- package/schema/registry.schema.json +150 -45
- package/schema/tokens.schema.json +134 -34
- package/src/cli/command-line.js +194 -0
- package/src/cli/config-editors.js +9 -0
- package/src/cli/doctor.js +399 -0
- package/src/cli/file-transaction.js +295 -0
- package/src/cli/global-css.js +153 -0
- package/src/cli/index.js +567 -1613
- package/src/cli/install-plan.js +592 -0
- package/src/cli/install-receipt.js +171 -0
- package/src/cli/jsonc.js +203 -0
- package/src/cli/package-install-state.js +254 -0
- package/src/cli/package-manager.js +238 -0
- package/src/cli/package-plan.js +185 -0
- package/src/cli/package-version.js +97 -0
- package/src/cli/registry-query.js +207 -0
- package/src/cli/reporting.js +55 -0
- package/src/cli/schema-validation.js +19 -0
- package/src/cli/source-scanner.js +686 -0
- package/src/cli/vite-config.js +478 -0
- package/tokens/banhaten.tokens.json +4312 -309
- package/docs/design-system/components/command-bar.md +0 -57
- package/registry/components/expanded/BannerBoard.tsx +0 -225
- package/registry/components/expanded/CatalogTag.tsx +0 -85
- package/registry/components/expanded/CommandBar.tsx +0 -386
- package/registry/components/expanded/IconExplorer.tsx +0 -612
- package/registry/components/expanded/TimelineShowcase.tsx +0 -158
- package/registry/components/expanded/commandBar.css +0 -470
- package/registry/components/expanded/iconExplorer.css +0 -764
- package/registry/components/expanded/iconPacks.ts +0 -866
- package/registry/components/expanded/tag.css +0 -148
- package/registry/examples/expanded/icons-demo.tsx +0 -5
- package/tokens/Color mode.zip +0 -0
- package/tokens/Numbers.zip +0 -0
- package/tokens/Radius.zip +0 -0
- package/tokens/Theme.zip +0 -0
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
CheckIcon as LucideCheckIcon,
|
|
4
|
-
ChevronDownIcon as LucideChevronDownIcon,
|
|
5
|
-
PaperclipIcon as LucidePaperclipIcon,
|
|
6
|
-
UploadCloudIcon as LucideUploadCloudIcon,
|
|
7
|
-
XIcon,
|
|
8
|
-
} from "lucide-react";
|
|
2
|
+
import { XIcon } from "lucide-react";
|
|
9
3
|
import "./slideout.css";
|
|
10
4
|
|
|
11
5
|
export type SlideoutSize = "small" | "medium" | "large";
|
|
@@ -20,6 +14,10 @@ export type SlideoutProps = {
|
|
|
20
14
|
dir?: "ltr" | "rtl";
|
|
21
15
|
footer?: boolean;
|
|
22
16
|
headerAction?: boolean;
|
|
17
|
+
onAction?: () => void;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
onPrimaryAction?: () => void;
|
|
20
|
+
onSecondaryAction?: () => void;
|
|
23
21
|
primaryActionLabel?: string;
|
|
24
22
|
secondaryAction?: boolean;
|
|
25
23
|
secondaryActionLabel?: string;
|
|
@@ -27,10 +25,6 @@ export type SlideoutProps = {
|
|
|
27
25
|
title?: string;
|
|
28
26
|
};
|
|
29
27
|
|
|
30
|
-
type SlideoutSlotExampleProps = {
|
|
31
|
-
dir?: "ltr" | "rtl";
|
|
32
|
-
};
|
|
33
|
-
|
|
34
28
|
function cx(...classes: Array<string | false | null | undefined>) {
|
|
35
29
|
return classes.filter(Boolean).join(" ");
|
|
36
30
|
}
|
|
@@ -41,9 +35,13 @@ export function Slideout({
|
|
|
41
35
|
children,
|
|
42
36
|
className = "",
|
|
43
37
|
closeLabel,
|
|
44
|
-
dir
|
|
38
|
+
dir,
|
|
45
39
|
footer = true,
|
|
46
40
|
headerAction = true,
|
|
41
|
+
onAction,
|
|
42
|
+
onClose,
|
|
43
|
+
onPrimaryAction,
|
|
44
|
+
onSecondaryAction,
|
|
47
45
|
primaryActionLabel,
|
|
48
46
|
secondaryAction = true,
|
|
49
47
|
secondaryActionLabel,
|
|
@@ -62,7 +60,6 @@ export function Slideout({
|
|
|
62
60
|
rtl && "ds-slideout--rtl",
|
|
63
61
|
className,
|
|
64
62
|
)}
|
|
65
|
-
data-node-id="256:19065"
|
|
66
63
|
dir={dir}
|
|
67
64
|
>
|
|
68
65
|
<section aria-label={title} className="ds-slideout__panel" role="dialog">
|
|
@@ -70,13 +67,13 @@ export function Slideout({
|
|
|
70
67
|
<div className="ds-slideout__heading-wrap">
|
|
71
68
|
<h2 className="ds-slideout__title">{title}</h2>
|
|
72
69
|
{headerAction && actionLabel && (
|
|
73
|
-
<button className="ds-slideout__text-button" type="button">
|
|
70
|
+
<button className="ds-slideout__text-button" type="button" onClick={onAction}>
|
|
74
71
|
{actionLabel}
|
|
75
72
|
</button>
|
|
76
73
|
)}
|
|
77
74
|
</div>
|
|
78
75
|
{closeLabel && (
|
|
79
|
-
<button aria-label={closeLabel} className="ds-slideout__close" type="button">
|
|
76
|
+
<button aria-label={closeLabel} className="ds-slideout__close" type="button" onClick={onClose}>
|
|
80
77
|
<CloseIcon />
|
|
81
78
|
</button>
|
|
82
79
|
)}
|
|
@@ -85,12 +82,12 @@ export function Slideout({
|
|
|
85
82
|
{footer && hasFooterActions && (
|
|
86
83
|
<footer className="ds-slideout__footer">
|
|
87
84
|
{primaryActionLabel && (
|
|
88
|
-
<button className="ds-slideout__button ds-slideout__button--primary" type="button">
|
|
85
|
+
<button className="ds-slideout__button ds-slideout__button--primary" type="button" onClick={onPrimaryAction}>
|
|
89
86
|
{primaryActionLabel}
|
|
90
87
|
</button>
|
|
91
88
|
)}
|
|
92
89
|
{secondaryAction && secondaryActionLabel && (
|
|
93
|
-
<button className="ds-slideout__button ds-slideout__button--secondary" type="button">
|
|
90
|
+
<button className="ds-slideout__button ds-slideout__button--secondary" type="button" onClick={onSecondaryAction}>
|
|
94
91
|
{secondaryActionLabel}
|
|
95
92
|
</button>
|
|
96
93
|
)}
|
|
@@ -101,403 +98,6 @@ export function Slideout({
|
|
|
101
98
|
);
|
|
102
99
|
}
|
|
103
100
|
|
|
104
|
-
export function SlideoutFiltersExample({ dir = "ltr" }: SlideoutSlotExampleProps) {
|
|
105
|
-
const rtl = dir === "rtl";
|
|
106
|
-
const text = rtl
|
|
107
|
-
? {
|
|
108
|
-
assigned: "مخصصة لـ",
|
|
109
|
-
date: "التاريخ",
|
|
110
|
-
label: "التسمية",
|
|
111
|
-
names: ["أحمد جلال", "عمر مهدي", "هاني هشام", "عمر ماهر"],
|
|
112
|
-
priority: "الأولوية",
|
|
113
|
-
status: "الحالة",
|
|
114
|
-
}
|
|
115
|
-
: {
|
|
116
|
-
assigned: "Assigned to",
|
|
117
|
-
date: "Date",
|
|
118
|
-
label: "Label",
|
|
119
|
-
names: ["Ahmed Galal", "Amr Mahdy", "Hany Hisham", "Omar Maher"],
|
|
120
|
-
priority: "Priority",
|
|
121
|
-
status: "Status",
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<div className="ds-slideout-slot ds-slideout-filters" data-node-id="256:18779">
|
|
126
|
-
<FilterSection title={text.status}>
|
|
127
|
-
<ChoiceRow kind="checkbox" label={text.label} />
|
|
128
|
-
<ChoiceRow checked kind="checkbox" label={text.label} />
|
|
129
|
-
<ChoiceRow kind="checkbox" label={text.label} />
|
|
130
|
-
</FilterSection>
|
|
131
|
-
<Divider />
|
|
132
|
-
<FilterSection title={text.date}>
|
|
133
|
-
<ChoiceRow kind="radio" label={text.label} />
|
|
134
|
-
<ChoiceRow kind="radio" label={text.label} />
|
|
135
|
-
<ChoiceRow checked kind="radio" label={text.label} />
|
|
136
|
-
<ChoiceRow kind="radio" label={text.label} />
|
|
137
|
-
</FilterSection>
|
|
138
|
-
<Divider />
|
|
139
|
-
<FilterSection title={text.priority}>
|
|
140
|
-
<ChoiceRow kind="checkbox" label={text.label} />
|
|
141
|
-
<ChoiceRow checked kind="checkbox" label={text.label} />
|
|
142
|
-
<ChoiceRow kind="checkbox" label={text.label} />
|
|
143
|
-
</FilterSection>
|
|
144
|
-
<Divider />
|
|
145
|
-
<FilterSection title={text.assigned}>
|
|
146
|
-
{text.names.map((name, index) => (
|
|
147
|
-
<UserChoice key={name} name={name} selected={index === 0 || index === 2} muted={index === 1 || index === 3} />
|
|
148
|
-
))}
|
|
149
|
-
</FilterSection>
|
|
150
|
-
</div>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export function SlideoutUserProfileExample({ dir = "ltr" }: SlideoutSlotExampleProps) {
|
|
155
|
-
const rtl = dir === "rtl";
|
|
156
|
-
const text = rtl
|
|
157
|
-
? {
|
|
158
|
-
badgeTabs: ["عنصر القائمة", "عنصر القائمة", "عنصر القائمة", "عنصر القائمة"],
|
|
159
|
-
comments: [
|
|
160
|
-
"Lorem ipsum dolor sit amet consectetur @username. Cras in morbi volutpat porttitor se...",
|
|
161
|
-
"",
|
|
162
|
-
"Lorem ipsum dolor sit amet consectetur. Cras in morbi volutpat porttitor semper. Mattis bibendum...",
|
|
163
|
-
"اسم الملف.pdf",
|
|
164
|
-
],
|
|
165
|
-
name: "أحمد جلال",
|
|
166
|
-
role: "مصمم المنتجات",
|
|
167
|
-
time: "اليوم الساعة 5:20 مساءً",
|
|
168
|
-
titleParts: ["أحمد", "تمت إضافة تعليق جديد في", "#اسم المشروع"],
|
|
169
|
-
}
|
|
170
|
-
: {
|
|
171
|
-
badgeTabs: ["Activity", "Calendar", "My Work", "Asigned"],
|
|
172
|
-
comments: [
|
|
173
|
-
"Lorem ipsum dolor sit amet consectetur @username. Cras in morbi volutpat porttitor se...",
|
|
174
|
-
"",
|
|
175
|
-
"Lorem ipsum dolor sit amet consectetur. Cras in morbi volutpat porttitor semper. Mattis bibendum...",
|
|
176
|
-
"file-name.pdf",
|
|
177
|
-
],
|
|
178
|
-
name: "Ahmed Galal",
|
|
179
|
-
role: "Product designer",
|
|
180
|
-
time: "Today, 5:20 pm",
|
|
181
|
-
titleParts: ["Ahmed", "added a new comment in", "#project name"],
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
return (
|
|
185
|
-
<div className="ds-slideout-slot ds-slideout-profile" data-node-id="256:18872">
|
|
186
|
-
<div className="ds-slideout-profile__header">
|
|
187
|
-
<Avatar name={text.name} online size="large" />
|
|
188
|
-
<div className="ds-slideout-profile__identity">
|
|
189
|
-
<p className="ds-slideout-profile__name">{text.name}</p>
|
|
190
|
-
<p className="ds-slideout-profile__role">{text.role}</p>
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
<div aria-label={rtl ? "علامات تبويب الملف الشخصي" : "Profile tabs"} className="ds-slideout-profile__tabs" role="tablist">
|
|
194
|
-
{text.badgeTabs.map((tab, index) => (
|
|
195
|
-
<button aria-selected={index === 0 || (rtl && index === 3)} className="ds-slideout-profile__tab" key={`${tab}-${index}`} role="tab" type="button">
|
|
196
|
-
<span>{tab}</span>
|
|
197
|
-
{(index === 2 || index === 3) && !rtl && <span className="ds-slideout-profile__badge">{index === 2 ? "2" : "4"}</span>}
|
|
198
|
-
</button>
|
|
199
|
-
))}
|
|
200
|
-
</div>
|
|
201
|
-
<div className="ds-slideout-feed">
|
|
202
|
-
{text.comments.map((comment, index) => (
|
|
203
|
-
<FeedItem comment={comment} index={index} key={`${comment}-${index}`} rtl={rtl} time={text.time} titleParts={text.titleParts} />
|
|
204
|
-
))}
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export function SlideoutPaymentDetailExample({ dir = "ltr" }: SlideoutSlotExampleProps) {
|
|
211
|
-
const rtl = dir === "rtl";
|
|
212
|
-
const text = rtl
|
|
213
|
-
? {
|
|
214
|
-
amount: "9,453,50 دولار",
|
|
215
|
-
copy: "نسخة",
|
|
216
|
-
date: "24 مايو، 2050، 10:23 صباحًا",
|
|
217
|
-
details: "التفاصيل",
|
|
218
|
-
id: "معرف المعاملة",
|
|
219
|
-
name: "جاكوب جونز",
|
|
220
|
-
rows: [
|
|
221
|
-
["المبلغ", "9,553,50 دولار"],
|
|
222
|
-
["الرسوم", "$100 دولار"],
|
|
223
|
-
["الإجمالي", "9,453,50 دولار"],
|
|
224
|
-
],
|
|
225
|
-
showStory: "عرض القصة",
|
|
226
|
-
}
|
|
227
|
-
: {
|
|
228
|
-
amount: "$9,453,50",
|
|
229
|
-
copy: "Copy",
|
|
230
|
-
date: "24 May, 2050, 10:23 AM",
|
|
231
|
-
details: "Details",
|
|
232
|
-
id: "Transaction ID",
|
|
233
|
-
name: "Jacob Jones",
|
|
234
|
-
rows: [
|
|
235
|
-
["Amount", "$9,553,50"],
|
|
236
|
-
["Fee", "$100"],
|
|
237
|
-
["Total", "$9,453,50"],
|
|
238
|
-
],
|
|
239
|
-
showStory: "Show story",
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
return (
|
|
243
|
-
<div className="ds-slideout-slot ds-payment-detail" data-node-id="256:18901">
|
|
244
|
-
<section className="ds-payment-detail__hero">
|
|
245
|
-
<div className="ds-payment-detail__user">
|
|
246
|
-
<Avatar name={text.name} size="medium" />
|
|
247
|
-
<div>
|
|
248
|
-
<p className="ds-payment-detail__name">{text.name}</p>
|
|
249
|
-
<p className="ds-payment-detail__muted">useraccount@gmail.com</p>
|
|
250
|
-
</div>
|
|
251
|
-
</div>
|
|
252
|
-
<div>
|
|
253
|
-
<p className="ds-payment-detail__amount">{text.amount}</p>
|
|
254
|
-
<p className="ds-payment-detail__date">{text.date}</p>
|
|
255
|
-
</div>
|
|
256
|
-
</section>
|
|
257
|
-
<section className="ds-payment-card">
|
|
258
|
-
<h3>{text.details}</h3>
|
|
259
|
-
<div className="ds-payment-detail__rows">
|
|
260
|
-
{text.rows.map(([label, value]) => (
|
|
261
|
-
<div className="ds-payment-detail__row" key={label}>
|
|
262
|
-
<span>{label}</span>
|
|
263
|
-
<strong>{value}</strong>
|
|
264
|
-
</div>
|
|
265
|
-
))}
|
|
266
|
-
</div>
|
|
267
|
-
</section>
|
|
268
|
-
<section className="ds-payment-card">
|
|
269
|
-
<h3>{text.id}</h3>
|
|
270
|
-
<div className="ds-payment-detail__transaction">
|
|
271
|
-
<span>45FWGERT54GSGY54WRE</span>
|
|
272
|
-
<button className="ds-slideout__button ds-slideout__button--secondary ds-payment-detail__copy" type="button">
|
|
273
|
-
{text.copy}
|
|
274
|
-
</button>
|
|
275
|
-
</div>
|
|
276
|
-
</section>
|
|
277
|
-
<button className="ds-payment-detail__story" type="button">
|
|
278
|
-
{text.showStory}
|
|
279
|
-
</button>
|
|
280
|
-
</div>
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
export function SlideoutPaymentFormExample({ dir = "ltr" }: SlideoutSlotExampleProps) {
|
|
285
|
-
const rtl = dir === "rtl";
|
|
286
|
-
const text = rtl
|
|
287
|
-
? {
|
|
288
|
-
amount: "8,425.32 دولار",
|
|
289
|
-
category: "الفئة",
|
|
290
|
-
date: "31 مايو 2023 الساعة 09:42 صباحًا",
|
|
291
|
-
export: "تصدير",
|
|
292
|
-
fields: [
|
|
293
|
-
["BIC", "سيتيكسكس2X"],
|
|
294
|
-
["رقم الحساب المصرفي الدولي", "**** **** 4356 29"],
|
|
295
|
-
["باعث", "الشريط"],
|
|
296
|
-
["المرجع", "الشريط"],
|
|
297
|
-
["التاريخ", "31/05/2050"],
|
|
298
|
-
["العلامة", "الشريط"],
|
|
299
|
-
["التاريخ", "8,425.32 دولار"],
|
|
300
|
-
["الحالة", "البدء"],
|
|
301
|
-
],
|
|
302
|
-
receipts: "الإيصالات",
|
|
303
|
-
select: "السحب الآلي",
|
|
304
|
-
uploadHelp: "نقبل ملفات PDF وJPG وPNG بحجم يصل إلى 10 ميجابايت",
|
|
305
|
-
uploadTitle: "انقر لتحديد الملفات أو إسقاطها",
|
|
306
|
-
}
|
|
307
|
-
: {
|
|
308
|
-
amount: "$8,425.32",
|
|
309
|
-
category: "Category",
|
|
310
|
-
date: "31 May, 2023, 09:42 AM",
|
|
311
|
-
export: "Export",
|
|
312
|
-
fields: [
|
|
313
|
-
["IBAN", "**** **** 4356 29"],
|
|
314
|
-
["BIC", "CITIXX2X"],
|
|
315
|
-
["Reference", "STRIPE"],
|
|
316
|
-
["Emitter", "Stripe"],
|
|
317
|
-
["Tag", "Stripe"],
|
|
318
|
-
["Date", "05/31/2050"],
|
|
319
|
-
["Status", "Initiated"],
|
|
320
|
-
["Date", "$8,425.32"],
|
|
321
|
-
],
|
|
322
|
-
receipts: "Receipts",
|
|
323
|
-
select: "Automated Cashout",
|
|
324
|
-
uploadHelp: "We accept PDF, JPG and PNG files up to 10MB",
|
|
325
|
-
uploadTitle: "Click to select or drop files",
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
return (
|
|
329
|
-
<div className="ds-slideout-slot ds-payment-form" data-node-id="256:18964">
|
|
330
|
-
<section className="ds-payment-form__amount">
|
|
331
|
-
<CompanyIcon />
|
|
332
|
-
<div className="ds-payment-form__amount-copy">
|
|
333
|
-
<p className="ds-payment-form__value">{text.amount}</p>
|
|
334
|
-
<p className="ds-payment-form__date">{text.date}</p>
|
|
335
|
-
</div>
|
|
336
|
-
<button className="ds-slideout__button ds-slideout__button--secondary ds-payment-form__export" type="button">
|
|
337
|
-
{text.export}
|
|
338
|
-
</button>
|
|
339
|
-
</section>
|
|
340
|
-
<section className="ds-payment-card ds-payment-form__grid">
|
|
341
|
-
{text.fields.map(([label, value], index) => (
|
|
342
|
-
<div className="ds-payment-form__field" key={`${label}-${index}`}>
|
|
343
|
-
<span>{label}</span>
|
|
344
|
-
<strong>{value}</strong>
|
|
345
|
-
</div>
|
|
346
|
-
))}
|
|
347
|
-
</section>
|
|
348
|
-
<section className="ds-payment-card ds-payment-form__section">
|
|
349
|
-
<h3>{text.category}</h3>
|
|
350
|
-
<button className="ds-payment-form__select" type="button">
|
|
351
|
-
<span>{text.select}</span>
|
|
352
|
-
<ChevronDownIcon />
|
|
353
|
-
</button>
|
|
354
|
-
</section>
|
|
355
|
-
<section className="ds-payment-card ds-payment-form__section">
|
|
356
|
-
<h3>{text.receipts}</h3>
|
|
357
|
-
<div className="ds-payment-form__upload">
|
|
358
|
-
<span className="ds-payment-form__upload-icon">
|
|
359
|
-
<UploadCloudIcon />
|
|
360
|
-
</span>
|
|
361
|
-
<span className="ds-payment-form__upload-copy">
|
|
362
|
-
<strong>{text.uploadTitle}</strong>
|
|
363
|
-
<span>{text.uploadHelp}</span>
|
|
364
|
-
</span>
|
|
365
|
-
</div>
|
|
366
|
-
</section>
|
|
367
|
-
</div>
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
function FilterSection({ children, title }: { children: ReactNode; title: string }) {
|
|
372
|
-
return (
|
|
373
|
-
<section className="ds-filter-section">
|
|
374
|
-
<h3>{title}</h3>
|
|
375
|
-
<div className="ds-filter-section__content">{children}</div>
|
|
376
|
-
</section>
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
function ChoiceRow({ checked = false, kind, label }: { checked?: boolean; kind: "checkbox" | "radio"; label: string }) {
|
|
381
|
-
return (
|
|
382
|
-
<div className="ds-choice-row">
|
|
383
|
-
<span aria-hidden="true" className={cx("ds-choice-row__control", `ds-choice-row__control--${kind}`, checked && "is-checked")}>
|
|
384
|
-
{checked && kind === "checkbox" && <CheckIcon />}
|
|
385
|
-
{checked && kind === "radio" && <span className="ds-choice-row__dot" />}
|
|
386
|
-
</span>
|
|
387
|
-
<span className="ds-choice-row__label">{label}</span>
|
|
388
|
-
</div>
|
|
389
|
-
);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
function UserChoice({ muted = false, name, selected = false }: { muted?: boolean; name: string; selected?: boolean }) {
|
|
393
|
-
return (
|
|
394
|
-
<div className="ds-user-choice">
|
|
395
|
-
<div className="ds-user-choice__person">
|
|
396
|
-
<Avatar name={name} size="small" />
|
|
397
|
-
<span className={cx(muted && "is-muted")}>{name}</span>
|
|
398
|
-
</div>
|
|
399
|
-
{selected && <CheckIcon className="ds-user-choice__check" />}
|
|
400
|
-
</div>
|
|
401
|
-
);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
function FeedItem({
|
|
405
|
-
comment,
|
|
406
|
-
index,
|
|
407
|
-
rtl,
|
|
408
|
-
time,
|
|
409
|
-
titleParts,
|
|
410
|
-
}: {
|
|
411
|
-
comment: string;
|
|
412
|
-
index: number;
|
|
413
|
-
rtl: boolean;
|
|
414
|
-
time: string;
|
|
415
|
-
titleParts: string[];
|
|
416
|
-
}) {
|
|
417
|
-
return (
|
|
418
|
-
<article className="ds-feed-item">
|
|
419
|
-
<div className="ds-feed-item__heading">
|
|
420
|
-
<div className="ds-feed-item__copy">
|
|
421
|
-
<p>
|
|
422
|
-
<strong>{titleParts[0]}</strong> <span>{titleParts[1]}</span> <a href="#top">{titleParts[2]}</a>
|
|
423
|
-
</p>
|
|
424
|
-
<time>{time}</time>
|
|
425
|
-
</div>
|
|
426
|
-
<span aria-hidden="true" className="ds-feed-item__indicator" />
|
|
427
|
-
</div>
|
|
428
|
-
{index === 1 ? (
|
|
429
|
-
<div className="ds-feed-item__images">
|
|
430
|
-
<span className="ds-feed-item__image ds-feed-item__image--one" />
|
|
431
|
-
<span className="ds-feed-item__image ds-feed-item__image--two" />
|
|
432
|
-
</div>
|
|
433
|
-
) : index === 3 ? (
|
|
434
|
-
<div className="ds-feed-item__files">
|
|
435
|
-
<FileRow label={comment} rtl={rtl} />
|
|
436
|
-
<FileRow label={rtl ? "اسم الملف الثاني.pdf" : "Second file-name.pdf"} rtl={rtl} />
|
|
437
|
-
</div>
|
|
438
|
-
) : (
|
|
439
|
-
<p className="ds-feed-item__comment">{comment}</p>
|
|
440
|
-
)}
|
|
441
|
-
</article>
|
|
442
|
-
);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
function FileRow({ label, rtl }: { label: string; rtl: boolean }) {
|
|
446
|
-
return (
|
|
447
|
-
<div className="ds-file-row">
|
|
448
|
-
<PaperclipIcon />
|
|
449
|
-
<span>{label}</span>
|
|
450
|
-
<button type="button">{rtl ? "تنزيل" : "Download"}</button>
|
|
451
|
-
</div>
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
function Avatar({ name, online = false, size = "small" }: { name: string; online?: boolean; size?: "small" | "medium" | "large" }) {
|
|
456
|
-
const initials = name
|
|
457
|
-
.split(" ")
|
|
458
|
-
.filter(Boolean)
|
|
459
|
-
.slice(0, 2)
|
|
460
|
-
.map((part) => part[0])
|
|
461
|
-
.join("");
|
|
462
|
-
|
|
463
|
-
return (
|
|
464
|
-
<span className={cx("ds-avatar", `ds-avatar--${size}`)} aria-label={name} role="img">
|
|
465
|
-
<span>{initials}</span>
|
|
466
|
-
{online && <span aria-hidden="true" className="ds-avatar__status" />}
|
|
467
|
-
</span>
|
|
468
|
-
);
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
function CompanyIcon() {
|
|
472
|
-
return (
|
|
473
|
-
<span aria-hidden="true" className="ds-company-icon">
|
|
474
|
-
<span />
|
|
475
|
-
</span>
|
|
476
|
-
);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
function Divider() {
|
|
480
|
-
return <span aria-hidden="true" className="ds-slideout-divider" />;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
101
|
function CloseIcon() {
|
|
484
|
-
return <XIcon aria-hidden="true"
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
function CheckIcon({ className = "" }: { className?: string }) {
|
|
488
|
-
return (
|
|
489
|
-
<LucideCheckIcon aria-hidden="true" className={className} height="14" strokeWidth={2.6} width="14" />
|
|
490
|
-
);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
function ChevronDownIcon() {
|
|
494
|
-
return <LucideChevronDownIcon aria-hidden="true" height="20" strokeWidth={2} width="20" />;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
function PaperclipIcon() {
|
|
498
|
-
return <LucidePaperclipIcon aria-hidden="true" height="20" strokeWidth={1.8} width="20" />;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
function UploadCloudIcon() {
|
|
502
|
-
return <LucideUploadCloudIcon aria-hidden="true" height="20" strokeWidth={1.8} width="20" />;
|
|
102
|
+
return <XIcon aria-hidden="true" className="ds-slideout__close-icon" />;
|
|
503
103
|
}
|
|
@@ -61,7 +61,7 @@ export type VerticalStepItemProps = {
|
|
|
61
61
|
export function Steps({
|
|
62
62
|
alignment = "leading",
|
|
63
63
|
className = "",
|
|
64
|
-
dir
|
|
64
|
+
dir,
|
|
65
65
|
direction = "horizontal",
|
|
66
66
|
indicator = "icon",
|
|
67
67
|
items,
|
|
@@ -131,7 +131,7 @@ export function HorizontalStepItem({
|
|
|
131
131
|
label,
|
|
132
132
|
number = 1,
|
|
133
133
|
position = "top",
|
|
134
|
-
dir
|
|
134
|
+
dir,
|
|
135
135
|
showLeadingLine = true,
|
|
136
136
|
showTrailingLine = true,
|
|
137
137
|
}: HorizontalStepItemProps) {
|
|
@@ -183,7 +183,7 @@ export function VerticalStepItem({
|
|
|
183
183
|
indicator = "icon",
|
|
184
184
|
label,
|
|
185
185
|
number = 1,
|
|
186
|
-
dir
|
|
186
|
+
dir,
|
|
187
187
|
showBottomPadding = true,
|
|
188
188
|
showLine = true,
|
|
189
189
|
slotContent,
|
|
@@ -242,7 +242,7 @@ function StepMarker({ indicator, number }: { indicator: StepIndicator; number: R
|
|
|
242
242
|
|
|
243
243
|
return (
|
|
244
244
|
<span className="ds-step-marker ds-step-marker--icon">
|
|
245
|
-
<CheckIcon aria-hidden="true" focusable="false" strokeWidth=
|
|
245
|
+
<CheckIcon aria-hidden="true" focusable="false" strokeWidth="var(--bh-icon-stroke-300)" />
|
|
246
246
|
</span>
|
|
247
247
|
);
|
|
248
248
|
}
|