@sparklingopinions/sparkling-ui 0.14.0 → 0.15.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.
Files changed (99) hide show
  1. package/README.md +1 -1
  2. package/dist/aliases.d.ts +4 -0
  3. package/dist/components/ActionBar/ActionBar.js.map +1 -1
  4. package/dist/components/ActionBar/ActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
  5. package/dist/components/ActionBar/ActionBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  6. package/dist/components/Alert/Alert.js.map +1 -1
  7. package/dist/components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +1 -1
  8. package/dist/components/Alert/Alert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  9. package/dist/components/AlertDialog/AlertDialog.js.map +1 -1
  10. package/dist/components/AlertDialog/AlertDialog.vue_vue_type_script_setup_true_lang.js +5 -5
  11. package/dist/components/AlertDialog/AlertDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/Avatar/Avatar.js.map +1 -1
  13. package/dist/components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js +1 -1
  14. package/dist/components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  15. package/dist/components/Badge/Badge.js.map +1 -1
  16. package/dist/components/Badge/Badge.vue_vue_type_script_setup_true_lang.js +1 -1
  17. package/dist/components/Badge/Badge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  18. package/dist/components/Board/Board.js.map +1 -1
  19. package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js +5 -5
  20. package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/components/Button/Button.js.map +1 -1
  22. package/dist/components/Button/Button.vue_vue_type_script_setup_true_lang.js +23 -22
  23. package/dist/components/Button/Button.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/Calendar/Calendar.js.map +1 -1
  25. package/dist/components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +3 -3
  26. package/dist/components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  27. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  28. package/dist/components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
  29. package/dist/components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/DataList/DataList.js.map +1 -1
  31. package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js +103 -103
  32. package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/components/Dialog/ContextSeparator.js +19 -0
  34. package/dist/components/Dialog/ContextSeparator.js.map +1 -0
  35. package/dist/components/Dialog/ContextSeparator.vue.d.ts +3 -0
  36. package/dist/components/Dialog/Dialog.js.map +1 -1
  37. package/dist/components/Dialog/Dialog.vue.d.ts +16 -11
  38. package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js +130 -119
  39. package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/Dialog/focus.d.ts +2 -0
  41. package/dist/components/Dialog/focus.js +2 -2
  42. package/dist/components/Dialog/focus.js.map +1 -1
  43. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  44. package/dist/components/EmptyState/EmptyState.vue_vue_type_script_setup_true_lang.js +1 -1
  45. package/dist/components/EmptyState/EmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/components/Filters/FilterChip.js.map +1 -1
  47. package/dist/components/Filters/FilterChip.vue_vue_type_script_setup_true_lang.js +7 -7
  48. package/dist/components/Filters/FilterChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/components/Filters/FilterFrame.js.map +1 -1
  50. package/dist/components/Filters/FilterFrame.vue_vue_type_script_setup_true_lang.js +1 -1
  51. package/dist/components/Filters/FilterFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  52. package/dist/components/Filters/FilterMenu.js.map +1 -1
  53. package/dist/components/Filters/FilterMenu.vue_vue_type_script_setup_true_lang.js +3 -3
  54. package/dist/components/Filters/FilterMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  55. package/dist/components/Filters/SortMenu.js.map +1 -1
  56. package/dist/components/Filters/SortMenu.vue_vue_type_script_setup_true_lang.js +7 -7
  57. package/dist/components/Filters/SortMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/components/Input/Input.js.map +1 -1
  59. package/dist/components/Input/Input.vue_vue_type_script_setup_true_lang.js +1 -1
  60. package/dist/components/Input/Input.vue_vue_type_script_setup_true_lang.js.map +1 -1
  61. package/dist/components/Kbd/Kbd.js +1 -1
  62. package/dist/components/Kbd/Kbd.js.map +1 -1
  63. package/dist/components/Pagination/Pagination.js.map +1 -1
  64. package/dist/components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +1 -1
  65. package/dist/components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  66. package/dist/components/Popover/Popover.js.map +1 -1
  67. package/dist/components/Popover/Popover.vue_vue_type_script_setup_true_lang.js +1 -1
  68. package/dist/components/Popover/Popover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/components/Popover/PopoverDialog.js.map +1 -1
  70. package/dist/components/Popover/PopoverDialog.vue_vue_type_script_setup_true_lang.js +1 -1
  71. package/dist/components/Popover/PopoverDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/PropertyList/Editable.js.map +1 -1
  73. package/dist/components/PropertyList/Editable.vue_vue_type_script_setup_true_lang.js +2 -2
  74. package/dist/components/PropertyList/Editable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  75. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  76. package/dist/components/SegmentedControl/SegmentedControl.vue_vue_type_script_setup_true_lang.js +2 -2
  77. package/dist/components/SegmentedControl/SegmentedControl.vue_vue_type_script_setup_true_lang.js.map +1 -1
  78. package/dist/components/Select/Select.js.map +1 -1
  79. package/dist/components/Select/Select.vue_vue_type_script_setup_true_lang.js +4 -4
  80. package/dist/components/Select/Select.vue_vue_type_script_setup_true_lang.js.map +1 -1
  81. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  82. package/dist/components/Skeleton/Skeleton.vue_vue_type_script_setup_true_lang.js +1 -1
  83. package/dist/components/Skeleton/Skeleton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  84. package/dist/components/Table/Table.js.map +1 -1
  85. package/dist/components/Table/Table.vue_vue_type_script_setup_true_lang.js +3 -3
  86. package/dist/components/Table/Table.vue_vue_type_script_setup_true_lang.js.map +1 -1
  87. package/dist/components/Tag/Tag.js.map +1 -1
  88. package/dist/components/Tag/Tag.vue_vue_type_script_setup_true_lang.js +3 -3
  89. package/dist/components/Tag/Tag.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/Textarea/Textarea.js.map +1 -1
  91. package/dist/components/Textarea/Textarea.vue.d.ts +3 -0
  92. package/dist/components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +7 -2
  93. package/dist/components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  94. package/dist/components/internal/menu.d.ts +2 -2
  95. package/dist/components/internal/menu.js +1 -1
  96. package/dist/components/internal/menu.js.map +1 -1
  97. package/dist/index.js +15 -15
  98. package/package.json +1 -1
  99. package/src/styles/tailwind.css +74 -12
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","names":["_sfc_main","Dialog_vue_vue_type_script_setup_true_lang_default","Dialog_default"],"sources":["../../../src/components/Dialog/Dialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, ref, useSlots, useTemplateRef, watch } from 'vue'\n\nimport { DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTitle } from 'reka-ui'\n\nimport Button from '../Button/Button.vue'\nimport Icon from '../Icon/Icon.vue'\nimport Tooltip from '../Tooltip/Tooltip.vue'\nimport CloseIcon from '../internal/CloseIcon.vue'\nimport { focusFirst } from './focus'\nimport { useSheetDrag } from './useSheetDrag'\n\nexport interface DialogProps {\n title?: string\n /** The close button in the header. */\n closable?: boolean\n closeLabel?: string\n cancelLabel?: string\n /** Shows the standard footer's confirm button, which emits `confirm`, as ⌘ or Ctrl Enter does. */\n confirmLabel?: string\n confirmIcon?: string\n confirmVariant?: 'primary' | 'danger' | 'contrast'\n confirmDisabled?: boolean\n /** sm 432px, md 512px, record 520px (the default with a band), lg 672px, xl 768px. */\n size?: 'sm' | 'md' | 'record' | 'lg' | 'xl'\n /** A record form's tinted header band: a CSS colour such as `rgb(var(--sui-hue-blue-soft))`, or `true` for the accent\n * wash. The `hero` slot sits centred in it. */\n band?: string | boolean\n /** Muted text at the footer's start, e.g. `saveHint()`. */\n hint?: string\n /** The body draws its own header, edge to edge. */\n headerless?: boolean\n /** sheet: a bottom sheet with a grab handle, drag to dismiss and a full-width confirm. auto: a sheet on a viewport\n * narrower than `sheetBelow`, a dialog otherwise. A sheet draws no Cancel and no band: dragging it down, the\n * scrim and Escape cancel. */\n presentation?: 'dialog' | 'sheet' | 'auto'\n /** The width in px below which `auto` is a sheet. */\n sheetBelow?: number\n}\n\nconst props = withDefaults(defineProps<DialogProps>(), {\n title: undefined,\n closable: true,\n closeLabel: 'Close',\n cancelLabel: 'Cancel',\n confirmLabel: undefined,\n confirmIcon: undefined,\n confirmVariant: 'primary',\n size: undefined,\n band: undefined,\n hint: undefined,\n presentation: 'dialog',\n sheetBelow: 640\n})\n\nconst emit = defineEmits<{ confirm: []; cancel: [] }>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\nconst slots = useSlots()\nconst hasFooter = computed(() => !!slots.footer || !!props.confirmLabel)\nconst banded = computed(() => !!props.band || !!slots.hero)\n\nconst sizes = {\n sm: 'max-w-[27rem]',\n md: 'max-w-lg',\n record: 'max-w-130',\n lg: 'max-w-2xl',\n xl: 'max-w-3xl'\n}\nconst width = computed(() => sizes[props.size ?? (banded.value ? 'record' : 'md')])\nconst bandColour = computed(() => (typeof props.band === 'string' ? props.band : 'rgb(var(--sui-accent-wash))'))\n\nconst narrow = ref(false)\nlet query: MediaQueryList | undefined\nconst onQuery = () => (narrow.value = !!query?.matches)\nwatch(\n () => [props.presentation, props.sheetBelow] as const,\n ([presentation, below]) => {\n query?.removeEventListener('change', onQuery)\n query =\n presentation === 'auto' && typeof window !== 'undefined'\n ? window.matchMedia(`(max-width: ${below - 0.02}px)`)\n : undefined\n query?.addEventListener('change', onQuery)\n onQuery()\n },\n { immediate: true }\n)\nonBeforeUnmount(() => query?.removeEventListener('change', onQuery))\n\nconst sheet = computed(() => props.presentation === 'sheet' || (props.presentation === 'auto' && narrow.value))\nconst panel = useTemplateRef<InstanceType<typeof DialogContent>>('panel')\nconst drag = useSheetDrag(\n computed(() => panel.value?.$el as HTMLElement | undefined),\n () => cancel()\n)\nwatch(open, (isOpen) => isOpen && drag.reset())\n\nconst iconColours = { primary: 'on-accent', danger: 'on-danger', contrast: 'on-contrast' } as const\n\nfunction cancel() {\n emit('cancel')\n open.value = false\n}\n\n// A sheet closes on a tap on the scrim; a dialog only from its buttons and Escape.\nfunction onOutside(event: Event) {\n if (sheet.value) emit('cancel')\n else event.preventDefault()\n}\n\nfunction confirmFromKeyboard(event: KeyboardEvent) {\n if (!event.metaKey && !event.ctrlKey) return\n event.preventDefault()\n if (props.confirmLabel && !props.confirmDisabled) emit('confirm')\n}\n</script>\n\n<!-- The one dialog: a header, body and canvas footer; or, with a `band` or `hero`, a record form under a tinted band; or\n a bottom sheet. -->\n<template>\n <DialogRoot v-model:open=\"open\">\n <DialogPortal>\n <DialogOverlay\n class=\"fixed inset-0 z-[1100] flex justify-center bg-sui-scrim/40 backdrop-blur-[4px] data-[state=closed]:animate-sui-scrim-out data-[state=open]:animate-sui-scrim-in\"\n :class=\"sheet ? 'items-end' : 'items-center'\"\n >\n <DialogContent\n v-if=\"sheet\"\n ref=\"panel\"\n :aria-describedby=\"undefined\"\n class=\"relative flex max-h-[calc(100dvh-1.5rem)] w-full flex-col rounded-t-(--sui-radius-sheet) bg-sui-surface shadow-xl outline-hidden data-[state=closed]:animate-sui-sheet-out data-[state=open]:animate-sui-sheet-in motion-reduce:animate-none motion-reduce:transition-none\"\n :class=\"!drag.dragging.value && 'transition-transform duration-[250ms] ease-[cubic-bezier(0.32,0.72,0,1)]'\"\n :style=\"drag.style.value\"\n @escape-key-down=\"emit('cancel')\"\n @interact-outside=\"onOutside\"\n @keydown.enter=\"confirmFromKeyboard\"\n @open-auto-focus=\"focusFirst\"\n >\n <!-- Without a close button, keyboard and screen-reader users still get one: it shows when focused. -->\n <button\n v-if=\"!closable\"\n class=\"pointer-events-none absolute top-2 right-3 h-7 rounded-md bg-sui-sunken px-2.5 text-13 font-medium text-sui-ink opacity-0 outline-hidden focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:sui-ring\"\n type=\"button\"\n @click=\"cancel\"\n >\n {{ closeLabel }}\n </button>\n <div class=\"shrink-0 cursor-grab touch-none pt-2\" data-modal-header v-bind=\"drag.handlers\">\n <span aria-hidden=\"true\" class=\"mx-auto block h-1 w-9 rounded-full bg-sui-mark-faint\" />\n <div v-if=\"!headerless\" class=\"flex min-h-11 items-center justify-between gap-3 pt-2 pr-4 pb-1 pl-5\">\n <DialogTitle class=\"min-w-0 truncate text-base font-semibold text-sui-ink\">\n <slot name=\"title\">{{ title }}</slot>\n </DialogTitle>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-subtle stroke-sui-ink-subtle\" />\n </Button>\n </Tooltip>\n </div>\n <DialogTitle v-else class=\"sr-only\">{{ title }}</DialogTitle>\n </div>\n\n <div\n class=\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 pt-2 pb-5 text-sm leading-5 text-sui-ink-emphasis\"\n data-modal-body\n >\n <slot />\n </div>\n\n <div\n v-if=\"hasFooter\"\n class=\"flex shrink-0 flex-col gap-2.5 border-t border-sui-line-subtle bg-sui-surface px-4 pt-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]\"\n data-modal-footer\n >\n <slot name=\"footer\">\n <div v-if=\"$slots['footer-start'] || hint\" class=\"flex min-w-0 items-center justify-center gap-2\">\n <slot name=\"footer-start\" />\n <span v-if=\"hint\" class=\"min-w-0 truncate text-xs text-sui-ink-muted\">{{ hint }}</span>\n </div>\n <Button\n class=\"w-full\"\n :disabled=\"confirmDisabled\"\n size=\"lg\"\n type=\"button\"\n :variant=\"confirmVariant\"\n @click=\"emit('confirm')\"\n >\n <Icon v-if=\"confirmIcon\" :color=\"iconColours[confirmVariant]\" :name=\"confirmIcon\" />\n {{ confirmLabel }}\n </Button>\n </slot>\n </div>\n </DialogContent>\n <DialogContent\n v-else\n :aria-describedby=\"undefined\"\n class=\"flex max-h-[90vh] w-full flex-col bg-sui-surface shadow-xl outline-hidden data-[state=closed]:animate-sui-dialog-out data-[state=open]:animate-sui-dialog-in\"\n :class=\"[width, banded ? 'rounded-2xl' : 'rounded-xl']\"\n @escape-key-down=\"emit('cancel')\"\n @interact-outside.prevent\n @keydown.enter=\"confirmFromKeyboard\"\n @open-auto-focus=\"focusFirst\"\n >\n <div\n v-if=\"banded\"\n class=\"shrink-0 rounded-t-2xl pt-3.5 pr-3.5 pb-4.5 pl-5 transition-colors duration-200\"\n data-modal-header\n :style=\"{ backgroundColor: bandColour }\"\n >\n <div class=\"flex items-center justify-between gap-3\">\n <DialogTitle class=\"text-13 leading-5 font-medium text-sui-ink-body\">{{ title }}</DialogTitle>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </Button>\n </Tooltip>\n </div>\n <div v-if=\"$slots.hero\" class=\"mt-0.5 flex flex-col items-center gap-1.5 pr-1.5\">\n <slot name=\"hero\" />\n </div>\n </div>\n <div\n v-else-if=\"!headerless\"\n class=\"flex shrink-0 items-center justify-between gap-3 rounded-t-xl border-b border-sui-line-subtle bg-sui-surface px-5 py-4 text-sui-ink\"\n data-modal-header\n >\n <DialogTitle class=\"min-w-0 truncate text-base font-semibold text-sui-ink\">\n <slot name=\"title\">{{ title }}</slot>\n </DialogTitle>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-subtle stroke-sui-ink-subtle\" />\n </Button>\n </Tooltip>\n </div>\n <DialogTitle v-else class=\"sr-only\">{{ title }}</DialogTitle>\n\n <div\n class=\"overflow-y-auto bg-sui-surface text-sm text-sui-ink-emphasis\"\n :class=\"[banded ? 'px-5 pt-0.5 pb-4' : 'p-5', !hasFooter && (banded ? 'rounded-b-2xl' : 'rounded-b-xl')]\"\n data-modal-body\n >\n <slot />\n </div>\n\n <div\n v-if=\"hasFooter\"\n class=\"flex shrink-0 items-center border-t border-sui-line-subtle bg-sui-canvas text-sui-ink\"\n :class=\"banded ? 'gap-2 rounded-b-2xl py-3 pr-4 pl-5' : 'gap-3 rounded-b-xl px-5 py-4'\"\n data-modal-footer\n >\n <slot name=\"footer\">\n <slot name=\"footer-start\" />\n <span v-if=\"hint\" class=\"min-w-0 truncate text-xs text-sui-ink-muted\">{{ hint }}</span>\n <span class=\"flex-1\" />\n <Button type=\"button\" variant=\"ghost\" @click=\"cancel\">{{ cancelLabel }}</Button>\n <Button :disabled=\"confirmDisabled\" type=\"button\" :variant=\"confirmVariant\" @click=\"emit('confirm')\">\n <Icon v-if=\"confirmIcon\" :color=\"iconColours[confirmVariant]\" :name=\"confirmIcon\" />\n {{ confirmLabel }}\n </Button>\n </slot>\n </div>\n </DialogContent>\n </DialogOverlay>\n </DialogPortal>\n </DialogRoot>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Dialog.js","names":["_sfc_main","Dialog_vue_vue_type_script_setup_true_lang_default","Dialog_default"],"sources":["../../../src/components/Dialog/Dialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, ref, useSlots, useTemplateRef, watch } from 'vue'\n\nimport { DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTitle } from 'reka-ui'\n\nimport Button from '../Button/Button.vue'\nimport Icon from '../Icon/Icon.vue'\nimport Kbd from '../Kbd/Kbd.vue'\nimport Tooltip from '../Tooltip/Tooltip.vue'\nimport CloseIcon from '../internal/CloseIcon.vue'\nimport ContextSeparator from './ContextSeparator.vue'\nimport { focusFirst, modifierKey } from './focus'\nimport { useSheetDrag } from './useSheetDrag'\n\nexport interface DialogProps {\n title?: string\n /** The close button in the header. */\n closable?: boolean\n closeLabel?: string\n /** @deprecated A dialog has no Cancel button: Escape and the close button cancel. Kept so existing calls compile. */\n cancelLabel?: string\n /** Shows the standard footer's confirm button, which emits `confirm`, as ⌘ or Ctrl Enter does. */\n confirmLabel?: string\n confirmIcon?: string\n confirmVariant?: 'primary' | 'danger' | 'contrast'\n confirmDisabled?: boolean\n /** sm 432px, md 512px, record 520px (the default with a band), lg 672px, xl 768px. */\n size?: 'sm' | 'md' | 'record' | 'lg' | 'xl'\n /** A record form's tinted header band: a CSS colour such as `rgb(var(--sui-hue-blue-soft))`, or `true` for the accent\n * wash. The `hero` slot sits centred in it. */\n band?: string | boolean\n /** Muted text at the footer's start. The ⌘ or Ctrl Enter shortcut is drawn by the dialog next to its confirm. */\n hint?: string\n /** The body draws its own header, edge to edge. */\n headerless?: boolean\n /** sheet: a bottom sheet with a grab handle, drag to dismiss and a full-width confirm. auto: a sheet on a viewport\n * narrower than `sheetBelow`, a dialog otherwise. A sheet draws no Cancel and no band: dragging it down, the\n * scrim and Escape cancel. */\n presentation?: 'dialog' | 'sheet' | 'auto'\n /** The width in px below which `auto` is a sheet. */\n sheetBelow?: number\n}\n\nconst props = withDefaults(defineProps<DialogProps>(), {\n title: undefined,\n closable: true,\n closeLabel: 'Close',\n cancelLabel: 'Cancel',\n confirmLabel: undefined,\n confirmIcon: undefined,\n confirmVariant: 'primary',\n size: undefined,\n band: undefined,\n hint: undefined,\n presentation: 'dialog',\n sheetBelow: 640\n})\n\nconst emit = defineEmits<{ confirm: []; cancel: [] }>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\nconst slots = useSlots()\nconst hasContext = computed(() => !!slots.context)\nconst modKey = modifierKey()\nconst hasFooter = computed(() => !!slots.footer || !!props.confirmLabel)\nconst banded = computed(() => !!props.band || !!slots.hero)\n\nconst sizes = {\n sm: 'max-w-[27rem]',\n md: 'max-w-lg',\n record: 'max-w-130',\n lg: 'max-w-2xl',\n xl: 'max-w-3xl'\n}\nconst width = computed(() => sizes[props.size ?? (banded.value ? 'record' : 'md')])\nconst bandColour = computed(() => (typeof props.band === 'string' ? props.band : 'rgb(var(--sui-accent-wash))'))\n\nconst narrow = ref(false)\nlet query: MediaQueryList | undefined\nconst onQuery = () => (narrow.value = !!query?.matches)\nwatch(\n () => [props.presentation, props.sheetBelow] as const,\n ([presentation, below]) => {\n query?.removeEventListener('change', onQuery)\n query =\n presentation === 'auto' && typeof window !== 'undefined'\n ? window.matchMedia(`(max-width: ${below - 0.02}px)`)\n : undefined\n query?.addEventListener('change', onQuery)\n onQuery()\n },\n { immediate: true }\n)\nonBeforeUnmount(() => query?.removeEventListener('change', onQuery))\n\nconst sheet = computed(() => props.presentation === 'sheet' || (props.presentation === 'auto' && narrow.value))\nconst panel = useTemplateRef<InstanceType<typeof DialogContent>>('panel')\nconst drag = useSheetDrag(\n computed(() => panel.value?.$el as HTMLElement | undefined),\n () => cancel()\n)\nwatch(open, (isOpen) => isOpen && drag.reset())\n\nconst iconColours = { primary: 'on-accent', danger: 'on-danger', contrast: 'on-contrast' } as const\n\nfunction cancel() {\n emit('cancel')\n open.value = false\n}\n\n// A sheet closes on a tap on the scrim; a dialog only from its buttons and Escape.\nfunction onOutside(event: Event) {\n if (sheet.value) emit('cancel')\n else event.preventDefault()\n}\n\nfunction confirmFromKeyboard(event: KeyboardEvent) {\n if (!event.metaKey && !event.ctrlKey) return\n event.preventDefault()\n if (props.confirmLabel && !props.confirmDisabled) emit('confirm')\n}\n</script>\n\n<!-- The one dialog: one raised piece with a title (after an optional `context`, such as where the thing lands), a body\n and a footer; or, with a `band` or `hero`, a record form under a tinted band; or a bottom sheet. -->\n<template>\n <DialogRoot v-model:open=\"open\">\n <DialogPortal>\n <DialogOverlay\n class=\"fixed inset-0 z-[1100] flex justify-center data-[state=closed]:animate-sui-scrim-out data-[state=open]:animate-sui-scrim-in\"\n :class=\"\n sheet\n ? 'items-end bg-sui-scrim/40 backdrop-blur-[4px]'\n : 'items-start bg-[rgb(var(--sui-scrim)/var(--sui-scrim-alpha))] px-4 pt-(--sui-dialog-offset) pb-4'\n \"\n >\n <DialogContent\n v-if=\"sheet\"\n ref=\"panel\"\n :aria-describedby=\"undefined\"\n class=\"relative flex max-h-[calc(100dvh-1.5rem)] w-full flex-col rounded-t-(--sui-radius-sheet) border border-b-0 border-sui-edge bg-sui-raised shadow-(--sui-shadow-floating) outline-hidden data-[state=closed]:animate-sui-sheet-out data-[state=open]:animate-sui-sheet-in motion-reduce:animate-none motion-reduce:transition-none\"\n :class=\"!drag.dragging.value && 'transition-transform duration-[250ms] ease-[cubic-bezier(0.32,0.72,0,1)]'\"\n :style=\"drag.style.value\"\n @escape-key-down=\"emit('cancel')\"\n @interact-outside=\"onOutside\"\n @keydown.enter=\"confirmFromKeyboard\"\n @open-auto-focus=\"focusFirst\"\n >\n <!-- Without a close button, keyboard and screen-reader users still get one: it shows when focused. -->\n <button\n v-if=\"!closable\"\n class=\"pointer-events-none absolute top-2 right-3 h-7 rounded-md bg-sui-fill px-2.5 text-13 font-medium text-sui-ink opacity-0 outline-hidden focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:sui-ring\"\n type=\"button\"\n @click=\"cancel\"\n >\n {{ closeLabel }}\n </button>\n <div class=\"shrink-0 cursor-grab touch-none pt-2\" data-modal-header v-bind=\"drag.handlers\">\n <span aria-hidden=\"true\" class=\"mx-auto block h-1 w-9 rounded-full bg-sui-mark-faint\" />\n <div v-if=\"!headerless\" class=\"flex min-h-11 items-center justify-between gap-3 pt-2 pr-4 pb-1 pl-5\">\n <div class=\"flex min-w-0 items-center gap-1\">\n <template v-if=\"hasContext\">\n <slot name=\"context\" />\n <ContextSeparator />\n </template>\n <DialogTitle class=\"min-w-0 truncate text-base font-semibold text-sui-ink\">\n <slot name=\"title\">{{ title }}</slot>\n </DialogTitle>\n </div>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-subtle stroke-sui-ink-subtle\" />\n </Button>\n </Tooltip>\n </div>\n <DialogTitle v-else class=\"sr-only\">{{ title }}</DialogTitle>\n </div>\n\n <div\n class=\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 pt-2 pb-5 text-sm leading-5 text-sui-ink-emphasis\"\n data-modal-body\n >\n <slot />\n </div>\n\n <div\n v-if=\"hasFooter\"\n class=\"flex shrink-0 flex-col gap-2.5 border-t border-sui-fill-line bg-sui-raised px-4 pt-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]\"\n data-modal-footer\n >\n <slot name=\"footer\">\n <div v-if=\"$slots['footer-start'] || hint\" class=\"flex min-w-0 items-center justify-center gap-2\">\n <slot name=\"footer-start\" />\n <span v-if=\"hint\" class=\"min-w-0 truncate text-xs text-sui-ink-muted\">{{ hint }}</span>\n </div>\n <Button\n class=\"w-full\"\n :disabled=\"confirmDisabled\"\n size=\"lg\"\n type=\"button\"\n :variant=\"confirmVariant\"\n @click=\"emit('confirm')\"\n >\n <Icon v-if=\"confirmIcon\" :color=\"iconColours[confirmVariant]\" :name=\"confirmIcon\" />\n {{ confirmLabel }}\n </Button>\n </slot>\n </div>\n </DialogContent>\n <DialogContent\n v-else\n :aria-describedby=\"undefined\"\n class=\"flex max-h-[calc(100dvh-var(--sui-dialog-offset)-1rem)] w-full flex-col border border-sui-edge bg-sui-raised shadow-(--sui-shadow-floating) outline-hidden data-[state=closed]:animate-sui-dialog-out data-[state=open]:animate-sui-dialog-in\"\n :class=\"[width, banded ? 'rounded-2xl' : 'rounded-xl']\"\n @escape-key-down=\"emit('cancel')\"\n @interact-outside.prevent\n @keydown.enter=\"confirmFromKeyboard\"\n @open-auto-focus=\"focusFirst\"\n >\n <div\n v-if=\"banded\"\n class=\"shrink-0 rounded-t-2xl pt-3.5 pr-3.5 pb-4.5 pl-5 transition-colors duration-200\"\n data-modal-header\n :style=\"{ backgroundColor: bandColour }\"\n >\n <div class=\"flex items-center justify-between gap-3\">\n <DialogTitle class=\"text-13 leading-5 font-medium text-sui-ink-body\">{{ title }}</DialogTitle>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </Button>\n </Tooltip>\n </div>\n <div v-if=\"$slots.hero\" class=\"mt-0.5 flex flex-col items-center gap-1.5 pr-1.5\">\n <slot name=\"hero\" />\n </div>\n </div>\n <div\n v-else-if=\"!headerless\"\n class=\"flex shrink-0 items-center justify-between gap-3 pt-3 pr-3 pl-4 text-sui-ink\"\n data-modal-header\n >\n <div class=\"flex min-h-7 min-w-0 items-center gap-1\">\n <template v-if=\"hasContext\">\n <slot name=\"context\" />\n <ContextSeparator />\n </template>\n <DialogTitle\n class=\"min-w-0 truncate text-sm font-semibold text-sui-ink\"\n :class=\"hasContext ? '' : 'pl-1'\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </DialogTitle>\n </div>\n <Tooltip v-if=\"closable\" :text=\"closeLabel\">\n <Button :aria-label=\"closeLabel\" class=\"shrink-0\" icon-only size=\"sm\" variant=\"ghost\" @click=\"cancel\">\n <CloseIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </Button>\n </Tooltip>\n </div>\n <DialogTitle v-else class=\"sr-only\">{{ title }}</DialogTitle>\n\n <div\n class=\"overflow-y-auto text-sm text-sui-ink-emphasis\"\n :class=\"[\n banded ? 'px-5 pt-0.5 pb-4' : headerless ? 'p-5' : 'px-5 pt-3.5 pb-5',\n !hasFooter && (banded ? 'rounded-b-2xl' : 'rounded-b-xl')\n ]\"\n data-modal-body\n >\n <slot />\n </div>\n\n <div\n v-if=\"hasFooter\"\n class=\"flex shrink-0 items-center gap-2.5 text-sui-ink\"\n :class=\"banded ? 'rounded-b-2xl py-3 pr-4 pl-5' : 'rounded-b-xl px-4 pt-1 pb-4 pl-5'\"\n data-modal-footer\n >\n <slot name=\"footer\">\n <slot name=\"footer-start\" />\n <span v-if=\"hint\" class=\"min-w-0 truncate text-xs text-sui-ink-muted\">{{ hint }}</span>\n <span class=\"flex-1\" />\n <span v-if=\"confirmLabel\" aria-hidden=\"true\" class=\"flex shrink-0 items-center gap-1\">\n <Kbd>{{ modKey }}</Kbd\n ><Kbd>↵</Kbd>\n </span>\n <Button\n v-if=\"confirmLabel\"\n :aria-keyshortcuts=\"modKey === '⌘' ? 'Meta+Enter' : 'Control+Enter'\"\n :disabled=\"confirmDisabled\"\n type=\"button\"\n :variant=\"confirmVariant\"\n @click=\"emit('confirm')\"\n >\n <Icon v-if=\"confirmIcon\" :color=\"iconColours[confirmVariant]\" :name=\"confirmIcon\" />\n {{ confirmLabel }}\n </Button>\n </slot>\n </div>\n </DialogContent>\n </DialogOverlay>\n </DialogPortal>\n </DialogRoot>\n</template>\n"],"mappings":""}
@@ -3,6 +3,7 @@ export interface DialogProps {
3
3
  /** The close button in the header. */
4
4
  closable?: boolean;
5
5
  closeLabel?: string;
6
+ /** @deprecated A dialog has no Cancel button: Escape and the close button cancel. Kept so existing calls compile. */
6
7
  cancelLabel?: string;
7
8
  /** Shows the standard footer's confirm button, which emits `confirm`, as ⌘ or Ctrl Enter does. */
8
9
  confirmLabel?: string;
@@ -14,7 +15,7 @@ export interface DialogProps {
14
15
  /** A record form's tinted header band: a CSS colour such as `rgb(var(--sui-hue-blue-soft))`, or `true` for the accent
15
16
  * wash. The `hero` slot sits centred in it. */
16
17
  band?: string | boolean;
17
- /** Muted text at the footer's start, e.g. `saveHint()`. */
18
+ /** Muted text at the footer's start. The ⌘ or Ctrl Enter shortcut is drawn by the dialog next to its confirm. */
18
19
  hint?: string;
19
20
  /** The body draws its own header, edge to edge. */
20
21
  headerless?: boolean;
@@ -30,25 +31,29 @@ type __VLS_ModelProps = {
30
31
  'open'?: boolean;
31
32
  };
32
33
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
33
- declare var __VLS_36: {}, __VLS_63: {}, __VLS_65: {}, __VLS_67: {}, __VLS_118: {}, __VLS_126: {}, __VLS_153: {}, __VLS_155: {}, __VLS_157: {};
34
+ declare var __VLS_30: {}, __VLS_43: {}, __VLS_70: {}, __VLS_72: {}, __VLS_74: {}, __VLS_125: {}, __VLS_127: {}, __VLS_140: {}, __VLS_167: {}, __VLS_169: {}, __VLS_171: {};
34
35
  type __VLS_Slots = {} & {
35
- title?: (props: typeof __VLS_36) => any;
36
+ context?: (props: typeof __VLS_30) => any;
36
37
  } & {
37
- default?: (props: typeof __VLS_63) => any;
38
+ title?: (props: typeof __VLS_43) => any;
38
39
  } & {
39
- footer?: (props: typeof __VLS_65) => any;
40
+ default?: (props: typeof __VLS_70) => any;
40
41
  } & {
41
- 'footer-start'?: (props: typeof __VLS_67) => any;
42
+ footer?: (props: typeof __VLS_72) => any;
42
43
  } & {
43
- hero?: (props: typeof __VLS_118) => any;
44
+ 'footer-start'?: (props: typeof __VLS_74) => any;
44
45
  } & {
45
- title?: (props: typeof __VLS_126) => any;
46
+ hero?: (props: typeof __VLS_125) => any;
46
47
  } & {
47
- default?: (props: typeof __VLS_153) => any;
48
+ context?: (props: typeof __VLS_127) => any;
48
49
  } & {
49
- footer?: (props: typeof __VLS_155) => any;
50
+ title?: (props: typeof __VLS_140) => any;
50
51
  } & {
51
- 'footer-start'?: (props: typeof __VLS_157) => any;
52
+ default?: (props: typeof __VLS_167) => any;
53
+ } & {
54
+ footer?: (props: typeof __VLS_169) => any;
55
+ } & {
56
+ 'footer-start'?: (props: typeof __VLS_171) => any;
52
57
  };
53
58
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
54
59
  cancel: () => any;
@@ -2,40 +2,46 @@ import e from "../Button/Button.js";
2
2
  import t from "../Icon/Icon.js";
3
3
  import n from "../Tooltip/Tooltip.js";
4
4
  import r from "../internal/CloseIcon.js";
5
- import { focusFirst as i } from "./focus.js";
6
- import { useSheetDrag as a } from "./useSheetDrag.js";
7
- import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, mergeModels as m, mergeProps as ee, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as te, openBlock as _, ref as v, renderSlot as y, toDisplayString as b, unref as x, useModel as ne, useSlots as re, useTemplateRef as ie, watch as S, withCtx as C, withKeys as w, withModifiers as ae } from "vue";
8
- import { DialogContent as T, DialogOverlay as E, DialogPortal as D, DialogRoot as O, DialogTitle as k } from "reka-ui";
5
+ import i from "../Kbd/Kbd.js";
6
+ import a from "./ContextSeparator.js";
7
+ import { focusFirst as o, modifierKey as s } from "./focus.js";
8
+ import { useSheetDrag as c } from "./useSheetDrag.js";
9
+ import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, mergeModels as v, mergeProps as ee, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as x, openBlock as S, ref as te, renderSlot as C, toDisplayString as w, unref as T, useModel as ne, useSlots as re, useTemplateRef as ie, watch as E, withCtx as D, withKeys as O, withModifiers as ae } from "vue";
10
+ import { DialogContent as k, DialogOverlay as A, DialogPortal as oe, DialogRoot as j, DialogTitle as M } from "reka-ui";
9
11
  //#region src/components/Dialog/Dialog.vue?vue&type=script&setup=true&lang.ts
10
- var A = {
12
+ var se = {
11
13
  key: 0,
12
14
  class: "flex min-h-11 items-center justify-between gap-3 pt-2 pr-4 pb-1 pl-5"
13
- }, j = {
15
+ }, ce = { class: "flex min-w-0 items-center gap-1" }, le = {
14
16
  class: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 pt-2 pb-5 text-sm leading-5 text-sui-ink-emphasis",
15
17
  "data-modal-body": ""
16
- }, M = {
18
+ }, ue = {
17
19
  key: 1,
18
- class: "flex shrink-0 flex-col gap-2.5 border-t border-sui-line-subtle bg-sui-surface px-4 pt-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",
20
+ class: "flex shrink-0 flex-col gap-2.5 border-t border-sui-fill-line bg-sui-raised px-4 pt-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",
19
21
  "data-modal-footer": ""
20
- }, N = {
22
+ }, de = {
21
23
  key: 0,
22
24
  class: "flex min-w-0 items-center justify-center gap-2"
23
- }, P = {
25
+ }, fe = {
24
26
  key: 0,
25
27
  class: "min-w-0 truncate text-xs text-sui-ink-muted"
26
- }, F = { class: "flex items-center justify-between gap-3" }, I = {
28
+ }, pe = { class: "flex items-center justify-between gap-3" }, me = {
27
29
  key: 0,
28
30
  class: "mt-0.5 flex flex-col items-center gap-1.5 pr-1.5"
29
- }, L = {
31
+ }, N = {
30
32
  key: 1,
31
- class: "flex shrink-0 items-center justify-between gap-3 rounded-t-xl border-b border-sui-line-subtle bg-sui-surface px-5 py-4 text-sui-ink",
33
+ class: "flex shrink-0 items-center justify-between gap-3 pt-3 pr-3 pl-4 text-sui-ink",
32
34
  "data-modal-header": ""
33
- }, R = {
35
+ }, P = { class: "flex min-h-7 min-w-0 items-center gap-1" }, F = {
34
36
  key: 0,
35
37
  class: "min-w-0 truncate text-xs text-sui-ink-muted"
36
- }, z = /*@__PURE__*/ p({
38
+ }, I = {
39
+ key: 1,
40
+ "aria-hidden": "true",
41
+ class: "flex shrink-0 items-center gap-1"
42
+ }, L = /*@__PURE__*/ _({
37
43
  __name: "Dialog",
38
- props: /*@__PURE__*/ m({
44
+ props: /*@__PURE__*/ v({
39
45
  title: { default: void 0 },
40
46
  closable: {
41
47
  type: Boolean,
@@ -63,207 +69,212 @@ var A = {
63
69
  },
64
70
  openModifiers: {}
65
71
  }),
66
- emits: /*@__PURE__*/ m(["confirm", "cancel"], ["update:open"]),
67
- setup(p, { emit: m }) {
68
- let z = p, B = m, V = ne(p, "open"), H = re(), U = o(() => !!H.footer || !!z.confirmLabel), W = o(() => !!z.band || !!H.hero), oe = {
72
+ emits: /*@__PURE__*/ v(["confirm", "cancel"], ["update:open"]),
73
+ setup(_, { emit: v }) {
74
+ let L = _, R = v, z = ne(_, "open"), B = re(), V = u(() => !!B.context), H = s(), U = u(() => !!B.footer || !!L.confirmLabel), W = u(() => !!L.band || !!B.hero), he = {
69
75
  sm: "max-w-[27rem]",
70
76
  md: "max-w-lg",
71
77
  record: "max-w-130",
72
78
  lg: "max-w-2xl",
73
79
  xl: "max-w-3xl"
74
- }, se = o(() => oe[z.size ?? (W.value ? "record" : "md")]), ce = o(() => typeof z.band == "string" ? z.band : "rgb(var(--sui-accent-wash))"), G = v(!1), K, q = () => G.value = !!K?.matches;
75
- S(() => [z.presentation, z.sheetBelow], ([e, t]) => {
80
+ }, ge = u(() => he[L.size ?? (W.value ? "record" : "md")]), _e = u(() => typeof L.band == "string" ? L.band : "rgb(var(--sui-accent-wash))"), G = te(!1), K, q = () => G.value = !!K?.matches;
81
+ E(() => [L.presentation, L.sheetBelow], ([e, t]) => {
76
82
  K?.removeEventListener("change", q), K = e === "auto" && typeof window < "u" ? window.matchMedia(`(max-width: ${t - .02}px)`) : void 0, K?.addEventListener("change", q), q();
77
- }, { immediate: !0 }), te(() => K?.removeEventListener("change", q));
78
- let J = o(() => z.presentation === "sheet" || z.presentation === "auto" && G.value), Y = ie("panel"), X = a(o(() => Y.value?.$el), () => Q());
79
- S(V, (e) => e && X.reset());
83
+ }, { immediate: !0 }), x(() => K?.removeEventListener("change", q));
84
+ let J = u(() => L.presentation === "sheet" || L.presentation === "auto" && G.value), Y = ie("panel"), X = c(u(() => Y.value?.$el), () => Q());
85
+ E(z, (e) => e && X.reset());
80
86
  let Z = {
81
87
  primary: "on-accent",
82
88
  danger: "on-danger",
83
89
  contrast: "on-contrast"
84
90
  };
85
91
  function Q() {
86
- B("cancel"), V.value = !1;
92
+ R("cancel"), z.value = !1;
87
93
  }
88
- function le(e) {
89
- J.value ? B("cancel") : e.preventDefault();
94
+ function ve(e) {
95
+ J.value ? R("cancel") : e.preventDefault();
90
96
  }
91
97
  function $(e) {
92
- (e.metaKey || e.ctrlKey) && (e.preventDefault(), z.confirmLabel && !z.confirmDisabled && B("confirm"));
98
+ (e.metaKey || e.ctrlKey) && (e.preventDefault(), L.confirmLabel && !L.confirmDisabled && R("confirm"));
93
99
  }
94
- return (a, o) => (_(), s(x(O), {
95
- open: V.value,
96
- "onUpdate:open": o[5] ||= (e) => V.value = e
100
+ return (s, c) => (S(), d(T(j), {
101
+ open: z.value,
102
+ "onUpdate:open": c[5] ||= (e) => z.value = e
97
103
  }, {
98
- default: C(() => [f(x(D), null, {
99
- default: C(() => [f(x(E), { class: h(["fixed inset-0 z-[1100] flex justify-center bg-sui-scrim/40 backdrop-blur-[4px] data-[state=closed]:animate-sui-scrim-out data-[state=open]:animate-sui-scrim-in", J.value ? "items-end" : "items-center"]) }, {
100
- default: C(() => [J.value ? (_(), s(x(T), {
104
+ default: D(() => [g(T(oe), null, {
105
+ default: D(() => [g(T(A), { class: y(["fixed inset-0 z-[1100] flex justify-center data-[state=closed]:animate-sui-scrim-out data-[state=open]:animate-sui-scrim-in", J.value ? "items-end bg-sui-scrim/40 backdrop-blur-[4px]" : "items-start bg-[rgb(var(--sui-scrim)/var(--sui-scrim-alpha))] px-4 pt-(--sui-dialog-offset) pb-4"]) }, {
106
+ default: D(() => [J.value ? (S(), d(T(k), {
101
107
  key: 0,
102
108
  ref_key: "panel",
103
109
  ref: Y,
104
110
  "aria-describedby": void 0,
105
- class: h(["relative flex max-h-[calc(100dvh-1.5rem)] w-full flex-col rounded-t-(--sui-radius-sheet) bg-sui-surface shadow-xl outline-hidden data-[state=closed]:animate-sui-sheet-out data-[state=open]:animate-sui-sheet-in motion-reduce:animate-none motion-reduce:transition-none", !x(X).dragging.value && "transition-transform duration-[250ms] ease-[cubic-bezier(0.32,0.72,0,1)]"]),
106
- style: g(x(X).style.value),
107
- onEscapeKeyDown: o[1] ||= (e) => B("cancel"),
108
- onInteractOutside: le,
109
- onKeydown: w($, ["enter"]),
110
- onOpenAutoFocus: x(i)
111
+ class: y(["relative flex max-h-[calc(100dvh-1.5rem)] w-full flex-col rounded-t-(--sui-radius-sheet) border border-b-0 border-sui-edge bg-sui-raised shadow-(--sui-shadow-floating) outline-hidden data-[state=closed]:animate-sui-sheet-out data-[state=open]:animate-sui-sheet-in motion-reduce:animate-none motion-reduce:transition-none", !T(X).dragging.value && "transition-transform duration-[250ms] ease-[cubic-bezier(0.32,0.72,0,1)]"]),
112
+ style: b(T(X).style.value),
113
+ onEscapeKeyDown: c[1] ||= (e) => R("cancel"),
114
+ onInteractOutside: ve,
115
+ onKeydown: O($, ["enter"]),
116
+ onOpenAutoFocus: T(o)
111
117
  }, {
112
- default: C(() => [
113
- p.closable ? c("", !0) : (_(), l("button", {
118
+ default: D(() => [
119
+ _.closable ? f("", !0) : (S(), p("button", {
114
120
  key: 0,
115
- class: "pointer-events-none absolute top-2 right-3 h-7 rounded-md bg-sui-sunken px-2.5 text-13 font-medium text-sui-ink opacity-0 outline-hidden focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:sui-ring",
121
+ class: "pointer-events-none absolute top-2 right-3 h-7 rounded-md bg-sui-fill px-2.5 text-13 font-medium text-sui-ink opacity-0 outline-hidden focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:sui-ring",
116
122
  type: "button",
117
123
  onClick: Q
118
- }, b(p.closeLabel), 1)),
119
- u("div", ee({
124
+ }, w(_.closeLabel), 1)),
125
+ m("div", ee({
120
126
  class: "shrink-0 cursor-grab touch-none pt-2",
121
127
  "data-modal-header": ""
122
- }, x(X).handlers), [o[6] ||= u("span", {
128
+ }, T(X).handlers), [c[6] ||= m("span", {
123
129
  "aria-hidden": "true",
124
130
  class: "mx-auto block h-1 w-9 rounded-full bg-sui-mark-faint"
125
- }, null, -1), p.headerless ? (_(), s(x(k), {
131
+ }, null, -1), _.headerless ? (S(), d(T(M), {
126
132
  key: 1,
127
133
  class: "sr-only"
128
134
  }, {
129
- default: C(() => [d(b(p.title), 1)]),
135
+ default: D(() => [h(w(_.title), 1)]),
130
136
  _: 1
131
- })) : (_(), l("div", A, [f(x(k), { class: "min-w-0 truncate text-base font-semibold text-sui-ink" }, {
132
- default: C(() => [y(a.$slots, "title", {}, () => [d(b(p.title), 1)])]),
137
+ })) : (S(), p("div", se, [m("div", ce, [V.value ? (S(), p(l, { key: 0 }, [C(s.$slots, "context"), g(a)], 64)) : f("", !0), g(T(M), { class: "min-w-0 truncate text-base font-semibold text-sui-ink" }, {
138
+ default: D(() => [C(s.$slots, "title", {}, () => [h(w(_.title), 1)])]),
133
139
  _: 3
134
- }), p.closable ? (_(), s(n, {
140
+ })]), _.closable ? (S(), d(n, {
135
141
  key: 0,
136
- text: p.closeLabel
142
+ text: _.closeLabel
137
143
  }, {
138
- default: C(() => [f(e, {
139
- "aria-label": p.closeLabel,
144
+ default: D(() => [g(e, {
145
+ "aria-label": _.closeLabel,
140
146
  class: "shrink-0",
141
147
  "icon-only": "",
142
148
  size: "sm",
143
149
  variant: "ghost",
144
150
  onClick: Q
145
151
  }, {
146
- default: C(() => [f(r, { class: "fill-sui-ink-subtle stroke-sui-ink-subtle" })]),
152
+ default: D(() => [g(r, { class: "fill-sui-ink-subtle stroke-sui-ink-subtle" })]),
147
153
  _: 1
148
154
  }, 8, ["aria-label"])]),
149
155
  _: 1
150
- }, 8, ["text"])) : c("", !0)]))], 16),
151
- u("div", j, [y(a.$slots, "default")]),
152
- U.value ? (_(), l("div", M, [y(a.$slots, "footer", {}, () => [a.$slots["footer-start"] || p.hint ? (_(), l("div", N, [y(a.$slots, "footer-start"), p.hint ? (_(), l("span", P, b(p.hint), 1)) : c("", !0)])) : c("", !0), f(e, {
156
+ }, 8, ["text"])) : f("", !0)]))], 16),
157
+ m("div", le, [C(s.$slots, "default")]),
158
+ U.value ? (S(), p("div", ue, [C(s.$slots, "footer", {}, () => [s.$slots["footer-start"] || _.hint ? (S(), p("div", de, [C(s.$slots, "footer-start"), _.hint ? (S(), p("span", fe, w(_.hint), 1)) : f("", !0)])) : f("", !0), g(e, {
153
159
  class: "w-full",
154
- disabled: p.confirmDisabled,
160
+ disabled: _.confirmDisabled,
155
161
  size: "lg",
156
162
  type: "button",
157
- variant: p.confirmVariant,
158
- onClick: o[0] ||= (e) => B("confirm")
163
+ variant: _.confirmVariant,
164
+ onClick: c[0] ||= (e) => R("confirm")
159
165
  }, {
160
- default: C(() => [p.confirmIcon ? (_(), s(t, {
166
+ default: D(() => [_.confirmIcon ? (S(), d(t, {
161
167
  key: 0,
162
- color: Z[p.confirmVariant],
163
- name: p.confirmIcon
164
- }, null, 8, ["color", "name"])) : c("", !0), d(" " + b(p.confirmLabel), 1)]),
168
+ color: Z[_.confirmVariant],
169
+ name: _.confirmIcon
170
+ }, null, 8, ["color", "name"])) : f("", !0), h(" " + w(_.confirmLabel), 1)]),
165
171
  _: 1
166
- }, 8, ["disabled", "variant"])])])) : c("", !0)
172
+ }, 8, ["disabled", "variant"])])])) : f("", !0)
167
173
  ]),
168
174
  _: 3
169
175
  }, 8, [
170
176
  "class",
171
177
  "style",
172
178
  "onOpenAutoFocus"
173
- ])) : (_(), s(x(T), {
179
+ ])) : (S(), d(T(k), {
174
180
  key: 1,
175
181
  "aria-describedby": void 0,
176
- class: h(["flex max-h-[90vh] w-full flex-col bg-sui-surface shadow-xl outline-hidden data-[state=closed]:animate-sui-dialog-out data-[state=open]:animate-sui-dialog-in", [se.value, W.value ? "rounded-2xl" : "rounded-xl"]]),
177
- onEscapeKeyDown: o[3] ||= (e) => B("cancel"),
178
- onInteractOutside: o[4] ||= ae(() => {}, ["prevent"]),
179
- onKeydown: w($, ["enter"]),
180
- onOpenAutoFocus: x(i)
182
+ class: y(["flex max-h-[calc(100dvh-var(--sui-dialog-offset)-1rem)] w-full flex-col border border-sui-edge bg-sui-raised shadow-(--sui-shadow-floating) outline-hidden data-[state=closed]:animate-sui-dialog-out data-[state=open]:animate-sui-dialog-in", [ge.value, W.value ? "rounded-2xl" : "rounded-xl"]]),
183
+ onEscapeKeyDown: c[3] ||= (e) => R("cancel"),
184
+ onInteractOutside: c[4] ||= ae(() => {}, ["prevent"]),
185
+ onKeydown: O($, ["enter"]),
186
+ onOpenAutoFocus: T(o)
181
187
  }, {
182
- default: C(() => [
183
- W.value ? (_(), l("div", {
188
+ default: D(() => [
189
+ W.value ? (S(), p("div", {
184
190
  key: 0,
185
191
  class: "shrink-0 rounded-t-2xl pt-3.5 pr-3.5 pb-4.5 pl-5 transition-colors duration-200",
186
192
  "data-modal-header": "",
187
- style: g({ backgroundColor: ce.value })
188
- }, [u("div", F, [f(x(k), { class: "text-13 leading-5 font-medium text-sui-ink-body" }, {
189
- default: C(() => [d(b(p.title), 1)]),
193
+ style: b({ backgroundColor: _e.value })
194
+ }, [m("div", pe, [g(T(M), { class: "text-13 leading-5 font-medium text-sui-ink-body" }, {
195
+ default: D(() => [h(w(_.title), 1)]),
190
196
  _: 1
191
- }), p.closable ? (_(), s(n, {
197
+ }), _.closable ? (S(), d(n, {
192
198
  key: 0,
193
- text: p.closeLabel
199
+ text: _.closeLabel
194
200
  }, {
195
- default: C(() => [f(e, {
196
- "aria-label": p.closeLabel,
201
+ default: D(() => [g(e, {
202
+ "aria-label": _.closeLabel,
197
203
  class: "shrink-0",
198
204
  "icon-only": "",
199
205
  size: "sm",
200
206
  variant: "ghost",
201
207
  onClick: Q
202
208
  }, {
203
- default: C(() => [f(r, { class: "fill-sui-ink-muted stroke-sui-ink-muted" })]),
209
+ default: D(() => [g(r, { class: "fill-sui-ink-muted stroke-sui-ink-muted" })]),
204
210
  _: 1
205
211
  }, 8, ["aria-label"])]),
206
212
  _: 1
207
- }, 8, ["text"])) : c("", !0)]), a.$slots.hero ? (_(), l("div", I, [y(a.$slots, "hero")])) : c("", !0)], 4)) : p.headerless ? (_(), s(x(k), {
213
+ }, 8, ["text"])) : f("", !0)]), s.$slots.hero ? (S(), p("div", me, [C(s.$slots, "hero")])) : f("", !0)], 4)) : _.headerless ? (S(), d(T(M), {
208
214
  key: 2,
209
215
  class: "sr-only"
210
216
  }, {
211
- default: C(() => [d(b(p.title), 1)]),
217
+ default: D(() => [h(w(_.title), 1)]),
212
218
  _: 1
213
- })) : (_(), l("div", L, [f(x(k), { class: "min-w-0 truncate text-base font-semibold text-sui-ink" }, {
214
- default: C(() => [y(a.$slots, "title", {}, () => [d(b(p.title), 1)])]),
219
+ })) : (S(), p("div", N, [m("div", P, [V.value ? (S(), p(l, { key: 0 }, [C(s.$slots, "context"), g(a)], 64)) : f("", !0), g(T(M), { class: y(["min-w-0 truncate text-sm font-semibold text-sui-ink", V.value ? "" : "pl-1"]) }, {
220
+ default: D(() => [C(s.$slots, "title", {}, () => [h(w(_.title), 1)])]),
215
221
  _: 3
216
- }), p.closable ? (_(), s(n, {
222
+ }, 8, ["class"])]), _.closable ? (S(), d(n, {
217
223
  key: 0,
218
- text: p.closeLabel
224
+ text: _.closeLabel
219
225
  }, {
220
- default: C(() => [f(e, {
221
- "aria-label": p.closeLabel,
226
+ default: D(() => [g(e, {
227
+ "aria-label": _.closeLabel,
222
228
  class: "shrink-0",
223
229
  "icon-only": "",
224
230
  size: "sm",
225
231
  variant: "ghost",
226
232
  onClick: Q
227
233
  }, {
228
- default: C(() => [f(r, { class: "fill-sui-ink-subtle stroke-sui-ink-subtle" })]),
234
+ default: D(() => [g(r, { class: "fill-sui-ink-muted stroke-sui-ink-muted" })]),
229
235
  _: 1
230
236
  }, 8, ["aria-label"])]),
231
237
  _: 1
232
- }, 8, ["text"])) : c("", !0)])),
233
- u("div", {
234
- class: h(["overflow-y-auto bg-sui-surface text-sm text-sui-ink-emphasis", [W.value ? "px-5 pt-0.5 pb-4" : "p-5", !U.value && (W.value ? "rounded-b-2xl" : "rounded-b-xl")]]),
238
+ }, 8, ["text"])) : f("", !0)])),
239
+ m("div", {
240
+ class: y(["overflow-y-auto text-sm text-sui-ink-emphasis", [W.value ? "px-5 pt-0.5 pb-4" : _.headerless ? "p-5" : "px-5 pt-3.5 pb-5", !U.value && (W.value ? "rounded-b-2xl" : "rounded-b-xl")]]),
235
241
  "data-modal-body": ""
236
- }, [y(a.$slots, "default")], 2),
237
- U.value ? (_(), l("div", {
242
+ }, [C(s.$slots, "default")], 2),
243
+ U.value ? (S(), p("div", {
238
244
  key: 3,
239
- class: h(["flex shrink-0 items-center border-t border-sui-line-subtle bg-sui-canvas text-sui-ink", W.value ? "gap-2 rounded-b-2xl py-3 pr-4 pl-5" : "gap-3 rounded-b-xl px-5 py-4"]),
245
+ class: y(["flex shrink-0 items-center gap-2.5 text-sui-ink", W.value ? "rounded-b-2xl py-3 pr-4 pl-5" : "rounded-b-xl px-4 pt-1 pb-4 pl-5"]),
240
246
  "data-modal-footer": ""
241
- }, [y(a.$slots, "footer", {}, () => [
242
- y(a.$slots, "footer-start"),
243
- p.hint ? (_(), l("span", R, b(p.hint), 1)) : c("", !0),
244
- o[7] ||= u("span", { class: "flex-1" }, null, -1),
245
- f(e, {
246
- type: "button",
247
- variant: "ghost",
248
- onClick: Q
249
- }, {
250
- default: C(() => [d(b(p.cancelLabel), 1)]),
247
+ }, [C(s.$slots, "footer", {}, () => [
248
+ C(s.$slots, "footer-start"),
249
+ _.hint ? (S(), p("span", F, w(_.hint), 1)) : f("", !0),
250
+ c[8] ||= m("span", { class: "flex-1" }, null, -1),
251
+ _.confirmLabel ? (S(), p("span", I, [g(i, null, {
252
+ default: D(() => [h(w(T(H)), 1)]),
253
+ _: 1
254
+ }), g(i, null, {
255
+ default: D(() => [...c[7] ||= [h("↵", -1)]]),
251
256
  _: 1
252
- }),
253
- f(e, {
254
- disabled: p.confirmDisabled,
257
+ })])) : f("", !0),
258
+ _.confirmLabel ? (S(), d(e, {
259
+ key: 2,
260
+ "aria-keyshortcuts": T(H) === "⌘" ? "Meta+Enter" : "Control+Enter",
261
+ disabled: _.confirmDisabled,
255
262
  type: "button",
256
- variant: p.confirmVariant,
257
- onClick: o[2] ||= (e) => B("confirm")
263
+ variant: _.confirmVariant,
264
+ onClick: c[2] ||= (e) => R("confirm")
258
265
  }, {
259
- default: C(() => [p.confirmIcon ? (_(), s(t, {
266
+ default: D(() => [_.confirmIcon ? (S(), d(t, {
260
267
  key: 0,
261
- color: Z[p.confirmVariant],
262
- name: p.confirmIcon
263
- }, null, 8, ["color", "name"])) : c("", !0), d(" " + b(p.confirmLabel), 1)]),
268
+ color: Z[_.confirmVariant],
269
+ name: _.confirmIcon
270
+ }, null, 8, ["color", "name"])) : f("", !0), h(" " + w(_.confirmLabel), 1)]),
264
271
  _: 1
265
- }, 8, ["disabled", "variant"])
266
- ])], 2)) : c("", !0)
272
+ }, 8, [
273
+ "aria-keyshortcuts",
274
+ "disabled",
275
+ "variant"
276
+ ])) : f("", !0)
277
+ ])], 2)) : f("", !0)
267
278
  ]),
268
279
  _: 3
269
280
  }, 8, ["class", "onOpenAutoFocus"]))]),
@@ -276,6 +287,6 @@ var A = {
276
287
  }
277
288
  });
278
289
  //#endregion
279
- export { z as default };
290
+ export { L as default };
280
291
 
281
292
  //# sourceMappingURL=Dialog.vue_vue_type_script_setup_true_lang.js.map