@apliteni/apliteni-ui 0.140.0 → 0.142.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.140.0",
3
+ "version": "0.142.0",
4
4
 
5
5
  "workspaces": [
6
6
  "react"
package/react/README.md CHANGED
@@ -634,6 +634,9 @@ notice with an action and no close button has no other dismissal affordance.
634
634
  Pass `timer: 12` to dismiss a notice after that many seconds. Pass `timer: false` or `timer: 0`
635
635
  to keep a notice until it is dismissed.
636
636
 
637
+ Pass `collapse` to `Toast` to rest the notices as a pile with the newest in front. The pile fans out
638
+ when the reader hovers it or tabs into it. On a device without hover it stays a plain column.
639
+
637
640
  ```tsx
638
641
  function SaveButton() {
639
642
  const push = useToast();
@@ -886,7 +886,7 @@
886
886
  }
887
887
 
888
888
  /* src/Toast.css */
889
- .rx-toast-stack {
889
+ .ui-toast-stack.rx-toast-stack {
890
890
  position: fixed;
891
891
  right: var(--space-4);
892
892
  bottom: var(--space-4);
@@ -894,9 +894,76 @@
894
894
  z-index: var(--z-toast);
895
895
  pointer-events: none;
896
896
  }
897
+ .ui-toast-stack.rx-toast-stack.ui-toast-stack--collapsed {
898
+ pointer-events: auto;
899
+ }
897
900
  .rx-toast-stack > .ui-toast {
898
901
  pointer-events: auto;
899
902
  }
903
+ .ui-toast-stack--collapsed {
904
+ position: relative;
905
+ display: block;
906
+ height: var(--toast-pile-height, auto);
907
+ transition: height var(--dur-med) var(--ease);
908
+ }
909
+ .ui-toast-stack--collapsed:focus-visible {
910
+ outline: var(--ring);
911
+ outline-offset: var(--ring-offset);
912
+ }
913
+ .ui-toast-stack--collapsed > .ui-toast {
914
+ position: absolute;
915
+ right: 0;
916
+ bottom: 0;
917
+ z-index: var(--toast-card-depth, auto);
918
+ transform-origin: bottom center;
919
+ translate: 0 var(--toast-card-lift, 0px);
920
+ scale: var(--toast-card-scale, 1);
921
+ max-height: var(--toast-card-box, none);
922
+ clip-path: inset(-100vmax var(--toast-card-clip, -100vmax) var(--toast-card-clip, -100vmax));
923
+ transition: translate var(--dur-med) var(--ease), scale var(--dur-med) var(--ease);
924
+ }
925
+ .ui-toast-stack--collapsed > .ui-toast > .ui-toast__icon,
926
+ .ui-toast-stack--collapsed > .ui-toast > .ui-toast__body,
927
+ .ui-toast-stack--collapsed > .ui-toast > .ui-toast__action {
928
+ margin-block: auto;
929
+ }
930
+ .ui-toast-stack--collapsed:hover > .ui-toast > *,
931
+ .ui-toast-stack--collapsed:focus-within > .ui-toast > * {
932
+ margin-block: 0;
933
+ }
934
+ .ui-toast-stack--collapsed:hover,
935
+ .ui-toast-stack--collapsed:focus-within {
936
+ height: var(--toast-fan-height, auto);
937
+ }
938
+ .ui-toast-stack--collapsed:hover > .ui-toast,
939
+ .ui-toast-stack--collapsed:focus-within > .ui-toast {
940
+ translate: 0 var(--toast-card-fan, 0px);
941
+ scale: 1;
942
+ max-height: var(--toast-card-natural, none);
943
+ clip-path: inset(-100vmax -100vmax var(--toast-card-fan-clip, -100vmax));
944
+ transition: translate var(--dur-med) var(--ease), scale var(--dur-med) var(--ease);
945
+ }
946
+ @media (hover: none) {
947
+ .ui-toast-stack--collapsed,
948
+ .ui-toast-stack--collapsed:hover,
949
+ .ui-toast-stack--collapsed:focus-within {
950
+ display: flex;
951
+ height: auto;
952
+ }
953
+ .ui-toast-stack--collapsed > .ui-toast,
954
+ .ui-toast-stack--collapsed:hover > .ui-toast,
955
+ .ui-toast-stack--collapsed:focus-within > .ui-toast {
956
+ position: static;
957
+ translate: none;
958
+ scale: 1;
959
+ max-height: none;
960
+ clip-path: none;
961
+ }
962
+ }
963
+ .ui-toast-stack--collapsed:hover > .ui-toast > .ui-toast__timer.is-running,
964
+ .ui-toast-stack--collapsed:focus-within > .ui-toast > .ui-toast__timer.is-running {
965
+ animation-play-state: paused;
966
+ }
900
967
 
901
968
  /* src/ThemeToggle.css */
902
969
  .ui-theme-toggle {
@@ -936,6 +1003,32 @@
936
1003
  :where(:root[data-theme=light]) .ui-react-app__menu .ui-nav__item.is-active {
937
1004
  background: var(--surface-3);
938
1005
  }
1006
+ .ui-app__drawer {
1007
+ --ui-nav-col: 216px;
1008
+ --ui-nav-strip: 41px;
1009
+ --ui-app-av: 30px;
1010
+ }
1011
+ .ui-app__drawer .ui-app__user-trigger {
1012
+ width: 100%;
1013
+ gap: var(--space-2);
1014
+ min-height: 38px;
1015
+ padding: var(--space-1) 0;
1016
+ border: 0;
1017
+ border-radius: var(--radius-sm);
1018
+ background: none;
1019
+ color: var(--text);
1020
+ font-size: inherit;
1021
+ font-weight: inherit;
1022
+ letter-spacing: normal;
1023
+ }
1024
+ .ui-app__drawer .ui-app__user-trigger:hover {
1025
+ background: var(--surface);
1026
+ }
1027
+ @media (max-width: 720px) {
1028
+ .ui-drawer__footer > .ui-app__drawer {
1029
+ width: 100%;
1030
+ }
1031
+ }
939
1032
  .ui-react-app__band-control {
940
1033
  display: contents;
941
1034
  }
@@ -944,6 +1037,9 @@
944
1037
  gap: var(--space-1);
945
1038
  padding-inline: var(--space-2);
946
1039
  }
1040
+ .ui-react-app .ui-app__bar--phone {
1041
+ gap: var(--space-3);
1042
+ }
947
1043
  .ui-react-app .ui-app__bar:not(:has(> .ui-app__menu:first-child)) {
948
1044
  padding-inline-start: var(--space-4);
949
1045
  }
@@ -883,9 +883,27 @@ type ToastNotice = {
883
883
  };
884
884
  type ToastProps = {
885
885
  children: ReactNode;
886
+ collapse?: boolean;
886
887
  };
887
888
  declare function useToast(): (notice: ToastNotice) => void;
888
- declare function Toast({ children }: ToastProps): react.JSX.Element;
889
+ declare function Toast({ children, collapse }: ToastProps): react.JSX.Element;
890
+
891
+ type BreadcrumbItem = {
892
+ label: string;
893
+ href?: string;
894
+ target?: string;
895
+ icon?: string;
896
+ };
897
+ type BreadcrumbsProps = Omit<ComponentPropsWithoutRef<'nav'>, 'children'> & {
898
+ items: readonly BreadcrumbItem[];
899
+ /** Spread linkProps onto the router link, including children. */
900
+ renderLink?: (item: BreadcrumbItem, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
901
+ };
902
+ declare const Breadcrumbs: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children"> & {
903
+ items: readonly BreadcrumbItem[];
904
+ /** Spread linkProps onto the router link, including children. */
905
+ renderLink?: (item: BreadcrumbItem, linkProps: ComponentPropsWithoutRef<"a">) => ReactNode;
906
+ } & react.RefAttributes<HTMLElement>>;
889
907
 
890
908
  type AppShellSection = {
891
909
  href: string;
@@ -895,6 +913,8 @@ type AppShellSection = {
895
913
  };
896
914
  type AppShellProps = {
897
915
  sections: AppShellSection[];
916
+ /** The vanilla rail layout, or the existing band layout. */
917
+ layout?: 'rail' | 'topbar';
898
918
  /** Current router pathname; the longest matching section wins. */
899
919
  pathname: string;
900
920
  title: string;
@@ -907,6 +927,7 @@ type AppShellProps = {
907
927
  href: string;
908
928
  label: string;
909
929
  };
930
+ crumbs?: readonly BreadcrumbItem[];
910
931
  lede?: string;
911
932
  actions?: ReactNode;
912
933
  bandControl?: ReactNode;
@@ -925,7 +946,7 @@ type AppShellProps = {
925
946
  /** Spread linkProps onto the router link, including children and onClick. */
926
947
  renderLink?: (section: AppShellSection, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
927
948
  };
928
- declare function AppShell({ sections, pathname, title, children, word, brand, brandHref, width, back, lede, actions, bandControl, account, onSignOut, searchLabel, searchShortLabel, defaultCollapsed, palette, renderLink }: AppShellProps): react.JSX.Element;
949
+ declare function AppShell({ sections, pathname, title, children, word, brand, layout, brandHref, width, back, crumbs, lede, actions, bandControl, account, onSignOut, searchLabel, searchShortLabel, defaultCollapsed, palette, renderLink }: AppShellProps): react.JSX.Element;
929
950
 
930
951
  type AuthShellProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
931
952
  brand: ReactNode;
@@ -1303,23 +1324,6 @@ declare const NavTabs: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedH
1303
1324
  renderLink?: (item: NavTabItem, linkProps: ComponentPropsWithoutRef<"a">) => ReactNode;
1304
1325
  } & react.RefAttributes<HTMLElement>>;
1305
1326
 
1306
- type BreadcrumbItem = {
1307
- label: string;
1308
- href?: string;
1309
- target?: string;
1310
- icon?: string;
1311
- };
1312
- type BreadcrumbsProps = Omit<ComponentPropsWithoutRef<'nav'>, 'children'> & {
1313
- items: readonly BreadcrumbItem[];
1314
- /** Spread linkProps onto the router link, including children. */
1315
- renderLink?: (item: BreadcrumbItem, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
1316
- };
1317
- declare const Breadcrumbs: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children"> & {
1318
- items: readonly BreadcrumbItem[];
1319
- /** Spread linkProps onto the router link, including children. */
1320
- renderLink?: (item: BreadcrumbItem, linkProps: ComponentPropsWithoutRef<"a">) => ReactNode;
1321
- } & react.RefAttributes<HTMLElement>>;
1322
-
1323
1327
  declare const PAGE_SIZES: readonly number[];
1324
1328
  declare const DEFAULT_PAGE_SIZE: number;
1325
1329