@youcan/celeste 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/README.md +21 -0
- package/ai/component-registry.json +1826 -664
- package/ai/icons.json +12600 -0
- package/ai/tokens.json +2189 -0
- package/dist/celeste.css +25 -10
- package/dist/cjs/chunks/combobox.cjs +12 -8
- package/dist/components/combobox/combobox.d.ts +10 -2
- package/dist/es/chunks/combobox.js +13 -9
- package/package.json +3 -3
- package/src/components/combobox/combobox.vue +7 -4
- package/src/components/combobox/stories/combobox.stories.ts +35 -1
- package/src/components/modal/stories/modal.stories.ts +3 -3
- package/src/components/sidebar/sidebar-menu-action.vue +3 -0
- package/src/components/sidebar/sidebar-menu-button.vue +4 -0
- package/src/components/sidebar/sidebar-menu-sub-button.vue +3 -0
- package/src/components/sidebar/sidebar-menu-sub.vue +2 -0
- package/src/components/sidebar/sidebar-menu.vue +3 -0
- package/src/components/sidebar/stories/sidebar.stories.ts +2 -2
- package/ai/component-registry.md +0 -3518
- package/ai/icons.md +0 -142
- package/ai/tokens.md +0 -444
package/dist/celeste.css
CHANGED
|
@@ -3039,21 +3039,21 @@ to {
|
|
|
3039
3039
|
height: 40px;
|
|
3040
3040
|
padding: var(--spacing-10);
|
|
3041
3041
|
border-radius: var(--radius-10);
|
|
3042
|
-
}[data-v-
|
|
3042
|
+
}[data-v-f1dfb246] {
|
|
3043
3043
|
box-sizing: border-box;
|
|
3044
3044
|
}
|
|
3045
|
-
.celeste-dropdown-anchor-trigger-prefix[data-v-
|
|
3045
|
+
.celeste-dropdown-anchor-trigger-prefix[data-v-f1dfb246] {
|
|
3046
3046
|
display: flex;
|
|
3047
3047
|
align-items: center;
|
|
3048
3048
|
justify-content: center;
|
|
3049
3049
|
}
|
|
3050
|
-
.celeste-dropdown-anchor-trigger-prefix-selected[data-v-
|
|
3050
|
+
.celeste-dropdown-anchor-trigger-prefix-selected[data-v-f1dfb246] {
|
|
3051
3051
|
display: flex;
|
|
3052
3052
|
align-items: center;
|
|
3053
3053
|
justify-content: center;
|
|
3054
3054
|
}
|
|
3055
|
-
.celeste-dropdown-item-image[data-v-
|
|
3056
|
-
.selected-dropdown-image[data-v-
|
|
3055
|
+
.celeste-dropdown-item-image[data-v-f1dfb246],
|
|
3056
|
+
.selected-dropdown-image[data-v-f1dfb246] {
|
|
3057
3057
|
display: flex;
|
|
3058
3058
|
align-items: center;
|
|
3059
3059
|
justify-content: center;
|
|
@@ -3063,7 +3063,7 @@ to {
|
|
|
3063
3063
|
object-fit: cover;
|
|
3064
3064
|
border-radius: var(--radius-full);
|
|
3065
3065
|
}
|
|
3066
|
-
.celeste-dropdown-trigger-label[data-v-
|
|
3066
|
+
.celeste-dropdown-trigger-label[data-v-f1dfb246] {
|
|
3067
3067
|
display: flex;
|
|
3068
3068
|
flex: 1 0 0;
|
|
3069
3069
|
align-items: center;
|
|
@@ -3075,12 +3075,12 @@ to {
|
|
|
3075
3075
|
cursor: pointer;
|
|
3076
3076
|
gap: var(--spacing-8);
|
|
3077
3077
|
}
|
|
3078
|
-
.celeste-dropdown-trigger-label span[data-v-
|
|
3078
|
+
.celeste-dropdown-trigger-label span[data-v-f1dfb246] {
|
|
3079
3079
|
overflow: hidden;
|
|
3080
3080
|
text-overflow: ellipsis;
|
|
3081
3081
|
white-space: nowrap;
|
|
3082
3082
|
}
|
|
3083
|
-
.celeste-dropdown-trigger[data-v-
|
|
3083
|
+
.celeste-dropdown-trigger[data-v-f1dfb246] {
|
|
3084
3084
|
display: flex;
|
|
3085
3085
|
place-items: center center;
|
|
3086
3086
|
transition-property: transform;
|
|
@@ -3091,7 +3091,7 @@ to {
|
|
|
3091
3091
|
color: var(--color-icon-soft-400);
|
|
3092
3092
|
cursor: pointer;
|
|
3093
3093
|
}
|
|
3094
|
-
.celeste-dropdown-inner-input[data-v-
|
|
3094
|
+
.celeste-dropdown-inner-input[data-v-f1dfb246] {
|
|
3095
3095
|
display: flex;
|
|
3096
3096
|
position: sticky;
|
|
3097
3097
|
z-index: 50;
|
|
@@ -3100,7 +3100,7 @@ to {
|
|
|
3100
3100
|
gap: var(--spacing-4);
|
|
3101
3101
|
background-color: var(--color-bg-white-0);
|
|
3102
3102
|
}
|
|
3103
|
-
.celeste-dropdown-inner-input.sr-only[data-v-
|
|
3103
|
+
.celeste-dropdown-inner-input.sr-only[data-v-f1dfb246] {
|
|
3104
3104
|
position: absolute;
|
|
3105
3105
|
width: 1px;
|
|
3106
3106
|
height: 1px;
|
|
@@ -5952,9 +5952,12 @@ to {
|
|
|
5952
5952
|
width: 20px;
|
|
5953
5953
|
padding: 0;
|
|
5954
5954
|
transition: transform var(--animation-fast) ease-in-out;
|
|
5955
|
+
border: 0;
|
|
5955
5956
|
border-radius: var(--radius-8);
|
|
5956
5957
|
outline: none;
|
|
5958
|
+
background: none;
|
|
5957
5959
|
color: var(--sidebar-foreground);
|
|
5960
|
+
text-decoration: none;
|
|
5958
5961
|
inset-inline-end: var(--spacing-4);
|
|
5959
5962
|
inset-block-start: var(--spacing-8);
|
|
5960
5963
|
aspect-ratio: 1;
|
|
@@ -6058,10 +6061,14 @@ to {
|
|
|
6058
6061
|
height var(--animation-fast) linear,
|
|
6059
6062
|
padding var(--animation-fast) linear,
|
|
6060
6063
|
background-color var(--animation-fast);
|
|
6064
|
+
border: 0;
|
|
6061
6065
|
border-radius: var(--radius-8);
|
|
6062
6066
|
outline: none;
|
|
6067
|
+
background: none;
|
|
6068
|
+
color: var(--sidebar-foreground);
|
|
6063
6069
|
font: var(--label-sm);
|
|
6064
6070
|
text-align: start;
|
|
6071
|
+
text-decoration: none;
|
|
6065
6072
|
gap: var(--spacing-8);
|
|
6066
6073
|
}
|
|
6067
6074
|
.celeste-sidebar-menu-button:hover {
|
|
@@ -6144,9 +6151,12 @@ to {
|
|
|
6144
6151
|
overflow: hidden;
|
|
6145
6152
|
transform: translateX(-1px);
|
|
6146
6153
|
transition: background-color var(--animation-fast);
|
|
6154
|
+
border: 0;
|
|
6147
6155
|
border-radius: var(--radius-8);
|
|
6148
6156
|
outline: none;
|
|
6157
|
+
background: none;
|
|
6149
6158
|
color: var(--sidebar-foreground);
|
|
6159
|
+
text-decoration: none;
|
|
6150
6160
|
gap: var(--spacing-8);
|
|
6151
6161
|
}
|
|
6152
6162
|
.celeste-sidebar-menu-sub-button:hover {
|
|
@@ -6201,12 +6211,14 @@ to {
|
|
|
6201
6211
|
display: flex;
|
|
6202
6212
|
flex-direction: column;
|
|
6203
6213
|
min-width: 0;
|
|
6214
|
+
margin-block: 0;
|
|
6204
6215
|
margin-inline: var(--spacing-16);
|
|
6205
6216
|
padding-block: var(--spacing-4);
|
|
6206
6217
|
padding-inline: var(--spacing-10);
|
|
6207
6218
|
transform: translateX(1px);
|
|
6208
6219
|
gap: var(--spacing-4);
|
|
6209
6220
|
border-inline-start: 1px solid var(--sidebar-border);
|
|
6221
|
+
list-style: none;
|
|
6210
6222
|
}
|
|
6211
6223
|
[data-collapsible='icon'] .celeste-sidebar-menu-sub {
|
|
6212
6224
|
display: none;
|
|
@@ -6217,7 +6229,10 @@ to {
|
|
|
6217
6229
|
flex-direction: column;
|
|
6218
6230
|
width: 100%;
|
|
6219
6231
|
min-width: 0;
|
|
6232
|
+
margin: 0;
|
|
6233
|
+
padding: 0;
|
|
6220
6234
|
gap: var(--spacing-4);
|
|
6235
|
+
list-style: none;
|
|
6221
6236
|
}
|
|
6222
6237
|
|
|
6223
6238
|
:root {
|
|
@@ -32,12 +32,13 @@ var _hoisted_8 = ["src"];
|
|
|
32
32
|
var combobox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
33
33
|
inheritAttrs: false,
|
|
34
34
|
__name: "combobox",
|
|
35
|
-
props: {
|
|
35
|
+
props: /*@__PURE__*/ (0, vue.mergeModels)({
|
|
36
36
|
options: {},
|
|
37
37
|
valueBy: {},
|
|
38
38
|
labelBy: {},
|
|
39
39
|
placeholder: { default: "Select" },
|
|
40
40
|
searchPlaceholder: {},
|
|
41
|
+
searchTerm: {},
|
|
41
42
|
type: {},
|
|
42
43
|
size: { default: "md" },
|
|
43
44
|
emptyLabel: {},
|
|
@@ -63,17 +64,21 @@ var combobox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue
|
|
|
63
64
|
as: {},
|
|
64
65
|
name: {},
|
|
65
66
|
required: { type: Boolean }
|
|
66
|
-
},
|
|
67
|
-
|
|
67
|
+
}, {
|
|
68
|
+
"searchTerm": {},
|
|
69
|
+
"searchTermModifiers": {}
|
|
70
|
+
}),
|
|
71
|
+
emits: /*@__PURE__*/ (0, vue.mergeModels)([
|
|
68
72
|
"update:modelValue",
|
|
69
73
|
"highlight",
|
|
70
74
|
"update:open"
|
|
71
|
-
],
|
|
75
|
+
], ["update:searchTerm"]),
|
|
72
76
|
setup(__props, { emit: __emit }) {
|
|
73
77
|
const props = __props;
|
|
74
78
|
const emits = __emit;
|
|
79
|
+
const searchTerm = (0, vue.useModel)(__props, "searchTerm");
|
|
75
80
|
const delegatedProps = (0, vue.computed)(() => {
|
|
76
|
-
const { open, options, valueBy, labelBy, placeholder, searchPlaceholder, type, size, emptyLabel, badgeProps, searchable, class: _class, ...delegated } = props;
|
|
81
|
+
const { open, options, valueBy, labelBy, placeholder, searchPlaceholder, type, size, emptyLabel, badgeProps, searchable, searchTerm: _searchTerm, class: _class, ...delegated } = props;
|
|
77
82
|
return delegated;
|
|
78
83
|
});
|
|
79
84
|
const forwarded = require_useForwardPropsEmits.useForwardPropsEmits(delegatedProps, emits);
|
|
@@ -107,8 +112,7 @@ var combobox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue
|
|
|
107
112
|
...props.badgeProps,
|
|
108
113
|
disabled: props.disabled
|
|
109
114
|
}));
|
|
110
|
-
const
|
|
111
|
-
const filteredOptions = (0, vue.computed)(() => filterFunction(props.options, searchTerm.value));
|
|
115
|
+
const filteredOptions = (0, vue.computed)(() => props.ignoreFilter ? props.options : filterFunction(props.options, searchTerm.value ?? ""));
|
|
112
116
|
return (_ctx, _cache) => {
|
|
113
117
|
return (0, vue.openBlock)(), (0, vue.createBlock)(require_combobox_root.combobox_root_default, (0, vue.mergeProps)((0, vue.unref)(forwarded), { "ignore-filter": "" }), {
|
|
114
118
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)(require_combobox_anchor.combobox_anchor_default, { "as-child": "" }, {
|
|
@@ -197,7 +201,7 @@ var combobox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue
|
|
|
197
201
|
});
|
|
198
202
|
//#endregion
|
|
199
203
|
//#region src/components/combobox/combobox.vue
|
|
200
|
-
var combobox_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(combobox_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
204
|
+
var combobox_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(combobox_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-f1dfb246"]]);
|
|
201
205
|
//#endregion
|
|
202
206
|
Object.defineProperty(exports, "combobox_default", {
|
|
203
207
|
enumerable: true,
|
|
@@ -7,6 +7,7 @@ export interface ComboboxPropsType extends ComboboxRootProps {
|
|
|
7
7
|
labelBy?: string;
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
searchPlaceholder?: string;
|
|
10
|
+
searchTerm?: string;
|
|
10
11
|
type?: 'normal' | 'compact' | 'inline' | 'compact-input';
|
|
11
12
|
size?: 'xs' | 'sm' | 'md';
|
|
12
13
|
emptyLabel?: string;
|
|
@@ -14,6 +15,11 @@ export interface ComboboxPropsType extends ComboboxRootProps {
|
|
|
14
15
|
searchable?: boolean;
|
|
15
16
|
class?: string;
|
|
16
17
|
}
|
|
18
|
+
type __VLS_Props = ComboboxPropsType;
|
|
19
|
+
type __VLS_ModelProps = {
|
|
20
|
+
'searchTerm'?: string;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
17
23
|
declare var __VLS_20: {
|
|
18
24
|
selected: ComboboxItemPropsType;
|
|
19
25
|
}, __VLS_22: {
|
|
@@ -24,20 +30,22 @@ type __VLS_Slots = {} & {
|
|
|
24
30
|
} & {
|
|
25
31
|
prefix?: (props: typeof __VLS_22) => any;
|
|
26
32
|
};
|
|
27
|
-
declare const __VLS_base: import('vue').DefineComponent<
|
|
33
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
28
34
|
"update:modelValue": (value: import('reka-ui').AcceptableValue) => any;
|
|
29
35
|
"update:open": (value: boolean) => any;
|
|
30
36
|
highlight: (payload: {
|
|
31
37
|
ref: HTMLElement;
|
|
32
38
|
value: import('reka-ui').AcceptableValue;
|
|
33
39
|
} | undefined) => any;
|
|
34
|
-
|
|
40
|
+
"update:searchTerm": (value: string | undefined) => any;
|
|
41
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
35
42
|
"onUpdate:modelValue"?: ((value: import('reka-ui').AcceptableValue) => any) | undefined;
|
|
36
43
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
37
44
|
onHighlight?: ((payload: {
|
|
38
45
|
ref: HTMLElement;
|
|
39
46
|
value: import('reka-ui').AcceptableValue;
|
|
40
47
|
} | undefined) => any) | undefined;
|
|
48
|
+
"onUpdate:searchTerm"?: ((value: string | undefined) => any) | undefined;
|
|
41
49
|
}>, {
|
|
42
50
|
size: "xs" | "sm" | "md";
|
|
43
51
|
placeholder: string;
|
|
@@ -10,7 +10,7 @@ import { t as combobox_input_default } from "./combobox-input.js";
|
|
|
10
10
|
import { t as combobox_item_default } from "./combobox-item.js";
|
|
11
11
|
import { t as combobox_root_default } from "./combobox-root.js";
|
|
12
12
|
import { t as combobox_separator_default } from "./combobox-separator.js";
|
|
13
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, openBlock,
|
|
13
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeClass, normalizeProps, openBlock, renderList, renderSlot, toDisplayString, unref, useModel, withCtx } from "vue";
|
|
14
14
|
//#region src/components/combobox/combobox.vue?vue&type=script&setup=true&lang.ts
|
|
15
15
|
var _hoisted_1 = {
|
|
16
16
|
key: 0,
|
|
@@ -34,12 +34,13 @@ var _hoisted_8 = ["src"];
|
|
|
34
34
|
var combobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
35
35
|
inheritAttrs: false,
|
|
36
36
|
__name: "combobox",
|
|
37
|
-
props: {
|
|
37
|
+
props: /*@__PURE__*/ mergeModels({
|
|
38
38
|
options: {},
|
|
39
39
|
valueBy: {},
|
|
40
40
|
labelBy: {},
|
|
41
41
|
placeholder: { default: "Select" },
|
|
42
42
|
searchPlaceholder: {},
|
|
43
|
+
searchTerm: {},
|
|
43
44
|
type: {},
|
|
44
45
|
size: { default: "md" },
|
|
45
46
|
emptyLabel: {},
|
|
@@ -65,17 +66,21 @@ var combobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
65
66
|
as: {},
|
|
66
67
|
name: {},
|
|
67
68
|
required: { type: Boolean }
|
|
68
|
-
},
|
|
69
|
-
|
|
69
|
+
}, {
|
|
70
|
+
"searchTerm": {},
|
|
71
|
+
"searchTermModifiers": {}
|
|
72
|
+
}),
|
|
73
|
+
emits: /*@__PURE__*/ mergeModels([
|
|
70
74
|
"update:modelValue",
|
|
71
75
|
"highlight",
|
|
72
76
|
"update:open"
|
|
73
|
-
],
|
|
77
|
+
], ["update:searchTerm"]),
|
|
74
78
|
setup(__props, { emit: __emit }) {
|
|
75
79
|
const props = __props;
|
|
76
80
|
const emits = __emit;
|
|
81
|
+
const searchTerm = useModel(__props, "searchTerm");
|
|
77
82
|
const delegatedProps = computed(() => {
|
|
78
|
-
const { open, options, valueBy, labelBy, placeholder, searchPlaceholder, type, size, emptyLabel, badgeProps, searchable, class: _class, ...delegated } = props;
|
|
83
|
+
const { open, options, valueBy, labelBy, placeholder, searchPlaceholder, type, size, emptyLabel, badgeProps, searchable, searchTerm: _searchTerm, class: _class, ...delegated } = props;
|
|
79
84
|
return delegated;
|
|
80
85
|
});
|
|
81
86
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
@@ -109,8 +114,7 @@ var combobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
109
114
|
...props.badgeProps,
|
|
110
115
|
disabled: props.disabled
|
|
111
116
|
}));
|
|
112
|
-
const
|
|
113
|
-
const filteredOptions = computed(() => filterFunction(props.options, searchTerm.value));
|
|
117
|
+
const filteredOptions = computed(() => props.ignoreFilter ? props.options : filterFunction(props.options, searchTerm.value ?? ""));
|
|
114
118
|
return (_ctx, _cache) => {
|
|
115
119
|
return openBlock(), createBlock(combobox_root_default, mergeProps(unref(forwarded), { "ignore-filter": "" }), {
|
|
116
120
|
default: withCtx(() => [createVNode(combobox_anchor_default, { "as-child": "" }, {
|
|
@@ -196,6 +200,6 @@ var combobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
196
200
|
}, 16);
|
|
197
201
|
};
|
|
198
202
|
}
|
|
199
|
-
}), [["__scopeId", "data-v-
|
|
203
|
+
}), [["__scopeId", "data-v-f1dfb246"]]);
|
|
200
204
|
//#endregion
|
|
201
205
|
export { combobox_default as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youcan/celeste",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"author": "YouCan <tech@youcan.shop>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"reka-ui": "^2.10.1",
|
|
53
53
|
"tinycolor2": "^1.6.0",
|
|
54
54
|
"vue-sonner": "^2.0.9",
|
|
55
|
-
"@youcan/celeste-
|
|
56
|
-
"@youcan/celeste-
|
|
55
|
+
"@youcan/celeste-tokens": "0.15.0",
|
|
56
|
+
"@youcan/celeste-icons": "0.15.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@chromatic-com/storybook": "^5.3.0",
|
|
@@ -4,7 +4,7 @@ import type { BadgeProps } from '../badge/badge.vue';
|
|
|
4
4
|
import type { ComboboxItemPropsType } from './combobox-item.vue';
|
|
5
5
|
|
|
6
6
|
import { useForwardPropsEmits } from 'reka-ui';
|
|
7
|
-
import { computed
|
|
7
|
+
import { computed } from 'vue';
|
|
8
8
|
import Badge from '../badge/badge.vue';
|
|
9
9
|
import ComboboxAnchor from './combobox-anchor.vue';
|
|
10
10
|
import ComboboxEmpty from './combobox-empty.vue';
|
|
@@ -22,6 +22,7 @@ export interface ComboboxPropsType extends ComboboxRootProps {
|
|
|
22
22
|
labelBy?: string;
|
|
23
23
|
placeholder?: string;
|
|
24
24
|
searchPlaceholder?: string;
|
|
25
|
+
searchTerm?: string;
|
|
25
26
|
type?: 'normal' | 'compact' | 'inline' | 'compact-input';
|
|
26
27
|
size?: 'xs' | 'sm' | 'md';
|
|
27
28
|
emptyLabel?: string;
|
|
@@ -39,6 +40,7 @@ const props = withDefaults(defineProps<ComboboxPropsType>(), {
|
|
|
39
40
|
size: 'md',
|
|
40
41
|
});
|
|
41
42
|
const emits = defineEmits<ComboboxRootEmits>();
|
|
43
|
+
const searchTerm = defineModel<string>('searchTerm');
|
|
42
44
|
|
|
43
45
|
const delegatedProps = computed(() => {
|
|
44
46
|
const {
|
|
@@ -53,6 +55,7 @@ const delegatedProps = computed(() => {
|
|
|
53
55
|
emptyLabel,
|
|
54
56
|
badgeProps,
|
|
55
57
|
searchable,
|
|
58
|
+
searchTerm: _searchTerm,
|
|
56
59
|
class: _class,
|
|
57
60
|
...delegated
|
|
58
61
|
} = props;
|
|
@@ -132,9 +135,9 @@ const mergedBadgeProps = computed(() => ({
|
|
|
132
135
|
disabled: props.disabled,
|
|
133
136
|
}));
|
|
134
137
|
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
const filteredOptions = computed(() => props.ignoreFilter
|
|
139
|
+
? props.options
|
|
140
|
+
: filterFunction(props.options, searchTerm.value ?? ''));
|
|
138
141
|
</script>
|
|
139
142
|
|
|
140
143
|
<template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
-
import { ref } from 'vue';
|
|
2
|
+
import { computed, ref } from 'vue';
|
|
3
3
|
import Combobox from '../combobox.vue';
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Combobox> = {
|
|
@@ -241,3 +241,37 @@ export const Preselected: Story = {
|
|
|
241
241
|
`,
|
|
242
242
|
}),
|
|
243
243
|
};
|
|
244
|
+
|
|
245
|
+
export const ControlledSearch: Story = {
|
|
246
|
+
args: {
|
|
247
|
+
valueBy: 'id',
|
|
248
|
+
placeholder: 'Search and select',
|
|
249
|
+
searchable: true,
|
|
250
|
+
searchPlaceholder: 'Search Users',
|
|
251
|
+
ignoreFilter: true,
|
|
252
|
+
},
|
|
253
|
+
|
|
254
|
+
render: args => ({
|
|
255
|
+
components: { Combobox },
|
|
256
|
+
setup() {
|
|
257
|
+
const selectedValue = ref();
|
|
258
|
+
const searchTerm = ref('');
|
|
259
|
+
|
|
260
|
+
const options = computed(() => OPTIONS.filter(option => option.label
|
|
261
|
+
.toLowerCase()
|
|
262
|
+
.startsWith(searchTerm.value.toLowerCase())));
|
|
263
|
+
|
|
264
|
+
return { args, selectedValue, searchTerm, options };
|
|
265
|
+
},
|
|
266
|
+
template: `
|
|
267
|
+
<div>
|
|
268
|
+
<Combobox v-bind="args" v-model="selectedValue" v-model:search-term="searchTerm" :options="options" />
|
|
269
|
+
<div style="margin-top: 16px; padding: 12px; background: #f5f5f5; border-radius: 8px; font-family: monospace;">
|
|
270
|
+
<strong>Term:</strong> {{ searchTerm || 'None' }}
|
|
271
|
+
<br>
|
|
272
|
+
<strong>Selected:</strong> {{ selectedValue ? selectedValue.label : 'None' }}
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
`,
|
|
276
|
+
}),
|
|
277
|
+
};
|
|
@@ -42,7 +42,7 @@ export const Default: Story = {
|
|
|
42
42
|
/>
|
|
43
43
|
<ModalBody>
|
|
44
44
|
<div style="display: grid; gap: 4px;">
|
|
45
|
-
<Label
|
|
45
|
+
<Label sublabel="(Optional)" required>Email address</Label>
|
|
46
46
|
<TextInput type="email" placeholder="hello@live.fr" size="md" />
|
|
47
47
|
</div>
|
|
48
48
|
</ModalBody>
|
|
@@ -79,7 +79,7 @@ export const WithoutDescription: Story = {
|
|
|
79
79
|
/>
|
|
80
80
|
<ModalBody>
|
|
81
81
|
<div style="display: grid; gap: 4px;">
|
|
82
|
-
<Label
|
|
82
|
+
<Label sublabel="(Optional)" required>Email address</Label>
|
|
83
83
|
<TextInput type="email" placeholder="hello@live.fr" size="md" />
|
|
84
84
|
</div>
|
|
85
85
|
</ModalBody>
|
|
@@ -113,7 +113,7 @@ export const WithoutIcon: Story = {
|
|
|
113
113
|
<ModalHeader title="Email Verification"/>
|
|
114
114
|
<ModalBody>
|
|
115
115
|
<div style="display: grid; gap: 4px;">
|
|
116
|
-
<Label
|
|
116
|
+
<Label sublabel="(Optional)" required>Email address</Label>
|
|
117
117
|
<TextInput type="email" placeholder="hello@live.fr" size="md" />
|
|
118
118
|
</div>
|
|
119
119
|
</ModalBody>
|
|
@@ -38,9 +38,12 @@ const props = withDefaults(defineProps<SidebarMenuActionProps>(), {
|
|
|
38
38
|
width: 20px;
|
|
39
39
|
padding: 0;
|
|
40
40
|
transition: transform var(--animation-fast) ease-in-out;
|
|
41
|
+
border: 0;
|
|
41
42
|
border-radius: var(--radius-8);
|
|
42
43
|
outline: none;
|
|
44
|
+
background: none;
|
|
43
45
|
color: var(--sidebar-foreground);
|
|
46
|
+
text-decoration: none;
|
|
44
47
|
inset-inline-end: var(--spacing-4);
|
|
45
48
|
inset-block-start: var(--spacing-8);
|
|
46
49
|
aspect-ratio: 1;
|
|
@@ -51,10 +51,14 @@ const delegatedProps = reactiveOmit(props, 'class', 'variant', 'isActive');
|
|
|
51
51
|
height var(--animation-fast) linear,
|
|
52
52
|
padding var(--animation-fast) linear,
|
|
53
53
|
background-color var(--animation-fast);
|
|
54
|
+
border: 0;
|
|
54
55
|
border-radius: var(--radius-8);
|
|
55
56
|
outline: none;
|
|
57
|
+
background: none;
|
|
58
|
+
color: var(--sidebar-foreground);
|
|
56
59
|
font: var(--label-sm);
|
|
57
60
|
text-align: start;
|
|
61
|
+
text-decoration: none;
|
|
58
62
|
gap: var(--spacing-8);
|
|
59
63
|
}
|
|
60
64
|
|
|
@@ -46,9 +46,12 @@ const props = withDefaults(defineProps<SidebarMenuSubButtonProps>(), {
|
|
|
46
46
|
overflow: hidden;
|
|
47
47
|
transform: translateX(-1px);
|
|
48
48
|
transition: background-color var(--animation-fast);
|
|
49
|
+
border: 0;
|
|
49
50
|
border-radius: var(--radius-8);
|
|
50
51
|
outline: none;
|
|
52
|
+
background: none;
|
|
51
53
|
color: var(--sidebar-foreground);
|
|
54
|
+
text-decoration: none;
|
|
52
55
|
gap: var(--spacing-8);
|
|
53
56
|
}
|
|
54
57
|
|
|
@@ -21,12 +21,14 @@ const props = defineProps<{
|
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
min-width: 0;
|
|
24
|
+
margin-block: 0;
|
|
24
25
|
margin-inline: var(--spacing-16);
|
|
25
26
|
padding-block: var(--spacing-4);
|
|
26
27
|
padding-inline: var(--spacing-10);
|
|
27
28
|
transform: translateX(1px);
|
|
28
29
|
gap: var(--spacing-4);
|
|
29
30
|
border-inline-start: 1px solid var(--sidebar-border);
|
|
31
|
+
list-style: none;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
[data-collapsible='icon'] .celeste-sidebar-menu-sub {
|
|
@@ -180,7 +180,7 @@ export const Simple: Story = {
|
|
|
180
180
|
},
|
|
181
181
|
template: `
|
|
182
182
|
<SidebarProvider>
|
|
183
|
-
<Sidebar collapsible="icon"
|
|
183
|
+
<Sidebar collapsible="icon" v-bind="args">
|
|
184
184
|
<SidebarHeader>
|
|
185
185
|
<DropdownMenu>
|
|
186
186
|
<DropdownMenuTrigger as-child>
|
|
@@ -351,7 +351,7 @@ export const Simple: Story = {
|
|
|
351
351
|
|
|
352
352
|
<div style="padding: 24px;">
|
|
353
353
|
<SidebarTrigger />
|
|
354
|
-
|
|
354
|
+
</div>
|
|
355
355
|
</SidebarProvider>
|
|
356
356
|
`,
|
|
357
357
|
}),
|