@caratlogic/design-system 0.1.47 → 0.1.48

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 (30) hide show
  1. package/dist/components/atoms/BrandLoader/BrandLoader.d.ts +10 -0
  2. package/dist/components/atoms/BrandLoader/BrandLoader.d.ts.map +1 -0
  3. package/dist/components/atoms/BrandLoader/BrandLoader.types.d.ts +9 -0
  4. package/dist/components/atoms/BrandLoader/BrandLoader.types.d.ts.map +1 -0
  5. package/dist/components/atoms/BrandLoader/BrandLoader.utils.d.ts +13 -0
  6. package/dist/components/atoms/BrandLoader/BrandLoader.utils.d.ts.map +1 -0
  7. package/dist/components/atoms/BrandLoader/index.d.ts +4 -0
  8. package/dist/components/atoms/BrandLoader/index.d.ts.map +1 -0
  9. package/dist/components/molecules/PageLoader/PageLoader.d.ts +6 -0
  10. package/dist/components/molecules/PageLoader/PageLoader.d.ts.map +1 -0
  11. package/dist/components/molecules/PageLoader/PageLoader.types.d.ts +5 -0
  12. package/dist/components/molecules/PageLoader/PageLoader.types.d.ts.map +1 -0
  13. package/dist/components/molecules/PageLoader/index.d.ts +3 -0
  14. package/dist/components/molecules/PageLoader/index.d.ts.map +1 -0
  15. package/dist/components/molecules/SubmittingOverlay/SubmittingOverlay.d.ts +11 -0
  16. package/dist/components/molecules/SubmittingOverlay/SubmittingOverlay.d.ts.map +1 -0
  17. package/dist/components/molecules/SubmittingOverlay/SubmittingOverlay.types.d.ts +7 -0
  18. package/dist/components/molecules/SubmittingOverlay/SubmittingOverlay.types.d.ts.map +1 -0
  19. package/dist/components/molecules/SubmittingOverlay/SubmittingOverlay.utils.d.ts +2 -0
  20. package/dist/components/molecules/SubmittingOverlay/SubmittingOverlay.utils.d.ts.map +1 -0
  21. package/dist/components/molecules/SubmittingOverlay/index.d.ts +3 -0
  22. package/dist/components/molecules/SubmittingOverlay/index.d.ts.map +1 -0
  23. package/dist/index.cjs.js +48 -0
  24. package/dist/index.cjs.js.map +1 -1
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.esm.js +45 -1
  28. package/dist/index.esm.js.map +1 -1
  29. package/dist/source.css +33 -0
  30. package/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { BrandLoaderProps } from './BrandLoader.types';
3
+ export type { BrandLoaderProps, BrandLoaderTone } from './BrandLoader.types';
4
+ /**
5
+ * The animated brand gem: it winds up, springs out with a glow and settles while
6
+ * two rings ripple out behind it. Needs the `loader-*` animations from
7
+ * `source.css`; motion stops for users who ask for reduced motion.
8
+ */
9
+ export declare function BrandLoader({ logoSrc, tone, className }: BrandLoaderProps): ReactElement;
10
+ //# sourceMappingURL=BrandLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandLoader.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/BrandLoader/BrandLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE7E;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,IAAgB,EAAE,SAAS,EAAE,EAAE,gBAAgB,GAAG,YAAY,CAuBpG"}
@@ -0,0 +1,9 @@
1
+ /** `inverse` is for a dark backdrop, such as SubmittingOverlay's scrim. */
2
+ export type BrandLoaderTone = 'default' | 'inverse';
3
+ export interface BrandLoaderProps {
4
+ /** The brand gem image; each app passes its own asset URL. */
5
+ logoSrc: string;
6
+ tone?: BrandLoaderTone;
7
+ className?: string;
8
+ }
9
+ //# sourceMappingURL=BrandLoader.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandLoader.types.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/BrandLoader/BrandLoader.types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,13 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { BrandLoaderTone } from './BrandLoader.types';
3
+ export declare const BRAND_LOADER_RINGS: readonly [{
4
+ readonly id: "first";
5
+ readonly delay: "0s";
6
+ }, {
7
+ readonly id: "second";
8
+ readonly delay: "0.45s";
9
+ }];
10
+ export declare const RING_TONE_CLASS: Record<BrandLoaderTone, string>;
11
+ /** Clips the sheen to the logo's own shape. */
12
+ export declare const logoMaskStyle: (logoSrc: string) => CSSProperties;
13
+ //# sourceMappingURL=BrandLoader.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandLoader.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/BrandLoader/BrandLoader.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,eAAO,MAAM,kBAAkB;;;;;;EAGrB,CAAC;AAEX,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAG3D,CAAC;AAEF,+CAA+C;AAC/C,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,aAG9C,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { BrandLoader } from './BrandLoader';
2
+ export type { BrandLoaderProps, BrandLoaderTone } from './BrandLoader';
3
+ export { BRAND_LOADER_RINGS } from './BrandLoader.utils';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/BrandLoader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { PageLoaderProps } from './PageLoader.types';
3
+ export type { PageLoaderProps } from './PageLoader.types';
4
+ /** Fills the content area with the brand loader while a page loads. */
5
+ export declare function PageLoader({ logoSrc, className }: PageLoaderProps): ReactElement;
6
+ //# sourceMappingURL=PageLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageLoader.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/PageLoader/PageLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,eAAe,GAAG,YAAY,CAWhF"}
@@ -0,0 +1,5 @@
1
+ export interface PageLoaderProps {
2
+ logoSrc: string;
3
+ className?: string;
4
+ }
5
+ //# sourceMappingURL=PageLoader.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageLoader.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/PageLoader/PageLoader.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,3 @@
1
+ export { PageLoader } from './PageLoader';
2
+ export type { PageLoaderProps } from './PageLoader';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/PageLoader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { SubmittingOverlayProps } from './SubmittingOverlay.types';
3
+ export type { SubmittingOverlayProps } from './SubmittingOverlay.types';
4
+ /**
5
+ * Full-screen scrim with the brand loader and a short label, shown while a
6
+ * submit request is in flight. Sits above dialogs and slide-outs (z-50), since
7
+ * some submits start from one. `pointer-events-auto` because an open Radix
8
+ * dialog sets `pointer-events: none` on body, which would let clicks through.
9
+ */
10
+ export declare function SubmittingOverlay({ open, label, logoSrc }: SubmittingOverlayProps): ReactElement | null;
11
+ //# sourceMappingURL=SubmittingOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubmittingOverlay.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SubmittingOverlay/SubmittingOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGxE,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,sBAAsB,GAAG,YAAY,GAAG,IAAI,CAmBvG"}
@@ -0,0 +1,7 @@
1
+ export interface SubmittingOverlayProps {
2
+ open: boolean;
3
+ /** Two or three words, e.g. "Creating invoice". */
4
+ label: string;
5
+ logoSrc: string;
6
+ }
7
+ //# sourceMappingURL=SubmittingOverlay.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubmittingOverlay.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SubmittingOverlay/SubmittingOverlay.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export declare const GEM_EDGE_GLOW_CLASS = "[filter:drop-shadow(0_0_1px_rgb(255_255_255/0.6))_drop-shadow(0_0_6px_rgb(255_255_255/0.15))]";
2
+ //# sourceMappingURL=SubmittingOverlay.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubmittingOverlay.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SubmittingOverlay/SubmittingOverlay.utils.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB,kGACiE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { SubmittingOverlay } from './SubmittingOverlay';
2
+ export type { SubmittingOverlayProps } from './SubmittingOverlay';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SubmittingOverlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -13747,6 +13747,30 @@ const Badge = React.forwardRef(({ appearance = 'solid', color = 'primary', size
13747
13747
  });
13748
13748
  Badge.displayName = 'Badge';
13749
13749
 
13750
+ // The second ring trails well behind the first, so the two travel out with a clear gap.
13751
+ const BRAND_LOADER_RINGS = [
13752
+ { id: 'first', delay: '0s' },
13753
+ { id: 'second', delay: '0.45s' },
13754
+ ];
13755
+ const RING_TONE_CLASS = {
13756
+ default: 'border-primary/50',
13757
+ inverse: 'border-white/80',
13758
+ };
13759
+ /** Clips the sheen to the logo's own shape. */
13760
+ const logoMaskStyle = (logoSrc) => ({
13761
+ maskImage: `url(${logoSrc})`,
13762
+ WebkitMaskImage: `url(${logoSrc})`,
13763
+ });
13764
+
13765
+ /**
13766
+ * The animated brand gem: it winds up, springs out with a glow and settles while
13767
+ * two rings ripple out behind it. Needs the `loader-*` animations from
13768
+ * `source.css`; motion stops for users who ask for reduced motion.
13769
+ */
13770
+ function BrandLoader({ logoSrc, tone = 'default', className }) {
13771
+ return (jsxRuntime.jsxs("div", { "aria-hidden": true, className: cn('relative flex size-28 items-center justify-center', className), children: [BRAND_LOADER_RINGS.map((ring) => (jsxRuntime.jsx("span", { "data-loader-ring": true, style: { animationDelay: ring.delay }, className: cn('absolute size-24 rounded-full border-2 opacity-0 motion-safe:animate-loader-ring motion-reduce:hidden', RING_TONE_CLASS[tone]) }, ring.id))), jsxRuntime.jsxs("div", { className: "relative size-[7.8rem] shrink-0 motion-safe:animate-loader-gem motion-reduce:scale-[0.77]", children: [jsxRuntime.jsx("img", { src: logoSrc, alt: "", className: "size-full object-contain" }), jsxRuntime.jsx("span", { style: logoMaskStyle(logoSrc), className: "absolute inset-0 bg-[linear-gradient(110deg,transparent_35%,rgb(255_255_255/0.8)_50%,transparent_65%)] bg-[length:200%_100%] [mask-position:center] [mask-repeat:no-repeat] [mask-size:contain] motion-safe:animate-loader-sheen motion-reduce:hidden" })] })] }));
13772
+ }
13773
+
13750
13774
  const getButtonRoleProps = (type) => ({
13751
13775
  type: type ?? 'button',
13752
13776
  });
@@ -44897,6 +44921,11 @@ const NumberedStepCard = ({ step, title, description, className, }) => {
44897
44921
  return (jsxRuntime.jsxs("div", { className: cn('flex flex-col gap-3 rounded-xl border border-border bg-card p-4', className), children: [jsxRuntime.jsx("span", { className: "inline-flex h-6 w-6 items-center justify-center rounded-full bg-primary text-xs font-medium text-primary-foreground", children: step }), jsxRuntime.jsxs("div", { className: "space-y-1", children: [jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: title }), jsxRuntime.jsx("p", { className: "text-xs leading-snug text-label", children: description })] })] }));
44898
44922
  };
44899
44923
 
44924
+ /** Fills the content area with the brand loader while a page loads. */
44925
+ function PageLoader({ logoSrc, className }) {
44926
+ return (jsxRuntime.jsxs("div", { role: "status", "aria-live": "polite", className: cn('flex min-h-full flex-1 items-center justify-center', className), children: [jsxRuntime.jsx(BrandLoader, { logoSrc: logoSrc }), jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })] }));
44927
+ }
44928
+
44900
44929
  /** Options with a description get the taller layout with an icon badge (default variant only). */
44901
44930
  function hasDetails(variant, hasDescription) {
44902
44931
  return variant === 'default' && hasDescription;
@@ -73831,6 +73860,21 @@ const SpecList = ({ rows, zebra = true, className, }) => {
73831
73860
  }) }));
73832
73861
  };
73833
73862
 
73863
+ // A thin white glow traces the gem so the green reads on the dark scrim in both themes.
73864
+ const GEM_EDGE_GLOW_CLASS = '[filter:drop-shadow(0_0_1px_rgb(255_255_255/0.6))_drop-shadow(0_0_6px_rgb(255_255_255/0.15))]';
73865
+
73866
+ /**
73867
+ * Full-screen scrim with the brand loader and a short label, shown while a
73868
+ * submit request is in flight. Sits above dialogs and slide-outs (z-50), since
73869
+ * some submits start from one. `pointer-events-auto` because an open Radix
73870
+ * dialog sets `pointer-events: none` on body, which would let clicks through.
73871
+ */
73872
+ function SubmittingOverlay({ open, label, logoSrc }) {
73873
+ if (!open)
73874
+ return null;
73875
+ return ReactDOM.createPortal(jsxRuntime.jsx("div", { role: "status", "aria-live": "polite", "aria-busy": true, className: "pointer-events-auto fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-4", children: [jsxRuntime.jsx("div", { className: GEM_EDGE_GLOW_CLASS, children: jsxRuntime.jsx(BrandLoader, { logoSrc: logoSrc, tone: "inverse" }) }), jsxRuntime.jsx("p", { className: "text-base font-medium tracking-wide text-white", children: label })] }) }), document.body);
73876
+ }
73877
+
73834
73878
  const usePageJump = (totalPages, onPageChange) => {
73835
73879
  const [pageInput, setPageInputState] = React.useState('');
73836
73880
  const setPageInput = React.useCallback((v) => {
@@ -81183,8 +81227,10 @@ exports.AuditEntryCard = AuditEntryCard;
81183
81227
  exports.AuditHistoryPanel = AuditHistoryPanel;
81184
81228
  exports.AuditTimeline = AuditTimeline;
81185
81229
  exports.AuditTimelineShimmer = AuditTimelineShimmer;
81230
+ exports.BRAND_LOADER_RINGS = BRAND_LOADER_RINGS;
81186
81231
  exports.Badge = Badge;
81187
81232
  exports.BadgeType = BadgeType;
81233
+ exports.BrandLoader = BrandLoader;
81188
81234
  exports.BusinessContactStatusFilter = BusinessContactStatusFilter;
81189
81235
  exports.Button = Button;
81190
81236
  exports.CUSTOMER_AUDIT_CONFIG = CUSTOMER_AUDIT_CONFIG;
@@ -81315,6 +81361,7 @@ exports.OwnershipFilter = OwnershipFilter;
81315
81361
  exports.OwnershipSplitCard = OwnershipSplitCard;
81316
81362
  exports.PROFORMA_AUDIT_CONFIG = PROFORMA_AUDIT_CONFIG;
81317
81363
  exports.PageHeader = PageHeader;
81364
+ exports.PageLoader = PageLoader;
81318
81365
  exports.PageTabs = PageTabs;
81319
81366
  exports.Pagination = Pagination;
81320
81367
  exports.PaginationSelect = PaginationSelect;
@@ -81383,6 +81430,7 @@ exports.StatusBadge = StatusBadge$1;
81383
81430
  exports.StatusFilter = StatusFilter;
81384
81431
  exports.Stepper = Stepper;
81385
81432
  exports.StockTypeFilter = StockTypeFilter;
81433
+ exports.SubmittingOverlay = SubmittingOverlay;
81386
81434
  exports.TableEmptyState = TableEmptyState;
81387
81435
  exports.TablePagination = TablePagination;
81388
81436
  exports.TableRowsSkeleton = TableRowsSkeleton;