@acronis-platform/ui-react 5.1.1 → 5.3.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/components/ui/area-chart/area-chart.js +107 -107
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +162 -162
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/category-bar/category-bar.js +50 -50
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart.js +53 -40
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +1 -1
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js +1 -1
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/composed-chart/composed-chart.js +146 -146
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +97 -97
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +2 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +120 -120
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +58 -58
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/input-num-picker/input-num-picker.js.map +1 -1
- package/dist/components/ui/input-select/input-select.js +1 -1
- package/dist/components/ui/input-select/input-select.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +91 -91
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/number-field/number-field.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +92 -92
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +37 -37
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +112 -112
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +78 -78
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +57 -57
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/sidebar-primary/sidebar-primary.js +10 -5
- package/dist/components/ui/sidebar-primary/sidebar-primary.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +87 -87
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/index.js +111 -111
- package/dist/llms/checkbox.md +63 -12
- package/dist/llms/sidebar-primary.md +18 -1
- package/dist/llms.txt +1 -1
- package/dist/react.js +111 -111
- package/dist/src/components/ui/chart/chart.d.ts +1 -0
- package/dist/src/components/ui/chart/index.d.ts +1 -1
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +3 -2
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +1 -1
- package/dist/src/components/ui/sidebar-primary/sidebar-primary.d.ts +23 -0
- package/dist/src/components/ui/treemap/treemap.d.ts +3 -2
- package/dist/ui-react.css +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-select.js","names":[],"sources":["../../../../src/components/ui/input-select/input-select.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Select as SelectPrimitive } from '@base-ui/react/select';\nimport {\n CheckIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n CircleWarningIcon,\n InboxIcon,\n MagnifierIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\nimport { usePortalContainer } from '@/lib/portal-container';\n\n// The next-gen select, themed by the dedicated `--ui-input-select-*` tier (global /\n// normal / error / dropdown). It composes Base UI `Select` and adds the field\n// furniture (label, required, description, error) and the dropdown machinery\n// (in-dropdown search, sections/groups, single + multiple items, loading/empty/error\n// status). The trigger box wires each state to its own token — idle / hover / open\n// (`data-popup-open`) + focus ring / disabled — and switches to the error border +\n// `--ui-focus-error` ring when `aria-invalid` is set. Selection mode (single vs\n// multiple) flows from the `multiple` prop on the root via `InputSelectModeContext`:\n// single items toggle the row background and show a trailing check; multiple items\n// keep the row background and show a leading checkbox.\n\nconst InputSelectModeContext = React.createContext(false);\n\ninterface InputSelectFilterContextValue {\n /** Current in-dropdown search query. */\n query: string;\n /** Update the search query. */\n setQuery: (query: string) => void;\n}\n\nconst InputSelectFilterContext =\n React.createContext<InputSelectFilterContextValue | null>(null);\n\n/**\n * Read the live in-dropdown search query (and its setter) from the nearest\n * `InputSelect`. Flat item lists filter themselves; use this for hierarchical\n * (tree) dropdowns that need to compute their own visibility.\n */\nfunction useInputSelectFilter(): InputSelectFilterContextValue {\n const context = React.useContext(InputSelectFilterContext);\n if (!context) {\n throw new Error('useInputSelectFilter must be used within <InputSelect>.');\n }\n return context;\n}\n\nfunction InputSelect<Value, Multiple extends boolean | undefined = false>(\n props: SelectPrimitive.Root.Props<Value, Multiple>\n) {\n const { onOpenChange } = props;\n const [query, setQuery] = React.useState('');\n const filter = React.useMemo(() => ({ query, setQuery }), [query]);\n\n // Reset the query when the popup closes so it reopens unfiltered, via two paths.\n // 1. `onOpenChange` — the only path in uncontrolled mode, where Base UI owns the\n // open state and reports every real transition. A consumer that calls\n // `eventDetails.cancel()` keeps the popup open (Base UI skips its own state\n // update too), so the query must survive that.\n // 2. The `open` prop transitioning true -> false — needed in controlled mode,\n // where a consumer can flip its own state directly (e.g. an external toggle\n // button whose click handler runs after it cancelled Base UI's outside-press\n // close) without `onOpenChange` ever firing for that transition. A cancelled\n // close leaves `open` at `true`, so this path preserves the query too.\n const handleOpenChange = React.useCallback<\n NonNullable<SelectPrimitive.Root.Props<Value, Multiple>['onOpenChange']>\n >(\n (open, eventDetails) => {\n onOpenChange?.(open, eventDetails);\n if (!open && !eventDetails.isCanceled) {\n setQuery('');\n }\n },\n [onOpenChange]\n );\n\n const controlledOpen = props.open;\n const previousOpenRef = React.useRef(controlledOpen);\n React.useEffect(() => {\n if (previousOpenRef.current && controlledOpen === false) {\n setQuery('');\n }\n previousOpenRef.current = controlledOpen;\n }, [controlledOpen]);\n\n return (\n <InputSelectModeContext.Provider value={Boolean(props.multiple)}>\n <InputSelectFilterContext.Provider value={filter}>\n <SelectPrimitive.Root {...props} onOpenChange={handleOpenChange} />\n </InputSelectFilterContext.Provider>\n </InputSelectModeContext.Provider>\n );\n}\nInputSelect.displayName = 'InputSelect';\n\nconst InputSelectGroup = SelectPrimitive.Group;\n\n/** Vertical field stack: label, trigger, description/error. */\nconst InputSelectField = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex min-w-[var(--ui-input-select-global-container-width-min)] flex-col gap-[var(--ui-input-select-global-container-gap)]',\n className\n )}\n {...props}\n />\n));\nInputSelectField.displayName = 'InputSelectField';\n\nconst InputSelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label> & {\n /** Appends a required `*` after the label text. */\n required?: boolean;\n }\n>(({ className, children, required, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\n 'flex gap-[var(--ui-input-select-global-container-label-gap)] text-sm leading-4 text-[var(--ui-input-select-global-label-color-idle)] data-[disabled]:text-[var(--ui-input-select-global-label-color-disabled)]',\n className\n )}\n {...props}\n >\n {children}\n {required && (\n <span\n aria-hidden=\"true\"\n className=\"text-[var(--ui-input-select-global-required-color)]\"\n >\n *\n </span>\n )}\n </SelectPrimitive.Label>\n));\nInputSelectLabel.displayName = 'InputSelectLabel';\n\nconst InputSelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'group flex h-[var(--ui-input-select-global-box-height)] w-full min-w-0 items-center gap-[var(--ui-input-select-global-box-gap)] rounded-[var(--ui-input-select-global-box-border-radius)] border bg-[var(--ui-input-select-global-box-color-idle)] border-[var(--ui-input-select-normal-box-border-color-idle)] px-[var(--ui-input-select-global-box-padding-x)] text-sm leading-6 text-[var(--ui-input-select-global-value-color-idle)] outline-none transition-colors',\n 'not-data-[disabled]:hover:bg-[var(--ui-input-select-global-box-color-hover)] not-data-[disabled]:hover:border-[var(--ui-input-select-normal-box-border-color-hover)]',\n 'focus-visible:border-[var(--ui-input-select-normal-box-border-color-hover)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]',\n 'data-[popup-open]:border-[var(--ui-input-select-normal-box-border-color-hover)] data-[popup-open]:ring-[3px] data-[popup-open]:ring-[var(--ui-focus-primary)]',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:border-[var(--ui-input-select-normal-box-border-color-disabled)] data-[disabled]:bg-[var(--ui-input-select-global-box-color-disabled)] data-[disabled]:text-[var(--ui-input-select-global-value-color-disabled)]',\n // Error treatment (driven by `aria-invalid`).\n 'aria-invalid:border-[var(--ui-input-select-error-box-border-color-idle)] not-data-[disabled]:aria-invalid:hover:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:focus-visible:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:focus-visible:ring-[var(--ui-focus-error)] aria-invalid:data-[popup-open]:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:data-[popup-open]:ring-[var(--ui-focus-error)]',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon className=\"flex size-[var(--ui-input-select-global-icon-box-size)] shrink-0 items-center justify-center text-[var(--ui-input-select-normal-icon-expand-color-idle)] group-data-[disabled]:text-[var(--ui-input-select-normal-icon-expand-color-disabled)]\">\n <ChevronDownIcon\n size={16}\n className=\"transition-transform group-data-[popup-open]:rotate-180\"\n />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nInputSelectTrigger.displayName = 'InputSelectTrigger';\n\nconst InputSelectValue = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Value>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Value\n ref={ref}\n className={cn(\n 'min-w-0 flex-1 truncate text-start text-[var(--ui-input-select-global-value-color-idle)] data-[placeholder]:text-[var(--ui-input-select-global-placeholder-color-idle)]',\n 'group-data-[disabled]:!text-[var(--ui-input-select-global-value-color-disabled)] group-data-[disabled]:data-[placeholder]:!text-[var(--ui-input-select-global-placeholder-color-disabled)]',\n className\n )}\n {...props}\n />\n));\nInputSelectValue.displayName = 'InputSelectValue';\n\nconst InputSelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Popup>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Popup> & {\n sideOffset?: number;\n align?: SelectPrimitive.Positioner.Props['align'];\n side?: SelectPrimitive.Positioner.Props['side'];\n /**\n * Offset in px along the alignment axis (perpendicular to `side`). Defaults\n * to Base UI's own `0` when omitted — pass a value to nudge the dropdown\n * along the trigger's edge without changing its `align`.\n */\n alignOffset?: SelectPrimitive.Positioner.Props['alignOffset'];\n /**\n * Collision-avoidance strategy. Defaults to Base UI's own flip/shift\n * behavior, which may move the dropdown off the requested `side`/`align`\n * when it doesn't fit. Pass `{ side: 'none', fallbackAxisSide: 'none' }`\n * alongside an explicit `side`/`align` to lock the popup to that placement\n * with no auto-flip fallback (e.g. \"always to the right, no matter what\":\n * `side=\"right\" sideOffset={20} collisionAvoidance={{ side: 'none',\n * fallbackAxisSide: 'none' }}`).\n */\n collisionAvoidance?: SelectPrimitive.Positioner.Props['collisionAvoidance'];\n /**\n * Element (or ref/getter) the popup positions itself against, overriding\n * the default of anchoring to `InputSelectTrigger`. Use when the visible\n * trigger isn't the element Base UI tracks internally — e.g. an external\n * button drives a hidden trigger, and the popup should align with the\n * button instead of the hidden trigger's layout position.\n */\n anchor?: SelectPrimitive.Positioner.Props['anchor'];\n /**\n * Container to portal the dropdown into. Defaults to the nearest\n * `PortalContainerProvider`, or `document.body` when there is none; pass an\n * element to scope the portal explicitly (e.g. a shadow root, so the popup\n * inherits styles defined there).\n */\n portalContainer?: SelectPrimitive.Portal.Props['container'];\n /**\n * Render the dropdown chrome like `PopoverContent` (`--ui-popover-container-*`\n * tokens, no shadow, fade/zoom/slide enter-exit animation) instead of the\n * default `--ui-input-select-dropdown-container-*` tokens + static `shadow-md`.\n * See `components/ui/popover/popover.tsx`.\n */\n isPopoverStyled?: boolean;\n }\n>(\n (\n {\n className,\n children,\n sideOffset = 4,\n align = 'start',\n side = 'bottom',\n alignOffset,\n collisionAvoidance,\n anchor,\n portalContainer,\n isPopoverStyled = false,\n ...props\n },\n ref\n ) => {\n const ctxContainer = usePortalContainer();\n const resolvedContainer = portalContainer ?? ctxContainer;\n\n return (\n <SelectPrimitive.Portal container={resolvedContainer}>\n <SelectPrimitive.Positioner\n sideOffset={sideOffset}\n align={align}\n side={side}\n alignOffset={alignOffset}\n collisionAvoidance={collisionAvoidance}\n anchor={anchor}\n alignItemWithTrigger={false}\n className=\"z-50 outline-none\"\n >\n <SelectPrimitive.Popup\n ref={ref}\n className={cn(\n 'max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-y-auto py-[var(--ui-input-select-dropdown-container-padding-y)] text-sm outline-none',\n // Keep the border/radius/background token references and the animation\n // classes below in sync with PopoverContent's container in popover.tsx —\n // but deliberately NOT its sizing (`min-w`/`max-w`) or `text-foreground`:\n // the dropdown keeps its own `--anchor-width`/`--available-height` sizing\n // and default text color whether or not `isPopoverStyled` is set.\n isPopoverStyled\n ? [\n 'rounded-[var(--ui-popover-container-border-radius)] border-[length:var(--ui-popover-container-border-width)] border-solid border-[var(--ui-popover-container-border-color)] bg-[var(--ui-popover-container-color)]',\n 'duration-200 data-[open]:animate-in data-[closed]:animate-out data-[open]:fade-in-0 data-[closed]:fade-out-0 data-[open]:zoom-in-95 data-[closed]:zoom-out-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2',\n ]\n : 'rounded-[var(--ui-input-select-dropdown-container-border-radius)] border border-[var(--ui-input-select-dropdown-container-border-color)] bg-[var(--ui-input-select-dropdown-container-color)] shadow-md',\n className\n )}\n {...props}\n >\n {children}\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n );\n }\n);\nInputSelectContent.displayName = 'InputSelectContent';\n\n/**\n * In-dropdown search row (magnifier + input). By default it drives the\n * `InputSelect` filter context — flat `InputSelectItem`s filter themselves, and\n * tree dropdowns read the query via `useInputSelectFilter`. Pass `value`/`onChange`\n * to control the query externally.\n */\nconst InputSelectSearch = React.forwardRef<\n HTMLInputElement,\n React.ComponentPropsWithoutRef<'input'>\n>(({ className, value, onChange, onKeyDown, ...props }, ref) => {\n const filter = React.useContext(InputSelectFilterContext);\n const setQuery = filter?.setQuery;\n const controlled = value !== undefined;\n\n // When the query is controlled externally, the consumer's `value` is the\n // source of truth for what's displayed, so keep the internal filter context\n // (what flat items match against) synced to it. A prop-driven value change —\n // a \"clear\" button resetting to '', a debounced/transformed value — doesn't\n // fire `onChange`, so driving the filter off raw DOM events alone would leave\n // `filter.query` stale and hide every item against a query the box no longer\n // shows. `setQuery` is a stable state setter, so this runs only when `value`\n // changes.\n React.useEffect(() => {\n if (controlled) {\n setQuery?.(String(value ?? ''));\n }\n }, [controlled, value, setQuery]);\n\n return (\n <div className=\"flex items-center gap-[var(--ui-input-select-dropdown-dropdown-search-gap)] px-[var(--ui-input-select-dropdown-dropdown-search-padding-x)] py-[var(--ui-input-select-dropdown-dropdown-search-padding-y)]\">\n <MagnifierIcon\n size={16}\n className=\"shrink-0 text-[var(--ui-glyph-on-surface-primary)]\"\n />\n <input\n ref={ref}\n type=\"search\"\n value={value ?? filter?.query ?? ''}\n onChange={(event) => {\n onChange?.(event);\n // Uncontrolled: the input's value *is* the filter query, so write it\n // straight through. Controlled: the effect above syncs the filter to\n // the consumer's `value` once it re-renders, avoiding a flash of raw\n // typed text when the consumer debounces or transforms the value.\n if (!controlled) {\n filter?.setQuery(event.currentTarget.value);\n }\n }}\n // Base UI Select's typeahead would consume printable keys before they\n // reach this input, so stop those from bubbling — but let navigation and\n // selection keys (Arrow*/Home/End/Enter/Escape, all multi-char `key`\n // names) through so the user can move from the search box into the\n // filtered list and pick a result with the keyboard.\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.key.length === 1) {\n event.stopPropagation();\n }\n }}\n className={cn(\n 'min-w-0 flex-1 border-0 bg-transparent p-0 text-sm leading-6 text-[var(--ui-input-select-dropdown-dropdown-search-label-color-value)] outline-none placeholder:text-[var(--ui-input-select-dropdown-dropdown-search-label-color-placeholder)] [&::-webkit-search-cancel-button]:appearance-none',\n className\n )}\n {...props}\n />\n </div>\n );\n});\nInputSelectSearch.displayName = 'InputSelectSearch';\n\n/** A section (group) of items with an optional header. Divided by a top border. */\nconst InputSelectSection = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Group\n ref={ref}\n className={cn(\n 'flex flex-col border-t border-[var(--ui-input-select-dropdown-section-container-border-color)] py-[var(--ui-input-select-dropdown-section-container-padding-y)] first:border-t-0',\n className\n )}\n {...props}\n />\n));\nInputSelectSection.displayName = 'InputSelectSection';\n\nconst InputSelectSectionLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.GroupLabel>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.GroupLabel>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.GroupLabel\n ref={ref}\n className={cn(\n 'px-[var(--ui-input-select-dropdown-section-container-header-padding-x)] py-[var(--ui-input-select-dropdown-section-container-header-padding-y)] text-sm font-semibold leading-6 text-[var(--ui-input-select-dropdown-section-label-group-color)]',\n className\n )}\n {...props}\n />\n));\nInputSelectSectionLabel.displayName = 'InputSelectSectionLabel';\n\n/**\n * Width (px) of the leading nesting spacer for a 1-based tree `indent` level, per\n * the Figma \"InputSelectDropdownTenants\" spec: level 1 reserves 16 px (enough for a\n * single chevron) and each deeper level adds 24 px — 16 / 40 / 64 for levels 1–3.\n * The tenant icon therefore starts at the same x-position whether or not the row is\n * expandable, because the chevron lives right-aligned inside this reserved space.\n */\nconst NESTING_BASE = 16;\nconst NESTING_STEP = 24;\nfunction nestingWidth(indent: number): number {\n return NESTING_BASE + (indent - 1) * NESTING_STEP;\n}\n\nexport interface InputSelectItemProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {\n /** Optional leading icon rendered before the label text. Colored by `--ui-input-select-dropdown-item-global-icon-tenant`. */\n icon?: React.ReactNode;\n /** 1-based nesting level (0 / omitted = no indent). Levels 1–3 reserve 16 / 40 / 64 px. */\n indent?: number;\n /**\n * Text used to match the in-dropdown search query. Defaults to the string\n * `children`. When a query is active and this text doesn't match, the row hides\n * itself — unless `hidden` is passed explicitly (tree dropdowns compute their own\n * visibility). Rows stay mounted while hidden to keep Base UI's selection index\n * stable.\n */\n textValue?: string;\n}\n\nconst InputSelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n InputSelectItemProps\n>(({ className, children, icon, indent, textValue, hidden, ...props }, ref) => {\n const multiple = React.useContext(InputSelectModeContext);\n const filter = React.useContext(InputSelectFilterContext);\n const query = filter?.query.trim().toLowerCase() ?? '';\n const label = textValue ?? (typeof children === 'string' ? children : undefined);\n const autoHidden =\n query.length > 0 && label !== undefined && !label.toLowerCase().includes(query);\n return (\n <SelectPrimitive.Item\n ref={ref}\n hidden={hidden ?? autoHidden}\n className={cn(\n 'group/item relative flex cursor-default items-center gap-[var(--ui-input-select-dropdown-item-global-container-gap)] px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)] outline-none select-none',\n 'bg-[var(--ui-input-select-dropdown-item-unselected-container-color-idle)] data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-hover)]',\n // Single-select rows tint when selected; multiple-select rows keep the\n // unselected background (the leading checkbox carries the state).\n !multiple &&\n 'data-[selected]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-idle)] data-[selected]:data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-hover)]',\n 'data-[disabled]:pointer-events-none data-[disabled]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-disabled)]',\n className\n )}\n {...props}\n >\n {multiple && (\n <span\n aria-hidden=\"true\"\n className=\"flex size-[var(--ui-checkbox-global-box-size)] shrink-0 items-center justify-center rounded-[var(--ui-checkbox-global-box-border-radius)] border-[length:var(--ui-checkbox-global-box-border-width)] border-[var(--ui-checkbox-unchecked-box-border-color-idle)] bg-[var(--ui-checkbox-unchecked-box-color-idle)] text-transparent group-data-[selected]/item:border-[var(--ui-checkbox-checked-box-border-color-idle)] group-data-[selected]/item:bg-[var(--ui-checkbox-checked-box-color-idle)] group-data-[selected]/item:text-[var(--ui-checkbox-checked-icon-color-idle)]\"\n >\n <CheckIcon size={16} />\n </span>\n )}\n {typeof indent === 'number' && indent > 0 && (\n <span\n aria-hidden=\"true\"\n className=\"size-4 shrink-0\"\n style={{ minWidth: nestingWidth(indent) }}\n />\n )}\n {icon && (\n <span className=\"flex shrink-0 items-center text-[var(--ui-input-select-dropdown-item-global-icon-tenant)]\">\n {icon}\n </span>\n )}\n <SelectPrimitive.ItemText className=\"min-w-0 flex-1 truncate\">\n {children}\n </SelectPrimitive.ItemText>\n {!multiple && (\n <SelectPrimitive.ItemIndicator className=\"flex shrink-0 items-center text-[var(--ui-input-select-dropdown-item-global-icon-checked)]\">\n <CheckIcon size={16} />\n </SelectPrimitive.ItemIndicator>\n )}\n </SelectPrimitive.Item>\n );\n});\nInputSelectItem.displayName = 'InputSelectItem';\n\nexport interface InputSelectExpanderProps\n extends React.ComponentPropsWithoutRef<'button'> {\n /** Whether the group is currently expanded. */\n expanded: boolean;\n /** Called when the user clicks the row to toggle expand/collapse. */\n onToggle: () => void;\n /** Optional leading icon rendered after the chevron. */\n icon?: React.ReactNode;\n /** 1-based nesting level (0 / omitted = level 1). Levels 1–3 reserve 16 / 40 / 64 px; the chevron sits right-aligned inside. */\n indent?: number;\n}\n\n/**\n * A non-selectable row that acts as an expand/collapse toggle for a tree group.\n * Visually identical to `InputSelectItem` but is **not** a `SelectPrimitive.Item`,\n * so clicking it won't set the select value.\n *\n * When collapsing a group, keep its child `InputSelectItem`s mounted and toggle\n * their `hidden` prop rather than unmounting them: Base UI's Select tracks the\n * selection by list index, so removing the selected row from the DOM makes a\n * sibling inherit its index and render a phantom check. `hidden` rows keep the\n * indices stable and are skipped by keyboard navigation.\n */\nconst InputSelectExpander = React.forwardRef<\n HTMLButtonElement,\n InputSelectExpanderProps\n>(({ className, children, expanded, onToggle, icon, indent, ...props }, ref) => (\n <button\n ref={ref}\n type=\"button\"\n onClick={onToggle}\n aria-expanded={expanded}\n className={cn(\n 'group/item relative flex w-full cursor-default items-center gap-[var(--ui-input-select-dropdown-item-global-container-gap)] px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] text-start leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)] outline-none select-none',\n 'bg-[var(--ui-input-select-dropdown-item-unselected-container-color-idle)] hover:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-hover)]',\n className\n )}\n {...props}\n >\n <span\n aria-hidden=\"true\"\n className=\"flex shrink-0 items-center justify-end text-[var(--ui-input-select-dropdown-item-global-icon-collapse)]\"\n style={{\n minWidth:\n typeof indent === 'number' && indent > 0 ? nestingWidth(indent) : NESTING_BASE,\n }}\n >\n {expanded ? <ChevronDownIcon size={16} /> : <ChevronRightIcon size={16} />}\n </span>\n {icon && (\n <span className=\"flex shrink-0 items-center text-[var(--ui-input-select-dropdown-item-global-icon-tenant)]\">\n {icon}\n </span>\n )}\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n </button>\n));\nInputSelectExpander.displayName = 'InputSelectExpander';\n\nconst InputSelectDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<'p'>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\n 'text-xs leading-4 text-[var(--ui-input-select-normal-description-color-idle)]',\n className\n )}\n {...props}\n />\n));\nInputSelectDescription.displayName = 'InputSelectDescription';\n\nconst InputSelectError = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<'p'>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\n 'text-xs leading-4 text-[var(--ui-input-select-error-error-msg-color)]',\n className\n )}\n {...props}\n />\n));\nInputSelectError.displayName = 'InputSelectError';\n\nexport interface InputSelectStatusProps\n extends React.ComponentPropsWithoutRef<'div'> {\n /** Which status to show. Drives the leading icon. */\n variant: 'loading' | 'empty' | 'error';\n /** Optional trailing action (e.g. a \"Try again\" button) — shown for `error`. */\n action?: React.ReactNode;\n}\n\n/** Loading / empty / error status row shown instead of items inside the dropdown. */\nconst InputSelectStatus = React.forwardRef<HTMLDivElement, InputSelectStatusProps>(\n ({ className, variant, children, action, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-[var(--ui-input-select-dropdown-container-status-width-min)] flex-col items-center justify-center gap-[var(--ui-input-select-dropdown-container-status-gap)] border-t border-[var(--ui-input-select-dropdown-section-container-border-color)] px-[var(--ui-input-select-dropdown-container-status-padding-x)] py-[var(--ui-input-select-dropdown-container-status-padding-y)] text-center text-sm leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)]',\n className\n )}\n {...props}\n >\n {variant === 'loading' && (\n <span\n aria-hidden=\"true\"\n className=\"size-6 animate-spin rounded-full border-2 border-[var(--ui-glyph-on-surface-primary)] border-t-transparent\"\n />\n )}\n {variant === 'empty' && <InboxIcon size={24} className=\"text-[var(--ui-glyph-on-status-info)]\" />}\n {variant === 'error' && <CircleWarningIcon size={24} className=\"text-[var(--ui-glyph-on-status-warning)]\" />}\n {children}\n {variant === 'error' && action}\n </div>\n )\n);\nInputSelectStatus.displayName = 'InputSelectStatus';\n\nexport {\n InputSelect,\n InputSelectField,\n InputSelectLabel,\n InputSelectTrigger,\n InputSelectValue,\n InputSelectContent,\n InputSelectSearch,\n InputSelectGroup,\n InputSelectSection,\n InputSelectSectionLabel,\n InputSelectItem,\n InputSelectExpander,\n InputSelectDescription,\n InputSelectError,\n InputSelectStatus,\n useInputSelectFilter,\n};\n"],"mappings":";;;;;;;AAyBA,IAAM,IAAyB,EAAM,cAAc,EAAK,GASlD,IACJ,EAAM,cAAoD,IAAI;AAOhE,SAAS,IAAsD;CAC7D,IAAM,IAAU,EAAM,WAAW,CAAwB;CACzD,IAAI,CAAC,GACH,MAAU,MAAM,yDAAyD;CAE3E,OAAO;AACT;AAEA,SAAS,EACP,GACA;CACA,IAAM,EAAE,oBAAiB,GACnB,CAAC,GAAO,KAAY,EAAM,SAAS,EAAE,GACrC,IAAS,EAAM,eAAe;EAAE;EAAO;CAAS,IAAI,CAAC,CAAK,CAAC,GAY3D,IAAmB,EAAM,aAG5B,GAAM,MAAiB;EAEtB,AADA,IAAe,GAAM,CAAY,GAC7B,CAAC,KAAQ,CAAC,EAAa,cACzB,EAAS,EAAE;CAEf,GACA,CAAC,CAAY,CACf,GAEM,IAAiB,EAAM,MACvB,IAAkB,EAAM,OAAO,CAAc;CAQnD,OAPA,EAAM,gBAAgB;EAIpB,AAHI,EAAgB,WAAW,MAAmB,MAChD,EAAS,EAAE,GAEb,EAAgB,UAAU;CAC5B,GAAG,CAAC,CAAc,CAA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MAAY,WAAW,kBAAC,GAAD;GAAmB,MAAM;GAAI,WAAU;EAA4C,CAAA;EAC1G;EACA,MAAY,WAAW;CACrB;AAET,CAAA,CAAA;AACA,EAAkB,cAAc"}
|
|
1
|
+
{"version":3,"file":"input-select.js","names":[],"sources":["../../../../src/components/ui/input-select/input-select.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Select as SelectPrimitive } from '@base-ui/react/select';\nimport {\n CheckSmallIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n CircleWarningIcon,\n InboxIcon,\n MagnifierIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\nimport { usePortalContainer } from '@/lib/portal-container';\n\n// The next-gen select, themed by the dedicated `--ui-input-select-*` tier (global /\n// normal / error / dropdown). It composes Base UI `Select` and adds the field\n// furniture (label, required, description, error) and the dropdown machinery\n// (in-dropdown search, sections/groups, single + multiple items, loading/empty/error\n// status). The trigger box wires each state to its own token — idle / hover / open\n// (`data-popup-open`) + focus ring / disabled — and switches to the error border +\n// `--ui-focus-error` ring when `aria-invalid` is set. Selection mode (single vs\n// multiple) flows from the `multiple` prop on the root via `InputSelectModeContext`:\n// single items toggle the row background and show a trailing check; multiple items\n// keep the row background and show a leading checkbox.\n\nconst InputSelectModeContext = React.createContext(false);\n\ninterface InputSelectFilterContextValue {\n /** Current in-dropdown search query. */\n query: string;\n /** Update the search query. */\n setQuery: (query: string) => void;\n}\n\nconst InputSelectFilterContext =\n React.createContext<InputSelectFilterContextValue | null>(null);\n\n/**\n * Read the live in-dropdown search query (and its setter) from the nearest\n * `InputSelect`. Flat item lists filter themselves; use this for hierarchical\n * (tree) dropdowns that need to compute their own visibility.\n */\nfunction useInputSelectFilter(): InputSelectFilterContextValue {\n const context = React.useContext(InputSelectFilterContext);\n if (!context) {\n throw new Error('useInputSelectFilter must be used within <InputSelect>.');\n }\n return context;\n}\n\nfunction InputSelect<Value, Multiple extends boolean | undefined = false>(\n props: SelectPrimitive.Root.Props<Value, Multiple>\n) {\n const { onOpenChange } = props;\n const [query, setQuery] = React.useState('');\n const filter = React.useMemo(() => ({ query, setQuery }), [query]);\n\n // Reset the query when the popup closes so it reopens unfiltered, via two paths.\n // 1. `onOpenChange` — the only path in uncontrolled mode, where Base UI owns the\n // open state and reports every real transition. A consumer that calls\n // `eventDetails.cancel()` keeps the popup open (Base UI skips its own state\n // update too), so the query must survive that.\n // 2. The `open` prop transitioning true -> false — needed in controlled mode,\n // where a consumer can flip its own state directly (e.g. an external toggle\n // button whose click handler runs after it cancelled Base UI's outside-press\n // close) without `onOpenChange` ever firing for that transition. A cancelled\n // close leaves `open` at `true`, so this path preserves the query too.\n const handleOpenChange = React.useCallback<\n NonNullable<SelectPrimitive.Root.Props<Value, Multiple>['onOpenChange']>\n >(\n (open, eventDetails) => {\n onOpenChange?.(open, eventDetails);\n if (!open && !eventDetails.isCanceled) {\n setQuery('');\n }\n },\n [onOpenChange]\n );\n\n const controlledOpen = props.open;\n const previousOpenRef = React.useRef(controlledOpen);\n React.useEffect(() => {\n if (previousOpenRef.current && controlledOpen === false) {\n setQuery('');\n }\n previousOpenRef.current = controlledOpen;\n }, [controlledOpen]);\n\n return (\n <InputSelectModeContext.Provider value={Boolean(props.multiple)}>\n <InputSelectFilterContext.Provider value={filter}>\n <SelectPrimitive.Root {...props} onOpenChange={handleOpenChange} />\n </InputSelectFilterContext.Provider>\n </InputSelectModeContext.Provider>\n );\n}\nInputSelect.displayName = 'InputSelect';\n\nconst InputSelectGroup = SelectPrimitive.Group;\n\n/** Vertical field stack: label, trigger, description/error. */\nconst InputSelectField = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex min-w-[var(--ui-input-select-global-container-width-min)] flex-col gap-[var(--ui-input-select-global-container-gap)]',\n className\n )}\n {...props}\n />\n));\nInputSelectField.displayName = 'InputSelectField';\n\nconst InputSelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label> & {\n /** Appends a required `*` after the label text. */\n required?: boolean;\n }\n>(({ className, children, required, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\n 'flex gap-[var(--ui-input-select-global-container-label-gap)] text-sm leading-4 text-[var(--ui-input-select-global-label-color-idle)] data-[disabled]:text-[var(--ui-input-select-global-label-color-disabled)]',\n className\n )}\n {...props}\n >\n {children}\n {required && (\n <span\n aria-hidden=\"true\"\n className=\"text-[var(--ui-input-select-global-required-color)]\"\n >\n *\n </span>\n )}\n </SelectPrimitive.Label>\n));\nInputSelectLabel.displayName = 'InputSelectLabel';\n\nconst InputSelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'group flex h-[var(--ui-input-select-global-box-height)] w-full min-w-0 items-center gap-[var(--ui-input-select-global-box-gap)] rounded-[var(--ui-input-select-global-box-border-radius)] border bg-[var(--ui-input-select-global-box-color-idle)] border-[var(--ui-input-select-normal-box-border-color-idle)] px-[var(--ui-input-select-global-box-padding-x)] text-sm leading-6 text-[var(--ui-input-select-global-value-color-idle)] outline-none transition-colors',\n 'not-data-[disabled]:hover:bg-[var(--ui-input-select-global-box-color-hover)] not-data-[disabled]:hover:border-[var(--ui-input-select-normal-box-border-color-hover)]',\n 'focus-visible:border-[var(--ui-input-select-normal-box-border-color-hover)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]',\n 'data-[popup-open]:border-[var(--ui-input-select-normal-box-border-color-hover)] data-[popup-open]:ring-[3px] data-[popup-open]:ring-[var(--ui-focus-primary)]',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:border-[var(--ui-input-select-normal-box-border-color-disabled)] data-[disabled]:bg-[var(--ui-input-select-global-box-color-disabled)] data-[disabled]:text-[var(--ui-input-select-global-value-color-disabled)]',\n // Error treatment (driven by `aria-invalid`).\n 'aria-invalid:border-[var(--ui-input-select-error-box-border-color-idle)] not-data-[disabled]:aria-invalid:hover:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:focus-visible:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:focus-visible:ring-[var(--ui-focus-error)] aria-invalid:data-[popup-open]:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:data-[popup-open]:ring-[var(--ui-focus-error)]',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon className=\"flex size-[var(--ui-input-select-global-icon-box-size)] shrink-0 items-center justify-center text-[var(--ui-input-select-normal-icon-expand-color-idle)] group-data-[disabled]:text-[var(--ui-input-select-normal-icon-expand-color-disabled)]\">\n <ChevronDownIcon\n size={16}\n className=\"transition-transform group-data-[popup-open]:rotate-180\"\n />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nInputSelectTrigger.displayName = 'InputSelectTrigger';\n\nconst InputSelectValue = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Value>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Value\n ref={ref}\n className={cn(\n 'min-w-0 flex-1 truncate text-start text-[var(--ui-input-select-global-value-color-idle)] data-[placeholder]:text-[var(--ui-input-select-global-placeholder-color-idle)]',\n 'group-data-[disabled]:!text-[var(--ui-input-select-global-value-color-disabled)] group-data-[disabled]:data-[placeholder]:!text-[var(--ui-input-select-global-placeholder-color-disabled)]',\n className\n )}\n {...props}\n />\n));\nInputSelectValue.displayName = 'InputSelectValue';\n\nconst InputSelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Popup>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Popup> & {\n sideOffset?: number;\n align?: SelectPrimitive.Positioner.Props['align'];\n side?: SelectPrimitive.Positioner.Props['side'];\n /**\n * Offset in px along the alignment axis (perpendicular to `side`). Defaults\n * to Base UI's own `0` when omitted — pass a value to nudge the dropdown\n * along the trigger's edge without changing its `align`.\n */\n alignOffset?: SelectPrimitive.Positioner.Props['alignOffset'];\n /**\n * Collision-avoidance strategy. Defaults to Base UI's own flip/shift\n * behavior, which may move the dropdown off the requested `side`/`align`\n * when it doesn't fit. Pass `{ side: 'none', fallbackAxisSide: 'none' }`\n * alongside an explicit `side`/`align` to lock the popup to that placement\n * with no auto-flip fallback (e.g. \"always to the right, no matter what\":\n * `side=\"right\" sideOffset={20} collisionAvoidance={{ side: 'none',\n * fallbackAxisSide: 'none' }}`).\n */\n collisionAvoidance?: SelectPrimitive.Positioner.Props['collisionAvoidance'];\n /**\n * Element (or ref/getter) the popup positions itself against, overriding\n * the default of anchoring to `InputSelectTrigger`. Use when the visible\n * trigger isn't the element Base UI tracks internally — e.g. an external\n * button drives a hidden trigger, and the popup should align with the\n * button instead of the hidden trigger's layout position.\n */\n anchor?: SelectPrimitive.Positioner.Props['anchor'];\n /**\n * Container to portal the dropdown into. Defaults to the nearest\n * `PortalContainerProvider`, or `document.body` when there is none; pass an\n * element to scope the portal explicitly (e.g. a shadow root, so the popup\n * inherits styles defined there).\n */\n portalContainer?: SelectPrimitive.Portal.Props['container'];\n /**\n * Render the dropdown chrome like `PopoverContent` (`--ui-popover-container-*`\n * tokens, no shadow, fade/zoom/slide enter-exit animation) instead of the\n * default `--ui-input-select-dropdown-container-*` tokens + static `shadow-md`.\n * See `components/ui/popover/popover.tsx`.\n */\n isPopoverStyled?: boolean;\n }\n>(\n (\n {\n className,\n children,\n sideOffset = 4,\n align = 'start',\n side = 'bottom',\n alignOffset,\n collisionAvoidance,\n anchor,\n portalContainer,\n isPopoverStyled = false,\n ...props\n },\n ref\n ) => {\n const ctxContainer = usePortalContainer();\n const resolvedContainer = portalContainer ?? ctxContainer;\n\n return (\n <SelectPrimitive.Portal container={resolvedContainer}>\n <SelectPrimitive.Positioner\n sideOffset={sideOffset}\n align={align}\n side={side}\n alignOffset={alignOffset}\n collisionAvoidance={collisionAvoidance}\n anchor={anchor}\n alignItemWithTrigger={false}\n className=\"z-50 outline-none\"\n >\n <SelectPrimitive.Popup\n ref={ref}\n className={cn(\n 'max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-y-auto py-[var(--ui-input-select-dropdown-container-padding-y)] text-sm outline-none',\n // Keep the border/radius/background token references and the animation\n // classes below in sync with PopoverContent's container in popover.tsx —\n // but deliberately NOT its sizing (`min-w`/`max-w`) or `text-foreground`:\n // the dropdown keeps its own `--anchor-width`/`--available-height` sizing\n // and default text color whether or not `isPopoverStyled` is set.\n isPopoverStyled\n ? [\n 'rounded-[var(--ui-popover-container-border-radius)] border-[length:var(--ui-popover-container-border-width)] border-solid border-[var(--ui-popover-container-border-color)] bg-[var(--ui-popover-container-color)]',\n 'duration-200 data-[open]:animate-in data-[closed]:animate-out data-[open]:fade-in-0 data-[closed]:fade-out-0 data-[open]:zoom-in-95 data-[closed]:zoom-out-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2',\n ]\n : 'rounded-[var(--ui-input-select-dropdown-container-border-radius)] border border-[var(--ui-input-select-dropdown-container-border-color)] bg-[var(--ui-input-select-dropdown-container-color)] shadow-md',\n className\n )}\n {...props}\n >\n {children}\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n );\n }\n);\nInputSelectContent.displayName = 'InputSelectContent';\n\n/**\n * In-dropdown search row (magnifier + input). By default it drives the\n * `InputSelect` filter context — flat `InputSelectItem`s filter themselves, and\n * tree dropdowns read the query via `useInputSelectFilter`. Pass `value`/`onChange`\n * to control the query externally.\n */\nconst InputSelectSearch = React.forwardRef<\n HTMLInputElement,\n React.ComponentPropsWithoutRef<'input'>\n>(({ className, value, onChange, onKeyDown, ...props }, ref) => {\n const filter = React.useContext(InputSelectFilterContext);\n const setQuery = filter?.setQuery;\n const controlled = value !== undefined;\n\n // When the query is controlled externally, the consumer's `value` is the\n // source of truth for what's displayed, so keep the internal filter context\n // (what flat items match against) synced to it. A prop-driven value change —\n // a \"clear\" button resetting to '', a debounced/transformed value — doesn't\n // fire `onChange`, so driving the filter off raw DOM events alone would leave\n // `filter.query` stale and hide every item against a query the box no longer\n // shows. `setQuery` is a stable state setter, so this runs only when `value`\n // changes.\n React.useEffect(() => {\n if (controlled) {\n setQuery?.(String(value ?? ''));\n }\n }, [controlled, value, setQuery]);\n\n return (\n <div className=\"flex items-center gap-[var(--ui-input-select-dropdown-dropdown-search-gap)] px-[var(--ui-input-select-dropdown-dropdown-search-padding-x)] py-[var(--ui-input-select-dropdown-dropdown-search-padding-y)]\">\n <MagnifierIcon\n size={16}\n className=\"shrink-0 text-[var(--ui-glyph-on-surface-primary)]\"\n />\n <input\n ref={ref}\n type=\"search\"\n value={value ?? filter?.query ?? ''}\n onChange={(event) => {\n onChange?.(event);\n // Uncontrolled: the input's value *is* the filter query, so write it\n // straight through. Controlled: the effect above syncs the filter to\n // the consumer's `value` once it re-renders, avoiding a flash of raw\n // typed text when the consumer debounces or transforms the value.\n if (!controlled) {\n filter?.setQuery(event.currentTarget.value);\n }\n }}\n // Base UI Select's typeahead would consume printable keys before they\n // reach this input, so stop those from bubbling — but let navigation and\n // selection keys (Arrow*/Home/End/Enter/Escape, all multi-char `key`\n // names) through so the user can move from the search box into the\n // filtered list and pick a result with the keyboard.\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.key.length === 1) {\n event.stopPropagation();\n }\n }}\n className={cn(\n 'min-w-0 flex-1 border-0 bg-transparent p-0 text-sm leading-6 text-[var(--ui-input-select-dropdown-dropdown-search-label-color-value)] outline-none placeholder:text-[var(--ui-input-select-dropdown-dropdown-search-label-color-placeholder)] [&::-webkit-search-cancel-button]:appearance-none',\n className\n )}\n {...props}\n />\n </div>\n );\n});\nInputSelectSearch.displayName = 'InputSelectSearch';\n\n/** A section (group) of items with an optional header. Divided by a top border. */\nconst InputSelectSection = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Group\n ref={ref}\n className={cn(\n 'flex flex-col border-t border-[var(--ui-input-select-dropdown-section-container-border-color)] py-[var(--ui-input-select-dropdown-section-container-padding-y)] first:border-t-0',\n className\n )}\n {...props}\n />\n));\nInputSelectSection.displayName = 'InputSelectSection';\n\nconst InputSelectSectionLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.GroupLabel>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.GroupLabel>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.GroupLabel\n ref={ref}\n className={cn(\n 'px-[var(--ui-input-select-dropdown-section-container-header-padding-x)] py-[var(--ui-input-select-dropdown-section-container-header-padding-y)] text-sm font-semibold leading-6 text-[var(--ui-input-select-dropdown-section-label-group-color)]',\n className\n )}\n {...props}\n />\n));\nInputSelectSectionLabel.displayName = 'InputSelectSectionLabel';\n\n/**\n * Width (px) of the leading nesting spacer for a 1-based tree `indent` level, per\n * the Figma \"InputSelectDropdownTenants\" spec: level 1 reserves 16 px (enough for a\n * single chevron) and each deeper level adds 24 px — 16 / 40 / 64 for levels 1–3.\n * The tenant icon therefore starts at the same x-position whether or not the row is\n * expandable, because the chevron lives right-aligned inside this reserved space.\n */\nconst NESTING_BASE = 16;\nconst NESTING_STEP = 24;\nfunction nestingWidth(indent: number): number {\n return NESTING_BASE + (indent - 1) * NESTING_STEP;\n}\n\nexport interface InputSelectItemProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {\n /** Optional leading icon rendered before the label text. Colored by `--ui-input-select-dropdown-item-global-icon-tenant`. */\n icon?: React.ReactNode;\n /** 1-based nesting level (0 / omitted = no indent). Levels 1–3 reserve 16 / 40 / 64 px. */\n indent?: number;\n /**\n * Text used to match the in-dropdown search query. Defaults to the string\n * `children`. When a query is active and this text doesn't match, the row hides\n * itself — unless `hidden` is passed explicitly (tree dropdowns compute their own\n * visibility). Rows stay mounted while hidden to keep Base UI's selection index\n * stable.\n */\n textValue?: string;\n}\n\nconst InputSelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n InputSelectItemProps\n>(({ className, children, icon, indent, textValue, hidden, ...props }, ref) => {\n const multiple = React.useContext(InputSelectModeContext);\n const filter = React.useContext(InputSelectFilterContext);\n const query = filter?.query.trim().toLowerCase() ?? '';\n const label = textValue ?? (typeof children === 'string' ? children : undefined);\n const autoHidden =\n query.length > 0 && label !== undefined && !label.toLowerCase().includes(query);\n return (\n <SelectPrimitive.Item\n ref={ref}\n hidden={hidden ?? autoHidden}\n className={cn(\n 'group/item relative flex cursor-default items-center gap-[var(--ui-input-select-dropdown-item-global-container-gap)] px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)] outline-none select-none',\n 'bg-[var(--ui-input-select-dropdown-item-unselected-container-color-idle)] data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-hover)]',\n // Single-select rows tint when selected; multiple-select rows keep the\n // unselected background (the leading checkbox carries the state).\n !multiple &&\n 'data-[selected]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-idle)] data-[selected]:data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-hover)]',\n 'data-[disabled]:pointer-events-none data-[disabled]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-disabled)]',\n className\n )}\n {...props}\n >\n {multiple && (\n <span\n aria-hidden=\"true\"\n className=\"flex size-[var(--ui-checkbox-global-box-size)] shrink-0 items-center justify-center rounded-[var(--ui-checkbox-global-box-border-radius)] border-[length:var(--ui-checkbox-global-box-border-width)] border-[var(--ui-checkbox-unchecked-box-border-color-idle)] bg-[var(--ui-checkbox-unchecked-box-color-idle)] text-transparent group-data-[selected]/item:border-[var(--ui-checkbox-checked-box-border-color-idle)] group-data-[selected]/item:bg-[var(--ui-checkbox-checked-box-color-idle)] group-data-[selected]/item:text-[var(--ui-checkbox-checked-icon-color-idle)]\"\n >\n <CheckSmallIcon size={16} />\n </span>\n )}\n {typeof indent === 'number' && indent > 0 && (\n <span\n aria-hidden=\"true\"\n className=\"size-4 shrink-0\"\n style={{ minWidth: nestingWidth(indent) }}\n />\n )}\n {icon && (\n <span className=\"flex shrink-0 items-center text-[var(--ui-input-select-dropdown-item-global-icon-tenant)]\">\n {icon}\n </span>\n )}\n <SelectPrimitive.ItemText className=\"min-w-0 flex-1 truncate\">\n {children}\n </SelectPrimitive.ItemText>\n {!multiple && (\n <SelectPrimitive.ItemIndicator className=\"flex shrink-0 items-center text-[var(--ui-input-select-dropdown-item-global-icon-checked)]\">\n <CheckSmallIcon size={16} />\n </SelectPrimitive.ItemIndicator>\n )}\n </SelectPrimitive.Item>\n );\n});\nInputSelectItem.displayName = 'InputSelectItem';\n\nexport interface InputSelectExpanderProps\n extends React.ComponentPropsWithoutRef<'button'> {\n /** Whether the group is currently expanded. */\n expanded: boolean;\n /** Called when the user clicks the row to toggle expand/collapse. */\n onToggle: () => void;\n /** Optional leading icon rendered after the chevron. */\n icon?: React.ReactNode;\n /** 1-based nesting level (0 / omitted = level 1). Levels 1–3 reserve 16 / 40 / 64 px; the chevron sits right-aligned inside. */\n indent?: number;\n}\n\n/**\n * A non-selectable row that acts as an expand/collapse toggle for a tree group.\n * Visually identical to `InputSelectItem` but is **not** a `SelectPrimitive.Item`,\n * so clicking it won't set the select value.\n *\n * When collapsing a group, keep its child `InputSelectItem`s mounted and toggle\n * their `hidden` prop rather than unmounting them: Base UI's Select tracks the\n * selection by list index, so removing the selected row from the DOM makes a\n * sibling inherit its index and render a phantom check. `hidden` rows keep the\n * indices stable and are skipped by keyboard navigation.\n */\nconst InputSelectExpander = React.forwardRef<\n HTMLButtonElement,\n InputSelectExpanderProps\n>(({ className, children, expanded, onToggle, icon, indent, ...props }, ref) => (\n <button\n ref={ref}\n type=\"button\"\n onClick={onToggle}\n aria-expanded={expanded}\n className={cn(\n 'group/item relative flex w-full cursor-default items-center gap-[var(--ui-input-select-dropdown-item-global-container-gap)] px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] text-start leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)] outline-none select-none',\n 'bg-[var(--ui-input-select-dropdown-item-unselected-container-color-idle)] hover:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-hover)]',\n className\n )}\n {...props}\n >\n <span\n aria-hidden=\"true\"\n className=\"flex shrink-0 items-center justify-end text-[var(--ui-input-select-dropdown-item-global-icon-collapse)]\"\n style={{\n minWidth:\n typeof indent === 'number' && indent > 0 ? nestingWidth(indent) : NESTING_BASE,\n }}\n >\n {expanded ? <ChevronDownIcon size={16} /> : <ChevronRightIcon size={16} />}\n </span>\n {icon && (\n <span className=\"flex shrink-0 items-center text-[var(--ui-input-select-dropdown-item-global-icon-tenant)]\">\n {icon}\n </span>\n )}\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n </button>\n));\nInputSelectExpander.displayName = 'InputSelectExpander';\n\nconst InputSelectDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<'p'>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\n 'text-xs leading-4 text-[var(--ui-input-select-normal-description-color-idle)]',\n className\n )}\n {...props}\n />\n));\nInputSelectDescription.displayName = 'InputSelectDescription';\n\nconst InputSelectError = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<'p'>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\n 'text-xs leading-4 text-[var(--ui-input-select-error-error-msg-color)]',\n className\n )}\n {...props}\n />\n));\nInputSelectError.displayName = 'InputSelectError';\n\nexport interface InputSelectStatusProps\n extends React.ComponentPropsWithoutRef<'div'> {\n /** Which status to show. Drives the leading icon. */\n variant: 'loading' | 'empty' | 'error';\n /** Optional trailing action (e.g. a \"Try again\" button) — shown for `error`. */\n action?: React.ReactNode;\n}\n\n/** Loading / empty / error status row shown instead of items inside the dropdown. */\nconst InputSelectStatus = React.forwardRef<HTMLDivElement, InputSelectStatusProps>(\n ({ className, variant, children, action, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-[var(--ui-input-select-dropdown-container-status-width-min)] flex-col items-center justify-center gap-[var(--ui-input-select-dropdown-container-status-gap)] border-t border-[var(--ui-input-select-dropdown-section-container-border-color)] px-[var(--ui-input-select-dropdown-container-status-padding-x)] py-[var(--ui-input-select-dropdown-container-status-padding-y)] text-center text-sm leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)]',\n className\n )}\n {...props}\n >\n {variant === 'loading' && (\n <span\n aria-hidden=\"true\"\n className=\"size-6 animate-spin rounded-full border-2 border-[var(--ui-glyph-on-surface-primary)] border-t-transparent\"\n />\n )}\n {variant === 'empty' && <InboxIcon size={24} className=\"text-[var(--ui-glyph-on-status-info)]\" />}\n {variant === 'error' && <CircleWarningIcon size={24} className=\"text-[var(--ui-glyph-on-status-warning)]\" />}\n {children}\n {variant === 'error' && action}\n </div>\n )\n);\nInputSelectStatus.displayName = 'InputSelectStatus';\n\nexport {\n InputSelect,\n InputSelectField,\n InputSelectLabel,\n InputSelectTrigger,\n InputSelectValue,\n InputSelectContent,\n InputSelectSearch,\n InputSelectGroup,\n InputSelectSection,\n InputSelectSectionLabel,\n InputSelectItem,\n InputSelectExpander,\n InputSelectDescription,\n InputSelectError,\n InputSelectStatus,\n useInputSelectFilter,\n};\n"],"mappings":";;;;;;;AAyBA,IAAM,IAAyB,EAAM,cAAc,EAAK,GASlD,IACJ,EAAM,cAAoD,IAAI;AAOhE,SAAS,IAAsD;CAC7D,IAAM,IAAU,EAAM,WAAW,CAAwB;CACzD,IAAI,C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B,kBAAC,KAAD;CACO;CACL,WAAW,EACT,iFACA,CACF;CACA,GAAI;AACL,CAAA,CACF;AACD,EAAuB,cAAc;AAErC,IAAM,IAAmB,EAAM,YAG5B,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,KAAD;CACO;CACL,WAAW,EACT,yEACA,CACF;CACA,GAAI;AACL,CAAA,CACF;AACD,EAAiB,cAAc;AAW/B,IAAM,IAAoB,EAAM,YAC7B,EAAE,cAAW,YAAS,aAAU,WAAQ,GAAG,KAAS,MACnD,kBAAC,OAAD;CACO;CACL,WAAW,EACT,ydACA,CACF;CACA,GAAI;CANN,UAAA;EAQG,MAAY,aACX,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;EACX,CAAA;EAEF,MAAY,WAAW,kBAAC,GAAD;GAAW,MAAM;GAAI,WAAU;EAAyC,CAAA;EAC/F,MAAY,WAAW,kBAAC,GAAD;GAAmB,MAAM;GAAI,WAAU;EAA4C,CAAA;EAC1G;EACA,MAAY,WAAW;CACrB;AAET,CAAA,CAAA;AACA,EAAkB,cAAc"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/utils.js";
|
|
3
3
|
import { cva as t } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
-
import { ChartContainer as n, ChartLegend as r, ChartLegendContent as i, ChartTooltip as a, ChartTooltipContent as o } from "../chart/chart.js";
|
|
5
|
-
import { CHART_LABEL_MARGIN as
|
|
4
|
+
import { ChartContainer as n, ChartLegend as r, ChartLegendContent as i, ChartTooltip as a, ChartTooltipContent as o, toCssKey as s } from "../chart/chart.js";
|
|
5
|
+
import { CHART_LABEL_MARGIN as c, dropProjectionPayload as l, resolveAnimation as u, resolveAxisDomain as d, resolveBrushProps as f, resolveChartReferenceValue as p, resolveLabelFillClass as ee, resolveReferenceLineProps as te, resolveRotatedTickAnchor as ne, resolveXAxisHeight as re, resolveXAxisTitle as ie, resolveYAxisTitle as ae, toLabelFormatter as oe, toReferenceLineList as se } from "../chart/chart-format.js";
|
|
6
6
|
import * as m from "react";
|
|
7
7
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
-
import { Area as
|
|
8
|
+
import { Area as ce, Brush as le, CartesianGrid as v, ComposedChart as y, LabelList as ue, Line as b, LineChart as de, ReferenceLine as fe, Text as pe, XAxis as me, YAxis as he, usePlotArea as x, useXAxisScale as S } from "recharts";
|
|
9
9
|
//#region src/components/ui/line-chart/line-chart.tsx
|
|
10
|
-
var
|
|
10
|
+
var C = t("", {
|
|
11
11
|
variants: {
|
|
12
12
|
curve: {
|
|
13
13
|
linear: "",
|
|
@@ -29,7 +29,7 @@ var S = t("", {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
function ge({ projectionStart: e, prevTick: t, clipId: n, dataKeys: r }) {
|
|
32
|
-
let i =
|
|
32
|
+
let i = S(), a = x();
|
|
33
33
|
if (!i || !a) return null;
|
|
34
34
|
let o = i(t), s = i(e);
|
|
35
35
|
if (o == null || s == null) return null;
|
|
@@ -63,15 +63,15 @@ function ge({ projectionStart: e, prevTick: t, clipId: n, dataKeys: r }) {
|
|
|
63
63
|
})
|
|
64
64
|
] });
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
function w(e) {
|
|
68
|
-
return e?.filter((e) => !String(e.dataKey).startsWith(C));
|
|
69
|
-
}
|
|
66
|
+
var w = "__band_";
|
|
70
67
|
function T(e) {
|
|
68
|
+
return e?.filter((e) => !String(e.dataKey).startsWith(w));
|
|
69
|
+
}
|
|
70
|
+
function E(e) {
|
|
71
71
|
return function(t) {
|
|
72
72
|
let n = {
|
|
73
73
|
...t,
|
|
74
|
-
payload:
|
|
74
|
+
payload: T(t.payload)
|
|
75
75
|
};
|
|
76
76
|
return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
|
|
77
77
|
};
|
|
@@ -80,24 +80,24 @@ function _e(e) {
|
|
|
80
80
|
return function(t) {
|
|
81
81
|
let n = {
|
|
82
82
|
...t,
|
|
83
|
-
payload:
|
|
83
|
+
payload: l(t.payload)
|
|
84
84
|
};
|
|
85
85
|
return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
var
|
|
89
|
-
let
|
|
88
|
+
var D = m.forwardRef(({ className: t, config: h, palette: x, data: S, dataKeys: D, comparisonKeys: O, deltaBands: ve, xKey: k, xAxisLabel: A, yAxisLabel: j, yUnit: ye, curve: M = "monotone", lineStyle: N = "solid", strokeWidth: P = 2, showDots: be = !1, dotSize: xe = 3, showActiveDot: Se, connectNulls: F = !1, lineSettings: I, referenceLine: Ce, projectionStart: L, showGrid: we = !0, showTooltip: Te = !0, showLegend: Ee = !0, showXAxis: De = !0, showYAxis: Oe = !0, xTickFormatter: R, yTickFormatter: ke, xAxisAngle: z, xAxisInterval: Ae, yAxisTickCount: je, yAxisDomain: B, gridDashed: Me, gridHorizontal: Ne, gridVertical: Pe, tooltipContent: V, animate: Fe, animationDuration: Ie, animationBegin: Le, animationEasing: Re, showLabels: H = !1, labelPosition: ze, labelFormatter: Be, showBrush: Ve = !1, brushHeight: He, brushAriaLabel: Ue, ...We }, Ge) => {
|
|
89
|
+
let U = u({
|
|
90
90
|
animate: Fe,
|
|
91
91
|
animationDuration: Ie,
|
|
92
92
|
animationBegin: Le,
|
|
93
93
|
animationEasing: Re
|
|
94
|
-
}), Ke = ze ?? "top", qe =
|
|
94
|
+
}), Ke = ze ?? "top", qe = d(B), Je = se(Ce), W = (e) => I?.[e]?.color ?? `var(--color-${s(e)})`, G = (e) => I?.[e]?.curveType ?? M ?? "monotone", Ye = H || Object.values(I ?? {}).some((e) => e.showLabel), Xe = re(A, z), K = m.useMemo(() => L === void 0 ? -1 : S.findIndex((e) => e[k] === L), [
|
|
95
95
|
L,
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
S,
|
|
97
|
+
k
|
|
98
98
|
]), q = K > 0, J = m.useMemo(() => {
|
|
99
99
|
if (!q) return;
|
|
100
|
-
let e = new Set(
|
|
100
|
+
let e = new Set(S.slice(K).map((e) => e[k]));
|
|
101
101
|
return ({ payload: t, index: n, ...r }) => /* @__PURE__ */ g(pe, {
|
|
102
102
|
...r,
|
|
103
103
|
fontSize: 12,
|
|
@@ -107,168 +107,168 @@ var E = m.forwardRef(({ className: t, config: h, palette: b, data: x, dataKeys:
|
|
|
107
107
|
}, [
|
|
108
108
|
q,
|
|
109
109
|
K,
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
S,
|
|
111
|
+
k,
|
|
112
112
|
R
|
|
113
|
-
]), Y = m.useMemo(() => q ?
|
|
113
|
+
]), Y = m.useMemo(() => q ? S.map((e) => ({
|
|
114
114
|
...e,
|
|
115
|
-
...Object.fromEntries(
|
|
116
|
-
})) :
|
|
115
|
+
...Object.fromEntries(D.map((t) => [`_proj_${t}`, e[t]]))
|
|
116
|
+
})) : S, [
|
|
117
117
|
q,
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
S,
|
|
119
|
+
D
|
|
120
120
|
]), X = m.useMemo(() => {
|
|
121
|
-
if (!(K <= 0)) return
|
|
121
|
+
if (!(K <= 0)) return S[K - 1]?.[k];
|
|
122
122
|
}, [
|
|
123
123
|
K,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
]), Z = `line-proj-${m.useId().replace(/:/g, "")}`,
|
|
127
|
-
if (!
|
|
128
|
-
let e =
|
|
124
|
+
S,
|
|
125
|
+
k
|
|
126
|
+
]), Z = `line-proj-${m.useId().replace(/:/g, "")}`, Ze = m.useMemo(() => {
|
|
127
|
+
if (!V) return;
|
|
128
|
+
let e = E(V);
|
|
129
129
|
return q ? _e(e) : e;
|
|
130
|
-
}, [
|
|
131
|
-
field: `${
|
|
130
|
+
}, [V, q]), Qe = ie(A), $e = ae(j), Q = (ve ?? []).map(([e, t], n) => ({
|
|
131
|
+
field: `${w}${n}`,
|
|
132
132
|
current: e,
|
|
133
133
|
comparison: t
|
|
134
|
-
})), $ = Q.length > 0,
|
|
134
|
+
})), $ = Q.length > 0, et = Ze ?? ($ || q ? ((e) => /* @__PURE__ */ g(o, {
|
|
135
135
|
active: e.active,
|
|
136
136
|
label: e.label,
|
|
137
|
-
payload:
|
|
138
|
-
})) : /* @__PURE__ */ g(o, {})),
|
|
137
|
+
payload: l(T(e.payload))
|
|
138
|
+
})) : /* @__PURE__ */ g(o, {})), tt = $ || q ? ((e) => /* @__PURE__ */ g(i, {
|
|
139
139
|
verticalAlign: e.verticalAlign,
|
|
140
|
-
payload:
|
|
141
|
-
})) : /* @__PURE__ */ g(i, {}),
|
|
140
|
+
payload: l(T(e.payload))
|
|
141
|
+
})) : /* @__PURE__ */ g(i, {}), nt = Q.length ? Y.map((e) => {
|
|
142
142
|
let t = { ...e };
|
|
143
143
|
for (let { field: n, current: r, comparison: i } of Q) {
|
|
144
144
|
let a = e[r], o = e[i];
|
|
145
145
|
t[n] = typeof a == "number" && typeof o == "number" ? [Math.min(a, o), Math.max(a, o)] : void 0;
|
|
146
146
|
}
|
|
147
147
|
return t;
|
|
148
|
-
}) : Y,
|
|
148
|
+
}) : Y, rt = Q.length > 0 ? y : de;
|
|
149
149
|
return /* @__PURE__ */ g("div", {
|
|
150
150
|
ref: Ge,
|
|
151
|
-
"data-curve":
|
|
152
|
-
"data-line-style":
|
|
153
|
-
className: e(
|
|
154
|
-
curve:
|
|
155
|
-
lineStyle:
|
|
151
|
+
"data-curve": M,
|
|
152
|
+
"data-line-style": N,
|
|
153
|
+
className: e(C({
|
|
154
|
+
curve: M,
|
|
155
|
+
lineStyle: N
|
|
156
156
|
}), t),
|
|
157
157
|
...We,
|
|
158
158
|
children: /* @__PURE__ */ g(n, {
|
|
159
159
|
config: h,
|
|
160
|
-
palette:
|
|
160
|
+
palette: x,
|
|
161
161
|
className: "size-full [&_.recharts-label]:fill-foreground",
|
|
162
|
-
children: /* @__PURE__ */ _(
|
|
163
|
-
data:
|
|
164
|
-
margin: Ye ?
|
|
162
|
+
children: /* @__PURE__ */ _(rt, {
|
|
163
|
+
data: nt,
|
|
164
|
+
margin: Ye ? c : void 0,
|
|
165
165
|
children: [
|
|
166
|
-
|
|
166
|
+
we && /* @__PURE__ */ g(v, {
|
|
167
167
|
horizontal: Ne ?? !0,
|
|
168
168
|
vertical: Pe ?? !1,
|
|
169
169
|
strokeDasharray: Me ? "3 3" : void 0
|
|
170
170
|
}),
|
|
171
171
|
/* @__PURE__ */ g(me, {
|
|
172
|
-
dataKey:
|
|
172
|
+
dataKey: k,
|
|
173
173
|
type: "category",
|
|
174
|
-
hide: !
|
|
174
|
+
hide: !De,
|
|
175
175
|
tickLine: !1,
|
|
176
176
|
axisLine: !1,
|
|
177
177
|
tickMargin: 8,
|
|
178
178
|
tickFormatter: J ? void 0 : R,
|
|
179
179
|
tick: J,
|
|
180
180
|
angle: z,
|
|
181
|
-
interval:
|
|
182
|
-
textAnchor:
|
|
183
|
-
height:
|
|
184
|
-
label:
|
|
181
|
+
interval: Ae,
|
|
182
|
+
textAnchor: ne(z),
|
|
183
|
+
height: Xe,
|
|
184
|
+
label: Qe
|
|
185
185
|
}),
|
|
186
186
|
/* @__PURE__ */ g(he, {
|
|
187
187
|
type: "number",
|
|
188
|
-
hide: !
|
|
188
|
+
hide: !Oe,
|
|
189
189
|
tickLine: !1,
|
|
190
190
|
axisLine: !1,
|
|
191
191
|
unit: ye,
|
|
192
|
-
tickFormatter:
|
|
193
|
-
tickCount:
|
|
192
|
+
tickFormatter: ke,
|
|
193
|
+
tickCount: je,
|
|
194
194
|
domain: qe,
|
|
195
|
-
width:
|
|
196
|
-
label:
|
|
195
|
+
width: j ? 72 : void 0,
|
|
196
|
+
label: $e
|
|
197
197
|
}),
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
Te && /* @__PURE__ */ g(a, { content: et }),
|
|
199
|
+
Ee && /* @__PURE__ */ g(r, { content: tt }),
|
|
200
200
|
q && X != null && /* @__PURE__ */ g(ge, {
|
|
201
201
|
projectionStart: L,
|
|
202
202
|
prevTick: X,
|
|
203
203
|
clipId: Z,
|
|
204
|
-
dataKeys:
|
|
204
|
+
dataKeys: D
|
|
205
205
|
}),
|
|
206
|
-
Q.map(({ field: e, current: t }) => /* @__PURE__ */ g(
|
|
206
|
+
Q.map(({ field: e, current: t }) => /* @__PURE__ */ g(ce, {
|
|
207
207
|
dataKey: e,
|
|
208
|
-
type:
|
|
208
|
+
type: G(t),
|
|
209
209
|
stroke: "none",
|
|
210
|
-
fill:
|
|
210
|
+
fill: W(t),
|
|
211
211
|
fillOpacity: .12,
|
|
212
212
|
connectNulls: F,
|
|
213
213
|
dot: !1,
|
|
214
214
|
activeDot: !1,
|
|
215
215
|
clipPath: q ? `url(#${Z}-actual)` : void 0,
|
|
216
|
-
...
|
|
216
|
+
...U,
|
|
217
217
|
legendType: "none",
|
|
218
218
|
tooltipType: "none"
|
|
219
219
|
}, e)),
|
|
220
|
-
|
|
221
|
-
let n =
|
|
222
|
-
return /* @__PURE__ */ g(
|
|
220
|
+
D.map((e, t) => {
|
|
221
|
+
let n = O?.includes(e), r = I?.[e], i = !n && (r?.showDots ?? be), a = r?.dotSize ?? xe, o = !n && (Se ?? i), s = r?.dashed ?? N === "dashed", c = r?.showLabel ?? H, l = r?.labelPosition ?? Ke;
|
|
222
|
+
return /* @__PURE__ */ g(b, {
|
|
223
223
|
className: q && !n ? `actual-${Z}-${t}` : void 0,
|
|
224
|
-
type:
|
|
224
|
+
type: G(e),
|
|
225
225
|
dataKey: e,
|
|
226
|
-
stroke:
|
|
227
|
-
strokeWidth: r?.strokeWidth ??
|
|
226
|
+
stroke: W(e),
|
|
227
|
+
strokeWidth: r?.strokeWidth ?? P,
|
|
228
228
|
strokeDasharray: n || s ? "5 5" : void 0,
|
|
229
229
|
strokeOpacity: n ? .5 : void 0,
|
|
230
230
|
dot: i ? { r: a } : !1,
|
|
231
231
|
activeDot: o ? { r: a + 2 } : !1,
|
|
232
232
|
connectNulls: F,
|
|
233
|
-
...
|
|
234
|
-
children: c && /* @__PURE__ */ g(
|
|
233
|
+
...U,
|
|
234
|
+
children: c && /* @__PURE__ */ g(ue, {
|
|
235
235
|
dataKey: e,
|
|
236
236
|
position: l,
|
|
237
|
-
formatter:
|
|
238
|
-
className:
|
|
237
|
+
formatter: oe(Be),
|
|
238
|
+
className: ee(l),
|
|
239
239
|
fontSize: 12
|
|
240
240
|
})
|
|
241
241
|
}, e);
|
|
242
242
|
}),
|
|
243
|
-
q &&
|
|
244
|
-
if (
|
|
243
|
+
q && D.map((e, t) => {
|
|
244
|
+
if (O?.includes(e)) return null;
|
|
245
245
|
let n = I?.[e];
|
|
246
|
-
return /* @__PURE__ */ g(
|
|
246
|
+
return /* @__PURE__ */ g(b, {
|
|
247
247
|
className: `proj-${Z}-${t}`,
|
|
248
|
-
type:
|
|
248
|
+
type: G(e),
|
|
249
249
|
dataKey: `_proj_${e}`,
|
|
250
250
|
name: e,
|
|
251
|
-
stroke:
|
|
252
|
-
strokeWidth: n?.strokeWidth ??
|
|
251
|
+
stroke: W(e),
|
|
252
|
+
strokeWidth: n?.strokeWidth ?? P,
|
|
253
253
|
strokeDasharray: "5 5",
|
|
254
254
|
dot: !1,
|
|
255
255
|
activeDot: !1,
|
|
256
256
|
legendType: "none",
|
|
257
257
|
tooltipType: "none",
|
|
258
|
-
...
|
|
258
|
+
...U
|
|
259
259
|
}, `_proj_${e}`);
|
|
260
260
|
}),
|
|
261
261
|
Je.map((e, t) => {
|
|
262
|
-
let n =
|
|
263
|
-
return n === void 0 ? null : /* @__PURE__ */ g(
|
|
262
|
+
let n = p(e, S, D);
|
|
263
|
+
return n === void 0 ? null : /* @__PURE__ */ g(fe, {
|
|
264
264
|
y: n,
|
|
265
|
-
...
|
|
265
|
+
...te(e.label, e.labelPosition)
|
|
266
266
|
}, `${e.label ?? "ref"}-${t}`);
|
|
267
267
|
}),
|
|
268
|
-
Ve && /* @__PURE__ */ g(
|
|
269
|
-
dataKey:
|
|
268
|
+
Ve && /* @__PURE__ */ g(le, {
|
|
269
|
+
dataKey: k,
|
|
270
270
|
tickFormatter: R,
|
|
271
|
-
...
|
|
271
|
+
...f({
|
|
272
272
|
brushHeight: He,
|
|
273
273
|
brushAriaLabel: Ue
|
|
274
274
|
})
|
|
@@ -278,8 +278,8 @@ var E = m.forwardRef(({ className: t, config: h, palette: b, data: x, dataKeys:
|
|
|
278
278
|
})
|
|
279
279
|
});
|
|
280
280
|
});
|
|
281
|
-
|
|
281
|
+
D.displayName = "LineChart";
|
|
282
282
|
//#endregion
|
|
283
|
-
export {
|
|
283
|
+
export { D as LineChart, E as createBandStrippedTooltip, T as dropBandSeries, C as lineChartVariants };
|
|
284
284
|
|
|
285
285
|
//# sourceMappingURL=line-chart.js.map
|