@sparklingopinions/sparkling-ui 0.14.0 → 0.16.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 (100) 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.d.ts +3 -0
  20. package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js +68 -63
  21. package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/dist/components/Button/Button.js.map +1 -1
  23. package/dist/components/Button/Button.vue_vue_type_script_setup_true_lang.js +23 -22
  24. package/dist/components/Button/Button.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/components/Calendar/Calendar.js.map +1 -1
  26. package/dist/components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +3 -3
  27. package/dist/components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  29. package/dist/components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
  30. package/dist/components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  31. package/dist/components/DataList/DataList.js.map +1 -1
  32. package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js +103 -103
  33. package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/dist/components/Dialog/ContextSeparator.js +19 -0
  35. package/dist/components/Dialog/ContextSeparator.js.map +1 -0
  36. package/dist/components/Dialog/ContextSeparator.vue.d.ts +3 -0
  37. package/dist/components/Dialog/Dialog.js.map +1 -1
  38. package/dist/components/Dialog/Dialog.vue.d.ts +16 -11
  39. package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js +130 -119
  40. package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/components/Dialog/focus.d.ts +2 -0
  42. package/dist/components/Dialog/focus.js +2 -2
  43. package/dist/components/Dialog/focus.js.map +1 -1
  44. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  45. package/dist/components/EmptyState/EmptyState.vue_vue_type_script_setup_true_lang.js +1 -1
  46. package/dist/components/EmptyState/EmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  47. package/dist/components/Filters/FilterChip.js.map +1 -1
  48. package/dist/components/Filters/FilterChip.vue_vue_type_script_setup_true_lang.js +7 -7
  49. package/dist/components/Filters/FilterChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  50. package/dist/components/Filters/FilterFrame.js.map +1 -1
  51. package/dist/components/Filters/FilterFrame.vue_vue_type_script_setup_true_lang.js +1 -1
  52. package/dist/components/Filters/FilterFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/dist/components/Filters/FilterMenu.js.map +1 -1
  54. package/dist/components/Filters/FilterMenu.vue_vue_type_script_setup_true_lang.js +3 -3
  55. package/dist/components/Filters/FilterMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  56. package/dist/components/Filters/SortMenu.js.map +1 -1
  57. package/dist/components/Filters/SortMenu.vue_vue_type_script_setup_true_lang.js +7 -7
  58. package/dist/components/Filters/SortMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/components/Input/Input.js.map +1 -1
  60. package/dist/components/Input/Input.vue_vue_type_script_setup_true_lang.js +1 -1
  61. package/dist/components/Input/Input.vue_vue_type_script_setup_true_lang.js.map +1 -1
  62. package/dist/components/Kbd/Kbd.js +1 -1
  63. package/dist/components/Kbd/Kbd.js.map +1 -1
  64. package/dist/components/Pagination/Pagination.js.map +1 -1
  65. package/dist/components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +1 -1
  66. package/dist/components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  67. package/dist/components/Popover/Popover.js.map +1 -1
  68. package/dist/components/Popover/Popover.vue_vue_type_script_setup_true_lang.js +1 -1
  69. package/dist/components/Popover/Popover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  70. package/dist/components/Popover/PopoverDialog.js.map +1 -1
  71. package/dist/components/Popover/PopoverDialog.vue_vue_type_script_setup_true_lang.js +1 -1
  72. package/dist/components/Popover/PopoverDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  73. package/dist/components/PropertyList/Editable.js.map +1 -1
  74. package/dist/components/PropertyList/Editable.vue_vue_type_script_setup_true_lang.js +2 -2
  75. package/dist/components/PropertyList/Editable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  76. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  77. package/dist/components/SegmentedControl/SegmentedControl.vue_vue_type_script_setup_true_lang.js +2 -2
  78. package/dist/components/SegmentedControl/SegmentedControl.vue_vue_type_script_setup_true_lang.js.map +1 -1
  79. package/dist/components/Select/Select.js.map +1 -1
  80. package/dist/components/Select/Select.vue_vue_type_script_setup_true_lang.js +4 -4
  81. package/dist/components/Select/Select.vue_vue_type_script_setup_true_lang.js.map +1 -1
  82. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  83. package/dist/components/Skeleton/Skeleton.vue_vue_type_script_setup_true_lang.js +1 -1
  84. package/dist/components/Skeleton/Skeleton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  85. package/dist/components/Table/Table.js.map +1 -1
  86. package/dist/components/Table/Table.vue_vue_type_script_setup_true_lang.js +3 -3
  87. package/dist/components/Table/Table.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/components/Tag/Tag.js.map +1 -1
  89. package/dist/components/Tag/Tag.vue_vue_type_script_setup_true_lang.js +3 -3
  90. package/dist/components/Tag/Tag.vue_vue_type_script_setup_true_lang.js.map +1 -1
  91. package/dist/components/Textarea/Textarea.js.map +1 -1
  92. package/dist/components/Textarea/Textarea.vue.d.ts +3 -0
  93. package/dist/components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +7 -2
  94. package/dist/components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  95. package/dist/components/internal/menu.d.ts +2 -2
  96. package/dist/components/internal/menu.js +1 -1
  97. package/dist/components/internal/menu.js.map +1 -1
  98. package/dist/index.js +15 -15
  99. package/package.json +1 -1
  100. package/src/styles/tailwind.css +93 -12
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","names":["_sfc_main","Tag_vue_vue_type_script_setup_true_lang_default","Tag_default"],"sources":["../../../src/components/Tag/Tag.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Hue } from '../../utils/hues'\nimport Icon from '../Icon/Icon.vue'\nimport type { IconColor } from '../Icon/colors'\nimport CloseSmallIcon from '../internal/CloseSmallIcon.vue'\n\nexport interface TagProps {\n /** The text; or use the default slot. */\n name?: string\n /** soft: a label people create, with an optional hue dot, removable. outline: a value from a fixed set (a stage, a status). */\n variant?: 'soft' | 'outline'\n /** soft only: a dot of the tag's own hue, on a neutral chip. */\n color?: Hue\n /** soft and outline: a 14px icon before the name, through the app's icon resolver, in place of the dot. */\n icon?: string\n /** The icon's colour; ink-subtle by default. */\n iconColor?: IconColor\n /** outline only: the quieter, superseded side, e.g. the \"from\" of a stage change. */\n muted?: boolean\n /** soft only. */\n removable?: boolean\n /** The remove button's accessible name. */\n removeLabel?: string\n /** A toggle button for quick choices, bound to `v-model:pressed`. Group several in a `role=\"group\"` with a label. */\n pressable?: boolean\n /** pressable only. */\n disabled?: boolean\n /** pressable only: md is 28px, sm 22px for a dense row of filters. */\n size?: 'sm' | 'md'\n}\n\nwithDefaults(defineProps<TagProps>(), {\n name: undefined,\n variant: 'soft',\n color: undefined,\n icon: undefined,\n iconColor: 'ink-subtle',\n removeLabel: 'Remove tag',\n size: 'md'\n})\n\ndefineEmits<{ remove: [] }>()\n\nconst pressed = defineModel<boolean>('pressed', { default: false })\n\nconst dots: Record<Hue, string> = {\n blue: 'bg-sui-hue-blue-ink',\n green: 'bg-sui-hue-green-ink',\n orange: 'bg-sui-hue-orange-ink',\n pink: 'bg-sui-hue-pink-ink',\n purple: 'bg-sui-hue-purple-ink',\n slate: 'bg-sui-hue-slate-ink',\n red: 'bg-sui-hue-red-ink',\n amber: 'bg-sui-hue-amber-ink',\n gray: 'bg-sui-ink'\n}\n</script>\n\n<!-- A label: soft for the ones people create, outline for a value from a fixed set; or, pressable, a toggle chip. -->\n<template>\n <button\n v-if=\"pressable\"\n :aria-pressed=\"pressed\"\n class=\"inline-flex cursor-pointer items-center rounded-md border leading-none font-medium whitespace-nowrap transition-colors duration-150 outline-hidden focus-visible:sui-ring disabled:cursor-default disabled:opacity-50\"\n :class=\"[\n size === 'sm' ? 'h-5.5 gap-1 px-2 text-xs' : 'h-7 gap-1.5 px-3 text-13',\n pressed\n ? 'border-sui-accent-line bg-sui-accent-wash text-sui-accent enabled:hover:border-sui-accent-bright enabled:hover:bg-sui-accent-soft enabled:active:border-sui-accent-solid enabled:active:bg-sui-accent-soft'\n : 'border-sui-line bg-sui-surface text-sui-ink-body enabled:hover:border-sui-line-strong enabled:hover:bg-sui-canvas enabled:hover:text-sui-ink enabled:active:bg-sui-sunken'\n ]\"\n :disabled=\"disabled\"\n type=\"button\"\n @click=\"pressed = !pressed\"\n >\n <svg\n v-if=\"pressed\"\n aria-hidden=\"true\"\n class=\"-ml-0.5 size-3 shrink-0 fill-none stroke-current\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.75\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M3.5 8.25l3 3 6-6.5\" />\n </svg>\n <slot>{{ name }}</slot>\n </button>\n <span\n v-else-if=\"variant === 'outline'\"\n class=\"inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs whitespace-nowrap\"\n :class=\"\n muted ? 'border-sui-line-subtle text-sui-ink-muted' : 'border-sui-line bg-sui-sunken font-medium text-sui-ink'\n \"\n >\n <Icon v-if=\"icon\" class=\"size-3.5 shrink-0\" :color=\"iconColor\" :name=\"icon\" />\n <slot>{{ name }}</slot>\n </span>\n <div\n v-else\n class=\"inline-flex items-center gap-1.5 rounded-md bg-sui-sunken px-2 py-0.5 text-xs font-medium text-sui-ink-body\"\n >\n <Icon v-if=\"icon\" class=\"size-3.5 shrink-0\" :color=\"iconColor\" :name=\"icon\" />\n <span v-else-if=\"color\" class=\"h-1.5 w-1.5 shrink-0 rounded-full\" :class=\"dots[color]\" />\n <span class=\"truncate\"\n ><slot>{{ name }}</slot></span\n >\n <button\n v-if=\"removable\"\n :aria-label=\"removeLabel\"\n class=\"-mr-0.5 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full transition-colors hover:bg-sui-line focus-visible:sui-ring\"\n type=\"button\"\n @click=\"$emit('remove')\"\n >\n <CloseSmallIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </button>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Tag.js","names":["_sfc_main","Tag_vue_vue_type_script_setup_true_lang_default","Tag_default"],"sources":["../../../src/components/Tag/Tag.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Hue } from '../../utils/hues'\nimport Icon from '../Icon/Icon.vue'\nimport type { IconColor } from '../Icon/colors'\nimport CloseSmallIcon from '../internal/CloseSmallIcon.vue'\n\nexport interface TagProps {\n /** The text; or use the default slot. */\n name?: string\n /** soft: a label people create, with an optional hue dot, removable. outline: a value from a fixed set (a stage, a status). */\n variant?: 'soft' | 'outline'\n /** soft only: a dot of the tag's own hue, on a neutral chip. */\n color?: Hue\n /** soft and outline: a 14px icon before the name, through the app's icon resolver, in place of the dot. */\n icon?: string\n /** The icon's colour; ink-subtle by default. */\n iconColor?: IconColor\n /** outline only: the quieter, superseded side, e.g. the \"from\" of a stage change. */\n muted?: boolean\n /** soft only. */\n removable?: boolean\n /** The remove button's accessible name. */\n removeLabel?: string\n /** A toggle button for quick choices, bound to `v-model:pressed`. Group several in a `role=\"group\"` with a label. */\n pressable?: boolean\n /** pressable only. */\n disabled?: boolean\n /** pressable only: md is 28px, sm 22px for a dense row of filters. */\n size?: 'sm' | 'md'\n}\n\nwithDefaults(defineProps<TagProps>(), {\n name: undefined,\n variant: 'soft',\n color: undefined,\n icon: undefined,\n iconColor: 'ink-subtle',\n removeLabel: 'Remove tag',\n size: 'md'\n})\n\ndefineEmits<{ remove: [] }>()\n\nconst pressed = defineModel<boolean>('pressed', { default: false })\n\nconst dots: Record<Hue, string> = {\n blue: 'bg-sui-hue-blue-ink',\n green: 'bg-sui-hue-green-ink',\n orange: 'bg-sui-hue-orange-ink',\n pink: 'bg-sui-hue-pink-ink',\n purple: 'bg-sui-hue-purple-ink',\n slate: 'bg-sui-hue-slate-ink',\n red: 'bg-sui-hue-red-ink',\n amber: 'bg-sui-hue-amber-ink',\n gray: 'bg-sui-ink'\n}\n</script>\n\n<!-- A label: soft for the ones people create, outline for a value from a fixed set; or, pressable, a toggle chip. -->\n<template>\n <button\n v-if=\"pressable\"\n :aria-pressed=\"pressed\"\n class=\"inline-flex cursor-pointer items-center rounded-full border leading-none font-medium whitespace-nowrap transition-colors duration-150 outline-hidden focus-visible:sui-ring disabled:cursor-default disabled:opacity-50\"\n :class=\"[\n size === 'sm' ? 'h-5.5 gap-1 px-2.5 text-xs' : 'h-7 gap-1.5 px-3 text-13',\n pressed\n ? 'border-sui-accent-line bg-sui-accent-wash text-sui-accent enabled:hover:border-sui-accent-bright enabled:hover:bg-sui-accent-soft enabled:active:border-sui-accent-solid enabled:active:bg-sui-accent-soft'\n : 'border-sui-fill-line bg-sui-fill text-sui-ink-emphasis enabled:hover:bg-sui-fill-hover enabled:hover:text-sui-ink'\n ]\"\n :disabled=\"disabled\"\n type=\"button\"\n @click=\"pressed = !pressed\"\n >\n <svg\n v-if=\"pressed\"\n aria-hidden=\"true\"\n class=\"-ml-0.5 size-3 shrink-0 fill-none stroke-current\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.75\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M3.5 8.25l3 3 6-6.5\" />\n </svg>\n <slot>{{ name }}</slot>\n </button>\n <span\n v-else-if=\"variant === 'outline'\"\n class=\"inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs whitespace-nowrap\"\n :class=\"\n muted ? 'border-sui-line-subtle text-sui-ink-muted' : 'border-sui-line bg-sui-fill font-medium text-sui-ink'\n \"\n >\n <Icon v-if=\"icon\" class=\"size-3.5 shrink-0\" :color=\"iconColor\" :name=\"icon\" />\n <slot>{{ name }}</slot>\n </span>\n <div\n v-else\n class=\"inline-flex items-center gap-1.5 rounded-md bg-sui-fill px-2 py-0.5 text-xs font-medium text-sui-ink-body\"\n >\n <Icon v-if=\"icon\" class=\"size-3.5 shrink-0\" :color=\"iconColor\" :name=\"icon\" />\n <span v-else-if=\"color\" class=\"h-1.5 w-1.5 shrink-0 rounded-full\" :class=\"dots[color]\" />\n <span class=\"truncate\"\n ><slot>{{ name }}</slot></span\n >\n <button\n v-if=\"removable\"\n :aria-label=\"removeLabel\"\n class=\"-mr-0.5 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full transition-colors hover:bg-sui-line focus-visible:sui-ring\"\n type=\"button\"\n @click=\"$emit('remove')\"\n >\n <CloseSmallIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </button>\n </div>\n</template>\n"],"mappings":""}
@@ -12,7 +12,7 @@ var h = ["aria-pressed", "disabled"], g = {
12
12
  viewBox: "0 0 16 16"
13
13
  }, _ = {
14
14
  key: 2,
15
- class: "inline-flex items-center gap-1.5 rounded-md bg-sui-sunken px-2 py-0.5 text-xs font-medium text-sui-ink-body"
15
+ class: "inline-flex items-center gap-1.5 rounded-md bg-sui-fill px-2 py-0.5 text-xs font-medium text-sui-ink-body"
16
16
  }, v = { class: "truncate" }, y = ["aria-label"], b = /*@__PURE__*/ c({
17
17
  __name: "Tag",
18
18
  props: /*@__PURE__*/ l({
@@ -50,13 +50,13 @@ var h = ["aria-pressed", "disabled"], g = {
50
50
  return (m, x) => c.pressable ? (d(), i("button", {
51
51
  key: 0,
52
52
  "aria-pressed": l.value,
53
- class: u(["inline-flex cursor-pointer items-center rounded-md border leading-none font-medium whitespace-nowrap transition-colors duration-150 outline-hidden focus-visible:sui-ring disabled:cursor-default disabled:opacity-50", [c.size === "sm" ? "h-5.5 gap-1 px-2 text-xs" : "h-7 gap-1.5 px-3 text-13", l.value ? "border-sui-accent-line bg-sui-accent-wash text-sui-accent enabled:hover:border-sui-accent-bright enabled:hover:bg-sui-accent-soft enabled:active:border-sui-accent-solid enabled:active:bg-sui-accent-soft" : "border-sui-line bg-sui-surface text-sui-ink-body enabled:hover:border-sui-line-strong enabled:hover:bg-sui-canvas enabled:hover:text-sui-ink enabled:active:bg-sui-sunken"]]),
53
+ class: u(["inline-flex cursor-pointer items-center rounded-full border leading-none font-medium whitespace-nowrap transition-colors duration-150 outline-hidden focus-visible:sui-ring disabled:cursor-default disabled:opacity-50", [c.size === "sm" ? "h-5.5 gap-1 px-2.5 text-xs" : "h-7 gap-1.5 px-3 text-13", l.value ? "border-sui-accent-line bg-sui-accent-wash text-sui-accent enabled:hover:border-sui-accent-bright enabled:hover:bg-sui-accent-soft enabled:active:border-sui-accent-solid enabled:active:bg-sui-accent-soft" : "border-sui-fill-line bg-sui-fill text-sui-ink-emphasis enabled:hover:bg-sui-fill-hover enabled:hover:text-sui-ink"]]),
54
54
  disabled: c.disabled,
55
55
  type: "button",
56
56
  onClick: x[0] ||= (e) => l.value = !l.value
57
57
  }, [l.value ? (d(), i("svg", g, [...x[2] ||= [a("path", { d: "M3.5 8.25l3 3 6-6.5" }, null, -1)]])) : r("", !0), f(m.$slots, "default", {}, () => [o(p(c.name), 1)])], 10, h)) : c.variant === "outline" ? (d(), i("span", {
58
58
  key: 1,
59
- class: u(["inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs whitespace-nowrap", c.muted ? "border-sui-line-subtle text-sui-ink-muted" : "border-sui-line bg-sui-sunken font-medium text-sui-ink"])
59
+ class: u(["inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs whitespace-nowrap", c.muted ? "border-sui-line-subtle text-sui-ink-muted" : "border-sui-line bg-sui-fill font-medium text-sui-ink"])
60
60
  }, [c.icon ? (d(), n(e, {
61
61
  key: 0,
62
62
  class: "size-3.5 shrink-0",
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.vue_vue_type_script_setup_true_lang.js","names":["$emit","_useModel","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_createCommentVNode","_renderSlot","_createTextVNode","_toDisplayString","_createBlock","Icon","_createVNode","CloseSmallIcon","Icon_default","CloseSmallIcon_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","Tag_vue_vue_type_script_setup_true_lang_default","\"pressed\"","\"pressedModifiers\"","pressed","useModel","__props","dots","openBlock","createElementBlock","normalizeClass","_cache","createElementVNode","createCommentVNode","renderSlot","_ctx","createTextVNode","toDisplayString","createBlock","createVNode"],"sources":["../../../src/components/Tag/Tag.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Hue } from '../../utils/hues'\nimport Icon from '../Icon/Icon.vue'\nimport type { IconColor } from '../Icon/colors'\nimport CloseSmallIcon from '../internal/CloseSmallIcon.vue'\n\nexport interface TagProps {\n /** The text; or use the default slot. */\n name?: string\n /** soft: a label people create, with an optional hue dot, removable. outline: a value from a fixed set (a stage, a status). */\n variant?: 'soft' | 'outline'\n /** soft only: a dot of the tag's own hue, on a neutral chip. */\n color?: Hue\n /** soft and outline: a 14px icon before the name, through the app's icon resolver, in place of the dot. */\n icon?: string\n /** The icon's colour; ink-subtle by default. */\n iconColor?: IconColor\n /** outline only: the quieter, superseded side, e.g. the \"from\" of a stage change. */\n muted?: boolean\n /** soft only. */\n removable?: boolean\n /** The remove button's accessible name. */\n removeLabel?: string\n /** A toggle button for quick choices, bound to `v-model:pressed`. Group several in a `role=\"group\"` with a label. */\n pressable?: boolean\n /** pressable only. */\n disabled?: boolean\n /** pressable only: md is 28px, sm 22px for a dense row of filters. */\n size?: 'sm' | 'md'\n}\n\nwithDefaults(defineProps<TagProps>(), {\n name: undefined,\n variant: 'soft',\n color: undefined,\n icon: undefined,\n iconColor: 'ink-subtle',\n removeLabel: 'Remove tag',\n size: 'md'\n})\n\ndefineEmits<{ remove: [] }>()\n\nconst pressed = defineModel<boolean>('pressed', { default: false })\n\nconst dots: Record<Hue, string> = {\n blue: 'bg-sui-hue-blue-ink',\n green: 'bg-sui-hue-green-ink',\n orange: 'bg-sui-hue-orange-ink',\n pink: 'bg-sui-hue-pink-ink',\n purple: 'bg-sui-hue-purple-ink',\n slate: 'bg-sui-hue-slate-ink',\n red: 'bg-sui-hue-red-ink',\n amber: 'bg-sui-hue-amber-ink',\n gray: 'bg-sui-ink'\n}\n</script>\n\n<!-- A label: soft for the ones people create, outline for a value from a fixed set; or, pressable, a toggle chip. -->\n<template>\n <button\n v-if=\"pressable\"\n :aria-pressed=\"pressed\"\n class=\"inline-flex cursor-pointer items-center rounded-md border leading-none font-medium whitespace-nowrap transition-colors duration-150 outline-hidden focus-visible:sui-ring disabled:cursor-default disabled:opacity-50\"\n :class=\"[\n size === 'sm' ? 'h-5.5 gap-1 px-2 text-xs' : 'h-7 gap-1.5 px-3 text-13',\n pressed\n ? 'border-sui-accent-line bg-sui-accent-wash text-sui-accent enabled:hover:border-sui-accent-bright enabled:hover:bg-sui-accent-soft enabled:active:border-sui-accent-solid enabled:active:bg-sui-accent-soft'\n : 'border-sui-line bg-sui-surface text-sui-ink-body enabled:hover:border-sui-line-strong enabled:hover:bg-sui-canvas enabled:hover:text-sui-ink enabled:active:bg-sui-sunken'\n ]\"\n :disabled=\"disabled\"\n type=\"button\"\n @click=\"pressed = !pressed\"\n >\n <svg\n v-if=\"pressed\"\n aria-hidden=\"true\"\n class=\"-ml-0.5 size-3 shrink-0 fill-none stroke-current\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.75\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M3.5 8.25l3 3 6-6.5\" />\n </svg>\n <slot>{{ name }}</slot>\n </button>\n <span\n v-else-if=\"variant === 'outline'\"\n class=\"inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs whitespace-nowrap\"\n :class=\"\n muted ? 'border-sui-line-subtle text-sui-ink-muted' : 'border-sui-line bg-sui-sunken font-medium text-sui-ink'\n \"\n >\n <Icon v-if=\"icon\" class=\"size-3.5 shrink-0\" :color=\"iconColor\" :name=\"icon\" />\n <slot>{{ name }}</slot>\n </span>\n <div\n v-else\n class=\"inline-flex items-center gap-1.5 rounded-md bg-sui-sunken px-2 py-0.5 text-xs font-medium text-sui-ink-body\"\n >\n <Icon v-if=\"icon\" class=\"size-3.5 shrink-0\" :color=\"iconColor\" :name=\"icon\" />\n <span v-else-if=\"color\" class=\"h-1.5 w-1.5 shrink-0 rounded-full\" :class=\"dots[color]\" />\n <span class=\"truncate\"\n ><slot>{{ name }}</slot></span\n >\n <button\n v-if=\"removable\"\n :aria-label=\"removeLabel\"\n class=\"-mr-0.5 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full transition-colors hover:bg-sui-line focus-visible:sui-ring\"\n type=\"button\"\n @click=\"$emit('remove')\"\n >\n <CloseSmallIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,IAAMwB,IAAUvB,EAAoByB,GAAC,SAA6B,GAE5DC,IAA4B;GAChC,MAAM;GACN,OAAO;GACP,QAAQ;GACR,MAAM;GACN,QAAQ;GACR,OAAO;GACP,KAAK;GACL,OAAO;GACP,MAAM;EACR;E,iBAMUD,EAAA,aADRxB,EAAA,GAAAC,EA0BS,UAAA;;GAxBN,gBAAcqB,EAAA;GACf,OAAKpB,EAAA,CAAC,yNAAuN,CAC7MsB,EAAA,SAAI,OAAA,6BAAA,4BAA2EF,EAAA,Q;GAM9F,UAAUE,EAAA;GACX,MAAK;GACJ,SAAK,AAAAK,EAAA,QAAA,MAAE,EAAA,QAAO,CAAIP,EAAA;E,IAGXA,EAAA,SADRtB,EAAA,GAAAC,EAUM,OAVNc,GAUM,CAAA,GAAA,AAAAc,EAAA,OAAA,CADJ1B,EAAgC,QAAA,EAA1B,GAAE,sBAAqB,GAAA,MAAA,EAAA,C,kBAE/BE,EAAuB4B,EAAA,QAAA,WAAA,CAAA,SAAA,CAAd3B,EAAAC,EAAAiB,EAAA,IAAI,GAAA,CAAA,C,eAGFA,EAAA,YAAO,aADpBxB,EAAA,GAAAC,EASO,QAAA;;GAPL,OAAKC,EAAA,CAAC,0FACSsB,EAAA,QAAK,8CAAA,wD;E,IAIRA,EAAA,QAAZxB,EAAA,GAAAQ,EAA8EC,GAAA;;GAA5D,OAAM;GAAqB,OAAOe,EAAA;GAAY,MAAMA,EAAA;E,6CACtEnB,EAAuB4B,EAAA,QAAA,WAAA,CAAA,SAAA,CAAd3B,EAAAC,EAAAiB,EAAA,IAAI,GAAA,CAAA,C,YAEfxB,EAAA,GAAAC,EAkBM,OAlBNe,GAkBM;GAdQQ,EAAA,QAAZxB,EAAA,GAAAQ,EAA8EC,GAAA;;IAA5D,OAAM;IAAqB,OAAOe,EAAA;IAAY,MAAMA,EAAA;G,kCACrDA,EAAA,SAAjBxB,EAAA,GAAAC,EAAyF,QAAA;;IAAjE,OAAKC,EAAA,CAAC,qCAA4CuB,EAAKD,EAAA,MAAK,CAAA;;GACpFrB,EAEC,QAFDc,GAEC,CADEZ,EAAuB4B,EAAA,QAAA,WAAA,CAAA,SAAA,CAAd3B,EAAAC,EAAAiB,EAAA,IAAI,GAAA,CAAA,C;GAGRA,EAAA,aADRxB,EAAA,GAAAC,EAQS,UAAA;;IANN,cAAYuB,EAAA;IACb,OAAM;IACN,MAAK;IACJ,SAAK,AAAAK,EAAA,QAAA,MAAE/B,EAAAA,MAAK,QAAA;G,IAEbY,EAAkEC,GAAA,EAAlD,OAAM,0CAAyC,CAAA,C"}
1
+ {"version":3,"file":"Tag.vue_vue_type_script_setup_true_lang.js","names":["$emit","_useModel","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_createCommentVNode","_renderSlot","_createTextVNode","_toDisplayString","_createBlock","Icon","_createVNode","CloseSmallIcon","Icon_default","CloseSmallIcon_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","Tag_vue_vue_type_script_setup_true_lang_default","\"pressed\"","\"pressedModifiers\"","pressed","useModel","__props","dots","openBlock","createElementBlock","normalizeClass","_cache","createElementVNode","createCommentVNode","renderSlot","_ctx","createTextVNode","toDisplayString","createBlock","createVNode"],"sources":["../../../src/components/Tag/Tag.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Hue } from '../../utils/hues'\nimport Icon from '../Icon/Icon.vue'\nimport type { IconColor } from '../Icon/colors'\nimport CloseSmallIcon from '../internal/CloseSmallIcon.vue'\n\nexport interface TagProps {\n /** The text; or use the default slot. */\n name?: string\n /** soft: a label people create, with an optional hue dot, removable. outline: a value from a fixed set (a stage, a status). */\n variant?: 'soft' | 'outline'\n /** soft only: a dot of the tag's own hue, on a neutral chip. */\n color?: Hue\n /** soft and outline: a 14px icon before the name, through the app's icon resolver, in place of the dot. */\n icon?: string\n /** The icon's colour; ink-subtle by default. */\n iconColor?: IconColor\n /** outline only: the quieter, superseded side, e.g. the \"from\" of a stage change. */\n muted?: boolean\n /** soft only. */\n removable?: boolean\n /** The remove button's accessible name. */\n removeLabel?: string\n /** A toggle button for quick choices, bound to `v-model:pressed`. Group several in a `role=\"group\"` with a label. */\n pressable?: boolean\n /** pressable only. */\n disabled?: boolean\n /** pressable only: md is 28px, sm 22px for a dense row of filters. */\n size?: 'sm' | 'md'\n}\n\nwithDefaults(defineProps<TagProps>(), {\n name: undefined,\n variant: 'soft',\n color: undefined,\n icon: undefined,\n iconColor: 'ink-subtle',\n removeLabel: 'Remove tag',\n size: 'md'\n})\n\ndefineEmits<{ remove: [] }>()\n\nconst pressed = defineModel<boolean>('pressed', { default: false })\n\nconst dots: Record<Hue, string> = {\n blue: 'bg-sui-hue-blue-ink',\n green: 'bg-sui-hue-green-ink',\n orange: 'bg-sui-hue-orange-ink',\n pink: 'bg-sui-hue-pink-ink',\n purple: 'bg-sui-hue-purple-ink',\n slate: 'bg-sui-hue-slate-ink',\n red: 'bg-sui-hue-red-ink',\n amber: 'bg-sui-hue-amber-ink',\n gray: 'bg-sui-ink'\n}\n</script>\n\n<!-- A label: soft for the ones people create, outline for a value from a fixed set; or, pressable, a toggle chip. -->\n<template>\n <button\n v-if=\"pressable\"\n :aria-pressed=\"pressed\"\n class=\"inline-flex cursor-pointer items-center rounded-full border leading-none font-medium whitespace-nowrap transition-colors duration-150 outline-hidden focus-visible:sui-ring disabled:cursor-default disabled:opacity-50\"\n :class=\"[\n size === 'sm' ? 'h-5.5 gap-1 px-2.5 text-xs' : 'h-7 gap-1.5 px-3 text-13',\n pressed\n ? 'border-sui-accent-line bg-sui-accent-wash text-sui-accent enabled:hover:border-sui-accent-bright enabled:hover:bg-sui-accent-soft enabled:active:border-sui-accent-solid enabled:active:bg-sui-accent-soft'\n : 'border-sui-fill-line bg-sui-fill text-sui-ink-emphasis enabled:hover:bg-sui-fill-hover enabled:hover:text-sui-ink'\n ]\"\n :disabled=\"disabled\"\n type=\"button\"\n @click=\"pressed = !pressed\"\n >\n <svg\n v-if=\"pressed\"\n aria-hidden=\"true\"\n class=\"-ml-0.5 size-3 shrink-0 fill-none stroke-current\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.75\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M3.5 8.25l3 3 6-6.5\" />\n </svg>\n <slot>{{ name }}</slot>\n </button>\n <span\n v-else-if=\"variant === 'outline'\"\n class=\"inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs whitespace-nowrap\"\n :class=\"\n muted ? 'border-sui-line-subtle text-sui-ink-muted' : 'border-sui-line bg-sui-fill font-medium text-sui-ink'\n \"\n >\n <Icon v-if=\"icon\" class=\"size-3.5 shrink-0\" :color=\"iconColor\" :name=\"icon\" />\n <slot>{{ name }}</slot>\n </span>\n <div\n v-else\n class=\"inline-flex items-center gap-1.5 rounded-md bg-sui-fill px-2 py-0.5 text-xs font-medium text-sui-ink-body\"\n >\n <Icon v-if=\"icon\" class=\"size-3.5 shrink-0\" :color=\"iconColor\" :name=\"icon\" />\n <span v-else-if=\"color\" class=\"h-1.5 w-1.5 shrink-0 rounded-full\" :class=\"dots[color]\" />\n <span class=\"truncate\"\n ><slot>{{ name }}</slot></span\n >\n <button\n v-if=\"removable\"\n :aria-label=\"removeLabel\"\n class=\"-mr-0.5 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full transition-colors hover:bg-sui-line focus-visible:sui-ring\"\n type=\"button\"\n @click=\"$emit('remove')\"\n >\n <CloseSmallIcon class=\"fill-sui-ink-muted stroke-sui-ink-muted\" />\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,IAAMwB,IAAUvB,EAAoByB,GAAC,SAA6B,GAE5DC,IAA4B;GAChC,MAAM;GACN,OAAO;GACP,QAAQ;GACR,MAAM;GACN,QAAQ;GACR,OAAO;GACP,KAAK;GACL,OAAO;GACP,MAAM;EACR;E,iBAMUD,EAAA,aADRxB,EAAA,GAAAC,EA0BS,UAAA;;GAxBN,gBAAcqB,EAAA;GACf,OAAKpB,EAAA,CAAC,2NAAyN,CAC/MsB,EAAA,SAAI,OAAA,+BAAA,4BAA6EF,EAAA,Q;GAMhG,UAAUE,EAAA;GACX,MAAK;GACJ,SAAK,AAAAK,EAAA,QAAA,MAAE,EAAA,QAAO,CAAIP,EAAA;E,IAGXA,EAAA,SADRtB,EAAA,GAAAC,EAUM,OAVNc,GAUM,CAAA,GAAA,AAAAc,EAAA,OAAA,CADJ1B,EAAgC,QAAA,EAA1B,GAAE,sBAAqB,GAAA,MAAA,EAAA,C,kBAE/BE,EAAuB4B,EAAA,QAAA,WAAA,CAAA,SAAA,CAAd3B,EAAAC,EAAAiB,EAAA,IAAI,GAAA,CAAA,C,eAGFA,EAAA,YAAO,aADpBxB,EAAA,GAAAC,EASO,QAAA;;GAPL,OAAKC,EAAA,CAAC,0FACSsB,EAAA,QAAK,8CAAA,sD;E,IAIRA,EAAA,QAAZxB,EAAA,GAAAQ,EAA8EC,GAAA;;GAA5D,OAAM;GAAqB,OAAOe,EAAA;GAAY,MAAMA,EAAA;E,6CACtEnB,EAAuB4B,EAAA,QAAA,WAAA,CAAA,SAAA,CAAd3B,EAAAC,EAAAiB,EAAA,IAAI,GAAA,CAAA,C,YAEfxB,EAAA,GAAAC,EAkBM,OAlBNe,GAkBM;GAdQQ,EAAA,QAAZxB,EAAA,GAAAQ,EAA8EC,GAAA;;IAA5D,OAAM;IAAqB,OAAOe,EAAA;IAAY,MAAMA,EAAA;G,kCACrDA,EAAA,SAAjBxB,EAAA,GAAAC,EAAyF,QAAA;;IAAjE,OAAKC,EAAA,CAAC,qCAA4CuB,EAAKD,EAAA,MAAK,CAAA;;GACpFrB,EAEC,QAFDc,GAEC,CADEZ,EAAuB4B,EAAA,QAAA,WAAA,CAAA,SAAA,CAAd3B,EAAAC,EAAAiB,EAAA,IAAI,GAAA,CAAA,C;GAGRA,EAAA,aADRxB,EAAA,GAAAC,EAQS,UAAA;;IANN,cAAYuB,EAAA;IACb,OAAM;IACN,MAAK;IACJ,SAAK,AAAAK,EAAA,QAAA,MAAE/B,EAAAA,MAAK,QAAA;G,IAEbY,EAAkEC,GAAA,EAAlD,OAAM,0CAAyC,CAAA,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","names":["_sfc_main","Textarea_vue_vue_type_script_setup_true_lang_default","Textarea_default"],"sources":["../../../src/components/Textarea/Textarea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { nextTick, onBeforeUnmount, onMounted, useTemplateRef, watch } from 'vue'\n\nimport { useFieldControl } from '../FormField/context'\n\nexport interface TextareaProps {\n /** Grows with its content instead of scrolling. */\n autoResize?: boolean\n /** Marks the field as failing validation: a danger border and `aria-invalid`. */\n invalid?: boolean\n disabled?: boolean\n}\n\nconst props = defineProps<TextareaProps>()\n\nconst model = defineModel<string | null>()\n\nconst textarea = useTemplateRef<HTMLTextAreaElement>('textarea')\n\nconst { attrs: fieldAttrs, invalid: isInvalid } = useFieldControl(\n () => model.value,\n () => props.invalid\n)\n\n// Grows straight to the content's height, and only drops to `auto` to measure when shrinking.\nfunction resize() {\n const el = textarea.value\n if (!props.autoResize || !el?.offsetParent) return\n const current = parseInt(el.style.height) || 0\n const needed = el.scrollHeight\n if (current && needed < current) {\n el.style.height = 'auto'\n el.style.height = `${el.scrollHeight}px`\n } else if (!current || needed > current) {\n el.style.height = `${needed}px`\n }\n}\n\nlet observer: ResizeObserver | undefined\n\nonMounted(() => {\n if (!props.autoResize || !textarea.value) return\n observer = new ResizeObserver(() => requestAnimationFrame(resize))\n observer.observe(textarea.value)\n})\n\nonBeforeUnmount(() => observer?.disconnect())\n\nwatch(model, () => nextTick(resize))\n</script>\n\n<template>\n <textarea\n ref=\"textarea\"\n v-bind=\"fieldAttrs\"\n :aria-invalid=\"isInvalid ? 'true' : undefined\"\n class=\"m-0 w-full appearance-none rounded-md border bg-sui-surface px-3 py-1.5 font-sans text-sm leading-5 text-sui-ink transition-[border-color,box-shadow] duration-200 placeholder:text-sui-ink-faint\"\n :class=\"[\n isInvalid ? 'border-sui-danger-mid' : 'border-sui-line-strong hover:border-sui-ink-muted',\n disabled\n ? 'pointer-events-none cursor-default opacity-60 select-none'\n : 'focus:border-sui-accent focus:ring-0 focus-visible:sui-ring-field'\n ]\"\n :disabled=\"disabled\"\n :value=\"model ?? ''\"\n @input=\"model = ($event.target as HTMLTextAreaElement).value\"\n />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Textarea.js","names":["_sfc_main","Textarea_vue_vue_type_script_setup_true_lang_default","Textarea_default"],"sources":["../../../src/components/Textarea/Textarea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { nextTick, onBeforeUnmount, onMounted, useTemplateRef, watch } from 'vue'\n\nimport { useFieldControl } from '../FormField/context'\n\nexport interface TextareaProps {\n /** Grows with its content instead of scrolling. */\n autoResize?: boolean\n /** Marks the field as failing validation: a danger border and `aria-invalid`. */\n invalid?: boolean\n disabled?: boolean\n /** No box: for when the text is the thing being made (a note, a message), filling a dialog edge to edge. Give it an\n * `aria-label` or a visually hidden label. */\n bare?: boolean\n}\n\nconst props = defineProps<TextareaProps>()\n\nconst model = defineModel<string | null>()\n\nconst textarea = useTemplateRef<HTMLTextAreaElement>('textarea')\n\nconst { attrs: fieldAttrs, invalid: isInvalid } = useFieldControl(\n () => model.value,\n () => props.invalid\n)\n\n// Grows straight to the content's height, and only drops to `auto` to measure when shrinking.\nfunction resize() {\n const el = textarea.value\n if (!props.autoResize || !el?.offsetParent) return\n const current = parseInt(el.style.height) || 0\n const needed = el.scrollHeight\n if (current && needed < current) {\n el.style.height = 'auto'\n el.style.height = `${el.scrollHeight}px`\n } else if (!current || needed > current) {\n el.style.height = `${needed}px`\n }\n}\n\nlet observer: ResizeObserver | undefined\n\nonMounted(() => {\n if (!props.autoResize || !textarea.value) return\n observer = new ResizeObserver(() => requestAnimationFrame(resize))\n observer.observe(textarea.value)\n})\n\nonBeforeUnmount(() => observer?.disconnect())\n\nwatch(model, () => nextTick(resize))\n</script>\n\n<template>\n <textarea\n ref=\"textarea\"\n v-bind=\"fieldAttrs\"\n :aria-invalid=\"isInvalid ? 'true' : undefined\"\n class=\"m-0 w-full appearance-none font-sans text-sui-ink placeholder:text-sui-ink-faint\"\n :class=\"[\n bare\n ? 'resize-none border-0 bg-transparent p-0 text-sm leading-[1.55] shadow-none outline-hidden focus:border-0 focus:shadow-none focus:ring-0 focus:outline-hidden'\n : [\n 'rounded-lg border bg-sui-fill px-3 py-1.5 text-sm leading-5 transition-[border-color,box-shadow,background-color] duration-200',\n isInvalid ? 'border-sui-danger-mid' : 'border-sui-fill-line hover:bg-sui-fill-hover',\n !disabled && 'focus:border-sui-accent focus:bg-transparent focus:ring-0 focus-visible:sui-ring-field'\n ],\n disabled && 'pointer-events-none cursor-default opacity-60 select-none'\n ]\"\n :disabled=\"disabled\"\n :value=\"model ?? ''\"\n @input=\"model = ($event.target as HTMLTextAreaElement).value\"\n />\n</template>\n"],"mappings":""}
@@ -4,6 +4,9 @@ export interface TextareaProps {
4
4
  /** Marks the field as failing validation: a danger border and `aria-invalid`. */
5
5
  invalid?: boolean;
6
6
  disabled?: boolean;
7
+ /** No box: for when the text is the thing being made (a note, a message), filling a dialog edge to edge. Give it an
8
+ * `aria-label` or a visually hidden label. */
9
+ bare?: boolean;
7
10
  }
8
11
  type __VLS_Props = TextareaProps;
9
12
  type __VLS_ModelProps = {
@@ -10,7 +10,8 @@ var p = [
10
10
  props: /*@__PURE__*/ r({
11
11
  autoResize: { type: Boolean },
12
12
  invalid: { type: Boolean },
13
- disabled: { type: Boolean }
13
+ disabled: { type: Boolean },
14
+ bare: { type: Boolean }
14
15
  }, {
15
16
  modelValue: {},
16
17
  modelModifiers: {}
@@ -32,7 +33,11 @@ var p = [
32
33
  ref: h
33
34
  }, l(g), {
34
35
  "aria-invalid": l(_) ? "true" : void 0,
35
- class: ["m-0 w-full appearance-none rounded-md border bg-sui-surface px-3 py-1.5 font-sans text-sm leading-5 text-sui-ink transition-[border-color,box-shadow] duration-200 placeholder:text-sui-ink-faint", [l(_) ? "border-sui-danger-mid" : "border-sui-line-strong hover:border-sui-ink-muted", n.disabled ? "pointer-events-none cursor-default opacity-60 select-none" : "focus:border-sui-accent focus:ring-0 focus-visible:sui-ring-field"]],
36
+ class: ["m-0 w-full appearance-none font-sans text-sui-ink placeholder:text-sui-ink-faint", [n.bare ? "resize-none border-0 bg-transparent p-0 text-sm leading-[1.55] shadow-none outline-hidden focus:border-0 focus:shadow-none focus:ring-0 focus:outline-hidden" : [
37
+ "rounded-lg border bg-sui-fill px-3 py-1.5 text-sm leading-5 transition-[border-color,box-shadow,background-color] duration-200",
38
+ l(_) ? "border-sui-danger-mid" : "border-sui-fill-line hover:bg-sui-fill-hover",
39
+ !n.disabled && "focus:border-sui-accent focus:bg-transparent focus:ring-0 focus-visible:sui-ring-field"
40
+ ], n.disabled && "pointer-events-none cursor-default opacity-60 select-none"]],
36
41
  disabled: n.disabled,
37
42
  value: m.value ?? "",
38
43
  onInput: r[0] ||= (e) => m.value = e.target.value
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createElementBlock","_mergeProps","_unref","_hoisted_1","Textarea_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","props","__props","model","useModel","textarea","useTemplateRef","fieldAttrs","isInvalid","useFieldControl","resize","el","current","needed","observer","onMounted","onBeforeUnmount","watch","nextTick","openBlock","createElementBlock","mergeProps","unref","_cache","$event"],"sources":["../../../src/components/Textarea/Textarea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { nextTick, onBeforeUnmount, onMounted, useTemplateRef, watch } from 'vue'\n\nimport { useFieldControl } from '../FormField/context'\n\nexport interface TextareaProps {\n /** Grows with its content instead of scrolling. */\n autoResize?: boolean\n /** Marks the field as failing validation: a danger border and `aria-invalid`. */\n invalid?: boolean\n disabled?: boolean\n}\n\nconst props = defineProps<TextareaProps>()\n\nconst model = defineModel<string | null>()\n\nconst textarea = useTemplateRef<HTMLTextAreaElement>('textarea')\n\nconst { attrs: fieldAttrs, invalid: isInvalid } = useFieldControl(\n () => model.value,\n () => props.invalid\n)\n\n// Grows straight to the content's height, and only drops to `auto` to measure when shrinking.\nfunction resize() {\n const el = textarea.value\n if (!props.autoResize || !el?.offsetParent) return\n const current = parseInt(el.style.height) || 0\n const needed = el.scrollHeight\n if (current && needed < current) {\n el.style.height = 'auto'\n el.style.height = `${el.scrollHeight}px`\n } else if (!current || needed > current) {\n el.style.height = `${needed}px`\n }\n}\n\nlet observer: ResizeObserver | undefined\n\nonMounted(() => {\n if (!props.autoResize || !textarea.value) return\n observer = new ResizeObserver(() => requestAnimationFrame(resize))\n observer.observe(textarea.value)\n})\n\nonBeforeUnmount(() => observer?.disconnect())\n\nwatch(model, () => nextTick(resize))\n</script>\n\n<template>\n <textarea\n ref=\"textarea\"\n v-bind=\"fieldAttrs\"\n :aria-invalid=\"isInvalid ? 'true' : undefined\"\n class=\"m-0 w-full appearance-none rounded-md border bg-sui-surface px-3 py-1.5 font-sans text-sm leading-5 text-sui-ink transition-[border-color,box-shadow] duration-200 placeholder:text-sui-ink-faint\"\n :class=\"[\n isInvalid ? 'border-sui-danger-mid' : 'border-sui-line-strong hover:border-sui-ink-muted',\n disabled\n ? 'pointer-events-none cursor-default opacity-60 select-none'\n : 'focus:border-sui-accent focus:ring-0 focus-visible:sui-ring-field'\n ]\"\n :disabled=\"disabled\"\n :value=\"model ?? ''\"\n @input=\"model = ($event.target as HTMLTextAreaElement).value\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAaA,IAAMS,IAAQC,GAERC,IAAQX,EAA0BU,GAAA,YAAC,GAEnCG,IAAWC,EAAoC,UAAU,GAEzD,EAAE,OAAOC,GAAY,SAASC,MAAcC,QAC1CN,EAAM,aACNF,EAAM,OACd;EAGA,SAASS,IAAS;GAChB,IAAMC,IAAKN,EAAS;GACpB,IAAI,CAACJ,EAAM,cAAc,CAACU,GAAI,cAAc;GAC5C,IAAMC,IAAU,SAASD,EAAG,MAAM,MAAM,KAAK,GACvCE,IAASF,EAAG;GAClB,AAAIC,KAAWC,IAASD,KACtB,EAAG,MAAM,SAAS,QAClB,EAAG,MAAM,SAAS,GAAGD,EAAG,aAAa,QAC5B,CAACC,KAAWC,IAASD,OAC9B,EAAG,MAAM,SAAS,GAAGC,EAAO;EAEhC;EAEA,IAAIC;E,OAEJC,QAAgB;GACd,AAAKd,EAAM,cAAeI,EAAS,UACnC,IAAW,IAAI,qBAAqB,sBAAsBK,CAAM,CAAC,GACjEI,EAAS,QAAQT,EAAS,KAAK;EACjC,CAAC,GAEDW,QAAsBF,GAAU,WAAW,CAAC,GAE5CG,EAAMd,SAAae,EAASR,CAAM,CAAC,I,UAIjCjB,EAAA,GAAAC,EAcE,YAdFC,EAcE;GAbI,SAAA;GAAJ,KAAIU;EACI,GAAAT,EAAAW,CAAA,GAAU;GACjB,gBAAcX,EAAAY,CAAA,IAAS,SAAY,KAAA;GACpC,OAAK,CAAC,qMAAmM,CACzLZ,EAAAY,CAAA,IAAS,0BAAA,qDAAwFN,EAAA,W;GAMhH,UAAUA,EAAA;GACV,OAAOC,EAAA,SAAK;GACZ,SAAK,AAAAoB,EAAA,QAAA,MAAE,EAAA,QAASC,EAAO,OAA+B"}
1
+ {"version":3,"file":"Textarea.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createElementBlock","_mergeProps","_unref","_hoisted_1","Textarea_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","props","__props","model","useModel","textarea","useTemplateRef","fieldAttrs","isInvalid","useFieldControl","resize","el","current","needed","observer","onMounted","onBeforeUnmount","watch","nextTick","openBlock","createElementBlock","mergeProps","unref","_cache","$event"],"sources":["../../../src/components/Textarea/Textarea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { nextTick, onBeforeUnmount, onMounted, useTemplateRef, watch } from 'vue'\n\nimport { useFieldControl } from '../FormField/context'\n\nexport interface TextareaProps {\n /** Grows with its content instead of scrolling. */\n autoResize?: boolean\n /** Marks the field as failing validation: a danger border and `aria-invalid`. */\n invalid?: boolean\n disabled?: boolean\n /** No box: for when the text is the thing being made (a note, a message), filling a dialog edge to edge. Give it an\n * `aria-label` or a visually hidden label. */\n bare?: boolean\n}\n\nconst props = defineProps<TextareaProps>()\n\nconst model = defineModel<string | null>()\n\nconst textarea = useTemplateRef<HTMLTextAreaElement>('textarea')\n\nconst { attrs: fieldAttrs, invalid: isInvalid } = useFieldControl(\n () => model.value,\n () => props.invalid\n)\n\n// Grows straight to the content's height, and only drops to `auto` to measure when shrinking.\nfunction resize() {\n const el = textarea.value\n if (!props.autoResize || !el?.offsetParent) return\n const current = parseInt(el.style.height) || 0\n const needed = el.scrollHeight\n if (current && needed < current) {\n el.style.height = 'auto'\n el.style.height = `${el.scrollHeight}px`\n } else if (!current || needed > current) {\n el.style.height = `${needed}px`\n }\n}\n\nlet observer: ResizeObserver | undefined\n\nonMounted(() => {\n if (!props.autoResize || !textarea.value) return\n observer = new ResizeObserver(() => requestAnimationFrame(resize))\n observer.observe(textarea.value)\n})\n\nonBeforeUnmount(() => observer?.disconnect())\n\nwatch(model, () => nextTick(resize))\n</script>\n\n<template>\n <textarea\n ref=\"textarea\"\n v-bind=\"fieldAttrs\"\n :aria-invalid=\"isInvalid ? 'true' : undefined\"\n class=\"m-0 w-full appearance-none font-sans text-sui-ink placeholder:text-sui-ink-faint\"\n :class=\"[\n bare\n ? 'resize-none border-0 bg-transparent p-0 text-sm leading-[1.55] shadow-none outline-hidden focus:border-0 focus:shadow-none focus:ring-0 focus:outline-hidden'\n : [\n 'rounded-lg border bg-sui-fill px-3 py-1.5 text-sm leading-5 transition-[border-color,box-shadow,background-color] duration-200',\n isInvalid ? 'border-sui-danger-mid' : 'border-sui-fill-line hover:bg-sui-fill-hover',\n !disabled && 'focus:border-sui-accent focus:bg-transparent focus:ring-0 focus-visible:sui-ring-field'\n ],\n disabled && 'pointer-events-none cursor-default opacity-60 select-none'\n ]\"\n :disabled=\"disabled\"\n :value=\"model ?? ''\"\n @input=\"model = ($event.target as HTMLTextAreaElement).value\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAgBA,IAAMS,IAAQC,GAERC,IAAQX,EAA0BU,GAAA,YAAC,GAEnCG,IAAWC,EAAoC,UAAU,GAEzD,EAAE,OAAOC,GAAY,SAASC,MAAcC,QAC1CN,EAAM,aACNF,EAAM,OACd;EAGA,SAASS,IAAS;GAChB,IAAMC,IAAKN,EAAS;GACpB,IAAI,CAACJ,EAAM,cAAc,CAACU,GAAI,cAAc;GAC5C,IAAMC,IAAU,SAASD,EAAG,MAAM,MAAM,KAAK,GACvCE,IAASF,EAAG;GAClB,AAAIC,KAAWC,IAASD,KACtB,EAAG,MAAM,SAAS,QAClB,EAAG,MAAM,SAAS,GAAGD,EAAG,aAAa,QAC5B,CAACC,KAAWC,IAASD,OAC9B,EAAG,MAAM,SAAS,GAAGC,EAAO;EAEhC;EAEA,IAAIC;E,OAEJC,QAAgB;GACd,AAAKd,EAAM,cAAeI,EAAS,UACnC,IAAW,IAAI,qBAAqB,sBAAsBK,CAAM,CAAC,GACjEI,EAAS,QAAQT,EAAS,KAAK;EACjC,CAAC,GAEDW,QAAsBF,GAAU,WAAW,CAAC,GAE5CG,EAAMd,SAAae,EAASR,CAAM,CAAC,I,UAIjCjB,EAAA,GAAAC,EAkBE,YAlBFC,EAkBE;GAjBI,SAAA;GAAJ,KAAIU;EACI,GAAAT,EAAAW,CAAA,GAAU;GACjB,gBAAcX,EAAAY,CAAA,IAAS,SAAY,KAAA;GACpC,OAAK,CAAC,oFAAkF,CACxEN,EAAA,O;;IAAoVN,EAAAY,CAAA,IAAS,0BAAA;IAA0F,CAAAN,EAAA,YAAQ;G,GAAgHA,EAAA,YAAQ,2D;GAUtkB,UAAUA,EAAA;GACV,OAAOC,EAAA,SAAK;GACZ,SAAK,AAAAoB,EAAA,QAAA,MAAE,EAAA,QAASC,EAAO,OAA+B"}
@@ -39,8 +39,8 @@ export declare const menuConfirmDefaults: {
39
39
  deleteLabel: string;
40
40
  cancelLabel: string;
41
41
  };
42
- export declare const menuContentClass = "z-[1100] rounded-xl border border-sui-line-subtle bg-sui-surface p-1 shadow-lg outline-hidden data-[state=open]:animate-sui-menu-in";
43
- export declare const menuItemClass = "relative rounded-lg text-sm text-sui-ink transition-colors duration-150 outline-hidden hover:bg-sui-sunken focus-visible:sui-ring-inset data-highlighted:bg-sui-sunken";
42
+ export declare const menuContentClass = "z-[1100] rounded-xl border border-sui-edge bg-sui-raised p-1 shadow-lg outline-hidden data-[state=open]:animate-sui-menu-in";
43
+ export declare const menuItemClass = "relative rounded-lg text-sm text-sui-ink transition-colors duration-150 outline-hidden hover:bg-sui-fill-hover focus-visible:sui-ring-inset data-highlighted:bg-sui-fill-hover";
44
44
  export declare const menuSeparatorClass = "my-1 border-t border-sui-line-subtle";
45
45
  /** Runs an item: asks first when it says so, then emits it with the menu's `id`. */
46
46
  export declare function useMenuSelect(props: Required<Omit<MenuConfirmLabels, 'id'>> & {
@@ -7,7 +7,7 @@ var t = {
7
7
  confirmLabel: "Confirm",
8
8
  deleteLabel: "Delete",
9
9
  cancelLabel: "Cancel"
10
- }, n = "z-[1100] rounded-xl border border-sui-line-subtle bg-sui-surface p-1 shadow-lg outline-hidden data-[state=open]:animate-sui-menu-in", r = "relative rounded-lg text-sm text-sui-ink transition-colors duration-150 outline-hidden hover:bg-sui-sunken focus-visible:sui-ring-inset data-highlighted:bg-sui-sunken", i = "my-1 border-t border-sui-line-subtle";
10
+ }, n = "z-[1100] rounded-xl border border-sui-edge bg-sui-raised p-1 shadow-lg outline-hidden data-[state=open]:animate-sui-menu-in", r = "relative rounded-lg text-sm text-sui-ink transition-colors duration-150 outline-hidden hover:bg-sui-fill-hover focus-visible:sui-ring-inset data-highlighted:bg-sui-fill-hover", i = "my-1 border-t border-sui-line-subtle";
11
11
  function a(t, n) {
12
12
  let r = e();
13
13
  return async function(e, i) {
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","names":["menuConfirmDefaults","menuContentClass","menuItemClass","menuSeparatorClass","useMenuSelect","confirm","useConfirm","item","destructive","props"],"sources":["../../../src/components/internal/menu.ts"],"sourcesContent":["import { useConfirm } from '../../composables/useConfirm'\n\nexport interface DropdownMenuAction {\n type: 'action'\n label: string\n action?: string\n icon?: string\n variant?: 'danger'\n shortcut?: string\n /** Asks first, with this wording; `confirmed: true` asks with the generic wording. */\n confirm?: { message: string; title?: string; acceptLabel?: string }\n confirmed?: boolean\n /** Dimmed and inert, but still reached with the arrow keys and announced as unavailable. */\n disabled?: boolean\n /** Why it's disabled, shown under its label. */\n disabledReason?: string\n [key: string]: unknown\n}\n\nexport type DropdownMenuEntry = DropdownMenuAction | { type: 'separator' }\n\n/** The confirm step's wording, shared by DropdownMenu and ContextMenu. */\nexport interface MenuConfirmLabels {\n /** Passed back with every clicked item, e.g. the record the menu acts on. */\n id?: string\n confirmTitle?: string\n confirmMessage?: string\n confirmLabel?: string\n deleteLabel?: string\n cancelLabel?: string\n}\n\nexport const menuConfirmDefaults = {\n id: undefined,\n confirmTitle: 'Are you sure?',\n confirmMessage: \"This can't be undone.\",\n confirmLabel: 'Confirm',\n deleteLabel: 'Delete',\n cancelLabel: 'Cancel'\n}\n\nexport const menuContentClass =\n 'z-[1100] rounded-xl border border-sui-line-subtle bg-sui-surface p-1 shadow-lg outline-hidden data-[state=open]:animate-sui-menu-in'\nexport const menuItemClass =\n 'relative rounded-lg text-sm text-sui-ink transition-colors duration-150 outline-hidden hover:bg-sui-sunken focus-visible:sui-ring-inset data-highlighted:bg-sui-sunken'\nexport const menuSeparatorClass = 'my-1 border-t border-sui-line-subtle'\n\n/** Runs an item: asks first when it says so, then emits it with the menu's `id`. */\nexport function useMenuSelect(\n props: Required<Omit<MenuConfirmLabels, 'id'>> & { id?: string },\n emit: (item: DropdownMenuAction & { id?: string }) => void\n) {\n const confirm = useConfirm()\n\n return async function select(item: DropdownMenuAction, event?: Event) {\n if (item.disabled) {\n // Keeps the menu open.\n event?.preventDefault()\n return\n }\n if (item.confirm || item.confirmed) {\n const destructive = item.variant === 'danger' || item.action === 'delete'\n const confirmed = await confirm({\n title: item.confirm?.title ?? props.confirmTitle,\n message: item.confirm?.message ?? props.confirmMessage,\n cancelLabel: props.cancelLabel,\n confirmLabel: item.confirm?.acceptLabel ?? (item.action === 'delete' ? props.deleteLabel : props.confirmLabel),\n confirmVariant: destructive ? 'danger' : 'primary'\n })\n if (!confirmed) return\n }\n emit({ id: props.id, ...item })\n }\n}\n"],"mappings":";;AAgCA,IAAaA,IAAsB;CACjC,IAAI,KAAA;CACJ,cAAc;CACd,gBAAgB;CAChB,cAAc;CACd,aAAa;CACb,aAAa;AACf,GAEaC,IACX,uIACWC,IACX,0KACWC,IAAqB;AAGlC,SAAgBC,EACd,GACA,GACA;CACA,IAAMC,IAAUC,EAAW;CAE3B,OAAO,eAAsB,GAA0B,GAAe;EACpE,IAAIC,EAAK,UAEP,GAAO,eAAe;OAGxB;OAAIA,EAAK,WAAWA,EAAK,WAAW;IAClC,IAAMC,IAAcD,EAAK,YAAY,YAAYA,EAAK,WAAW;IAQjE,IAAI,CAAC,MAPmBF,EAAQ;KAC9B,OAAOE,EAAK,SAAS,SAASE,EAAM;KACpC,SAASF,EAAK,SAAS,WAAWE,EAAM;KACxC,aAAaA,EAAM;KACnB,cAAcF,EAAK,SAAS,gBAAgBA,EAAK,WAAW,WAAWE,EAAM,cAAcA,EAAM;KACjG,gBAAgBD,IAAc,WAAW;IAC3C,CAAC,GACe;GAClB;GACA,EAAK;IAAE,IAAIC,EAAM;IAAI,GAAGF;GAAK,CAAC;EAD9B;CAEF;AACF"}
1
+ {"version":3,"file":"menu.js","names":["menuConfirmDefaults","menuContentClass","menuItemClass","menuSeparatorClass","useMenuSelect","confirm","useConfirm","item","destructive","props"],"sources":["../../../src/components/internal/menu.ts"],"sourcesContent":["import { useConfirm } from '../../composables/useConfirm'\n\nexport interface DropdownMenuAction {\n type: 'action'\n label: string\n action?: string\n icon?: string\n variant?: 'danger'\n shortcut?: string\n /** Asks first, with this wording; `confirmed: true` asks with the generic wording. */\n confirm?: { message: string; title?: string; acceptLabel?: string }\n confirmed?: boolean\n /** Dimmed and inert, but still reached with the arrow keys and announced as unavailable. */\n disabled?: boolean\n /** Why it's disabled, shown under its label. */\n disabledReason?: string\n [key: string]: unknown\n}\n\nexport type DropdownMenuEntry = DropdownMenuAction | { type: 'separator' }\n\n/** The confirm step's wording, shared by DropdownMenu and ContextMenu. */\nexport interface MenuConfirmLabels {\n /** Passed back with every clicked item, e.g. the record the menu acts on. */\n id?: string\n confirmTitle?: string\n confirmMessage?: string\n confirmLabel?: string\n deleteLabel?: string\n cancelLabel?: string\n}\n\nexport const menuConfirmDefaults = {\n id: undefined,\n confirmTitle: 'Are you sure?',\n confirmMessage: \"This can't be undone.\",\n confirmLabel: 'Confirm',\n deleteLabel: 'Delete',\n cancelLabel: 'Cancel'\n}\n\nexport const menuContentClass =\n 'z-[1100] rounded-xl border border-sui-edge bg-sui-raised p-1 shadow-lg outline-hidden data-[state=open]:animate-sui-menu-in'\nexport const menuItemClass =\n 'relative rounded-lg text-sm text-sui-ink transition-colors duration-150 outline-hidden hover:bg-sui-fill-hover focus-visible:sui-ring-inset data-highlighted:bg-sui-fill-hover'\nexport const menuSeparatorClass = 'my-1 border-t border-sui-line-subtle'\n\n/** Runs an item: asks first when it says so, then emits it with the menu's `id`. */\nexport function useMenuSelect(\n props: Required<Omit<MenuConfirmLabels, 'id'>> & { id?: string },\n emit: (item: DropdownMenuAction & { id?: string }) => void\n) {\n const confirm = useConfirm()\n\n return async function select(item: DropdownMenuAction, event?: Event) {\n if (item.disabled) {\n // Keeps the menu open.\n event?.preventDefault()\n return\n }\n if (item.confirm || item.confirmed) {\n const destructive = item.variant === 'danger' || item.action === 'delete'\n const confirmed = await confirm({\n title: item.confirm?.title ?? props.confirmTitle,\n message: item.confirm?.message ?? props.confirmMessage,\n cancelLabel: props.cancelLabel,\n confirmLabel: item.confirm?.acceptLabel ?? (item.action === 'delete' ? props.deleteLabel : props.confirmLabel),\n confirmVariant: destructive ? 'danger' : 'primary'\n })\n if (!confirmed) return\n }\n emit({ id: props.id, ...item })\n }\n}\n"],"mappings":";;AAgCA,IAAaA,IAAsB;CACjC,IAAI,KAAA;CACJ,cAAc;CACd,gBAAgB;CAChB,cAAc;CACd,aAAa;CACb,aAAa;AACf,GAEaC,IACX,+HACWC,IACX,kLACWC,IAAqB;AAGlC,SAAgBC,EACd,GACA,GACA;CACA,IAAMC,IAAUC,EAAW;CAE3B,OAAO,eAAsB,GAA0B,GAAe;EACpE,IAAIC,EAAK,UAEP,GAAO,eAAe;OAGxB;OAAIA,EAAK,WAAWA,EAAK,WAAW;IAClC,IAAMC,IAAcD,EAAK,YAAY,YAAYA,EAAK,WAAW;IAQjE,IAAI,CAAC,MAPmBF,EAAQ;KAC9B,OAAOE,EAAK,SAAS,SAASE,EAAM;KACpC,SAASF,EAAK,SAAS,WAAWE,EAAM;KACxC,aAAaA,EAAM;KACnB,cAAcF,EAAK,SAAS,gBAAgBA,EAAK,WAAW,WAAWE,EAAM,cAAcA,EAAM;KACjG,gBAAgBD,IAAc,WAAW;IAC3C,CAAC,GACe;GAClB;GACA,EAAK;IAAE,IAAIC,EAAM;IAAI,GAAGF;GAAK,CAAC;EAD9B;CAEF;AACF"}
package/dist/index.js CHANGED
@@ -15,20 +15,20 @@ import m from "./components/Calendar/Calendar.js";
15
15
  import h from "./components/Checkbox/Checkbox.js";
16
16
  import g from "./components/ContextMenu/ContextMenu.js";
17
17
  import _ from "./components/DataList/DataList.js";
18
- import { saveHint as v } from "./components/Dialog/focus.js";
19
- import y from "./components/Dialog/Dialog.js";
20
- import b from "./components/DropdownMenu/DropdownMenu.js";
21
- import x from "./components/EmptyState/EmptyState.js";
22
- import S from "./components/ErrorSummary/ErrorSummary.js";
23
- import C from "./components/Input/Input.js";
24
- import w from "./components/SegmentedControl/SegmentedControl.js";
25
- import { datePresets as T, describeFilter as E, filterOperators as D, sortDirections as O } from "./components/Filters/defaults.js";
26
- import k from "./components/Filters/FilterChip.js";
27
- import A from "./components/Filters/FilterMenu.js";
28
- import j from "./components/Filters/SortMenu.js";
29
- import M from "./components/FormField/FormField.js";
30
- import N from "./components/ImageUpload/ImageUpload.js";
31
- import P from "./components/Kbd/Kbd.js";
18
+ import v from "./components/Kbd/Kbd.js";
19
+ import { saveHint as y } from "./components/Dialog/focus.js";
20
+ import b from "./components/Dialog/Dialog.js";
21
+ import x from "./components/DropdownMenu/DropdownMenu.js";
22
+ import S from "./components/EmptyState/EmptyState.js";
23
+ import C from "./components/ErrorSummary/ErrorSummary.js";
24
+ import w from "./components/Input/Input.js";
25
+ import T from "./components/SegmentedControl/SegmentedControl.js";
26
+ import { datePresets as E, describeFilter as D, filterOperators as O, sortDirections as k } from "./components/Filters/defaults.js";
27
+ import A from "./components/Filters/FilterChip.js";
28
+ import j from "./components/Filters/FilterMenu.js";
29
+ import M from "./components/Filters/SortMenu.js";
30
+ import N from "./components/FormField/FormField.js";
31
+ import P from "./components/ImageUpload/ImageUpload.js";
32
32
  import F from "./components/Meter/Meter.js";
33
33
  import I from "./components/Pagination/Pagination.js";
34
34
  import L from "./components/Popover/Popover.js";
@@ -50,4 +50,4 @@ import Q from "./components/Toolbar/Toolbar.js";
50
50
  import $ from "./components/TypingIndicator/TypingIndicator.js";
51
51
  import { initColorMode as ee, useColorMode as te, useForceLightMode as ne } from "./composables/useColorMode.js";
52
52
  import { Banner as re, BulkActions as ie, CalendarMonth as ae, Chip as oe, ConfirmDialog as se, Field as ce, FilterFieldPicker as le, FormErrors as ue, ImageInput as de, InlineField as fe, InlineForm as pe, LedgerMore as me, LedgerRow as he, List as ge, Modal as _e, OptionsMenu as ve, Pill as ye, SortControl as be, TextInput as xe, TypingDots as Se } from "./aliases.js";
53
- export { a as ActionBar, o as Alert, c as AlertDialog, u as Avatar, d as Badge, re as Banner, p as Board, ie as BulkActions, e as Button, m as Calendar, ae as CalendarMonth, h as Checkbox, oe as Chip, K as Collapsible, se as ConfirmDialog, g as ContextMenu, _ as DataList, y as Dialog, b as DropdownMenu, W as Editable, x as EmptyState, S as ErrorSummary, ce as Field, k as FilterChip, le as FilterFieldPicker, A as FilterMenu, ue as FormErrors, M as FormField, r as Icon, de as ImageInput, N as ImageUpload, fe as InlineField, pe as InlineForm, C as Input, P as Kbd, me as LedgerMore, he as LedgerRow, ge as List, F as Meter, _e as Modal, ve as OptionsMenu, I as Pagination, ye as Pill, L as Popover, R as PopoverDialog, z as PricingCard, G as PropertyList, q as PropertyRow, J as Radio, w as SegmentedControl, H as Select, f as Skeleton, be as SortControl, j as SortMenu, B as Spinner, Y as Table, V as Tag, xe as TextInput, U as Textarea, Z as Toaster, Q as Toolbar, i as Tooltip, Se as TypingDots, $ as TypingIndicator, T as datePresets, E as describeFilter, D as filterOperators, l as hueFor, t as iconNames, ee as initColorMode, v as saveHint, n as setIconResolver, O as sortDirections, X as toast, te as useColorMode, s as useConfirm, ne as useForceLightMode };
53
+ export { a as ActionBar, o as Alert, c as AlertDialog, u as Avatar, d as Badge, re as Banner, p as Board, ie as BulkActions, e as Button, m as Calendar, ae as CalendarMonth, h as Checkbox, oe as Chip, K as Collapsible, se as ConfirmDialog, g as ContextMenu, _ as DataList, b as Dialog, x as DropdownMenu, W as Editable, S as EmptyState, C as ErrorSummary, ce as Field, A as FilterChip, le as FilterFieldPicker, j as FilterMenu, ue as FormErrors, N as FormField, r as Icon, de as ImageInput, P as ImageUpload, fe as InlineField, pe as InlineForm, w as Input, v as Kbd, me as LedgerMore, he as LedgerRow, ge as List, F as Meter, _e as Modal, ve as OptionsMenu, I as Pagination, ye as Pill, L as Popover, R as PopoverDialog, z as PricingCard, G as PropertyList, q as PropertyRow, J as Radio, T as SegmentedControl, H as Select, f as Skeleton, be as SortControl, M as SortMenu, B as Spinner, Y as Table, V as Tag, xe as TextInput, U as Textarea, Z as Toaster, Q as Toolbar, i as Tooltip, Se as TypingDots, $ as TypingIndicator, E as datePresets, D as describeFilter, O as filterOperators, l as hueFor, t as iconNames, ee as initColorMode, y as saveHint, n as setIconResolver, k as sortDirections, X as toast, te as useColorMode, s as useConfirm, ne as useForceLightMode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparklingopinions/sparkling-ui",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "A product-agnostic Vue 3 component library, themed by semantic tokens",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,8 +28,8 @@
28
28
  --sui-ink-emphasis: 69 68 74;
29
29
  --sui-ink-body: 83 83 90;
30
30
  --sui-ink-subtle: 97 97 104;
31
- --sui-ink-muted: 111 111 117;
32
- --sui-ink-faint: 111 111 117;
31
+ --sui-ink-muted: 105 105 111;
32
+ --sui-ink-faint: 105 105 111;
33
33
  --sui-mark-faint: 185 185 191;
34
34
 
35
35
  /* Contrast */
@@ -105,8 +105,28 @@
105
105
  --sui-inverse: 69 68 74;
106
106
  --sui-on-inverse: 255 255 255;
107
107
 
108
- /* Behind dialogs, with an opacity modifier */
108
+ /* Behind dialogs, with an opacity modifier; dialogs use scrim-alpha, sheets their own */
109
109
  --sui-scrim: 0 0 0;
110
+ --sui-scrim-alpha: 0.1;
111
+
112
+ /* Floating layers (dialogs, sheets, popovers, menus) sit on raised, a step above the page in dark, with an edge */
113
+ --sui-raised: 255 255 255;
114
+ --sui-edge: 0 0 0;
115
+ --sui-edge-alpha: 0.08;
116
+ --sui-shadow-floating:
117
+ 0 2px 6px rgb(0 0 0 / 0.06), 0 12px 28px -6px rgb(0 0 0 / 0.18), 0 24px 70px -8px rgb(0 0 0 / 0.16);
118
+
119
+ /* Soft fills: ink at a low alpha, so controls read the same on any ground (fields, secondary buttons, chips, keys) */
120
+ --sui-fill: 0 0 0;
121
+ --sui-fill-alpha: 0.035;
122
+ --sui-fill-hover-alpha: 0.06;
123
+ --sui-fill-line-alpha: 0.07;
124
+
125
+ /* A segmented control's track, and the segment lifted out of it */
126
+ --sui-track: 0 0 0;
127
+ --sui-track-alpha: 0.045;
128
+ --sui-lifted: 255 255 255;
129
+ --sui-shadow-lifted: 0 1px 2px rgb(0 0 0 / 0.08), 0 0 0 1px rgb(0 0 0 / 0.06);
110
130
  }
111
131
 
112
132
  :where([data-mode='dark']) {
@@ -128,8 +148,8 @@
128
148
  --sui-ink-emphasis: 204 204 209;
129
149
  --sui-ink-body: 182 182 188;
130
150
  --sui-ink-subtle: 162 162 169;
131
- --sui-ink-muted: 142 142 149;
132
- --sui-ink-faint: 142 142 149;
151
+ --sui-ink-muted: 152 152 159;
152
+ --sui-ink-faint: 152 152 159;
133
153
  --sui-mark-faint: 102 102 109;
134
154
 
135
155
  /* Contrast */
@@ -139,7 +159,7 @@
139
159
 
140
160
  /* Accent: accent is for text, accent-solid for fills (one step can't hold contrast as both in dark mode),
141
161
  accent-bright for hover borders */
142
- --sui-accent: 144 132 255;
162
+ --sui-accent: 154 144 255;
143
163
  --sui-accent-solid: 111 97 208;
144
164
  --sui-accent-hover: 102 87 198;
145
165
  --sui-accent-bright: 107 94 196;
@@ -205,8 +225,28 @@
205
225
  --sui-inverse: 64 64 69;
206
226
  --sui-on-inverse: 228 228 231;
207
227
 
208
- /* Behind dialogs, with an opacity modifier */
228
+ /* Behind dialogs, with an opacity modifier; dialogs use scrim-alpha, sheets their own */
209
229
  --sui-scrim: 0 0 0;
230
+ --sui-scrim-alpha: 0.35;
231
+
232
+ /* Floating layers: black shadows vanish on black, so the edge does the work */
233
+ --sui-raised: 35 35 38;
234
+ --sui-edge: 255 255 255;
235
+ --sui-edge-alpha: 0.09;
236
+ --sui-shadow-floating:
237
+ 0 2px 6px rgb(0 0 0 / 0.35), 0 12px 28px -6px rgb(0 0 0 / 0.55), 0 24px 70px -8px rgb(0 0 0 / 0.6);
238
+
239
+ /* Soft fills */
240
+ --sui-fill: 255 255 255;
241
+ --sui-fill-alpha: 0.04;
242
+ --sui-fill-hover-alpha: 0.06;
243
+ --sui-fill-line-alpha: 0.07;
244
+
245
+ /* Segmented control */
246
+ --sui-track: 0 0 0;
247
+ --sui-track-alpha: 0.3;
248
+ --sui-lifted: 58 58 62;
249
+ --sui-shadow-lifted: 0 1px 2px rgb(0 0 0 / 0.5), inset 0 1px 0 rgb(255 255 255 / 0.07);
210
250
  }
211
251
 
212
252
  /* Prefixed, so they never meet an app's own colour names (bg-sui-surface, text-sui-ink).
@@ -286,16 +326,28 @@
286
326
  --color-sui-inverse: rgb(var(--sui-inverse) / 1);
287
327
  --color-sui-on-inverse: rgb(var(--sui-on-inverse) / 1);
288
328
  --color-sui-scrim: rgb(var(--sui-scrim) / 1);
329
+ --color-sui-raised: rgb(var(--sui-raised) / 1);
330
+ --color-sui-lifted: rgb(var(--sui-lifted) / 1);
331
+ /* Translucent by design: never put an opacity modifier on these */
332
+ --color-sui-edge: rgb(var(--sui-edge) / var(--sui-edge-alpha));
333
+ --color-sui-fill: rgb(var(--sui-fill) / var(--sui-fill-alpha));
334
+ --color-sui-fill-hover: rgb(var(--sui-fill) / var(--sui-fill-hover-alpha));
335
+ --color-sui-fill-line: rgb(var(--sui-fill) / var(--sui-fill-line-alpha));
336
+ --color-sui-track: rgb(var(--sui-track) / var(--sui-track-alpha));
289
337
  }
290
338
 
291
339
  /* Sizes and shapes, the same in both modes. */
292
340
  :where(:root) {
293
- --sui-button-height: 2.25rem;
294
- --sui-button-padding-x: 0.875rem;
295
- --sui-button-text: 0.875rem;
341
+ /* Buttons, fields and select triggers share one height */
342
+ --sui-control-height: 2rem;
343
+ --sui-button-height: var(--sui-control-height);
344
+ --sui-button-padding-x: 0.75rem;
345
+ --sui-button-text: 0.8125rem;
296
346
  --sui-radius-button: 0.5rem;
297
347
  /* A bottom sheet's top corners. */
298
348
  --sui-radius-sheet: 1.25rem;
349
+ /* How far below the viewport's top a dialog opens, where a command palette usually sits */
350
+ --sui-dialog-offset: 12vh;
299
351
  /* Table rows and headers at one height, e.g. 44px; unset (initial), each Table's size decides. */
300
352
  --sui-table-row: initial;
301
353
  /* The header row's own height, e.g. 36px over 44px rows; unset, it follows the rows. */
@@ -318,6 +370,35 @@
318
370
  --sui-focus-offset-inset: -2px;
319
371
  }
320
372
 
373
+ /* A clickable card's hover ground: the soft fill mixed into surface, opaque so it can fade in (a gradient can't).
374
+ On every [data-mode] element, so a subtree in the other mode works it out again. */
375
+ :where(:root, [data-mode]) {
376
+ --sui-card-hover: color-mix(in srgb, rgb(var(--sui-surface)), rgb(var(--sui-fill)) calc(var(--sui-fill-alpha) * 60%));
377
+ }
378
+
379
+ /* A clickable card on surface (a board card, a choice, a record tile): on hover its border firms up to `line` and its
380
+ ground fades into --sui-card-hover. Pair it with a `line-subtle` (or `line`) border and a surface ground. */
381
+ @utility sui-card-hover {
382
+ transition:
383
+ border-color 150ms,
384
+ background-color 150ms;
385
+
386
+ &:hover {
387
+ border-color: rgb(var(--sui-line));
388
+ background-color: var(--sui-card-hover);
389
+ }
390
+ }
391
+
392
+ /* The soft fill as an opaque band over surface, for what content scrolls under or what overlaps (sticky headers,
393
+ stacked avatars). */
394
+ @utility sui-band {
395
+ background-color: rgb(var(--sui-surface));
396
+ background-image: linear-gradient(
397
+ rgb(var(--sui-fill) / var(--sui-fill-alpha)),
398
+ rgb(var(--sui-fill) / var(--sui-fill-alpha))
399
+ );
400
+ }
401
+
321
402
  /* The keyboard focus ring, one treatment everywhere, applied with a variant (focus-visible:sui-ring). Outside by
322
403
  default, so it reads around filled buttons; a halo on fields; inset in menus, lists and tight groups. */
323
404
  @utility sui-ring {
@@ -442,14 +523,14 @@
442
523
  @keyframes sui-dialog-in {
443
524
  from {
444
525
  opacity: 0;
445
- transform: scale(0.75);
526
+ transform: translateY(-4px) scale(0.97);
446
527
  }
447
528
  }
448
529
 
449
530
  @keyframes sui-dialog-out {
450
531
  to {
451
532
  opacity: 0;
452
- transform: scale(0.75);
533
+ transform: translateY(-4px) scale(0.97);
453
534
  }
454
535
  }
455
536