@ssa-ui-kit/core 3.16.4 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7964,6 +7964,8 @@ __webpack_require__.d(__webpack_exports__, {
7964
7964
  BarLineComplexChart: () => (/* reexport */ BarLineComplexChart),
7965
7965
  BigNumberChart: () => (/* reexport */ BigNumberChart),
7966
7966
  BigNumberChartComponent: () => (/* reexport */ BigNumberChartComponent),
7967
+ BreadcrumbMenu: () => (/* reexport */ BreadcrumbMenu),
7968
+ Breadcrumbs: () => (/* reexport */ Breadcrumbs),
7967
7969
  Button: () => (/* reexport */ Button_Button),
7968
7970
  ButtonGroup: () => (/* reexport */ ButtonGroup),
7969
7971
  CandlestickChart: () => (/* reexport */ CandlestickChart),
@@ -7999,8 +8001,8 @@ __webpack_require__.d(__webpack_exports__, {
7999
8001
  DropdownOptions: () => (/* reexport */ DropdownOptions_DropdownOptions),
8000
8002
  DropdownToggle: () => (/* reexport */ DropdownToggle_DropdownToggle),
8001
8003
  Field: () => (/* reexport */ index_parts_namespaceObject),
8004
+ FileAttachment: () => (/* reexport */ FileAttachment_FileAttachment),
8002
8005
  FileUpload: () => (/* reexport */ FileUpload_FileUpload),
8003
- FileUploadItem: () => (/* reexport */ FileUpload_FileUploadItem),
8004
8006
  Filters: () => (/* reexport */ Filters),
8005
8007
  FiltersMultiSelect: () => (/* reexport */ FiltersMultiSelect),
8006
8008
  FiltersMultiSelectEmpty: () => (/* reexport */ FiltersMultiSelectEmpty),
@@ -8164,6 +8166,7 @@ __webpack_require__.d(__webpack_exports__, {
8164
8166
  cancelButtonStyles: () => (/* reexport */ cancelButtonStyles),
8165
8167
  checkboxStyles: () => (/* reexport */ checkboxStyles),
8166
8168
  clearButtonStyles: () => (/* reexport */ clearButtonStyles),
8169
+ deriveBreadcrumbs: () => (/* reexport */ deriveBreadcrumbs),
8167
8170
  filterButtonStyles: () => (/* reexport */ filterButtonStyles),
8168
8171
  globalStyles: () => (/* reexport */ global_namespaceObject),
8169
8172
  highlightInputMatch: () => (/* reexport */ highlightInputMatch),
@@ -8177,6 +8180,7 @@ __webpack_require__.d(__webpack_exports__, {
8177
8180
  styleUtils: () => (/* reexport */ safari_focus_outline_namespaceObject),
8178
8181
  styles: () => (/* reexport */ Tooltip_styles_namespaceObject),
8179
8182
  useAccordionGroupContext: () => (/* reexport */ useAccordionGroupContext),
8183
+ useBreadcrumbs: () => (/* reexport */ useBreadcrumbs),
8180
8184
  useCollapsibleNavBarContext: () => (/* reexport */ useCollapsibleNavBarContext),
8181
8185
  useCollapsibleNavBarItemContext: () => (/* reexport */ useCollapsibleNavBarItemContext),
8182
8186
  useDrawer: () => (/* reexport */ useDrawer),
@@ -18243,6 +18247,836 @@ const IconButton = ({
18243
18247
  };
18244
18248
  ;// ./src/components/IconButton/index.ts
18245
18249
 
18250
+ ;// external "react-router-dom"
18251
+ const external_react_router_dom_namespaceObject = require("react-router-dom");
18252
+ ;// ./src/components/WithLink.tsx
18253
+ function WithLink_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
18254
+
18255
+
18256
+
18257
+ var WithLink_ref = true ? {
18258
+ name: "me5k4h",
18259
+ styles: "text-decoration:none;div{cursor:pointer;}"
18260
+ } : 0;
18261
+ const WithLink = ({
18262
+ link,
18263
+ onClick,
18264
+ children,
18265
+ className
18266
+ }) => link ? (0,jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Link, {
18267
+ to: link,
18268
+ onClick: onClick,
18269
+ className: className,
18270
+ css: WithLink_ref,
18271
+ children: children
18272
+ }) : children;
18273
+ ;// ./src/components/Popover/hooks/usePopover.tsx
18274
+
18275
+
18276
+
18277
+ /**
18278
+ * usePopover - Hook for popover functionality
18279
+ *
18280
+ * Custom hook that provides popover state management, positioning, and interactions.
18281
+ * Handles both controlled and uncontrolled modes, supports multiple interaction types
18282
+ * (click, hover, both), and integrates with Floating UI for positioning and focus management.
18283
+ *
18284
+ * @param options - Popover configuration options
18285
+ * @returns Popover context value with state, positioning, and interaction handlers
18286
+ *
18287
+ * @example
18288
+ * ```tsx
18289
+ * const popover = usePopover({
18290
+ * placement: 'top',
18291
+ * interactionsEnabled: 'click',
18292
+ * modal: false,
18293
+ * });
18294
+ * ```
18295
+ *
18296
+ * @see {@link Popover} - Component that uses this hook
18297
+ */
18298
+ const usePopover = ({
18299
+ initialOpen = false,
18300
+ placement = 'bottom',
18301
+ modal,
18302
+ open: controlledOpen,
18303
+ onOpenChange: setControlledOpen,
18304
+ keyboardHandlers = true,
18305
+ floatingOptions = {},
18306
+ interactionsEnabled = 'click'
18307
+ } = {}) => {
18308
+ const [uncontrolledOpen, setUncontrolledOpen] = external_react_namespaceObject.useState(initialOpen);
18309
+ const [labelId, setLabelId] = external_react_namespaceObject.useState();
18310
+ const [descriptionId, setDescriptionId] = external_react_namespaceObject.useState();
18311
+ const open = controlledOpen ?? uncontrolledOpen;
18312
+ const setOpen = setControlledOpen ?? setUncontrolledOpen;
18313
+ const data = (0,external_floating_ui_react_namespaceObject.useFloating)({
18314
+ placement,
18315
+ open,
18316
+ onOpenChange: setOpen,
18317
+ whileElementsMounted: external_floating_ui_react_namespaceObject.autoUpdate,
18318
+ middleware: [(0,external_floating_ui_react_namespaceObject.offset)(5), (0,external_floating_ui_react_namespaceObject.flip)({
18319
+ crossAxis: placement.includes('-'),
18320
+ padding: 5
18321
+ }), (0,external_floating_ui_react_namespaceObject.shift)({
18322
+ padding: 5
18323
+ })],
18324
+ ...floatingOptions
18325
+ });
18326
+ const context = data.context;
18327
+ const click = (0,external_floating_ui_react_namespaceObject.useClick)(context, {
18328
+ enabled: (0,utils_namespaceObject.isNill)(controlledOpen) && ['click', 'both'].includes(interactionsEnabled),
18329
+ keyboardHandlers
18330
+ });
18331
+ const isControlled = controlledOpen !== undefined;
18332
+ const dismiss = (0,external_floating_ui_react_namespaceObject.useDismiss)(context, {
18333
+ // When controlled, disable referencePress (parent handles toggle) but keep outsidePress
18334
+ referencePress: !isControlled,
18335
+ // Keep outsidePress enabled even in controlled mode
18336
+ outsidePress: true,
18337
+ escapeKey: true,
18338
+ ancestorScroll: !isControlled
18339
+ });
18340
+ const role = (0,external_floating_ui_react_namespaceObject.useRole)(context);
18341
+ const hover = (0,external_floating_ui_react_namespaceObject.useHover)(context, {
18342
+ enabled: (0,utils_namespaceObject.isNill)(controlledOpen) && ['hover', 'both'].includes(interactionsEnabled),
18343
+ handleClose: (0,external_floating_ui_react_namespaceObject.safePolygon)()
18344
+ });
18345
+ const interactionsHooks = [dismiss, role];
18346
+ switch (interactionsEnabled) {
18347
+ case 'click':
18348
+ {
18349
+ interactionsHooks.push(click);
18350
+ break;
18351
+ }
18352
+ case 'hover':
18353
+ {
18354
+ interactionsHooks.push(hover);
18355
+ break;
18356
+ }
18357
+ default:
18358
+ {
18359
+ interactionsHooks.push(click, hover);
18360
+ }
18361
+ }
18362
+ const interactions = (0,external_floating_ui_react_namespaceObject.useInteractions)(interactionsHooks);
18363
+ const result = external_react_namespaceObject.useMemo(() => ({
18364
+ open,
18365
+ setOpen,
18366
+ ...interactions,
18367
+ ...data,
18368
+ modal,
18369
+ labelId,
18370
+ descriptionId,
18371
+ floatingOptions,
18372
+ setLabelId,
18373
+ setDescriptionId
18374
+ }), [open, setOpen, interactions, data, modal, labelId, descriptionId, floatingOptions]);
18375
+ return result;
18376
+ };
18377
+ ;// ./src/components/Popover/hooks/usePopoverContext.tsx
18378
+
18379
+
18380
+ /**
18381
+ * Context for popover components
18382
+ *
18383
+ * Provides popover state and functionality to child components. Created by
18384
+ * Popover component and consumed by PopoverTrigger, PopoverContent, and other
18385
+ * popover sub-components.
18386
+ */
18387
+ const PopoverContext = /*#__PURE__*/external_react_namespaceObject.createContext({});
18388
+
18389
+ /**
18390
+ * usePopoverContext - Hook to access popover context
18391
+ *
18392
+ * Returns the popover context value. Throws an error if used outside of a
18393
+ * Popover component.
18394
+ *
18395
+ * @returns Popover context value with state, positioning, and interaction handlers
18396
+ * @throws Error if used outside of Popover component
18397
+ *
18398
+ * @example
18399
+ * ```tsx
18400
+ * const { open, setOpen, refs } = usePopoverContext();
18401
+ * ```
18402
+ *
18403
+ * @see {@link Popover} - Component that provides this context
18404
+ */
18405
+ const usePopoverContext = () => {
18406
+ const context = external_react_namespaceObject.useContext(PopoverContext);
18407
+ if ((0,utils_namespaceObject.isNill)(context)) {
18408
+ throw new Error('Popover components must be wrapped in <Popover />');
18409
+ }
18410
+ return context;
18411
+ };
18412
+ ;// ./src/components/Popover/Popover.tsx
18413
+
18414
+
18415
+
18416
+
18417
+ /**
18418
+ * Popover - Floating content container component
18419
+ *
18420
+ * A flexible popover system built on Floating UI that provides floating content
18421
+ * containers relative to trigger elements. Uses a compound component pattern with
18422
+ * Popover (root), PopoverTrigger (activator), PopoverContent (display),
18423
+ * PopoverHeading, PopoverDescription, and PopoverClose (content helpers).
18424
+ *
18425
+ * Supports multiple interaction modes (click, hover, both), flexible positioning
18426
+ * with auto-adjustment via Floating UI middleware, modal and non-modal modes,
18427
+ * and comprehensive accessibility features including ARIA attributes and focus
18428
+ * management.
18429
+ *
18430
+ * @category Components
18431
+ * @subcategory Overlay
18432
+ *
18433
+ * @example
18434
+ * ```tsx
18435
+ * // Basic popover on click
18436
+ * <Popover>
18437
+ * <PopoverTrigger>
18438
+ * <Button>Open Popover</Button>
18439
+ * </PopoverTrigger>
18440
+ * <PopoverContent>
18441
+ * <PopoverHeading variant="h4">Popover Title</PopoverHeading>
18442
+ * <PopoverDescription>
18443
+ * This is the popover content with helpful information.
18444
+ * </PopoverDescription>
18445
+ * <PopoverClose>Close</PopoverClose>
18446
+ * </PopoverContent>
18447
+ * </Popover>
18448
+ * ```
18449
+ *
18450
+ * @example
18451
+ * ```tsx
18452
+ * // Popover with hover interaction
18453
+ * <Popover interactionsEnabled="hover">
18454
+ * <PopoverTrigger>
18455
+ * <Icon name="info" />
18456
+ * </PopoverTrigger>
18457
+ * <PopoverContent>
18458
+ * <PopoverHeading variant="h4">Information</PopoverHeading>
18459
+ * <PopoverDescription>
18460
+ * This popover appears on hover.
18461
+ * </PopoverDescription>
18462
+ * </PopoverContent>
18463
+ * </Popover>
18464
+ * ```
18465
+ *
18466
+ * @example
18467
+ * ```tsx
18468
+ * // Popover with custom placement
18469
+ * <Popover placement="top">
18470
+ * <PopoverTrigger>
18471
+ * <Button>Show Above</Button>
18472
+ * </PopoverTrigger>
18473
+ * <PopoverContent>
18474
+ * <PopoverDescription>
18475
+ * This popover appears above the trigger element.
18476
+ * </PopoverDescription>
18477
+ * <PopoverClose>Close</PopoverClose>
18478
+ * </PopoverContent>
18479
+ * </Popover>
18480
+ * ```
18481
+ *
18482
+ * @example
18483
+ * ```tsx
18484
+ * // Advanced positioning with Floating UI middleware
18485
+ * <Popover
18486
+ * placement="top"
18487
+ * floatingOptions={{
18488
+ * middleware: [
18489
+ * offset(10),
18490
+ * flip(),
18491
+ * shift({ padding: 8 }),
18492
+ * ],
18493
+ * }}>
18494
+ * <PopoverTrigger>
18495
+ * <Button>Smart Positioning</Button>
18496
+ * </PopoverTrigger>
18497
+ * <PopoverContent>
18498
+ * <PopoverHeading variant="h4">Smart Positioning</PopoverHeading>
18499
+ * <PopoverDescription>
18500
+ * This popover automatically adjusts its position to stay in view.
18501
+ * </PopoverDescription>
18502
+ * <PopoverClose>Close</PopoverClose>
18503
+ * </PopoverContent>
18504
+ * </Popover>
18505
+ * ```
18506
+ *
18507
+ * @example
18508
+ * ```tsx
18509
+ * // Modal popover with controlled state
18510
+ * <Popover modal open={isOpen} onOpenChange={setIsOpen}>
18511
+ * <PopoverTrigger>
18512
+ * <Button>Open Modal Popover</Button>
18513
+ * </PopoverTrigger>
18514
+ * <PopoverContent>
18515
+ * <PopoverHeading variant="h4">Modal Popover</PopoverHeading>
18516
+ * <PopoverDescription>
18517
+ * This is a modal popover that traps focus.
18518
+ * </PopoverDescription>
18519
+ * <PopoverClose>Close</PopoverClose>
18520
+ * </PopoverContent>
18521
+ * </Popover>
18522
+ * ```
18523
+ *
18524
+ * @see {@link PopoverTrigger} - Trigger element component
18525
+ * @see {@link PopoverContent} - Content display component
18526
+ * @see {@link PopoverHeading} - Accessible heading component
18527
+ * @see {@link PopoverDescription} - Accessible description component
18528
+ * @see {@link PopoverClose} - Close button component
18529
+ *
18530
+ * @accessibility
18531
+ * - Keyboard accessible (ESC to close, Enter/Space to activate)
18532
+ * - Focus management with FloatingFocusManager for modal popovers
18533
+ * - ARIA attributes automatically applied (role, aria-labelledby, aria-describedby)
18534
+ * - Screen reader friendly with semantic heading and description components
18535
+ * - Focus trap for modal popovers
18536
+ */
18537
+
18538
+ const Popover = ({
18539
+ children,
18540
+ modal = false,
18541
+ ...restOptions
18542
+ }) => {
18543
+ // This can accept any props as options, e.g. `placement`,
18544
+ // or other positioning options.
18545
+ const popover = usePopover({
18546
+ modal,
18547
+ ...restOptions
18548
+ });
18549
+ return (0,jsx_runtime_namespaceObject.jsx)(PopoverContext.Provider, {
18550
+ value: popover,
18551
+ children: children
18552
+ });
18553
+ };
18554
+ ;// ./src/components/Popover/PopoverTrigger.tsx
18555
+
18556
+
18557
+
18558
+
18559
+
18560
+ /**
18561
+ * PopoverTrigger - Trigger element for popover
18562
+ *
18563
+ * Activates the popover when interacted with. By default renders as a Button,
18564
+ * but can be customized using the `asChild` prop to render as any React element.
18565
+ * Automatically receives Floating UI reference props for positioning and state
18566
+ * management.
18567
+ *
18568
+ * @category Components
18569
+ * @subcategory Overlay
18570
+ *
18571
+ * @example
18572
+ * ```tsx
18573
+ * // Default Button trigger
18574
+ * <PopoverTrigger>
18575
+ * Open Popover
18576
+ * </PopoverTrigger>
18577
+ * ```
18578
+ *
18579
+ * @example
18580
+ * ```tsx
18581
+ * // Custom element trigger
18582
+ * <PopoverTrigger asChild>
18583
+ * <Icon name="info" />
18584
+ * </PopoverTrigger>
18585
+ * ```
18586
+ *
18587
+ * @see {@link Popover} - Root component
18588
+ * @see {@link PopoverContent} - Content display component
18589
+ */
18590
+ const PopoverTrigger = /*#__PURE__*/external_react_namespaceObject.forwardRef(function PopoverTrigger({
18591
+ children,
18592
+ asChild = false,
18593
+ dataTestId = 'trigger-button',
18594
+ variant = 'primary',
18595
+ ...props
18596
+ }, propRef) {
18597
+ const context = usePopoverContext();
18598
+
18599
+ // `asChild` allows the user to pass any element as the anchor
18600
+ if (asChild && /*#__PURE__*/external_react_namespaceObject.isValidElement(children)) {
18601
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18602
+ const childrenElement = children;
18603
+
18604
+ // Extract ref from children props BEFORE calling getReferenceProps to avoid conflicts
18605
+ // In React 19, refs are regular props, but forwardRef components may not expose them in children.props.ref
18606
+ // We extract it here for backward compatibility
18607
+ const {
18608
+ ref: existingChildrenRef,
18609
+ ...childrenPropsWithoutRef
18610
+ } = childrenElement.props || {};
18611
+
18612
+ // Merge all refs: floating-ui's setReference, children's ref, and propRef
18613
+ // This ensures positioning works while preserving any refs passed to the child component
18614
+ const mergedRef = (0,external_floating_ui_react_namespaceObject.useMergeRefs)([context?.refs.setReference, existingChildrenRef, propRef]);
18615
+
18616
+ // Get reference props from floating-ui - pass the merged ref to it
18617
+ // This ensures floating-ui gets the correct element for positioning
18618
+ const referenceProps = context?.getReferenceProps({
18619
+ ref: mergedRef,
18620
+ ...props,
18621
+ ...childrenPropsWithoutRef,
18622
+ 'data-state': context.open ? 'open' : 'closed'
18623
+ });
18624
+
18625
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18626
+ return /*#__PURE__*/external_react_namespaceObject.cloneElement(children, referenceProps);
18627
+ }
18628
+
18629
+ // For non-asChild case, merge refs normally
18630
+ const childrenRef = /*#__PURE__*/external_react_namespaceObject.isValidElement(children) ? children.props?.ref : undefined;
18631
+ const ref = (0,external_floating_ui_react_namespaceObject.useMergeRefs)([context?.refs.setReference, propRef, childrenRef]);
18632
+ return (0,jsx_runtime_namespaceObject.jsx)(Button_Button, {
18633
+ "data-testid": dataTestId,
18634
+ ref: ref
18635
+ // The user can style the trigger based on the state
18636
+ ,
18637
+ "data-state": context?.open ? 'open' : 'closed',
18638
+ variant: variant,
18639
+ ...context?.getReferenceProps(props),
18640
+ children: children
18641
+ });
18642
+ });
18643
+ ;// ./src/components/Popover/PopoverContent.tsx
18644
+ function PopoverContent_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
18645
+
18646
+
18647
+
18648
+
18649
+
18650
+ var PopoverContent_ref = true ? {
18651
+ name: "3abrc0",
18652
+ styles: "width:auto"
18653
+ } : 0;
18654
+ /**
18655
+ * PopoverContent - Content container for popover
18656
+ *
18657
+ * Renders the actual popover content that appears when the trigger is activated.
18658
+ * Automatically positioned using Floating UI, supports portal rendering, and
18659
+ * includes focus management for modal popovers. Can be configured to unmount
18660
+ * or keep mounted when closed.
18661
+ *
18662
+ * @category Components
18663
+ * @subcategory Overlay
18664
+ *
18665
+ * @example
18666
+ * ```tsx
18667
+ * <PopoverContent>
18668
+ * <PopoverHeading variant="h4">Title</PopoverHeading>
18669
+ * <PopoverDescription>Content goes here</PopoverDescription>
18670
+ * <PopoverClose>Close</PopoverClose>
18671
+ * </PopoverContent>
18672
+ * ```
18673
+ *
18674
+ * @example
18675
+ * ```tsx
18676
+ * // Keep content mounted when closed
18677
+ * <PopoverContent mountMode="keep-mounted">
18678
+ * <div>This stays in DOM when closed</div>
18679
+ * </PopoverContent>
18680
+ * ```
18681
+ *
18682
+ * @see {@link Popover} - Root component
18683
+ * @see {@link PopoverTrigger} - Trigger element component
18684
+ * @see {@link PopoverHeading} - Accessible heading component
18685
+ * @see {@link PopoverDescription} - Accessible description component
18686
+ */
18687
+ const PopoverContent = /*#__PURE__*/external_react_namespaceObject.forwardRef(function PopoverContent({
18688
+ style,
18689
+ isFocusManagerDisabled = false,
18690
+ mountMode = 'unmount',
18691
+ ...props
18692
+ }, propRef) {
18693
+ const {
18694
+ context: floatingContext,
18695
+ ...context
18696
+ } = usePopoverContext();
18697
+ const ref = (0,external_floating_ui_react_namespaceObject.useMergeRefs)([context.refs.setFloating, propRef]);
18698
+ const keepMounted = mountMode === 'keep-mounted';
18699
+ if (!keepMounted && !floatingContext.open) return null;
18700
+ const hidden = keepMounted && !floatingContext.open;
18701
+ return (0,jsx_runtime_namespaceObject.jsx)(external_floating_ui_react_namespaceObject.FloatingPortal, {
18702
+ children: (0,jsx_runtime_namespaceObject.jsx)(external_floating_ui_react_namespaceObject.FloatingFocusManager, {
18703
+ context: floatingContext,
18704
+ modal: context.modal,
18705
+ disabled: isFocusManagerDisabled,
18706
+ children: (0,jsx_runtime_namespaceObject.jsx)(Wrapper_Wrapper, {
18707
+ ref: ref,
18708
+ css: PopoverContent_ref,
18709
+ style: {
18710
+ ...context.floatingStyles,
18711
+ ...(hidden ? {
18712
+ display: 'none',
18713
+ pointerEvents: 'none'
18714
+ } : null),
18715
+ ...style
18716
+ },
18717
+ "aria-labelledby": context.labelId,
18718
+ "aria-describedby": context.descriptionId,
18719
+ direction: "column",
18720
+ ...context.getFloatingProps(props),
18721
+ children: props.children
18722
+ })
18723
+ })
18724
+ });
18725
+ });
18726
+ ;// ./src/components/Breadcrumbs/styles.ts
18727
+ function Breadcrumbs_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
18728
+
18729
+
18730
+ const fontBase = true ? {
18731
+ name: "1206kx8",
18732
+ styles: "font-family:'Manrope',sans-serif;font-size:14px;line-height:18px;letter-spacing:0"
18733
+ } : 0;
18734
+ const nav = true ? {
18735
+ name: "4zleql",
18736
+ styles: "display:block"
18737
+ } : 0;
18738
+ const list = true ? {
18739
+ name: "szqxm1",
18740
+ styles: "display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0;padding:0;list-style:none"
18741
+ } : 0;
18742
+ const styles_item = true ? {
18743
+ name: "8irbms",
18744
+ styles: "display:inline-flex;align-items:center"
18745
+ } : 0;
18746
+ const styles_separator = /*#__PURE__*/(0,react_namespaceObject.css)("display:inline-flex;align-items:center;justify-content:center;color:", themes_main.colors.greyDarker80, ";pointer-events:none;user-select:none;" + ( true ? "" : 0), true ? "" : 0);
18747
+ const crumbLink = /*#__PURE__*/(0,react_namespaceObject.css)(fontBase, ";font-weight:500;color:", themes_main.colors.greyDarker80, ";text-decoration:none;background:none;border:none;padding:0;cursor:pointer;transition:color 0.15s ease;&:hover,&:focus-visible{color:", themes_main.colors.greyDarker, ";}" + ( true ? "" : 0), true ? "" : 0);
18748
+ const crumbText = /*#__PURE__*/(0,react_namespaceObject.css)(fontBase, ";font-weight:500;color:", themes_main.colors.greyDarker80, ";" + ( true ? "" : 0), true ? "" : 0);
18749
+ const crumbCurrent = /*#__PURE__*/(0,react_namespaceObject.css)(fontBase, ";font-weight:600;color:", themes_main.palette.primary.dark, ";" + ( true ? "" : 0), true ? "" : 0);
18750
+ const menu = /*#__PURE__*/(0,react_namespaceObject.css)("display:flex;flex-direction:column;gap:2px;min-width:140px;margin:0;padding:6px;list-style:none;background:", themes_main.colors.white, ";border:1px solid ", themes_main.colors.grey20, ";border-radius:8px;box-shadow:0 8px 24px ", themes_main.colors.greyDarker14, ";" + ( true ? "" : 0), true ? "" : 0);
18751
+ const menuItem = /*#__PURE__*/(0,react_namespaceObject.css)(fontBase, ";font-weight:500;display:block;padding:6px 10px;border-radius:6px;color:", themes_main.colors.greyDarker80, ";text-decoration:none;cursor:pointer;transition:color 0.15s ease,background-color 0.15s ease;&:hover,&:focus-visible{color:", themes_main.colors.greyDarker, ";background-color:", themes_main.colors.blue6, ";}" + ( true ? "" : 0), true ? "" : 0);
18752
+ ;// ./src/components/Breadcrumbs/BreadcrumbMenu.tsx
18753
+
18754
+
18755
+
18756
+
18757
+
18758
+
18759
+ /**
18760
+ * A hover/click popover listing navigable routes. Shared by the collapsed `…`
18761
+ * crumb and, in the route-aware mode, by crumbs that expose sibling routes.
18762
+ */
18763
+ const BreadcrumbMenu = ({
18764
+ trigger,
18765
+ items
18766
+ }) => (0,jsx_runtime_namespaceObject.jsxs)(Popover, {
18767
+ placement: "bottom-start",
18768
+ interactionsEnabled: "both",
18769
+ children: [(0,jsx_runtime_namespaceObject.jsx)(PopoverTrigger, {
18770
+ asChild: true,
18771
+ children: trigger
18772
+ }), (0,jsx_runtime_namespaceObject.jsx)(PopoverContent, {
18773
+ children: (0,jsx_runtime_namespaceObject.jsx)("ul", {
18774
+ css: menu,
18775
+ children: items.map((sibling, index) => (0,jsx_runtime_namespaceObject.jsx)("li", {
18776
+ children: (0,jsx_runtime_namespaceObject.jsx)(WithLink, {
18777
+ link: sibling.to,
18778
+ className: "breadcrumb-menu-item",
18779
+ children: (0,jsx_runtime_namespaceObject.jsx)("span", {
18780
+ css: menuItem,
18781
+ children: sibling.label
18782
+ })
18783
+ })
18784
+ }, index))
18785
+ })
18786
+ })]
18787
+ });
18788
+ ;// ./src/components/Breadcrumbs/utils.ts
18789
+ /** A rendered slot in the trail: either a real crumb or the collapsed `…`. */
18790
+
18791
+ /**
18792
+ * Collapse the trail to `first … last` when it exceeds `maxItems`, per design.
18793
+ * The hidden middle crumbs are returned on the ellipsis entry so they can be
18794
+ * offered from its menu. When `maxItems` is falsy or not exceeded, every item
18795
+ * is returned as-is.
18796
+ */
18797
+ const collapseItems = (items, maxItems) => {
18798
+ if (!maxItems || items.length <= maxItems || items.length <= 2) {
18799
+ return items.map((item, index) => ({
18800
+ type: 'item',
18801
+ item,
18802
+ index
18803
+ }));
18804
+ }
18805
+ const lastIndex = items.length - 1;
18806
+ return [{
18807
+ type: 'item',
18808
+ item: items[0],
18809
+ index: 0
18810
+ }, {
18811
+ type: 'ellipsis',
18812
+ items: items.slice(1, lastIndex)
18813
+ }, {
18814
+ type: 'item',
18815
+ item: items[lastIndex],
18816
+ index: lastIndex
18817
+ }];
18818
+ };
18819
+ ;// ./src/components/Breadcrumbs/Breadcrumbs.tsx
18820
+
18821
+
18822
+
18823
+
18824
+
18825
+
18826
+
18827
+
18828
+ const DefaultSeparator = (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
18829
+ name: "carrot-right",
18830
+ size: 14,
18831
+ color: themes_main.colors.greyDarker80
18832
+ });
18833
+
18834
+ /**
18835
+ * Breadcrumbs — navigational trail of the current page's location.
18836
+ *
18837
+ * Accepts a list of `{ label, to }` items and renders them as react-router
18838
+ * links separated by a chevron, with the current (last) crumb shown as a
18839
+ * non-navigable, emphasised label. When the trail is longer than `maxItems`
18840
+ * it collapses to `first … last`, with the hidden crumbs available from the
18841
+ * `…` menu.
18842
+ *
18843
+ * @example
18844
+ * ```tsx
18845
+ * <Breadcrumbs
18846
+ * maxItems={4}
18847
+ * items={[
18848
+ * { label: 'Home', to: '/' },
18849
+ * { label: 'People', to: '/people' },
18850
+ * { label: 'Jane Doe' },
18851
+ * ]}
18852
+ * />
18853
+ * ```
18854
+ */
18855
+ const Breadcrumbs = ({
18856
+ items,
18857
+ maxItems,
18858
+ separator = DefaultSeparator,
18859
+ ariaLabel = 'Breadcrumb',
18860
+ className,
18861
+ css
18862
+ }) => {
18863
+ if (!items.length) {
18864
+ return null;
18865
+ }
18866
+ const lastIndex = items.length - 1;
18867
+ const entries = collapseItems(items, maxItems);
18868
+ const isCurrent = (item, index) => item.isCurrent ?? index === lastIndex;
18869
+ const renderCrumb = (item, index) => {
18870
+ if (isCurrent(item, index)) {
18871
+ return (0,jsx_runtime_namespaceObject.jsx)("span", {
18872
+ css: crumbCurrent,
18873
+ "aria-current": "page",
18874
+ children: item.label
18875
+ });
18876
+ }
18877
+ const inner = item.to ? (0,jsx_runtime_namespaceObject.jsx)(WithLink, {
18878
+ link: item.to,
18879
+ onClick: item.onClick,
18880
+ children: (0,jsx_runtime_namespaceObject.jsx)("span", {
18881
+ css: crumbLink,
18882
+ children: item.label
18883
+ })
18884
+ }) : item.onClick ? (0,jsx_runtime_namespaceObject.jsx)("button", {
18885
+ type: "button",
18886
+ css: crumbLink,
18887
+ onClick: item.onClick,
18888
+ children: item.label
18889
+ }) : (0,jsx_runtime_namespaceObject.jsx)("span", {
18890
+ css: crumbText,
18891
+ children: item.label
18892
+ });
18893
+ if (item.siblings?.length) {
18894
+ return (0,jsx_runtime_namespaceObject.jsx)(BreadcrumbMenu, {
18895
+ trigger: (0,jsx_runtime_namespaceObject.jsx)("span", {
18896
+ css: styles_item,
18897
+ children: inner
18898
+ }),
18899
+ items: item.siblings
18900
+ });
18901
+ }
18902
+ return inner;
18903
+ };
18904
+ return (0,jsx_runtime_namespaceObject.jsx)("nav", {
18905
+ "aria-label": ariaLabel,
18906
+ css: [nav, css, true ? "" : 0, true ? "" : 0],
18907
+ className: className,
18908
+ children: (0,jsx_runtime_namespaceObject.jsx)("ol", {
18909
+ css: list,
18910
+ children: entries.map((entry, position) => {
18911
+ const isLastEntry = position === entries.length - 1;
18912
+ return (0,jsx_runtime_namespaceObject.jsxs)(external_react_namespaceObject.Fragment, {
18913
+ children: [(0,jsx_runtime_namespaceObject.jsx)("li", {
18914
+ css: styles_item,
18915
+ children: entry.type === 'item' ? renderCrumb(entry.item, entry.index) : (0,jsx_runtime_namespaceObject.jsx)(BreadcrumbMenu, {
18916
+ trigger: (0,jsx_runtime_namespaceObject.jsx)("button", {
18917
+ type: "button",
18918
+ css: crumbLink,
18919
+ "aria-label": "Show hidden breadcrumbs",
18920
+ children: "..."
18921
+ }),
18922
+ items: entry.items.filter(item => item.to).map(item => ({
18923
+ label: item.label,
18924
+ to: item.to
18925
+ }))
18926
+ })
18927
+ }), !isLastEntry && (0,jsx_runtime_namespaceObject.jsx)("li", {
18928
+ css: styles_separator,
18929
+ "aria-hidden": "true",
18930
+ children: separator
18931
+ })]
18932
+ }, entry.type === 'item' ? `item-${entry.index}` : 'ellipsis');
18933
+ })
18934
+ })
18935
+ });
18936
+ };
18937
+ ;// ./src/components/Breadcrumbs/useBreadcrumbs.ts
18938
+
18939
+
18940
+
18941
+ /** Context passed to a route's `crumb` resolver function. */
18942
+
18943
+ /**
18944
+ * Shape read from a route's `handle` to build its crumb. Attach this to routes
18945
+ * in your `createBrowserRouter` config:
18946
+ *
18947
+ * ```ts
18948
+ * { path: 'people', handle: { crumb: 'People' } as BreadcrumbRouteHandle }
18949
+ * ```
18950
+ */
18951
+
18952
+ const getHandle = route => route.handle;
18953
+ const joinPaths = (base, path) => `/${`${base}/${path}`.split('/').filter(Boolean).join('/')}`;
18954
+ const resolveLabel = (route, ctx, getLabel) => {
18955
+ const handle = getHandle(route);
18956
+ if (handle?.hideCrumb) {
18957
+ return undefined;
18958
+ }
18959
+ if (handle?.crumb !== undefined) {
18960
+ return typeof handle.crumb === 'function' ? handle.crumb(ctx) : handle.crumb;
18961
+ }
18962
+ if (handle?.title !== undefined) {
18963
+ return handle.title;
18964
+ }
18965
+ return getLabel?.(route, ctx);
18966
+ };
18967
+ const hasContent = label => label !== undefined && label !== null && label !== false;
18968
+
18969
+ /**
18970
+ * Resolve a sibling route's pattern to a concrete path using the current
18971
+ * params. Returns `null` when the sibling needs params we don't have (it can't
18972
+ * be navigated to from here) so the caller can drop it.
18973
+ */
18974
+ const resolveSiblingPath = (pattern, params) => {
18975
+ try {
18976
+ return (0,external_react_router_dom_namespaceObject.generatePath)(pattern, params);
18977
+ } catch {
18978
+ return null;
18979
+ }
18980
+ };
18981
+ const getSiblings = (siblingRoutes, currentRoute, parentBase, params, getLabel) => siblingRoutes.reduce((acc, route) => {
18982
+ if (route === currentRoute || route.index || !route.path) {
18983
+ return acc;
18984
+ }
18985
+ const pattern = route.path.startsWith('/') ? route.path : joinPaths(parentBase, route.path);
18986
+ const to = resolveSiblingPath(pattern, params);
18987
+ if (to === null) {
18988
+ return acc;
18989
+ }
18990
+ const label = resolveLabel(route, {
18991
+ params,
18992
+ pathname: to
18993
+ }, getLabel);
18994
+ if (!hasContent(label)) {
18995
+ return acc;
18996
+ }
18997
+ acc.push({
18998
+ label,
18999
+ to
19000
+ });
19001
+ return acc;
19002
+ }, []);
19003
+
19004
+ /**
19005
+ * Pure derivation of breadcrumb items from a route tree and a pathname.
19006
+ * Extracted from the hook so it can be unit-tested without a router.
19007
+ */
19008
+ const deriveBreadcrumbs = (routes, pathname, {
19009
+ includeSiblings = true,
19010
+ getLabel
19011
+ } = {}) => {
19012
+ const matches = (0,external_react_router_dom_namespaceObject.matchRoutes)(routes, pathname);
19013
+ if (!matches) {
19014
+ return [];
19015
+ }
19016
+ const items = [];
19017
+ matches.forEach((match, index) => {
19018
+ const ctx = {
19019
+ params: match.params,
19020
+ pathname: match.pathname
19021
+ };
19022
+ const label = resolveLabel(match.route, ctx, getLabel);
19023
+ if (!hasContent(label)) {
19024
+ return;
19025
+ }
19026
+ const item = {
19027
+ label,
19028
+ to: match.pathname
19029
+ };
19030
+ if (includeSiblings) {
19031
+ const parentChildren = index === 0 ? routes : matches[index - 1].route.children ?? [];
19032
+ const parentBase = index === 0 ? '/' : matches[index - 1].pathnameBase;
19033
+ const siblings = getSiblings(parentChildren, match.route, parentBase, match.params, getLabel);
19034
+ if (siblings.length) {
19035
+ item.siblings = siblings;
19036
+ }
19037
+ }
19038
+ items.push(item);
19039
+ });
19040
+
19041
+ // The deepest crumb is the current page.
19042
+ if (items.length) {
19043
+ const last = items[items.length - 1];
19044
+ last.isCurrent = true;
19045
+ delete last.to;
19046
+ delete last.siblings;
19047
+ }
19048
+ return items;
19049
+ };
19050
+
19051
+ /**
19052
+ * Route-aware breadcrumb builder. Reads the current location, matches it
19053
+ * against your route tree, and returns `BreadcrumbItem[]` ready for
19054
+ * `<Breadcrumbs>`. Labels come from each route's `handle.crumb`/`handle.title`;
19055
+ * sibling routes (other children of a crumb's parent) power the hover menu.
19056
+ *
19057
+ * @example
19058
+ * ```tsx
19059
+ * const items = useBreadcrumbs({ routes });
19060
+ * return <Breadcrumbs items={items} maxItems={4} />;
19061
+ * ```
19062
+ */
19063
+ const useBreadcrumbs = ({
19064
+ routes,
19065
+ pathname,
19066
+ includeSiblings = true,
19067
+ getLabel
19068
+ }) => {
19069
+ const location = (0,external_react_router_dom_namespaceObject.useLocation)();
19070
+ const activePathname = pathname ?? location.pathname;
19071
+ return (0,external_react_namespaceObject.useMemo)(() => deriveBreadcrumbs(routes, activePathname, {
19072
+ includeSiblings,
19073
+ getLabel
19074
+ }), [routes, activePathname, includeSiblings, getLabel]);
19075
+ };
19076
+ ;// ./src/components/Breadcrumbs/index.ts
19077
+
19078
+
19079
+
18246
19080
  ;// ./src/components/Label/LabelBase.tsx
18247
19081
 
18248
19082
  const LabelBase = /*#__PURE__*/base_default()("label", true ? {
@@ -20626,11 +21460,11 @@ const multipleStyles = ({
20626
21460
  isOpen
20627
21461
  }) => {
20628
21462
  const borderColor = isOpen ? theme.palette.primary.main : theme.colors.grey;
20629
- return /*#__PURE__*/(0,react_namespaceObject.css)("justify-content:space-between;height:40px;padding:11px 15px 9px 10px;font-size:14px;font-weight:500;color:", theme.colors.greyDarker, ";border:1px solid ", borderColor, ";border-radius:12px;background:", theme.colors.white, ";max-width:250px;svg path{stroke:", theme.colors.greyDarker, ";}&:disabled{background:", theme.colors.greyLighter, ";border-color:", theme.colors.grey, ";color:", theme.colors.greyDarker60, ";cursor:default;svg path{stroke:", theme.colors.grey, ";}}&:focus:not(:disabled){border-color:", theme.palette.primary.main, ";}&:hover:not(:disabled){border-color:", isOpen ? theme.palette.primary.main : theme.colors.greyDarker80, ";}" + ( true ? "" : 0), true ? "" : 0);
21463
+ return /*#__PURE__*/(0,react_namespaceObject.css)("height:40px;padding:11px 15px 9px 10px;font-size:14px;font-weight:500;color:", theme.colors.greyDarker, ";border:1px solid ", borderColor, ";border-radius:12px;background:", theme.colors.white, ";max-width:250px;svg path{stroke:", theme.colors.greyDarker, ";}&:disabled{background:", theme.colors.greyLighter, ";border-color:", theme.colors.grey, ";color:", theme.colors.greyDarker60, ";cursor:default;svg path{stroke:", theme.colors.grey, ";}}&:focus:not(:disabled){border-color:", theme.palette.primary.main, ";}&:hover:not(:disabled){border-color:", isOpen ? theme.palette.primary.main : theme.colors.greyDarker80, ";}" + ( true ? "" : 0), true ? "" : 0);
20630
21464
  };
20631
21465
  const DropdownToggleBase = /*#__PURE__*/base_default()("button", true ? {
20632
21466
  target: "er3kf7h0"
20633
- } : 0)("display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-start;gap:8px;position:relative;width:auto;height:44px;padding:0 14px;font:inherit;font-size:14px;font-weight:500;text-align:left;line-height:18px;cursor:pointer;outline:inherit;border-radius:12px;", ({
21467
+ } : 0)("display:flex;flex-flow:row nowrap;align-items:center;justify-content:space-between;gap:8px;position:relative;width:auto;height:44px;padding:0 14px;font:inherit;font-size:14px;font-weight:500;text-align:left;line-height:18px;cursor:pointer;outline:inherit;border-radius:12px;", ({
20634
21468
  isMultiple,
20635
21469
  isOpen,
20636
21470
  disabled,
@@ -21561,591 +22395,227 @@ const MultipleDropdownNotification = /*#__PURE__*/base_default()(Badge_BadgeBase
21561
22395
  }) => theme.colors.white, ";background-color:", ({
21562
22396
  theme
21563
22397
  }) => theme.colors.blueNotification, ";font-size:10px;border-radius:50%;" + ( true ? "" : 0));
21564
- /* harmony default export */ const MultipleDropdownNotification_MultipleDropdownNotification = (MultipleDropdownNotification);
21565
- ;// ./src/components/MultipleDropdown/MultipleDropdown.tsx
21566
-
21567
- function MultipleDropdown_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
21568
-
21569
-
21570
-
21571
-
21572
-
21573
-
21574
-
21575
-
21576
-
21577
-
21578
-
21579
-
21580
- const DropdownPlaceholderLabel = /*#__PURE__*/base_default()("div", true ? {
21581
- target: "ezz35kx0"
21582
- } : 0)( true ? {
21583
- name: "l8l8b8",
21584
- styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
21585
- } : 0);
21586
-
21587
- /**
21588
- * MultipleDropdown - Dropdown component for multi-select and single-select
21589
- *
21590
- * A flexible dropdown that lets users select one or more options from a list.
21591
- * In multi-select mode (`isMultiple=true`, default) each option toggles independently;
21592
- * the toggle button shows the first selected value and a `+N` badge for overflow.
21593
- * In single-select mode (`isMultiple=false`) selecting an option closes the menu.
21594
- * Forwards its ref to the root container div.
21595
- *
21596
- * Component structure:
21597
- * - MultipleDropdown (root container with context)
21598
- * - DropdownToggle (button that opens/closes the menu)
21599
- * - MultipleDropdownOptions (menu container rendered when open)
21600
- * - DropdownOption (individual selectable items)
21601
- *
21602
- * @category Form Controls
21603
- * @subcategory Selection
21604
- *
21605
- * @example
21606
- * ```tsx
21607
- * // Basic multi-select
21608
- * <MultipleDropdown
21609
- * label="Fruits"
21610
- * selectedItems={[{ value: 'apple' }]}
21611
- * onChange={(value, isSelected) => handleChange(value, isSelected)}
21612
- * >
21613
- * <DropdownOption value="apple">Apple</DropdownOption>
21614
- * <DropdownOption value="banana">Banana</DropdownOption>
21615
- * <DropdownOption value="cherry">Cherry</DropdownOption>
21616
- * </MultipleDropdown>
21617
- * ```
21618
- *
21619
- * @example
21620
- * ```tsx
21621
- * // Single-select mode (closes on pick)
21622
- * <MultipleDropdown
21623
- * label="Country"
21624
- * isMultiple={false}
21625
- * selectedItems={selected}
21626
- * onChange={handleChange}
21627
- * >
21628
- * <DropdownOption value="us">United States</DropdownOption>
21629
- * <DropdownOption value="uk">United Kingdom</DropdownOption>
21630
- * </MultipleDropdown>
21631
- * ```
21632
- *
21633
- * @example
21634
- * ```tsx
21635
- * // Hide placeholder text, only show badge count
21636
- * <MultipleDropdown
21637
- * label="Tags"
21638
- * showPlaceholder={false}
21639
- * selectedItems={tags}
21640
- * onChange={handleChange}
21641
- * >
21642
- * {tags.map(tag => (
21643
- * <DropdownOption key={tag.value} value={tag.value}>{tag.label}</DropdownOption>
21644
- * ))}
21645
- * </MultipleDropdown>
21646
- * ```
21647
- *
21648
- * @see {@link DropdownOption} - Child component for individual options
21649
- * @see {@link DropdownToggle} - Toggle button component
21650
- * @see {@link MultipleDropdownOptions} - Options menu container
21651
- *
21652
- * @accessibility
21653
- * - ARIA attributes set according to WAI-ARIA combobox pattern
21654
- * - Keyboard navigation (Arrow keys, Enter, Escape)
21655
- * - Click outside to close
21656
- * - Screen reader friendly with aria-expanded and aria-controls
21657
- *
21658
- * @see https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
21659
- */
21660
- function MultipleDropdownInner({
21661
- selectedItems = [],
21662
- isDisabled,
21663
- isOpen: isInitOpen,
21664
- isMultiple = true,
21665
- placeholder = 'Select something',
21666
- showPlaceholder = true,
21667
- label,
21668
- children,
21669
- onChange: handleChange,
21670
- className,
21671
- maxHeight = 200
21672
- }, ref) {
21673
- const dropdownBaseRef = (0,external_react_namespaceObject.useRef)(null);
21674
- const dropdownId = (0,external_react_namespaceObject.useId)();
21675
- const [isOpen, setIsOpen] = (0,external_react_namespaceObject.useState)(isInitOpen || false);
21676
- const [optionsWithKey, setOptionsWithKey] = (0,external_react_namespaceObject.useState)({});
21677
- const [items, setItems] = (0,external_react_namespaceObject.useState)([]);
21678
- const [values, setValues] = (0,external_react_namespaceObject.useState)([]);
21679
- const [valuesWithoutPlaceholder, setValuesWithoutPlaceholder] = (0,external_react_namespaceObject.useState)([]);
21680
- const memoSelectedItems = external_react_default().useMemo(() => selectedItems, [JSON.stringify(selectedItems)]);
21681
- const onChange = item => {
21682
- if (isDisabled || !item) {
21683
- return;
21684
- }
21685
- if (!isMultiple && optionsWithKey[item.value].isSelected) {
21686
- return;
21687
- }
21688
- let newOptionsWithKey = {};
21689
- let isSelected = true;
21690
- if (isMultiple) {
21691
- isSelected = !optionsWithKey[item.value].isSelected;
21692
- newOptionsWithKey = {
21693
- ...optionsWithKey,
21694
- [item.value]: {
21695
- ...optionsWithKey[item.value],
21696
- isSelected
21697
- }
21698
- };
21699
- setOptionsWithKey(newOptionsWithKey);
21700
- } else {
21701
- newOptionsWithKey = (0,utils_namespaceObject.mapObjIndexed)(option => ({
21702
- ...option,
21703
- isSelected: option.value === item.value
21704
- }), optionsWithKey);
21705
- setOptionsWithKey(newOptionsWithKey);
21706
- setIsOpen(false);
21707
- }
21708
- if (handleChange) {
21709
- handleChange(item.value, isSelected);
21710
- }
21711
- };
21712
- (0,hooks_namespaceObject.useClickOutside)(dropdownBaseRef, () => isOpen && setIsOpen(false));
21713
- (0,external_react_namespaceObject.useEffect)(() => {
21714
- if (isDisabled && isOpen) {
21715
- setIsOpen(false);
21716
- }
21717
- }, [isDisabled]);
21718
- (0,external_react_namespaceObject.useEffect)(() => {
21719
- const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
21720
- const newOptions = [];
21721
- const keyedOptions = {};
21722
- const childItems = childrenArray.map((child, index) => {
21723
- const newOption = {
21724
- ...child.props,
21725
- isSelected: !!memoSelectedItems.find(selectedItem => selectedItem.value === child.props.value)
21726
- };
21727
- newOptions.push(newOption);
21728
- keyedOptions[newOption.value] = newOption;
21729
- return /*#__PURE__*/external_react_default().cloneElement(child, {
21730
- index,
21731
- onClick: onChange.bind(null),
21732
- ...child.props
21733
- });
21734
- });
21735
- setOptionsWithKey(keyedOptions);
21736
- setItems(childItems);
21737
- }, [memoSelectedItems, children]);
21738
- const contextValue = external_react_default().useMemo(() => ({
21739
- onChange,
21740
- allItems: optionsWithKey,
21741
- isMultiple,
21742
- maxHeight
21743
- }), [onChange, optionsWithKey, isMultiple, maxHeight]);
21744
- (0,external_react_namespaceObject.useEffect)(() => {
21745
- const newValues = getActiveItems({
21746
- allItems: optionsWithKey,
21747
- placeholder
21748
- });
21749
- const newValuesWithoutPlaceholder = newValues.filter(item => item !== placeholder);
21750
- setValues(newValues);
21751
- setValuesWithoutPlaceholder(newValuesWithoutPlaceholder);
21752
- }, [optionsWithKey]);
21753
- return (0,jsx_runtime_namespaceObject.jsx)(MultipleDropdown_context.Provider, {
21754
- value: contextValue,
21755
- children: (0,jsx_runtime_namespaceObject.jsxs)(components_DropdownBase_DropdownBase, {
21756
- ref: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([dropdownBaseRef, ref]),
21757
- "data-testid": "dropdown",
21758
- children: [(0,jsx_runtime_namespaceObject.jsxs)(DropdownToggle_DropdownToggle, {
21759
- className: className,
21760
- isOpen: isOpen,
21761
- disabled: isDisabled,
21762
- onClick: setIsOpen.bind(null, !isOpen),
21763
- ariaLabelledby: `dropdown-label-${dropdownId}`,
21764
- ariaControls: `dropdown-popup-${dropdownId}`,
21765
- isMultiple: isMultiple,
21766
- selectedCount: valuesWithoutPlaceholder.length,
21767
- children: [isMultiple ? (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
21768
- children: [(0,jsx_runtime_namespaceObject.jsxs)(DropdownPlaceholderLabel, {
21769
- children: [label, showPlaceholder ? values.length > 0 && `: ${values[0]}` : valuesWithoutPlaceholder.length > 0 && `: ${valuesWithoutPlaceholder[0]}`]
21770
- }), values.length > 1 ? (0,jsx_runtime_namespaceObject.jsxs)(MultipleDropdownNotification_MultipleDropdownNotification, {
21771
- as: 'div',
21772
- children: ["+", values.length - 1]
21773
- }) : '']
21774
- }) : values.join(''), (0,jsx_runtime_namespaceObject.jsx)(DropdownArrow_DropdownArrow, {
21775
- isUp: isOpen
21776
- })]
21777
- }), isOpen ? (0,jsx_runtime_namespaceObject.jsx)(MultipleDropdownOptions_MultipleDropdownOptions, {
21778
- children: items
21779
- }) : null]
21780
- })
21781
- });
21782
- }
21783
- const MultipleDropdown = /*#__PURE__*/external_react_default().forwardRef(MultipleDropdownInner);
21784
- /* harmony default export */ const MultipleDropdown_MultipleDropdown = (MultipleDropdown);
21785
- ;// ./src/components/Popover/hooks/usePopover.tsx
21786
-
21787
-
21788
-
21789
- /**
21790
- * usePopover - Hook for popover functionality
21791
- *
21792
- * Custom hook that provides popover state management, positioning, and interactions.
21793
- * Handles both controlled and uncontrolled modes, supports multiple interaction types
21794
- * (click, hover, both), and integrates with Floating UI for positioning and focus management.
21795
- *
21796
- * @param options - Popover configuration options
21797
- * @returns Popover context value with state, positioning, and interaction handlers
21798
- *
21799
- * @example
21800
- * ```tsx
21801
- * const popover = usePopover({
21802
- * placement: 'top',
21803
- * interactionsEnabled: 'click',
21804
- * modal: false,
21805
- * });
21806
- * ```
21807
- *
21808
- * @see {@link Popover} - Component that uses this hook
21809
- */
21810
- const usePopover = ({
21811
- initialOpen = false,
21812
- placement = 'bottom',
21813
- modal,
21814
- open: controlledOpen,
21815
- onOpenChange: setControlledOpen,
21816
- keyboardHandlers = true,
21817
- floatingOptions = {},
21818
- interactionsEnabled = 'click'
21819
- } = {}) => {
21820
- const [uncontrolledOpen, setUncontrolledOpen] = external_react_namespaceObject.useState(initialOpen);
21821
- const [labelId, setLabelId] = external_react_namespaceObject.useState();
21822
- const [descriptionId, setDescriptionId] = external_react_namespaceObject.useState();
21823
- const open = controlledOpen ?? uncontrolledOpen;
21824
- const setOpen = setControlledOpen ?? setUncontrolledOpen;
21825
- const data = (0,external_floating_ui_react_namespaceObject.useFloating)({
21826
- placement,
21827
- open,
21828
- onOpenChange: setOpen,
21829
- whileElementsMounted: external_floating_ui_react_namespaceObject.autoUpdate,
21830
- middleware: [(0,external_floating_ui_react_namespaceObject.offset)(5), (0,external_floating_ui_react_namespaceObject.flip)({
21831
- crossAxis: placement.includes('-'),
21832
- padding: 5
21833
- }), (0,external_floating_ui_react_namespaceObject.shift)({
21834
- padding: 5
21835
- })],
21836
- ...floatingOptions
21837
- });
21838
- const context = data.context;
21839
- const click = (0,external_floating_ui_react_namespaceObject.useClick)(context, {
21840
- enabled: (0,utils_namespaceObject.isNill)(controlledOpen) && ['click', 'both'].includes(interactionsEnabled),
21841
- keyboardHandlers
21842
- });
21843
- const isControlled = controlledOpen !== undefined;
21844
- const dismiss = (0,external_floating_ui_react_namespaceObject.useDismiss)(context, {
21845
- // When controlled, disable referencePress (parent handles toggle) but keep outsidePress
21846
- referencePress: !isControlled,
21847
- // Keep outsidePress enabled even in controlled mode
21848
- outsidePress: true,
21849
- escapeKey: true,
21850
- ancestorScroll: !isControlled
21851
- });
21852
- const role = (0,external_floating_ui_react_namespaceObject.useRole)(context);
21853
- const hover = (0,external_floating_ui_react_namespaceObject.useHover)(context, {
21854
- enabled: (0,utils_namespaceObject.isNill)(controlledOpen) && ['hover', 'both'].includes(interactionsEnabled),
21855
- handleClose: (0,external_floating_ui_react_namespaceObject.safePolygon)()
21856
- });
21857
- const interactionsHooks = [dismiss, role];
21858
- switch (interactionsEnabled) {
21859
- case 'click':
21860
- {
21861
- interactionsHooks.push(click);
21862
- break;
21863
- }
21864
- case 'hover':
21865
- {
21866
- interactionsHooks.push(hover);
21867
- break;
21868
- }
21869
- default:
21870
- {
21871
- interactionsHooks.push(click, hover);
21872
- }
21873
- }
21874
- const interactions = (0,external_floating_ui_react_namespaceObject.useInteractions)(interactionsHooks);
21875
- const result = external_react_namespaceObject.useMemo(() => ({
21876
- open,
21877
- setOpen,
21878
- ...interactions,
21879
- ...data,
21880
- modal,
21881
- labelId,
21882
- descriptionId,
21883
- floatingOptions,
21884
- setLabelId,
21885
- setDescriptionId
21886
- }), [open, setOpen, interactions, data, modal, labelId, descriptionId, floatingOptions]);
21887
- return result;
21888
- };
21889
- ;// ./src/components/Popover/hooks/usePopoverContext.tsx
21890
-
21891
-
21892
- /**
21893
- * Context for popover components
21894
- *
21895
- * Provides popover state and functionality to child components. Created by
21896
- * Popover component and consumed by PopoverTrigger, PopoverContent, and other
21897
- * popover sub-components.
21898
- */
21899
- const PopoverContext = /*#__PURE__*/external_react_namespaceObject.createContext({});
21900
-
21901
- /**
21902
- * usePopoverContext - Hook to access popover context
21903
- *
21904
- * Returns the popover context value. Throws an error if used outside of a
21905
- * Popover component.
21906
- *
21907
- * @returns Popover context value with state, positioning, and interaction handlers
21908
- * @throws Error if used outside of Popover component
21909
- *
21910
- * @example
21911
- * ```tsx
21912
- * const { open, setOpen, refs } = usePopoverContext();
21913
- * ```
21914
- *
21915
- * @see {@link Popover} - Component that provides this context
21916
- */
21917
- const usePopoverContext = () => {
21918
- const context = external_react_namespaceObject.useContext(PopoverContext);
21919
- if ((0,utils_namespaceObject.isNill)(context)) {
21920
- throw new Error('Popover components must be wrapped in <Popover />');
21921
- }
21922
- return context;
21923
- };
21924
- ;// ./src/components/Popover/Popover.tsx
21925
-
21926
-
21927
-
21928
-
21929
- /**
21930
- * Popover - Floating content container component
21931
- *
21932
- * A flexible popover system built on Floating UI that provides floating content
21933
- * containers relative to trigger elements. Uses a compound component pattern with
21934
- * Popover (root), PopoverTrigger (activator), PopoverContent (display),
21935
- * PopoverHeading, PopoverDescription, and PopoverClose (content helpers).
21936
- *
21937
- * Supports multiple interaction modes (click, hover, both), flexible positioning
21938
- * with auto-adjustment via Floating UI middleware, modal and non-modal modes,
21939
- * and comprehensive accessibility features including ARIA attributes and focus
21940
- * management.
21941
- *
21942
- * @category Components
21943
- * @subcategory Overlay
21944
- *
21945
- * @example
21946
- * ```tsx
21947
- * // Basic popover on click
21948
- * <Popover>
21949
- * <PopoverTrigger>
21950
- * <Button>Open Popover</Button>
21951
- * </PopoverTrigger>
21952
- * <PopoverContent>
21953
- * <PopoverHeading variant="h4">Popover Title</PopoverHeading>
21954
- * <PopoverDescription>
21955
- * This is the popover content with helpful information.
21956
- * </PopoverDescription>
21957
- * <PopoverClose>Close</PopoverClose>
21958
- * </PopoverContent>
21959
- * </Popover>
21960
- * ```
21961
- *
21962
- * @example
21963
- * ```tsx
21964
- * // Popover with hover interaction
21965
- * <Popover interactionsEnabled="hover">
21966
- * <PopoverTrigger>
21967
- * <Icon name="info" />
21968
- * </PopoverTrigger>
21969
- * <PopoverContent>
21970
- * <PopoverHeading variant="h4">Information</PopoverHeading>
21971
- * <PopoverDescription>
21972
- * This popover appears on hover.
21973
- * </PopoverDescription>
21974
- * </PopoverContent>
21975
- * </Popover>
21976
- * ```
21977
- *
21978
- * @example
21979
- * ```tsx
21980
- * // Popover with custom placement
21981
- * <Popover placement="top">
21982
- * <PopoverTrigger>
21983
- * <Button>Show Above</Button>
21984
- * </PopoverTrigger>
21985
- * <PopoverContent>
21986
- * <PopoverDescription>
21987
- * This popover appears above the trigger element.
21988
- * </PopoverDescription>
21989
- * <PopoverClose>Close</PopoverClose>
21990
- * </PopoverContent>
21991
- * </Popover>
21992
- * ```
21993
- *
21994
- * @example
21995
- * ```tsx
21996
- * // Advanced positioning with Floating UI middleware
21997
- * <Popover
21998
- * placement="top"
21999
- * floatingOptions={{
22000
- * middleware: [
22001
- * offset(10),
22002
- * flip(),
22003
- * shift({ padding: 8 }),
22004
- * ],
22005
- * }}>
22006
- * <PopoverTrigger>
22007
- * <Button>Smart Positioning</Button>
22008
- * </PopoverTrigger>
22009
- * <PopoverContent>
22010
- * <PopoverHeading variant="h4">Smart Positioning</PopoverHeading>
22011
- * <PopoverDescription>
22012
- * This popover automatically adjusts its position to stay in view.
22013
- * </PopoverDescription>
22014
- * <PopoverClose>Close</PopoverClose>
22015
- * </PopoverContent>
22016
- * </Popover>
22017
- * ```
22018
- *
22019
- * @example
22020
- * ```tsx
22021
- * // Modal popover with controlled state
22022
- * <Popover modal open={isOpen} onOpenChange={setIsOpen}>
22023
- * <PopoverTrigger>
22024
- * <Button>Open Modal Popover</Button>
22025
- * </PopoverTrigger>
22026
- * <PopoverContent>
22027
- * <PopoverHeading variant="h4">Modal Popover</PopoverHeading>
22028
- * <PopoverDescription>
22029
- * This is a modal popover that traps focus.
22030
- * </PopoverDescription>
22031
- * <PopoverClose>Close</PopoverClose>
22032
- * </PopoverContent>
22033
- * </Popover>
22034
- * ```
22035
- *
22036
- * @see {@link PopoverTrigger} - Trigger element component
22037
- * @see {@link PopoverContent} - Content display component
22038
- * @see {@link PopoverHeading} - Accessible heading component
22039
- * @see {@link PopoverDescription} - Accessible description component
22040
- * @see {@link PopoverClose} - Close button component
22041
- *
22042
- * @accessibility
22043
- * - Keyboard accessible (ESC to close, Enter/Space to activate)
22044
- * - Focus management with FloatingFocusManager for modal popovers
22045
- * - ARIA attributes automatically applied (role, aria-labelledby, aria-describedby)
22046
- * - Screen reader friendly with semantic heading and description components
22047
- * - Focus trap for modal popovers
22048
- */
22049
-
22050
- const Popover = ({
22051
- children,
22052
- modal = false,
22053
- ...restOptions
22054
- }) => {
22055
- // This can accept any props as options, e.g. `placement`,
22056
- // or other positioning options.
22057
- const popover = usePopover({
22058
- modal,
22059
- ...restOptions
22060
- });
22061
- return (0,jsx_runtime_namespaceObject.jsx)(PopoverContext.Provider, {
22062
- value: popover,
22063
- children: children
22064
- });
22065
- };
22066
- ;// ./src/components/Popover/PopoverContent.tsx
22067
- function PopoverContent_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
22398
+ /* harmony default export */ const MultipleDropdownNotification_MultipleDropdownNotification = (MultipleDropdownNotification);
22399
+ ;// ./src/components/MultipleDropdown/MultipleDropdown.tsx
22068
22400
 
22401
+ function MultipleDropdown_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
22069
22402
 
22070
22403
 
22071
22404
 
22072
22405
 
22073
- var PopoverContent_ref = true ? {
22074
- name: "3abrc0",
22075
- styles: "width:auto"
22076
- } : 0;
22406
+
22407
+
22408
+
22409
+
22410
+
22411
+
22412
+
22413
+
22414
+ const DropdownPlaceholderLabel = /*#__PURE__*/base_default()("div", true ? {
22415
+ target: "ezz35kx0"
22416
+ } : 0)( true ? {
22417
+ name: "l8l8b8",
22418
+ styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
22419
+ } : 0);
22420
+
22077
22421
  /**
22078
- * PopoverContent - Content container for popover
22422
+ * MultipleDropdown - Dropdown component for multi-select and single-select
22079
22423
  *
22080
- * Renders the actual popover content that appears when the trigger is activated.
22081
- * Automatically positioned using Floating UI, supports portal rendering, and
22082
- * includes focus management for modal popovers. Can be configured to unmount
22083
- * or keep mounted when closed.
22424
+ * A flexible dropdown that lets users select one or more options from a list.
22425
+ * In multi-select mode (`isMultiple=true`, default) each option toggles independently;
22426
+ * the toggle button shows the first selected value and a `+N` badge for overflow.
22427
+ * In single-select mode (`isMultiple=false`) selecting an option closes the menu.
22428
+ * Forwards its ref to the root container div.
22084
22429
  *
22085
- * @category Components
22086
- * @subcategory Overlay
22430
+ * Component structure:
22431
+ * - MultipleDropdown (root container with context)
22432
+ * - DropdownToggle (button that opens/closes the menu)
22433
+ * - MultipleDropdownOptions (menu container rendered when open)
22434
+ * - DropdownOption (individual selectable items)
22435
+ *
22436
+ * @category Form Controls
22437
+ * @subcategory Selection
22087
22438
  *
22088
22439
  * @example
22089
22440
  * ```tsx
22090
- * <PopoverContent>
22091
- * <PopoverHeading variant="h4">Title</PopoverHeading>
22092
- * <PopoverDescription>Content goes here</PopoverDescription>
22093
- * <PopoverClose>Close</PopoverClose>
22094
- * </PopoverContent>
22441
+ * // Basic multi-select
22442
+ * <MultipleDropdown
22443
+ * label="Fruits"
22444
+ * selectedItems={[{ value: 'apple' }]}
22445
+ * onChange={(value, isSelected) => handleChange(value, isSelected)}
22446
+ * >
22447
+ * <DropdownOption value="apple">Apple</DropdownOption>
22448
+ * <DropdownOption value="banana">Banana</DropdownOption>
22449
+ * <DropdownOption value="cherry">Cherry</DropdownOption>
22450
+ * </MultipleDropdown>
22095
22451
  * ```
22096
22452
  *
22097
22453
  * @example
22098
22454
  * ```tsx
22099
- * // Keep content mounted when closed
22100
- * <PopoverContent mountMode="keep-mounted">
22101
- * <div>This stays in DOM when closed</div>
22102
- * </PopoverContent>
22455
+ * // Single-select mode (closes on pick)
22456
+ * <MultipleDropdown
22457
+ * label="Country"
22458
+ * isMultiple={false}
22459
+ * selectedItems={selected}
22460
+ * onChange={handleChange}
22461
+ * >
22462
+ * <DropdownOption value="us">United States</DropdownOption>
22463
+ * <DropdownOption value="uk">United Kingdom</DropdownOption>
22464
+ * </MultipleDropdown>
22103
22465
  * ```
22104
22466
  *
22105
- * @see {@link Popover} - Root component
22106
- * @see {@link PopoverTrigger} - Trigger element component
22107
- * @see {@link PopoverHeading} - Accessible heading component
22108
- * @see {@link PopoverDescription} - Accessible description component
22467
+ * @example
22468
+ * ```tsx
22469
+ * // Hide placeholder text, only show badge count
22470
+ * <MultipleDropdown
22471
+ * label="Tags"
22472
+ * showPlaceholder={false}
22473
+ * selectedItems={tags}
22474
+ * onChange={handleChange}
22475
+ * >
22476
+ * {tags.map(tag => (
22477
+ * <DropdownOption key={tag.value} value={tag.value}>{tag.label}</DropdownOption>
22478
+ * ))}
22479
+ * </MultipleDropdown>
22480
+ * ```
22481
+ *
22482
+ * @see {@link DropdownOption} - Child component for individual options
22483
+ * @see {@link DropdownToggle} - Toggle button component
22484
+ * @see {@link MultipleDropdownOptions} - Options menu container
22485
+ *
22486
+ * @accessibility
22487
+ * - ARIA attributes set according to WAI-ARIA combobox pattern
22488
+ * - Keyboard navigation (Arrow keys, Enter, Escape)
22489
+ * - Click outside to close
22490
+ * - Screen reader friendly with aria-expanded and aria-controls
22491
+ *
22492
+ * @see https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
22109
22493
  */
22110
- const PopoverContent = /*#__PURE__*/external_react_namespaceObject.forwardRef(function PopoverContent({
22111
- style,
22112
- isFocusManagerDisabled = false,
22113
- mountMode = 'unmount',
22114
- ...props
22115
- }, propRef) {
22116
- const {
22117
- context: floatingContext,
22118
- ...context
22119
- } = usePopoverContext();
22120
- const ref = (0,external_floating_ui_react_namespaceObject.useMergeRefs)([context.refs.setFloating, propRef]);
22121
- const keepMounted = mountMode === 'keep-mounted';
22122
- if (!keepMounted && !floatingContext.open) return null;
22123
- const hidden = keepMounted && !floatingContext.open;
22124
- return (0,jsx_runtime_namespaceObject.jsx)(external_floating_ui_react_namespaceObject.FloatingPortal, {
22125
- children: (0,jsx_runtime_namespaceObject.jsx)(external_floating_ui_react_namespaceObject.FloatingFocusManager, {
22126
- context: floatingContext,
22127
- modal: context.modal,
22128
- disabled: isFocusManagerDisabled,
22129
- children: (0,jsx_runtime_namespaceObject.jsx)(Wrapper_Wrapper, {
22130
- ref: ref,
22131
- css: PopoverContent_ref,
22132
- style: {
22133
- ...context.floatingStyles,
22134
- ...(hidden ? {
22135
- display: 'none',
22136
- pointerEvents: 'none'
22137
- } : null),
22138
- ...style
22139
- },
22140
- "aria-labelledby": context.labelId,
22141
- "aria-describedby": context.descriptionId,
22142
- direction: "column",
22143
- ...context.getFloatingProps(props),
22144
- children: props.children
22145
- })
22494
+ function MultipleDropdownInner({
22495
+ selectedItems = [],
22496
+ isDisabled,
22497
+ isOpen: isInitOpen,
22498
+ isMultiple = true,
22499
+ placeholder = 'Select something',
22500
+ showPlaceholder = true,
22501
+ label,
22502
+ children,
22503
+ onChange: handleChange,
22504
+ className,
22505
+ maxHeight = 200
22506
+ }, ref) {
22507
+ const dropdownBaseRef = (0,external_react_namespaceObject.useRef)(null);
22508
+ const dropdownId = (0,external_react_namespaceObject.useId)();
22509
+ const [isOpen, setIsOpen] = (0,external_react_namespaceObject.useState)(isInitOpen || false);
22510
+ const [optionsWithKey, setOptionsWithKey] = (0,external_react_namespaceObject.useState)({});
22511
+ const [items, setItems] = (0,external_react_namespaceObject.useState)([]);
22512
+ const [values, setValues] = (0,external_react_namespaceObject.useState)([]);
22513
+ const [valuesWithoutPlaceholder, setValuesWithoutPlaceholder] = (0,external_react_namespaceObject.useState)([]);
22514
+ const memoSelectedItems = external_react_default().useMemo(() => selectedItems, [JSON.stringify(selectedItems)]);
22515
+ const onChange = item => {
22516
+ if (isDisabled || !item) {
22517
+ return;
22518
+ }
22519
+ if (!isMultiple && optionsWithKey[item.value].isSelected) {
22520
+ return;
22521
+ }
22522
+ let newOptionsWithKey = {};
22523
+ let isSelected = true;
22524
+ if (isMultiple) {
22525
+ isSelected = !optionsWithKey[item.value].isSelected;
22526
+ newOptionsWithKey = {
22527
+ ...optionsWithKey,
22528
+ [item.value]: {
22529
+ ...optionsWithKey[item.value],
22530
+ isSelected
22531
+ }
22532
+ };
22533
+ setOptionsWithKey(newOptionsWithKey);
22534
+ } else {
22535
+ newOptionsWithKey = (0,utils_namespaceObject.mapObjIndexed)(option => ({
22536
+ ...option,
22537
+ isSelected: option.value === item.value
22538
+ }), optionsWithKey);
22539
+ setOptionsWithKey(newOptionsWithKey);
22540
+ setIsOpen(false);
22541
+ }
22542
+ if (handleChange) {
22543
+ handleChange(item.value, isSelected);
22544
+ }
22545
+ };
22546
+ (0,hooks_namespaceObject.useClickOutside)(dropdownBaseRef, () => isOpen && setIsOpen(false));
22547
+ (0,external_react_namespaceObject.useEffect)(() => {
22548
+ if (isDisabled && isOpen) {
22549
+ setIsOpen(false);
22550
+ }
22551
+ }, [isDisabled]);
22552
+ (0,external_react_namespaceObject.useEffect)(() => {
22553
+ const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
22554
+ const newOptions = [];
22555
+ const keyedOptions = {};
22556
+ const childItems = childrenArray.map((child, index) => {
22557
+ const newOption = {
22558
+ ...child.props,
22559
+ isSelected: !!memoSelectedItems.find(selectedItem => selectedItem.value === child.props.value)
22560
+ };
22561
+ newOptions.push(newOption);
22562
+ keyedOptions[newOption.value] = newOption;
22563
+ return /*#__PURE__*/external_react_default().cloneElement(child, {
22564
+ index,
22565
+ onClick: onChange.bind(null),
22566
+ ...child.props
22567
+ });
22568
+ });
22569
+ setOptionsWithKey(keyedOptions);
22570
+ setItems(childItems);
22571
+ }, [memoSelectedItems, children]);
22572
+ const contextValue = external_react_default().useMemo(() => ({
22573
+ onChange,
22574
+ allItems: optionsWithKey,
22575
+ isMultiple,
22576
+ maxHeight
22577
+ }), [onChange, optionsWithKey, isMultiple, maxHeight]);
22578
+ (0,external_react_namespaceObject.useEffect)(() => {
22579
+ const newValues = getActiveItems({
22580
+ allItems: optionsWithKey,
22581
+ placeholder
22582
+ });
22583
+ const newValuesWithoutPlaceholder = newValues.filter(item => item !== placeholder);
22584
+ setValues(newValues);
22585
+ setValuesWithoutPlaceholder(newValuesWithoutPlaceholder);
22586
+ }, [optionsWithKey]);
22587
+ return (0,jsx_runtime_namespaceObject.jsx)(MultipleDropdown_context.Provider, {
22588
+ value: contextValue,
22589
+ children: (0,jsx_runtime_namespaceObject.jsxs)(components_DropdownBase_DropdownBase, {
22590
+ ref: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([dropdownBaseRef, ref]),
22591
+ "data-testid": "dropdown",
22592
+ children: [(0,jsx_runtime_namespaceObject.jsxs)(DropdownToggle_DropdownToggle, {
22593
+ className: className,
22594
+ isOpen: isOpen,
22595
+ disabled: isDisabled,
22596
+ onClick: setIsOpen.bind(null, !isOpen),
22597
+ ariaLabelledby: `dropdown-label-${dropdownId}`,
22598
+ ariaControls: `dropdown-popup-${dropdownId}`,
22599
+ isMultiple: isMultiple,
22600
+ selectedCount: valuesWithoutPlaceholder.length,
22601
+ children: [isMultiple ? (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
22602
+ children: [(0,jsx_runtime_namespaceObject.jsxs)(DropdownPlaceholderLabel, {
22603
+ children: [label, showPlaceholder ? values.length > 0 && `: ${values[0]}` : valuesWithoutPlaceholder.length > 0 && `: ${valuesWithoutPlaceholder[0]}`]
22604
+ }), values.length > 1 ? (0,jsx_runtime_namespaceObject.jsxs)(MultipleDropdownNotification_MultipleDropdownNotification, {
22605
+ as: 'div',
22606
+ children: ["+", values.length - 1]
22607
+ }) : '']
22608
+ }) : values.join(''), (0,jsx_runtime_namespaceObject.jsx)(DropdownArrow_DropdownArrow, {
22609
+ isUp: isOpen
22610
+ })]
22611
+ }), isOpen ? (0,jsx_runtime_namespaceObject.jsx)(MultipleDropdownOptions_MultipleDropdownOptions, {
22612
+ children: items
22613
+ }) : null]
22146
22614
  })
22147
22615
  });
22148
- });
22616
+ }
22617
+ const MultipleDropdown = /*#__PURE__*/external_react_default().forwardRef(MultipleDropdownInner);
22618
+ /* harmony default export */ const MultipleDropdown_MultipleDropdown = (MultipleDropdown);
22149
22619
  ;// ./src/components/Popover/PopoverDescription.tsx
22150
22620
 
22151
22621
 
@@ -22625,95 +23095,6 @@ const TypeaheadFocusTrap = ({
22625
23095
  };
22626
23096
  ;// external "@emotion/css"
22627
23097
  const css_namespaceObject = require("@emotion/css");
22628
- ;// ./src/components/Popover/PopoverTrigger.tsx
22629
-
22630
-
22631
-
22632
-
22633
-
22634
- /**
22635
- * PopoverTrigger - Trigger element for popover
22636
- *
22637
- * Activates the popover when interacted with. By default renders as a Button,
22638
- * but can be customized using the `asChild` prop to render as any React element.
22639
- * Automatically receives Floating UI reference props for positioning and state
22640
- * management.
22641
- *
22642
- * @category Components
22643
- * @subcategory Overlay
22644
- *
22645
- * @example
22646
- * ```tsx
22647
- * // Default Button trigger
22648
- * <PopoverTrigger>
22649
- * Open Popover
22650
- * </PopoverTrigger>
22651
- * ```
22652
- *
22653
- * @example
22654
- * ```tsx
22655
- * // Custom element trigger
22656
- * <PopoverTrigger asChild>
22657
- * <Icon name="info" />
22658
- * </PopoverTrigger>
22659
- * ```
22660
- *
22661
- * @see {@link Popover} - Root component
22662
- * @see {@link PopoverContent} - Content display component
22663
- */
22664
- const PopoverTrigger = /*#__PURE__*/external_react_namespaceObject.forwardRef(function PopoverTrigger({
22665
- children,
22666
- asChild = false,
22667
- dataTestId = 'trigger-button',
22668
- variant = 'primary',
22669
- ...props
22670
- }, propRef) {
22671
- const context = usePopoverContext();
22672
-
22673
- // `asChild` allows the user to pass any element as the anchor
22674
- if (asChild && /*#__PURE__*/external_react_namespaceObject.isValidElement(children)) {
22675
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
22676
- const childrenElement = children;
22677
-
22678
- // Extract ref from children props BEFORE calling getReferenceProps to avoid conflicts
22679
- // In React 19, refs are regular props, but forwardRef components may not expose them in children.props.ref
22680
- // We extract it here for backward compatibility
22681
- const {
22682
- ref: existingChildrenRef,
22683
- ...childrenPropsWithoutRef
22684
- } = childrenElement.props || {};
22685
-
22686
- // Merge all refs: floating-ui's setReference, children's ref, and propRef
22687
- // This ensures positioning works while preserving any refs passed to the child component
22688
- const mergedRef = (0,external_floating_ui_react_namespaceObject.useMergeRefs)([context?.refs.setReference, existingChildrenRef, propRef]);
22689
-
22690
- // Get reference props from floating-ui - pass the merged ref to it
22691
- // This ensures floating-ui gets the correct element for positioning
22692
- const referenceProps = context?.getReferenceProps({
22693
- ref: mergedRef,
22694
- ...props,
22695
- ...childrenPropsWithoutRef,
22696
- 'data-state': context.open ? 'open' : 'closed'
22697
- });
22698
-
22699
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
22700
- return /*#__PURE__*/external_react_namespaceObject.cloneElement(children, referenceProps);
22701
- }
22702
-
22703
- // For non-asChild case, merge refs normally
22704
- const childrenRef = /*#__PURE__*/external_react_namespaceObject.isValidElement(children) ? children.props?.ref : undefined;
22705
- const ref = (0,external_floating_ui_react_namespaceObject.useMergeRefs)([context?.refs.setReference, propRef, childrenRef]);
22706
- return (0,jsx_runtime_namespaceObject.jsx)(Button_Button, {
22707
- "data-testid": dataTestId,
22708
- ref: ref
22709
- // The user can style the trigger based on the state
22710
- ,
22711
- "data-state": context?.open ? 'open' : 'closed',
22712
- variant: variant,
22713
- ...context?.getReferenceProps(props),
22714
- children: children
22715
- });
22716
- });
22717
23098
  ;// ./src/components/Typeahead/styles.ts
22718
23099
 
22719
23100
  function Typeahead_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
@@ -28423,6 +28804,207 @@ const SearchBox = ({
28423
28804
 
28424
28805
 
28425
28806
 
28807
+ ;// ./src/components/FileAttachment/utils.ts
28808
+ const formatBytes = bytes => {
28809
+ if (bytes < 1024) return `${bytes} B`;
28810
+ if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
28811
+ return `${Math.round(bytes / (1024 * 1024))} MB`;
28812
+ };
28813
+ const EXTENSION_ICON_MAP = {
28814
+ pdf: 'file-pdf',
28815
+ doc: 'file-word',
28816
+ docx: 'file-word',
28817
+ xls: 'excel-download',
28818
+ xlsx: 'excel-download'
28819
+ };
28820
+
28821
+ /** Returns the file-type icon for a known extension, or `null` when the design's grey Placeholder look should be used instead. */
28822
+ const getFileTypeIcon = fileName => {
28823
+ const extension = fileName.split('.').pop()?.toLowerCase();
28824
+ return extension && EXTENSION_ICON_MAP[extension] || null;
28825
+ };
28826
+ const IMAGE_FILE_NAME_REGEX = /\.(png|jpe?g|gif|webp|bmp|avif|svg)$/i;
28827
+
28828
+ /** Gates image-preview rendering strictly on the file name's extension, so a pdf/php/etc. is never rendered via `<img>` even if preview data is (incorrectly) supplied for it. */
28829
+ const isImageFile = fileName => IMAGE_FILE_NAME_REGEX.test(fileName);
28830
+ ;// ./src/components/FileAttachment/hooks/useFilePreviewUrl.ts
28831
+
28832
+
28833
+ /** Creates an object URL for a local File/Blob and revokes it on unmount or when `content` changes, avoiding a memory leak. */
28834
+ const useFilePreviewUrl = content => {
28835
+ const [url, setUrl] = (0,external_react_namespaceObject.useState)();
28836
+ (0,external_react_namespaceObject.useEffect)(() => {
28837
+ if (!content) {
28838
+ setUrl(undefined);
28839
+ return;
28840
+ }
28841
+ const objectUrl = URL.createObjectURL(content);
28842
+ setUrl(objectUrl);
28843
+ return () => URL.revokeObjectURL(objectUrl);
28844
+ }, [content]);
28845
+ return url;
28846
+ };
28847
+ ;// ./src/components/FileAttachment/styles.ts
28848
+ function FileAttachment_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
28849
+
28850
+ const paddingBySize = {
28851
+ large: 16,
28852
+ small: 12
28853
+ };
28854
+ const iconSizeBySize = {
28855
+ large: 40,
28856
+ small: 24
28857
+ };
28858
+ /** Placeholder glyph is inset ~20% on each side of its box in the design (40px box -> 24px glyph). */
28859
+ const placeholderIconSizeBySize = {
28860
+ large: 24,
28861
+ small: 14
28862
+ };
28863
+ const container = (theme, size) => /*#__PURE__*/(0,react_namespaceObject.css)("display:flex;align-items:center;gap:8px;width:100%;padding:", paddingBySize[size], "px;background:", theme.colors.white, ";border:1px solid ", theme.colors.grey, ";border-radius:12px;" + ( true ? "" : 0), true ? "" : 0);
28864
+ const disabledContainer = theme => /*#__PURE__*/(0,react_namespaceObject.css)("background:", theme.colors.greyLighter, ";" + ( true ? "" : 0), true ? "" : 0);
28865
+ const iconWrapper = size => /*#__PURE__*/(0,react_namespaceObject.css)("flex-shrink:0;display:flex;align-items:center;justify-content:center;width:", iconSizeBySize[size], "px;height:", iconSizeBySize[size], "px;" + ( true ? "" : 0), true ? "" : 0);
28866
+ const placeholderWrapper = theme => /*#__PURE__*/(0,react_namespaceObject.css)("background:", theme.palette.secondary.dark, ";border-radius:4px;" + ( true ? "" : 0), true ? "" : 0);
28867
+ const previewImage = true ? {
28868
+ name: "rys4i",
28869
+ styles: "width:100%;height:100%;border-radius:4px;object-fit:cover;display:block"
28870
+ } : 0;
28871
+ const textColumn = true ? {
28872
+ name: "1vjbjgs",
28873
+ styles: "flex:1;min-width:0;display:flex;flex-direction:column;gap:4px"
28874
+ } : 0;
28875
+ const title = theme => /*#__PURE__*/(0,react_namespaceObject.css)("font-size:0.875rem;font-weight:600;color:", theme.colors.greyDarker, ";overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" + ( true ? "" : 0), true ? "" : 0);
28876
+ const description = theme => /*#__PURE__*/(0,react_namespaceObject.css)("display:flex;align-items:center;gap:6px;font-size:0.875rem;font-weight:500;color:", theme.colors.greyDarker60, ";white-space:nowrap;" + ( true ? "" : 0), true ? "" : 0);
28877
+ const dot = theme => /*#__PURE__*/(0,react_namespaceObject.css)("flex-shrink:0;width:4px;height:4px;border-radius:50%;background:", theme.colors.greyDarker60, ";" + ( true ? "" : 0), true ? "" : 0);
28878
+ const progressTrack = theme => /*#__PURE__*/(0,react_namespaceObject.css)("position:relative;flex-shrink:0;overflow:hidden;width:60px;height:4px;border-radius:4px;background:", theme.palette.secondary.light, ";" + ( true ? "" : 0), true ? "" : 0);
28879
+ const progressFill = theme => /*#__PURE__*/(0,react_namespaceObject.css)("position:absolute;top:0;left:0;height:4px;border-radius:4px;background:", theme.palette.primary.main, ";" + ( true ? "" : 0), true ? "" : 0);
28880
+ const deleteButton = theme => /*#__PURE__*/(0,react_namespaceObject.css)("flex-shrink:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:none;cursor:pointer;color:", theme.colors.greyDarker60, ";transition:color 0.15s ease;&:hover{color:", theme.palette.error.main, ";}&:disabled{cursor:default;color:", theme.colors.grey, ";}" + ( true ? "" : 0), true ? "" : 0);
28881
+ ;// ./src/components/FileAttachment/FileAttachment.tsx
28882
+
28883
+
28884
+
28885
+
28886
+
28887
+
28888
+ /**
28889
+ * FileAttachment - Read-only row displaying a single attached/uploading file
28890
+ *
28891
+ * @example
28892
+ * ```tsx
28893
+ * <FileAttachment
28894
+ * file={{ name: 'Report.pdf', size: 20 * 1024 * 1024 }}
28895
+ * progress={50}
28896
+ * onRemove={() => handleRemove(file)}
28897
+ * />
28898
+ * ```
28899
+ *
28900
+ * @example
28901
+ * ```tsx
28902
+ * // Progress bar look instead of the default percentage text
28903
+ * <FileAttachment
28904
+ * file={{ name: 'Report.pdf', size: 20 * 1024 * 1024 }}
28905
+ * progress={50}
28906
+ * progressDisplay="bar"
28907
+ * onRemove={() => handleRemove(file)}
28908
+ * />
28909
+ * ```
28910
+ *
28911
+ * @example
28912
+ * ```tsx
28913
+ * // Omitting `progress` entirely shows just the file size, no progress copy —
28914
+ * // e.g. a file that's been selected but whose upload hasn't started yet.
28915
+ * <FileAttachment
28916
+ * file={{ name: 'Report.pdf', size: 20 * 1024 * 1024 }}
28917
+ * onRemove={() => handleRemove(file)}
28918
+ * />
28919
+ * ```
28920
+ */
28921
+
28922
+ const FileAttachment = ({
28923
+ file,
28924
+ size = 'large',
28925
+ progress,
28926
+ progressDisplay = 'text',
28927
+ uploadingText = 'Uploading',
28928
+ uploadedText = 'Uploaded Successfully',
28929
+ showDescription = true,
28930
+ icon,
28931
+ isDisabled = false,
28932
+ onRemove,
28933
+ className,
28934
+ css: cssProp
28935
+ }) => {
28936
+ const theme = (0,react_namespaceObject.useTheme)();
28937
+ const clampedProgress = progress === undefined ? undefined : Math.min(100, Math.max(0, progress));
28938
+ const isUploaded = clampedProgress !== undefined && clampedProgress >= 100;
28939
+ const iconName = icon ?? getFileTypeIcon(file.name);
28940
+ const canPreviewImage = !icon && isImageFile(file.name);
28941
+ const objectPreviewUrl = useFilePreviewUrl(canPreviewImage ? file.content : undefined);
28942
+ const previewSrc = canPreviewImage ? file.previewUrl ?? objectPreviewUrl : undefined;
28943
+ return (0,jsx_runtime_namespaceObject.jsxs)("div", {
28944
+ css: [container(theme, size), isDisabled && disabledContainer(theme), cssProp, true ? "" : 0, true ? "" : 0],
28945
+ className: className,
28946
+ children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
28947
+ css: [iconWrapper(size), !iconName && !previewSrc && placeholderWrapper(theme), true ? "" : 0, true ? "" : 0],
28948
+ children: previewSrc ? (0,jsx_runtime_namespaceObject.jsx)("img", {
28949
+ src: previewSrc,
28950
+ alt: "",
28951
+ css: previewImage
28952
+ }) : (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
28953
+ name: iconName ?? 'picture',
28954
+ size: iconName ? iconSizeBySize[size] : placeholderIconSizeBySize[size],
28955
+ color: iconName ? theme.colors.greyDarker60 : theme.colors.white
28956
+ })
28957
+ }), (0,jsx_runtime_namespaceObject.jsxs)("div", {
28958
+ css: textColumn,
28959
+ children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
28960
+ css: title(theme),
28961
+ children: file.name
28962
+ }), showDescription && (0,jsx_runtime_namespaceObject.jsxs)("div", {
28963
+ css: description(theme),
28964
+ children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
28965
+ children: formatBytes(file.size)
28966
+ }), clampedProgress !== undefined && (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
28967
+ children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
28968
+ children: "|"
28969
+ }), progressDisplay === 'bar' ? (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
28970
+ children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
28971
+ css: progressTrack(theme),
28972
+ role: "progressbar",
28973
+ children: (0,jsx_runtime_namespaceObject.jsx)("div", {
28974
+ css: progressFill(theme),
28975
+ style: {
28976
+ width: `${clampedProgress}%`
28977
+ }
28978
+ })
28979
+ }), (0,jsx_runtime_namespaceObject.jsxs)("span", {
28980
+ children: [clampedProgress, "%"]
28981
+ })]
28982
+ }) : (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
28983
+ children: [(0,jsx_runtime_namespaceObject.jsxs)("span", {
28984
+ children: [clampedProgress, "%"]
28985
+ }), (0,jsx_runtime_namespaceObject.jsx)("span", {
28986
+ css: dot(theme)
28987
+ }), (0,jsx_runtime_namespaceObject.jsx)("span", {
28988
+ children: isUploaded ? uploadedText : uploadingText
28989
+ })]
28990
+ })]
28991
+ })]
28992
+ })]
28993
+ }), onRemove && (0,jsx_runtime_namespaceObject.jsx)("button", {
28994
+ type: "button",
28995
+ css: deleteButton(theme),
28996
+ disabled: isDisabled,
28997
+ onClick: onRemove,
28998
+ "aria-label": `Remove ${file.name}`,
28999
+ children: (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
29000
+ name: "delete",
29001
+ size: 16,
29002
+ color: "currentColor"
29003
+ })
29004
+ })]
29005
+ });
29006
+ };
29007
+ /* harmony default export */ const FileAttachment_FileAttachment = (FileAttachment);
28426
29008
  ;// ./src/components/FileUpload/styles.ts
28427
29009
  function FileUpload_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
28428
29010
 
@@ -28461,71 +29043,6 @@ const filesList = true ? {
28461
29043
  styles: "display:flex;flex-direction:column;gap:8px;margin-top:12px"
28462
29044
  } : 0;
28463
29045
  const filesListTitle = theme => /*#__PURE__*/(0,react_namespaceObject.css)("font-size:0.875rem;font-weight:500;color:", theme.colors.greyDarker, ";margin-bottom:4px;" + ( true ? "" : 0), true ? "" : 0);
28464
-
28465
- // ─── File item ────────────────────────────────────────────────────────────────
28466
-
28467
- const fileItem = theme => /*#__PURE__*/(0,react_namespaceObject.css)("display:flex;align-items:center;gap:12px;padding:12px 16px;background:", theme.colors.white, ";border:1px solid ", theme.colors.grey, ";border-radius:12px;" + ( true ? "" : 0), true ? "" : 0);
28468
- const fileIconWrapper = true ? {
28469
- name: "1xuq60z",
28470
- styles: "flex-shrink:0;display:flex;align-items:center;justify-content:center"
28471
- } : 0;
28472
- const fileInfo = true ? {
28473
- name: "1k33dov",
28474
- styles: "flex:1;display:flex;flex-direction:column;gap:2px;min-width:0"
28475
- } : 0;
28476
- const fileName = theme => /*#__PURE__*/(0,react_namespaceObject.css)("font-size:0.875rem;font-weight:600;color:", theme.colors.greyDarker, ";overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" + ( true ? "" : 0), true ? "" : 0);
28477
- const fileSize = theme => /*#__PURE__*/(0,react_namespaceObject.css)("font-size:0.75rem;font-weight:400;color:", theme.colors.greyDarker60, ";" + ( true ? "" : 0), true ? "" : 0);
28478
- const deleteButton = theme => /*#__PURE__*/(0,react_namespaceObject.css)("flex-shrink:0;display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;background:transparent;border:none;border-radius:8px;cursor:pointer;color:", theme.colors.greyDarker60, ";transition:color 0.15s ease,background 0.15s ease;&:hover{color:", theme.palette.error.main, ";background:", theme.colors.greyLighter, ";}&:disabled{cursor:not-allowed;opacity:0.5;}" + ( true ? "" : 0), true ? "" : 0);
28479
- ;// ./src/components/FileUpload/FileUploadItem.tsx
28480
-
28481
-
28482
-
28483
-
28484
- const formatFileSize = bytes => {
28485
- if (bytes === 0) return '0 B';
28486
- if (bytes < 1024) return `${bytes} B`;
28487
- if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
28488
- return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
28489
- };
28490
- const FileUploadItem = ({
28491
- file,
28492
- onRemove,
28493
- disabled
28494
- }) => {
28495
- const theme = (0,react_namespaceObject.useTheme)();
28496
- return (0,jsx_runtime_namespaceObject.jsxs)("div", {
28497
- css: fileItem(theme),
28498
- children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
28499
- css: fileIconWrapper,
28500
- children: (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
28501
- name: "file-pdf",
28502
- size: 32,
28503
- color: theme.colors.greyDarker60
28504
- })
28505
- }), (0,jsx_runtime_namespaceObject.jsxs)("div", {
28506
- css: fileInfo,
28507
- children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
28508
- css: fileName(theme),
28509
- children: file.name
28510
- }), (0,jsx_runtime_namespaceObject.jsx)("span", {
28511
- css: fileSize(theme),
28512
- children: formatFileSize(file.size)
28513
- })]
28514
- }), (0,jsx_runtime_namespaceObject.jsx)("button", {
28515
- css: deleteButton(theme),
28516
- type: "button",
28517
- disabled: disabled,
28518
- onClick: () => onRemove(file),
28519
- "aria-label": `Remove ${file.name}`,
28520
- children: (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
28521
- name: "bin",
28522
- size: 16,
28523
- color: "currentColor"
28524
- })
28525
- })]
28526
- });
28527
- };
28528
- /* harmony default export */ const FileUpload_FileUploadItem = (FileUploadItem);
28529
29046
  ;// ./src/components/FileUpload/FileUpload.tsx
28530
29047
 
28531
29048
 
@@ -28536,14 +29053,23 @@ const FileUploadItem = ({
28536
29053
 
28537
29054
 
28538
29055
 
29056
+
28539
29057
  const normalizeValue = value => {
28540
29058
  if (!value) return [];
28541
29059
  return Array.isArray(value) ? value : [value];
28542
29060
  };
28543
- const formatBytes = bytes => {
28544
- if (bytes < 1024) return `${bytes} B`;
28545
- if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
28546
- return `${Math.round(bytes / (1024 * 1024))} MB`;
29061
+
29062
+ /**
29063
+ * Matches by the Nth occurrence of a name rather than the first, so files
29064
+ * that share a name (e.g. two "photo.png" from different folders) each get
29065
+ * their own progress entry instead of colliding on the same one.
29066
+ */
29067
+ const getFileProgress = (file, index, files, uploadProgress) => {
29068
+ if (uploadProgress === undefined) return undefined;
29069
+ if (typeof uploadProgress === 'number') return uploadProgress;
29070
+ const occurrence = files.slice(0, index + 1).filter(f => f.name === file.name).length;
29071
+ const matches = uploadProgress.filter(entry => entry.name === file.name);
29072
+ return matches[occurrence - 1]?.progress;
28547
29073
  };
28548
29074
 
28549
29075
  /**
@@ -28551,7 +29077,8 @@ const formatBytes = bytes => {
28551
29077
  *
28552
29078
  * Supports single and multi-file selection with built-in validation for
28553
29079
  * file formats and size. In multi-file mode, selected files are listed
28554
- * below the input with individual remove controls.
29080
+ * below the input with individual remove controls. Single-file mode can opt
29081
+ * into the same list treatment via `showFileAttachment`.
28555
29082
  *
28556
29083
  * @example
28557
29084
  * ```tsx
@@ -28579,6 +29106,36 @@ const formatBytes = bytes => {
28579
29106
  * onChange={setFiles}
28580
29107
  * />
28581
29108
  * ```
29109
+ *
29110
+ * @example
29111
+ * ```tsx
29112
+ * // Multi-file with per-file upload progress, driven by the consumer's own
29113
+ * // upload requests — FileUpload only handles local selection, so it has no
29114
+ * // progress data of its own.
29115
+ * <FileUpload
29116
+ * isMultiFile
29117
+ * value={files}
29118
+ * onChange={setFiles}
29119
+ * uploadProgress={[
29120
+ * { name: 'report.pdf', progress: 50 },
29121
+ * { name: 'photo.png', progress: 100 },
29122
+ * ]}
29123
+ * />
29124
+ * ```
29125
+ *
29126
+ * @example
29127
+ * ```tsx
29128
+ * // Single file, shown as a FileAttachment card below the input (icon,
29129
+ * // size, delete button, image preview) instead of inline text next to the
29130
+ * // button. `uploadProgress` here can just be a single number, since there's
29131
+ * // only ever one file.
29132
+ * <FileUpload
29133
+ * showFileAttachment
29134
+ * value={file}
29135
+ * onChange={(files) => setFile(files[0])}
29136
+ * uploadProgress={70}
29137
+ * />
29138
+ * ```
28582
29139
  */
28583
29140
  const FileUpload = ({
28584
29141
  label,
@@ -28595,6 +29152,8 @@ const FileUpload = ({
28595
29152
  maxFiles,
28596
29153
  withDropArea = false,
28597
29154
  uploadedSectionTitle,
29155
+ uploadProgress,
29156
+ showFileAttachment = false,
28598
29157
  value,
28599
29158
  onChange,
28600
29159
  onFileRejected
@@ -28657,8 +29216,8 @@ const FileUpload = ({
28657
29216
  };
28658
29217
  const acceptAttr = allowedFormats?.map(f => `.${f}`).join(',');
28659
29218
  const hasError = !!error;
28660
- const inlineFileName = !isMultiFile && files[0]?.name;
28661
- const showUploadedFiles = isMultiFile && files.length > 0;
29219
+ const inlineFileName = !isMultiFile && !showFileAttachment && files[0]?.name;
29220
+ const attachmentFiles = isMultiFile || showFileAttachment && !withDropArea ? files : [];
28662
29221
  return (0,jsx_runtime_namespaceObject.jsxs)("div", {
28663
29222
  css: [wrapper, css, true ? "" : 0, true ? "" : 0],
28664
29223
  className: className,
@@ -28684,7 +29243,7 @@ const FileUpload = ({
28684
29243
  onKeyDown: e => e.key === 'Enter' && !files[0] && handleChooseClick(),
28685
29244
  children: !isMultiFile && files[0] ? (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
28686
29245
  children: [(0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
28687
- name: "file-pdf",
29246
+ name: getFileTypeIcon(files[0].name) ?? 'picture',
28688
29247
  size: 36,
28689
29248
  color: theme.colors.greyDarker60
28690
29249
  }), (0,jsx_runtime_namespaceObject.jsx)("span", {
@@ -28741,15 +29300,20 @@ const FileUpload = ({
28741
29300
  marginTop: 12
28742
29301
  } : undefined,
28743
29302
  children: error || helperText
28744
- }), showUploadedFiles && (0,jsx_runtime_namespaceObject.jsxs)("div", {
29303
+ }), attachmentFiles.length > 0 && (0,jsx_runtime_namespaceObject.jsxs)("div", {
28745
29304
  css: filesList,
28746
29305
  children: [uploadedSectionTitle && (0,jsx_runtime_namespaceObject.jsx)("span", {
28747
29306
  css: filesListTitle(theme),
28748
29307
  children: uploadedSectionTitle
28749
- }), files.map((file, index) => (0,jsx_runtime_namespaceObject.jsx)(FileUpload_FileUploadItem, {
28750
- file: file,
28751
- onRemove: handleRemove,
28752
- disabled: disabled
29308
+ }), attachmentFiles.map((file, index) => (0,jsx_runtime_namespaceObject.jsx)(FileAttachment_FileAttachment, {
29309
+ file: {
29310
+ name: file.name,
29311
+ size: file.size,
29312
+ content: file
29313
+ },
29314
+ progress: getFileProgress(file, index, files, uploadProgress),
29315
+ onRemove: () => handleRemove(file),
29316
+ isDisabled: disabled
28753
29317
  }, `${file.name}-${index}`))]
28754
29318
  })]
28755
29319
  });
@@ -43141,29 +43705,6 @@ var nivo_legends_v=function(e){var i=e.x,n=e.y,o=e.size,r=e.fill,l=e.opacity,a=v
43141
43705
  function nivo_pie_E(){return nivo_pie_E=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},nivo_pie_E.apply(null,arguments)}function nivo_pie_F(e,i){if(null==e)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==i.indexOf(a))continue;t[a]=e[a]}return t}var nivo_pie_X,nivo_pie_Y=function(e){var i=e.width,t=e.height,a=e.legends,n=e.data,r=e.toggleSerie;return (0,external_react_jsx_runtime_namespaceObject.jsx)(external_react_jsx_runtime_namespaceObject.Fragment,{children:a.map((function(e,a){var o;return (0,external_react_jsx_runtime_namespaceObject.jsx)(nivo_legends_E,nivo_pie_E({},e,{containerWidth:i,containerHeight:t,data:null!=(o=e.data)?o:n,toggleSerie:e.toggleSerie?r:void 0}),a)}))})},nivo_pie_P={id:"id",value:"value",sortByValue:!1,innerRadius:0,padAngle:0,cornerRadius:0,layers:["arcs","arcLinkLabels","arcLabels","legends"],startAngle:0,endAngle:360,fit:!0,activeInnerRadiusOffset:0,activeOuterRadiusOffset:0,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableArcLabels:!0,arcLabel:"formattedValue",arcLabelsSkipAngle:0,arcLabelsSkipRadius:0,arcLabelsRadiusOffset:.5,arcLabelsTextColor:{theme:"labels.text.fill"},enableArcLinkLabels:!0,arcLinkLabel:"id",arcLinkLabelsSkipAngle:0,arcLinkLabelsOffset:0,arcLinkLabelsDiagonalLength:16,arcLinkLabelsStraightLength:24,arcLinkLabelsThickness:1,arcLinkLabelsTextOffset:6,arcLinkLabelsTextColor:{theme:"labels.text.fill"},arcLinkLabelsColor:{theme:"axis.ticks.line.stroke"},colors:{scheme:"nivo"},defs:[],fill:[],isInteractive:!0,animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",tooltip:function(e){var i=e.datum;return (0,external_react_jsx_runtime_namespaceObject.jsx)(T,{id:i.id,value:i.formattedValue,enableChip:!0,color:i.color})},legends:[],role:"img",pixelRatio:"undefined"!=typeof window&&null!=(nivo_pie_X=window.devicePixelRatio)?nivo_pie_X:1},nivo_pie_j=["points"],nivo_pie_q=function(i){var t=i.data,a=i.id,n=void 0===a?nivo_pie_P.id:a,r=i.value,o=void 0===r?nivo_pie_P.value:r,d=i.valueFormat,c=i.colors,u=void 0===c?nivo_pie_P.colors:c,f=bn(n),v=bn(o),g=hn(d),h=hr(u,"id");return (0,external_react_namespaceObject.useMemo)((function(){return t.map((function(e){var i,t=f(e),a=v(e),n={id:t,label:null!=(i=e.label)?i:t,hidden:!1,value:a,formattedValue:g(a),data:e};return nivo_pie_E({},n,{color:h(n)})}))}),[t,f,v,g,h])},nivo_pie_J=function(a){var n=a.data,r=a.startAngle,o=a.endAngle,d=a.innerRadius,l=a.outerRadius,s=a.padAngle,f=a.sortByValue,v=a.activeId,g=a.activeInnerRadiusOffset,h=a.activeOuterRadiusOffset,L=a.hiddenIds,b=a.forwardLegendData,A=(0,external_react_namespaceObject.useMemo)((function(){var e=pie().value((function(e){return e.value})).startAngle(ut(r)).endAngle(ut(o)).padAngle(ut(s));return f||e.sortValues(null),e}),[r,o,s,f]),p=(0,external_react_namespaceObject.useMemo)((function(){var e=n.filter((function(e){return!L.includes(e.id)}));return{dataWithArc:A(e).map((function(e){var i=Math.abs(e.endAngle-e.startAngle);return nivo_pie_E({},e.data,{arc:{index:e.index,startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:v===e.data.id?d-g:d,outerRadius:v===e.data.id?l+h:l,thickness:l-d,padAngle:e.padAngle,angle:i,angleDeg:ct(i)}})})),legendData:n.map((function(e){return{id:e.id,label:e.label,color:e.color,hidden:L.includes(e.id),data:e}}))}}),[A,n,L,v,d,g,l,h]),R=p.legendData,k=(0,external_react_namespaceObject.useRef)(b);return (0,external_react_namespaceObject.useEffect)((function(){"function"==typeof k.current&&k.current(R)}),[k,R]),p},nivo_pie_K=function(e){var i=e.activeId,t=e.onActiveIdChange,r=e.defaultActiveId,o=void 0!==i,d=(0,external_react_namespaceObject.useState)(o?null:void 0===r?null:r),l=d[0],s=d[1];return{activeId:o?i:l,setActiveId:(0,external_react_namespaceObject.useCallback)((function(e){t&&t(e),o||s(e)}),[o,t,s])}},nivo_pie_N=function(e){var i=e.data,t=e.radius,r=e.innerRadius,o=e.startAngle,d=void 0===o?nivo_pie_P.startAngle:o,l=e.endAngle,s=void 0===l?nivo_pie_P.endAngle:l,u=e.padAngle,f=void 0===u?nivo_pie_P.padAngle:u,v=e.sortByValue,g=void 0===v?nivo_pie_P.sortByValue:v,h=e.cornerRadius,L=void 0===h?nivo_pie_P.cornerRadius:h,b=e.activeInnerRadiusOffset,A=void 0===b?nivo_pie_P.activeInnerRadiusOffset:b,R=e.activeOuterRadiusOffset,k=void 0===R?nivo_pie_P.activeOuterRadiusOffset:R,m=e.activeId,I=e.onActiveIdChange,O=e.defaultActiveId,C=e.forwardLegendData,w=nivo_pie_K({activeId:m,onActiveIdChange:I,defaultActiveId:O}),x=w.activeId,W=w.setActiveId,M=a([]),y=M[0],S=M[1],T=nivo_pie_J({data:i,startAngle:d,endAngle:s,innerRadius:r,outerRadius:t,padAngle:f,sortByValue:g,activeId:x,activeInnerRadiusOffset:A,activeOuterRadiusOffset:k,hiddenIds:y,forwardLegendData:C}),D=n((function(e){S((function(i){return i.indexOf(e)>-1?i.filter((function(i){return i!==e})):[].concat(i,[e])}))}),[]);return nivo_pie_E({},T,{arcGenerator:p({cornerRadius:L,padAngle:c(f)}),setActiveId:W,toggleSerie:D})},nivo_pie_Q=function(i){var t=i.data,r=i.width,o=i.height,d=i.innerRadius,l=void 0===d?nivo_pie_P.innerRadius:d,s=i.startAngle,u=void 0===s?nivo_pie_P.startAngle:s,f=i.endAngle,v=void 0===f?nivo_pie_P.endAngle:f,g=i.padAngle,h=void 0===g?nivo_pie_P.padAngle:g,L=i.sortByValue,b=void 0===L?nivo_pie_P.sortByValue:L,A=i.cornerRadius,k=void 0===A?nivo_pie_P.cornerRadius:A,m=i.fit,I=void 0===m?nivo_pie_P.fit:m,O=i.activeInnerRadiusOffset,C=void 0===O?nivo_pie_P.activeInnerRadiusOffset:O,w=i.activeOuterRadiusOffset,x=void 0===w?nivo_pie_P.activeOuterRadiusOffset:w,W=i.activeId,M=i.onActiveIdChange,y=i.defaultActiveId,S=i.forwardLegendData,T=nivo_pie_K({activeId:W,onActiveIdChange:M,defaultActiveId:y}),D=T.activeId,V=T.setActiveId,B=(0,external_react_namespaceObject.useState)([]),z=B[0],H=B[1],G=(0,external_react_namespaceObject.useMemo)((function(){var e,i=Math.min(r,o)/2,t=i*Math.min(l,1),a=r/2,n=o/2;if(I){var d=nivo_arcs_sn(a,n,i,u-90,v-90),s=d.points,c=nivo_pie_F(d,nivo_pie_j),f=Math.min(r/c.width,o/c.height),g={width:c.width*f,height:c.height*f};g.x=(r-g.width)/2,g.y=(o-g.height)/2,a=(a-c.x)/c.width*c.width*f+g.x,n=(n-c.y)/c.height*c.height*f+g.y,e={box:c,ratio:f,points:s},i*=f,t*=f}return{centerX:a,centerY:n,radius:i,innerRadius:t,debug:e}}),[r,o,l,u,v,I]),X=nivo_pie_J({data:t,startAngle:u,endAngle:v,innerRadius:G.innerRadius,outerRadius:G.radius,padAngle:h,sortByValue:b,activeId:D,activeInnerRadiusOffset:C,activeOuterRadiusOffset:x,hiddenIds:z,forwardLegendData:S}),Y=(0,external_react_namespaceObject.useCallback)((function(e){H((function(i){return i.indexOf(e)>-1?i.filter((function(i){return i!==e})):[].concat(i,[e])}))}),[]);return nivo_pie_E({arcGenerator:nivo_arcs_fn({cornerRadius:k,padAngle:ut(h)}),activeId:D,setActiveId:V,toggleSerie:Y},X,G)},nivo_pie_U=function(i){var t=i.dataWithArc,a=i.arcGenerator,n=i.centerX,r=i.centerY,o=i.radius,d=i.innerRadius;return (0,external_react_namespaceObject.useMemo)((function(){return{dataWithArc:t,arcGenerator:a,centerX:n,centerY:r,radius:o,innerRadius:d}}),[t,a,n,r,o,d])},Z=function(i){var t=i.center,a=i.data,n=i.arcGenerator,o=i.borderWidth,d=i.borderColor,l=i.isInteractive,s=i.onClick,c=i.onMouseEnter,u=i.onMouseMove,f=i.onMouseLeave,v=i.setActiveId,g=i.tooltip,h=i.transitionMode,L=nivo_tooltip_z(),b=L.showTooltipFromEvent,A=L.hideTooltip,p=(0,external_react_namespaceObject.useMemo)((function(){if(l)return function(e,i){null==s||s(e,i)}}),[l,s]),R=(0,external_react_namespaceObject.useMemo)((function(){if(l)return function(e,i){b((0,external_react_namespaceObject.createElement)(g,{datum:e}),i),v(e.id),null==c||c(e,i)}}),[l,b,v,c,g]),m=(0,external_react_namespaceObject.useMemo)((function(){if(l)return function(e,i){b((0,external_react_namespaceObject.createElement)(g,{datum:e}),i),null==u||u(e,i)}}),[l,b,u,g]),I=(0,external_react_namespaceObject.useMemo)((function(){if(l)return function(e,i){A(),v(null),null==f||f(e,i)}}),[l,A,v,f]);return (0,external_react_jsx_runtime_namespaceObject.jsx)(nivo_arcs_un,{center:t,data:a,arcGenerator:n,borderWidth:o,borderColor:d,transitionMode:h,onClick:p,onMouseEnter:R,onMouseMove:m,onMouseLeave:I})},nivo_pie_$=["isInteractive","animate","motionConfig","theme","renderWrapper"],nivo_pie_=function(e){var i=e.data,t=e.id,a=void 0===t?nivo_pie_P.id:t,n=e.value,o=void 0===n?nivo_pie_P.value:n,l=e.valueFormat,s=e.sortByValue,c=void 0===s?nivo_pie_P.sortByValue:s,u=e.layers,f=void 0===u?nivo_pie_P.layers:u,L=e.startAngle,b=void 0===L?nivo_pie_P.startAngle:L,A=e.endAngle,p=void 0===A?nivo_pie_P.endAngle:A,R=e.padAngle,k=void 0===R?nivo_pie_P.padAngle:R,O=e.fit,C=void 0===O?nivo_pie_P.fit:O,w=e.innerRadius,x=void 0===w?nivo_pie_P.innerRadius:w,W=e.cornerRadius,M=void 0===W?nivo_pie_P.cornerRadius:W,y=e.activeInnerRadiusOffset,T=void 0===y?nivo_pie_P.activeInnerRadiusOffset:y,D=e.activeOuterRadiusOffset,V=void 0===D?nivo_pie_P.activeOuterRadiusOffset:D,B=e.width,z=e.height,H=e.margin,G=e.colors,E=void 0===G?nivo_pie_P.colors:G,F=e.borderWidth,X=void 0===F?nivo_pie_P.borderWidth:F,j=e.borderColor,J=void 0===j?nivo_pie_P.borderColor:j,K=e.enableArcLabels,N=void 0===K?nivo_pie_P.enableArcLabels:K,$=e.arcLabel,_=void 0===$?nivo_pie_P.arcLabel:$,ee=e.arcLabelsSkipAngle,ie=void 0===ee?nivo_pie_P.arcLabelsSkipAngle:ee,te=e.arcLabelsSkipRadius,ae=void 0===te?nivo_pie_P.arcLabelsSkipRadius:te,ne=e.arcLabelsTextColor,re=void 0===ne?nivo_pie_P.arcLabelsTextColor:ne,oe=e.arcLabelsRadiusOffset,de=void 0===oe?nivo_pie_P.arcLabelsRadiusOffset:oe,le=e.arcLabelsComponent,se=e.enableArcLinkLabels,ce=void 0===se?nivo_pie_P.enableArcLinkLabels:se,ue=e.arcLinkLabel,fe=void 0===ue?nivo_pie_P.arcLinkLabel:ue,ve=e.arcLinkLabelsSkipAngle,ge=void 0===ve?nivo_pie_P.arcLinkLabelsSkipAngle:ve,he=e.arcLinkLabelsOffset,Le=void 0===he?nivo_pie_P.arcLinkLabelsOffset:he,be=e.arcLinkLabelsDiagonalLength,Ae=void 0===be?nivo_pie_P.arcLinkLabelsDiagonalLength:be,pe=e.arcLinkLabelsStraightLength,Re=void 0===pe?nivo_pie_P.arcLinkLabelsStraightLength:pe,ke=e.arcLinkLabelsThickness,me=void 0===ke?nivo_pie_P.arcLinkLabelsThickness:ke,Ie=e.arcLinkLabelsTextOffset,Oe=void 0===Ie?nivo_pie_P.arcLinkLabelsTextOffset:Ie,Ce=e.arcLinkLabelsTextColor,we=void 0===Ce?nivo_pie_P.arcLinkLabelsTextColor:Ce,xe=e.arcLinkLabelsColor,We=void 0===xe?nivo_pie_P.arcLinkLabelsColor:xe,Me=e.arcLinkLabelComponent,ye=e.defs,Se=void 0===ye?nivo_pie_P.defs:ye,Te=e.fill,De=void 0===Te?nivo_pie_P.fill:Te,Ve=e.isInteractive,Be=void 0===Ve?nivo_pie_P.isInteractive:Ve,ze=e.onClick,He=e.onMouseEnter,Ge=e.onMouseMove,Ee=e.onMouseLeave,Fe=e.tooltip,Xe=void 0===Fe?nivo_pie_P.tooltip:Fe,Ye=e.activeId,Pe=e.onActiveIdChange,je=e.defaultActiveId,qe=e.transitionMode,Je=void 0===qe?nivo_pie_P.transitionMode:qe,Ke=e.legends,Ne=void 0===Ke?nivo_pie_P.legends:Ke,Qe=e.forwardLegendData,Ue=e.role,Ze=void 0===Ue?nivo_pie_P.role:Ue,$e=e.forwardedRef,_e=cn(B,z,H),ei=_e.outerWidth,ii=_e.outerHeight,ti=_e.margin,ai=_e.innerWidth,ni=_e.innerHeight,ri=nivo_pie_q({data:i,id:a,value:o,valueFormat:l,colors:E}),oi=nivo_pie_Q({data:ri,width:ai,height:ni,fit:C,innerRadius:x,startAngle:b,endAngle:p,padAngle:k,sortByValue:c,cornerRadius:M,activeInnerRadiusOffset:T,activeOuterRadiusOffset:V,activeId:Ye,onActiveIdChange:Pe,defaultActiveId:je,forwardLegendData:Qe}),di=oi.dataWithArc,li=oi.legendData,si=oi.arcGenerator,ci=oi.centerX,ui=oi.centerY,fi=oi.radius,vi=oi.innerRadius,gi=oi.setActiveId,hi=oi.toggleSerie,Li=Mn(Se,di,De),bi={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};f.includes("arcs")&&(bi.arcs=(0,external_react_jsx_runtime_namespaceObject.jsx)(Z,{center:[ci,ui],data:di,arcGenerator:si,borderWidth:X,borderColor:J,isInteractive:Be,onClick:ze,onMouseEnter:He,onMouseMove:Ge,onMouseLeave:Ee,setActiveId:gi,tooltip:Xe,transitionMode:Je},"arcs")),ce&&f.includes("arcLinkLabels")&&(bi.arcLinkLabels=(0,external_react_jsx_runtime_namespaceObject.jsx)(Y,{center:[ci,ui],data:di,label:fe,skipAngle:ge,offset:Le,diagonalLength:Ae,straightLength:Re,strokeWidth:me,textOffset:Oe,textColor:we,linkColor:We,component:Me},"arcLinkLabels")),N&&f.includes("arcLabels")&&(bi.arcLabels=(0,external_react_jsx_runtime_namespaceObject.jsx)(q,{center:[ci,ui],data:di,label:_,radiusOffset:de,skipAngle:ie,skipRadius:ae,textColor:re,transitionMode:Je,component:le},"arcLabels")),Ne.length>0&&f.includes("legends")&&(bi.legends=(0,external_react_jsx_runtime_namespaceObject.jsx)(nivo_pie_Y,{width:ai,height:ni,data:li,legends:Ne,toggleSerie:hi},"legends"));var Ai=nivo_pie_U({dataWithArc:di,arcGenerator:si,centerX:ci,centerY:ui,radius:fi,innerRadius:vi});return (0,external_react_jsx_runtime_namespaceObject.jsx)(Rt,{width:ei,height:ii,margin:ti,defs:Li,role:Ze,ref:$e,children:f.map((function(e,i){return void 0!==bi[e]?bi[e]:"function"==typeof e?(0,external_react_jsx_runtime_namespaceObject.jsx)(external_react_namespaceObject.Fragment,{children:(0,external_react_namespaceObject.createElement)(e,Ai)},i):null}))})},ee=(0,external_react_namespaceObject.forwardRef)((function(e,i){var t=e.isInteractive,a=void 0===t?nivo_pie_P.isInteractive:t,n=e.animate,r=void 0===n?nivo_pie_P.animate:n,o=e.motionConfig,d=void 0===o?nivo_pie_P.motionConfig:o,l=e.theme,s=e.renderWrapper,c=nivo_pie_F(e,nivo_pie_$);return (0,external_react_jsx_runtime_namespaceObject.jsx)(Fr,{animate:r,isInteractive:a,motionConfig:d,renderWrapper:s,theme:l,children:(0,external_react_jsx_runtime_namespaceObject.jsx)(nivo_pie_,nivo_pie_E({isInteractive:a},c,{forwardedRef:i}))})})),ie=["defaultWidth","defaultHeight","onResize","debounceResize"],te=(0,external_react_namespaceObject.forwardRef)((function(e,i){var t=e.defaultWidth,a=e.defaultHeight,n=e.onResize,r=e.debounceResize,o=nivo_pie_F(e,ie);return (0,external_react_jsx_runtime_namespaceObject.jsx)($r,{defaultWidth:t,defaultHeight:a,onResize:n,debounceResize:r,children:function(e){var t=e.width,a=e.height;return (0,external_react_jsx_runtime_namespaceObject.jsx)(ee,nivo_pie_E({width:t,height:a},o,{ref:i}))}})})),nivo_pie_ae=["isInteractive","theme","renderWrapper"],ne=function(a){var n=a.data,o=a.id,d=void 0===o?nivo_pie_P.id:o,l=a.value,s=void 0===l?nivo_pie_P.value:l,c=a.valueFormat,u=a.sortByValue,f=void 0===u?nivo_pie_P.sortByValue:u,g=a.startAngle,h=void 0===g?nivo_pie_P.startAngle:g,L=a.endAngle,p=void 0===L?nivo_pie_P.endAngle:L,R=a.padAngle,k=void 0===R?nivo_pie_P.padAngle:R,m=a.fit,I=void 0===m?nivo_pie_P.fit:m,M=a.innerRadius,T=void 0===M?nivo_pie_P.innerRadius:M,D=a.cornerRadius,V=void 0===D?nivo_pie_P.cornerRadius:D,z=a.activeInnerRadiusOffset,F=void 0===z?nivo_pie_P.activeInnerRadiusOffset:z,X=a.activeOuterRadiusOffset,Y=void 0===X?nivo_pie_P.activeOuterRadiusOffset:X,j=a.width,J=a.height,K=a.margin,N=a.pixelRatio,U=void 0===N?nivo_pie_P.pixelRatio:N,Z=a.colors,$=void 0===Z?nivo_pie_P.colors:Z,_=a.borderWidth,ee=void 0===_?nivo_pie_P.borderWidth:_,ie=a.borderColor,te=void 0===ie?nivo_pie_P.borderColor:ie,ae=a.enableArcLabels,ne=void 0===ae?nivo_pie_P.enableArcLabels:ae,re=a.arcLabel,oe=void 0===re?nivo_pie_P.arcLabel:re,de=a.arcLabelsSkipAngle,le=void 0===de?nivo_pie_P.arcLabelsSkipAngle:de,se=a.arcLabelsTextColor,ce=void 0===se?nivo_pie_P.arcLabelsTextColor:se,ue=a.arcLabelsRadiusOffset,fe=void 0===ue?nivo_pie_P.arcLabelsRadiusOffset:ue,ve=a.enableArcLinkLabels,ge=void 0===ve?nivo_pie_P.enableArcLinkLabels:ve,he=a.arcLinkLabel,Le=void 0===he?nivo_pie_P.arcLinkLabel:he,be=a.arcLinkLabelsSkipAngle,Ae=void 0===be?nivo_pie_P.arcLinkLabelsSkipAngle:be,pe=a.arcLinkLabelsOffset,Re=void 0===pe?nivo_pie_P.arcLinkLabelsOffset:pe,ke=a.arcLinkLabelsDiagonalLength,me=void 0===ke?nivo_pie_P.arcLinkLabelsDiagonalLength:ke,Ie=a.arcLinkLabelsStraightLength,Oe=void 0===Ie?nivo_pie_P.arcLinkLabelsStraightLength:Ie,Ce=a.arcLinkLabelsThickness,we=void 0===Ce?nivo_pie_P.arcLinkLabelsThickness:Ce,xe=a.arcLinkLabelsTextOffset,We=void 0===xe?nivo_pie_P.arcLinkLabelsTextOffset:xe,Me=a.arcLinkLabelsTextColor,ye=void 0===Me?nivo_pie_P.arcLinkLabelsTextColor:Me,Se=a.arcLinkLabelsColor,Te=void 0===Se?nivo_pie_P.arcLinkLabelsColor:Se,De=a.isInteractive,Ve=void 0===De?nivo_pie_P.isInteractive:De,Be=a.onClick,ze=a.onMouseMove,He=a.tooltip,Ge=void 0===He?nivo_pie_P.tooltip:He,Ee=a.activeId,Fe=a.onActiveIdChange,Xe=a.defaultActiveId,Ye=a.legends,Pe=void 0===Ye?nivo_pie_P.legends:Ye,je=a.forwardLegendData,qe=a.role,Je=a.forwardedRef,Ke=(0,external_react_namespaceObject.useRef)(null),Ne=nivo_theming_M(),Qe=cn(j,J,K),Ue=Qe.margin,Ze=Qe.innerWidth,$e=Qe.innerHeight,_e=Qe.outerWidth,ei=Qe.outerHeight,ii=nivo_pie_q({data:n,id:d,value:s,valueFormat:c,colors:$}),ti=nivo_pie_Q({data:ii,width:Ze,height:$e,fit:I,innerRadius:T,startAngle:h,endAngle:p,padAngle:k,sortByValue:f,cornerRadius:V,activeInnerRadiusOffset:F,activeOuterRadiusOffset:Y,activeId:Ee,onActiveIdChange:Fe,defaultActiveId:Xe,forwardLegendData:je}),ai=ti.dataWithArc,ni=ti.arcGenerator,ri=ti.centerX,oi=ti.centerY,di=ti.radius,li=ti.innerRadius,si=ti.setActiveId,ci=nivo_colors_Ye(te,Ne),ui=nivo_arcs_D({data:ai,label:oe,skipAngle:le,offset:fe,textColor:ce}),fi=nivo_arcs_({data:ai,skipAngle:Ae,offset:Re,diagonalLength:me,straightLength:Oe,label:Le,linkColor:Te,textOffset:We,textColor:ye});(0,external_react_namespaceObject.useEffect)((function(){if(Ke.current){Ke.current.width=_e*U,Ke.current.height=ei*U;var e=Ke.current.getContext("2d");e.scale(U,U),e.fillStyle=Ne.background,e.fillRect(0,0,_e,ei),e.save(),e.translate(Ue.left,Ue.top),ni.context(e),e.save(),e.translate(ri,oi),ai.forEach((function(i){e.beginPath(),e.fillStyle=i.color,e.strokeStyle=ci(i),e.lineWidth=ee,ni(i.arc),e.fill(),ee>0&&e.stroke()})),!0===ge&&nivo_arcs_Z(e,fi,Ne,we),!0===ne&&nivo_arcs_z(e,ui,Ne),e.restore(),Pe.forEach((function(i){nivo_legends_L(e,nivo_pie_E({},i,{data:ai,containerWidth:Ze,containerHeight:$e,theme:Ne}))}))}}),[Ke,Ze,$e,_e,ei,Ue.top,Ue.left,U,ri,oi,ni,ai,ee,ci,ne,ui,ge,fi,we,Pe,Ne]);var vi=(0,external_react_namespaceObject.useMemo)((function(){return ai.map((function(e){return nivo_pie_E({id:e.id},e.arc)}))}),[ai]),gi=function(e){if(!Ke.current)return null;var i=kn(Ke.current,e),t=i[0],a=i[1],n=nivo_arcs_dn(Ue.left+ri,Ue.top+oi,di,li,vi,t,a);return n?ai.find((function(e){return e.id===n.id})):null},hi=nivo_tooltip_z(),Li=hi.showTooltipFromEvent,bi=hi.hideTooltip,Ai=function(e){var i=gi(e);i?(null==ze||ze(i,e),si(i.id),Li((0,external_react_namespaceObject.createElement)(Ge,{datum:i}),e)):(si(null),bi())};return (0,external_react_jsx_runtime_namespaceObject.jsx)("canvas",{ref:Rn(Ke,Je),width:_e*U,height:ei*U,style:{width:_e,height:ei,cursor:Ve?"auto":"normal"},onMouseEnter:Ve?Ai:void 0,onMouseMove:Ve?Ai:void 0,onMouseLeave:Ve?function(){bi()}:void 0,onClick:Ve?function(e){if(Be){var i=gi(e);i&&Be(i,e)}}:void 0,role:qe})},nivo_pie_re=(0,external_react_namespaceObject.forwardRef)((function(e,i){var t=e.isInteractive,a=void 0===t?nivo_pie_P.isInteractive:t,n=e.theme,r=e.renderWrapper,o=nivo_pie_F(e,nivo_pie_ae);return (0,external_react_jsx_runtime_namespaceObject.jsx)(Fr,{isInteractive:a,renderWrapper:r,theme:n,children:(0,external_react_jsx_runtime_namespaceObject.jsx)(ne,nivo_pie_E({isInteractive:a},o,{forwardedRef:i}))})})),oe=["defaultWidth","defaultHeight","onResize","debounceResize"],nivo_pie_de=(0,external_react_namespaceObject.forwardRef)((function(e,i){var t=e.defaultWidth,a=e.defaultHeight,n=e.onResize,r=e.debounceResize,o=nivo_pie_F(e,oe);return (0,external_react_jsx_runtime_namespaceObject.jsx)($r,{defaultWidth:t,defaultHeight:a,onResize:n,debounceResize:r,children:function(e){var t=e.width,a=e.height;return (0,external_react_jsx_runtime_namespaceObject.jsx)(nivo_pie_re,nivo_pie_E({width:t,height:a},o,{ref:i}))}})}));
43142
43706
  //# sourceMappingURL=nivo-pie.mjs.map
43143
43707
 
43144
- ;// external "react-router-dom"
43145
- const external_react_router_dom_namespaceObject = require("react-router-dom");
43146
- ;// ./src/components/WithLink.tsx
43147
- function WithLink_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
43148
-
43149
-
43150
-
43151
- var WithLink_ref = true ? {
43152
- name: "me5k4h",
43153
- styles: "text-decoration:none;div{cursor:pointer;}"
43154
- } : 0;
43155
- const WithLink = ({
43156
- link,
43157
- onClick,
43158
- children,
43159
- className
43160
- }) => link ? (0,jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Link, {
43161
- to: link,
43162
- onClick: onClick,
43163
- className: className,
43164
- css: WithLink_ref,
43165
- children: children
43166
- }) : children;
43167
43708
  ;// ./src/components/WidgetCard/WidgetCardBase.tsx
43168
43709
 
43169
43710
 
@@ -53986,7 +54527,7 @@ function History_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have trie
53986
54527
 
53987
54528
  const FIRST_LINE_TOP_PADDING = 2;
53988
54529
  const FIRST_LINE_HEIGHT = 20;
53989
- const container = true ? {
54530
+ const styles_container = true ? {
53990
54531
  name: "1fttcpj",
53991
54532
  styles: "display:flex;flex-direction:column"
53992
54533
  } : 0;
@@ -54053,7 +54594,7 @@ const History_History = ({
54053
54594
  const circleTopOffset = Math.max(0, FIRST_LINE_TOP_PADDING + (FIRST_LINE_HEIGHT - circleSize) / 2);
54054
54595
  return (0,jsx_runtime_namespaceObject.jsx)("div", {
54055
54596
  "data-testid": "history",
54056
- css: container,
54597
+ css: styles_container,
54057
54598
  style: sx,
54058
54599
  children: items.map((item, index) => {
54059
54600
  const isLast = index === items.length - 1;
@@ -58502,6 +59043,7 @@ const UserProfile = ({
58502
59043
 
58503
59044
 
58504
59045
 
59046
+
58505
59047
 
58506
59048
 
58507
59049
  // ============================================================================