@youcan/celeste 0.6.15 → 0.6.16

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 (88) hide show
  1. package/dist/celeste.css +597 -198
  2. package/dist/cjs/chunks/combobox-anchor.js +31 -0
  3. package/dist/cjs/chunks/combobox-root.js +38 -0
  4. package/dist/cjs/chunks/index.js +17 -0
  5. package/dist/cjs/combobox-anchor.js +3 -0
  6. package/dist/cjs/combobox-empty.js +32 -0
  7. package/dist/cjs/combobox-group.js +42 -0
  8. package/dist/cjs/combobox-input.js +67 -0
  9. package/dist/cjs/combobox-item.js +109 -0
  10. package/dist/cjs/combobox-list.js +62 -0
  11. package/dist/cjs/combobox-root.js +3 -0
  12. package/dist/cjs/combobox-separator.js +32 -0
  13. package/dist/cjs/combobox-trigger.js +46 -0
  14. package/dist/cjs/combobox.js +208 -0
  15. package/dist/cjs/dropdown.js +10 -3
  16. package/dist/cjs/index.js +30 -0
  17. package/dist/cjs/text-input-icon.js +2 -2
  18. package/dist/components/combobox/combobox-anchor.d.ts +22 -0
  19. package/dist/components/combobox/combobox-empty.d.ts +22 -0
  20. package/dist/components/combobox/combobox-group.d.ts +23 -0
  21. package/dist/components/combobox/combobox-input.d.ts +17 -0
  22. package/dist/components/combobox/combobox-item.d.ts +31 -0
  23. package/dist/components/combobox/combobox-list.d.ts +36 -0
  24. package/dist/components/combobox/combobox-root.d.ts +29 -0
  25. package/dist/components/combobox/combobox-separator.d.ts +22 -0
  26. package/dist/components/combobox/combobox-trigger.d.ts +20 -0
  27. package/dist/components/combobox/combobox.d.ts +53 -0
  28. package/dist/components/combobox/index.d.ts +20 -0
  29. package/dist/components/dropdown/dropdown.d.ts +5 -1
  30. package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +4 -4
  31. package/dist/components/index.d.ts +1 -0
  32. package/dist/components/modal/modal-content.d.ts +2 -2
  33. package/dist/components/popover/popover-content.d.ts +2 -2
  34. package/dist/es/chunks/combobox-anchor.js +32 -0
  35. package/dist/es/chunks/combobox-root.js +39 -0
  36. package/dist/es/chunks/index.js +59 -42
  37. package/dist/es/combobox-anchor.js +4 -0
  38. package/dist/es/combobox-empty.js +33 -0
  39. package/dist/es/combobox-group.js +43 -0
  40. package/dist/es/combobox-input.js +68 -0
  41. package/dist/es/combobox-item.js +110 -0
  42. package/dist/es/combobox-list.js +63 -0
  43. package/dist/es/combobox-root.js +4 -0
  44. package/dist/es/combobox-separator.js +33 -0
  45. package/dist/es/combobox-trigger.js +47 -0
  46. package/dist/es/combobox.js +209 -0
  47. package/dist/es/command-group.js +1 -1
  48. package/dist/es/command-input.js +1 -1
  49. package/dist/es/command-separator.js +1 -1
  50. package/dist/es/dropdown-menu-group.js +1 -1
  51. package/dist/es/dropdown-menu-item.js +1 -1
  52. package/dist/es/dropdown-menu-label.js +1 -1
  53. package/dist/es/dropdown-menu-separator.js +1 -1
  54. package/dist/es/dropdown-menu-trigger.js +1 -1
  55. package/dist/es/dropdown-menu.js +1 -1
  56. package/dist/es/dropdown.js +11 -4
  57. package/dist/es/index.js +75 -45
  58. package/dist/es/label.js +1 -1
  59. package/dist/es/modal-content.js +1 -1
  60. package/dist/es/modal-header.js +1 -1
  61. package/dist/es/popover-content.js +1 -1
  62. package/dist/es/popover-trigger.js +1 -1
  63. package/dist/es/segmented-control-item.js +1 -1
  64. package/dist/es/segmented-control.js +1 -1
  65. package/dist/es/select-content.js +1 -1
  66. package/dist/es/select-item.js +1 -1
  67. package/dist/es/select-trigger.js +1 -1
  68. package/dist/es/select-value.js +1 -1
  69. package/dist/es/tab-menu-content.js +1 -1
  70. package/dist/es/tab-menu-item.js +1 -1
  71. package/dist/es/tab-menu-list.js +1 -1
  72. package/dist/es/text-input-icon.js +2 -2
  73. package/dist/es/tooltip.js +1 -1
  74. package/package.json +3 -3
  75. package/src/components/combobox/combobox-anchor.vue +25 -0
  76. package/src/components/combobox/combobox-empty.vue +30 -0
  77. package/src/components/combobox/combobox-group.vue +42 -0
  78. package/src/components/combobox/combobox-input.vue +64 -0
  79. package/src/components/combobox/combobox-item.vue +196 -0
  80. package/src/components/combobox/combobox-list.vue +100 -0
  81. package/src/components/combobox/combobox-root.vue +14 -0
  82. package/src/components/combobox/combobox-separator.vue +31 -0
  83. package/src/components/combobox/combobox-trigger.vue +249 -0
  84. package/src/components/combobox/combobox.vue +257 -0
  85. package/src/components/combobox/index.ts +29 -0
  86. package/src/components/combobox/stories/combobox.stories.ts +99 -0
  87. package/src/components/dropdown/dropdown.vue +33 -2
  88. package/src/components/index.ts +1 -0
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, createCommentVNode, createBlock, withCtx, toDisplayString, createVNode } from "vue";
2
2
  import CompactButton from "./compact-button.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { a1 as Pu, a2 as Du, a as Gl } from "./chunks/index.js";
4
+ import { a4 as Pu, a5 as Du, a as Gl } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _hoisted_1 = ["data-dismissible", "data-alignment", "data-type"];
7
7
  const _hoisted_2 = {
@@ -2,7 +2,7 @@ import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, m
2
2
  import CompactButton from "./compact-button.js";
3
3
  import { useDelegatedProps } from "./use-delegated-props.js";
4
4
  import { c as clsx } from "./chunks/clsx.js";
5
- import { x as xe, a3 as bs, a4 as ws, a5 as _s, a6 as xs } from "./chunks/index.js";
5
+ import { x as xe, a6 as bs, a7 as ws, a8 as _s, a9 as xs } from "./chunks/index.js";
6
6
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
7
7
  const _hoisted_1 = ["data-icon-size"];
8
8
  const _hoisted_2 = { class: "celeste-popover-title" };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
- import { a7 as gs } from "./chunks/index.js";
2
+ import { aa as gs } from "./chunks/index.js";
3
3
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
4
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  __name: "popover-trigger",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { s as sv } from "./chunks/index.js";
4
+ import { v as sv } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "segmented-control-item",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { x as xe, r as lv } from "./chunks/index.js";
4
+ import { x as xe, s as lv } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "segmented-control",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { x as xe, a8 as zy, a9 as Ky, aa as Xy } from "./chunks/index.js";
4
+ import { x as xe, ab as zy, ac as Ky, ad as Xy } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "select-content",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, renderSlot, createElementVNode } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { ab as jy, ac as Yy, ad as Uy } from "./chunks/index.js";
4
+ import { ae as jy, af as Yy, ag as Uy } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "select-item",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot, createVNode, createElementVNode } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { ae as Ly, af as eg } from "./chunks/index.js";
4
+ import { ah as Ly, ai as eg } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "select-trigger",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { ag as Qy } from "./chunks/index.js";
4
+ import { aj as Qy } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "select-value",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { p as bg } from "./chunks/index.js";
4
+ import { r as bg } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "tab-menu-content",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot, createElementBlock, createCommentVNode } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { A as At, l as Cg } from "./chunks/index.js";
4
+ import { A as At, p as Cg } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _hoisted_1 = {
7
7
  key: 0,
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { j as gg } from "./chunks/index.js";
4
+ import { l as gg } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "tab-menu-list",
@@ -24,7 +24,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
24
  };
25
25
  }
26
26
  });
27
- const textInputIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3b859b72"]]);
27
+ const TextInputIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3b859b72"]]);
28
28
  export {
29
- textInputIcon as default
29
+ TextInputIcon as default
30
30
  };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, renderSlot, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
2
2
  import CompactButton from "./compact-button.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { x as xe, ah as Lg, ai as zg, aj as Kg, ak as jg, al as Hg, am as Wg } from "./chunks/index.js";
4
+ import { x as xe, ak as Lg, al as zg, am as Kg, an as jg, ao as Hg, ap as Wg } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _hoisted_1 = { class: "celeste-tooltip-content-box" };
7
7
  const _hoisted_2 = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@youcan/celeste",
3
3
  "type": "module",
4
- "version": "0.6.15",
4
+ "version": "0.6.16",
5
5
  "author": "YouCan <tech@youcan.shop>",
6
6
  "keywords": [
7
7
  "youcan",
@@ -32,8 +32,8 @@
32
32
  "clsx": "^2.1.1",
33
33
  "radix-vue": "^1.9.12",
34
34
  "tinycolor2": "^1.6.0",
35
- "@youcan/celeste-icons": "0.6.15",
36
- "@youcan/celeste-tokens": "0.6.15"
35
+ "@youcan/celeste-icons": "0.6.16",
36
+ "@youcan/celeste-tokens": "0.6.16"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@chromatic-com/storybook": "^4.0.0",
@@ -0,0 +1,25 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxAnchorProps } from 'radix-vue';
3
+ import clsx from 'clsx';
4
+ import { ComboboxAnchor, useForwardProps } from 'radix-vue';
5
+ import { computed, type HTMLAttributes } from 'vue';
6
+
7
+ const props = defineProps<ComboboxAnchorProps & { class?: HTMLAttributes['class'] }>();
8
+
9
+ const delegatedProps = computed(() => {
10
+ const { class: _, ...delegated } = props;
11
+
12
+ return delegated;
13
+ });
14
+
15
+ const forwarded = useForwardProps(delegatedProps);
16
+ </script>
17
+
18
+ <template>
19
+ <ComboboxAnchor
20
+ v-bind="forwarded"
21
+ :class="clsx(props.class, 'celeste-dropdown-anchor')"
22
+ >
23
+ <slot />
24
+ </ComboboxAnchor>
25
+ </template>
@@ -0,0 +1,30 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxEmptyProps } from 'radix-vue';
3
+ import clsx from 'clsx';
4
+ import { ComboboxEmpty } from 'radix-vue';
5
+ import { computed, type HTMLAttributes } from 'vue';
6
+
7
+ const props = defineProps<ComboboxEmptyProps & { class?: HTMLAttributes['class'] }>();
8
+
9
+ const delegatedProps = computed(() => {
10
+ const { class: _, ...delegated } = props;
11
+
12
+ return delegated;
13
+ });
14
+ </script>
15
+
16
+ <template>
17
+ <ComboboxEmpty v-bind="delegatedProps" :class="clsx('celeste-dropdown-empty-list', props.class)">
18
+ <slot />
19
+ </ComboboxEmpty>
20
+ </template>
21
+
22
+ <style lang="scss" scoped>
23
+ .celeste-dropdown-empty-list {
24
+ display: flex;
25
+ align-items: center;
26
+ padding: var(--spacing-8);
27
+ color: var(--color-text-sub-600);
28
+ font: var(--paragraph-sm);
29
+ }
30
+ </style>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxGroupProps } from 'radix-vue';
3
+ import clsx from 'clsx';
4
+ import { ComboboxGroup, ComboboxLabel } from 'radix-vue';
5
+ import { computed, type HTMLAttributes } from 'vue';
6
+
7
+ const props = defineProps<ComboboxGroupProps & {
8
+ class?: HTMLAttributes['class'];
9
+ heading?: string;
10
+ }>();
11
+
12
+ const delegatedProps = computed(() => {
13
+ const { class: _, ...delegated } = props;
14
+
15
+ return delegated;
16
+ });
17
+ </script>
18
+
19
+ <template>
20
+ <ComboboxGroup
21
+ v-bind="delegatedProps"
22
+ :class="clsx(props.class, 'celeste-dropdown-items-group')"
23
+ >
24
+ <ComboboxLabel v-if="heading" class="">
25
+ {{ heading }}
26
+ </ComboboxLabel>
27
+ <slot />
28
+ </ComboboxGroup>
29
+ </template>
30
+
31
+ <style lang="scss" scoped>
32
+ .celeste-dropdown-items-group {
33
+ display: flex;
34
+ flex-direction: column;
35
+ gap: var(--spacing-4);
36
+
37
+ &:deep([data-radix-vue-combobox-item]) {
38
+ width: auto;
39
+ height: auto;
40
+ }
41
+ }
42
+ </style>
@@ -0,0 +1,64 @@
1
+ <script setup lang="ts">
2
+ import clsx from 'clsx';
3
+ import { ComboboxInput, type ComboboxInputProps } from 'radix-vue';
4
+ import { computed, type HTMLAttributes } from 'vue';
5
+ import TextInputIcon from '../text-input/text-input-icon.vue';
6
+ import TextInput, { type TextInputProps } from '../text-input/text-input.vue';
7
+
8
+ const props = defineProps<ComboboxInputProps & {
9
+ class?: HTMLAttributes['class'];
10
+ textInputProps?: Partial<TextInputProps>;
11
+ searchable?: boolean;
12
+ }>();
13
+
14
+ const model = defineModel<string | undefined>();
15
+
16
+ const comboboxInputProps = computed(() => {
17
+ const { class: _class, textInputProps: _textInputProps, ...rest } = props;
18
+ return rest;
19
+ });
20
+
21
+ const textInputProps = computed((): TextInputProps => {
22
+ return {
23
+ type: 'search',
24
+ size: 'sm',
25
+ placeholder: 'Search',
26
+ ...props.textInputProps,
27
+ };
28
+ });
29
+ </script>
30
+
31
+ <template>
32
+ <ComboboxInput
33
+ v-bind="comboboxInputProps"
34
+ :class="clsx('celeste-dropdown-input', props.class)"
35
+ :readonly="!props.searchable"
36
+ as="div"
37
+ >
38
+ <TextInput
39
+ v-bind="textInputProps"
40
+ v-model="model"
41
+ :readonly="!props.searchable"
42
+ :style="!props.searchable ? 'opacity: 0; height: 1px; padding: 0; border: none;' : ''"
43
+ >
44
+ <TextInputIcon v-if="props.searchable" icon="i-celeste-search-2-line" />
45
+ </TextInput>
46
+ </ComboboxInput>
47
+ </template>
48
+
49
+ <style lang="scss" scoped>
50
+ .celeste-dropdown-input {
51
+ display: flex;
52
+ align-items: center;
53
+ gap: var(--spacing-4);
54
+ background-color: var(--color-bg-white-0);
55
+
56
+ &:deep(.celeste-text-input-wrapper) {
57
+ width: 100%;
58
+ border: none;
59
+ border-radius: var(--radius-8) var(--radius-8) 0 0;
60
+ outline: none;
61
+ box-shadow: none;
62
+ }
63
+ }
64
+ </style>
@@ -0,0 +1,196 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxItemEmits } from 'radix-vue';
3
+ import clsx from 'clsx';
4
+ import { ComboboxItem, useForwardPropsEmits } from 'radix-vue';
5
+ import { computed, type HTMLAttributes } from 'vue';
6
+ import Checkbox from '../checkbox/checkbox.vue';
7
+
8
+ const props = withDefaults(defineProps<ComboboxItemPropsType>(), {
9
+ size: 'sm',
10
+ });
11
+ const emits = defineEmits<ComboboxItemEmits>();
12
+
13
+ const delegatedProps = computed(() => {
14
+ const { class: _, ...delegated } = props;
15
+
16
+ return delegated;
17
+ });
18
+
19
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
20
+ </script>
21
+
22
+ <script lang="ts">
23
+ export interface ComboboxItemPropsType {
24
+ class?: HTMLAttributes['class'];
25
+ label: string;
26
+ size?: 'sm' | 'lg';
27
+ checkbox?: boolean;
28
+ sublabel?: string;
29
+ description?: string;
30
+ selected?: boolean | 'indeterminate';
31
+ focused?: boolean;
32
+ value: string | number | boolean | Record<string, any>;
33
+ icon?: string;
34
+ image?: string;
35
+ disabled?: boolean;
36
+ }
37
+ </script>
38
+
39
+ <template>
40
+ <ComboboxItem
41
+ v-bind="forwarded"
42
+ :disabled="disabled"
43
+ as-child
44
+ >
45
+ <div
46
+ tabindex="0"
47
+ :aria-disabled="disabled"
48
+ :class="clsx(
49
+ props.class,
50
+ 'celeste-dropdown-item',
51
+ { 'celeste-dropdown-item-disabled': disabled },
52
+ { 'celeste-dropdown-item-selected': selected },
53
+ { 'celeste-dropdown-item-focused': focused },
54
+ )"
55
+ >
56
+ <Checkbox
57
+ v-if="checkbox && size === 'sm'"
58
+ :checked="selected"
59
+ :disabled="disabled"
60
+ />
61
+ <div
62
+ v-if="$slots.prefix"
63
+ :class="clsx(
64
+ 'celeste-dropdown-item-prefix',
65
+ `celeste-dropdown-item-prefix-${size}`,
66
+ )"
67
+ >
68
+ <slot name="prefix" />
69
+ </div>
70
+ <div class="celeste-dropdown-item-info">
71
+ <div
72
+ :class="clsx(
73
+ 'celeste-dropdown-item-header',
74
+ `celeste-dropdown-item-header-${size}`,
75
+ )"
76
+ >
77
+ <span class="celeste-dropdown-item-label" v-html="label" />
78
+ <span v-if="sublabel" class="celeste-dropdown-item-sublabel">{{ sublabel }}</span>
79
+ </div>
80
+ <p v-if="description && size === 'lg'" class="celeste-dropdown-item-description">
81
+ {{ description }}
82
+ </p>
83
+ </div>
84
+ <div v-if="$slots.suffix" class="celeste-dropdown-item-suffix">
85
+ <slot name="suffix" />
86
+ </div>
87
+ <i v-if="selected" class="i-celeste-check-fill" />
88
+ </div>
89
+ </ComboboxItem>
90
+ </template>
91
+
92
+ <style lang="scss" scoped>
93
+ .celeste-dropdown-item {
94
+ display: flex;
95
+ align-items: center;
96
+ padding: var(--spacing-8);
97
+ transition-property: background-color;
98
+ transition-duration: var(--animation-fast);
99
+ transition-timing-function: ease-out;
100
+ border-radius: var(--radius-8);
101
+ background: var(--color-bg-white-0);
102
+ cursor: pointer;
103
+ gap: var(--spacing-8);
104
+
105
+ i {
106
+ color: var(--color-icon-sub-600);
107
+ }
108
+
109
+ &[data-highlighted],
110
+ &:hover,
111
+ &-focused,
112
+ &:focus,
113
+ &:focus-visible {
114
+ outline: none;
115
+ background: var(--color-bg-weak-50);
116
+ }
117
+
118
+ :deep(.celeste-input-wrapper) {
119
+ gap: 0;
120
+ }
121
+
122
+ &-header {
123
+ display: flex;
124
+ align-items: center;
125
+ gap: var(--spacing-4);
126
+ }
127
+
128
+ &-label {
129
+ color: var(--color-text-strong-950);
130
+ font: var(--paragraph-sm);
131
+ }
132
+
133
+ &-sublabel {
134
+ color: var(--color-text-soft-400);
135
+ font: var(--paragraph-xs);
136
+ }
137
+
138
+ &-description {
139
+ margin: var(--spacing-0);
140
+ color: var(--color-text-sub-600);
141
+ font: var(--paragraph-xs);
142
+ }
143
+
144
+ .celeste-dropdown-item-prefix {
145
+ display: flex;
146
+ align-items: center;
147
+ justify-content: center;
148
+ color: var(--color-icon-sub-600);
149
+
150
+ &-lg {
151
+ padding: var(--spacing-10);
152
+ border: 1px solid var(--color-stroke-soft-200);
153
+ border-radius: var(--radius-full);
154
+ box-shadow: var(--shadow-regular-xs);
155
+ gap: var(--spacing-10);
156
+ }
157
+ }
158
+
159
+ .celeste-dropdown-item-suffix {
160
+ color: var(--color-icon-sub-600);
161
+ }
162
+
163
+ &-disabled {
164
+ color: var(--color-text-disabled-300);
165
+ cursor: not-allowed;
166
+
167
+ :deep(i) {
168
+ color: var(--color-text-disabled-300);
169
+ }
170
+
171
+ .celeste-dropdown-item-label,
172
+ .celeste-dropdown-item-sublabel,
173
+ .celeste-dropdown-item-description {
174
+ color: var(--color-text-disabled-300);
175
+ }
176
+ }
177
+
178
+ &-selected {
179
+ background: var(--color-bg-weak-50);
180
+ }
181
+
182
+ .celeste-dropdown-item-info {
183
+ display: flex;
184
+ flex: 1 0 0;
185
+ flex-direction: column;
186
+ justify-content: center;
187
+ gap: var(--spacing-4);
188
+ }
189
+
190
+ .celeste-dropdown-item-header-lg {
191
+ .celeste-dropdown-item-label {
192
+ font-weight: var(--font-weights-display-0);
193
+ }
194
+ }
195
+ }
196
+ </style>
@@ -0,0 +1,100 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxContentEmits, ComboboxContentProps } from 'radix-vue';
3
+ import clsx from 'clsx';
4
+ import { ComboboxContent, ComboboxPortal, ComboboxViewport, useForwardPropsEmits } from 'radix-vue';
5
+ import { computed, type HTMLAttributes } from 'vue';
6
+
7
+ const props = withDefaults(defineProps<ComboboxContentProps & { class?: HTMLAttributes['class'] }>(), {
8
+ position: 'popper',
9
+ align: 'start',
10
+ sideOffset: 4,
11
+ });
12
+ const emits = defineEmits<ComboboxContentEmits>();
13
+
14
+ const delegatedProps = computed(() => {
15
+ const { class: _, ...delegated } = props;
16
+
17
+ return delegated;
18
+ });
19
+
20
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
21
+ </script>
22
+
23
+ <template>
24
+ <ComboboxPortal>
25
+ <ComboboxContent
26
+ v-bind="forwarded"
27
+ :class="clsx('celeste-dropdown-content', props.class)"
28
+ >
29
+ <ComboboxViewport class="celeste-dropdown-items-viewport">
30
+ <slot />
31
+ </ComboboxViewport>
32
+ </ComboboxContent>
33
+ </ComboboxPortal>
34
+ </template>
35
+
36
+ <style lang="scss" scoped>
37
+ .celeste-dropdown-content,
38
+ div:deep(.celeste-dropdown-content) {
39
+ --dropdown-width: fit-content;
40
+ --dropdown-height: 300px;
41
+ --dropdown-min-width: var(--radix-combobox-trigger-width, 300px);
42
+
43
+ display: flex;
44
+ z-index: 50;
45
+ box-sizing: border-box;
46
+ flex-direction: column;
47
+ width: var(--dropdown-width);
48
+ min-width: var(--dropdown-min-width);
49
+ max-height: var(--dropdown-height);
50
+ margin-top: var(--spacing-10);
51
+ padding: var(--spacing-8);
52
+ overflow: visible;
53
+ transform-origin: var(--radix-combobox-content-transform-origin);
54
+ animation-duration: var(--animation-fast);
55
+ animation-timing-function: ease-out;
56
+ border: 1px solid var(--color-stroke-soft-200);
57
+ border-radius: var(--radius-16);
58
+ background-color: var(--color-bg-white-0);
59
+ box-shadow: var(--shadow-regular-md);
60
+ gap: var(--spacing-4);
61
+
62
+ &[data-state='open'] {
63
+ animation-name: slide-up-and-fade;
64
+ }
65
+
66
+ &[data-state='closed'] {
67
+ animation-name: slide-down-and-fade;
68
+ }
69
+ }
70
+
71
+ div:deep(.celeste-dropdown-items-viewport) {
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: var(--spacing-4);
75
+ }
76
+
77
+ @keyframes slide-up-and-fade {
78
+ from {
79
+ transform: translateY(10px);
80
+ opacity: 0;
81
+ }
82
+
83
+ to {
84
+ transform: translateY(0);
85
+ opacity: 1;
86
+ }
87
+ }
88
+
89
+ @keyframes slide-down-and-fade {
90
+ from {
91
+ transform: translateY(0);
92
+ opacity: 1;
93
+ }
94
+
95
+ to {
96
+ transform: translateY(10px);
97
+ opacity: 0;
98
+ }
99
+ }
100
+ </style>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import { ComboboxRoot, type ComboboxRootEmits, type ComboboxRootProps, useForwardPropsEmits } from 'radix-vue';
3
+
4
+ const props = defineProps<ComboboxRootProps>();
5
+ const emits = defineEmits<ComboboxRootEmits>();
6
+
7
+ const forwarded = useForwardPropsEmits(props, emits);
8
+ </script>
9
+
10
+ <template>
11
+ <ComboboxRoot v-bind="forwarded">
12
+ <slot />
13
+ </ComboboxRoot>
14
+ </template>
@@ -0,0 +1,31 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxSeparatorProps } from 'radix-vue';
3
+ import clsx from 'clsx';
4
+ import { ComboboxSeparator } from 'radix-vue';
5
+ import { computed, type HTMLAttributes } from 'vue';
6
+
7
+ const props = defineProps<ComboboxSeparatorProps & { class?: HTMLAttributes['class'] }>();
8
+
9
+ const delegatedProps = computed(() => {
10
+ const { class: _, ...delegated } = props;
11
+
12
+ return delegated;
13
+ });
14
+ </script>
15
+
16
+ <template>
17
+ <ComboboxSeparator
18
+ v-bind="delegatedProps"
19
+ :class="clsx('celeste-dropdown-separator', props.class)"
20
+ >
21
+ <slot />
22
+ </ComboboxSeparator>
23
+ </template>
24
+
25
+ <style lang="scss" scoped>
26
+ .celeste-dropdown-separator {
27
+ width: 100%;
28
+ height: 1px;
29
+ background-color: var(--color-stroke-soft-200);
30
+ }
31
+ </style>