@ac-design/design-system 1.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -18
- package/dist/lib/charts/ChartFrame.js +5 -0
- package/dist/lib/charts/ChartFrame.vue.d.ts +71 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +173 -0
- package/dist/lib/charts/cartesian.d.ts +324 -0
- package/dist/lib/charts/cartesian.js +137 -0
- package/dist/lib/charts/echarts.d.ts +86 -0
- package/dist/lib/charts/echarts.js +173 -0
- package/dist/lib/charts/graph.d.ts +77 -0
- package/dist/lib/charts/graph.js +155 -0
- package/dist/lib/charts/index.d.ts +11 -0
- package/dist/lib/charts/index.js +7 -0
- package/dist/lib/charts/shared.d.ts +53 -0
- package/dist/lib/charts/shared.js +96 -0
- package/dist/lib/charts/xy.d.ts +69 -0
- package/dist/lib/charts/xy.js +73 -0
- package/dist/lib/compat.css +2770 -1061
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcAlert.vue.d.ts +10 -1
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +139 -45
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/lib/components/AcAreaChart.js +5 -0
- package/dist/lib/components/AcAreaChart.vue.d.ts +47 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +205 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +66 -61
- package/dist/lib/components/AcBadge.vue.d.ts +20 -7
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +67 -44
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/lib/components/AcBarChart.js +5 -0
- package/dist/lib/components/AcBarChart.vue.d.ts +46 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +213 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +36 -34
- package/dist/lib/components/AcBulkActionBar.js +5 -0
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +45 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/lib/components/AcButton.vue.d.ts +13 -7
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +93 -47
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +42 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +175 -14
- package/dist/lib/components/AcCellValue.vue.d.ts +6 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +219 -178
- package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +113 -30
- package/dist/lib/components/AcCheckList.js +5 -0
- package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
- package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +102 -26
- package/dist/lib/components/AcCircularProgress.js +5 -0
- package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcColorInput.js +5 -0
- package/dist/lib/components/AcColorInput.vue.d.ts +57 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/lib/components/AcCommandBlock.js +5 -0
- package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
- package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcConfirmModal.js +5 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCopyButton.js +5 -0
- package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcCostSummary.js +5 -0
- package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
- package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +8 -8
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +634 -417
- package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +57 -60
- package/dist/lib/components/AcDonutChart.js +5 -0
- package/dist/lib/components/AcDonutChart.vue.d.ts +83 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +237 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +91 -78
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +2 -2
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +18 -18
- package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
- package/dist/lib/components/AcErrorState.js +5 -0
- package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
- package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +139 -116
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFooter.js +5 -0
- package/dist/lib/components/AcFooter.vue.d.ts +37 -0
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/lib/components/AcForm.vue.d.ts +3 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
- package/dist/lib/components/AcFormFooter.vue.d.ts +3 -3
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFormSection.vue.d.ts +8 -1
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
- package/dist/lib/components/AcGraphChart.js +5 -0
- package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
- package/dist/lib/components/AcHeader.vue.d.ts +20 -5
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +82 -28
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/lib/components/AcInput.vue.d.ts +4 -4
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +99 -91
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcKeyValueInput.js +5 -0
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +336 -0
- package/dist/lib/components/AcLineChart.js +5 -0
- package/dist/lib/components/AcLineChart.vue.d.ts +44 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +175 -0
- package/dist/lib/components/AcLoader.js +5 -0
- package/dist/lib/components/AcLoader.vue.d.ts +15 -0
- package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcLocaleSwitcher.js +5 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +48 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/lib/components/AcMapChart.js +5 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
- package/dist/lib/components/AcModal.vue.d.ts +6 -3
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +88 -64
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +29 -21
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +23 -24
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +139 -174
- package/dist/lib/components/AcNumberInput.js +5 -0
- package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +241 -0
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcPagination.vue.d.ts +22 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +87 -56
- package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/lib/components/AcProductHero.js +5 -0
- package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
- package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/lib/components/AcProgress.vue.d.ts +19 -4
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +85 -31
- package/dist/lib/components/AcResourceCard.vue.d.ts +3 -3
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +14 -9
- package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSelect.vue.d.ts +6 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +246 -254
- package/dist/lib/components/AcSettingsRow.js +5 -0
- package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
- package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +32 -32
- package/dist/lib/components/AcSideTabs.vue.d.ts +2 -2
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/lib/components/AcSidebar.vue.d.ts +6 -3
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +67 -57
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +46 -45
- package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
- package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
- package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +31 -19
- package/dist/lib/components/AcSwitchCard.js +5 -0
- package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +97 -97
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +43 -28
- package/dist/lib/components/AcTag.vue.d.ts +2 -2
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcTagInput.js +5 -0
- package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +289 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +4 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +85 -63
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +56 -24
- package/dist/lib/components/AcTimePicker.js +5 -0
- package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +455 -0
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +115 -82
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +203 -79
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +166 -115
- package/dist/lib/components/index.d.ts +21 -2
- package/dist/lib/components/status.d.ts +28 -0
- package/dist/lib/components/status.js +125 -0
- package/dist/lib/composables/copyText.d.ts +2 -1
- package/dist/lib/composables/copyText.js +2 -2
- package/dist/lib/composables/useApiPagination.d.ts +55 -0
- package/dist/lib/composables/useApiPagination.js +58 -0
- package/dist/lib/composables/useBulkSelection.d.ts +44 -0
- package/dist/lib/composables/useBulkSelection.js +41 -0
- package/dist/lib/composables/useFormValidation.d.ts +65 -0
- package/dist/lib/composables/useFormValidation.js +148 -0
- package/dist/lib/composables/useTablePagination.d.ts +49 -0
- package/dist/lib/composables/useTablePagination.js +41 -0
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/editor/theme.js +65 -62
- package/dist/lib/index.d.ts +21 -3
- package/dist/lib/index.js +99 -75
- package/dist/lib/theme.css +377 -273
- package/package.json +20 -4
|
@@ -17,13 +17,13 @@ import { EditorView as S, drawSelection as He, dropCursor as Ue, highlightActive
|
|
|
17
17
|
//#region src/lib/components/AcCodeEditor.vue?vue&type=script&setup=true&lang.ts
|
|
18
18
|
var qe = {
|
|
19
19
|
key: 0,
|
|
20
|
-
class: "flex min-h-
|
|
20
|
+
class: "flex min-h-12 flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-border bg-surface-muted px-4 py-2"
|
|
21
21
|
}, Je = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "min-w-0 truncate font-mono text-xs font-medium text-heading"
|
|
24
24
|
}, Ye = {
|
|
25
25
|
key: 1,
|
|
26
|
-
class: "rounded-
|
|
26
|
+
class: "rounded-6 border border-border bg-surface px-1.5 text-xs leading-5 font-medium text-muted"
|
|
27
27
|
}, Xe = {
|
|
28
28
|
key: 2,
|
|
29
29
|
class: "text-xs text-muted"
|
|
@@ -305,7 +305,7 @@ var qe = {
|
|
|
305
305
|
focus: St,
|
|
306
306
|
editor: P
|
|
307
307
|
}), (t, r) => (m(), l("div", {
|
|
308
|
-
class: p(["flex min-w-0 flex-col overflow-hidden bg-
|
|
308
|
+
class: p(["flex min-w-0 flex-col overflow-hidden bg-background", d.bordered && "rounded-10 border border-border transition-[border-color,box-shadow] duration-200 has-[.cm-editor.cm-focused]:focus-ring"]),
|
|
309
309
|
"data-ac-ds": "",
|
|
310
310
|
"data-testid": "ac-code-editor"
|
|
311
311
|
}, [
|
|
@@ -329,16 +329,16 @@ var qe = {
|
|
|
329
329
|
}, {
|
|
330
330
|
default: pe(() => [u("button", {
|
|
331
331
|
type: "button",
|
|
332
|
-
class: "inline-flex size-
|
|
332
|
+
class: "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
333
333
|
"aria-label": R.value ? "Copied" : "Copy to clipboard",
|
|
334
334
|
onClick: wt
|
|
335
335
|
}, [R.value ? (m(), s(_(he), {
|
|
336
336
|
key: 0,
|
|
337
|
-
class: "size-
|
|
337
|
+
class: "size-4 text-success-strong",
|
|
338
338
|
"aria-hidden": "true"
|
|
339
339
|
})) : (m(), s(_(_e), {
|
|
340
340
|
key: 1,
|
|
341
|
-
class: "size-
|
|
341
|
+
class: "size-4",
|
|
342
342
|
"aria-hidden": "true"
|
|
343
343
|
}))], 8, Qe)]),
|
|
344
344
|
_: 1
|
|
@@ -361,14 +361,14 @@ var qe = {
|
|
|
361
361
|
I.value.length && !V.value ? (m(), l("div", {
|
|
362
362
|
key: 2,
|
|
363
363
|
id: _(ut),
|
|
364
|
-
class: "border-t border-border
|
|
364
|
+
class: "border-t border-border bg-surface-muted"
|
|
365
365
|
}, [u("p", et, g(I.value.length) + " " + g(I.value.length === 1 ? "problem" : "problems"), 1), u("ul", tt, [(m(!0), l(ee, null, ae(I.value, (e, t) => (m(), l("li", { key: t }, [u("button", {
|
|
366
366
|
type: "button",
|
|
367
|
-
class: "flex w-full cursor-pointer items-start gap-2 px-
|
|
367
|
+
class: "flex w-full cursor-pointer items-start gap-2 px-4 py-1 text-left text-xs leading-5 text-body transition-colors duration-200 hover:bg-accent-hover focus-visible:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset",
|
|
368
368
|
onClick: (t) => Ct(e)
|
|
369
369
|
}, [
|
|
370
370
|
(m(), s(se(e.severity === "error" ? _(ge) : _(ve)), {
|
|
371
|
-
class: p(["mt-0.75 size-3.5 shrink-0", e.severity === "error" ? "text-
|
|
371
|
+
class: p(["mt-0.75 size-3.5 shrink-0", e.severity === "error" ? "text-danger" : "text-warning"]),
|
|
372
372
|
"aria-hidden": "true"
|
|
373
373
|
}, null, 8, ["class"])),
|
|
374
374
|
u("span", rt, "Ln " + g(e.line) + ", Col " + g(e.column), 1),
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface ColorPreset {
|
|
2
|
+
/** Hex colour, `#rgb` or `#rrggbb`. */
|
|
3
|
+
value: string;
|
|
4
|
+
/** Name read out for the swatch, e.g. "Brand green". Defaults to the hex value. */
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Props {
|
|
8
|
+
/** Label above the field. Without one, pass `aria-label` so the field still has a name. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Native `name` attribute of the hex field. */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** Quick-pick swatches under the field: hex strings or `{ value, label }`. */
|
|
13
|
+
presets?: (string | ColorPreset)[];
|
|
14
|
+
/** Marks the field required and adds a red asterisk. */
|
|
15
|
+
required?: boolean;
|
|
16
|
+
/** Disables the field, the swatch and the presets. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Read-only field: a muted fill, "(read only)" after the label, and no picker. */
|
|
19
|
+
readonly?: boolean;
|
|
20
|
+
/** Error text under the field. Turns the border red and sets `aria-invalid`. */
|
|
21
|
+
errorMsg?: string;
|
|
22
|
+
/** Help text between the label and the field. */
|
|
23
|
+
hint?: string;
|
|
24
|
+
/** `small` 36px or `normal` 42px tall. With `swatch-only`, a 40px or 48px swatch. */
|
|
25
|
+
size?: "small" | "normal";
|
|
26
|
+
/** Shows only the native colour swatch, with no hex field: cloud-ui's AcColorInput look. */
|
|
27
|
+
swatchOnly?: boolean;
|
|
28
|
+
}
|
|
29
|
+
type __VLS_Props = Props;
|
|
30
|
+
type __VLS_ModelProps = {
|
|
31
|
+
/** Lowercase `#rrggbb`, or `""` when empty. Typed `#rgb` is expanded on blur. */
|
|
32
|
+
modelValue?: string;
|
|
33
|
+
};
|
|
34
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
35
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
36
|
+
/** Moves focus to the hex field, or to the swatch with `swatch-only`. */
|
|
37
|
+
focus: () => void | undefined;
|
|
38
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
"update:modelValue": (value: string) => any;
|
|
40
|
+
change: (value: string) => any;
|
|
41
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
42
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
43
|
+
onChange?: ((value: string) => any) | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
required: boolean;
|
|
46
|
+
label: string;
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
name: string;
|
|
49
|
+
size: "small" | "normal";
|
|
50
|
+
readonly: boolean;
|
|
51
|
+
hint: string;
|
|
52
|
+
errorMsg: string;
|
|
53
|
+
presets: (string | ColorPreset)[];
|
|
54
|
+
swatchOnly: boolean;
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const _default: typeof __VLS_export;
|
|
57
|
+
export default _default;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, normalizeClass as c, normalizeStyle as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, unref as m, useAttrs as h, useId as g, useModel as _, watch as v, withKeys as y } from "vue";
|
|
2
|
+
//#region src/lib/components/AcColorInput.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var b = ["for"], x = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "font-normal text-muted"
|
|
6
|
+
}, S = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "text-danger",
|
|
9
|
+
"aria-hidden": "true"
|
|
10
|
+
}, C = ["id"], w = [
|
|
11
|
+
"id",
|
|
12
|
+
"value",
|
|
13
|
+
"name",
|
|
14
|
+
"disabled",
|
|
15
|
+
"required",
|
|
16
|
+
"aria-label",
|
|
17
|
+
"aria-invalid",
|
|
18
|
+
"aria-describedby"
|
|
19
|
+
], T = [
|
|
20
|
+
"value",
|
|
21
|
+
"disabled",
|
|
22
|
+
"aria-label"
|
|
23
|
+
], E = [
|
|
24
|
+
"id",
|
|
25
|
+
"value",
|
|
26
|
+
"name",
|
|
27
|
+
"disabled",
|
|
28
|
+
"readonly",
|
|
29
|
+
"required",
|
|
30
|
+
"aria-invalid",
|
|
31
|
+
"aria-describedby"
|
|
32
|
+
], D = ["aria-label"], O = [
|
|
33
|
+
"disabled",
|
|
34
|
+
"aria-label",
|
|
35
|
+
"aria-pressed",
|
|
36
|
+
"title",
|
|
37
|
+
"onClick"
|
|
38
|
+
], k = ["id"], A = /*@__PURE__*/ a({
|
|
39
|
+
inheritAttrs: !1,
|
|
40
|
+
__name: "AcColorInput",
|
|
41
|
+
props: /*@__PURE__*/ o({
|
|
42
|
+
label: { default: "" },
|
|
43
|
+
name: { default: "" },
|
|
44
|
+
presets: { default: () => [] },
|
|
45
|
+
required: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
disabled: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !1
|
|
52
|
+
},
|
|
53
|
+
readonly: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !1
|
|
56
|
+
},
|
|
57
|
+
errorMsg: { default: "" },
|
|
58
|
+
hint: { default: "" },
|
|
59
|
+
size: { default: "normal" },
|
|
60
|
+
swatchOnly: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
modelValue: { default: "" },
|
|
66
|
+
modelModifiers: {}
|
|
67
|
+
}),
|
|
68
|
+
emits: /*@__PURE__*/ o(["change"], ["update:modelValue"]),
|
|
69
|
+
setup(a, { expose: o, emit: A }) {
|
|
70
|
+
let j = a, M = _(a, "modelValue"), N = A, P = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i, F = g(), I = h(), L = t(() => ({
|
|
71
|
+
class: I.class,
|
|
72
|
+
style: I.style
|
|
73
|
+
})), R = t(() => {
|
|
74
|
+
let { class: e, style: t, ...n } = I;
|
|
75
|
+
return n;
|
|
76
|
+
}), z = d(null), B = d(null), V = d(M.value), H = d(""), U = t(() => J(M.value)), W = t(() => j.disabled || j.readonly), G = t(() => j.errorMsg || H.value), K = t(() => [j.hint && `${F}-hint`, G.value && `${F}-msg`].filter(Boolean).join(" ") || void 0), q = t(() => j.presets.flatMap((e) => {
|
|
77
|
+
let t = typeof e == "string" ? { value: e } : e, n = J(t.value);
|
|
78
|
+
return n ? [{
|
|
79
|
+
value: n,
|
|
80
|
+
label: t.label || n
|
|
81
|
+
}] : [];
|
|
82
|
+
}));
|
|
83
|
+
function J(e) {
|
|
84
|
+
let t = e ? P.exec(e.trim()) : null;
|
|
85
|
+
if (!t) return null;
|
|
86
|
+
let n = t[1].toLowerCase();
|
|
87
|
+
return `#${n.length === 3 ? [...n].map((e) => e + e).join("") : n}`;
|
|
88
|
+
}
|
|
89
|
+
function Y(e) {
|
|
90
|
+
H.value = "", V.value = e, e !== M.value && (M.value = e, N("change", e));
|
|
91
|
+
}
|
|
92
|
+
function X(e) {
|
|
93
|
+
V.value = e.target.value, H.value = "";
|
|
94
|
+
let t = V.value.trim().replace(/^#?/, "").length === 6 ? J(V.value) : null;
|
|
95
|
+
t && (M.value = t);
|
|
96
|
+
}
|
|
97
|
+
function Z() {
|
|
98
|
+
let e = V.value.trim();
|
|
99
|
+
if (!e) return Y("");
|
|
100
|
+
let t = J(e);
|
|
101
|
+
t ? Y(t) : H.value = "Enter a hex colour such as #1c7c54 or #fff";
|
|
102
|
+
}
|
|
103
|
+
function Q(e) {
|
|
104
|
+
H.value = "";
|
|
105
|
+
let t = e.target.value.toLowerCase();
|
|
106
|
+
V.value = t, M.value = t;
|
|
107
|
+
}
|
|
108
|
+
function $(e) {
|
|
109
|
+
N("change", e.target.value.toLowerCase());
|
|
110
|
+
}
|
|
111
|
+
return v(M, (e) => {
|
|
112
|
+
J(V.value) !== J(e) && (V.value = e ?? "");
|
|
113
|
+
}), o({ focus: () => (j.swatchOnly ? B.value : z.value)?.focus() }), (t, o) => (u(), r("div", s(L.value, {
|
|
114
|
+
class: [a.swatchOnly ? "w-fit" : "w-full", a.disabled && "opacity-50"],
|
|
115
|
+
"data-ac-ds": "",
|
|
116
|
+
"data-testid": "ac-color-input"
|
|
117
|
+
}), [
|
|
118
|
+
a.label ? (u(), r("label", {
|
|
119
|
+
key: 0,
|
|
120
|
+
for: a.swatchOnly ? `${m(F)}-picker` : m(F),
|
|
121
|
+
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
122
|
+
}, [
|
|
123
|
+
i("span", null, p(a.label), 1),
|
|
124
|
+
a.readonly ? (u(), r("span", x, "(read only)")) : n("", !0),
|
|
125
|
+
a.required ? (u(), r("span", S, "*")) : n("", !0)
|
|
126
|
+
], 8, b)) : n("", !0),
|
|
127
|
+
a.hint ? (u(), r("p", {
|
|
128
|
+
key: 1,
|
|
129
|
+
id: `${m(F)}-hint`,
|
|
130
|
+
class: "mb-2 text-base text-muted"
|
|
131
|
+
}, p(a.hint), 9, C)) : n("", !0),
|
|
132
|
+
a.swatchOnly ? (u(), r("input", s({
|
|
133
|
+
key: 2,
|
|
134
|
+
id: `${m(F)}-picker`,
|
|
135
|
+
ref_key: "picker",
|
|
136
|
+
ref: B
|
|
137
|
+
}, R.value, {
|
|
138
|
+
type: "color",
|
|
139
|
+
value: U.value ?? "#000000",
|
|
140
|
+
name: a.name,
|
|
141
|
+
disabled: W.value,
|
|
142
|
+
required: a.required,
|
|
143
|
+
"aria-label": a.label ? void 0 : R.value["aria-label"] ?? "Colour",
|
|
144
|
+
"aria-invalid": !!G.value || void 0,
|
|
145
|
+
"aria-describedby": K.value,
|
|
146
|
+
class: ["block cursor-pointer rounded-6 border-2 bg-background text-heading transition-all duration-200 focus:border-primary/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface disabled:cursor-not-allowed motion-reduce:transition-none", [a.size === "small" ? "size-10" : "size-12", G.value ? "border-danger/50" : "border-border"]],
|
|
147
|
+
"data-testid": "ac-color-input-swatch",
|
|
148
|
+
onInput: Q,
|
|
149
|
+
onChange: $
|
|
150
|
+
}), null, 16, w)) : (u(), r("div", {
|
|
151
|
+
key: 3,
|
|
152
|
+
class: c(["relative flex min-w-0 items-center rounded-10 border transition-[border-color,box-shadow,background-color] duration-200", [
|
|
153
|
+
a.size === "small" ? "h-9" : "h-10.5",
|
|
154
|
+
a.readonly ? "bg-surface-muted" : "bg-background",
|
|
155
|
+
G.value ? "border-danger/50 focus-within:border-danger focus-within:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus-within:focus-ring", !a.disabled && "hover:border-accent-active"]
|
|
156
|
+
]])
|
|
157
|
+
}, [i("span", {
|
|
158
|
+
class: c(["relative ml-1 shrink-0 overflow-hidden rounded-8 border-2 border-border has-[input:focus-visible]:ring-2 has-[input:focus-visible]:ring-ring has-[input:focus-visible]:ring-offset-1 has-[input:focus-visible]:ring-offset-surface", [a.size === "small" ? "size-7" : "size-8", !U.value && "bg-surface-sunken"]]),
|
|
159
|
+
style: l(U.value ? { backgroundColor: U.value } : void 0),
|
|
160
|
+
"data-testid": "ac-color-input-swatch"
|
|
161
|
+
}, [i("input", {
|
|
162
|
+
type: "color",
|
|
163
|
+
value: U.value ?? "#000000",
|
|
164
|
+
disabled: W.value,
|
|
165
|
+
"aria-label": a.label ? `${a.label}: open colour picker` : "Open colour picker",
|
|
166
|
+
class: "absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
167
|
+
onInput: Q,
|
|
168
|
+
onChange: $
|
|
169
|
+
}, null, 40, T)], 6), i("input", s({
|
|
170
|
+
id: m(F),
|
|
171
|
+
ref_key: "input",
|
|
172
|
+
ref: z
|
|
173
|
+
}, R.value, {
|
|
174
|
+
type: "text",
|
|
175
|
+
autocomplete: "off",
|
|
176
|
+
spellcheck: "false",
|
|
177
|
+
maxlength: "7",
|
|
178
|
+
value: V.value,
|
|
179
|
+
name: a.name,
|
|
180
|
+
disabled: a.disabled,
|
|
181
|
+
readonly: a.readonly,
|
|
182
|
+
required: a.required,
|
|
183
|
+
"aria-invalid": !!G.value || void 0,
|
|
184
|
+
"aria-describedby": K.value,
|
|
185
|
+
class: ["block h-full w-full min-w-0 flex-1 rounded-10 bg-transparent pl-2.5 font-mono text-base font-normal text-heading outline-none placeholder:font-sans placeholder:text-muted/80 disabled:cursor-not-allowed", a.size === "small" ? "pr-3" : "pr-4"],
|
|
186
|
+
onInput: X,
|
|
187
|
+
onBlur: Z,
|
|
188
|
+
onKeydown: y(Z, ["enter"])
|
|
189
|
+
}), null, 16, E)], 2)),
|
|
190
|
+
q.value.length ? (u(), r("div", {
|
|
191
|
+
key: 4,
|
|
192
|
+
class: "mt-2.5 flex flex-wrap gap-2",
|
|
193
|
+
role: "group",
|
|
194
|
+
"aria-label": a.label ? `${a.label} presets` : "Presets"
|
|
195
|
+
}, [(u(!0), r(e, null, f(q.value, (e) => (u(), r("button", {
|
|
196
|
+
key: e.value,
|
|
197
|
+
type: "button",
|
|
198
|
+
class: c(["size-6 shrink-0 rounded-full border border-border transition-[box-shadow,transform] duration-200 hover:scale-110 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:hover:scale-100 motion-reduce:transition-none motion-reduce:hover:scale-100", [e.value === U.value && "ring-2 ring-primary ring-offset-2 ring-offset-surface", !W.value && "cursor-pointer"]]),
|
|
199
|
+
style: l({ backgroundColor: e.value }),
|
|
200
|
+
disabled: W.value,
|
|
201
|
+
"aria-label": e.label,
|
|
202
|
+
"aria-pressed": e.value === U.value,
|
|
203
|
+
title: e.label,
|
|
204
|
+
"data-testid": "ac-color-input-preset",
|
|
205
|
+
onClick: (t) => Y(e.value)
|
|
206
|
+
}, null, 14, O))), 128))], 8, D)) : n("", !0),
|
|
207
|
+
G.value ? (u(), r("p", {
|
|
208
|
+
key: 5,
|
|
209
|
+
id: `${m(F)}-msg`,
|
|
210
|
+
class: "mt-1 text-base text-danger-strong",
|
|
211
|
+
role: "alert"
|
|
212
|
+
}, p(G.value), 9, k)) : n("", !0)
|
|
213
|
+
], 16));
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
//#endregion
|
|
217
|
+
export { A as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** The commands or text to show and copy. An array is joined with line breaks. */
|
|
3
|
+
commands: string | string[];
|
|
4
|
+
/** A line above the block saying where to run it, e.g. "On the machine that runs the tunnel:". */
|
|
5
|
+
caption?: string;
|
|
6
|
+
/** What the block holds, read by screen readers in "Copy commands" and "Copied commands". */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Masks the text with dots until the viewer clicks the eye button, for passwords and tokens. Copy still copies the real value. */
|
|
9
|
+
secret?: boolean;
|
|
10
|
+
/** Tallest the block grows before it scrolls, as a CSS length, e.g. `"240px"`. Leave empty to show everything. */
|
|
11
|
+
maxHeight?: string;
|
|
12
|
+
}
|
|
13
|
+
type __VLS_Slots = {
|
|
14
|
+
/** Extra buttons next to Copy, e.g. a "Download script" link. Use small, quiet buttons. */
|
|
15
|
+
actions?: () => unknown;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
copy: (text: string) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
20
|
+
onCopy?: ((text: string) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
caption: string;
|
|
23
|
+
label: string;
|
|
24
|
+
maxHeight: string;
|
|
25
|
+
secret: boolean;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { copyText as e } from "../composables/copyText.js";
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, normalizeStyle as c, onBeforeUnmount as l, openBlock as u, ref as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, useId as g } from "vue";
|
|
3
|
+
import { Check as _, Copy as v, Eye as y, EyeOff as b } from "@lucide/vue";
|
|
4
|
+
//#region src/lib/components/AcCommandBlock.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var x = {
|
|
6
|
+
"data-ac-ds": "",
|
|
7
|
+
"data-testid": "ac-command-block"
|
|
8
|
+
}, S = ["id"], C = { class: "relative" }, w = ["aria-describedby", "aria-label"], T = { class: "absolute top-2 right-2 flex items-center gap-1 rounded-8 bg-background" }, E = ["aria-label", "aria-pressed"], D = { class: "sr-only" }, O = {
|
|
9
|
+
class: "sr-only",
|
|
10
|
+
role: "status"
|
|
11
|
+
}, k = /*@__PURE__*/ s({
|
|
12
|
+
__name: "AcCommandBlock",
|
|
13
|
+
props: {
|
|
14
|
+
commands: {},
|
|
15
|
+
caption: { default: "" },
|
|
16
|
+
label: { default: "commands" },
|
|
17
|
+
secret: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
maxHeight: { default: "" }
|
|
22
|
+
},
|
|
23
|
+
emits: ["copy"],
|
|
24
|
+
setup(s, { emit: k }) {
|
|
25
|
+
let A = s, j = k, M = g(), N = d(!1), P = d(!1), F = d(!1), I, L = t(() => Array.isArray(A.commands) ? A.commands.join("\n") : A.commands), R = t(() => A.secret && !F.value ? L.value.replace(/[^\n]/g, "•") : L.value), z = t(() => N.value ? `Copied ${A.label}` : P.value ? "Copy failed. Select the text and copy it by hand." : "");
|
|
26
|
+
async function B() {
|
|
27
|
+
clearTimeout(I);
|
|
28
|
+
try {
|
|
29
|
+
await e(L.value), N.value = !0, P.value = !1, j("copy", L.value);
|
|
30
|
+
} catch {
|
|
31
|
+
P.value = !0;
|
|
32
|
+
}
|
|
33
|
+
I = setTimeout(() => {
|
|
34
|
+
N.value = !1, P.value = !1;
|
|
35
|
+
}, 2e3);
|
|
36
|
+
}
|
|
37
|
+
return l(() => clearTimeout(I)), (e, t) => (u(), i("div", x, [s.caption ? (u(), i("p", {
|
|
38
|
+
key: 0,
|
|
39
|
+
id: `${h(M)}-caption`,
|
|
40
|
+
class: "mb-1.5 text-xs text-muted"
|
|
41
|
+
}, m(s.caption), 9, S)) : r("", !0), a("div", C, [
|
|
42
|
+
a("pre", {
|
|
43
|
+
class: "ac-scrollbar overflow-auto rounded-10 border border-border bg-background/60 p-3 pr-28 font-mono text-xs leading-relaxed whitespace-pre text-heading",
|
|
44
|
+
style: c(s.maxHeight ? { maxHeight: s.maxHeight } : void 0),
|
|
45
|
+
"aria-describedby": s.caption ? `${h(M)}-caption` : void 0,
|
|
46
|
+
"aria-label": s.secret && !F.value ? `${s.label} (hidden)` : void 0,
|
|
47
|
+
tabindex: "0",
|
|
48
|
+
"data-testid": "ac-command-block-text"
|
|
49
|
+
}, m(R.value), 13, w),
|
|
50
|
+
a("div", T, [
|
|
51
|
+
f(e.$slots, "actions"),
|
|
52
|
+
s.secret ? (u(), i("button", {
|
|
53
|
+
key: 0,
|
|
54
|
+
type: "button",
|
|
55
|
+
class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-8 border border-border bg-surface text-muted transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
56
|
+
"aria-label": F.value ? `Hide ${s.label}` : `Show ${s.label}`,
|
|
57
|
+
"aria-pressed": F.value,
|
|
58
|
+
"data-testid": "ac-command-block-reveal",
|
|
59
|
+
onClick: t[0] ||= (e) => F.value = !F.value
|
|
60
|
+
}, [(u(), n(p(F.value ? h(b) : h(y)), {
|
|
61
|
+
class: "size-3.5",
|
|
62
|
+
"aria-hidden": "true"
|
|
63
|
+
}))], 8, E)) : r("", !0),
|
|
64
|
+
a("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
class: "group inline-flex h-6 cursor-pointer items-center gap-1 rounded-8 border border-border bg-surface px-1.5 text-xs text-muted transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
67
|
+
"data-testid": "ac-command-block-copy",
|
|
68
|
+
onClick: B
|
|
69
|
+
}, [
|
|
70
|
+
N.value ? (u(), n(h(_), {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "size-3.5 text-primary",
|
|
73
|
+
"aria-hidden": "true"
|
|
74
|
+
})) : (u(), n(h(v), {
|
|
75
|
+
key: 1,
|
|
76
|
+
class: "size-3.5",
|
|
77
|
+
"aria-hidden": "true"
|
|
78
|
+
})),
|
|
79
|
+
o(" " + m(N.value ? "Copied" : "Copy"), 1),
|
|
80
|
+
a("span", D, m(s.label), 1)
|
|
81
|
+
])
|
|
82
|
+
]),
|
|
83
|
+
a("span", O, m(z.value), 1)
|
|
84
|
+
])]));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//#endregion
|
|
88
|
+
export { k as default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import type { Tone } from "./types";
|
|
3
|
+
export interface Props {
|
|
4
|
+
/** Heading that names the action, e.g. "Restart database". */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** What happens if the viewer confirms. The default slot replaces it for rich text. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Label of the confirm button. Name the action: "Restart", "Revoke token". */
|
|
9
|
+
confirmLabel?: string;
|
|
10
|
+
/** Same as `confirmLabel`; the name cloud-ui's ConfirmModal and AcDeleteModal use. Wins when both are set. */
|
|
11
|
+
confirmText?: string;
|
|
12
|
+
/** Label of the cancel button. */
|
|
13
|
+
cancelLabel?: string;
|
|
14
|
+
/** Colour of the soft confirm button and the icon tile. Defaults to `danger`, as cloud-ui's ConfirmModal (its `error`); pass `primary` for safe actions. */
|
|
15
|
+
color?: Tone;
|
|
16
|
+
/** Shows a spinner on the confirm button, disables Cancel and blocks closing while the request runs. cloud-ui's `is-loading`. */
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
/** A Lucide icon shown in a 32px tile tinted with `color`, beside the description. */
|
|
19
|
+
icon?: Component;
|
|
20
|
+
}
|
|
21
|
+
type __VLS_Props = Props;
|
|
22
|
+
type __VLS_Slots = {
|
|
23
|
+
/** Rich description, e.g. with the resource name in `<strong>`. Replaces `description`. */
|
|
24
|
+
default?: () => unknown;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_ModelProps = {
|
|
27
|
+
/** Whether the dialog is open. Bind with `v-model:open`. */
|
|
28
|
+
"open"?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
31
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
"update:open": (value: boolean) => any;
|
|
33
|
+
cancel: () => any;
|
|
34
|
+
confirm: () => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
37
|
+
onCancel?: (() => any) | undefined;
|
|
38
|
+
onConfirm?: (() => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
title: string;
|
|
41
|
+
description: string;
|
|
42
|
+
icon: Component;
|
|
43
|
+
color: Tone;
|
|
44
|
+
loading: boolean;
|
|
45
|
+
confirmLabel: string;
|
|
46
|
+
confirmText: string;
|
|
47
|
+
cancelLabel: string;
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
52
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
53
|
+
new (): {
|
|
54
|
+
$slots: S;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import e from "./AcButton.js";
|
|
2
|
+
import t from "./AcModal.js";
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, openBlock as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, useModel as h, withCtx as g } from "vue";
|
|
4
|
+
//#region src/lib/components/AcConfirmModal.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _ = {
|
|
6
|
+
class: "flex items-start gap-4",
|
|
7
|
+
"data-ac-ds": "",
|
|
8
|
+
"data-testid": "ac-confirm-modal"
|
|
9
|
+
}, v = /*@__PURE__*/ c({
|
|
10
|
+
__name: "AcConfirmModal",
|
|
11
|
+
props: /*@__PURE__*/ l({
|
|
12
|
+
title: { default: "Confirm action" },
|
|
13
|
+
description: { default: "" },
|
|
14
|
+
confirmLabel: { default: "Confirm" },
|
|
15
|
+
confirmText: { default: "" },
|
|
16
|
+
cancelLabel: { default: "Cancel" },
|
|
17
|
+
color: { default: "danger" },
|
|
18
|
+
loading: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
icon: { default: void 0 }
|
|
23
|
+
}, {
|
|
24
|
+
open: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
openModifiers: {}
|
|
29
|
+
}),
|
|
30
|
+
emits: /*@__PURE__*/ l(["confirm", "cancel"], ["update:open"]),
|
|
31
|
+
setup(c, { emit: l }) {
|
|
32
|
+
let v = c, y = h(c, "open"), b = l, x = {
|
|
33
|
+
primary: "border-primary/25 bg-primary/10 text-primary-strong",
|
|
34
|
+
info: "border-info/25 bg-info/10 text-info-strong",
|
|
35
|
+
success: "border-success/25 bg-success/10 text-success-strong",
|
|
36
|
+
warning: "border-warning/30 bg-warning/10 text-warning-strong",
|
|
37
|
+
danger: "border-danger/25 bg-danger/10 text-danger-strong"
|
|
38
|
+
}, S = n(() => v.confirmText || v.confirmLabel), C = n(() => v.color === "danger");
|
|
39
|
+
function w() {
|
|
40
|
+
y.value = !1, b("cancel");
|
|
41
|
+
}
|
|
42
|
+
return (n, l) => (d(), r(t, {
|
|
43
|
+
open: y.value,
|
|
44
|
+
"onUpdate:open": l[1] ||= (e) => y.value = e,
|
|
45
|
+
title: c.title,
|
|
46
|
+
size: "small",
|
|
47
|
+
variant: "plain",
|
|
48
|
+
closable: !c.loading,
|
|
49
|
+
"close-on-outside-click": !c.loading,
|
|
50
|
+
onClose: l[2] ||= (e) => b("cancel")
|
|
51
|
+
}, {
|
|
52
|
+
footer: g(() => [s(e, {
|
|
53
|
+
title: c.cancelLabel,
|
|
54
|
+
variant: "light",
|
|
55
|
+
size: "medium",
|
|
56
|
+
disabled: c.loading,
|
|
57
|
+
autofocus: C.value || void 0,
|
|
58
|
+
"data-ac-ds": "",
|
|
59
|
+
"data-testid": "ac-confirm-modal-cancel",
|
|
60
|
+
onClick: w
|
|
61
|
+
}, null, 8, [
|
|
62
|
+
"title",
|
|
63
|
+
"disabled",
|
|
64
|
+
"autofocus"
|
|
65
|
+
]), s(e, {
|
|
66
|
+
title: S.value,
|
|
67
|
+
color: c.color,
|
|
68
|
+
variant: "light",
|
|
69
|
+
size: "medium",
|
|
70
|
+
loading: c.loading,
|
|
71
|
+
autofocus: !C.value || void 0,
|
|
72
|
+
"data-ac-ds": "",
|
|
73
|
+
"data-testid": "ac-confirm-modal-confirm",
|
|
74
|
+
onClick: l[0] ||= (e) => b("confirm")
|
|
75
|
+
}, null, 8, [
|
|
76
|
+
"title",
|
|
77
|
+
"color",
|
|
78
|
+
"loading",
|
|
79
|
+
"autofocus"
|
|
80
|
+
])]),
|
|
81
|
+
default: g(() => [o("div", _, [c.icon ? (d(), a("span", {
|
|
82
|
+
key: 0,
|
|
83
|
+
class: u(["inline-flex size-8 shrink-0 items-center justify-center rounded-10 border", x[c.color]]),
|
|
84
|
+
"aria-hidden": "true"
|
|
85
|
+
}, [(d(), r(p(c.icon), { class: "size-4" }))], 2)) : i("", !0), o("div", { class: u(["min-w-0 flex-1 text-lg text-muted [&_strong]:font-semibold [&_strong]:text-heading", c.icon && "pt-1"]) }, [f(n.$slots, "default", {}, () => [o("p", null, m(c.description), 1)])], 2)])]),
|
|
86
|
+
_: 3
|
|
87
|
+
}, 8, [
|
|
88
|
+
"open",
|
|
89
|
+
"title",
|
|
90
|
+
"closable",
|
|
91
|
+
"close-on-outside-click"
|
|
92
|
+
]));
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
//#endregion
|
|
96
|
+
export { v as default };
|
|
@@ -7,7 +7,7 @@ export interface Props {
|
|
|
7
7
|
bordered?: boolean;
|
|
8
8
|
}
|
|
9
9
|
type __VLS_Slots = {
|
|
10
|
-
/**
|
|
10
|
+
/** A 16px Lucide icon before the title, shown in a tinted 32px tile. */
|
|
11
11
|
icon?: () => unknown;
|
|
12
12
|
/** Right after the title, e.g. a count badge or info tooltip. */
|
|
13
13
|
"title-actions"?: () => unknown;
|