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.
Files changed (58) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/registry/components/accordion.tsx +37 -1
  4. package/registry/components/alert.tsx +14 -28
  5. package/registry/components/attribute.tsx +6 -10
  6. package/registry/components/avatar.tsx +1 -2
  7. package/registry/components/button-group.tsx +1 -1
  8. package/registry/components/card.tsx +1 -1
  9. package/registry/components/checkbox.tsx +19 -16
  10. package/registry/components/expanded/ActivityFeed.tsx +37 -23
  11. package/registry/components/expanded/Banner.tsx +54 -19
  12. package/registry/components/expanded/Breadcrumbs.tsx +10 -38
  13. package/registry/components/expanded/CatalogComponentsShowcase.tsx +11 -16
  14. package/registry/components/expanded/CatalogTag.tsx +4 -11
  15. package/registry/components/expanded/CommandBar.tsx +33 -53
  16. package/registry/components/expanded/FileUpload.tsx +362 -59
  17. package/registry/components/expanded/OnboardingStepListItem.tsx +6 -10
  18. package/registry/components/expanded/PageHeader.tsx +2 -11
  19. package/registry/components/expanded/Slideout.tsx +12 -23
  20. package/registry/components/expanded/Steps.tsx +6 -8
  21. package/registry/components/expanded/Table.tsx +18 -40
  22. package/registry/components/expanded/Timeline.tsx +5 -24
  23. package/registry/components/expanded/activityFeed.css +10 -54
  24. package/registry/components/expanded/banner.css +8 -75
  25. package/registry/components/expanded/breadcrumbs.css +1 -1
  26. package/registry/components/expanded/commandBar.css +23 -26
  27. package/registry/components/expanded/divider.css +1 -1
  28. package/registry/components/expanded/fileUpload.css +304 -75
  29. package/registry/components/expanded/pageHeader.css +1 -1
  30. package/registry/components/expanded/steps.css +15 -51
  31. package/registry/components/expanded/table.css +5 -1
  32. package/registry/components/expanded/timeline.css +18 -15
  33. package/registry/components/input.tsx +125 -54
  34. package/registry/components/menu.tsx +99 -72
  35. package/registry/components/pagination.tsx +6 -18
  36. package/registry/components/radio-card.tsx +25 -31
  37. package/registry/components/select-content.tsx +28 -123
  38. package/registry/components/select.tsx +9 -9
  39. package/registry/components/social-button.tsx +24 -90
  40. package/registry/components/spinner.tsx +21 -5
  41. package/registry/components/textarea.tsx +20 -35
  42. package/registry/components/toggle.tsx +7 -23
  43. package/registry/components/tooltip.tsx +4 -4
  44. package/registry/examples/attribute-demo.tsx +2 -2
  45. package/registry/examples/checkbox-demo.tsx +3 -8
  46. package/registry/examples/date-picker-demo.tsx +75 -22
  47. package/registry/examples/expanded/banner-demo.tsx +31 -6
  48. package/registry/examples/expanded/breadcrumbs-demo.tsx +59 -0
  49. package/registry/examples/expanded/file-upload-demo.tsx +60 -0
  50. package/registry/examples/expanded/steps-demo.tsx +11 -0
  51. package/registry/examples/expanded/table-demo.tsx +142 -0
  52. package/registry/examples/progress-demo.tsx +2 -2
  53. package/registry/examples/select-demo.tsx +32 -18
  54. package/registry/examples/social-button-demo.tsx +33 -33
  55. package/registry/examples/spinner-demo.tsx +37 -0
  56. package/registry/examples/tag-demo.tsx +1 -1
  57. package/registry/index.json +26 -12
  58. package/registry/styles/globals.css +5 -3
@@ -36,17 +36,12 @@ const breadcrumbAriaLabel = "Catalog breadcrumbs";
36
36
  const rtlBreadcrumbAriaLabel = "\u0627\u0644\u0645\u0633\u0627\u0631";
37
37
 
38
38
  const uploadFiles: FileUploadFile[] = [
39
- { id: "tokens", name: "semantic-tokens.json", sizeLabel: "4 MB", versionLabel: "v3.0", status: "uploaded" },
40
- { id: "components", name: "component-inventory.csv", sizeLabel: "18 MB", versionLabel: "v2.4", status: "uploading" },
41
- { id: "icons", name: "icons-shortlist.pdf", sizeLabel: "7 MB", status: "error", errorLabel: "Needs retry" },
39
+ { id: "uploaded", name: "file-name.pdf", sizeLabel: "32mb", versionLabel: "v1.2.2", status: "uploaded" },
40
+ { id: "uploading", name: "file-name.pdf", sizeLabel: "32mb", versionLabel: "v1.2.2", status: "uploading" },
41
+ { id: "progress", name: "file-name.pdf", sizeLabel: "32 KB", progress: 40, status: "uploading-progress" },
42
+ { id: "error", name: "file-name.pdf", sizeLabel: "32mb", versionLabel: "v1.2.2", status: "error", errorLabel: "Upload failed" },
42
43
  ];
43
44
 
44
- const fileUploadCopy = {
45
- browseLabel: "Browse",
46
- helperText: "SVG, PNG, PDF, or CSV up to 50 MB",
47
- prompt: "Drag and drop files here, or",
48
- };
49
-
50
45
  const projectRows: ProjectRow[] = [
51
46
  { id: "1", name: "Component audit", leader: "Maya Chen", progress: 84, status: "On track", deadline: "Jun 12" },
52
47
  { id: "2", name: "Icon decision", leader: "Ahmed Galal", progress: 64, status: "Review", deadline: "Jun 18" },
@@ -121,7 +116,7 @@ export function CatalogComponentsShowcase() {
121
116
  aria-label={rtlBreadcrumbAriaLabel}
122
117
  dir="rtl"
123
118
  items={rtlBreadcrumbItems}
124
- overflowLabel="\u0627\u0644\u0645\u0632\u064a\u062f"
119
+ overflowLabel={"\u0627\u0644\u0645\u0632\u064a\u062f"}
125
120
  separator="chevron"
126
121
  style="raised"
127
122
  />
@@ -134,7 +129,7 @@ export function CatalogComponentsShowcase() {
134
129
  <CatalogDivider borderStyle="dotted" />
135
130
  <CatalogContentDivider label="Text" />
136
131
  <CatalogContentDivider actionLabel="Button" onAction={() => undefined} />
137
- <CatalogContentDivider dir="rtl" label="\u0646\u0635" borderStyle="dotted" />
132
+ <CatalogContentDivider dir="rtl" label={"\u0646\u0635"} borderStyle="dotted" />
138
133
  </div>
139
134
  </ShowcaseCard>
140
135
 
@@ -162,21 +157,21 @@ export function CatalogComponentsShowcase() {
162
157
  large
163
158
  </CatalogTag>
164
159
  <CatalogTag
165
- avatar="\u0645"
166
- closeLabel="\u0625\u0632\u0627\u0644\u0629 \u0648\u0633\u0645"
160
+ avatar={"\u0645"}
161
+ closeLabel={"\u0625\u0632\u0627\u0644\u0629 \u0648\u0633\u0645"}
167
162
  dir="rtl"
168
163
  type="avatar"
169
164
  showCloseButton
170
165
  >
171
- \u0645\u0644\u0635\u0642
166
+ {"\u0645\u0644\u0635\u0642"}
172
167
  </CatalogTag>
173
168
  </div>
174
169
  </ShowcaseCard>
175
170
 
176
171
  <ShowcaseCard title="File Upload" description="Large and small queued-file upload states.">
177
172
  <div className="catalog-showcase__upload-grid">
178
- <FileUpload {...fileUploadCopy} files={uploadFiles} multiple />
179
- <FileUpload {...fileUploadCopy} files={uploadFiles.slice(0, 1)} size="sm" />
173
+ <FileUpload files={uploadFiles} multiple />
174
+ <FileUpload files={uploadFiles.slice(0, 4)} size="sm" />
180
175
  </div>
181
176
  </ShowcaseCard>
182
177
 
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import { PlusIcon as LucidePlusIcon, XIcon } from "lucide-react";
2
3
  import "./tag.css";
3
4
 
4
5
  export type TagType = "simple" | "dot" | "flag" | "avatar" | "icon";
@@ -61,7 +62,7 @@ export function CatalogTag({
61
62
  <span aria-hidden="true" className="ds-tag__leading">
62
63
  {type === "dot" && <span className="ds-tag__dot" />}
63
64
  {type === "flag" && (flag ?? <span className="ds-tag__flag" />)}
64
- {type === "avatar" && avatar}
65
+ {type === "avatar" && <span className="ds-tag__avatar">{avatar}</span>}
65
66
  {type === "icon" && (icon ?? <PlusIcon />)}
66
67
  </span>
67
68
  )}
@@ -76,17 +77,9 @@ export function CatalogTag({
76
77
  }
77
78
 
78
79
  function PlusIcon() {
79
- return (
80
- <svg aria-hidden="true" viewBox="0 0 16 16">
81
- <path d="M8 3.5v9M3.5 8h9" fill="none" stroke="currentColor" strokeLinecap="round" strokeWidth="1.7" />
82
- </svg>
83
- );
80
+ return <LucidePlusIcon aria-hidden="true" strokeWidth={2.25} />;
84
81
  }
85
82
 
86
83
  function CloseIcon() {
87
- return (
88
- <svg aria-hidden="true" viewBox="0 0 16 16">
89
- <path d="m4.5 4.5 7 7M11.5 4.5l-7 7" fill="none" stroke="currentColor" strokeLinecap="round" strokeWidth="1.6" />
90
- </svg>
91
- );
84
+ return <XIcon aria-hidden="true" strokeWidth={2.25} />;
92
85
  }
@@ -1,5 +1,16 @@
1
1
  import "./commandBar.css";
2
2
 
3
+ import {
4
+ ArrowUpDownIcon as LucideArrowUpDownIcon,
5
+ BookOpenIcon,
6
+ CommandIcon,
7
+ CornerDownLeftIcon,
8
+ SearchIcon as LucideSearchIcon,
9
+ XIcon,
10
+ } from "lucide-react";
11
+
12
+ import { Button } from "@/components/ui/button";
13
+
3
14
  export type CommandBarType = "default" | "recent" | "results" | "no-result";
4
15
  export type CommandBarBreakpoint = "desktop" | "mobile";
5
16
 
@@ -34,7 +45,7 @@ type CommandRow = {
34
45
  readonly visual: "avatar" | "icon";
35
46
  };
36
47
 
37
- const shortcutText = "\u2318K";
48
+ const shortcutLabel = "Command K";
38
49
 
39
50
  const ltrCopy: CommandBarCopy = {
40
51
  clear: "Clear search",
@@ -248,9 +259,15 @@ function FilterSection({ copy }: { copy: CommandBarCopy }) {
248
259
  <SectionHeading>{copy.searchFor}</SectionHeading>
249
260
  <div className="ds-command-bar__tags" aria-label={copy.searchFor}>
250
261
  {copy.tags.map((tag) => (
251
- <button className="ds-command-bar__tag" key={tag} type="button">
262
+ <Button
263
+ className="ds-command-bar__tag"
264
+ key={tag}
265
+ size="sm"
266
+ type="button"
267
+ variant="secondary"
268
+ >
252
269
  {tag}
253
- </button>
270
+ </Button>
254
271
  ))}
255
272
  </div>
256
273
  </div>
@@ -326,7 +343,14 @@ function CommandFooter({ copy }: { copy: CommandBarCopy }) {
326
343
  }
327
344
 
328
345
  function Shortcut() {
329
- return <kbd className="ds-command-bar__shortcut">{shortcutText}</kbd>;
346
+ return (
347
+ <kbd aria-label={shortcutLabel} className="ds-command-bar__shortcut">
348
+ <CommandIcon aria-hidden="true" className="ds-command-bar__shortcut-icon" />
349
+ <span aria-hidden="true" className="ds-command-bar__shortcut-key">
350
+ K
351
+ </span>
352
+ </kbd>
353
+ );
330
354
  }
331
355
 
332
356
  function IconWrap() {
@@ -342,65 +366,21 @@ function Avatar() {
342
366
  }
343
367
 
344
368
  function SearchIcon({ size = 24 }: { size?: number }) {
345
- return (
346
- <svg aria-hidden="true" fill="none" height={size} viewBox="0 0 24 24" width={size}>
347
- <path
348
- d="M10.75 18.5a7.75 7.75 0 1 1 5.48-2.27l3.02 3.02"
349
- stroke="currentColor"
350
- strokeLinecap="round"
351
- strokeLinejoin="round"
352
- strokeWidth="2"
353
- />
354
- </svg>
355
- );
369
+ return <LucideSearchIcon aria-hidden="true" height={size} strokeWidth={2} width={size} />;
356
370
  }
357
371
 
358
372
  function CloseIcon() {
359
- return (
360
- <svg aria-hidden="true" fill="none" height="20" viewBox="0 0 20 20" width="20">
361
- <path d="m5 5 10 10M15 5 5 15" stroke="currentColor" strokeLinecap="round" strokeWidth="1.8" />
362
- </svg>
363
- );
373
+ return <XIcon aria-hidden="true" height="20" strokeWidth={2.2} width="20" />;
364
374
  }
365
375
 
366
376
  function BookIcon() {
367
- return (
368
- <svg aria-hidden="true" fill="none" height="20" viewBox="0 0 20 20" width="20">
369
- <path
370
- d="M5.5 3.5h8.2c.9 0 1.6.7 1.6 1.6v10.4H6.2a1.5 1.5 0 0 0 0 3h9.1M5.5 3.5a2 2 0 0 0-2 2v11a2 2 0 0 1 2-2m0-11v11m2.4-7.8h4.8"
371
- stroke="currentColor"
372
- strokeLinecap="round"
373
- strokeLinejoin="round"
374
- strokeWidth="1.6"
375
- />
376
- </svg>
377
- );
377
+ return <BookOpenIcon aria-hidden="true" height="20" strokeWidth={1.8} width="20" />;
378
378
  }
379
379
 
380
380
  function ArrowUpDownIcon() {
381
- return (
382
- <svg aria-hidden="true" fill="none" height="16" viewBox="0 0 16 16" width="16">
383
- <path
384
- d="M5 2v12m0 0 2.5-2.5M5 14l-2.5-2.5M11 14V2m0 0 2.5 2.5M11 2 8.5 4.5"
385
- stroke="currentColor"
386
- strokeLinecap="round"
387
- strokeLinejoin="round"
388
- strokeWidth="1.45"
389
- />
390
- </svg>
391
- );
381
+ return <LucideArrowUpDownIcon aria-hidden="true" height="16" strokeWidth={1.9} width="16" />;
392
382
  }
393
383
 
394
384
  function EnterIcon() {
395
- return (
396
- <svg aria-hidden="true" fill="none" height="16" viewBox="0 0 16 16" width="16">
397
- <path
398
- d="M12.5 3.5v3.25a3 3 0 0 1-3 3H3.75m0 0L6.2 7.3M3.75 9.75 6.2 12.2"
399
- stroke="currentColor"
400
- strokeLinecap="round"
401
- strokeLinejoin="round"
402
- strokeWidth="1.45"
403
- />
404
- </svg>
405
- );
385
+ return <CornerDownLeftIcon aria-hidden="true" height="16" strokeWidth={1.9} width="16" />;
406
386
  }