@ostack.tech/ui-exhibit 0.10.4 → 0.11.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.
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx, Fragment as Fragment$1 } from "react/jsx-runtime";
2
- import { useCssVars, Stack, Heading, Link, VisuallyHidden, AlertDialog, AlertDialogTrigger, Button, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogBody, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, Alert, AlertTitle, ButtonGroup, IconButton, Calendar, Field, Label, CheckboxGroup, Checkbox, Feedback, HelperText, Code, useSpacing, Collapsible, CollapsibleTrigger, CollapsibleContent, useKeyboardShortcut, Keybinds, CommandMenuDialog, CommandMenu, CommandMenuGroup, CommandMenuItem, DataTable, DataTableFilter, DataTableContent, DataTableRowsPerPage, DataTablePagination, DateInput, DateRangeInput, Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogBody, DialogDescription, Input, DialogFooter, DialogClose, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuCheckboxItem, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, Keyboard, Mark, MenuList, MenuListGroup, MenuListItem, NumericInput, ControlAddon, Output, Popover, PopoverTrigger, PopoverContent, TextArea, RadioGroup, Radio, Select, Option, Spinner, Table, TableHead, TableColumn, TableBody, TableRow, TableCell, TableFoot, Tabs, TabList, Tab, TabContent, Tag, useToastManager, Tooltip, Root, enGB, Container } from "@ostack.tech/ui";
2
+ import { useCssVars, Stack, Heading, Link, VisuallyHidden, AlertDialog, AlertDialogTrigger, Button, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogBody, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, Alert, AlertTitle, ButtonGroup, IconButton, Calendar, Field, Label, CheckboxGroup, Checkbox, Feedback, HelperText, Code, useSpacing, Collapsible, CollapsibleTrigger, CollapsibleContent, useKeyboardShortcut, Keybinds, CommandMenuDialog, CommandMenu, CommandMenuGroup, CommandMenuItem, DataTable, DataTableFilter, DataTableContent, DataTableRowsPerPage, DataTablePagination, DateInput, DateRangeInput, DescriptionList, DescriptionListItem, Tag, Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogBody, DialogDescription, Input, DialogFooter, DialogClose, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuCheckboxItem, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, FieldGroup, FieldGroupHeader, FieldGroupTitle, FieldGroupBody, Keyboard, Mark, MenuList, MenuListGroup, MenuListItem, NumericInput, ControlAddon, Output, Popover, PopoverTrigger, PopoverContent, TextArea, RadioGroup, Radio, Select, Option, Spinner, Stepper, StepList, Step, StepContent, StepperPreviousTrigger, StepperNextTrigger, StepperFinishTrigger, Table, TableHead, TableColumn, TableBody, TableRow, TableCell, TableFoot, Tabs, TabList, Tab, TabContent, useToastManager, Tooltip, Root, enGB, Container } from "@ostack.tech/ui";
3
3
  import { createContext, useContext, Fragment, useState } from "react";
4
4
  import { faFolderOpen, faSave, faTrashCan, faBolt, faCaretUp, faCaretDown, faGear, faWifi, faNetworkWired, faDisplay, faVolumeHigh, faKeyboard, faPrint, faClock, faUser, faCircleXmark, faSeedling, faEye, faPencil, faComment, faStar, faBookmark } from "@fortawesome/free-solid-svg-icons";
5
5
  const ExhibitContext = createContext(null);
@@ -38,8 +38,9 @@ function ExhibitSection({
38
38
  children
39
39
  }) {
40
40
  const { cssVar } = useCssVars();
41
- const docsUrl = useDocsUrl();
42
41
  const headingId = title.toLowerCase().replace(/[^a-z0-9]/g, "-");
42
+ const docsUrl = new URL(useDocsUrl());
43
+ docsUrl.searchParams.set("path", `/docs/${docsPage}--docs`);
43
44
  return /* @__PURE__ */ jsx(Stack, { asChild: true, children: /* @__PURE__ */ jsxs("section", { className: "exhibit-section", "aria-labelledby": headingId, children: [
44
45
  /* @__PURE__ */ jsx(Stack, { asChild: true, direction: "row", gap: 4, alignItems: "baseline", children: /* @__PURE__ */ jsxs("header", { children: [
45
46
  /* @__PURE__ */ jsx(Heading, { id: headingId, children: /* @__PURE__ */ jsx(
@@ -55,7 +56,7 @@ function ExhibitSection({
55
56
  Link,
56
57
  {
57
58
  className: "exhibit-section-docs-link",
58
- href: `${docsUrl}?path=/docs/${docsPage}--docs`,
59
+ href: docsUrl.toString(),
59
60
  external: true,
60
61
  children: [
61
62
  "View docs",
@@ -560,7 +561,7 @@ function DataTableSection() {
560
561
  ExhibitSection,
561
562
  {
562
563
  title: "Data table",
563
- docsPage: "ostack-ui-data-data-display-data-table",
564
+ docsPage: "ostack-ui-data-display-data-table",
564
565
  children: /* @__PURE__ */ jsx(
565
566
  ExhibitGrid,
566
567
  {
@@ -573,10 +574,6 @@ function DataTableSection() {
573
574
  renderItem: ({ col }) => /* @__PURE__ */ jsx(Field, { style: { width: 450 }, children: /* @__PURE__ */ jsxs(
574
575
  DataTable,
575
576
  {
576
- displayMode: col === "scrolled" ? col : void 0,
577
- showSelectionColumn: col === "showSelectionColumn",
578
- rowKey: "id",
579
- defaultLimit: 5,
580
577
  columns: {
581
578
  student: {
582
579
  label: "Student",
@@ -593,6 +590,10 @@ function DataTableSection() {
593
590
  }
594
591
  },
595
592
  rows: ROWS$1,
593
+ rowKey: "id",
594
+ displayMode: col === "scrolled" ? col : void 0,
595
+ showSelectionColumn: col === "showSelectionColumn",
596
+ defaultLimit: 5,
596
597
  children: [
597
598
  /* @__PURE__ */ jsx(Label, { children: "Exam grades" }),
598
599
  /* @__PURE__ */ jsx(DataTableFilter, {}),
@@ -706,6 +707,33 @@ function DateRangeInputSection() {
706
707
  }
707
708
  );
708
709
  }
710
+ function DescriptionListSection() {
711
+ return /* @__PURE__ */ jsx(
712
+ ExhibitSection,
713
+ {
714
+ title: "Description list",
715
+ docsPage: "ostack-ui-data-display-description-list",
716
+ children: /* @__PURE__ */ jsxs(DescriptionList, { children: [
717
+ /* @__PURE__ */ jsx(DescriptionListItem, { term: "Instance ID", xs: 6, md: 4, lg: 3, xl: 2, children: /* @__PURE__ */ jsx(Code, { children: "i-04f29a87bca612" }) }),
718
+ /* @__PURE__ */ jsx(DescriptionListItem, { term: "Status", xs: 6, md: 4, lg: 3, xl: 2, children: /* @__PURE__ */ jsx(Tag, { color: "success", children: "Running" }) }),
719
+ /* @__PURE__ */ jsx(DescriptionListItem, { term: "Public IPv4", xs: 6, md: 4, lg: 3, xl: 2, children: /* @__PURE__ */ jsx(Link, { href: "http://203.0.113.88", external: true, children: "203.0.113.88" }) }),
720
+ /* @__PURE__ */ jsx(DescriptionListItem, { term: "Storage", xs: 6, md: 4, lg: 3, xl: 2, children: "20 GB (SSD)" }),
721
+ /* @__PURE__ */ jsx(
722
+ DescriptionListItem,
723
+ {
724
+ term: "Availability Zone",
725
+ xs: 6,
726
+ md: 4,
727
+ lg: 3,
728
+ xl: 2,
729
+ children: /* @__PURE__ */ jsx(Code, { children: "us-east-1a" })
730
+ }
731
+ ),
732
+ /* @__PURE__ */ jsx(DescriptionListItem, { term: "Launch Time", xs: 6, md: 4, lg: 3, xl: 2, children: "2026-02-12 14:30 UTC" })
733
+ ] })
734
+ }
735
+ );
736
+ }
709
737
  function DialogSection() {
710
738
  return /* @__PURE__ */ jsx(ExhibitSection, { title: "Dialog", docsPage: "ostack-ui-overlay-dialog", children: /* @__PURE__ */ jsx(
711
739
  ExhibitGrid,
@@ -805,6 +833,30 @@ function DropdownMenuSection() {
805
833
  }
806
834
  );
807
835
  }
836
+ function FieldGroupSection() {
837
+ return /* @__PURE__ */ jsx(ExhibitSection, { title: "Field group", docsPage: "ostack-ui-forms-field-group", children: /* @__PURE__ */ jsx(
838
+ ExhibitGrid,
839
+ {
840
+ cols: {
841
+ Basic: "basic",
842
+ Code: "code"
843
+ },
844
+ renderItem: ({ col }) => /* @__PURE__ */ jsxs(FieldGroup, { children: [
845
+ /* @__PURE__ */ jsx(FieldGroupHeader, { code: col === "code" ? "1" : void 0, children: /* @__PURE__ */ jsx(FieldGroupTitle, { children: "Identification" }) }),
846
+ /* @__PURE__ */ jsx(FieldGroupBody, { children: /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
847
+ /* @__PURE__ */ jsxs(Field, { children: [
848
+ /* @__PURE__ */ jsx(Label, { children: "Full name" }),
849
+ /* @__PURE__ */ jsx(Input, { code: col === "code" ? "1.1" : void 0 })
850
+ ] }),
851
+ /* @__PURE__ */ jsxs(Field, { children: [
852
+ /* @__PURE__ */ jsx(Label, { children: "Passport number" }),
853
+ /* @__PURE__ */ jsx(Input, { code: col === "code" ? "1.2" : void 0 })
854
+ ] })
855
+ ] }) })
856
+ ] })
857
+ }
858
+ ) });
859
+ }
808
860
  function IconButtonSection() {
809
861
  return /* @__PURE__ */ jsx(ExhibitSection, { title: "Icon button", docsPage: "ostack-ui-forms-icon-button", children: /* @__PURE__ */ jsx(
810
862
  ExhibitGrid,
@@ -1236,6 +1288,31 @@ function SpinnerSection() {
1236
1288
  }
1237
1289
  ) });
1238
1290
  }
1291
+ function StepperSection() {
1292
+ const spacing = useSpacing();
1293
+ return /* @__PURE__ */ jsx(
1294
+ ExhibitSection,
1295
+ {
1296
+ title: "Stepper",
1297
+ docsPage: "ostack-ui-data-disclosure-stepper",
1298
+ children: /* @__PURE__ */ jsxs(Stepper, { style: { maxWidth: 600 }, children: [
1299
+ /* @__PURE__ */ jsxs(StepList, { children: [
1300
+ /* @__PURE__ */ jsx(Step, { children: "Account Details" }),
1301
+ /* @__PURE__ */ jsx(Step, { children: "Shipping Address" }),
1302
+ /* @__PURE__ */ jsx(Step, { children: "Payment Method" }),
1303
+ /* @__PURE__ */ jsx(Step, { children: "Review & Confirm" })
1304
+ ] }),
1305
+ /* @__PURE__ */ jsx(StepContent, { style: { marginBlock: spacing(2) }, children: "Enter your contact information…" }),
1306
+ /* @__PURE__ */ jsx(StepContent, { style: { marginBlock: spacing(2) }, children: "Select your shipping address…" }),
1307
+ /* @__PURE__ */ jsx(StepContent, { style: { marginBlock: spacing(2) }, children: "Select your payment method…" }),
1308
+ /* @__PURE__ */ jsx(StepContent, { style: { marginBlock: spacing(2) }, children: "Double-check your order…" }),
1309
+ /* @__PURE__ */ jsx(StepperPreviousTrigger, {}),
1310
+ /* @__PURE__ */ jsx(StepperNextTrigger, {}),
1311
+ /* @__PURE__ */ jsx(StepperFinishTrigger, {})
1312
+ ] })
1313
+ }
1314
+ );
1315
+ }
1239
1316
  const ROWS = [
1240
1317
  { student: "Avi Everett", grade: 82.5 },
1241
1318
  { student: "Evan Gutierrez", grade: 67.8 },
@@ -1417,7 +1494,7 @@ function ExhibitApp({
1417
1494
  prefix,
1418
1495
  actions
1419
1496
  }) {
1420
- return /* @__PURE__ */ jsx(ExhibitContext, { value: { docsUrl }, children: /* @__PURE__ */ jsxs(Root, { prefix, locale: enGB, children: [
1497
+ return /* @__PURE__ */ jsx(ExhibitContext.Provider, { value: { docsUrl }, children: /* @__PURE__ */ jsxs(Root, { prefix, locale: enGB, children: [
1421
1498
  /* @__PURE__ */ jsx(VisuallyHidden, { focusable: true, asChild: true, children: /* @__PURE__ */ jsx(Link, { href: "#exhibit-main", style: { top: 6, left: 6 }, children: "Skip to main content" }) }),
1422
1499
  /* @__PURE__ */ jsx(Container, { asChild: true, children: /* @__PURE__ */ jsxs("header", { id: "exhibit-header", children: [
1423
1500
  /* @__PURE__ */ jsx(Heading, { level: 1, id: "exhibit-title", children: title }),
@@ -1437,8 +1514,10 @@ function ExhibitApp({
1437
1514
  /* @__PURE__ */ jsx(DataTableSection, {}),
1438
1515
  /* @__PURE__ */ jsx(DateInputSection, {}),
1439
1516
  /* @__PURE__ */ jsx(DateRangeInputSection, {}),
1517
+ /* @__PURE__ */ jsx(DescriptionListSection, {}),
1440
1518
  /* @__PURE__ */ jsx(DialogSection, {}),
1441
1519
  /* @__PURE__ */ jsx(DropdownMenuSection, {}),
1520
+ /* @__PURE__ */ jsx(FieldGroupSection, {}),
1442
1521
  /* @__PURE__ */ jsx(IconButtonSection, {}),
1443
1522
  /* @__PURE__ */ jsx(InputSection, {}),
1444
1523
  /* @__PURE__ */ jsx(LinkSection, {}),
@@ -1450,6 +1529,7 @@ function ExhibitApp({
1450
1529
  /* @__PURE__ */ jsx(RadioGroupSection, {}),
1451
1530
  /* @__PURE__ */ jsx(SelectSection, {}),
1452
1531
  /* @__PURE__ */ jsx(SpinnerSection, {}),
1532
+ /* @__PURE__ */ jsx(StepperSection, {}),
1453
1533
  /* @__PURE__ */ jsx(TableSection, {}),
1454
1534
  /* @__PURE__ */ jsx(TabsSection, {}),
1455
1535
  /* @__PURE__ */ jsx(TagSection, {}),