@nimbus-ds/patterns 1.34.1 → 1.36.0-rc.1

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 (56) hide show
  1. package/package.json +1 -1
  2. package/dist/AppShell/index.d.ts +0 -109
  3. package/dist/AppShell/index.js +0 -2
  4. package/dist/CHANGELOG.md +0 -538
  5. package/dist/Calendar/index.d.ts +0 -44
  6. package/dist/Calendar/index.js +0 -2
  7. package/dist/CalloutCard/index.d.ts +0 -43
  8. package/dist/CalloutCard/index.js +0 -2
  9. package/dist/ChatInput/index.d.ts +0 -89
  10. package/dist/ChatInput/index.js +0 -2
  11. package/dist/DataList/index.d.ts +0 -49
  12. package/dist/DataList/index.js +0 -2
  13. package/dist/DataTable/index.d.ts +0 -201
  14. package/dist/DataTable/index.js +0 -2
  15. package/dist/Editor/index.d.ts +0 -65
  16. package/dist/Editor/index.js +0 -2
  17. package/dist/EmptyApp/index.d.ts +0 -65
  18. package/dist/EmptyApp/index.js +0 -2
  19. package/dist/EmptyMessage/index.d.ts +0 -38
  20. package/dist/EmptyMessage/index.js +0 -2
  21. package/dist/FormField/index.d.ts +0 -63
  22. package/dist/FormField/index.js +0 -2
  23. package/dist/HelpLink/index.d.ts +0 -20
  24. package/dist/HelpLink/index.js +0 -2
  25. package/dist/InitialScreen/index.d.ts +0 -138
  26. package/dist/InitialScreen/index.js +0 -2
  27. package/dist/InteractiveList/index.d.ts +0 -133
  28. package/dist/InteractiveList/index.js +0 -2
  29. package/dist/Layout/index.d.ts +0 -33
  30. package/dist/Layout/index.js +0 -2
  31. package/dist/Menu/index.d.ts +0 -151
  32. package/dist/Menu/index.js +0 -2
  33. package/dist/MenuButton/index.d.ts +0 -101
  34. package/dist/MenuButton/index.js +0 -2
  35. package/dist/NavTabs/index.d.ts +0 -46
  36. package/dist/NavTabs/index.js +0 -2
  37. package/dist/Page/index.d.ts +0 -48
  38. package/dist/Page/index.js +0 -2
  39. package/dist/PlanDisplay/index.d.ts +0 -72
  40. package/dist/PlanDisplay/index.js +0 -2
  41. package/dist/ProductDataList/index.d.ts +0 -208
  42. package/dist/ProductDataList/index.js +0 -2
  43. package/dist/ProductUpdates/index.d.ts +0 -79
  44. package/dist/ProductUpdates/index.js +0 -2
  45. package/dist/README.md +0 -235
  46. package/dist/SideModal/index.d.ts +0 -73
  47. package/dist/SideModal/index.js +0 -2
  48. package/dist/Sortable/index.d.ts +0 -140
  49. package/dist/Sortable/index.js +0 -2
  50. package/dist/SummaryStats/index.d.ts +0 -238
  51. package/dist/SummaryStats/index.js +0 -2
  52. package/dist/ThumbnailWithAction/index.d.ts +0 -31
  53. package/dist/ThumbnailWithAction/index.js +0 -2
  54. package/dist/components-props.json +0 -1
  55. package/dist/index.d.ts +0 -1672
  56. package/dist/index.js +0 -2
@@ -1,73 +0,0 @@
1
- // Generated by dts-bundle-generator v8.1.2
2
-
3
- import { ButtonProperties, ButtonProps, SidebarProperties } from '@nimbus-ds/components';
4
- import React from 'react';
5
- import { HTMLAttributes, ReactNode } from 'react';
6
-
7
- export type SideModalPadding = "none" | "base";
8
- export interface SideModalProperties extends Pick<SidebarProperties, "position" | "onRemove" | "open" | "padding" | "maxWidth" | "zIndex" | "needRemoveScroll" | "ignoreAttributeName"> {
9
- /**
10
- * Choose where the portal should render. Defaults to viewport (body).
11
- */
12
- /**
13
- * Title.
14
- */
15
- title?: string;
16
- /**
17
- * Action Title
18
- * @TJS-type React.ReactNode
19
- */
20
- titleAction?: ReactNode;
21
- /**
22
- * Action Header
23
- * @TJS-type React.ReactNode
24
- */
25
- headerAction?: ReactNode;
26
- /**
27
- * Icon Header
28
- * @TJS-type React.ReactNode
29
- */
30
- headerIcon?: ReactNode;
31
- /**
32
- * Body Content
33
- * @TJS-type React.ReactNode
34
- */
35
- children?: ReactNode;
36
- /**
37
- * Header padding.
38
- */
39
- paddingHeader?: SideModalPadding;
40
- /**
41
- * Body padding.
42
- */
43
- paddingBody?: SideModalPadding;
44
- /**
45
- * Footer padding.
46
- */
47
- paddingFooter?: SideModalPadding;
48
- /**
49
- * Footer element actions.
50
- */
51
- footer?: {
52
- primaryAction: ButtonProperties;
53
- secondaryAction: ButtonProperties;
54
- };
55
- }
56
- export type SideModalProps = SideModalProperties & {
57
- footer?: {
58
- primaryAction: ButtonProps;
59
- secondaryAction: ButtonProps;
60
- };
61
- /**
62
- * Choose where the portal should render. Defaults to the viewport (document.body).
63
- * Useful to scope the modal within a specific container (e.g., AppShell.Chat).
64
- */
65
- root?: HTMLElement | null;
66
- } & HTMLAttributes<HTMLElement>;
67
- export declare const SideModal: React.FC<SideModalProps>;
68
-
69
- export {
70
- SideModal as default,
71
- };
72
-
73
- export {};
@@ -1,2 +0,0 @@
1
- "use client";
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nimbus-ds/components")):"function"==typeof define&&define.amd?define(["react","@nimbus-ds/components"],t):"object"==typeof exports?exports["@nimbus-ds/patterns"]=t(require("react"),require("@nimbus-ds/components")):e["@nimbus-ds/patterns"]=t(e.react,e["@nimbus-ds/components"])}(global,((e,t)=>(()=>{"use strict";var r={4765:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SideModal=void 0;const n=r(5163).__importDefault(r(8156)),o=r(5280),a=({title:e,titleAction:t,headerAction:r,headerIcon:a,paddingHeader:i,paddingBody:c,paddingFooter:u,footer:l,children:f,...s})=>n.default.createElement(o.Sidebar,{...s},n.default.createElement(o.Sidebar.Header,{padding:i||"base"},n.default.createElement(o.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:"4"},r,a),n.default.createElement(o.Box,{display:"flex",justifyContent:"space-between",alignItems:"center"},n.default.createElement(o.Title,{as:"h2"},e),t)),n.default.createElement(o.Sidebar.Body,{padding:c},f),!!l&&n.default.createElement(o.Sidebar.Footer,{padding:u||"base"},n.default.createElement(o.Button,{...l.primaryAction}),n.default.createElement(o.Button,{...l.secondaryAction})));t.SideModal=a,a.displayName="SideModal"},5163:(e,t,r)=>{r.r(t),r.d(t,{__assign:()=>a,__asyncDelegator:()=>P,__asyncGenerator:()=>S,__asyncValues:()=>x,__await:()=>j,__awaiter:()=>y,__classPrivateFieldGet:()=>A,__classPrivateFieldIn:()=>C,__classPrivateFieldSet:()=>B,__createBinding:()=>v,__decorate:()=>c,__esDecorate:()=>l,__exportStar:()=>h,__extends:()=>o,__generator:()=>b,__importDefault:()=>M,__importStar:()=>I,__makeTemplateObject:()=>E,__metadata:()=>d,__param:()=>u,__propKey:()=>s,__read:()=>_,__rest:()=>i,__runInitializers:()=>f,__setFunctionName:()=>p,__spread:()=>w,__spreadArray:()=>O,__spreadArrays:()=>g,__values:()=>m});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function c(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function u(e,t){return function(r,n){t(r,n,e)}}function l(e,t,r,n,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var c,u=n.kind,l="getter"===u?"get":"setter"===u?"set":"value",f=!t&&e?n.static?e:e.prototype:null,s=t||(f?Object.getOwnPropertyDescriptor(f,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var y={};for(var b in n)y[b]="access"===b?{}:n[b];for(var b in n.access)y.access[b]=n.access[b];y.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var v=(0,r[d])("accessor"===u?{get:s.get,set:s.set}:s[l],y);if("accessor"===u){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(c=i(v.get))&&(s.get=c),(c=i(v.set))&&(s.set=c),(c=i(v.init))&&o.push(c)}else(c=i(v))&&("field"===u?o.push(c):s[l]=c)}f&&Object.defineProperty(f,n.name,s),p=!0}function f(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function s(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function d(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function y(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function c(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,c)}u((n=n.apply(e,t||[])).next())}))}function b(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var v=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function h(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||v(t,e,r)}function m(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_(arguments[t]));return e}function g(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,c=a.length;i<c;i++,o++)n[o]=a[i];return n}function O(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function j(e){return this instanceof j?(this.v=e,this):new j(e)}function S(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof j?Promise.resolve(r.value.v).then(u,l):f(a[0][2],r)}catch(e){f(a[0][3],e)}var r}function u(e){c("next",e)}function l(e){c("throw",e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function P(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:j(e[n](t)),done:!1}:o?o(t):t}:o}}function x(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=m(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function I(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&v(t,e,r);return T(t,e),t}function M(e){return e&&e.__esModule?e:{default:e}}function A(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function B(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function C(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},5280:e=>{e.exports=t},8156:t=>{t.exports=e}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0}),e.SideModal=void 0;const t=o(4765);var r=o(4765);Object.defineProperty(e,"SideModal",{enumerable:!0,get:function(){return r.SideModal}}),e.default=t.SideModal})(),a})()));
@@ -1,140 +0,0 @@
1
- // Generated by dts-bundle-generator v8.1.2
2
-
3
- import { DndContextProps, DragEndEvent, DragOverEvent, DragOverlayProps, DragStartEvent, DraggableAttributes, PointerSensorOptions, UniqueIdentifier } from '@dnd-kit/core';
4
- import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
5
- import React from 'react';
6
- import { CSSProperties, ReactElement, ReactNode } from 'react';
7
-
8
- declare const orientation: {
9
- readonly vertical: "vertical";
10
- readonly horizontal: "horizontal";
11
- };
12
- /**
13
- * Base type for items that can be sorted
14
- */
15
- export type SortableItemType = {
16
- /** Unique identifier for the sortable item */
17
- id: UniqueIdentifier;
18
- };
19
- export type InternalDndContextSettings = Omit<DndContextProps, "children" | "sensors" | "collisionDetection" | "onDragStart" | "onDragOver" | "onDragEnd">;
20
- /**
21
- * Properties specific to the Sortable component
22
- */
23
- export interface SortableProperties<T extends SortableItemType> {
24
- /** The children components */
25
- children: ReactNode;
26
- /** Whether to disable sorting functionality */
27
- disabled?: boolean;
28
- /** The items to be sorted */
29
- items: T[];
30
- /** Callback fired when items are reordered */
31
- onReorder: (items: T[]) => void;
32
- /** Callback fired when drag starts */
33
- onDragStart?: (event: DragStartEvent) => void;
34
- /** Callback fired during drag */
35
- onDragOver?: (event: DragOverEvent) => void;
36
- /** Callback fired when drag ends */
37
- onDragEnd?: (event: DragEndEvent) => void;
38
- /** The orientation of the sortable list */
39
- orientation?: typeof orientation.vertical | typeof orientation.horizontal;
40
- /**
41
- * Custom sensor options for drag detection
42
- * @example
43
- * ```tsx
44
- * <Sortable
45
- * sensorOptions={{
46
- * activationConstraint: {
47
- * distance: 20, // Allow movements up to 20px
48
- * delay: 150, // Wait 150ms before canceling
49
- * tolerance: 5 // Tolerate 5px of movement
50
- * }
51
- * }}
52
- * >
53
- * ```
54
- */
55
- sensorOptions?: PointerSensorOptions;
56
- /** Configuration for the drag overlay appearance and behavior */
57
- overlaySettings?: Omit<DragOverlayProps, "wrapperElement" | "style">;
58
- /** Settings for the DndContext */
59
- dndContextSettings?: Omit<InternalDndContextSettings, "accessibility">;
60
- /** Render function for the dragged item overlay */
61
- renderOverlay?: (item: T) => ReactNode;
62
- }
63
- export type SortableProps<T extends SortableItemType> = SortableProperties<T> & {
64
- /** Configuration for the drag overlay appearance and behavior */
65
- overlaySettings?: DragOverlayProps;
66
- /** Settings for the DndContext */
67
- dndContextSettings?: InternalDndContextSettings;
68
- };
69
- export interface RenderItemProps {
70
- /** Drag attributes required for drag functionality */
71
- attributes: DraggableAttributes;
72
- /** Event listeners for drag functionality */
73
- listeners: SyntheticListenerMap | undefined;
74
- /** Reference setter for the draggable node */
75
- setNodeRef: (node: HTMLElement | null) => void;
76
- /** Style properties for drag animation */
77
- style: CSSProperties;
78
- /** Whether the item is currently being dragged */
79
- isDragging: boolean;
80
- }
81
- export interface SortableItemProperties {
82
- /** The unique identifier for the item */
83
- id: UniqueIdentifier;
84
- /** Whether the item is disabled from being dragged */
85
- disabled?: boolean;
86
- /** Custom drag handle selector */
87
- handle?: boolean;
88
- /** The children components */
89
- children?: ReactNode;
90
- /** Optional render function that receives drag state and handlers, useful for fully customizing the item */
91
- renderItem?: (props: RenderItemProps) => ReactElement;
92
- }
93
- export type SortableItemProps = SortableItemProperties & ({
94
- children: ReactNode;
95
- renderItem?: undefined;
96
- } | {
97
- children?: undefined;
98
- renderItem: (props: RenderItemProps) => ReactElement;
99
- });
100
- export declare const SortableItem: React.FC<SortableItemProps>;
101
- export type SortableItemHandleProperties = {
102
- /**
103
- * The content of the SortableItemHandle component
104
- */
105
- children: ReactNode;
106
- };
107
- export declare const SortableItemHandle: {
108
- ({ children, }: SortableItemHandleProperties): React.ReactElement;
109
- displayName: string;
110
- };
111
- /**
112
- * A component that provides drag and drop sorting functionality
113
- * @example
114
- * ```tsx
115
- * const [items, setItems] = useState([{ id: '1', content: 'Item 1' }]);
116
- *
117
- * return (
118
- * <Sortable items={items} onReorder={setItems}>
119
- * <div className="my-sortable-container">
120
- * {items.map((item) => (
121
- * <Sortable.Item key={item.id} id={item.id}>
122
- * {item.content}
123
- * </Sortable.Item>
124
- * ))}
125
- * </div>
126
- * </Sortable>
127
- * );
128
- * ```
129
- */
130
- export declare function Sortable<T extends SortableItemType>({ items, onReorder, orientation, sensorOptions, onDragStart, onDragOver, onDragEnd, disabled, children, overlaySettings, renderOverlay, dndContextSettings, }: SortableProps<T>): React.ReactElement;
131
- export declare namespace Sortable {
132
- var Item: React.FC<SortableItemProps>;
133
- var ItemHandle: {
134
- ({ children, }: SortableItemHandleProperties): React.ReactElement;
135
- displayName: string;
136
- };
137
- var displayName: string;
138
- }
139
-
140
- export {};
@@ -1,2 +0,0 @@
1
- "use client";
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@dnd-kit/core"),require("@dnd-kit/sortable"),require("@dnd-kit/utilities"),require("@nimbus-ds/components")):"function"==typeof define&&define.amd?define(["react","@dnd-kit/core","@dnd-kit/sortable","@dnd-kit/utilities","@nimbus-ds/components"],t):"object"==typeof exports?exports["@nimbus-ds/patterns"]=t(require("react"),require("@dnd-kit/core"),require("@dnd-kit/sortable"),require("@dnd-kit/utilities"),require("@nimbus-ds/components")):e["@nimbus-ds/patterns"]=t(e.react,e["@dnd-kit/core"],e["@dnd-kit/sortable"],e["@dnd-kit/utilities"],e["@nimbus-ds/components"])}(global,((e,t,r,n,o)=>(()=>{"use strict";var a={977:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_OVERLAY_SETTINGS=t.orientation=void 0,t.orientation={vertical:"vertical",horizontal:"horizontal"},t.DEFAULT_OVERLAY_SETTINGS={dropAnimation:{duration:0,easing:"ease"}}},8753:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Sortable=void 0;const n=r(5163).__importStar(r(8156)),o=r(2948),a=r(1762),i=r(421),l=r(977);function c({items:e,onReorder:t,orientation:r="vertical",sensorOptions:i,onDragStart:c,onDragOver:u,onDragEnd:s,disabled:f=!1,children:d,overlaySettings:p=l.DEFAULT_OVERLAY_SETTINGS,renderOverlay:b,dndContextSettings:y}){const[v,m]=(0,n.useState)(null),_=v?e.find((e=>e.id===v)):null,h=(0,o.useSensors)((0,o.useSensor)(o.PointerSensor,{activationConstraint:{distance:8},...i}),(0,o.useSensor)(o.KeyboardSensor,{coordinateGetter:a.sortableKeyboardCoordinates,...i})),S=(0,n.useMemo)((()=>"vertical"===r?a.verticalListSortingStrategy:a.horizontalListSortingStrategy),[r]);return f?n.default.createElement(n.default.Fragment,null,d):n.default.createElement(o.DndContext,{sensors:h,collisionDetection:o.closestCenter,onDragStart:e=>{m(e.active.id),c?.(e)},onDragOver:u,onDragEnd:r=>{const{active:n,over:o}=r;if(o&&n.id!==o.id){const r=e.findIndex((e=>e.id===n.id)),a=e.findIndex((e=>e.id===o.id)),i=[...e],[l]=i.splice(r,1);i.splice(a,0,l),t(i)}m(null),s?.(r)},...y},n.default.createElement(a.SortableContext,{items:e.map((e=>e.id)),strategy:S},d),n.default.createElement(o.DragOverlay,{...p},_&&b?b(_):null))}t.Sortable=c,c.Item=i.SortableItem,c.ItemHandle=i.SortableItemHandle,c.displayName="Sortable",c.Item.displayName="Sortable.Item",c.ItemHandle.displayName="Sortable.ItemHandle"},4932:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5163);n.__exportStar(r(7880),t),n.__exportStar(r(421),t)},6456:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortableItem=void 0;const n=r(5163).__importStar(r(8156)),o=r(1762),a=r(8927),i=r(3750);t.SortableItem=({id:e,disabled:t=!1,handle:r=!1,children:l,renderItem:c})=>{const{attributes:u,listeners:s,setNodeRef:f,setActivatorNodeRef:d,transform:p,transition:b,isDragging:y}=(0,o.useSortable)({id:e,disabled:t}),v=(0,n.useMemo)((()=>({transform:a.CSS.Transform.toString(p),transition:b,touchAction:"none"})),[p,b]),m=(0,n.useMemo)((()=>({setActivatorNodeRef:d,attributes:u,listeners:s})),[d,u,s]);return c?c({isDragging:y,attributes:u,listeners:r?void 0:s,setNodeRef:f,style:v}):n.default.createElement(i.SortableItemContext.Provider,{value:m},n.default.createElement("div",{ref:f,style:v,...!r&&{...u,...s}},l))}},3750:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useSortableItemContext=t.SortableItemContext=void 0;const n=r(8156);t.SortableItemContext=(0,n.createContext)(null);t.useSortableItemContext=()=>{const e=(0,n.useContext)(t.SortableItemContext);if(!e)throw new Error("useSortableItemContext must be used within a SortableItem");return e}},1882:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortableItem=void 0;var n=r(6456);Object.defineProperty(t,"SortableItem",{enumerable:!0,get:function(){return n.SortableItem}})},3429:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortableItemHandle=void 0;const n=r(5163).__importDefault(r(8156)),o=r(5280),a=r(3750),i=({children:e})=>{const{setActivatorNodeRef:t,attributes:r,listeners:i}=(0,a.useSortableItemContext)();return n.default.createElement(o.Box,{...r,...i,ref:t,cursor:"grab"},e)};t.SortableItemHandle=i,i.displayName="SortableItemHandle"},2595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortableItemHandle=void 0;var n=r(3429);Object.defineProperty(t,"SortableItemHandle",{enumerable:!0,get:function(){return n.SortableItemHandle}})},421:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5163);n.__exportStar(r(1882),t),n.__exportStar(r(2595),t)},7880:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Sortable=void 0;const n=r(8753);var o=r(8753);Object.defineProperty(t,"Sortable",{enumerable:!0,get:function(){return o.Sortable}}),t.default=n.Sortable},5163:(e,t,r)=>{r.r(t),r.d(t,{__assign:()=>a,__asyncDelegator:()=>x,__asyncGenerator:()=>j,__asyncValues:()=>P,__await:()=>O,__awaiter:()=>b,__classPrivateFieldGet:()=>D,__classPrivateFieldIn:()=>M,__classPrivateFieldSet:()=>k,__createBinding:()=>v,__decorate:()=>l,__esDecorate:()=>u,__exportStar:()=>m,__extends:()=>o,__generator:()=>y,__importDefault:()=>C,__importStar:()=>T,__makeTemplateObject:()=>I,__metadata:()=>p,__param:()=>c,__propKey:()=>f,__read:()=>h,__rest:()=>i,__runInitializers:()=>s,__setFunctionName:()=>d,__spread:()=>S,__spreadArray:()=>w,__spreadArrays:()=>g,__values:()=>_});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function l(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function c(e,t){return function(r,n){t(r,n,e)}}function u(e,t,r,n,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,c=n.kind,u="getter"===c?"get":"setter"===c?"set":"value",s=!t&&e?n.static?e:e.prototype:null,f=t||(s?Object.getOwnPropertyDescriptor(s,n.name):{}),d=!1,p=r.length-1;p>=0;p--){var b={};for(var y in n)b[y]="access"===y?{}:n[y];for(var y in n.access)b.access[y]=n.access[y];b.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var v=(0,r[p])("accessor"===c?{get:f.get,set:f.set}:f[u],b);if("accessor"===c){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(l=i(v.get))&&(f.get=l),(l=i(v.set))&&(f.set=l),(l=i(v.init))&&o.push(l)}else(l=i(v))&&("field"===c?o.push(l):f[u]=l)}s&&Object.defineProperty(s,n.name,f),d=!0}function s(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function f(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function b(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function l(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,l)}c((n=n.apply(e,t||[])).next())}))}function y(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}var v=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function m(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||v(t,e,r)}function _(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function S(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function g(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,o++)n[o]=a[i];return n}function w(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function O(e){return this instanceof O?(this.v=e,this):new O(e)}function j(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||l(e,t)}))})}function l(e,t){try{(r=o[e](t)).value instanceof O?Promise.resolve(r.value.v).then(c,u):s(a[0][2],r)}catch(e){s(a[0][3],e)}var r}function c(e){l("next",e)}function u(e){l("throw",e)}function s(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}function x(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:O(e[n](t)),done:!1}:o?o(t):t}:o}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=_(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function I(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var E=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function T(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&v(t,e,r);return E(t,e),t}function C(e){return e&&e.__esModule?e:{default:e}}function D(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function k(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function M(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},2948:e=>{e.exports=t},1762:e=>{e.exports=r},8927:e=>{e.exports=n},5280:e=>{e.exports=o},8156:t=>{t.exports=e}},i={};function l(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return a[e](r,r.exports,l),r.exports}return l.d=(e,t)=>{for(var r in t)l.o(t,r)&&!l.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l(4932)})()));
@@ -1,238 +0,0 @@
1
- // Generated by dts-bundle-generator v8.1.2
2
-
3
- import React from 'react';
4
- import { HTMLAttributes, ReactNode } from 'react';
5
-
6
- /** Trend direction for the indicator (up, down, or neutral). */
7
- export type TrendDirection = "up" | "down" | "neutral";
8
- export interface SummaryStatsTrendIndicatorProperties {
9
- /**
10
- * The text to display (e.g., "8%", "+15%").
11
- */
12
- text?: string;
13
- /**
14
- * The direction of the trend.
15
- */
16
- trend: TrendDirection;
17
- }
18
- export type SummaryStatsTrendIndicatorProps = SummaryStatsTrendIndicatorProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
19
- /**
20
- * Props for the SummaryStatsItem component.
21
- *
22
- * Defines the props used to render a single stat: a primary value, description,
23
- * optional trend indicator, optional tooltip, and optional expandable content
24
- * (children). Used by the SummaryStatsItem component to display one metric in
25
- * a summary stats row.
26
- *
27
- * @see SummaryStatsItem - Component that consumes these props.
28
- * @property children - Optional ReactNode rendered in the expandable area when this stat is active.
29
- */
30
- export interface SummaryStatsItemProperties {
31
- /**
32
- * The main value to display (e.g., "$0.00", "156").
33
- */
34
- value: string;
35
- /**
36
- * Brief text that identifies the metric.
37
- */
38
- description: string;
39
- /**
40
- * Trend indicator showing the change direction.
41
- */
42
- trend?: TrendDirection;
43
- /**
44
- * Text describing the trend or change (e.g., "+15%", "-5%", "0%").
45
- */
46
- trendText?: string;
47
- /**
48
- * Tooltip content for the info icon. If provided, displays an info icon.
49
- */
50
- infoTooltip?: string;
51
- /**
52
- * Content to display when this stat is active (for expandable variant).
53
- * This content will be rendered in the expandable area below the stats row.
54
- * @TJS-type React.ReactNode
55
- */
56
- children?: ReactNode;
57
- }
58
- export type SummaryStatsItemProps = SummaryStatsItemProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
59
- /**
60
- * A single stat card for the SummaryStats component. Renders a stat display with a
61
- * primary value and description, an optional trend indicator (up/down/neutral with
62
- * text), and an optional info icon with tooltip. When used inside an expandable
63
- * SummaryStats, the stat is clickable and reveals additional content (children) in
64
- * an expandable area below the stats row.
65
- *
66
- * **Returns:** A stat display (Box-based layout) showing value and description,
67
- * with optional trend indicator and info tooltip. In expandable mode it behaves as
68
- * a button that toggles the expanded content.
69
- *
70
- * **Required props:** `value`, `description`.
71
- * **Optional props:** `trend`, `trendText`, `infoTooltip`, `children`,
72
- * and any valid HTML element attributes (rest props).
73
- *
74
- * @param props - SummaryStatsItemProps
75
- * @param props.value - **Required.** Main value to display (e.g. "$1,000", "156").
76
- * Type: `string`.
77
- * @param props.description - **Required.** Short label for the metric (e.g. "Total Sales").
78
- * Type: `string`.
79
- * @param props.trend - **Optional.** Trend direction for the indicator. Type: `"up" | "down" | "neutral"`.
80
- * When set, a trend icon and optional `trendText` are shown next to the value.
81
- * @param props.trendText - **Optional.** Text shown next to the trend icon (e.g. "15%", "-8%").
82
- * Type: `string`. Meaningful when `trend` is provided.
83
- * @param props.infoTooltip - **Optional.** If provided, an info icon is shown next to the
84
- * description; hovering shows this string as tooltip content. Type: `string`.
85
- * @param props.children - **Optional.** Content rendered in the expandable area when this
86
- * stat is active (only when SummaryStats has `expandable`). Type: `ReactNode`.
87
- * @param props.aria-label - **Optional.** Accessible label for the stat element. Forwarded
88
- * to the inner interactive element (the one with `role="button"` in expandable mode).
89
- * Clients should provide their own for localization. Type: `string`.
90
- * @param props - **Rest.** Any other HTML element attributes (e.g. `data-*`, `aria-*`)
91
- * are forwarded to the root Box element.
92
- *
93
- * @example
94
- * // Basic stat with trend
95
- * <SummaryStats>
96
- * <SummaryStats.Item
97
- * value="$1,000"
98
- * description="Total Sales"
99
- * trend="up"
100
- * trendText="15%"
101
- * />
102
- * </SummaryStats>
103
- *
104
- * @example
105
- * // Stat with info tooltip
106
- * <SummaryStats>
107
- * <SummaryStats.Item
108
- * value="156"
109
- * description="Orders"
110
- * infoTooltip="Total orders in the last 30 days."
111
- * />
112
- * </SummaryStats>
113
- *
114
- * @example
115
- * // Expandable stat with children
116
- * <SummaryStats expandable>
117
- * <SummaryStats.Item value="$1,000" description="Total Sales">
118
- * <Chart />
119
- * </SummaryStats.Item>
120
- * </SummaryStats>
121
- */
122
- export declare const SummaryStatsItem: React.FC<SummaryStatsItemProps>;
123
- export declare const trendConfig: {
124
- up: {
125
- icon: React.FC<import("@nimbus-ds/icons").IconProps>;
126
- color: "success-interactivePressed";
127
- label: string;
128
- };
129
- down: {
130
- icon: React.FC<import("@nimbus-ds/icons").IconProps>;
131
- color: "danger-interactive";
132
- label: string;
133
- };
134
- neutral: {
135
- icon: null;
136
- color: "neutral-textLow";
137
- label: string;
138
- };
139
- };
140
- /**
141
- * SummaryStatsTrendIndicator displays a trend direction (up, down, or neutral) with
142
- * an icon and optional text, using semantic colors from trendConfig. Typically used
143
- * inside SummaryStats.Stat to show metric changes.
144
- *
145
- * Renders a Box containing an icon (when not neutral) and optional text, both styled
146
- * according to the trend via trendConfig (ArrowupIcon/ArrowDownIcon, success/danger/neutral colors).
147
- *
148
- * @param props - Props for SummaryStatsTrendIndicator; see SummaryStatsTrendIndicatorProps.
149
- * @param props.className - Optional CSS class name applied to the root element (forwarded via rest).
150
- * @param props.style - Optional inline styles for the root element (forwarded via rest).
151
- * @param props.trend - Direction of the trend: "up" | "down" | "neutral"; drives icon and color.
152
- * @param props.text - Optional label to show next to the icon (e.g. "8%", "+15%").
153
- * @param props.rest - Remaining HTML attributes (excluding color) spread onto the root Box.
154
- * @returns JSX element: a Box with icon and optional Text, with aria-label from trendConfig.
155
- */
156
- export declare const SummaryStatsTrendIndicator: React.FC<SummaryStatsTrendIndicatorProps>;
157
- /**
158
- * Layout variant for the SummaryStats container.
159
- * - "horizontal": single row (optionally with scroll/expand).
160
- * - "grid": 2-column grid.
161
- */
162
- export type SummaryStatsLayout = "horizontal" | "grid";
163
- /**
164
- * Subcomponents exposed on SummaryStats (e.g. SummaryStats.Item).
165
- * Use {@link SummaryStatsItem} for the Item subcomponent type and API.
166
- */
167
- export interface SummaryStatsComponents {
168
- Item: typeof SummaryStatsItem;
169
- }
170
- /**
171
- * Props specific to SummaryStats. Children should be {@link SummaryStatsItem}
172
- * nodes (SummaryStats.Item). Layout is "horizontal" (default) or "grid".
173
- * Defaults: layout "horizontal", expandable false.
174
- *
175
- * Supports both controlled and uncontrolled modes for the active stat:
176
- * - **Uncontrolled** (default): omit `activeStatId` and the component manages
177
- * active state internally.
178
- * - **Controlled**: pass `activeStatId` and `onActiveStatIdChange` to manage
179
- * the active stat externally (e.g. for routing, analytics, or persistence).
180
- */
181
- export interface SummaryStatsProperties {
182
- /**
183
- * Content to be rendered inside the SummaryStats component.
184
- * Composed of SummaryStats.Item subcomponents.
185
- * @TJS-type React.ReactNode
186
- */
187
- children: ReactNode;
188
- /**
189
- * Layout variant for the stats container.
190
- * - "horizontal": Items in a single row (2-6 items recommended).
191
- * - "grid": Items in a 2-column grid layout (2 or 4 items recommended).
192
- * @default "horizontal"
193
- */
194
- layout?: SummaryStatsLayout;
195
- /**
196
- * Enables expandable mode where stats can be clicked to show additional content.
197
- * @default false
198
- */
199
- expandable?: boolean;
200
- /**
201
- * The id of the currently active stat (controlled mode).
202
- * When provided, the component becomes controlled and `onActiveStatIdChange`
203
- * should be used to handle state changes. Pass `null` for no active stat.
204
- */
205
- activeStatId?: string | null;
206
- /**
207
- * Callback fired when the active stat changes (controlled mode).
208
- * Receives the new active stat id, or `null` when the active stat is deselected.
209
- */
210
- onActiveStatIdChange?: (activeStatId: string | null) => void;
211
- }
212
- /**
213
- * Full props for SummaryStats: {@link SummaryStatsProperties} plus HTML element
214
- * attributes (excluding color). Use for the root SummaryStats component.
215
- */
216
- export type SummaryStatsProps = SummaryStatsProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
217
- /**
218
- * SummaryStats displays a set of stat blocks in a configurable layout. Use
219
- * {@link SummaryStatsProps} for the full props type and {@link SummaryStatsComponents}
220
- * for the compound component API (e.g. SummaryStats.Item).
221
- *
222
- * Layout can be horizontal (single row, optionally with scroll/expand) or grid
223
- * (2-column). When layout is "horizontal" and expandable is true, clicking a
224
- * stat toggles an expanded area below showing that stat's extra content.
225
- *
226
- * @param props - See SummaryStatsProps
227
- * @param props.className - Optional CSS class for the root element
228
- * @param props.style - Optional inline styles for the root element
229
- * @param props.children - Stat items, typically SummaryStats.Item components
230
- * @param props.layout - "horizontal" (default) or "grid"; controls row vs grid layout
231
- * @param props.expandable - When true and layout is horizontal, stats are expandable
232
- * @param props.activeStatId - Optional. Controlled active stat id. Pass `null` for none.
233
- * @param props.onActiveStatIdChange - Optional. Callback when active stat changes.
234
- * @param props.rest - Remaining HTML element attributes (spread to root Box)
235
- */
236
- export declare const SummaryStats: React.FC<SummaryStatsProps> & SummaryStatsComponents;
237
-
238
- export {};
@@ -1,2 +0,0 @@
1
- "use client";
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nimbus-ds/components"),require("@nimbus-ds/icons")):"function"==typeof define&&define.amd?define(["react","@nimbus-ds/components","@nimbus-ds/icons"],t):"object"==typeof exports?exports["@nimbus-ds/patterns"]=t(require("react"),require("@nimbus-ds/components"),require("@nimbus-ds/icons")):e["@nimbus-ds/patterns"]=t(e.react,e["@nimbus-ds/components"],e["@nimbus-ds/icons"])}(global,((e,t,r)=>(()=>{"use strict";var n={8302:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useRandomId=void 0;var n=r(2660);Object.defineProperty(t,"useRandomId",{enumerable:!0,get:function(){return n.useRandomId}})},2660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useRandomId=void 0;var n=r(7761);Object.defineProperty(t,"useRandomId",{enumerable:!0,get:function(){return n.useRandomId}})},7761:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useRandomId=void 0;const n=r(8156);t.useRandomId=function(){const e=(0,n.useRef)(null);return e.current??=Math.random().toString(36).substring(2,9),e.current}},9144:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SummaryStats=void 0;const n=r(5163).__importStar(r(8156)),o=r(5280),a=r(6815),i=r(4948),l=({style:e,children:t,layout:r="horizontal",expandable:a=!1,activeStatId:l,onActiveStatIdChange:u,...c})=>{const s="horizontal"===r&&a,d=void 0!==l,[f,m]=(0,n.useState)(null),p=d?l??null:f,[y,b]=(0,n.useState)(new Map),[v,S]=(0,n.useState)([]),[g,h]=(0,n.useState)([]),x=(0,n.useCallback)((e=>{const t=p===e?null:e;d||m(t),u?.(t)}),[p,d,u]),_=(0,n.useCallback)(((e,t,r)=>{b((r=>new Map(r).set(e,t))),r?h((t=>t.includes(e)?t:[...t,e])):S((t=>t.includes(e)?t:[...t,e]))}),[]),w=(0,n.useCallback)((e=>{b((t=>{const r=new Map(t);return r.delete(e),r})),S((t=>t.filter((t=>t!==e)))),h((t=>t.filter((t=>t!==e)))),d||m((t=>t===e?null:t))}),[d]),I=(0,n.useMemo)((()=>s&&null!==p?y.get(p)??null:null),[s,p,y]),O="horizontal"===r,P=(0,n.useMemo)((()=>({activeId:p,onToggle:x,expandable:s,layout:r,registerStat:_,unregisterStat:w,statIds:v,isHorizontalLayout:O,visibleStatIds:v})),[p,x,s,r,_,w,v,O]),j=(0,n.useMemo)((()=>({...P,isScrollPaneBlock:!0,statIds:g,visibleStatIds:g})),[P,g]),C=(0,n.useMemo)((()=>({...P,isScrollPaneBlock:!1})),[P]);return n.default.createElement(i.SummaryStatsContext.Provider,{value:P},n.default.createElement(o.Box,{...c,display:"flex",flexDirection:"column",width:"100%",backgroundColor:"neutral-background",boxShadow:"2",borderRadius:"2",overflow:"hidden"},"grid"===r&&n.default.createElement(o.Box,{display:"grid",alignItems:"stretch",gridTemplateColumns:"1fr 1fr",padding:"1"},t),"horizontal"===r&&n.default.createElement(i.SummaryStatsContext.Provider,{value:j},n.default.createElement(o.Box,{display:{xs:"block",md:"none"}},n.default.createElement(o.ScrollPane,{showGradients:!0,enableGrabScroll:!0},n.default.createElement(o.Box,{display:"flex",flexDirection:"row",alignItems:"stretch"},t)))),"horizontal"===r&&n.default.createElement(i.SummaryStatsContext.Provider,{value:C},n.default.createElement(o.Box,{display:{xs:"none",md:"flex"},flexDirection:"row",alignItems:"stretch",padding:"1"},t)),I&&n.default.createElement(o.Box,{display:"flex",flexDirection:"column",padding:"4",margin:"4",backgroundColor:"neutral-background"},I)))};t.SummaryStats=l,l.Item=a.SummaryStatsItem,l.displayName="SummaryStats",l.Item.displayName="SummaryStats.Item"},6032:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5163);n.__exportStar(r(7052),t),n.__exportStar(r(6815),t)},1412:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SummaryStatsItem=void 0;const n=r(5163).__importStar(r(8156)),o=r(5280),a=r(3215),i=r(8302),l=r(4948),u=r(9420),c=r(9539),s=({style:e,children:t,value:r,description:s,trend:d,trendText:f,infoTooltip:m,"aria-label":p,...y})=>{const b=(0,i.useRandomId)(),{activeId:v,onToggle:S,expandable:g,layout:h,registerStat:x,unregisterStat:_,statIds:w,isHorizontalLayout:I,isScrollPaneBlock:O}=(0,l.useSummaryStatsContext)(!1),P=v===b,j=w.indexOf(b),C="grid"===h&&w.length%2!=0&&w.length>0&&w.at(-1)===b,E="grid"===h&&w.length%2!=0&&w.length>=2&&w.at(-2)===b,T=(0,c.getSeparatorConfig)(j,w,b,h,I);(0,n.useEffect)((()=>(x(b,t,O),()=>{_(b)})),[t,b,x,_,O]);const k=(0,n.useCallback)((()=>{g&&S(b)}),[g,S,b]),M=(0,n.useCallback)((e=>{!g||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),S(b))}),[g,S,b]);return n.default.createElement(o.Box,{...y,display:"flex",flexDirection:"column",backgroundColor:"neutral-background",flex:"1"},n.default.createElement(o.Box,{display:"flex",flexDirection:"row",alignItems:"stretch",flex:"1",paddingLeft:"1",paddingRight:T.paddingRight},n.default.createElement(o.Box,{display:"flex",flexDirection:"column",gap:"1",padding:"2",flex:"1",backgroundColor:{xs:P?"primary-surface":"neutral-background",...g&&{hover:P?"primary-surface":"neutral-surface"}},borderRadius:"2",cursor:g?"pointer":void 0,onClick:k,onKeyDown:M,tabIndex:g?0:void 0,role:g?"button":void 0,"aria-expanded":g?P:void 0,"aria-label":p},n.default.createElement(o.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"2"},n.default.createElement(o.Box,{display:"flex",alignItems:"center",gap:"1"},n.default.createElement(o.Text,{fontSize:"base",fontWeight:"medium",color:"neutral-textHigh"},r),d&&n.default.createElement(u.SummaryStatsTrendIndicator,{trend:d,text:f})),g&&n.default.createElement(c.ExpandableChevron,{isActive:P})),n.default.createElement(o.Box,{display:"flex",alignItems:"center",gap:"1"},n.default.createElement(o.Text,{fontSize:"caption",color:"neutral-textLow"},s),m&&n.default.createElement(o.Tooltip,{content:m,position:"bottom"},n.default.createElement(o.Icon,{source:n.default.createElement(a.InfoCircleIcon,{size:"small"}),color:"neutral-textLow",cursor:"pointer","data-testid":"summary-stats-item-info-icon"})))),T.showVerticalSeparator&&!C&&n.default.createElement(o.Box,{display:T.verticalSeparatorDisplay,alignItems:"center",marginLeft:"1","data-testid":"summary-stats-item-vertical-separator"},n.default.createElement(o.Box,{width:"1px",height:"100%",backgroundColor:"neutral-surfaceDisabled"}))),n.default.createElement(o.Box,{display:E?{xs:"block",md:"block"}:T.showHorizontalSeparator||{xs:"none",md:"none"},width:"100%",height:"1px",backgroundColor:"neutral-surfaceDisabled"}))};t.SummaryStatsItem=s,s.displayName="SummaryStatsItem"},4987:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SummaryStatsItem=void 0;const n=r(1412);var o=r(1412);Object.defineProperty(t,"SummaryStatsItem",{enumerable:!0,get:function(){return o.SummaryStatsItem}}),t.default=n.SummaryStatsItem},9539:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSeparatorConfig=t.ExpandableChevron=void 0;const n=r(5163).__importDefault(r(8156)),o=r(5280),a=r(3215);t.ExpandableChevron=({isActive:e})=>{const t=e?a.ChevronUpIcon:a.ChevronDownIcon;return n.default.createElement(o.Icon,{source:n.default.createElement(t,{size:"small"}),color:"neutral-textLow"})},t.ExpandableChevron.displayName="ExpandableChevron",t.getSeparatorConfig=function(e,t,r,n,o){const a=t.length>0&&t.at(-1)===r,i=(e+1)%2!=0,l=e>=t.length-2,u="grid"===n&&!l;return{showVerticalSeparator:"grid"===n?i:!a,paddingRight:a?"1":void 0,verticalSeparatorDisplay:"grid"===n||o?"flex":{xs:"none",md:"flex"},showHorizontalSeparator:{xs:u||"grid"!==n&&!o&&!a?"block":"none",md:u?"block":"none"}}}},5739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trendConfig=t.SummaryStatsTrendIndicator=void 0;const n=r(5163).__importDefault(r(8156)),o=r(5280),a=r(3215),i={up:{icon:a.ArrowupIcon,color:"success-interactivePressed",label:"increase"},down:{icon:a.ArrowDownIcon,color:"danger-interactive",label:"decrease"},neutral:{icon:null,color:"neutral-textLow",label:"no change"}};t.trendConfig=i;const l=({style:e,trend:t,text:r,...a})=>{const l=i[t];return n.default.createElement(o.Box,{...a,display:"flex",alignItems:"center",gap:"0-5",role:"img","aria-label":l.label},l.icon&&n.default.createElement(o.Icon,{source:n.default.createElement(l.icon,{size:"small"}),color:l.color}),r&&n.default.createElement(o.Text,{fontSize:"caption",color:l.color},r))};t.SummaryStatsTrendIndicator=l,l.displayName="SummaryStatsTrendIndicator"},9420:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trendConfig=t.SummaryStatsTrendIndicator=void 0;var n=r(5739);Object.defineProperty(t,"SummaryStatsTrendIndicator",{enumerable:!0,get:function(){return n.SummaryStatsTrendIndicator}}),Object.defineProperty(t,"trendConfig",{enumerable:!0,get:function(){return n.trendConfig}})},6815:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(5163);n.__exportStar(r(4987),t),n.__exportStar(r(9420),t)},9811:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initialSummaryStatsContextValue=void 0,t.initialSummaryStatsContextValue={activeId:null,isScrollPaneBlock:void 0,onToggle:()=>{},expandable:!1,layout:"horizontal",registerStat:()=>{},unregisterStat:()=>{},statIds:[],isHorizontalLayout:!1,visibleStatIds:[]}},2524:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useSummaryStatsContext=t.SummaryStatsContext=void 0;const n=r(8156),o=r(9811);t.SummaryStatsContext=(0,n.createContext)(void 0);t.useSummaryStatsContext=(e=!0)=>{const r=(0,n.useContext)(t.SummaryStatsContext);if(void 0===r){if(!e)return o.initialSummaryStatsContextValue;throw new Error("useSummaryStatsContext must be used within a SummaryStats component")}return r}},4736:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useSummaryStatsContext=t.SummaryStatsContext=void 0;var n=r(2524);Object.defineProperty(t,"SummaryStatsContext",{enumerable:!0,get:function(){return n.SummaryStatsContext}}),Object.defineProperty(t,"useSummaryStatsContext",{enumerable:!0,get:function(){return n.useSummaryStatsContext}})},4948:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});r(5163).__exportStar(r(4736),t)},7052:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SummaryStats=void 0;const n=r(9144);var o=r(9144);Object.defineProperty(t,"SummaryStats",{enumerable:!0,get:function(){return o.SummaryStats}}),t.default=n.SummaryStats},5163:(e,t,r)=>{r.r(t),r.d(t,{__assign:()=>a,__asyncDelegator:()=>O,__asyncGenerator:()=>I,__asyncValues:()=>P,__await:()=>w,__awaiter:()=>p,__classPrivateFieldGet:()=>k,__classPrivateFieldIn:()=>D,__classPrivateFieldSet:()=>M,__createBinding:()=>b,__decorate:()=>l,__esDecorate:()=>c,__exportStar:()=>v,__extends:()=>o,__generator:()=>y,__importDefault:()=>T,__importStar:()=>E,__makeTemplateObject:()=>j,__metadata:()=>m,__param:()=>u,__propKey:()=>d,__read:()=>g,__rest:()=>i,__runInitializers:()=>s,__setFunctionName:()=>f,__spread:()=>h,__spreadArray:()=>_,__spreadArrays:()=>x,__values:()=>S});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function l(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function u(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,u=n.kind,c="getter"===u?"get":"setter"===u?"set":"value",s=!t&&e?n.static?e:e.prototype:null,d=t||(s?Object.getOwnPropertyDescriptor(s,n.name):{}),f=!1,m=r.length-1;m>=0;m--){var p={};for(var y in n)p[y]="access"===y?{}:n[y];for(var y in n.access)p.access[y]=n.access[y];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var b=(0,r[m])("accessor"===u?{get:d.get,set:d.set}:d[c],p);if("accessor"===u){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(l=i(b.get))&&(d.get=l),(l=i(b.set))&&(d.set=l),(l=i(b.init))&&o.push(l)}else(l=i(b))&&("field"===u?o.push(l):d[c]=l)}s&&Object.defineProperty(s,n.name,d),f=!0}function s(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function m(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function l(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,l)}u((n=n.apply(e,t||[])).next())}))}function y(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(u){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,u])}}}var b=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function v(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||b(t,e,r)}function S(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function h(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function x(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,o++)n[o]=a[i];return n}function _(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function w(e){return this instanceof w?(this.v=e,this):new w(e)}function I(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||l(e,t)}))})}function l(e,t){try{(r=o[e](t)).value instanceof w?Promise.resolve(r.value.v).then(u,c):s(a[0][2],r)}catch(e){s(a[0][3],e)}var r}function u(e){l("next",e)}function c(e){l("throw",e)}function s(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}function O(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:w(e[n](t)),done:!1}:o?o(t):t}:o}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=S(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function j(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var C=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&b(t,e,r);return C(t,e),t}function T(e){return e&&e.__esModule?e:{default:e}}function k(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function M(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},5280:e=>{e.exports=t},3215:e=>{e.exports=r},8156:t=>{t.exports=e}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,a),r.exports}return a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a(6032)})()));
@@ -1,31 +0,0 @@
1
- // Generated by dts-bundle-generator v8.1.2
2
-
3
- import { BoxProperties, ThumbnailProperties, ThumbnailProps } from '@nimbus-ds/components';
4
- import React from 'react';
5
- import { HTMLAttributes, ReactNode } from 'react';
6
-
7
- export interface ThumbnailWithActionProperties {
8
- /**
9
- * Thumbnail component properties.
10
- */
11
- thumbnail: ThumbnailProperties;
12
- /**
13
- * Element to be rendered inside the Thumbnail.
14
- * @TJS-type React.ReactNode
15
- */
16
- children: ReactNode;
17
- /**
18
- * Optional position of the element.
19
- */
20
- contentPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
21
- }
22
- export type ThumbnailWithActionProps = ThumbnailWithActionProperties & {
23
- thumbnail: ThumbnailProps;
24
- } & BoxProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
25
- export declare const ThumbnailWithAction: React.FC<ThumbnailWithActionProps>;
26
-
27
- export {
28
- ThumbnailWithAction as default,
29
- };
30
-
31
- export {};
@@ -1,2 +0,0 @@
1
- "use client";
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("@nimbus-ds/components")):"function"==typeof define&&define.amd?define(["react","@nimbus-ds/components"],e):"object"==typeof exports?exports["@nimbus-ds/patterns"]=e(require("react"),require("@nimbus-ds/components")):t["@nimbus-ds/patterns"]=e(t.react,t["@nimbus-ds/components"])}(global,((t,e)=>(()=>{"use strict";var r={4336:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ThumbnailWithAction=void 0;const n=r(5163).__importDefault(r(8156)),o=r(5280),i=r(2910),a=({style:t,thumbnail:e,children:r,contentPosition:a="top-right",...c})=>{const{top:u,left:l,right:f,bottom:s}=i.contentPositions[a];return n.default.createElement(o.Box,{position:"relative",width:"fit-content",borderRadius:"2",overflow:"hidden"},n.default.createElement(o.Box,{...c,style:t,position:"absolute",zIndex:"100",top:u,left:l,right:f,bottom:s,p:"2"},r),n.default.createElement(o.Thumbnail,{...e}))};e.ThumbnailWithAction=a,a.displayName="ThumbnailWithAction"},2910:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentPositions=void 0,e.contentPositions={"top-left":{top:"0",left:"0",right:void 0,bottom:void 0},"top-right":{top:"0",left:void 0,right:"0",bottom:void 0},"bottom-left":{top:void 0,left:"0",right:void 0,bottom:"0"},"bottom-right":{top:void 0,left:void 0,right:"0",bottom:"0"}}},5163:(t,e,r)=>{r.r(e),r.d(e,{__assign:()=>i,__asyncDelegator:()=>x,__asyncGenerator:()=>P,__asyncValues:()=>S,__await:()=>j,__awaiter:()=>d,__classPrivateFieldGet:()=>M,__classPrivateFieldIn:()=>R,__classPrivateFieldSet:()=>D,__createBinding:()=>h,__decorate:()=>c,__esDecorate:()=>l,__exportStar:()=>v,__extends:()=>o,__generator:()=>b,__importDefault:()=>I,__importStar:()=>A,__makeTemplateObject:()=>T,__metadata:()=>y,__param:()=>u,__propKey:()=>s,__read:()=>_,__rest:()=>a,__runInitializers:()=>f,__setFunctionName:()=>p,__spread:()=>w,__spreadArray:()=>O,__spreadArrays:()=>g,__values:()=>m});var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function a(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function c(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function u(t,e){return function(r,n){e(r,n,t)}}function l(t,e,r,n,o,i){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var c,u=n.kind,l="getter"===u?"get":"setter"===u?"set":"value",f=!e&&t?n.static?t:t.prototype:null,s=e||(f?Object.getOwnPropertyDescriptor(f,n.name):{}),p=!1,y=r.length-1;y>=0;y--){var d={};for(var b in n)d[b]="access"===b?{}:n[b];for(var b in n.access)d.access[b]=n.access[b];d.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(t||null))};var h=(0,r[y])("accessor"===u?{get:s.get,set:s.set}:s[l],d);if("accessor"===u){if(void 0===h)continue;if(null===h||"object"!=typeof h)throw new TypeError("Object expected");(c=a(h.get))&&(s.get=c),(c=a(h.set))&&(s.set=c),(c=a(h.init))&&o.push(c)}else(c=a(h))&&("field"===u?o.push(c):s[l]=c)}f&&Object.defineProperty(f,n.name,s),p=!0}function f(t,e,r){for(var n=arguments.length>2,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0}function s(t){return"symbol"==typeof t?t:"".concat(t)}function p(t,e,r){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function y(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function d(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,c)}u((n=n.apply(t,e||[])).next())}))}function b(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var h=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]};function v(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||h(e,t,r)}function m(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function w(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_(arguments[e]));return t}function g(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,c=i.length;a<c;a++,o++)n[o]=i[a];return n}function O(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function j(t){return this instanceof j?(this.v=t,this):new j(t)}function P(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(t){o[t]&&(n[t]=function(e){return new Promise((function(r,n){i.push([t,e,r,n])>1||c(t,e)}))})}function c(t,e){try{(r=o[t](e)).value instanceof j?Promise.resolve(r.value.v).then(u,l):f(i[0][2],r)}catch(t){f(i[0][3],t)}var r}function u(t){c("next",t)}function l(t){c("throw",t)}function f(t,e){t(e),i.shift(),i.length&&c(i[0][0],i[0][1])}}function x(t){var e,r;return e={},n("next"),n("throw",(function(t){throw t})),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,o){e[n]=t[n]?function(e){return(r=!r)?{value:j(t[n](e)),done:!1}:o?o(e):e}:o}}function S(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=m(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise((function(n,o){(function(t,e,r,n){Promise.resolve(n).then((function(e){t({value:e,done:r})}),e)})(n,o,(e=t[r](e)).done,e.value)}))}}}function T(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var E=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function A(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&h(e,t,r);return E(e,t),e}function I(t){return t&&t.__esModule?t:{default:t}}function M(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function D(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r}function R(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}},5280:t=>{t.exports=e},8156:e=>{e.exports=t}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,o),i.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{var t=i;Object.defineProperty(t,"__esModule",{value:!0}),t.ThumbnailWithAction=void 0;const e=o(4336);var r=o(4336);Object.defineProperty(t,"ThumbnailWithAction",{enumerable:!0,get:function(){return r.ThumbnailWithAction}}),t.default=e.ThumbnailWithAction})(),i})()));