nish-ui 1.4.1 → 1.5.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/README.md +11 -3
- package/dist/index.d.ts +45 -2
- package/dist/index.js +279 -78
- package/dist/index.js.map +1 -1
- package/dist/server/hono.d.ts +19 -4
- package/dist/server/hono.js +50 -0
- package/dist/server/hono.js.map +1 -1
- package/dist/server/index.d.ts +4 -54
- package/dist/server/index.js +128 -6
- package/dist/server/index.js.map +1 -1
- package/dist/{spa-EPM1E0Va.d.ts → spa-DuVB5O7S.d.ts} +104 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,9 +26,15 @@ examples exactly as written, install it under that name with an npm alias:
|
|
|
26
26
|
npm install @nish/ui@npm:nish-ui
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
The nish.software apps pin
|
|
30
|
-
`"@nish/ui": "
|
|
31
|
-
|
|
29
|
+
The nish.software apps pin that alias to an exact version,
|
|
30
|
+
`"@nish/ui": "npm:nish-ui@X.Y.Z"`. The release fan-out keeps the pin current, so the version is
|
|
31
|
+
never written by hand.
|
|
32
|
+
|
|
33
|
+
### Fallback: without the npm registry
|
|
34
|
+
|
|
35
|
+
Every release tag carries the same built files, so a machine that cannot reach npm can pin the
|
|
36
|
+
tag's tarball, which needs only HTTPS:
|
|
37
|
+
`"@nish/ui": "https://codeload.github.com/nishant/ui/tar.gz/refs/tags/vX.Y.Z"`.
|
|
32
38
|
|
|
33
39
|
## Usage
|
|
34
40
|
|
|
@@ -115,6 +121,8 @@ More than 60 components, each with live stories, props and guidelines on the
|
|
|
115
121
|
Switch, Segmented, Chip, SearchInput, Field
|
|
116
122
|
- **Feedback:** Toast, Callout, Spinner, Skeleton, EmptyState, ErrorState, StatusDot, Meter
|
|
117
123
|
- **Overlays:** Modal, Drawer, ConfirmDialog, Popover, DropdownMenu, Tooltip
|
|
124
|
+
- **Settings:** SettingsSection, SettingRow, NumberField, ServiceTokensSection (list and revoke
|
|
125
|
+
service tokens)
|
|
118
126
|
- **Layout and navigation:** AppShell, AppHeader, BottomNav, NavRail, MoreSheet, Tabs,
|
|
119
127
|
PageHeader, Card, Table, FilterBar, SplitStage
|
|
120
128
|
- **Data and motion:** Stat, Sparkline, MediaRow, ActivityFeed, WorkflowBoard, SystemCanvas,
|
package/dist/index.d.ts
CHANGED
|
@@ -3005,6 +3005,49 @@ interface NumberFieldProps extends Omit<InputProps, 'value' | 'onChange' | 'type
|
|
|
3005
3005
|
/** A numeric setting that saves when you leave the field or press Enter. */
|
|
3006
3006
|
declare const NumberField: react.ForwardRefExoticComponent<NumberFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
3007
3007
|
|
|
3008
|
+
/** A service token as the settings page sees it: never the hash. */
|
|
3009
|
+
interface ServiceTokenView {
|
|
3010
|
+
id: string;
|
|
3011
|
+
name: string;
|
|
3012
|
+
scopes: string[];
|
|
3013
|
+
created: string;
|
|
3014
|
+
source: 'file' | 'env';
|
|
3015
|
+
revoked: boolean;
|
|
3016
|
+
revokedAt?: string;
|
|
3017
|
+
}
|
|
3018
|
+
interface ServiceTokenListResponse {
|
|
3019
|
+
tokens: ServiceTokenView[];
|
|
3020
|
+
}
|
|
3021
|
+
|
|
3022
|
+
interface UseServiceTokens {
|
|
3023
|
+
/** undefined until the first load finishes. */
|
|
3024
|
+
tokens: ServiceTokenView[] | undefined;
|
|
3025
|
+
loading: boolean;
|
|
3026
|
+
error: string | null;
|
|
3027
|
+
reload: () => void;
|
|
3028
|
+
/** Revokes the token with this id and replaces `tokens` with the server's new list. Throws the ApiError on failure. */
|
|
3029
|
+
revoke: (id: string) => Promise<void>;
|
|
3030
|
+
}
|
|
3031
|
+
/** Loads the app's service tokens from `url` (GET) and revokes one with POST `${url}/<id>/revoke`.
|
|
3032
|
+
* The server side is `mountServiceTokenRoutes` from `@nish/ui/server/hono`. */
|
|
3033
|
+
declare function useServiceTokens(url?: string): UseServiceTokens;
|
|
3034
|
+
interface ServiceTokensSectionProps {
|
|
3035
|
+
/** undefined = loading. */
|
|
3036
|
+
tokens: ServiceTokenView[] | undefined;
|
|
3037
|
+
error?: string | null;
|
|
3038
|
+
onRetry?: () => void;
|
|
3039
|
+
/** Revokes the token. Reject to keep the dialog open with the error. */
|
|
3040
|
+
onRevoke: (id: string) => Promise<void>;
|
|
3041
|
+
/** Default "Service tokens". */
|
|
3042
|
+
title?: ReactNode;
|
|
3043
|
+
description?: ReactNode;
|
|
3044
|
+
/** Anchor id on the section. Default "service-tokens". */
|
|
3045
|
+
id?: string;
|
|
3046
|
+
className?: string;
|
|
3047
|
+
}
|
|
3048
|
+
/** The settings block that lists an app's service tokens with a Revoke button each. */
|
|
3049
|
+
declare function ServiceTokensSection({ tokens, error, onRetry, onRevoke, title, description, id, className, }: ServiceTokensSectionProps): react.JSX.Element;
|
|
3050
|
+
|
|
3008
3051
|
interface ComboboxOption {
|
|
3009
3052
|
value: string;
|
|
3010
3053
|
label: string;
|
|
@@ -3298,5 +3341,5 @@ interface MediaChipProps {
|
|
|
3298
3341
|
/** A pill button with a 16:9 thumbnail and a label, 44px tall: a recent item or a hidden pane to bring back. */
|
|
3299
3342
|
declare function MediaChip({ thumbnailUrl, label, onClick, action, className }: MediaChipProps): react.JSX.Element;
|
|
3300
3343
|
|
|
3301
|
-
export { ActivityFeed, AgentNode, AnimatedList, ApiError, AppErrorBoundary, AppHeader, AppShell, AsyncPanel, BREAKPOINTS, Badge, BarChart, BellIcon, BottomNav, Button, COLOR_ROLES, Callout, Card, CardHeader, CardListSkeleton, ChartLegend, CheckIcon, Checkbox, Chip, ChipGroup, ClockIcon, Combobox, CommandPalette, ConfirmDialog, ConnectionBanner, CopyButton, DEFAULT_THEME, Disclosure, Drawer, DropdownMenu, EmptyState, ErrorState, Favicon, Field, FieldGroup, FilterBar, FilterSheet, FlowSteps, HUE_ROLES, INBOX_ACTION_HEADER, INBOX_ACTION_TIMEOUT_MS, INBOX_DEFAULT_SETTINGS, INBOX_SOURCE_LABELS, IconButton, Inbox, Input, Kbd, KeyValueList, Label, LayoutPresetIcon, LayoutPresetPicker, LineChart, LinkCard, ListRow, LoadingBar, MAX_PANES, MediaChip, MediaRow, MediaThumb, MenuItem, MenuLabel, MenuSeparator, MenuSubHeader, Meter, Modal, MoreIcon, MoreSheet, NARROW_BREAKPOINT, NARROW_MAX, NARROW_QUERY, NavRail, NumberField, PHONE_QUERY, PRESETS, PageContainer, PageHeader, Popover, RangeBar, RelativeTime, ResponsiveTable, SCALE, SHADOWS, SOFT_ROLES, ScrollRow, SearchInput, SectionHeader, SectionNav, Segmented, Select, SettingRow, SettingsIcon, SettingsSection, Skeleton, SkeletonCard, SkeletonLines, SkeletonRows, Sparkline, Spinner, SplitDividers, SplitStage, Stat, StatGrid, StatGridSkeleton, StatusDot, StepBar, StickyActionBar, StickyBar, Switch, THEMES, TOGGLE_ORDER, TabPanel, Table, TableWrap, Tabs, Td, Textarea, Th, ThemeToggle, TickerText, Toaster, Tooltip, Tr, WorkflowBoard, addSlot, apiFetch, applyTheme, badgeClass, buttonClass, cardClass, chipClass, cn, computeDividers, computeRects, configureApi, confirmDialog, copyText, countLeaves, cycleTheme, defaultPreset, dismissToast, equalize, fieldClass, getThemeChoice, iconButtonClass, initTheme, isThemeName, isValidLayout, linkClass, locationAdapter, menuItemClass, mountChecklist, mountHeightVar, mountScrollspy, mountStuck, mountThemeToggle, mountTooltips, narrowLayout, navigateFromLayer, onThemeChange, openSheet, presetOptions, presetsFor, readToken, registerThemes, removeSlot, resizeAt, resolveTheme, revealClass, schemeOf, setThemeChoice, showToast, signTone, swapSlots, tabClass, tableClass, toast, toneFor, useBreakpoint, useCommandHotkey, useDocumentTitle, useHeightVar, useLocalStorage, useMediaQuery, useNarrow, useNow, useOnline, usePhone, usePrefersReducedMotion, useResource, useSaveStatus, useScrollEdges, useScrollSpy, useStuck, useTheme, useToast, useUrlState };
|
|
3302
|
-
export type { ActivityFeedProps, ActivityItem, AgentNodeProps, AgentNodeState, AnimatedListProps, ApiConfig, ApiFetchOptions, AppErrorBoundaryProps, AppHeaderProps, AppShellProps, AsyncPanelProps, BadgeClassOptions, BadgeHue, BadgeProps, BadgeTone, BarChartProps, BottomNavProps, Breakpoint, ButtonClassOptions, ButtonProps, ButtonSize, ButtonVariant, CalloutProps, CalloutTone, CanvasEdge, CanvasEdgeKind, CanvasGroup, CanvasHue, CanvasLayout, CanvasLayoutMode, CanvasNode, CanvasNodeKind, CardClassOptions, CardElement, CardHeaderProps, CardListSkeletonProps, CardPadding, CardProps, ChartLegendItem, ChartLegendProps, ChartLegendTone, ChartTone, CheckboxProps, ChipClassOptions, ChipGroupProps, ChipProps, Column, ComboboxOption, ComboboxProps, CommandItem, CommandPaletteProps, ConfirmDialogOptions, ConfirmDialogProps, ConnectionBannerProps, CopyButtonProps, DisclosureProps, Divider, DrawerProps, DropdownMenuProps, EmptyStateProps, ErrorStateProps, FaviconProps, FieldClassOptions, FieldGroupProps, FieldProps, FieldSize, FilterBarProps, FilterSheetProps, FlowStepItem, FlowStepStatus, FlowStepsProps, IconButtonClassOptions, IconButtonProps, IconButtonSize, IconButtonVariant, InboxAction, InboxActionCall, InboxActionResult, InboxItem, InboxListResponse, InboxProps, InboxSettings, InboxSeverity, InboxView, InputProps, KeyValueItem, KeyValueListProps, LayoutNode, LayoutOptions, LayoutPresetIconProps, LayoutPresetOption, LayoutPresetPickerProps, LineChartProps, LinePoint, LineSeries, LinkCardAccent, LinkCardProps, LinkClassOptions, ListRowProps, LoadingBarProps, MediaChipProps, MediaRowProps, MediaThumbProps, MediaThumbShape, MediaThumbSize, MenuItemClassOptions, MenuItemProps, MenuSubHeaderProps, MeterProps, MeterTone, ModalProps, MoreSheetProps, MountScrollspyOptions, MountThemeToggleOptions, NarrowLayout, NavItem, NavRailProps, NumberFieldProps, PageContainerProps, PageHeaderProps, PopoverCloseReason, PopoverProps, Preset, RangeBarProps, Rect, RelativeTimeProps, RenderLink, Resource, ResponsiveTableProps, RoutedEdge, SaveStatus, ScrollRowProps, SearchInputProps, SectionHeaderProps, SectionNavItem, SectionNavProps, SegmentedOption, SegmentedProps, SegmentedTone, SelectProps, SettingRowProps, SettingsSectionProps, ShowToastOptions, SkeletonCardProps, SkeletonRowsProps, Sort, SparklineProps, SparklineTone, SpinnerProps, SplitDividersProps, SplitStageProps, StatGridProps, StatGridSkeletonProps, StatProps, StaticToastTone, StatusDotProps, StatusTone, StepBarProps, StickyActionBarProps, StickyBarProps, SwitchProps, SystemCanvasProps, TabItem, TabPanelProps, TableProps, TableWrapProps, TabsBreakpoint, TabsProps, TabsSize, TdProps, TextareaProps, ThProps, ThemeChoice, ThemeName, ThemePreset, ThemeState, ThemeToggleLabels, ThemeToggleProps, TickerTextProps, ToastAction, ToastItem, ToastOptions, ToastTone, ToasterProps, TooltipProps, TrProps, UrlStateAdapter, UrlStateShape, UseResourceOptions, WorkflowBoardAgent, WorkflowBoardPhase, WorkflowBoardProps };
|
|
3344
|
+
export { ActivityFeed, AgentNode, AnimatedList, ApiError, AppErrorBoundary, AppHeader, AppShell, AsyncPanel, BREAKPOINTS, Badge, BarChart, BellIcon, BottomNav, Button, COLOR_ROLES, Callout, Card, CardHeader, CardListSkeleton, ChartLegend, CheckIcon, Checkbox, Chip, ChipGroup, ClockIcon, Combobox, CommandPalette, ConfirmDialog, ConnectionBanner, CopyButton, DEFAULT_THEME, Disclosure, Drawer, DropdownMenu, EmptyState, ErrorState, Favicon, Field, FieldGroup, FilterBar, FilterSheet, FlowSteps, HUE_ROLES, INBOX_ACTION_HEADER, INBOX_ACTION_TIMEOUT_MS, INBOX_DEFAULT_SETTINGS, INBOX_SOURCE_LABELS, IconButton, Inbox, Input, Kbd, KeyValueList, Label, LayoutPresetIcon, LayoutPresetPicker, LineChart, LinkCard, ListRow, LoadingBar, MAX_PANES, MediaChip, MediaRow, MediaThumb, MenuItem, MenuLabel, MenuSeparator, MenuSubHeader, Meter, Modal, MoreIcon, MoreSheet, NARROW_BREAKPOINT, NARROW_MAX, NARROW_QUERY, NavRail, NumberField, PHONE_QUERY, PRESETS, PageContainer, PageHeader, Popover, RangeBar, RelativeTime, ResponsiveTable, SCALE, SHADOWS, SOFT_ROLES, ScrollRow, SearchInput, SectionHeader, SectionNav, Segmented, Select, ServiceTokensSection, SettingRow, SettingsIcon, SettingsSection, Skeleton, SkeletonCard, SkeletonLines, SkeletonRows, Sparkline, Spinner, SplitDividers, SplitStage, Stat, StatGrid, StatGridSkeleton, StatusDot, StepBar, StickyActionBar, StickyBar, Switch, THEMES, TOGGLE_ORDER, TabPanel, Table, TableWrap, Tabs, Td, Textarea, Th, ThemeToggle, TickerText, Toaster, Tooltip, Tr, WorkflowBoard, addSlot, apiFetch, applyTheme, badgeClass, buttonClass, cardClass, chipClass, cn, computeDividers, computeRects, configureApi, confirmDialog, copyText, countLeaves, cycleTheme, defaultPreset, dismissToast, equalize, fieldClass, getThemeChoice, iconButtonClass, initTheme, isThemeName, isValidLayout, linkClass, locationAdapter, menuItemClass, mountChecklist, mountHeightVar, mountScrollspy, mountStuck, mountThemeToggle, mountTooltips, narrowLayout, navigateFromLayer, onThemeChange, openSheet, presetOptions, presetsFor, readToken, registerThemes, removeSlot, resizeAt, resolveTheme, revealClass, schemeOf, setThemeChoice, showToast, signTone, swapSlots, tabClass, tableClass, toast, toneFor, useBreakpoint, useCommandHotkey, useDocumentTitle, useHeightVar, useLocalStorage, useMediaQuery, useNarrow, useNow, useOnline, usePhone, usePrefersReducedMotion, useResource, useSaveStatus, useScrollEdges, useScrollSpy, useServiceTokens, useStuck, useTheme, useToast, useUrlState };
|
|
3345
|
+
export type { ActivityFeedProps, ActivityItem, AgentNodeProps, AgentNodeState, AnimatedListProps, ApiConfig, ApiFetchOptions, AppErrorBoundaryProps, AppHeaderProps, AppShellProps, AsyncPanelProps, BadgeClassOptions, BadgeHue, BadgeProps, BadgeTone, BarChartProps, BottomNavProps, Breakpoint, ButtonClassOptions, ButtonProps, ButtonSize, ButtonVariant, CalloutProps, CalloutTone, CanvasEdge, CanvasEdgeKind, CanvasGroup, CanvasHue, CanvasLayout, CanvasLayoutMode, CanvasNode, CanvasNodeKind, CardClassOptions, CardElement, CardHeaderProps, CardListSkeletonProps, CardPadding, CardProps, ChartLegendItem, ChartLegendProps, ChartLegendTone, ChartTone, CheckboxProps, ChipClassOptions, ChipGroupProps, ChipProps, Column, ComboboxOption, ComboboxProps, CommandItem, CommandPaletteProps, ConfirmDialogOptions, ConfirmDialogProps, ConnectionBannerProps, CopyButtonProps, DisclosureProps, Divider, DrawerProps, DropdownMenuProps, EmptyStateProps, ErrorStateProps, FaviconProps, FieldClassOptions, FieldGroupProps, FieldProps, FieldSize, FilterBarProps, FilterSheetProps, FlowStepItem, FlowStepStatus, FlowStepsProps, IconButtonClassOptions, IconButtonProps, IconButtonSize, IconButtonVariant, InboxAction, InboxActionCall, InboxActionResult, InboxItem, InboxListResponse, InboxProps, InboxSettings, InboxSeverity, InboxView, InputProps, KeyValueItem, KeyValueListProps, LayoutNode, LayoutOptions, LayoutPresetIconProps, LayoutPresetOption, LayoutPresetPickerProps, LineChartProps, LinePoint, LineSeries, LinkCardAccent, LinkCardProps, LinkClassOptions, ListRowProps, LoadingBarProps, MediaChipProps, MediaRowProps, MediaThumbProps, MediaThumbShape, MediaThumbSize, MenuItemClassOptions, MenuItemProps, MenuSubHeaderProps, MeterProps, MeterTone, ModalProps, MoreSheetProps, MountScrollspyOptions, MountThemeToggleOptions, NarrowLayout, NavItem, NavRailProps, NumberFieldProps, PageContainerProps, PageHeaderProps, PopoverCloseReason, PopoverProps, Preset, RangeBarProps, Rect, RelativeTimeProps, RenderLink, Resource, ResponsiveTableProps, RoutedEdge, SaveStatus, ScrollRowProps, SearchInputProps, SectionHeaderProps, SectionNavItem, SectionNavProps, SegmentedOption, SegmentedProps, SegmentedTone, SelectProps, ServiceTokenListResponse, ServiceTokenView, ServiceTokensSectionProps, SettingRowProps, SettingsSectionProps, ShowToastOptions, SkeletonCardProps, SkeletonRowsProps, Sort, SparklineProps, SparklineTone, SpinnerProps, SplitDividersProps, SplitStageProps, StatGridProps, StatGridSkeletonProps, StatProps, StaticToastTone, StatusDotProps, StatusTone, StepBarProps, StickyActionBarProps, StickyBarProps, SwitchProps, SystemCanvasProps, TabItem, TabPanelProps, TableProps, TableWrapProps, TabsBreakpoint, TabsProps, TabsSize, TdProps, TextareaProps, ThProps, ThemeChoice, ThemeName, ThemePreset, ThemeState, ThemeToggleLabels, ThemeToggleProps, TickerTextProps, ToastAction, ToastItem, ToastOptions, ToastTone, ToasterProps, TooltipProps, TrProps, UrlStateAdapter, UrlStateShape, UseResourceOptions, WorkflowBoardAgent, WorkflowBoardPhase, WorkflowBoardProps };
|