@morscherlab/mint-sdk 1.4.0-beta.9 → 1.4.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/README.md +14 -3
- package/dist/{AlertBox-B2Bgr3ei.js → AlertBox-DwgNTEqf.js} +3 -3
- package/dist/{AlertBox-B2Bgr3ei.js.map → AlertBox-DwgNTEqf.js.map} +1 -1
- package/dist/{AppSidebar-Dq9W1jE2.js → AppSidebar-CZZaxni0.js} +1103 -144
- package/dist/AppSidebar-CZZaxni0.js.map +1 -0
- package/dist/{ConfirmDialog-nbJj51is.js → ConfirmDialog-CjWoxAD1.js} +2 -2
- package/dist/{ConfirmDialog-nbJj51is.js.map → ConfirmDialog-CjWoxAD1.js.map} +1 -1
- package/dist/{ExperimentPopover-5T1fAq2L.js → ExperimentPopover-DujiuQIO.js} +5 -5
- package/dist/{ExperimentPopover-5T1fAq2L.js.map → ExperimentPopover-DujiuQIO.js.map} +1 -1
- package/dist/{ExperimentSelectorModal-65peG4Up.js → ExperimentSelectorModal-B4j4eUOJ.js} +114 -98
- package/dist/ExperimentSelectorModal-B4j4eUOJ.js.map +1 -0
- package/dist/{SegmentedControl-BtnnjWzs.js → SegmentedControl-DyUPH3I5.js} +2 -2
- package/dist/{SegmentedControl-BtnnjWzs.js.map → SegmentedControl-DyUPH3I5.js.map} +1 -1
- package/dist/{SettingsModal-483nyI6b.js → SettingsModal-D2MOOtuO.js} +26 -25
- package/dist/SettingsModal-D2MOOtuO.js.map +1 -0
- package/dist/__stories__/experiment-helpers.d.ts +10 -0
- package/dist/__tests__/components/AppTopBarOnboarding.test.d.ts +1 -0
- package/dist/__tests__/components/FloatingPanelsInModal.test.d.ts +1 -0
- package/dist/__tests__/composables/useFloatingPanel.test.d.ts +1 -0
- package/dist/__tests__/composables/useOnboarding.test.d.ts +1 -0
- package/dist/__tests__/styles/paletteTokens.test.d.ts +1 -0
- package/dist/__tests__/styles/v2AuditRules.test.d.ts +1 -0
- package/dist/components/AppTopBar.vue.d.ts +20 -5
- package/dist/components/BaseButton.vue.d.ts +4 -2
- package/dist/components/ExperimentSelectorModal.vue.d.ts +15 -1
- package/dist/components/JobsStatusTray.vue.d.ts +15 -4
- package/dist/components/PluginWorkspaceView.props.d.ts +3 -0
- package/dist/components/PluginWorkspaceView.vue.d.ts +3 -0
- package/dist/components/SmartGroupFieldRecipe.vue.d.ts +3 -3
- package/dist/components/internal/AppTopBarOnboardingInternal.vue.d.ts +7 -0
- package/dist/components/internal/AppTopBarPageSelectorInternal.vue.d.ts +2 -1
- package/dist/components/internal/AutoGroupModalInternal.vue.d.ts +2 -2
- package/dist/components/internal/OnboardingLayerInternal.vue.d.ts +7 -0
- package/dist/components/internal/WorkspaceShellInternal.vue.d.ts +8 -0
- package/dist/composables/pluginWorkspaceModel.d.ts +2 -2
- package/dist/composables/useFileImport.d.ts +7 -0
- package/dist/composables/useFloatingPanel.d.ts +29 -0
- package/dist/composables/useJobCenter.d.ts +41 -3
- package/dist/composables/useOnboarding.d.ts +119 -0
- package/dist/{controlSchemaModel-B8CTXagP.js → controlSchemaModel-Bsg0t5Ab.js} +2 -2
- package/dist/{controlSchemaModel-B8CTXagP.js.map → controlSchemaModel-Bsg0t5Ab.js.map} +1 -1
- package/dist/{data-CgILxDLW.js → data-Boeh4uPI.js} +13 -12
- package/dist/{data-CgILxDLW.js.map → data-Boeh4uPI.js.map} +1 -1
- package/dist/data.d.ts +1 -1
- package/dist/data.js +9 -9
- package/dist/{experiment-43OJtH7R.js → experiment-DyO54FQB.js} +25 -61
- package/dist/experiment-DyO54FQB.js.map +1 -0
- package/dist/{experimentStatus-Cqp6qNrR.js → experimentStatus-DCn2QKG7.js} +2 -2
- package/dist/{experimentStatus-Cqp6qNrR.js.map → experimentStatus-DCn2QKG7.js.map} +1 -1
- package/dist/index.js +20 -20
- package/dist/{install-BtLWTk6H.js → install-BEHp7Mo-.js} +15 -15
- package/dist/{install-BtLWTk6H.js.map → install-BEHp7Mo-.js.map} +1 -1
- package/dist/install.js +1 -1
- package/dist/{lab-MHzp-_J8.js → lab-D61eaX6f.js} +68 -61
- package/dist/{lab-MHzp-_J8.js.map → lab-D61eaX6f.js.map} +1 -1
- package/dist/lab.js +4 -4
- package/dist/{records-B6gpM_3e.js → records-D4aQXyZu.js} +193 -133
- package/dist/records-D4aQXyZu.js.map +1 -0
- package/dist/{runtime-7vfl_bI3.js → runtime-q-R0CNLh.js} +400 -33
- package/dist/runtime-q-R0CNLh.js.map +1 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +7 -7
- package/dist/{shell-Cs9OJMnm.js → shell-6CGFvUUw.js} +10 -5
- package/dist/{shell-Cs9OJMnm.js.map → shell-6CGFvUUw.js.map} +1 -1
- package/dist/shell.d.ts +1 -0
- package/dist/shell.js +6 -6
- package/dist/stores/index.d.ts +1 -1
- package/dist/stores/index.js +2 -2
- package/dist/stores/settings.d.ts +4 -12
- package/dist/styles.css +1191 -479
- package/dist/types/components.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/jobs.d.ts +9 -0
- package/dist/types/platform.d.ts +1 -1
- package/dist/{useDropdownState-8yWMu-7_.js → useDropdownState-uFIz6Yv8.js} +16 -4
- package/dist/useDropdownState-uFIz6Yv8.js.map +1 -0
- package/dist/{useExperimentSamples-DHnxKFAF.js → useExperimentSamples-QEFoq4tf.js} +48 -6
- package/dist/useExperimentSamples-QEFoq4tf.js.map +1 -0
- package/dist/{useListReorder-BitdUhxn.js → useListReorder-DsuzwWGS.js} +122 -172
- package/dist/useListReorder-DsuzwWGS.js.map +1 -0
- package/dist/{useRackEditor-DiwCt77M.js → useRackEditor-KpZ4iJ6o.js} +22 -32
- package/dist/useRackEditor-KpZ4iJ6o.js.map +1 -0
- package/dist/useRealtime-B58Lo-Tm.js +508 -0
- package/dist/useRealtime-B58Lo-Tm.js.map +1 -0
- package/dist/{useRequest-D506eHi8.js → useRequest-BuDmW8Jc.js} +8 -37
- package/dist/useRequest-BuDmW8Jc.js.map +1 -0
- package/package.json +3 -2
- package/src/__stories__/experiment-helpers.ts +3 -3
- package/src/__tests__/components/ActionMenu.test.ts +2 -2
- package/src/__tests__/components/AppTopBar.test.ts +206 -1
- package/src/__tests__/components/AppTopBarOnboarding.test.ts +160 -0
- package/src/__tests__/components/AppTopBarPageSelector.test.ts +125 -9
- package/src/__tests__/components/BaseButton.test.ts +19 -0
- package/src/__tests__/components/BaseModal.test.ts +13 -0
- package/src/__tests__/components/ExperimentSelectorModal.test.ts +34 -1
- package/src/__tests__/components/FloatingPanelsInModal.test.ts +94 -0
- package/src/__tests__/components/GeneratedPluginView.test.ts +1 -1
- package/src/__tests__/components/JobsStatusTray.test.ts +373 -71
- package/src/__tests__/components/PluginWorkspaceView.test.ts +63 -1
- package/src/__tests__/components/SampleSelector.test.ts +20 -0
- package/src/__tests__/components/SettingsModal.test.ts +9 -2
- package/src/__tests__/composables/useFileImport.test.ts +36 -0
- package/src/__tests__/composables/useFloatingPanel.test.ts +68 -0
- package/src/__tests__/composables/useJobCenter.test.ts +262 -3
- package/src/__tests__/composables/useOnboarding.test.ts +317 -0
- package/src/__tests__/docs/frontendDocsCatalog.test.ts +4 -3
- package/src/__tests__/fixtures/table-import/cells.xlsx +0 -0
- package/src/__tests__/fixtures/table-import/samples.xlsx +0 -0
- package/src/__tests__/stores/settings.test.ts +21 -21
- package/src/__tests__/styles/cssTokens.test.ts +4 -1
- package/src/__tests__/styles/menusShellRefresh.test.ts +8 -2
- package/src/__tests__/styles/paletteTokens.test.ts +44 -0
- package/src/__tests__/styles/v2AuditRules.test.ts +104 -0
- package/src/components/ActionMenu.vue +6 -37
- package/src/components/AppTopBar.onboarding.story.vue +69 -0
- package/src/components/AppTopBar.story.vue +59 -4
- package/src/components/AppTopBar.vue +132 -10
- package/src/components/BaseButton.vue +16 -2
- package/src/components/BaseModal.vue +2 -1
- package/src/components/ExperimentSelectorModal.story.vue +38 -0
- package/src/components/ExperimentSelectorModal.vue +20 -1
- package/src/components/GeneratedPluginView.vue +4 -9
- package/src/components/GeneratedResultRenderer.vue +3 -4
- package/src/components/JobsStatusTray.story.vue +97 -43
- package/src/components/JobsStatusTray.vue +287 -290
- package/src/components/LayoutResizeHandle.story.vue +65 -4
- package/src/components/PluginWorkspaceView.props.ts +3 -0
- package/src/components/PluginWorkspaceView.vue +17 -0
- package/src/components/SampleSelector.story.vue +21 -6
- package/src/components/SampleSelector.vue +10 -3
- package/src/components/SectionCard.story.vue +33 -0
- package/src/components/SettingsModal.vue +7 -12
- package/src/components/Tooltip.vue +9 -32
- package/src/components/internal/AppTopBarOnboardingInternal.vue +172 -0
- package/src/components/internal/AppTopBarPageSelectorInternal.vue +140 -72
- package/src/components/internal/DatePickerDateInternal.vue +7 -45
- package/src/components/internal/DatePickerDateTimeInternal.vue +7 -1
- package/src/components/internal/DatePickerTimeInternal.vue +8 -1
- package/src/components/internal/NumberUnitInputInternal.vue +4 -18
- package/src/components/internal/OnboardingLayerInternal.vue +173 -0
- package/src/components/internal/SelectMultipleInternal.vue +6 -1
- package/src/components/internal/SelectSearchableInternal.vue +6 -1
- package/src/components/internal/WellEditPopupInternal.vue +11 -22
- package/src/components/internal/WorkspaceShellInternal.vue +12 -0
- package/src/composables/pluginWorkspaceModel.ts +2 -2
- package/src/composables/useFileImport.ts +51 -1
- package/src/composables/useFloatingPanel.ts +107 -0
- package/src/composables/useJobCenter.ts +188 -6
- package/src/composables/useOnboarding.ts +465 -0
- package/src/composables/usePluginWorkspace.ts +1 -1
- package/src/data.ts +1 -0
- package/src/runtime.ts +2 -1
- package/src/shell.ts +17 -0
- package/src/stores/index.ts +0 -2
- package/src/stores/settings.ts +20 -50
- package/src/styles/components/action-menu.css +1 -1
- package/src/styles/components/app-layout.css +6 -3
- package/src/styles/components/app-page-selector.css +120 -45
- package/src/styles/components/app-top-bar.css +165 -3
- package/src/styles/components/button.css +8 -0
- package/src/styles/components/dataframe.css +1 -1
- package/src/styles/components/date-picker.css +4 -2
- package/src/styles/components/datetime-picker.css +4 -4
- package/src/styles/components/experiment-selector-modal.css +13 -0
- package/src/styles/components/jobs-status-tray.css +134 -296
- package/src/styles/components/layout-resize-handle.css +59 -16
- package/src/styles/components/modal.css +3 -3
- package/src/styles/components/number-input.css +1 -1
- package/src/styles/components/onboarding.css +368 -0
- package/src/styles/components/progress-bar.css +3 -3
- package/src/styles/components/sample-selector.css +43 -0
- package/src/styles/components/searchable-select.css +3 -7
- package/src/styles/components/section-card.css +30 -6
- package/src/styles/components/settings-modal.css +7 -2
- package/src/styles/components/time-picker.css +3 -6
- package/src/styles/components/toast.css +1 -1
- package/src/styles/components/tooltip.css +2 -2
- package/src/styles/components/unit-input.css +1 -1
- package/src/styles/components/well-edit-popup.css +2 -2
- package/src/styles/index.css +1 -0
- package/src/styles/variables.css +153 -15
- package/src/types/components.ts +2 -0
- package/src/types/index.ts +1 -0
- package/src/types/jobs.ts +10 -0
- package/src/types/platform.ts +1 -1
- package/dist/AppSidebar-Dq9W1jE2.js.map +0 -1
- package/dist/ExperimentSelectorModal-65peG4Up.js.map +0 -1
- package/dist/SettingsModal-483nyI6b.js.map +0 -1
- package/dist/experiment-43OJtH7R.js.map +0 -1
- package/dist/records-B6gpM_3e.js.map +0 -1
- package/dist/runtime-7vfl_bI3.js.map +0 -1
- package/dist/useDropdownState-8yWMu-7_.js.map +0 -1
- package/dist/useExperimentSamples-DHnxKFAF.js.map +0 -1
- package/dist/useListReorder-BitdUhxn.js.map +0 -1
- package/dist/useRackEditor-DiwCt77M.js.map +0 -1
- package/dist/useRealtime-C3iy9QkU.js +0 -699
- package/dist/useRealtime-C3iy9QkU.js.map +0 -1
- package/dist/useRequest-D506eHi8.js.map +0 -1
package/README.md
CHANGED
|
@@ -415,19 +415,30 @@ derives its groups from the same jobs ref and does not mirror it with a watcher:
|
|
|
415
415
|
|
|
416
416
|
```vue
|
|
417
417
|
<script setup lang="ts">
|
|
418
|
+
import { AppTopBar } from '@morscherlab/mint-sdk/shell'
|
|
418
419
|
import { JobsStatusTray } from '@morscherlab/mint-sdk/data'
|
|
420
|
+
import { useJobCenter } from '@morscherlab/mint-sdk/runtime'
|
|
421
|
+
import type { JobState } from '@morscherlab/mint-sdk/types'
|
|
419
422
|
import { useJobs } from './generated/mint-plugin'
|
|
420
423
|
|
|
421
424
|
const jobs = useJobs('analyze')
|
|
425
|
+
const center = useJobCenter({ source: jobs })
|
|
426
|
+
function openResult(job: JobState) { /* show the job's result */ }
|
|
422
427
|
</script>
|
|
423
428
|
|
|
424
429
|
<template>
|
|
425
|
-
<
|
|
430
|
+
<AppTopBar
|
|
431
|
+
:job="center.topBarJob.value"
|
|
432
|
+
:jobs-done="center.completedCount.value"
|
|
433
|
+
@job-click="center.handleTopBarClick(openResult)"
|
|
434
|
+
/>
|
|
435
|
+
<JobsStatusTray :center="center" @select="openResult" />
|
|
426
436
|
</template>
|
|
427
437
|
```
|
|
428
438
|
|
|
429
|
-
|
|
430
|
-
actions therefore have exactly one state owner.
|
|
439
|
+
The job center reads only the runtime source. Polling, SSE updates, and job
|
|
440
|
+
actions therefore have exactly one state owner. `PluginWorkspaceView` does this
|
|
441
|
+
wiring when its spec sets `jobs: jobs` and emits `job-select`.
|
|
431
442
|
|
|
432
443
|
When an incremental migration temporarily has more than one owner, use
|
|
433
444
|
`combinePluginJobSources([sdkJobs, legacyJobs])`. It preserves each source's
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as BaseButton_default } from "./useDropdownState-
|
|
2
|
-
import { L as EmptyState_default } from "./records-
|
|
1
|
+
import { a as BaseButton_default } from "./useDropdownState-uFIz6Yv8.js";
|
|
2
|
+
import { L as EmptyState_default } from "./records-D4aQXyZu.js";
|
|
3
3
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, toValue, useSlots, withCtx } from "vue";
|
|
4
4
|
//#region src/composables/useTextSearch.ts
|
|
5
5
|
/** Shared text-search filtering for tables, lists, selectors, and chip inputs. */
|
|
@@ -273,4 +273,4 @@ var AlertBox_default = /* @__PURE__ */ defineComponent({
|
|
|
273
273
|
//#endregion
|
|
274
274
|
export { normalizeSearchQuery as a, candidateMatchesSearch as i, DataStateInternal_default as n, useTextSearch as o, LoadingSpinner_default as r, AlertBox_default as t };
|
|
275
275
|
|
|
276
|
-
//# sourceMappingURL=AlertBox-
|
|
276
|
+
//# sourceMappingURL=AlertBox-DwgNTEqf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertBox-B2Bgr3ei.js","names":[],"sources":["../src/composables/useTextSearch.ts","../src/components/LoadingSpinner.vue","../src/components/LoadingSpinner.vue","../src/components/internal/DataStateInternal.vue","../src/components/internal/DataStateInternal.vue","../src/components/AlertBox.vue","../src/components/AlertBox.vue"],"sourcesContent":["import { computed, toValue, type ComputedRef, type Ref } from 'vue'\n\nexport type TextSearchSource<T> =\n | T\n | Ref<T>\n | ComputedRef<T>\n | (() => T)\n\nexport type TextSearchCandidate = unknown | readonly unknown[]\n\nexport interface UseTextSearchOptions<TItem> {\n items: TextSearchSource<readonly TItem[]>\n query: TextSearchSource<string | null | undefined>\n enabled?: TextSearchSource<boolean | null | undefined>\n getText: (item: TItem) => TextSearchCandidate\n}\n\nexport interface UseTextSearchReturn<TItem> {\n query: ComputedRef<string>\n filteredItems: ComputedRef<TItem[]>\n matches: (item: TItem, query?: string | null | undefined) => boolean\n}\n\n/** Shared text-search filtering for tables, lists, selectors, and chip inputs. */\nexport function useTextSearch<TItem>(options: UseTextSearchOptions<TItem>): UseTextSearchReturn<TItem> {\n const query = computed(() => normalizeSearchQuery(toValue(options.query)))\n const enabled = computed(() => toValue(options.enabled) ?? true)\n\n function matches(item: TItem, overrideQuery?: string | null | undefined): boolean {\n const activeQuery = overrideQuery === undefined ? query.value : normalizeSearchQuery(overrideQuery)\n if (!activeQuery) return true\n return candidateMatchesSearch(options.getText(item), activeQuery)\n }\n\n const filteredItems = computed(() => {\n const items = [...toValue(options.items)]\n if (!enabled.value || !query.value) return items\n return items.filter(item => matches(item))\n })\n\n return {\n query,\n filteredItems,\n matches,\n }\n}\n\nexport function normalizeSearchQuery(value: string | null | undefined): string {\n return (value ?? '').trim().toLowerCase()\n}\n\nexport function candidateMatchesSearch(candidate: TextSearchCandidate, query: string): boolean {\n const normalizedQuery = normalizeSearchQuery(query)\n if (!normalizedQuery) return true\n const values = Array.isArray(candidate) ? candidate : [candidate]\n return values.some((value) => {\n if (value === null || value === undefined) return false\n return String(value).toLowerCase().includes(normalizedQuery)\n })\n}\n","<script setup lang=\"ts\">\n/** Animated SVG spinner with size and tone, and a visually hidden status label for screen readers. `tone=\"inherit\"` takes the parent's text color. */\nimport type { Tone } from '../types'\n\ninterface Props {\n size?: 'xs' | 'sm' | 'md' | 'lg'\n tone?: Tone | 'inherit'\n label?: string\n}\n\nwithDefaults(defineProps<Props>(), {\n size: 'md',\n tone: 'primary',\n label: 'Loading',\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-spinner',\n `mint-spinner--${size}`,\n `mint-spinner--${tone}`,\n ]\"\n role=\"status\"\n >\n <svg\n class=\"mint-spinner__svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style=\"opacity: 0.25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"4\"\n />\n <path\n style=\"opacity: 0.75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n <span class=\"mint-spinner__label\">{{ label }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Animated SVG spinner with size and tone, and a visually hidden status label for screen readers. `tone=\"inherit\"` takes the parent's text color. */\nimport type { Tone } from '../types'\n\ninterface Props {\n size?: 'xs' | 'sm' | 'md' | 'lg'\n tone?: Tone | 'inherit'\n label?: string\n}\n\nwithDefaults(defineProps<Props>(), {\n size: 'md',\n tone: 'primary',\n label: 'Loading',\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-spinner',\n `mint-spinner--${size}`,\n `mint-spinner--${tone}`,\n ]\"\n role=\"status\"\n >\n <svg\n class=\"mint-spinner__svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style=\"opacity: 0.25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"4\"\n />\n <path\n style=\"opacity: 0.75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n <span class=\"mint-spinner__label\">{{ label }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Shared loading / error / empty presentation for the SDK data components.\n *\n * Internal: not exported from the package entrypoints. Data components render\n * this instead of hand-rolling their own placeholder markup so that the\n * loading, error and empty states look the same everywhere.\n */\nimport { computed } from 'vue'\nimport EmptyState from '../EmptyState.vue'\nimport LoadingSpinner from '../LoadingSpinner.vue'\n\n/** Single-path warning triangle used for the error state. */\nconst ERROR_ICON_PATH\n = 'M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'\n + 'M12 9v4M12 17h.01'\n\ninterface Props {\n /** Which of the three placeholder states to render. */\n state: 'loading' | 'error' | 'empty'\n /** Headline for the empty/error state. */\n title?: string\n /** Supporting copy for the empty/error state. */\n description?: string\n /** Custom `<path d>` for the empty state icon (the error state has its own). */\n iconPath?: string\n /** Placeholder scale; also drives the loading spinner size. */\n size?: 'sm' | 'md' | 'lg'\n /** `EmptyState` layout variant. */\n variant?: 'illustrated' | 'inline'\n /** Accessible label (and visible caption) for the loading state. */\n loadingLabel?: string\n /** Optional call-to-action rendered under the empty/error copy. */\n actionLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n size: 'md',\n variant: 'illustrated',\n loadingLabel: 'Loading',\n})\n\nconst emit = defineEmits<{\n action: []\n}>()\n\nconst spinnerSize = computed(() => (props.size === 'sm' ? 'sm' : props.size === 'lg' ? 'lg' : 'md'))\n</script>\n\n<template>\n <div\n :class=\"['mint-data-state', `mint-data-state--${state}`, `mint-data-state--${size}`]\"\n :data-state=\"state\"\n >\n <template v-if=\"state === 'loading'\">\n <LoadingSpinner :size=\"spinnerSize\" :label=\"loadingLabel\" />\n <p class=\"mint-data-state__loading-text\" aria-hidden=\"true\">{{ loadingLabel }}</p>\n </template>\n <EmptyState\n v-else\n :title=\"title\"\n :description=\"description\"\n :icon-path=\"state === 'error' ? ERROR_ICON_PATH : iconPath\"\n :tone=\"state === 'error' ? 'error' : 'neutral'\"\n :size=\"size\"\n :variant=\"variant\"\n :action-label=\"actionLabel\"\n @action=\"emit('action')\"\n >\n <slot />\n </EmptyState>\n </div>\n</template>\n\n","<script setup lang=\"ts\">\n/**\n * Shared loading / error / empty presentation for the SDK data components.\n *\n * Internal: not exported from the package entrypoints. Data components render\n * this instead of hand-rolling their own placeholder markup so that the\n * loading, error and empty states look the same everywhere.\n */\nimport { computed } from 'vue'\nimport EmptyState from '../EmptyState.vue'\nimport LoadingSpinner from '../LoadingSpinner.vue'\n\n/** Single-path warning triangle used for the error state. */\nconst ERROR_ICON_PATH\n = 'M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'\n + 'M12 9v4M12 17h.01'\n\ninterface Props {\n /** Which of the three placeholder states to render. */\n state: 'loading' | 'error' | 'empty'\n /** Headline for the empty/error state. */\n title?: string\n /** Supporting copy for the empty/error state. */\n description?: string\n /** Custom `<path d>` for the empty state icon (the error state has its own). */\n iconPath?: string\n /** Placeholder scale; also drives the loading spinner size. */\n size?: 'sm' | 'md' | 'lg'\n /** `EmptyState` layout variant. */\n variant?: 'illustrated' | 'inline'\n /** Accessible label (and visible caption) for the loading state. */\n loadingLabel?: string\n /** Optional call-to-action rendered under the empty/error copy. */\n actionLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n size: 'md',\n variant: 'illustrated',\n loadingLabel: 'Loading',\n})\n\nconst emit = defineEmits<{\n action: []\n}>()\n\nconst spinnerSize = computed(() => (props.size === 'sm' ? 'sm' : props.size === 'lg' ? 'lg' : 'md'))\n</script>\n\n<template>\n <div\n :class=\"['mint-data-state', `mint-data-state--${state}`, `mint-data-state--${size}`]\"\n :data-state=\"state\"\n >\n <template v-if=\"state === 'loading'\">\n <LoadingSpinner :size=\"spinnerSize\" :label=\"loadingLabel\" />\n <p class=\"mint-data-state__loading-text\" aria-hidden=\"true\">{{ loadingLabel }}</p>\n </template>\n <EmptyState\n v-else\n :title=\"title\"\n :description=\"description\"\n :icon-path=\"state === 'error' ? ERROR_ICON_PATH : iconPath\"\n :tone=\"state === 'error' ? 'error' : 'neutral'\"\n :size=\"size\"\n :variant=\"variant\"\n :action-label=\"actionLabel\"\n @action=\"emit('action')\"\n >\n <slot />\n </EmptyState>\n </div>\n</template>\n\n","<script setup lang=\"ts\">\n/** Inline alert banner with semantic icon, title, message slot, optional action button, and optional dismiss button. */\nimport { useSlots } from 'vue'\nimport type { Tone } from '../types'\nimport BaseButton from './BaseButton.vue'\n\ninterface Props {\n tone?: Tone\n title?: string\n dismissible?: boolean\n actionLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n tone: 'info',\n dismissible: false,\n})\n\nconst emit = defineEmits<{\n dismiss: []\n action: []\n}>()\n\nconst slots = useSlots()\nconst hasActions = () => !!props.actionLabel || !!slots.actions\n</script>\n\n<template>\n <div\n class=\"mint-alert\"\n :class=\"`mint-alert--${props.tone}`\"\n role=\"alert\"\n >\n <span :class=\"['mint-alert__icon', `mint-alert__icon--${props.tone}`]\">\n <!-- Lucide circle-check -->\n <svg v-if=\"props.tone === 'success'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m9 12 2 2 4-4\" />\n </svg>\n <!-- Lucide circle-x -->\n <svg v-else-if=\"props.tone === 'error'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m15 9-6 6\" /><path d=\"m9 9 6 6\" />\n </svg>\n <!-- Lucide triangle-alert -->\n <svg v-else-if=\"props.tone === 'warning'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" /><path d=\"M12 9v4\" /><path d=\"M12 17h.01\" />\n </svg>\n <!-- Lucide info -->\n <svg v-else viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M12 16v-4\" /><path d=\"M12 8h.01\" />\n </svg>\n </span>\n\n <div class=\"mint-alert__content\">\n <h4 v-if=\"props.title\" class=\"mint-alert__title\">\n {{ props.title }}\n </h4>\n <div class=\"mint-alert__message\">\n <slot />\n </div>\n </div>\n\n <div v-if=\"hasActions()\" class=\"mint-alert__actions\">\n <slot name=\"actions\">\n <BaseButton variant=\"secondary\" size=\"sm\" @click=\"emit('action')\">\n {{ props.actionLabel }}\n </BaseButton>\n </slot>\n </div>\n\n <button\n v-if=\"props.dismissible\"\n type=\"button\"\n class=\"mint-alert__dismiss\"\n aria-label=\"Dismiss\"\n @click=\"emit('dismiss')\"\n >\n <svg class=\"mint-alert__dismiss-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Inline alert banner with semantic icon, title, message slot, optional action button, and optional dismiss button. */\nimport { useSlots } from 'vue'\nimport type { Tone } from '../types'\nimport BaseButton from './BaseButton.vue'\n\ninterface Props {\n tone?: Tone\n title?: string\n dismissible?: boolean\n actionLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n tone: 'info',\n dismissible: false,\n})\n\nconst emit = defineEmits<{\n dismiss: []\n action: []\n}>()\n\nconst slots = useSlots()\nconst hasActions = () => !!props.actionLabel || !!slots.actions\n</script>\n\n<template>\n <div\n class=\"mint-alert\"\n :class=\"`mint-alert--${props.tone}`\"\n role=\"alert\"\n >\n <span :class=\"['mint-alert__icon', `mint-alert__icon--${props.tone}`]\">\n <!-- Lucide circle-check -->\n <svg v-if=\"props.tone === 'success'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m9 12 2 2 4-4\" />\n </svg>\n <!-- Lucide circle-x -->\n <svg v-else-if=\"props.tone === 'error'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m15 9-6 6\" /><path d=\"m9 9 6 6\" />\n </svg>\n <!-- Lucide triangle-alert -->\n <svg v-else-if=\"props.tone === 'warning'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" /><path d=\"M12 9v4\" /><path d=\"M12 17h.01\" />\n </svg>\n <!-- Lucide info -->\n <svg v-else viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M12 16v-4\" /><path d=\"M12 8h.01\" />\n </svg>\n </span>\n\n <div class=\"mint-alert__content\">\n <h4 v-if=\"props.title\" class=\"mint-alert__title\">\n {{ props.title }}\n </h4>\n <div class=\"mint-alert__message\">\n <slot />\n </div>\n </div>\n\n <div v-if=\"hasActions()\" class=\"mint-alert__actions\">\n <slot name=\"actions\">\n <BaseButton variant=\"secondary\" size=\"sm\" @click=\"emit('action')\">\n {{ props.actionLabel }}\n </BaseButton>\n </slot>\n </div>\n\n <button\n v-if=\"props.dismissible\"\n type=\"button\"\n class=\"mint-alert__dismiss\"\n aria-label=\"Dismiss\"\n @click=\"emit('dismiss')\"\n >\n <svg class=\"mint-alert__dismiss-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </div>\n</template>\n"],"mappings":";;;;;AAwBA,SAAgB,cAAqB,SAAkE;CACrG,MAAM,QAAQ,eAAe,qBAAqB,QAAQ,QAAQ,KAAK,CAAC,CAAC;CACzE,MAAM,UAAU,eAAe,QAAQ,QAAQ,OAAO,KAAK,IAAI;CAE/D,SAAS,QAAQ,MAAa,eAAoD;EAChF,MAAM,cAAc,kBAAkB,KAAA,IAAY,MAAM,QAAQ,qBAAqB,aAAa;EAClG,IAAI,CAAC,aAAa,OAAO;EACzB,OAAO,uBAAuB,QAAQ,QAAQ,IAAI,GAAG,WAAW;CAClE;CAQA,OAAO;EACL;EACA,eARoB,eAAe;GACnC,MAAM,QAAQ,CAAC,GAAG,QAAQ,QAAQ,KAAK,CAAC;G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ArB,UAAA,GAAA,mBAMM,OANN,YAMM,CALJ,WAIO,KAAA,QAAA,WAAA,CAAA,SAAA,CAHL,YAEa,oBAAA;KAFD,SAAQ;KAAY,MAAK;KAAM,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,QAAA;;KACpD,SAAA,cAAuB,CAApB,gBAAA,gBAAA,MAAM,WAAW,GAAA,CAAA,CAAA,CAAA;;;IAMlB,MAAM,eADd,UAAA,GAAA,mBAUS,UAAA;;KARP,MAAK;KACL,OAAM;KACN,cAAW;KACV,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,SAAA;IAEZ,GAAA,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,mBAEM,OAAA;KAFD,OAAM;KAA2B,SAAQ;KAAY,MAAK;KAAO,QAAO;KAAe,gBAAa;KAAI,kBAAe;KAAQ,mBAAgB;IAClJ,GAAA,CAAA,mBAAuB,QAAA,EAAjB,GAAE,aAAY,CAAA,GAAG,mBAAuB,QAAA,EAAjB,GAAE,aAAY,CAAA,CAAA,GAAA,EAAA,CAAA,EAAA,CAAA,KAAA,mBAAA,IAAA,IAAA"}
|
|
1
|
+
{"version":3,"file":"AlertBox-DwgNTEqf.js","names":[],"sources":["../src/composables/useTextSearch.ts","../src/components/LoadingSpinner.vue","../src/components/LoadingSpinner.vue","../src/components/internal/DataStateInternal.vue","../src/components/internal/DataStateInternal.vue","../src/components/AlertBox.vue","../src/components/AlertBox.vue"],"sourcesContent":["import { computed, toValue, type ComputedRef, type Ref } from 'vue'\n\nexport type TextSearchSource<T> =\n | T\n | Ref<T>\n | ComputedRef<T>\n | (() => T)\n\nexport type TextSearchCandidate = unknown | readonly unknown[]\n\nexport interface UseTextSearchOptions<TItem> {\n items: TextSearchSource<readonly TItem[]>\n query: TextSearchSource<string | null | undefined>\n enabled?: TextSearchSource<boolean | null | undefined>\n getText: (item: TItem) => TextSearchCandidate\n}\n\nexport interface UseTextSearchReturn<TItem> {\n query: ComputedRef<string>\n filteredItems: ComputedRef<TItem[]>\n matches: (item: TItem, query?: string | null | undefined) => boolean\n}\n\n/** Shared text-search filtering for tables, lists, selectors, and chip inputs. */\nexport function useTextSearch<TItem>(options: UseTextSearchOptions<TItem>): UseTextSearchReturn<TItem> {\n const query = computed(() => normalizeSearchQuery(toValue(options.query)))\n const enabled = computed(() => toValue(options.enabled) ?? true)\n\n function matches(item: TItem, overrideQuery?: string | null | undefined): boolean {\n const activeQuery = overrideQuery === undefined ? query.value : normalizeSearchQuery(overrideQuery)\n if (!activeQuery) return true\n return candidateMatchesSearch(options.getText(item), activeQuery)\n }\n\n const filteredItems = computed(() => {\n const items = [...toValue(options.items)]\n if (!enabled.value || !query.value) return items\n return items.filter(item => matches(item))\n })\n\n return {\n query,\n filteredItems,\n matches,\n }\n}\n\nexport function normalizeSearchQuery(value: string | null | undefined): string {\n return (value ?? '').trim().toLowerCase()\n}\n\nexport function candidateMatchesSearch(candidate: TextSearchCandidate, query: string): boolean {\n const normalizedQuery = normalizeSearchQuery(query)\n if (!normalizedQuery) return true\n const values = Array.isArray(candidate) ? candidate : [candidate]\n return values.some((value) => {\n if (value === null || value === undefined) return false\n return String(value).toLowerCase().includes(normalizedQuery)\n })\n}\n","<script setup lang=\"ts\">\n/** Animated SVG spinner with size and tone, and a visually hidden status label for screen readers. `tone=\"inherit\"` takes the parent's text color. */\nimport type { Tone } from '../types'\n\ninterface Props {\n size?: 'xs' | 'sm' | 'md' | 'lg'\n tone?: Tone | 'inherit'\n label?: string\n}\n\nwithDefaults(defineProps<Props>(), {\n size: 'md',\n tone: 'primary',\n label: 'Loading',\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-spinner',\n `mint-spinner--${size}`,\n `mint-spinner--${tone}`,\n ]\"\n role=\"status\"\n >\n <svg\n class=\"mint-spinner__svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style=\"opacity: 0.25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"4\"\n />\n <path\n style=\"opacity: 0.75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n <span class=\"mint-spinner__label\">{{ label }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Animated SVG spinner with size and tone, and a visually hidden status label for screen readers. `tone=\"inherit\"` takes the parent's text color. */\nimport type { Tone } from '../types'\n\ninterface Props {\n size?: 'xs' | 'sm' | 'md' | 'lg'\n tone?: Tone | 'inherit'\n label?: string\n}\n\nwithDefaults(defineProps<Props>(), {\n size: 'md',\n tone: 'primary',\n label: 'Loading',\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-spinner',\n `mint-spinner--${size}`,\n `mint-spinner--${tone}`,\n ]\"\n role=\"status\"\n >\n <svg\n class=\"mint-spinner__svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style=\"opacity: 0.25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"4\"\n />\n <path\n style=\"opacity: 0.75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n <span class=\"mint-spinner__label\">{{ label }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Shared loading / error / empty presentation for the SDK data components.\n *\n * Internal: not exported from the package entrypoints. Data components render\n * this instead of hand-rolling their own placeholder markup so that the\n * loading, error and empty states look the same everywhere.\n */\nimport { computed } from 'vue'\nimport EmptyState from '../EmptyState.vue'\nimport LoadingSpinner from '../LoadingSpinner.vue'\n\n/** Single-path warning triangle used for the error state. */\nconst ERROR_ICON_PATH\n = 'M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'\n + 'M12 9v4M12 17h.01'\n\ninterface Props {\n /** Which of the three placeholder states to render. */\n state: 'loading' | 'error' | 'empty'\n /** Headline for the empty/error state. */\n title?: string\n /** Supporting copy for the empty/error state. */\n description?: string\n /** Custom `<path d>` for the empty state icon (the error state has its own). */\n iconPath?: string\n /** Placeholder scale; also drives the loading spinner size. */\n size?: 'sm' | 'md' | 'lg'\n /** `EmptyState` layout variant. */\n variant?: 'illustrated' | 'inline'\n /** Accessible label (and visible caption) for the loading state. */\n loadingLabel?: string\n /** Optional call-to-action rendered under the empty/error copy. */\n actionLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n size: 'md',\n variant: 'illustrated',\n loadingLabel: 'Loading',\n})\n\nconst emit = defineEmits<{\n action: []\n}>()\n\nconst spinnerSize = computed(() => (props.size === 'sm' ? 'sm' : props.size === 'lg' ? 'lg' : 'md'))\n</script>\n\n<template>\n <div\n :class=\"['mint-data-state', `mint-data-state--${state}`, `mint-data-state--${size}`]\"\n :data-state=\"state\"\n >\n <template v-if=\"state === 'loading'\">\n <LoadingSpinner :size=\"spinnerSize\" :label=\"loadingLabel\" />\n <p class=\"mint-data-state__loading-text\" aria-hidden=\"true\">{{ loadingLabel }}</p>\n </template>\n <EmptyState\n v-else\n :title=\"title\"\n :description=\"description\"\n :icon-path=\"state === 'error' ? ERROR_ICON_PATH : iconPath\"\n :tone=\"state === 'error' ? 'error' : 'neutral'\"\n :size=\"size\"\n :variant=\"variant\"\n :action-label=\"actionLabel\"\n @action=\"emit('action')\"\n >\n <slot />\n </EmptyState>\n </div>\n</template>\n\n","<script setup lang=\"ts\">\n/**\n * Shared loading / error / empty presentation for the SDK data components.\n *\n * Internal: not exported from the package entrypoints. Data components render\n * this instead of hand-rolling their own placeholder markup so that the\n * loading, error and empty states look the same everywhere.\n */\nimport { computed } from 'vue'\nimport EmptyState from '../EmptyState.vue'\nimport LoadingSpinner from '../LoadingSpinner.vue'\n\n/** Single-path warning triangle used for the error state. */\nconst ERROR_ICON_PATH\n = 'M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'\n + 'M12 9v4M12 17h.01'\n\ninterface Props {\n /** Which of the three placeholder states to render. */\n state: 'loading' | 'error' | 'empty'\n /** Headline for the empty/error state. */\n title?: string\n /** Supporting copy for the empty/error state. */\n description?: string\n /** Custom `<path d>` for the empty state icon (the error state has its own). */\n iconPath?: string\n /** Placeholder scale; also drives the loading spinner size. */\n size?: 'sm' | 'md' | 'lg'\n /** `EmptyState` layout variant. */\n variant?: 'illustrated' | 'inline'\n /** Accessible label (and visible caption) for the loading state. */\n loadingLabel?: string\n /** Optional call-to-action rendered under the empty/error copy. */\n actionLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n size: 'md',\n variant: 'illustrated',\n loadingLabel: 'Loading',\n})\n\nconst emit = defineEmits<{\n action: []\n}>()\n\nconst spinnerSize = computed(() => (props.size === 'sm' ? 'sm' : props.size === 'lg' ? 'lg' : 'md'))\n</script>\n\n<template>\n <div\n :class=\"['mint-data-state', `mint-data-state--${state}`, `mint-data-state--${size}`]\"\n :data-state=\"state\"\n >\n <template v-if=\"state === 'loading'\">\n <LoadingSpinner :size=\"spinnerSize\" :label=\"loadingLabel\" />\n <p class=\"mint-data-state__loading-text\" aria-hidden=\"true\">{{ loadingLabel }}</p>\n </template>\n <EmptyState\n v-else\n :title=\"title\"\n :description=\"description\"\n :icon-path=\"state === 'error' ? ERROR_ICON_PATH : iconPath\"\n :tone=\"state === 'error' ? 'error' : 'neutral'\"\n :size=\"size\"\n :variant=\"variant\"\n :action-label=\"actionLabel\"\n @action=\"emit('action')\"\n >\n <slot />\n </EmptyState>\n </div>\n</template>\n\n","<script setup lang=\"ts\">\n/** Inline alert banner with semantic icon, title, message slot, optional action button, and optional dismiss button. */\nimport { useSlots } from 'vue'\nimport type { Tone } from '../types'\nimport BaseButton from './BaseButton.vue'\n\ninterface Props {\n tone?: Tone\n title?: string\n dismissible?: boolean\n actionLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n tone: 'info',\n dismissible: false,\n})\n\nconst emit = defineEmits<{\n dismiss: []\n action: []\n}>()\n\nconst slots = useSlots()\nconst hasActions = () => !!props.actionLabel || !!slots.actions\n</script>\n\n<template>\n <div\n class=\"mint-alert\"\n :class=\"`mint-alert--${props.tone}`\"\n role=\"alert\"\n >\n <span :class=\"['mint-alert__icon', `mint-alert__icon--${props.tone}`]\">\n <!-- Lucide circle-check -->\n <svg v-if=\"props.tone === 'success'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m9 12 2 2 4-4\" />\n </svg>\n <!-- Lucide circle-x -->\n <svg v-else-if=\"props.tone === 'error'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m15 9-6 6\" /><path d=\"m9 9 6 6\" />\n </svg>\n <!-- Lucide triangle-alert -->\n <svg v-else-if=\"props.tone === 'warning'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" /><path d=\"M12 9v4\" /><path d=\"M12 17h.01\" />\n </svg>\n <!-- Lucide info -->\n <svg v-else viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M12 16v-4\" /><path d=\"M12 8h.01\" />\n </svg>\n </span>\n\n <div class=\"mint-alert__content\">\n <h4 v-if=\"props.title\" class=\"mint-alert__title\">\n {{ props.title }}\n </h4>\n <div class=\"mint-alert__message\">\n <slot />\n </div>\n </div>\n\n <div v-if=\"hasActions()\" class=\"mint-alert__actions\">\n <slot name=\"actions\">\n <BaseButton variant=\"secondary\" size=\"sm\" @click=\"emit('action')\">\n {{ props.actionLabel }}\n </BaseButton>\n </slot>\n </div>\n\n <button\n v-if=\"props.dismissible\"\n type=\"button\"\n class=\"mint-alert__dismiss\"\n aria-label=\"Dismiss\"\n @click=\"emit('dismiss')\"\n >\n <svg class=\"mint-alert__dismiss-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Inline alert banner with semantic icon, title, message slot, optional action button, and optional dismiss button. */\nimport { useSlots } from 'vue'\nimport type { Tone } from '../types'\nimport BaseButton from './BaseButton.vue'\n\ninterface Props {\n tone?: Tone\n title?: string\n dismissible?: boolean\n actionLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n tone: 'info',\n dismissible: false,\n})\n\nconst emit = defineEmits<{\n dismiss: []\n action: []\n}>()\n\nconst slots = useSlots()\nconst hasActions = () => !!props.actionLabel || !!slots.actions\n</script>\n\n<template>\n <div\n class=\"mint-alert\"\n :class=\"`mint-alert--${props.tone}`\"\n role=\"alert\"\n >\n <span :class=\"['mint-alert__icon', `mint-alert__icon--${props.tone}`]\">\n <!-- Lucide circle-check -->\n <svg v-if=\"props.tone === 'success'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m9 12 2 2 4-4\" />\n </svg>\n <!-- Lucide circle-x -->\n <svg v-else-if=\"props.tone === 'error'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m15 9-6 6\" /><path d=\"m9 9 6 6\" />\n </svg>\n <!-- Lucide triangle-alert -->\n <svg v-else-if=\"props.tone === 'warning'\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" /><path d=\"M12 9v4\" /><path d=\"M12 17h.01\" />\n </svg>\n <!-- Lucide info -->\n <svg v-else viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M12 16v-4\" /><path d=\"M12 8h.01\" />\n </svg>\n </span>\n\n <div class=\"mint-alert__content\">\n <h4 v-if=\"props.title\" class=\"mint-alert__title\">\n {{ props.title }}\n </h4>\n <div class=\"mint-alert__message\">\n <slot />\n </div>\n </div>\n\n <div v-if=\"hasActions()\" class=\"mint-alert__actions\">\n <slot name=\"actions\">\n <BaseButton variant=\"secondary\" size=\"sm\" @click=\"emit('action')\">\n {{ props.actionLabel }}\n </BaseButton>\n </slot>\n </div>\n\n <button\n v-if=\"props.dismissible\"\n type=\"button\"\n class=\"mint-alert__dismiss\"\n aria-label=\"Dismiss\"\n @click=\"emit('dismiss')\"\n >\n <svg class=\"mint-alert__dismiss-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </div>\n</template>\n"],"mappings":";;;;;AAwBA,SAAgB,cAAqB,SAAkE;CACrG,MAAM,Q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