impact-nova 2.6.2 → 3.0.0-alpha.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/data/ag-grid-react/ag-grid-cell-components.d.ts +9 -0
- package/dist/components/data/ag-grid-react/ag-grid-list.d.ts +16 -0
- package/dist/components/data/ag-grid-react/ag-grid-list.js +23 -0
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +21 -9
- package/dist/components/data/ag-grid-react/cell-renderers/editors/list-select-cell-editor.d.ts +14 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/list-select-cell-editor.js +70 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/select-cell-editor.d.ts +10 -5
- package/dist/components/data/ag-grid-react/cell-renderers/editors/select-cell-editor.js +73 -41
- package/dist/components/data/ag-grid-react/cell-renderers/index.d.ts +7 -0
- package/dist/components/data/ag-grid-react/cell-renderers/index.js +42 -36
- package/dist/components/data/ag-grid-react/cell-renderers/list-select-display-renderer.d.ts +19 -0
- package/dist/components/data/ag-grid-react/cell-renderers/list-select-display-renderer.js +89 -0
- package/dist/components/data/ag-grid-react/cell-renderers/select-ai-insight-affordance.d.ts +28 -0
- package/dist/components/data/ag-grid-react/cell-renderers/select-ai-insight-affordance.js +96 -0
- package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.d.ts +30 -10
- package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.js +72 -24
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.d.ts +42 -0
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.js +86 -0
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +2 -12
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +200 -207
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +263 -244
- package/dist/components/data/data-table/data-table.js +85 -82
- package/dist/components/data/data-table/data-table.types.d.ts +5 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +2 -3
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +2 -3
- package/dist/components/data/expandable-list-item/sku-next-page-coordinator.d.ts +14 -0
- package/dist/components/data/expandable-list-item/sku-strip-lookahead.d.ts +26 -0
- package/dist/components/data/expandable-list-item/useServerSkuInfinitePages.d.ts +10 -0
- package/dist/components/data/expandable-list-item/useSkuStripVirtualizer.d.ts +30 -0
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.catalog.d.ts +81 -0
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.item-grid.d.ts +1 -0
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.product-card.d.ts +7 -0
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.sku-picker.d.ts +2 -0
- package/dist/components/data-display/chart/chart-heatmap-demos.d.ts +3 -0
- package/dist/components/data-display/chart/chart-heatmap-play.d.ts +9 -0
- package/dist/components/data-display/chart/chart.category-cluster-heatmap.stories-data.d.ts +22 -0
- package/dist/components/data-display/chart/chart.diverging-heatmap.stories-data.d.ts +43 -0
- package/dist/components/data-display/chart/chart.js +100 -93
- package/dist/components/data-display/chart/chart.types.d.ts +10 -0
- package/dist/components/data-display/chart/chart.utils.d.ts +14 -2
- package/dist/components/data-display/chart/chart.utils.js +132 -35
- package/dist/components/data-display/chart/index.js +15 -13
- package/dist/components/data-display/chart/resolve-highcharts-options.js +19 -14
- package/dist/components/data-display/globe-map/globe-map.d.ts +8 -0
- package/dist/components/data-display/globe-map/globe-map.js +161 -0
- package/dist/components/data-display/globe-map/globe-map.stories-data.d.ts +12 -0
- package/dist/components/data-display/globe-map/globe-map.types.d.ts +83 -0
- package/dist/components/data-display/globe-map/globe-map.utils.d.ts +115 -0
- package/dist/components/data-display/globe-map/globe-map.utils.js +259 -0
- package/dist/components/data-display/globe-map/globe-map.variants.d.ts +19 -0
- package/dist/components/data-display/globe-map/globe-map.variants.js +80 -0
- package/dist/components/data-display/globe-map/index.d.ts +2 -0
- package/dist/components/data-display/globe-map/index.js +10 -0
- package/dist/components/data-display/globe-map/internals/globe-countries-110m.json.d.ts +4 -0
- package/dist/components/data-display/globe-map/internals/globe-countries-110m.json.js +7 -0
- package/dist/components/data-display/globe-map/internals/globe-map-context.d.ts +25 -0
- package/dist/components/data-display/globe-map/internals/globe-map-context.js +19 -0
- package/dist/components/data-display/globe-map/internals/globe-map-legend.d.ts +2 -0
- package/dist/components/data-display/globe-map/internals/globe-map-legend.js +51 -0
- package/dist/components/data-display/globe-map/internals/globe-map-point-card-carousel.d.ts +6 -0
- package/dist/components/data-display/globe-map/internals/globe-map-point-card-carousel.js +119 -0
- package/dist/components/data-display/globe-map/internals/globe-map-point-card.d.ts +2 -0
- package/dist/components/data-display/globe-map/internals/globe-map-point-card.js +106 -0
- package/dist/components/data-display/globe-map/internals/globe-map-scene.d.ts +17 -0
- package/dist/components/data-display/globe-map/internals/globe-map-scene.js +218 -0
- package/dist/components/data-display/globe-map/internals/globe-map-tooltip.d.ts +2 -0
- package/dist/components/data-display/globe-map/internals/globe-map-tooltip.js +33 -0
- package/dist/components/data-display/globe-map/internals/use-globe-map-scene.d.ts +45 -0
- package/dist/components/data-display/globe-map/internals/use-globe-map-scene.js +270 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.d.ts +9 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.js +94 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.stories-data.d.ts +7 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.types.d.ts +43 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.variants.d.ts +11 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.variants.js +47 -0
- package/dist/components/data-display/hex-tilemap/index.d.ts +2 -0
- package/dist/components/data-display/hex-tilemap/index.js +12 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-camera.d.ts +40 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-camera.js +103 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-country-lattices.d.ts +9 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-country-lattices.js +1387 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-geometry.d.ts +21 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-geometry.js +82 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-lattice.d.ts +18 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-lattice.js +47 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-layout.d.ts +10 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-layout.js +35 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-new-zealand-grid.d.ts +31 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-new-zealand-grid.js +138 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-regions.d.ts +6 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-regions.js +18 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-context.d.ts +24 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-context.js +19 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-legend.d.ts +2 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-legend.js +51 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-tooltip.d.ts +2 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-tooltip.js +36 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-viewport.d.ts +3 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-viewport.js +147 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-zoom.d.ts +13 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-zoom.js +99 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-world-grid.d.ts +8 -0
- package/dist/components/data-display/hex-tilemap/internals/use-hex-camera.d.ts +27 -0
- package/dist/components/data-display/hex-tilemap/internals/use-hex-camera.js +137 -0
- package/dist/components/data-display/notch-card/index.d.ts +2 -0
- package/dist/components/data-display/notch-card/index.js +6 -0
- package/dist/components/data-display/notch-card/notch-card.d.ts +7 -0
- package/dist/components/data-display/notch-card/notch-card.js +151 -0
- package/dist/components/data-display/notch-card/notch-card.path.d.ts +19 -0
- package/dist/components/data-display/notch-card/notch-card.path.js +118 -0
- package/dist/components/data-display/notch-card/notch-card.types.d.ts +15 -0
- package/dist/components/data-display/notch-card/notch-card.variants.d.ts +15 -0
- package/dist/components/data-display/notch-card/notch-card.variants.js +86 -0
- package/dist/components/feedback/hover-card/hover-card.d.ts +3 -1
- package/dist/components/feedback/hover-card/hover-card.js +28 -24
- package/dist/components/feedback/tooltip/overflow-tooltip.d.ts +1 -1
- package/dist/components/feedback/tooltip/overflow-tooltip.js +63 -57
- package/dist/components/feedback/tooltip/overflow-tooltip.types.d.ts +4 -0
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/flows/filter-strip/index.d.ts +1 -0
- package/dist/components/flows/filter-strip/index.js +4 -2
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +48 -46
- package/dist/components/flows/iris-chat/index.d.ts +10 -0
- package/dist/components/flows/iris-chat/index.js +55 -0
- package/dist/components/flows/iris-chat/iris-chat-artifact.d.ts +4 -0
- package/dist/components/flows/iris-chat/iris-chat-artifact.js +125 -0
- package/dist/components/flows/iris-chat/iris-chat-composer.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-composer.js +297 -0
- package/dist/components/flows/iris-chat/iris-chat-context.d.ts +14 -0
- package/dist/components/flows/iris-chat/iris-chat-context.js +23 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +18 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.js +176 -0
- package/dist/components/flows/iris-chat/iris-chat-markdown.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-markdown.js +62 -0
- package/dist/components/flows/iris-chat/iris-chat-menu.d.ts +15 -0
- package/dist/components/flows/iris-chat/iris-chat-menu.js +259 -0
- package/dist/components/flows/iris-chat/iris-chat-prompt.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-prompt.js +46 -0
- package/dist/components/flows/iris-chat/iris-chat-thinking.d.ts +12 -0
- package/dist/components/flows/iris-chat/iris-chat-thinking.js +202 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.d.ts +37 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.js +493 -0
- package/dist/components/flows/iris-chat/iris-chat.d.ts +43 -0
- package/dist/components/flows/iris-chat/iris-chat.js +336 -0
- package/dist/components/flows/iris-chat/iris-chat.types.d.ts +208 -0
- package/dist/components/flows/iris-chat/iris-chat.variants.d.ts +14 -0
- package/dist/components/flows/iris-chat/iris-chat.variants.js +78 -0
- package/dist/components/flows/iris-chat/read-iris-greeting-period.d.ts +4 -0
- package/dist/components/flows/iris-chat/read-iris-greeting-period.js +16 -0
- package/dist/components/flows/wizard/index.d.ts +2 -2
- package/dist/components/flows/wizard/index.js +17 -13
- package/dist/components/flows/wizard/wizard-context.d.ts +6 -1
- package/dist/components/flows/wizard/wizard-context.js +15 -7
- package/dist/components/flows/wizard/wizard.d.ts +22 -4
- package/dist/components/flows/wizard/wizard.js +278 -174
- package/dist/components/flows/wizard/wizard.types.d.ts +40 -0
- package/dist/components/forms/choice-card/assets/featured-backdrop-baked.webp.js +4 -0
- package/dist/components/forms/choice-card/assets/featured-noise.webp.js +4 -0
- package/dist/components/forms/choice-card/choice-card-featured-arcs.d.ts +4 -0
- package/dist/components/forms/choice-card/choice-card-featured-arcs.js +42 -0
- package/dist/components/forms/choice-card/choice-card-featured-backdrop.d.ts +4 -0
- package/dist/components/forms/choice-card/choice-card-featured-backdrop.js +45 -0
- package/dist/components/forms/choice-card/choice-card-indicator.variants.d.ts +8 -0
- package/dist/components/forms/choice-card/choice-card-indicator.variants.js +5 -0
- package/dist/components/forms/choice-card/choice-card-percent.d.ts +11 -0
- package/dist/components/forms/choice-card/choice-card-percent.js +80 -0
- package/dist/components/forms/choice-card/choice-card.d.ts +40 -3
- package/dist/components/forms/choice-card/choice-card.js +651 -170
- package/dist/components/forms/choice-card/choice-card.types.d.ts +40 -0
- package/dist/components/forms/choice-card/choice-card.variants.d.ts +7 -0
- package/dist/components/forms/choice-card/choice-card.variants.js +100 -0
- package/dist/components/forms/choice-card/index.d.ts +2 -1
- package/dist/components/forms/choice-card/index.js +27 -10
- package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
- package/dist/components/forms/select/components/Submenu.js +2 -3
- package/dist/components/layout/header/header.d.ts +3 -2
- package/dist/components/layout/header/header.js +67 -47
- package/dist/components/layout/header/header.types.d.ts +1 -0
- package/dist/components/primitives/iris/iris-agent-cursor.d.ts +3 -0
- package/dist/components/primitives/iris/iris-agent-cursor.js +89 -0
- package/dist/components/primitives/iris/iris-alan-gradient-icon.d.ts +5 -0
- package/dist/components/primitives/iris/iris-alan-gradient-icon.js +69 -0
- package/dist/components/primitives/iris/iris-control-context.d.ts +15 -0
- package/dist/components/primitives/iris/iris-control-context.js +44 -0
- package/dist/components/primitives/iris/iris-control-region.d.ts +10 -0
- package/dist/components/primitives/iris/iris-control-region.js +102 -0
- package/dist/components/primitives/iris/iris-control.types.d.ts +24 -0
- package/dist/components/primitives/iris/iris-control.variants.d.ts +4 -0
- package/dist/components/primitives/iris/iris-control.variants.js +20 -0
- package/dist/components/primitives/iris/iris.d.ts +24 -0
- package/dist/components/primitives/iris/iris.js +232 -0
- package/dist/components/primitives/iris/iris.types.d.ts +35 -0
- package/dist/components/primitives/iris/iris.variants.d.ts +30 -0
- package/dist/components/primitives/iris/iris.variants.js +120 -0
- package/dist/components/primitives/stepper/internals/pipeline-current-mark.d.ts +6 -0
- package/dist/components/primitives/stepper/internals/pipeline-current-mark.js +35 -0
- package/dist/components/primitives/stepper/internals/rail-status-dot.d.ts +13 -0
- package/dist/components/primitives/stepper/internals/rail-status-dot.js +70 -0
- package/dist/components/primitives/stepper/internals/step-hit-target.d.ts +15 -0
- package/dist/components/primitives/stepper/internals/step-hit-target.js +51 -0
- package/dist/components/primitives/stepper/internals/step-model.d.ts +3 -0
- package/dist/components/primitives/stepper/internals/step-model.js +10 -0
- package/dist/components/primitives/stepper/internals/stepper-compact.d.ts +5 -0
- package/dist/components/primitives/stepper/internals/stepper-compact.js +68 -0
- package/dist/components/primitives/stepper/internals/stepper-pipeline.d.ts +7 -0
- package/dist/components/primitives/stepper/internals/stepper-pipeline.js +87 -0
- package/dist/components/primitives/stepper/internals/stepper-rail.d.ts +5 -0
- package/dist/components/primitives/stepper/internals/stepper-rail.js +105 -0
- package/dist/components/primitives/stepper/internals/stepper-summary.d.ts +5 -0
- package/dist/components/primitives/stepper/internals/stepper-summary.js +103 -0
- package/dist/components/primitives/stepper/internals/stepper-track.d.ts +8 -0
- package/dist/components/primitives/stepper/internals/stepper-track.js +170 -0
- package/dist/components/primitives/stepper/stepper.d.ts +1 -0
- package/dist/components/primitives/stepper/stepper.js +134 -52
- package/dist/components/primitives/stepper/stepper.types.d.ts +17 -0
- package/dist/components/primitives/stepper/stepper.variants.d.ts +26 -0
- package/dist/components/primitives/stepper/stepper.variants.js +165 -5
- package/dist/components/primitives/tabs/tabs.d.ts +4 -1
- package/dist/components/primitives/tabs/tabs.js +131 -59
- package/dist/components/primitives/tabs/tabs.types.d.ts +5 -1
- package/dist/form-react/Fields/DateRangeField.js +20 -19
- package/dist/form-react/Fields/WeekRangePicker.js +36 -36
- package/dist/i18n/defaultMessages.d.ts +100 -0
- package/dist/i18n/defaultMessages.js +118 -21
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +99 -2
- package/dist/i18n/locales/es.js +99 -2
- package/dist/i18n/locales/hi.js +99 -2
- package/dist/i18n/locales/kn.js +99 -2
- package/dist/impact-nova-components.css +972 -2
- package/dist/impact-nova-tokens.scss +109 -1
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +585 -551
- package/dist/lib/virtualized/directional-range-extractor.d.ts +26 -0
- package/dist/lib/virtualized/directional-range-extractor.js +39 -0
- package/dist/lib/virtualized/index.d.ts +3 -0
- package/dist/lib/virtualized/index.js +35 -27
- package/dist/lib/virtualized/scroll-seek.d.ts +61 -0
- package/dist/lib/virtualized/scroll-seek.js +61 -0
- package/dist/lib/virtualized/usePaintedRangeVirtualizer.d.ts +19 -0
- package/dist/lib/virtualized/usePaintedRangeVirtualizer.js +30 -0
- package/dist/lib/virtualized/useResponsiveColumnCount.d.ts +35 -0
- package/dist/lib/virtualized/useResponsiveColumnCount.js +51 -0
- package/dist/lib/virtualized/useScrollSeekPaintedRange.d.ts +13 -0
- package/dist/lib/virtualized/useScrollSeekPaintedRange.js +45 -0
- package/dist/lib/virtualized/useVirtualizedList.d.ts +7 -0
- package/dist/lib/virtualized/useVirtualizedList.js +89 -87
- package/dist/lib/virtualized/useVirtualizedRows.d.ts +9 -2
- package/dist/lib/virtualized/useVirtualizedRows.js +15 -13
- package/dist/lib/virtualized/virtualized.types.d.ts +2 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/tailwind.config.js +3 -1
- package/dist/theme/tailwind-colors.js +2 -1
- package/package.json +39 -4
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as A, useState as F, useEffect as le } from "react";
|
|
3
|
+
import { ChevronRight as ce } from "impact-nova-icons";
|
|
4
|
+
import { ButtonIconTooltip as h } from "../../feedback/tooltip/button-icon-tooltip.js";
|
|
5
|
+
import { Button as p } from "../../primitives/button/button.js";
|
|
6
|
+
import { DropdownMenu as P, DropdownMenuTrigger as _, DropdownMenuContent as W, DropdownMenuItem as V, DropdownMenuRadioGroup as ue, DropdownMenuRadioItem as de } from "../../feedback/dropdown-menu/dropdown-menu.js";
|
|
7
|
+
import { useImpactNovaI18n as he } from "../../../i18n/use-impact-nova-i18n.js";
|
|
8
|
+
import { useControllableState as G } from "@radix-ui/react-use-controllable-state";
|
|
9
|
+
import { createComponent as pe } from "../../../lib/primitives/create-component.js";
|
|
10
|
+
import { cn as me } from "../../../lib/utils.js";
|
|
11
|
+
import { useIrisChatOptional as fe } from "./iris-chat-context.js";
|
|
12
|
+
import { IrisChatAddIcon as q, IrisChatAttachIcon as ge, IrisChatMicIcon as Ce, IrisChatStopIcon as be, IrisChatSendIcon as ve } from "./iris-chat-icons.js";
|
|
13
|
+
import { IrisChatAttachment as ye } from "./iris-chat-thread.js";
|
|
14
|
+
import { irisChatComposerVariants as we } from "./iris-chat.variants.js";
|
|
15
|
+
const xe = [
|
|
16
|
+
{ label: "Auto", value: "auto" },
|
|
17
|
+
{ label: "Fast", value: "fast" }
|
|
18
|
+
], $e = pe(
|
|
19
|
+
"IrisChatComposer",
|
|
20
|
+
({
|
|
21
|
+
className: a,
|
|
22
|
+
value: s,
|
|
23
|
+
defaultValue: H = "",
|
|
24
|
+
onValueChange: J,
|
|
25
|
+
pending: f = !1,
|
|
26
|
+
placeholder: g,
|
|
27
|
+
model: Q,
|
|
28
|
+
defaultModel: X = "auto",
|
|
29
|
+
onModelChange: Y,
|
|
30
|
+
models: U = xe,
|
|
31
|
+
onSend: Z,
|
|
32
|
+
onStop: j,
|
|
33
|
+
onAddClick: O,
|
|
34
|
+
onAttachClick: E,
|
|
35
|
+
onAttach: ee,
|
|
36
|
+
onMicClick: K
|
|
37
|
+
}, te) => {
|
|
38
|
+
const { t: n } = he(), $ = fe(), C = $?.placement === "minimized" || $?.placement === "composer" ? "inline" : "stacked", [ie, x] = G({
|
|
39
|
+
prop: s,
|
|
40
|
+
defaultProp: H,
|
|
41
|
+
onChange: J
|
|
42
|
+
}), [D, ne] = G({
|
|
43
|
+
prop: Q,
|
|
44
|
+
defaultProp: X,
|
|
45
|
+
onChange: Y
|
|
46
|
+
}), T = A(null), k = A(null), B = A({}), [b, m] = F(!1), [v, z] = F([]), [c, I] = F({});
|
|
47
|
+
B.current = c;
|
|
48
|
+
const u = ie ?? "", R = u.trim().length > 0 || v.length > 0, ae = (e) => {
|
|
49
|
+
const i = T.current;
|
|
50
|
+
i && (i.accept = e, i.value = "", i.click());
|
|
51
|
+
}, L = (e) => {
|
|
52
|
+
if (!e?.length)
|
|
53
|
+
return;
|
|
54
|
+
const i = Array.from(e);
|
|
55
|
+
ee?.(i), z((r) => [...r, ...i]), I((r) => {
|
|
56
|
+
const o = {};
|
|
57
|
+
for (const d of i)
|
|
58
|
+
d.type.startsWith("image/") && (o[w(d)] = URL.createObjectURL(d));
|
|
59
|
+
return { ...r, ...o };
|
|
60
|
+
});
|
|
61
|
+
}, M = (e) => {
|
|
62
|
+
if (E) {
|
|
63
|
+
E();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
ae(e);
|
|
67
|
+
}, re = () => {
|
|
68
|
+
if (K) {
|
|
69
|
+
K();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (b) {
|
|
73
|
+
k.current?.stop(), m(!1);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const e = ke();
|
|
77
|
+
if (!e)
|
|
78
|
+
return;
|
|
79
|
+
const i = new e();
|
|
80
|
+
i.continuous = !1, i.interimResults = !1, i.onresult = (r) => {
|
|
81
|
+
const o = r.results[0]?.[0]?.transcript?.trim();
|
|
82
|
+
o && x(u ? `${u} ${o}` : o), m(!1);
|
|
83
|
+
}, i.onerror = () => m(!1), i.onend = () => m(!1), k.current = i, i.start(), m(!0);
|
|
84
|
+
};
|
|
85
|
+
le(
|
|
86
|
+
() => () => {
|
|
87
|
+
k.current?.stop(), Object.values(B.current).forEach((e) => URL.revokeObjectURL(e));
|
|
88
|
+
},
|
|
89
|
+
[]
|
|
90
|
+
);
|
|
91
|
+
const se = () => {
|
|
92
|
+
Object.values(c).forEach((e) => URL.revokeObjectURL(e)), I({}), z([]);
|
|
93
|
+
}, N = () => {
|
|
94
|
+
!R || f || (Z?.(u.trim(), v), se());
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ l(
|
|
97
|
+
"form",
|
|
98
|
+
{
|
|
99
|
+
ref: te,
|
|
100
|
+
"data-component": "iris-chat-composer",
|
|
101
|
+
"data-layout": C,
|
|
102
|
+
"data-pending": f ? "" : void 0,
|
|
103
|
+
className: me(
|
|
104
|
+
we({ layout: C }),
|
|
105
|
+
R && "iris-edge-wash-shell--menu iris-edge-wash-shell--fluid",
|
|
106
|
+
a
|
|
107
|
+
),
|
|
108
|
+
onDragOver: (e) => {
|
|
109
|
+
e.dataTransfer.types.includes("Files") && e.preventDefault();
|
|
110
|
+
},
|
|
111
|
+
onDrop: (e) => {
|
|
112
|
+
e.dataTransfer.files.length && (e.preventDefault(), L(e.dataTransfer.files));
|
|
113
|
+
},
|
|
114
|
+
onPaste: (e) => {
|
|
115
|
+
const i = De(e.clipboardData);
|
|
116
|
+
i.length && (e.preventDefault(), L(i));
|
|
117
|
+
},
|
|
118
|
+
onKeyDown: (e) => {
|
|
119
|
+
e.key === "Escape" && f && (e.preventDefault(), j?.());
|
|
120
|
+
},
|
|
121
|
+
onSubmit: (e) => {
|
|
122
|
+
e.preventDefault(), N();
|
|
123
|
+
},
|
|
124
|
+
children: [
|
|
125
|
+
v.length > 0 ? /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", "data-testid": "iris-chat-composer-attachments", children: v.map((e, i) => {
|
|
126
|
+
const r = w(e, i);
|
|
127
|
+
return /* @__PURE__ */ t(
|
|
128
|
+
ye,
|
|
129
|
+
{
|
|
130
|
+
name: e.name,
|
|
131
|
+
kind: e.type.startsWith("image/") ? "image" : "file",
|
|
132
|
+
sizeLabel: e.size < 1024 ? `${e.size} B` : `${Math.round(e.size / 1024)} KB`,
|
|
133
|
+
previewUrl: c[w(e)] ?? c[r],
|
|
134
|
+
onRemove: () => {
|
|
135
|
+
const o = w(e), d = c[o] ?? c[r];
|
|
136
|
+
d && URL.revokeObjectURL(d), I((S) => {
|
|
137
|
+
const y = { ...S };
|
|
138
|
+
return delete y[o], delete y[r], y;
|
|
139
|
+
}), z((S) => S.filter((y, oe) => oe !== i));
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
r
|
|
143
|
+
);
|
|
144
|
+
}) }) : null,
|
|
145
|
+
C === "stacked" ? /* @__PURE__ */ t(
|
|
146
|
+
"textarea",
|
|
147
|
+
{
|
|
148
|
+
id: "iris-chat-composer-input",
|
|
149
|
+
"data-testid": "iris-chat-composer-input",
|
|
150
|
+
rows: 2,
|
|
151
|
+
value: u,
|
|
152
|
+
placeholder: g ?? n("irisChat.askAnything"),
|
|
153
|
+
"aria-label": g ?? n("irisChat.askAnything"),
|
|
154
|
+
className: "w-full resize-none bg-transparent text-sm font-medium leading-5 text-content outline-none placeholder:text-content-empty",
|
|
155
|
+
onChange: (e) => x(e.target.value),
|
|
156
|
+
onKeyDown: (e) => {
|
|
157
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), N());
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
) : null,
|
|
161
|
+
/* @__PURE__ */ l("div", { className: "flex min-w-0 w-full items-center justify-between gap-1 [&_button[data-size=icon]]:size-8 [&_button[data-size=icon]_svg]:size-4", children: [
|
|
162
|
+
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-center", children: [
|
|
163
|
+
/* @__PURE__ */ t(
|
|
164
|
+
"input",
|
|
165
|
+
{
|
|
166
|
+
ref: T,
|
|
167
|
+
type: "file",
|
|
168
|
+
hidden: !0,
|
|
169
|
+
multiple: !0,
|
|
170
|
+
"data-testid": "iris-chat-attach-input",
|
|
171
|
+
onChange: (e) => L(e.target.files)
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
O ? /* @__PURE__ */ t(h, { label: n("irisChat.add"), children: /* @__PURE__ */ t(
|
|
175
|
+
p,
|
|
176
|
+
{
|
|
177
|
+
type: "button",
|
|
178
|
+
variant: "ghost",
|
|
179
|
+
size: "icon",
|
|
180
|
+
"aria-label": n("irisChat.add"),
|
|
181
|
+
onClick: O,
|
|
182
|
+
children: /* @__PURE__ */ t(q, {})
|
|
183
|
+
}
|
|
184
|
+
) }) : /* @__PURE__ */ l(P, { children: [
|
|
185
|
+
/* @__PURE__ */ t(h, { label: n("irisChat.add"), children: /* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ t(p, { type: "button", variant: "ghost", size: "icon", "aria-label": n("irisChat.add"), children: /* @__PURE__ */ t(q, {}) }) }) }),
|
|
186
|
+
/* @__PURE__ */ l(W, { align: "start", children: [
|
|
187
|
+
/* @__PURE__ */ t(V, { onSelect: () => M("*/*"), children: n("irisChat.attachFile") }),
|
|
188
|
+
/* @__PURE__ */ t(V, { onSelect: () => M("image/*"), children: n("irisChat.attachImage") })
|
|
189
|
+
] })
|
|
190
|
+
] }),
|
|
191
|
+
/* @__PURE__ */ t(h, { label: n("irisChat.attach"), children: /* @__PURE__ */ t(
|
|
192
|
+
p,
|
|
193
|
+
{
|
|
194
|
+
type: "button",
|
|
195
|
+
variant: "ghost",
|
|
196
|
+
size: "icon",
|
|
197
|
+
"aria-label": n("irisChat.attach"),
|
|
198
|
+
onClick: () => M("*/*"),
|
|
199
|
+
children: /* @__PURE__ */ t(ge, {})
|
|
200
|
+
}
|
|
201
|
+
) }),
|
|
202
|
+
C === "inline" ? /* @__PURE__ */ t(
|
|
203
|
+
"input",
|
|
204
|
+
{
|
|
205
|
+
id: "iris-chat-composer-input",
|
|
206
|
+
"data-testid": "iris-chat-composer-input",
|
|
207
|
+
value: u,
|
|
208
|
+
placeholder: g ?? n("irisChat.askAnything"),
|
|
209
|
+
"aria-label": g ?? n("irisChat.askAnything"),
|
|
210
|
+
className: "ms-1 h-8 min-w-0 flex-1 overflow-hidden bg-transparent py-0 text-sm font-medium leading-8 text-content outline-none placeholder:text-content-empty",
|
|
211
|
+
onChange: (e) => x(e.target.value),
|
|
212
|
+
onKeyDown: (e) => {
|
|
213
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), N());
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
) : null
|
|
217
|
+
] }),
|
|
218
|
+
/* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
219
|
+
/* @__PURE__ */ l(P, { children: [
|
|
220
|
+
/* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ l(
|
|
221
|
+
"button",
|
|
222
|
+
{
|
|
223
|
+
type: "button",
|
|
224
|
+
"data-testid": "iris-chat-model",
|
|
225
|
+
className: "flex h-8 max-w-24 shrink-0 items-center gap-0.5 truncate rounded-lg bg-secondary px-2 text-sm font-medium capitalize leading-none text-content",
|
|
226
|
+
"aria-label": n("irisChat.model"),
|
|
227
|
+
children: [
|
|
228
|
+
U.find((e) => e.value === D)?.label ?? D,
|
|
229
|
+
/* @__PURE__ */ t(ce, { size: 16, className: "rotate-90" })
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
) }),
|
|
233
|
+
/* @__PURE__ */ t(W, { align: "end", children: /* @__PURE__ */ t(
|
|
234
|
+
ue,
|
|
235
|
+
{
|
|
236
|
+
value: D,
|
|
237
|
+
onValueChange: ne,
|
|
238
|
+
children: U.map((e) => /* @__PURE__ */ t(de, { value: e.value, children: e.label }, e.value))
|
|
239
|
+
}
|
|
240
|
+
) })
|
|
241
|
+
] }),
|
|
242
|
+
/* @__PURE__ */ t(h, { label: n(b ? "irisChat.listening" : "irisChat.mic"), children: /* @__PURE__ */ t(
|
|
243
|
+
p,
|
|
244
|
+
{
|
|
245
|
+
type: "button",
|
|
246
|
+
variant: "ghost",
|
|
247
|
+
size: "icon",
|
|
248
|
+
"aria-label": n(b ? "irisChat.listening" : "irisChat.mic"),
|
|
249
|
+
"aria-pressed": b,
|
|
250
|
+
onClick: re,
|
|
251
|
+
children: /* @__PURE__ */ t(Ce, {})
|
|
252
|
+
}
|
|
253
|
+
) }),
|
|
254
|
+
f ? /* @__PURE__ */ t(h, { label: n("irisChat.stop"), children: /* @__PURE__ */ t(
|
|
255
|
+
p,
|
|
256
|
+
{
|
|
257
|
+
type: "button",
|
|
258
|
+
variant: "default",
|
|
259
|
+
size: "icon",
|
|
260
|
+
"aria-label": n("irisChat.stop"),
|
|
261
|
+
"data-testid": "iris-chat-stop",
|
|
262
|
+
className: "rounded-full",
|
|
263
|
+
onClick: j,
|
|
264
|
+
children: /* @__PURE__ */ t(be, { size: 16 })
|
|
265
|
+
}
|
|
266
|
+
) }) : R ? /* @__PURE__ */ t(h, { label: n("irisChat.send"), children: /* @__PURE__ */ t(
|
|
267
|
+
p,
|
|
268
|
+
{
|
|
269
|
+
type: "submit",
|
|
270
|
+
variant: "default",
|
|
271
|
+
size: "icon",
|
|
272
|
+
"aria-label": n("irisChat.send"),
|
|
273
|
+
"data-testid": "iris-chat-send",
|
|
274
|
+
className: "rounded-full",
|
|
275
|
+
children: /* @__PURE__ */ t(ve, { size: 16 })
|
|
276
|
+
}
|
|
277
|
+
) }) : null
|
|
278
|
+
] })
|
|
279
|
+
] })
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
function w(a, s = 0) {
|
|
286
|
+
return `${a.name}:${a.size}:${a.lastModified}:${s}`;
|
|
287
|
+
}
|
|
288
|
+
function De(a) {
|
|
289
|
+
return a ? a.files.length ? Array.from(a.files) : Array.from(a.items).filter((s) => s.kind === "file").map((s) => s.getAsFile()).filter((s) => !!s) : [];
|
|
290
|
+
}
|
|
291
|
+
function ke() {
|
|
292
|
+
const a = window;
|
|
293
|
+
return a.SpeechRecognition ?? a.webkitSpeechRecognition;
|
|
294
|
+
}
|
|
295
|
+
export {
|
|
296
|
+
$e as IrisChatComposer
|
|
297
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IrisChatPlacement } from './iris-chat.types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type IrisChatContextValue = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
setOpen: (open: boolean) => void;
|
|
6
|
+
placement: IrisChatPlacement;
|
|
7
|
+
setPlacement: (placement: IrisChatPlacement) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function IrisChatProvider({ value, children, }: {
|
|
10
|
+
value: IrisChatContextValue;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function useIrisChat(): IrisChatContextValue;
|
|
14
|
+
export declare function useIrisChatOptional(): IrisChatContextValue | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
const e = r.createContext(null);
|
|
4
|
+
function s({
|
|
5
|
+
value: t,
|
|
6
|
+
children: n
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ o(e.Provider, { value: t, children: n });
|
|
9
|
+
}
|
|
10
|
+
function u() {
|
|
11
|
+
const t = r.useContext(e);
|
|
12
|
+
if (!t)
|
|
13
|
+
throw new Error("IrisChat parts must render inside IrisChat.");
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
function a() {
|
|
17
|
+
return r.useContext(e);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
s as IrisChatProvider,
|
|
21
|
+
u as useIrisChat,
|
|
22
|
+
a as useIrisChatOptional
|
|
23
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type IconProps = {
|
|
2
|
+
size?: number;
|
|
3
|
+
className?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function IrisChatAddIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function IrisChatAttachIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function IrisChatMicIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function IrisChatSendIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function IrisChatStopIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function IrisChatHamburgerIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function IrisChatMinimizeIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function IrisChatSuggestIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function IrisChatLikeIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function IrisChatDislikeIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function IrisChatCopyIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function IrisChatRetryIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function IrisChatSpeakIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as h } from "../../../lib/utils.js";
|
|
3
|
+
function n({
|
|
4
|
+
size: r = 16,
|
|
5
|
+
className: t,
|
|
6
|
+
children: c,
|
|
7
|
+
viewBox: i = "0 0 24 24"
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ o(
|
|
10
|
+
"svg",
|
|
11
|
+
{
|
|
12
|
+
width: r,
|
|
13
|
+
height: r,
|
|
14
|
+
viewBox: i,
|
|
15
|
+
fill: "none",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
"aria-hidden": !0,
|
|
18
|
+
className: h("block shrink-0", t),
|
|
19
|
+
children: c
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function u({ size: r = 16, className: t }) {
|
|
24
|
+
return /* @__PURE__ */ o(n, { size: r, viewBox: "0 0 16 16", className: t, children: /* @__PURE__ */ o(
|
|
25
|
+
"path",
|
|
26
|
+
{
|
|
27
|
+
d: "M12 8.667H8.667V12A.667.667 0 0 1 8 12.667a.667.667 0 0 1-.667-.667V8.667H4A.667.667 0 0 1 3.333 8 .667.667 0 0 1 4 7.333h3.333V4A.667.667 0 0 1 8 3.333.667.667 0 0 1 8.667 4v3.333H12A.667.667 0 0 1 12.667 8 .667.667 0 0 1 12 8.667Z",
|
|
28
|
+
fill: "currentColor"
|
|
29
|
+
}
|
|
30
|
+
) });
|
|
31
|
+
}
|
|
32
|
+
function l({ size: r = 16, className: t }) {
|
|
33
|
+
return /* @__PURE__ */ o(n, { size: r, viewBox: "0 0 16 16", className: t, children: /* @__PURE__ */ o(
|
|
34
|
+
"path",
|
|
35
|
+
{
|
|
36
|
+
d: "M12.5 10.5c0 1.156-.406 2.139-1.217 2.95C10.472 14.261 9.489 14.667 8.333 14.667c-1.155 0-2.139-.406-2.95-1.217C4.572 12.639 4.167 11.656 4.167 10.5V4.333c0-.833.291-1.541.875-2.125C5.625 1.625 6.333 1.333 7.167 1.333c.833 0 1.541.292 2.125.875.583.584.875 1.292.875 2.125v5.834c0 .511-.178.944-.534 1.3-.355.355-.788.533-1.3.533-.511 0-.944-.178-1.3-.533-.355-.356-.533-.789-.533-1.3V4.667c0-.189.064-.347.192-.475.127-.128.286-.192.475-.192.188 0 .347.064.475.192.127.128.191.286.191.475v5.5c0 .144.048.264.142.358.094.095.214.142.358.142.145 0 .264-.047.359-.142.094-.094.141-.214.141-.358V4.333c-.011-.466-.175-.861-.491-1.183C8.025 2.828 7.633 2.667 7.167 2.667c-.467 0-.861.161-1.184.483-.322.322-.483.717-.483 1.183V10.5c-.011.789.261 1.458.817 2.008.555.55 1.227.825 2.016.825.778 0 1.439-.275 1.984-.825.544-.55.827-1.219.85-2.008V4.667c0-.189.064-.347.191-.475.128-.128.287-.192.475-.192.189 0 .347.064.475.192.128.128.192.286.192.475V10.5Z",
|
|
37
|
+
fill: "currentColor"
|
|
38
|
+
}
|
|
39
|
+
) });
|
|
40
|
+
}
|
|
41
|
+
function a({ size: r = 16, className: t }) {
|
|
42
|
+
return /* @__PURE__ */ o(n, { size: r, viewBox: "0 0 16 16", className: t, children: /* @__PURE__ */ o(
|
|
43
|
+
"path",
|
|
44
|
+
{
|
|
45
|
+
d: "M6.583 8.75C6.194 8.361 6 7.889 6 7.333V3.333C6 2.778 6.194 2.306 6.583 1.917 6.972 1.528 7.444 1.333 8 1.333c.556 0 1.028.195 1.417.584C9.806 2.306 10 2.778 10 3.333v4c0 .556-.194 1.028-.583 1.417C9.028 9.139 8.556 9.333 8 9.333c-.556 0-1.028-.194-1.417-.583ZM7.333 13.333v-1.383c-1.022-.144-1.897-.578-2.625-1.3C3.981 9.928 3.539 9.05 3.383 8.017c-.022-.189.028-.35.15-.484C3.656 7.4 3.811 7.333 4 7.333c.189 0 .347.064.475.192.128.128.214.286.258.475.156.778.542 1.417 1.159 1.917C6.508 10.417 7.211 10.667 8 10.667c.8 0 1.506-.253 2.117-.759.611-.505.994-1.141 1.15-1.908.044-.189.13-.347.258-.475.128-.128.286-.192.475-.192.189 0 .344.067.467.2.122.134.172.295.15.484-.156 1.011-.595 1.883-1.317 2.616-.722.734-1.6 1.173-2.633 1.317v1.383c0 .189-.064.348-.192.475A.64.64 0 0 1 8 14a.64.64 0 0 1-.475-.192.64.64 0 0 1-.192-.475ZM8.475 7.808A.64.64 0 0 0 8.667 7.333V3.333a.64.64 0 0 0-.192-.475A.64.64 0 0 0 8 2.667a.64.64 0 0 0-.475.191.64.64 0 0 0-.192.475v4c0 .189.064.347.192.475A.64.64 0 0 0 8 8a.64.64 0 0 0 .475-.192Z",
|
|
46
|
+
fill: "currentColor"
|
|
47
|
+
}
|
|
48
|
+
) });
|
|
49
|
+
}
|
|
50
|
+
function C({ size: r = 16, className: t }) {
|
|
51
|
+
return /* @__PURE__ */ o(n, { size: r, className: t, children: /* @__PURE__ */ o(
|
|
52
|
+
"path",
|
|
53
|
+
{
|
|
54
|
+
d: "M12 17V7M8 11l4-4 4 4",
|
|
55
|
+
stroke: "currentColor",
|
|
56
|
+
strokeWidth: "1.7",
|
|
57
|
+
strokeLinecap: "round",
|
|
58
|
+
strokeLinejoin: "round"
|
|
59
|
+
}
|
|
60
|
+
) });
|
|
61
|
+
}
|
|
62
|
+
function k({ size: r = 16, className: t }) {
|
|
63
|
+
return /* @__PURE__ */ o(n, { size: r, className: t, children: /* @__PURE__ */ o("rect", { x: "6.5", y: "6.5", width: "11", height: "11", rx: "1.5", fill: "currentColor" }) });
|
|
64
|
+
}
|
|
65
|
+
function p({ size: r = 16, className: t }) {
|
|
66
|
+
return /* @__PURE__ */ o(n, { size: r, className: t, children: /* @__PURE__ */ o("path", { d: "M5 7h14M5 12h14M5 17h14", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) });
|
|
67
|
+
}
|
|
68
|
+
function I({ size: r = 16, className: t }) {
|
|
69
|
+
return /* @__PURE__ */ e(n, { size: r, className: t, children: [
|
|
70
|
+
/* @__PURE__ */ o("rect", { x: "5", y: "6", width: "14", height: "12", rx: "2", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
71
|
+
/* @__PURE__ */ o("path", { d: "M5 16h14", stroke: "currentColor", strokeWidth: "1.8" })
|
|
72
|
+
] });
|
|
73
|
+
}
|
|
74
|
+
function M({ size: r = 14, className: t }) {
|
|
75
|
+
return /* @__PURE__ */ o(n, { size: r, className: t, children: /* @__PURE__ */ o(
|
|
76
|
+
"path",
|
|
77
|
+
{
|
|
78
|
+
d: "M8 6v8h7M12 11l3 3-3 3",
|
|
79
|
+
stroke: "currentColor",
|
|
80
|
+
strokeWidth: "1.5",
|
|
81
|
+
strokeLinecap: "round",
|
|
82
|
+
strokeLinejoin: "round"
|
|
83
|
+
}
|
|
84
|
+
) });
|
|
85
|
+
}
|
|
86
|
+
function f({ size: r = 16, className: t }) {
|
|
87
|
+
return /* @__PURE__ */ e(n, { size: r, className: t, children: [
|
|
88
|
+
/* @__PURE__ */ o(
|
|
89
|
+
"path",
|
|
90
|
+
{
|
|
91
|
+
d: "M7 21V10l6.4-7.2c.4-.4 1-.5 1.5-.2.4.2.7.7.6 1.2L14.6 8H20c1.1 0 2 .9 2 2v1.1c0 .2 0 .4-.1.6l-2.2 7.2A2 2 0 0 1 17.8 21H7Z",
|
|
92
|
+
stroke: "currentColor",
|
|
93
|
+
strokeWidth: "1.6",
|
|
94
|
+
strokeLinejoin: "round"
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ o("path", { d: "M7 10H3.8C3.4 10 3 10.4 3 10.8v8.4c0 .4.4.8.8.8H7", stroke: "currentColor", strokeWidth: "1.6" })
|
|
98
|
+
] });
|
|
99
|
+
}
|
|
100
|
+
function v({ size: r = 16, className: t }) {
|
|
101
|
+
return /* @__PURE__ */ e(n, { size: r, className: t, children: [
|
|
102
|
+
/* @__PURE__ */ o(
|
|
103
|
+
"path",
|
|
104
|
+
{
|
|
105
|
+
d: "M7 3v11l6.4 7.2c.4.4 1 .5 1.5.2.4-.2.7-.7.6-1.2L14.6 16H20c1.1 0 2-.9 2-2v-1.1c0-.2 0-.4-.1-.6l-2.2-7.2A2 2 0 0 0 17.8 3H7Z",
|
|
106
|
+
stroke: "currentColor",
|
|
107
|
+
strokeWidth: "1.6",
|
|
108
|
+
strokeLinejoin: "round"
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ o("path", { d: "M7 14H3.8C3.4 14 3 13.6 3 13.2V4.8C3 4.4 3.4 4 3.8 4H7", stroke: "currentColor", strokeWidth: "1.6" })
|
|
112
|
+
] });
|
|
113
|
+
}
|
|
114
|
+
function L({ size: r = 16, className: t }) {
|
|
115
|
+
return /* @__PURE__ */ e(n, { size: r, className: t, children: [
|
|
116
|
+
/* @__PURE__ */ o("rect", { x: "8", y: "8", width: "10", height: "12", rx: "1.5", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
117
|
+
/* @__PURE__ */ o(
|
|
118
|
+
"path",
|
|
119
|
+
{
|
|
120
|
+
d: "M6 16H5.5A1.5 1.5 0 0 1 4 14.5v-9A1.5 1.5 0 0 1 5.5 4h9A1.5 1.5 0 0 1 16 5.5V6",
|
|
121
|
+
stroke: "currentColor",
|
|
122
|
+
strokeWidth: "1.6",
|
|
123
|
+
strokeLinecap: "round"
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] });
|
|
127
|
+
}
|
|
128
|
+
function A({ size: r = 16, className: t }) {
|
|
129
|
+
return /* @__PURE__ */ o(n, { size: r, className: t, children: /* @__PURE__ */ o(
|
|
130
|
+
"path",
|
|
131
|
+
{
|
|
132
|
+
d: "M20 12a8 8 0 1 1-2.2-5.5M20 4v5h-5",
|
|
133
|
+
stroke: "currentColor",
|
|
134
|
+
strokeWidth: "1.6",
|
|
135
|
+
strokeLinecap: "round",
|
|
136
|
+
strokeLinejoin: "round"
|
|
137
|
+
}
|
|
138
|
+
) });
|
|
139
|
+
}
|
|
140
|
+
function V({ size: r = 16, className: t }) {
|
|
141
|
+
return /* @__PURE__ */ e(n, { size: r, className: t, children: [
|
|
142
|
+
/* @__PURE__ */ o(
|
|
143
|
+
"path",
|
|
144
|
+
{
|
|
145
|
+
d: "M5 9.5h3.2L12 6v12l-3.8-3.5H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1Z",
|
|
146
|
+
stroke: "currentColor",
|
|
147
|
+
strokeWidth: "1.6",
|
|
148
|
+
strokeLinejoin: "round"
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ o(
|
|
152
|
+
"path",
|
|
153
|
+
{
|
|
154
|
+
d: "M15.2 9.2a3.2 3.2 0 0 1 0 5.6M17.6 7a5.8 5.8 0 0 1 0 10",
|
|
155
|
+
stroke: "currentColor",
|
|
156
|
+
strokeWidth: "1.6",
|
|
157
|
+
strokeLinecap: "round"
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] });
|
|
161
|
+
}
|
|
162
|
+
export {
|
|
163
|
+
u as IrisChatAddIcon,
|
|
164
|
+
l as IrisChatAttachIcon,
|
|
165
|
+
L as IrisChatCopyIcon,
|
|
166
|
+
v as IrisChatDislikeIcon,
|
|
167
|
+
p as IrisChatHamburgerIcon,
|
|
168
|
+
f as IrisChatLikeIcon,
|
|
169
|
+
a as IrisChatMicIcon,
|
|
170
|
+
I as IrisChatMinimizeIcon,
|
|
171
|
+
A as IrisChatRetryIcon,
|
|
172
|
+
C as IrisChatSendIcon,
|
|
173
|
+
V as IrisChatSpeakIcon,
|
|
174
|
+
k as IrisChatStopIcon,
|
|
175
|
+
M as IrisChatSuggestIcon
|
|
176
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c } from "react";
|
|
3
|
+
import p from "react-markdown";
|
|
4
|
+
import m from "remark-gfm";
|
|
5
|
+
import { ButtonIconTooltip as l } from "../../feedback/tooltip/button-icon-tooltip.js";
|
|
6
|
+
import { Button as d } from "../../primitives/button/button.js";
|
|
7
|
+
import { useImpactNovaI18n as f } from "../../../i18n/use-impact-nova-i18n.js";
|
|
8
|
+
import { createComponent as h } from "../../../lib/primitives/create-component.js";
|
|
9
|
+
import { cn as u } from "../../../lib/utils.js";
|
|
10
|
+
import { IrisChatCopyIcon as C } from "./iris-chat-icons.js";
|
|
11
|
+
import { irisChatMarkdownVariants as k } from "./iris-chat.variants.js";
|
|
12
|
+
function n(r) {
|
|
13
|
+
return typeof r == "string" || typeof r == "number" ? String(r) : Array.isArray(r) ? r.map(n).join("") : r && typeof r == "object" && "props" in r ? n(r.props.children) : "";
|
|
14
|
+
}
|
|
15
|
+
function y({ children: r }) {
|
|
16
|
+
const { t: o } = f(), [e, i] = c(!1), a = n(r);
|
|
17
|
+
return /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
18
|
+
/* @__PURE__ */ t(l, { label: o(e ? "irisChat.copied" : "irisChat.copyCode"), children: /* @__PURE__ */ t(
|
|
19
|
+
d,
|
|
20
|
+
{
|
|
21
|
+
type: "button",
|
|
22
|
+
variant: "ghost",
|
|
23
|
+
size: "icon",
|
|
24
|
+
className: "absolute end-1.5 top-1.5 size-7",
|
|
25
|
+
"aria-label": o(e ? "irisChat.copied" : "irisChat.copyCode"),
|
|
26
|
+
"data-testid": "iris-chat-copy-code",
|
|
27
|
+
onClick: () => {
|
|
28
|
+
navigator.clipboard?.writeText(a).catch(() => {
|
|
29
|
+
}), i(!0), window.setTimeout(() => i(!1), 1600);
|
|
30
|
+
},
|
|
31
|
+
children: /* @__PURE__ */ t(C, { size: 14 })
|
|
32
|
+
}
|
|
33
|
+
) }),
|
|
34
|
+
/* @__PURE__ */ t("pre", { children: r })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
const B = h(
|
|
38
|
+
"IrisChatMarkdown",
|
|
39
|
+
({ className: r, children: o }, e) => /* @__PURE__ */ t(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
ref: e,
|
|
43
|
+
"data-component": "iris-chat-markdown",
|
|
44
|
+
className: u(k(), r),
|
|
45
|
+
children: /* @__PURE__ */ t(
|
|
46
|
+
p,
|
|
47
|
+
{
|
|
48
|
+
remarkPlugins: [m],
|
|
49
|
+
skipHtml: !0,
|
|
50
|
+
components: {
|
|
51
|
+
a: ({ href: i, children: a }) => /* @__PURE__ */ t("a", { href: i, target: "_blank", rel: "noreferrer", children: a }),
|
|
52
|
+
pre: ({ children: i }) => /* @__PURE__ */ t(y, { children: i })
|
|
53
|
+
},
|
|
54
|
+
children: o
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
export {
|
|
61
|
+
B as IrisChatMarkdown
|
|
62
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IrisChatListItemProps, IrisChatListProps, IrisChatMenuProps, IrisChatMenuSectionProps } from './iris-chat.types';
|
|
2
|
+
declare const IrisChatMenu: import('react').ForwardRefExoticComponent<IrisChatMenuProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const IrisChatMenuSection: {
|
|
4
|
+
({ value, title, onFilterSelect, onViewMore, viewMoreLabel, className, children, }: IrisChatMenuSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
declare const IrisChatListItem: {
|
|
8
|
+
({ title, onSelect, onAction, className }: IrisChatListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
declare function IrisChatList<T>({ items, getItemId, renderItem, title, onFilterSelect, estimateSize, className, }: IrisChatListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare namespace IrisChatList {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
export { IrisChatList, IrisChatListItem, IrisChatMenu, IrisChatMenuSection };
|