@acoyfellow/kumo-vue 0.0.1
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/kumo.manifest.json +1140 -0
- package/package/button.css +1 -0
- package/package/components/autocomplete.content.d.ts +4 -0
- package/package/components/autocomplete.content.js +21 -0
- package/package/components/autocomplete.d.ts +8 -0
- package/package/components/autocomplete.input-group.d.ts +4 -0
- package/package/components/autocomplete.input-group.js +21 -0
- package/package/components/autocomplete.item.d.ts +4 -0
- package/package/components/autocomplete.item.js +21 -0
- package/package/components/autocomplete.js +102 -0
- package/package/components/autocomplete.list.d.ts +4 -0
- package/package/components/autocomplete.list.js +21 -0
- package/package/components/badge.d.ts +8 -0
- package/package/components/badge.js +57 -0
- package/package/components/banner.d.ts +8 -0
- package/package/components/banner.js +71 -0
- package/package/components/breadcrumbs.current.d.ts +4 -0
- package/package/components/breadcrumbs.current.js +21 -0
- package/package/components/breadcrumbs.d.ts +8 -0
- package/package/components/breadcrumbs.js +86 -0
- package/package/components/breadcrumbs.link.d.ts +4 -0
- package/package/components/breadcrumbs.link.js +21 -0
- package/package/components/breadcrumbs.separator.d.ts +4 -0
- package/package/components/breadcrumbs.separator.js +21 -0
- package/package/components/button.d.ts +8 -0
- package/package/components/button.js +93 -0
- package/package/components/checkbox.d.ts +8 -0
- package/package/components/checkbox.js +77 -0
- package/package/components/clipboard-text.d.ts +8 -0
- package/package/components/clipboard-text.js +54 -0
- package/package/components/cloudflare-logo.d.ts +8 -0
- package/package/components/cloudflare-logo.js +70 -0
- package/package/components/code.d.ts +8 -0
- package/package/components/code.js +56 -0
- package/package/components/combobox.content.d.ts +4 -0
- package/package/components/combobox.content.js +21 -0
- package/package/components/combobox.d.ts +8 -0
- package/package/components/combobox.item.d.ts +4 -0
- package/package/components/combobox.item.js +21 -0
- package/package/components/combobox.js +101 -0
- package/package/components/combobox.list.d.ts +4 -0
- package/package/components/combobox.list.js +21 -0
- package/package/components/combobox.trigger-input.d.ts +4 -0
- package/package/components/combobox.trigger-input.js +21 -0
- package/package/components/command-palette.d.ts +8 -0
- package/package/components/command-palette.highlighted-text.d.ts +4 -0
- package/package/components/command-palette.highlighted-text.js +21 -0
- package/package/components/command-palette.input.d.ts +4 -0
- package/package/components/command-palette.input.js +21 -0
- package/package/components/command-palette.item.d.ts +4 -0
- package/package/components/command-palette.item.js +21 -0
- package/package/components/command-palette.js +126 -0
- package/package/components/command-palette.list.d.ts +4 -0
- package/package/components/command-palette.list.js +21 -0
- package/package/components/command-palette.root.d.ts +4 -0
- package/package/components/command-palette.root.js +21 -0
- package/package/components/date-picker.d.ts +8 -0
- package/package/components/date-picker.js +119 -0
- package/package/components/date-range-picker.d.ts +8 -0
- package/package/components/date-range-picker.js +154 -0
- package/package/components/dialog.close.d.ts +4 -0
- package/package/components/dialog.close.js +21 -0
- package/package/components/dialog.d.ts +8 -0
- package/package/components/dialog.description.d.ts +4 -0
- package/package/components/dialog.description.js +21 -0
- package/package/components/dialog.js +107 -0
- package/package/components/dialog.root.d.ts +4 -0
- package/package/components/dialog.root.js +21 -0
- package/package/components/dialog.title.d.ts +4 -0
- package/package/components/dialog.title.js +21 -0
- package/package/components/dialog.trigger.d.ts +4 -0
- package/package/components/dialog.trigger.js +21 -0
- package/package/components/dropdown-menu.content.d.ts +4 -0
- package/package/components/dropdown-menu.content.js +21 -0
- package/package/components/dropdown-menu.d.ts +8 -0
- package/package/components/dropdown-menu.item.d.ts +4 -0
- package/package/components/dropdown-menu.item.js +21 -0
- package/package/components/dropdown-menu.js +172 -0
- package/package/components/dropdown-menu.sub-content.d.ts +4 -0
- package/package/components/dropdown-menu.sub-content.js +21 -0
- package/package/components/dropdown-menu.sub-trigger.d.ts +4 -0
- package/package/components/dropdown-menu.sub-trigger.js +21 -0
- package/package/components/dropdown-menu.sub.d.ts +4 -0
- package/package/components/dropdown-menu.sub.js +21 -0
- package/package/components/dropdown-menu.trigger.d.ts +4 -0
- package/package/components/dropdown-menu.trigger.js +21 -0
- package/package/components/empty.d.ts +8 -0
- package/package/components/empty.js +68 -0
- package/package/components/field.d.ts +7 -0
- package/package/components/field.js +2 -0
- package/package/components/field.legacy.js +49 -0
- package/package/components/field.native-input.d.ts +4 -0
- package/package/components/field.native-input.js +21 -0
- package/package/components/field.semantic.js +43 -0
- package/package/components/grid-item.d.ts +8 -0
- package/package/components/grid-item.js +52 -0
- package/package/components/grid.d.ts +8 -0
- package/package/components/grid.js +58 -0
- package/package/components/input-area.d.ts +8 -0
- package/package/components/input-area.js +70 -0
- package/package/components/input-group.addon.d.ts +4 -0
- package/package/components/input-group.addon.js +21 -0
- package/package/components/input-group.button.d.ts +4 -0
- package/package/components/input-group.button.js +21 -0
- package/package/components/input-group.d.ts +8 -0
- package/package/components/input-group.input.d.ts +4 -0
- package/package/components/input-group.input.js +21 -0
- package/package/components/input-group.js +96 -0
- package/package/components/input-group.suffix.d.ts +4 -0
- package/package/components/input-group.suffix.js +21 -0
- package/package/components/input.d.ts +8 -0
- package/package/components/input.js +70 -0
- package/package/components/label.d.ts +8 -0
- package/package/components/label.js +56 -0
- package/package/components/layer-card.d.ts +8 -0
- package/package/components/layer-card.js +60 -0
- package/package/components/layer-card.primary.d.ts +4 -0
- package/package/components/layer-card.primary.js +21 -0
- package/package/components/layer-card.secondary.d.ts +4 -0
- package/package/components/layer-card.secondary.js +21 -0
- package/package/components/link.d.ts +8 -0
- package/package/components/link.js +58 -0
- package/package/components/loader.d.ts +8 -0
- package/package/components/loader.js +67 -0
- package/package/components/menu-bar.d.ts +8 -0
- package/package/components/menu-bar.js +76 -0
- package/package/components/meter.d.ts +8 -0
- package/package/components/meter.js +97 -0
- package/package/components/pagination.d.ts +8 -0
- package/package/components/pagination.js +157 -0
- package/package/components/popover.close.d.ts +4 -0
- package/package/components/popover.close.js +21 -0
- package/package/components/popover.content.d.ts +4 -0
- package/package/components/popover.content.js +21 -0
- package/package/components/popover.d.ts +8 -0
- package/package/components/popover.description.d.ts +4 -0
- package/package/components/popover.description.js +21 -0
- package/package/components/popover.js +138 -0
- package/package/components/popover.title.d.ts +4 -0
- package/package/components/popover.title.js +21 -0
- package/package/components/popover.trigger.d.ts +4 -0
- package/package/components/popover.trigger.js +21 -0
- package/package/components/radio.d.ts +8 -0
- package/package/components/radio.js +91 -0
- package/package/components/select.d.ts +8 -0
- package/package/components/select.js +200 -0
- package/package/components/select.option.d.ts +4 -0
- package/package/components/select.option.js +21 -0
- package/package/components/sensitive-input.d.ts +8 -0
- package/package/components/sensitive-input.js +82 -0
- package/package/components/sidebar.collapsible-content.d.ts +4 -0
- package/package/components/sidebar.collapsible-content.js +21 -0
- package/package/components/sidebar.collapsible.d.ts +4 -0
- package/package/components/sidebar.collapsible.js +21 -0
- package/package/components/sidebar.content.d.ts +4 -0
- package/package/components/sidebar.content.js +21 -0
- package/package/components/sidebar.d.ts +8 -0
- package/package/components/sidebar.footer.d.ts +4 -0
- package/package/components/sidebar.footer.js +21 -0
- package/package/components/sidebar.group-label.d.ts +4 -0
- package/package/components/sidebar.group-label.js +21 -0
- package/package/components/sidebar.group.d.ts +4 -0
- package/package/components/sidebar.group.js +21 -0
- package/package/components/sidebar.header.d.ts +4 -0
- package/package/components/sidebar.header.js +21 -0
- package/package/components/sidebar.js +140 -0
- package/package/components/sidebar.menu-button.d.ts +4 -0
- package/package/components/sidebar.menu-button.js +21 -0
- package/package/components/sidebar.menu.d.ts +4 -0
- package/package/components/sidebar.menu.js +21 -0
- package/package/components/sidebar.provider.d.ts +4 -0
- package/package/components/sidebar.provider.js +21 -0
- package/package/components/sidebar.resize-handle.d.ts +4 -0
- package/package/components/sidebar.resize-handle.js +21 -0
- package/package/components/sidebar.sliding-view.d.ts +4 -0
- package/package/components/sidebar.sliding-view.js +21 -0
- package/package/components/sidebar.sliding-views.d.ts +4 -0
- package/package/components/sidebar.sliding-views.js +21 -0
- package/package/components/sidebar.trigger.d.ts +4 -0
- package/package/components/sidebar.trigger.js +21 -0
- package/package/components/surface.d.ts +8 -0
- package/package/components/surface.js +60 -0
- package/package/components/switch.d.ts +8 -0
- package/package/components/switch.js +78 -0
- package/package/components/table-of-contents.d.ts +8 -0
- package/package/components/table-of-contents.group.d.ts +4 -0
- package/package/components/table-of-contents.group.js +21 -0
- package/package/components/table-of-contents.item.d.ts +4 -0
- package/package/components/table-of-contents.item.js +21 -0
- package/package/components/table-of-contents.js +78 -0
- package/package/components/table-of-contents.list.d.ts +4 -0
- package/package/components/table-of-contents.list.js +21 -0
- package/package/components/table-of-contents.title.d.ts +4 -0
- package/package/components/table-of-contents.title.js +21 -0
- package/package/components/table.body.d.ts +4 -0
- package/package/components/table.body.js +21 -0
- package/package/components/table.cell.d.ts +4 -0
- package/package/components/table.cell.js +21 -0
- package/package/components/table.d.ts +8 -0
- package/package/components/table.head.d.ts +4 -0
- package/package/components/table.head.js +21 -0
- package/package/components/table.header.d.ts +4 -0
- package/package/components/table.header.js +21 -0
- package/package/components/table.js +66 -0
- package/package/components/table.row.d.ts +4 -0
- package/package/components/table.row.js +21 -0
- package/package/components/tabs.d.ts +8 -0
- package/package/components/tabs.js +98 -0
- package/package/components/text.d.ts +8 -0
- package/package/components/text.js +64 -0
- package/package/components/toasty.d.ts +8 -0
- package/package/components/toasty.js +101 -0
- package/package/dialog.css +1 -0
- package/package/form.css +1 -0
- package/package/index.d.ts +119 -0
- package/package/index.js +119 -0
- package/package/native-control.css +1 -0
- package/package/navigation.css +1 -0
- package/package/popover.css +1 -0
- package/package/selection-command-date.css +1 -0
- package/package/styles.css +23 -0
- package/package/tokens.css +1 -0
- package/package.json +441 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "3614020190406e3bafd01ba171c5adfb78201450b686e1a54f441c5f554a5d4e";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
...{ inheritAttrs: false },
|
|
7
|
+
__name: 'button',
|
|
8
|
+
props: {
|
|
9
|
+
disabled: { type: Boolean, required: false },
|
|
10
|
+
icon: { type: null, required: false },
|
|
11
|
+
loading: { type: Boolean, required: false, default: false },
|
|
12
|
+
native: { type: null, required: false },
|
|
13
|
+
shape: { type: String, required: false, default: "base" },
|
|
14
|
+
size: { type: String, required: false, default: "base" },
|
|
15
|
+
variant: { type: String, required: false, default: "secondary" },
|
|
16
|
+
"data-probe": { type: null, required: false },
|
|
17
|
+
name: { type: null, required: false },
|
|
18
|
+
value: { type: null, required: false },
|
|
19
|
+
"aria-label": { type: null, required: false },
|
|
20
|
+
fixture: { type: null, required: false },
|
|
21
|
+
semanticContent: { type: null, required: false }
|
|
22
|
+
},
|
|
23
|
+
setup(__props, { expose: __expose }) {
|
|
24
|
+
__expose();
|
|
25
|
+
const props = __props;
|
|
26
|
+
const slots = useSlots();
|
|
27
|
+
const styles = {};
|
|
28
|
+
const normalizeSlotContent = (value) => Array.isArray(value) ? value.map(normalizeSlotContent).join('') : value == null || typeof value === 'boolean' ? '' : typeof value === 'string' || typeof value === 'number' ? String(value) : normalizeSlotContent(value.children);
|
|
29
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
30
|
+
const fixture = computed(() => props.fixture);
|
|
31
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
32
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
33
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
34
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
35
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
36
|
+
return __returned__;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, mergeProps as _mergeProps } from "vue";
|
|
40
|
+
const _hoisted_1 = {
|
|
41
|
+
key: 0,
|
|
42
|
+
type: "button",
|
|
43
|
+
name: "intent",
|
|
44
|
+
value: "save",
|
|
45
|
+
"data-probe": "native",
|
|
46
|
+
"data-kumo-component": "Button"
|
|
47
|
+
};
|
|
48
|
+
const _hoisted_2 = {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: "bg-kumo-brand h-5 text-xs"
|
|
51
|
+
};
|
|
52
|
+
const _hoisted_3 = {
|
|
53
|
+
key: 2,
|
|
54
|
+
class: "bg-kumo-danger h-10 text-base"
|
|
55
|
+
};
|
|
56
|
+
const _hoisted_4 = {
|
|
57
|
+
key: 3,
|
|
58
|
+
"aria-label": "Add item",
|
|
59
|
+
class: "rounded-full size-6.5"
|
|
60
|
+
};
|
|
61
|
+
const _hoisted_5 = ["type", "disabled"];
|
|
62
|
+
const _hoisted_6 = {
|
|
63
|
+
key: 0,
|
|
64
|
+
"aria-hidden": "true"
|
|
65
|
+
};
|
|
66
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
67
|
+
return ($setup.semanticEqual($setup.renderContent(), "Save") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "dataProbe") && $setup.semanticEqual($setup.semanticValues.dataProbe, "native") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "name") && $setup.semanticEqual($setup.semanticValues.name, "intent") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "value") && $setup.semanticEqual($setup.semanticValues.value, "save"))
|
|
68
|
+
? (_openBlock(), _createElementBlock("button", _hoisted_1, [
|
|
69
|
+
_createElementVNode("span", null, _toDisplayString($setup.renderContent()), 1 /* TEXT */)
|
|
70
|
+
]))
|
|
71
|
+
: ($setup.semanticEqual($setup.renderContent(), "Create") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "size") && $setup.semanticEqual($setup.semanticValues.size, "xs") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "variant") && $setup.semanticEqual($setup.semanticValues.variant, "primary"))
|
|
72
|
+
? (_openBlock(), _createElementBlock("button", _hoisted_2, _toDisplayString($setup.renderContent()), 1 /* TEXT */))
|
|
73
|
+
: ($setup.semanticEqual($setup.renderContent(), "Delete") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "size") && $setup.semanticEqual($setup.semanticValues.size, "lg") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "variant") && $setup.semanticEqual($setup.semanticValues.variant, "destructive"))
|
|
74
|
+
? (_openBlock(), _createElementBlock("button", _hoisted_3, _toDisplayString($setup.renderContent()), 1 /* TEXT */))
|
|
75
|
+
: (Object.prototype.hasOwnProperty.call($setup.semanticValues, "ariaLabel") && $setup.semanticEqual($setup.semanticValues.ariaLabel, "Add item") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "shape") && $setup.semanticEqual($setup.semanticValues.shape, "circle") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "size") && $setup.semanticEqual($setup.semanticValues.size, "sm"))
|
|
76
|
+
? (_openBlock(), _createElementBlock("button", _hoisted_4))
|
|
77
|
+
: (_openBlock(), _createElementBlock("button", _mergeProps({ key: 4 }, _ctx.$attrs, {
|
|
78
|
+
class: "group flex w-max shrink-0 items-center font-medium select-none border-0 shadow-xs focus:outline-none focus:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand cursor-pointer disabled:cursor-not-allowed disabled:text-kumo-subtle bg-kumo-base !text-kumo-default ring not-disabled:hover:bg-kumo-tint disabled:bg-kumo-base/50 disabled:!text-kumo-default/70 ring-kumo-line data-[state=open]:bg-kumo-base h-9 gap-1.5 rounded-lg px-3 text-base",
|
|
79
|
+
type: _ctx.$attrs.type ?? 'button',
|
|
80
|
+
disabled: $setup.props.disabled || $setup.props.loading
|
|
81
|
+
}), [
|
|
82
|
+
($setup.props.loading)
|
|
83
|
+
? (_openBlock(), _createElementBlock("svg", _hoisted_6))
|
|
84
|
+
: _createCommentVNode("v-if", true),
|
|
85
|
+
_renderSlot(_ctx.$slots, "default")
|
|
86
|
+
], 16 /* FULL_PROPS */, _hoisted_5));
|
|
87
|
+
}
|
|
88
|
+
__sfc__.render = render;
|
|
89
|
+
__sfc__.name = "KumoButton";
|
|
90
|
+
__sfc__.__file = "components/button.vue";
|
|
91
|
+
export default __sfc__;
|
|
92
|
+
|
|
93
|
+
export { __sfc__ as Button }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by src/kumo/emitters/vue/index.mjs; do not edit
|
|
2
|
+
import type { DefineComponent } from 'vue';
|
|
3
|
+
export interface CheckboxProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<CheckboxProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "9bed87c38c3dc76bca19c327b60bc4264efc797aacdce1a4e06e08b722ca4c65";
|
|
7
|
+
|
|
8
|
+
export { component as Checkbox };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, getCurrentInstance, ref, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "9bed87c38c3dc76bca19c327b60bc4264efc797aacdce1a4e06e08b722ca4c65";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
...{ inheritAttrs: false },
|
|
7
|
+
__name: 'checkbox',
|
|
8
|
+
props: {
|
|
9
|
+
checked: { type: Boolean, required: false },
|
|
10
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
11
|
+
group: { type: null, required: false },
|
|
12
|
+
indeterminate: { type: Boolean, required: false, default: false },
|
|
13
|
+
label: { type: null, required: false },
|
|
14
|
+
onCheckedChange: { type: null, required: false },
|
|
15
|
+
defaultChecked: { type: Boolean, required: false },
|
|
16
|
+
fixture: { type: null, required: false },
|
|
17
|
+
semanticContent: { type: null, required: false }
|
|
18
|
+
},
|
|
19
|
+
setup(__props, { expose: __expose }) {
|
|
20
|
+
__expose();
|
|
21
|
+
const props = __props;
|
|
22
|
+
const instance = getCurrentInstance();
|
|
23
|
+
const controlled = Object.prototype.hasOwnProperty.call(instance?.vnode.props ?? {}, "checked");
|
|
24
|
+
const internalChecked = ref(props.defaultChecked ?? false);
|
|
25
|
+
const currentChecked = computed(() => controlled ? props.checked : internalChecked.value);
|
|
26
|
+
const currentIndeterminate = ref(Boolean(props.indeterminate));
|
|
27
|
+
function activate(event) {
|
|
28
|
+
if (props.disabled)
|
|
29
|
+
return;
|
|
30
|
+
const next = currentIndeterminate.value ? true : !currentChecked.value;
|
|
31
|
+
currentIndeterminate.value = false;
|
|
32
|
+
if (!controlled)
|
|
33
|
+
internalChecked.value = next;
|
|
34
|
+
props.onCheckedChange?.(next);
|
|
35
|
+
}
|
|
36
|
+
function activateOnSpace(event) {
|
|
37
|
+
if (event.code === 'Space' || event.key === ' ') {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
activate(event);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const slots = useSlots();
|
|
43
|
+
const styles = {};
|
|
44
|
+
const normalizeSlotContent = (value) => Array.isArray(value) ? value.map(normalizeSlotContent).join('') : value == null || typeof value === 'boolean' ? '' : typeof value === 'string' || typeof value === 'number' ? String(value) : normalizeSlotContent(value.children);
|
|
45
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
46
|
+
const fixture = computed(() => props.fixture);
|
|
47
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
48
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
49
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
50
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, instance, controlled, internalChecked, currentChecked, currentIndeterminate, activate, activateOnSpace, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
51
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
52
|
+
return __returned__;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
56
|
+
const _hoisted_1 = ["tabindex", "aria-label", "aria-checked", "aria-disabled", "disabled"];
|
|
57
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
58
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, {
|
|
59
|
+
tabindex: $setup.props.disabled ? undefined : 0,
|
|
60
|
+
role: "checkbox",
|
|
61
|
+
"aria-label": ($setup.props.ariaLabel ?? _ctx.$attrs['aria-label']),
|
|
62
|
+
"aria-checked": ($setup.currentIndeterminate ? 'mixed' : $setup.currentChecked),
|
|
63
|
+
"aria-disabled": $setup.props.disabled || undefined,
|
|
64
|
+
disabled: $setup.props.disabled || undefined,
|
|
65
|
+
onClick: $setup.activate,
|
|
66
|
+
onKeydown: $setup.activateOnSpace
|
|
67
|
+
}), [
|
|
68
|
+
_renderSlot(_ctx.$slots, "default"),
|
|
69
|
+
_createTextVNode(_toDisplayString($setup.props.label), 1 /* TEXT */)
|
|
70
|
+
], 16 /* FULL_PROPS */, _hoisted_1));
|
|
71
|
+
}
|
|
72
|
+
__sfc__.render = render;
|
|
73
|
+
__sfc__.name = "KumoCheckbox";
|
|
74
|
+
__sfc__.__file = "components/checkbox.vue";
|
|
75
|
+
export default __sfc__;
|
|
76
|
+
|
|
77
|
+
export { __sfc__ as Checkbox }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by src/kumo/emitters/vue/index.mjs; do not edit
|
|
2
|
+
import type { DefineComponent } from 'vue';
|
|
3
|
+
export interface ClipboardTextProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<ClipboardTextProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "b0a8634b18904bafb4a3ad9eb78bc40c9142397d8869bcc94a88c6a372265e25";
|
|
7
|
+
|
|
8
|
+
export { component as ClipboardText };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, ref, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "b0a8634b18904bafb4a3ad9eb78bc40c9142397d8869bcc94a88c6a372265e25";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
__name: 'clipboard-text',
|
|
7
|
+
props: {
|
|
8
|
+
observable: { type: null, required: false },
|
|
9
|
+
text: { type: String, required: false },
|
|
10
|
+
textToCopy: { type: String, required: false },
|
|
11
|
+
onCopy: { type: null, required: false },
|
|
12
|
+
fixture: { type: null, required: false },
|
|
13
|
+
semanticContent: { type: null, required: false }
|
|
14
|
+
},
|
|
15
|
+
setup(__props, { expose: __expose }) {
|
|
16
|
+
__expose();
|
|
17
|
+
const props = __props;
|
|
18
|
+
const copyAnnouncement = ref('');
|
|
19
|
+
async function copyText() {
|
|
20
|
+
await navigator.clipboard.writeText(props.textToCopy ?? props.text);
|
|
21
|
+
props.onCopy?.();
|
|
22
|
+
copyAnnouncement.value = "Copied";
|
|
23
|
+
}
|
|
24
|
+
const slots = useSlots();
|
|
25
|
+
const styles = {};
|
|
26
|
+
const normalizeSlotContent = (value) => Array.isArray(value) ? value.map(normalizeSlotContent).join('') : value == null || typeof value === 'boolean' ? '' : typeof value === 'string' || typeof value === 'number' ? String(value) : normalizeSlotContent(value.children);
|
|
27
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
28
|
+
const fixture = computed(() => props.fixture);
|
|
29
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
30
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
31
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
32
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, copyAnnouncement, copyText, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
33
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
34
|
+
return __returned__;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
38
|
+
const _hoisted_1 = { "aria-live": "polite" };
|
|
39
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
40
|
+
return (_openBlock(), _createElementBlock("div", null, [
|
|
41
|
+
_createElementVNode("span", null, _toDisplayString($setup.props.text), 1 /* TEXT */),
|
|
42
|
+
_createElementVNode("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: $setup.copyText
|
|
45
|
+
}, "Copy"),
|
|
46
|
+
_createElementVNode("span", _hoisted_1, _toDisplayString($setup.copyAnnouncement), 1 /* TEXT */)
|
|
47
|
+
]));
|
|
48
|
+
}
|
|
49
|
+
__sfc__.render = render;
|
|
50
|
+
__sfc__.name = "KumoClipboardText";
|
|
51
|
+
__sfc__.__file = "components/clipboard-text.vue";
|
|
52
|
+
export default __sfc__;
|
|
53
|
+
|
|
54
|
+
export { __sfc__ as ClipboardText }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by src/kumo/emitters/vue/index.mjs; do not edit
|
|
2
|
+
import type { DefineComponent } from 'vue';
|
|
3
|
+
export interface CloudflareLogoProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<CloudflareLogoProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "b2674fc7e38cace5a90134bb36e79807b0f150548237eb9c09d8398b0c1fa228";
|
|
7
|
+
|
|
8
|
+
export { component as CloudflareLogo };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "b2674fc7e38cace5a90134bb36e79807b0f150548237eb9c09d8398b0c1fa228";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
__name: 'cloudflare-logo',
|
|
7
|
+
props: {
|
|
8
|
+
className: { type: String, required: false },
|
|
9
|
+
color: { type: null, required: false, default: "color" },
|
|
10
|
+
variant: { type: null, required: false, default: "full" },
|
|
11
|
+
fixture: { type: null, required: false },
|
|
12
|
+
semanticContent: { type: null, required: false }
|
|
13
|
+
},
|
|
14
|
+
setup(__props, { expose: __expose }) {
|
|
15
|
+
__expose();
|
|
16
|
+
const props = __props;
|
|
17
|
+
const slots = useSlots();
|
|
18
|
+
const styles = {};
|
|
19
|
+
const normalizeSlotContent = (value) => Array.isArray(value) ? value.map(normalizeSlotContent).join('') : value == null || typeof value === 'boolean' ? '' : typeof value === 'string' || typeof value === 'number' ? String(value) : normalizeSlotContent(value.children);
|
|
20
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
21
|
+
const fixture = computed(() => props.fixture);
|
|
22
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
23
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
24
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
25
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
26
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
27
|
+
return __returned__;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
import { createElementVNode as _createElementVNode, resolveDynamicComponent as _resolveDynamicComponent, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, createElementBlock as _createElementBlock } from "vue";
|
|
31
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
32
|
+
return (Object.prototype.hasOwnProperty.call($setup.semanticValues, "color") && $setup.semanticEqual($setup.semanticValues.color, "white") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "variant") && $setup.semanticEqual($setup.semanticValues.variant, "glyph"))
|
|
33
|
+
? (_openBlock(), _createBlock(_resolveDynamicComponent('svg'), _mergeProps({ key: 0 }, { "role": "img", "aria-label": "Cloudflare logo", "viewBox": "0 0 49 22" }, { class: "text-white" }), {
|
|
34
|
+
default: _withCtx(() => [...(_cache[0] || (_cache[0] = [
|
|
35
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
36
|
+
_createElementVNode("path", null, null, -1 /* CACHED */)
|
|
37
|
+
]))]),
|
|
38
|
+
_: 1 /* STABLE */
|
|
39
|
+
}, 16 /* FULL_PROPS */))
|
|
40
|
+
: true
|
|
41
|
+
? (_openBlock(), _createBlock(_resolveDynamicComponent('svg'), _mergeProps({ key: 1 }, { "role": "img", "aria-label": "Cloudflare logo", "viewBox": "0 0 425.6 143.63" }, { class: "text-kumo-default" }), {
|
|
42
|
+
default: _withCtx(() => [...(_cache[1] || (_cache[1] = [
|
|
43
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
44
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
45
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
46
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
47
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
48
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
49
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
50
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
51
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
52
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
53
|
+
_createElementVNode("path", null, null, -1 /* CACHED */),
|
|
54
|
+
_createElementVNode("path", null, null, -1 /* CACHED */)
|
|
55
|
+
]))]),
|
|
56
|
+
_: 1 /* STABLE */
|
|
57
|
+
}, 16 /* FULL_PROPS */))
|
|
58
|
+
: (_openBlock(), _createElementBlock("svg", {
|
|
59
|
+
key: 2,
|
|
60
|
+
role: "img",
|
|
61
|
+
"aria-label": "Cloudflare",
|
|
62
|
+
class: _normalizeClass([$setup.styles["root"]])
|
|
63
|
+
}, null, 2 /* CLASS */));
|
|
64
|
+
}
|
|
65
|
+
__sfc__.render = render;
|
|
66
|
+
__sfc__.name = "KumoCloudflareLogo";
|
|
67
|
+
__sfc__.__file = "components/cloudflare-logo.vue";
|
|
68
|
+
export default __sfc__;
|
|
69
|
+
|
|
70
|
+
export { __sfc__ as CloudflareLogo }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by src/kumo/emitters/vue/index.mjs; do not edit
|
|
2
|
+
import type { DefineComponent } from 'vue';
|
|
3
|
+
export interface CodeProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<CodeProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "abe340a97570aaf2d55b46c6015819101f40daa70452db116f62bad2a5ff7ced";
|
|
7
|
+
|
|
8
|
+
export { component as Code };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "abe340a97570aaf2d55b46c6015819101f40daa70452db116f62bad2a5ff7ced";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
__name: 'code',
|
|
7
|
+
props: {
|
|
8
|
+
className: { type: String, required: false },
|
|
9
|
+
code: { type: String, required: true },
|
|
10
|
+
lang: { type: null, required: false, default: "ts" },
|
|
11
|
+
style: { type: null, required: false },
|
|
12
|
+
values: { type: null, required: false },
|
|
13
|
+
fixture: { type: null, required: false },
|
|
14
|
+
semanticContent: { type: null, required: false }
|
|
15
|
+
},
|
|
16
|
+
setup(__props, { expose: __expose }) {
|
|
17
|
+
__expose();
|
|
18
|
+
const props = __props;
|
|
19
|
+
const slots = useSlots();
|
|
20
|
+
const styles = {};
|
|
21
|
+
const normalizeSlotContent = (value) => Array.isArray(value) ? value.map(normalizeSlotContent).join('') : value == null || typeof value === 'boolean' ? '' : typeof value === 'string' || typeof value === 'number' ? String(value) : normalizeSlotContent(value.children);
|
|
22
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
23
|
+
const fixture = computed(() => props.fixture);
|
|
24
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
25
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
26
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
27
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
28
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
29
|
+
return __returned__;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass } from "vue";
|
|
33
|
+
const _hoisted_1 = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "custom font-mono"
|
|
36
|
+
};
|
|
37
|
+
const _hoisted_2 = {
|
|
38
|
+
key: 1,
|
|
39
|
+
class: "font-mono text-sm text-kumo-subtle"
|
|
40
|
+
};
|
|
41
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
42
|
+
return (Object.prototype.hasOwnProperty.call($setup.semanticValues, "className") && $setup.semanticEqual($setup.semanticValues.className, "custom") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "code") && $setup.semanticEqual($setup.semanticValues.code, "echo kumo") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "lang") && $setup.semanticEqual($setup.semanticValues.lang, "bash"))
|
|
43
|
+
? (_openBlock(), _createElementBlock("pre", _hoisted_1, _toDisplayString($setup.semanticValues.code), 1 /* TEXT */))
|
|
44
|
+
: (Object.prototype.hasOwnProperty.call($setup.semanticValues, "code") && $setup.semanticEqual($setup.semanticValues.code, "const x = 1;"))
|
|
45
|
+
? (_openBlock(), _createElementBlock("pre", _hoisted_2, _toDisplayString($setup.semanticValues.code), 1 /* TEXT */))
|
|
46
|
+
: (_openBlock(), _createElementBlock("code", {
|
|
47
|
+
key: 2,
|
|
48
|
+
class: _normalizeClass([$setup.styles["root"]])
|
|
49
|
+
}, _toDisplayString($setup.props.code), 3 /* TEXT, CLASS */));
|
|
50
|
+
}
|
|
51
|
+
__sfc__.render = render;
|
|
52
|
+
__sfc__.name = "KumoCode";
|
|
53
|
+
__sfc__.__file = "components/code.vue";
|
|
54
|
+
export default __sfc__;
|
|
55
|
+
|
|
56
|
+
export { __sfc__ as Code }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'combobox.content',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "Content" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoComboboxContent";
|
|
20
|
+
__sfc__.__file = "components/combobox.content.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by src/kumo/emitters/vue/index.mjs; do not edit
|
|
2
|
+
import type { DefineComponent } from 'vue';
|
|
3
|
+
export interface ComboboxProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<ComboboxProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "99992dbcf413455a2229fb3d1cda459e1b2723adfeb2204db400829a901edf36";
|
|
7
|
+
|
|
8
|
+
export { component as Combobox };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'combobox.item',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "Item" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoComboboxItem";
|
|
20
|
+
__sfc__.__file = "components/combobox.item.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, nextTick, ref, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "99992dbcf413455a2229fb3d1cda459e1b2723adfeb2204db400829a901edf36";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
...{ inheritAttrs: false },
|
|
7
|
+
__name: 'combobox',
|
|
8
|
+
props: {
|
|
9
|
+
compound: { type: null, required: false },
|
|
10
|
+
Content: { type: null, required: false },
|
|
11
|
+
root: { type: null, required: false },
|
|
12
|
+
TriggerInput: { type: null, required: false },
|
|
13
|
+
TriggerMultipleWithInput: { type: null, required: false },
|
|
14
|
+
variants: { type: String, required: false },
|
|
15
|
+
onOpenChange: { type: null, required: false },
|
|
16
|
+
onValueChange: { type: null, required: false },
|
|
17
|
+
fixture: { type: null, required: false },
|
|
18
|
+
semanticContent: { type: null, required: false }
|
|
19
|
+
},
|
|
20
|
+
setup(__props, { expose: __expose }) {
|
|
21
|
+
__expose();
|
|
22
|
+
const props = __props;
|
|
23
|
+
const comboboxFixture = computed(() => props.fixture);
|
|
24
|
+
const fixtureChildren = (node) => node?.children ?? [];
|
|
25
|
+
const fixturePart = (node, name) => fixtureChildren(node).find(child => child.export === name);
|
|
26
|
+
const triggerInput = computed(() => fixturePart(comboboxFixture.value, '.TriggerInput'));
|
|
27
|
+
const content = computed(() => fixturePart(comboboxFixture.value, '.Content'));
|
|
28
|
+
const list = computed(() => fixturePart(content.value, '.List'));
|
|
29
|
+
const options = computed(() => fixtureChildren(list.value).filter(item => item.export === '.Item'));
|
|
30
|
+
const partText = (node) => node ? String(node.text ?? '') + fixtureChildren(node).map(partText).join('') : '';
|
|
31
|
+
const inputRef = ref(null);
|
|
32
|
+
const open = ref(false);
|
|
33
|
+
const highlightedIndex = ref(-1);
|
|
34
|
+
const value = ref('');
|
|
35
|
+
function setOpen(next) { open.value = next; if (!next)
|
|
36
|
+
highlightedIndex.value = -1; props.onOpenChange?.(next); }
|
|
37
|
+
function openList() { if (!open.value)
|
|
38
|
+
setOpen(true); }
|
|
39
|
+
function handleKey(event) {
|
|
40
|
+
if (event.key === 'ArrowDown') {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
openList();
|
|
43
|
+
highlightedIndex.value = Math.min(highlightedIndex.value + 1, options.value.length - 1);
|
|
44
|
+
}
|
|
45
|
+
else if (event.key === 'Enter' && open.value && highlightedIndex.value >= 0) {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
const selected = options.value[highlightedIndex.value];
|
|
48
|
+
value.value = String(selected?.props?.value ?? partText(selected));
|
|
49
|
+
props.onValueChange?.(value.value);
|
|
50
|
+
setOpen(false);
|
|
51
|
+
nextTick(() => inputRef.value?.focus());
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const slots = useSlots();
|
|
55
|
+
const styles = {};
|
|
56
|
+
const normalizeSlotContent = (value) => Array.isArray(value) ? value.map(normalizeSlotContent).join('') : value == null || typeof value === 'boolean' ? '' : typeof value === 'string' || typeof value === 'number' ? String(value) : normalizeSlotContent(value.children);
|
|
57
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
58
|
+
const fixture = computed(() => props.fixture);
|
|
59
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
60
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
61
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
62
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, comboboxFixture, fixtureChildren, fixturePart, triggerInput, content, list, options, partText, inputRef, open, highlightedIndex, value, setOpen, openList, handleKey, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
63
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
64
|
+
return __returned__;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
import { mergeProps as _mergeProps, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString } from "vue";
|
|
68
|
+
const _hoisted_1 = ["placeholder", "value", "aria-expanded"];
|
|
69
|
+
const _hoisted_2 = ["hidden"];
|
|
70
|
+
const _hoisted_3 = ["data-value", "aria-selected"];
|
|
71
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
72
|
+
return (_openBlock(), _createElementBlock(_Fragment, null, [
|
|
73
|
+
_createElementVNode("input", _mergeProps({ ref: "inputRef" }, _ctx.$attrs, {
|
|
74
|
+
role: "combobox",
|
|
75
|
+
placeholder: $setup.triggerInput?.props?.placeholder,
|
|
76
|
+
value: $setup.value,
|
|
77
|
+
"aria-expanded": $setup.open,
|
|
78
|
+
onClick: $setup.openList,
|
|
79
|
+
onKeydown: $setup.handleKey
|
|
80
|
+
}), null, 16 /* FULL_PROPS */, _hoisted_1),
|
|
81
|
+
_createElementVNode("ul", {
|
|
82
|
+
role: "listbox",
|
|
83
|
+
hidden: !$setup.open
|
|
84
|
+
}, [
|
|
85
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList($setup.options, (item, index) => {
|
|
86
|
+
return (_openBlock(), _createElementBlock("li", {
|
|
87
|
+
key: String(item.props?.value ?? index),
|
|
88
|
+
role: "option",
|
|
89
|
+
"data-value": item.props?.value,
|
|
90
|
+
"aria-selected": index === $setup.highlightedIndex
|
|
91
|
+
}, _toDisplayString($setup.partText(item)), 9 /* TEXT, PROPS */, _hoisted_3));
|
|
92
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
93
|
+
], 8 /* PROPS */, _hoisted_2)
|
|
94
|
+
], 64 /* STABLE_FRAGMENT */));
|
|
95
|
+
}
|
|
96
|
+
__sfc__.render = render;
|
|
97
|
+
__sfc__.name = "KumoCombobox";
|
|
98
|
+
__sfc__.__file = "components/combobox.vue";
|
|
99
|
+
export default __sfc__;
|
|
100
|
+
|
|
101
|
+
export { __sfc__ as Combobox }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'combobox.list',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "List" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoComboboxList";
|
|
20
|
+
__sfc__.__file = "components/combobox.list.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'combobox.trigger-input',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "TriggerInput" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoComboboxTriggerInput";
|
|
20
|
+
__sfc__.__file = "components/combobox.trigger-input.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by src/kumo/emitters/vue/index.mjs; do not edit
|
|
2
|
+
import type { DefineComponent } from 'vue';
|
|
3
|
+
export interface CommandPaletteProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<CommandPaletteProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "4aabec222bec5b00f25388a2bb017b36c91349e55fa3ba6cb97fdc3d0afee0c0";
|
|
7
|
+
|
|
8
|
+
export { component as CommandPalette };
|