@apliteni/apliteni-ui 0.50.0 → 0.51.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
package/react/README.md CHANGED
@@ -28,7 +28,7 @@ import '@apliteni/apliteni-ui/react/css'; // React components' shell styles (mo
28
28
  import { DataTable, Modal, Button } from '@apliteni/apliteni-ui/react';
29
29
  ```
30
30
 
31
- Components: `DataTable`, `Pagination`, `StatBand`, `Modal`, `Confirm`, `Drawer`, `CommandPalette`, `Dropdown`, `BackLink`, `Snippet`, `Tabs`, `Button`, `Badge`, `Card`, `Callout`, `Icon`.
31
+ Components: `EmptyState`, `DataTable`, `Pagination`, `StatBand`, `Modal`, `Confirm`, `Drawer`, `CommandPalette`, `Dropdown`, `BackLink`, `Snippet`, `Tabs`, `Button`, `Badge`, `Card`, `Callout`, `Icon`.
32
32
 
33
33
  `Snippet` accepts `label`, `code`, `reveal`, and `copyLabel` props. It treats `code`
34
34
  as plain text and copies it exactly as provided. After a successful clipboard write,
@@ -77,6 +77,13 @@ vanilla factory where the steps have to be real links. `PAGE_SIZES` and
77
77
  either number. They are declared in this package's own types, and `PAGE_SIZES` is a
78
78
  `readonly number[]`: pass it to `pageSizes`, but do not add sizes to it.
79
79
 
80
+ ## EmptyState
81
+
82
+ `EmptyState` uses the vanilla layout. `variant` selects `first-run`, `no-matches`,
83
+ `not-found`, or `not-yet-built` copy; `title`, `sub`, and `icon` override it.
84
+ `art` accepts a vanilla illustration name, trusted SVG string, or React node; `actions` accepts React nodes. Use at most one primary action and one ghost
85
+ action. The page supplies its own h1; EmptyState uses vanilla’s div title.
86
+
80
87
  ## What the Modal does with focus
81
88
 
82
89
  Opening moves focus to the first eligible control in the body, in DOM order, or to
@@ -586,7 +586,18 @@ type AppShellProps = {
586
586
  };
587
587
  declare function AppShell({ sections, pathname, title, children, word, brand, brandHref, width, back, lede, actions, bandControl, account, onSignOut, defaultCollapsed, palette, renderLink }: AppShellProps): react.JSX.Element;
588
588
 
589
+ type EmptyStateVariant = 'first-run' | 'no-matches' | 'not-found' | 'not-yet-built';
590
+ type EmptyStateProps = {
591
+ variant?: EmptyStateVariant;
592
+ title?: string;
593
+ sub?: string;
594
+ icon?: string;
595
+ art?: ReactNode;
596
+ actions?: ReactNode;
597
+ };
598
+ declare function EmptyState({ variant, title, sub, icon, art, actions }: EmptyStateProps): react.JSX.Element;
599
+
589
600
  declare const PAGE_SIZES: readonly number[];
590
601
  declare const DEFAULT_PAGE_SIZE: number;
591
602
 
592
- export { AppShell, type AppShellProps, type AppShellSection, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, BusyRegion, type BusyRegionProps, Button, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, RowIdentity, type RowIdentityProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, type TabItem, type TableSort, Tabs, type TabsProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, Timeline, type TimelineEvent, type TimelineProps, Toast, type ToastNotice, type ToastProps, sortTableRows, useToast };
603
+ export { AppShell, type AppShellProps, type AppShellSection, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, BusyRegion, type BusyRegionProps, Button, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, EmptyState, type EmptyStateProps, type EmptyStateVariant, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, RowIdentity, type RowIdentityProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, type TabItem, type TableSort, Tabs, type TabsProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, Timeline, type TimelineEvent, type TimelineProps, Toast, type ToastNotice, type ToastProps, sortTableRows, useToast };
@@ -2312,6 +2312,28 @@ function AppShell({
2312
2312
  ] });
2313
2313
  }
2314
2314
 
2315
+ // src/EmptyState.tsx
2316
+ import { icon as kitIcon2, illo } from "@apliteni/apliteni-ui";
2317
+ import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
2318
+ var cases = {
2319
+ "first-run": { title: "Nothing needs you yet", sub: "New items will appear here when they need your attention.", icon: "check" },
2320
+ "no-matches": { title: "No results in this view", sub: "Try another search or clear your filters.", icon: "search" },
2321
+ "not-found": { title: "We can't find that page", sub: "Check the address or return to the home page.", icon: "folder" },
2322
+ "not-yet-built": { title: "This ships later", sub: "This screen is not available yet. Check back later.", icon: "clock" }
2323
+ };
2324
+ function EmptyState({ variant = "first-run", title, sub, icon: icon5, art, actions }) {
2325
+ const preset = cases[variant];
2326
+ const heading = title ?? preset.title;
2327
+ const guidance = sub ?? preset.sub;
2328
+ const glyph = icon5 ?? preset.icon;
2329
+ return /* @__PURE__ */ jsxs22("div", { className: "ui-empty", children: [
2330
+ art ? typeof art === "string" ? /* @__PURE__ */ jsx26("div", { className: "ui-empty__art", dangerouslySetInnerHTML: { __html: /<svg/.test(art) ? art : illo(art) } }) : /* @__PURE__ */ jsx26("div", { className: "ui-empty__art", "aria-hidden": "true", children: art }) : glyph ? /* @__PURE__ */ jsx26("div", { className: "ui-empty__icon", dangerouslySetInnerHTML: { __html: kitIcon2(glyph) } }) : null,
2331
+ heading && /* @__PURE__ */ jsx26("div", { className: "ui-empty__title", children: heading }),
2332
+ guidance && /* @__PURE__ */ jsx26("div", { className: "ui-empty__sub", children: guidance }),
2333
+ actions && /* @__PURE__ */ jsx26("div", { className: "ui-empty__actions", children: actions })
2334
+ ] });
2335
+ }
2336
+
2315
2337
  // src/index.ts
2316
2338
  var PAGE_SIZES = KIT_PAGE_SIZES;
2317
2339
  var DEFAULT_PAGE_SIZE3 = KIT_DEFAULT_PAGE_SIZE;
@@ -2332,6 +2354,7 @@ export {
2332
2354
  Drawer,
2333
2355
  DrawerSection,
2334
2356
  Dropdown,
2357
+ EmptyState,
2335
2358
  FileField,
2336
2359
  FilterBar,
2337
2360
  Icon,