@acronis-platform/ui-react 4.1.0 → 5.1.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 +191 -85
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +288 -225
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/card-widget-carousel/card-widget-carousel.js +85 -0
- package/dist/components/ui/card-widget-carousel/card-widget-carousel.js.map +1 -0
- package/dist/components/ui/card-widget-carousel/card-widget.js +82 -0
- package/dist/components/ui/card-widget-carousel/card-widget.js.map +1 -0
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart-format.js +25 -22
- package/dist/components/ui/chart/chart-format.js.map +1 -1
- package/dist/components/ui/chart/chart-palette.js +9 -8
- package/dist/components/ui/chart/chart-palette.js.map +1 -1
- package/dist/components/ui/chart/chart.js +127 -89
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +189 -113
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/input-select/input-select.js +18 -9
- package/dist/components/ui/input-select/input-select.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +194 -86
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +76 -66
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +5 -2
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/separator/separator.js +52 -10
- package/dist/components/ui/separator/separator.js.map +1 -1
- package/dist/components/ui/sidebar-secondary/sidebar-secondary.js +144 -121
- package/dist/components/ui/sidebar-secondary/sidebar-secondary.js.map +1 -1
- package/dist/components/ui/tree-item/tree-item.js +67 -0
- package/dist/components/ui/tree-item/tree-item.js.map +1 -0
- package/dist/components/ui/treemap/treemap.js +73 -66
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/index.js +109 -107
- package/dist/llms/area-chart.md +2 -1
- package/dist/llms/bar-chart.md +132 -33
- package/dist/llms/card-widget-carousel.md +252 -0
- package/dist/llms/category-bar.md +2 -2
- package/dist/llms/funnel-chart.md +269 -101
- package/dist/llms/input-select.md +175 -1
- package/dist/llms/line-chart.md +2 -1
- package/dist/llms/metric.md +10 -5
- package/dist/llms/radar-chart.md +15 -5
- package/dist/llms/scatter-chart.md +2 -1
- package/dist/llms/separator.md +27 -8
- package/dist/llms/sidebar-secondary.md +235 -4
- package/dist/llms/tree-item.md +359 -0
- package/dist/llms/treemap.md +47 -36
- package/dist/llms.txt +5 -4
- package/dist/react.js +109 -107
- package/dist/src/components/ui/area-chart/area-chart.d.ts +10 -0
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +75 -10
- package/dist/src/components/ui/bar-chart/bar-chart.docs.d.ts +146 -0
- package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/card-widget-carousel/card-widget-carousel.d.ts +9 -0
- package/dist/src/components/ui/card-widget-carousel/card-widget.d.ts +43 -0
- package/dist/src/components/ui/card-widget-carousel/index.d.ts +2 -0
- package/dist/src/components/ui/chart/chart-format.d.ts +9 -1
- package/dist/src/components/ui/chart/chart-palette.d.ts +38 -10
- package/dist/src/components/ui/chart/chart.d.ts +8 -1
- package/dist/src/components/ui/chart/index.d.ts +2 -2
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +92 -26
- package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
- package/dist/src/components/ui/input-select/input-select.d.ts +34 -2
- package/dist/src/components/ui/line-chart/line-chart.d.ts +11 -1
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +42 -9
- package/dist/src/components/ui/separator/separator.d.ts +9 -1
- package/dist/src/components/ui/sidebar-secondary/sidebar-secondary.d.ts +23 -3
- package/dist/src/components/ui/tree-item/index.d.ts +1 -0
- package/dist/src/components/ui/tree-item/tree-item.d.ts +64 -0
- package/dist/src/components/ui/treemap/treemap.d.ts +16 -5
- package/dist/src/index.d.ts +2 -1
- package/dist/ui-react.css +1 -1
- package/package.json +1 -1
- package/dist/components/ui/meter/meter.js +0 -79
- package/dist/components/ui/meter/meter.js.map +0 -1
- package/dist/llms/meter.md +0 -177
- package/dist/src/components/ui/meter/index.d.ts +0 -1
- package/dist/src/components/ui/meter/meter.d.ts +0 -25
|
@@ -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.\n const handleOpenChange = React.useCallback<\n NonNullable<SelectPrimitive.Root.Props<Value, Multiple>['onOpenChange']>\n >(\n (open, eventDetails) => {\n onOpenChange?.(open, eventDetails);\n if (!open) {\n setQuery('');\n }\n },\n [onOpenChange]\n );\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 * Container to portal the dropdown into. Defaults to the document body;\n * pass an element to scope the portal (e.g. a shadow root, so the popup\n * inherits styles defined there).\n */\n portalContainer?: SelectPrimitive.Portal.Props['container'];\n }\n>(\n (\n {\n className,\n children,\n sideOffset = 4,\n align = 'start',\n side = 'bottom',\n portalContainer,\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 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 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)] py-[var(--ui-input-select-dropdown-container-padding-y)] text-sm shadow-md outline-none',\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,GAG3D,IAAmB,EAAM,aAG5B,GAAM,MAAiB;EAEtB,AADA,IAAe,GAAM,CAAY,GAC5B,KACH,EAAS,EAAE;CAEf,GACA,CAAC,CAAY,CACf;CAEA,OACE,kBAAC,EAAuB,UAAxB;EAAiC,OAAO,EAAQ,EAAM;EACpD,UAAA,kBAAC,EAAyB,UAA1B;GAAmC,OAAO;GACxC,UAAA,kBAAC,EAAgB,MAAjB;IAAsB,GAAI;IAAO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CACf,WAAW,EACT,sXACA,8JACA,CACF;CACA,GAAI;CAVN,UAAA;EAYE,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;GACV,OAAO,EACL,UACE,OAAO,KAAW,YAAY,IAAS,IAAI,EAAa,CAAM,IAAI,EACtE;GAEC,UAAW,EAAX,IAAY,IAAgC,GAAjC,EAAiB,MAAM,GAAK,CAAiC;EACrE,CAAA;EACL,KACC,kBAAC,QAAD;GAAM,WAAU;GACb,UAAA;EACG,CAAA;EAER,kBAAC,QAAD;GAAM,WAAU;GAA2B;EAAe,CAAA;CACpD;AACT,CAAA,CAAA;AACD,EAAoB,cAAc;AAElC,IAAM,IAAyB,EAAM,YAGlC,EAAE,cAAW,GAAG,KAAS,MAC1B,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
|
+
{"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,A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M,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"}
|
|
@@ -2,10 +2,10 @@
|
|
|
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
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 s,
|
|
6
|
-
import * as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { Area as
|
|
5
|
+
import { CHART_LABEL_MARGIN as s, dropProjectionPayload as c, resolveAnimation as l, resolveAxisDomain as u, resolveBrushProps as d, resolveChartReferenceValue as f, resolveLabelFillClass as p, resolveReferenceLineProps as ee, resolveRotatedTickAnchor as te, resolveXAxisHeight as ne, resolveXAxisTitle as re, resolveYAxisTitle as ie, toLabelFormatter as ae, toReferenceLineList as oe } from "../chart/chart-format.js";
|
|
6
|
+
import * as m from "react";
|
|
7
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
+
import { Area as se, Brush as ce, CartesianGrid as le, ComposedChart as ue, LabelList as de, Line as v, LineChart as fe, ReferenceLine as y, Text as pe, XAxis as me, YAxis as he, usePlotArea as b, useXAxisScale as x } from "recharts";
|
|
9
9
|
//#region src/components/ui/line-chart/line-chart.tsx
|
|
10
10
|
var S = t("", {
|
|
11
11
|
variants: {
|
|
@@ -27,7 +27,43 @@ var S = t("", {
|
|
|
27
27
|
curve: "monotone",
|
|
28
28
|
lineStyle: "solid"
|
|
29
29
|
}
|
|
30
|
-
})
|
|
30
|
+
});
|
|
31
|
+
function ge({ projectionStart: e, prevTick: t, clipId: n, dataKeys: r }) {
|
|
32
|
+
let i = x(), a = b();
|
|
33
|
+
if (!i || !a) return null;
|
|
34
|
+
let o = i(t), s = i(e);
|
|
35
|
+
if (o == null || s == null) return null;
|
|
36
|
+
let c = (o + s) / 2, { x: l, y: u, width: d, height: f } = a, p = r.map((e, t) => `.actual-${n}-${t}{clip-path:url(#${n}-actual)}.proj-${n}-${t}{clip-path:url(#${n}-projection)}`).join("");
|
|
37
|
+
return /* @__PURE__ */ _(h, { children: [
|
|
38
|
+
/* @__PURE__ */ _("defs", { children: [/* @__PURE__ */ g("clipPath", {
|
|
39
|
+
id: `${n}-actual`,
|
|
40
|
+
children: /* @__PURE__ */ g("rect", {
|
|
41
|
+
x: l,
|
|
42
|
+
y: u,
|
|
43
|
+
width: c - l,
|
|
44
|
+
height: f
|
|
45
|
+
})
|
|
46
|
+
}), /* @__PURE__ */ g("clipPath", {
|
|
47
|
+
id: `${n}-projection`,
|
|
48
|
+
children: /* @__PURE__ */ g("rect", {
|
|
49
|
+
x: c,
|
|
50
|
+
y: u,
|
|
51
|
+
width: l + d - c,
|
|
52
|
+
height: f
|
|
53
|
+
})
|
|
54
|
+
})] }),
|
|
55
|
+
/* @__PURE__ */ g("style", { children: p }),
|
|
56
|
+
/* @__PURE__ */ g("line", {
|
|
57
|
+
x1: c,
|
|
58
|
+
y1: u,
|
|
59
|
+
x2: c,
|
|
60
|
+
y2: u + f,
|
|
61
|
+
stroke: "var(--ui-border-on-surface-border)",
|
|
62
|
+
strokeDasharray: "4 4"
|
|
63
|
+
})
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
var C = "__band_";
|
|
31
67
|
function w(e) {
|
|
32
68
|
return e?.filter((e) => !String(e.dataKey).startsWith(C));
|
|
33
69
|
}
|
|
@@ -37,132 +73,204 @@ function T(e) {
|
|
|
37
73
|
...t,
|
|
38
74
|
payload: w(t.payload)
|
|
39
75
|
};
|
|
40
|
-
return typeof e == "function" ?
|
|
76
|
+
return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
|
|
41
77
|
};
|
|
42
78
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
79
|
+
function _e(e) {
|
|
80
|
+
return function(t) {
|
|
81
|
+
let n = {
|
|
82
|
+
...t,
|
|
83
|
+
payload: c(t.payload)
|
|
84
|
+
};
|
|
85
|
+
return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
var E = m.forwardRef(({ className: t, config: h, palette: b, data: x, dataKeys: E, comparisonKeys: D, deltaBands: ve, xKey: O, xAxisLabel: k, yAxisLabel: A, yUnit: ye, curve: j = "monotone", lineStyle: M = "solid", strokeWidth: N = 2, showDots: P = !1, dotSize: be = 3, showActiveDot: xe, connectNulls: F = !1, lineSettings: I, referenceLine: Se, projectionStart: L, showGrid: Ce = !0, showTooltip: we = !0, showLegend: Te = !0, showXAxis: Ee = !0, showYAxis: De = !0, xTickFormatter: R, yTickFormatter: Oe, xAxisAngle: z, xAxisInterval: ke, yAxisTickCount: Ae, yAxisDomain: je, gridDashed: Me, gridHorizontal: Ne, gridVertical: Pe, tooltipContent: B, animate: Fe, animationDuration: Ie, animationBegin: Le, animationEasing: Re, showLabels: V = !1, labelPosition: ze, labelFormatter: Be, showBrush: Ve = !1, brushHeight: He, brushAriaLabel: Ue, ...We }, Ge) => {
|
|
89
|
+
let H = l({
|
|
90
|
+
animate: Fe,
|
|
91
|
+
animationDuration: Ie,
|
|
92
|
+
animationBegin: Le,
|
|
93
|
+
animationEasing: Re
|
|
94
|
+
}), Ke = ze ?? "top", qe = u(je), Je = oe(Se), U = (e) => I?.[e]?.color ?? `var(--color-${e})`, W = (e) => I?.[e]?.curveType ?? j ?? "monotone", Ye = V || Object.values(I ?? {}).some((e) => e.showLabel), G = ne(k, z), K = m.useMemo(() => L === void 0 ? -1 : x.findIndex((e) => e[O] === L), [
|
|
95
|
+
L,
|
|
96
|
+
x,
|
|
97
|
+
O
|
|
98
|
+
]), q = K > 0, J = m.useMemo(() => {
|
|
99
|
+
if (!q) return;
|
|
100
|
+
let e = new Set(x.slice(K).map((e) => e[O]));
|
|
101
|
+
return ({ payload: t, index: n, ...r }) => /* @__PURE__ */ g(pe, {
|
|
102
|
+
...r,
|
|
103
|
+
fontSize: 12,
|
|
104
|
+
className: e.has(t.value) ? "fill-[var(--ui-text-on-surface-disabled)]" : "fill-muted-foreground",
|
|
105
|
+
children: R ? R(t.value, n) : t.value
|
|
106
|
+
});
|
|
107
|
+
}, [
|
|
108
|
+
q,
|
|
109
|
+
K,
|
|
110
|
+
x,
|
|
111
|
+
O,
|
|
112
|
+
R
|
|
113
|
+
]), Y = m.useMemo(() => q ? x.map((e) => ({
|
|
114
|
+
...e,
|
|
115
|
+
...Object.fromEntries(E.map((t) => [`_proj_${t}`, e[t]]))
|
|
116
|
+
})) : x, [
|
|
117
|
+
q,
|
|
118
|
+
x,
|
|
119
|
+
E
|
|
120
|
+
]), X = m.useMemo(() => {
|
|
121
|
+
if (!(K <= 0)) return x[K - 1]?.[O];
|
|
122
|
+
}, [
|
|
123
|
+
K,
|
|
124
|
+
x,
|
|
125
|
+
O
|
|
126
|
+
]), Z = `line-proj-${m.useId().replace(/:/g, "")}`, Xe = m.useMemo(() => {
|
|
127
|
+
if (!B) return;
|
|
128
|
+
let e = T(B);
|
|
129
|
+
return q ? _e(e) : e;
|
|
130
|
+
}, [B, q]), Ze = re(k), Qe = ie(A), Q = (ve ?? []).map(([e, t], n) => ({
|
|
50
131
|
field: `${C}${n}`,
|
|
51
132
|
current: e,
|
|
52
133
|
comparison: t
|
|
53
|
-
})), $ = Q.length > 0,
|
|
134
|
+
})), $ = Q.length > 0, $e = Xe ?? ($ || q ? ((e) => /* @__PURE__ */ g(o, {
|
|
54
135
|
active: e.active,
|
|
55
136
|
label: e.label,
|
|
56
|
-
payload: w(e.payload)
|
|
57
|
-
})) : /* @__PURE__ */
|
|
137
|
+
payload: c(w(e.payload))
|
|
138
|
+
})) : /* @__PURE__ */ g(o, {})), et = $ || q ? ((e) => /* @__PURE__ */ g(i, {
|
|
58
139
|
verticalAlign: e.verticalAlign,
|
|
59
|
-
payload: w(e.payload)
|
|
60
|
-
})) : /* @__PURE__ */
|
|
140
|
+
payload: c(w(e.payload))
|
|
141
|
+
})) : /* @__PURE__ */ g(i, {}), tt = Q.length ? Y.map((e) => {
|
|
61
142
|
let t = { ...e };
|
|
62
143
|
for (let { field: n, current: r, comparison: i } of Q) {
|
|
63
144
|
let a = e[r], o = e[i];
|
|
64
145
|
t[n] = typeof a == "number" && typeof o == "number" ? [Math.min(a, o), Math.max(a, o)] : void 0;
|
|
65
146
|
}
|
|
66
147
|
return t;
|
|
67
|
-
}) :
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
ref:
|
|
70
|
-
"data-curve":
|
|
71
|
-
"data-line-style":
|
|
148
|
+
}) : Y, nt = Q.length > 0 ? ue : fe;
|
|
149
|
+
return /* @__PURE__ */ g("div", {
|
|
150
|
+
ref: Ge,
|
|
151
|
+
"data-curve": j,
|
|
152
|
+
"data-line-style": M,
|
|
72
153
|
className: e(S({
|
|
73
|
-
curve:
|
|
74
|
-
lineStyle:
|
|
154
|
+
curve: j,
|
|
155
|
+
lineStyle: M
|
|
75
156
|
}), t),
|
|
76
|
-
...
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
config:
|
|
79
|
-
palette:
|
|
157
|
+
...We,
|
|
158
|
+
children: /* @__PURE__ */ g(n, {
|
|
159
|
+
config: h,
|
|
160
|
+
palette: b,
|
|
80
161
|
className: "size-full [&_.recharts-label]:fill-foreground",
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
data:
|
|
83
|
-
margin:
|
|
162
|
+
children: /* @__PURE__ */ _(nt, {
|
|
163
|
+
data: tt,
|
|
164
|
+
margin: Ye ? s : void 0,
|
|
84
165
|
children: [
|
|
85
|
-
|
|
86
|
-
horizontal:
|
|
87
|
-
vertical:
|
|
88
|
-
strokeDasharray:
|
|
166
|
+
Ce && /* @__PURE__ */ g(le, {
|
|
167
|
+
horizontal: Ne ?? !0,
|
|
168
|
+
vertical: Pe ?? !1,
|
|
169
|
+
strokeDasharray: Me ? "3 3" : void 0
|
|
89
170
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
dataKey:
|
|
171
|
+
/* @__PURE__ */ g(me, {
|
|
172
|
+
dataKey: O,
|
|
92
173
|
type: "category",
|
|
93
|
-
hide: !
|
|
174
|
+
hide: !Ee,
|
|
94
175
|
tickLine: !1,
|
|
95
176
|
axisLine: !1,
|
|
96
177
|
tickMargin: 8,
|
|
97
|
-
tickFormatter:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
178
|
+
tickFormatter: J ? void 0 : R,
|
|
179
|
+
tick: J,
|
|
180
|
+
angle: z,
|
|
181
|
+
interval: ke,
|
|
182
|
+
textAnchor: te(z),
|
|
183
|
+
height: G,
|
|
184
|
+
label: Ze
|
|
103
185
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ g(he, {
|
|
105
187
|
type: "number",
|
|
106
|
-
hide: !
|
|
188
|
+
hide: !De,
|
|
107
189
|
tickLine: !1,
|
|
108
190
|
axisLine: !1,
|
|
109
|
-
unit:
|
|
110
|
-
tickFormatter:
|
|
111
|
-
tickCount:
|
|
112
|
-
domain:
|
|
113
|
-
width:
|
|
114
|
-
label:
|
|
191
|
+
unit: ye,
|
|
192
|
+
tickFormatter: Oe,
|
|
193
|
+
tickCount: Ae,
|
|
194
|
+
domain: qe,
|
|
195
|
+
width: A ? 72 : void 0,
|
|
196
|
+
label: Qe
|
|
197
|
+
}),
|
|
198
|
+
we && /* @__PURE__ */ g(a, { content: $e }),
|
|
199
|
+
Te && /* @__PURE__ */ g(r, { content: et }),
|
|
200
|
+
q && X != null && /* @__PURE__ */ g(ge, {
|
|
201
|
+
projectionStart: L,
|
|
202
|
+
prevTick: X,
|
|
203
|
+
clipId: Z,
|
|
204
|
+
dataKeys: E
|
|
115
205
|
}),
|
|
116
|
-
|
|
117
|
-
me && /* @__PURE__ */ v(r, { content: Ue }),
|
|
118
|
-
Q.map(({ field: e, current: t }) => /* @__PURE__ */ v(b, {
|
|
206
|
+
Q.map(({ field: e, current: t }) => /* @__PURE__ */ g(se, {
|
|
119
207
|
dataKey: e,
|
|
120
|
-
type:
|
|
208
|
+
type: W(t),
|
|
121
209
|
stroke: "none",
|
|
122
|
-
fill:
|
|
210
|
+
fill: U(t),
|
|
123
211
|
fillOpacity: .12,
|
|
124
|
-
connectNulls:
|
|
212
|
+
connectNulls: F,
|
|
125
213
|
dot: !1,
|
|
126
214
|
activeDot: !1,
|
|
127
|
-
|
|
215
|
+
clipPath: q ? `url(#${Z}-actual)` : void 0,
|
|
216
|
+
...H,
|
|
128
217
|
legendType: "none",
|
|
129
218
|
tooltipType: "none"
|
|
130
219
|
}, e)),
|
|
131
|
-
|
|
132
|
-
let
|
|
133
|
-
return /* @__PURE__ */ v
|
|
134
|
-
|
|
220
|
+
E.map((e, t) => {
|
|
221
|
+
let n = D?.includes(e), r = I?.[e], i = !n && (r?.showDots ?? P), a = r?.dotSize ?? be, o = !n && (xe ?? i), s = r?.dashed ?? M === "dashed", c = r?.showLabel ?? V, l = r?.labelPosition ?? Ke;
|
|
222
|
+
return /* @__PURE__ */ g(v, {
|
|
223
|
+
className: q && !n ? `actual-${Z}-${t}` : void 0,
|
|
224
|
+
type: W(e),
|
|
135
225
|
dataKey: e,
|
|
136
|
-
stroke:
|
|
137
|
-
strokeWidth:
|
|
138
|
-
strokeDasharray:
|
|
139
|
-
strokeOpacity:
|
|
140
|
-
dot:
|
|
141
|
-
activeDot:
|
|
142
|
-
connectNulls:
|
|
143
|
-
...
|
|
144
|
-
children:
|
|
226
|
+
stroke: U(e),
|
|
227
|
+
strokeWidth: r?.strokeWidth ?? N,
|
|
228
|
+
strokeDasharray: n || s ? "5 5" : void 0,
|
|
229
|
+
strokeOpacity: n ? .5 : void 0,
|
|
230
|
+
dot: i ? { r: a } : !1,
|
|
231
|
+
activeDot: o ? { r: a + 2 } : !1,
|
|
232
|
+
connectNulls: F,
|
|
233
|
+
...H,
|
|
234
|
+
children: c && /* @__PURE__ */ g(de, {
|
|
145
235
|
dataKey: e,
|
|
146
|
-
position:
|
|
147
|
-
formatter:
|
|
148
|
-
className:
|
|
236
|
+
position: l,
|
|
237
|
+
formatter: ae(Be),
|
|
238
|
+
className: p(l),
|
|
149
239
|
fontSize: 12
|
|
150
240
|
})
|
|
151
241
|
}, e);
|
|
152
242
|
}),
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
243
|
+
q && E.map((e, t) => {
|
|
244
|
+
if (D?.includes(e)) return null;
|
|
245
|
+
let n = I?.[e];
|
|
246
|
+
return /* @__PURE__ */ g(v, {
|
|
247
|
+
className: `proj-${Z}-${t}`,
|
|
248
|
+
type: W(e),
|
|
249
|
+
dataKey: `_proj_${e}`,
|
|
250
|
+
name: e,
|
|
251
|
+
stroke: U(e),
|
|
252
|
+
strokeWidth: n?.strokeWidth ?? N,
|
|
253
|
+
strokeDasharray: "5 5",
|
|
254
|
+
dot: !1,
|
|
255
|
+
activeDot: !1,
|
|
256
|
+
legendType: "none",
|
|
257
|
+
tooltipType: "none",
|
|
258
|
+
...H
|
|
259
|
+
}, `_proj_${e}`);
|
|
260
|
+
}),
|
|
261
|
+
Je.map((e, t) => {
|
|
262
|
+
let n = f(e, x, E);
|
|
263
|
+
return n === void 0 ? null : /* @__PURE__ */ g(y, {
|
|
156
264
|
y: n,
|
|
157
|
-
...
|
|
265
|
+
...ee(e.label, e.labelPosition)
|
|
158
266
|
}, `${e.label ?? "ref"}-${t}`);
|
|
159
267
|
}),
|
|
160
|
-
|
|
161
|
-
dataKey:
|
|
162
|
-
tickFormatter:
|
|
163
|
-
...
|
|
164
|
-
brushHeight:
|
|
165
|
-
brushAriaLabel:
|
|
268
|
+
Ve && /* @__PURE__ */ g(ce, {
|
|
269
|
+
dataKey: O,
|
|
270
|
+
tickFormatter: R,
|
|
271
|
+
...d({
|
|
272
|
+
brushHeight: He,
|
|
273
|
+
brushAriaLabel: Ue
|
|
166
274
|
})
|
|
167
275
|
})
|
|
168
276
|
]
|