@prsm/mono-components 0.1.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/.claude/settings.local.json +13 -0
- package/.lore +83 -0
- package/histoire.config.js +43 -0
- package/package.json +39 -0
- package/postcss.config.js +6 -0
- package/src/components/Badge.vue +36 -0
- package/src/components/Button.vue +44 -0
- package/src/components/Checkbox.vue +51 -0
- package/src/components/CheckboxCards.vue +61 -0
- package/src/components/CodeEditor.vue +299 -0
- package/src/components/Collapsible.vue +69 -0
- package/src/components/CollapsibleGroup.vue +38 -0
- package/src/components/Combobox.vue +179 -0
- package/src/components/ContextMenu.vue +65 -0
- package/src/components/ContextMenuPanel.vue +115 -0
- package/src/components/DataTable.vue +326 -0
- package/src/components/Dropdown.vue +127 -0
- package/src/components/GhostInput.vue +29 -0
- package/src/components/Input.vue +23 -0
- package/src/components/KeyValue.vue +149 -0
- package/src/components/LabeledTextarea.vue +64 -0
- package/src/components/LabeledTextareaGroup.vue +14 -0
- package/src/components/Mention.vue +79 -0
- package/src/components/Modal.vue +109 -0
- package/src/components/MultiCombobox.vue +209 -0
- package/src/components/NavTree.vue +98 -0
- package/src/components/NumberInput.vue +128 -0
- package/src/components/PopConfirm.vue +94 -0
- package/src/components/Popover.vue +53 -0
- package/src/components/RadioCards.vue +37 -0
- package/src/components/RadioGroup.vue +57 -0
- package/src/components/RangeSlider.vue +165 -0
- package/src/components/ScrollBox.vue +78 -0
- package/src/components/SectionHeader.vue +18 -0
- package/src/components/Select.vue +187 -0
- package/src/components/Switch.vue +85 -0
- package/src/components/Tabs.vue +34 -0
- package/src/components/TagInput.vue +80 -0
- package/src/components/Textarea.vue +97 -0
- package/src/components/ToastContainer.vue +104 -0
- package/src/components/ToggleButtons.vue +45 -0
- package/src/components/ToggleGroup.vue +30 -0
- package/src/components/Tooltip.vue +56 -0
- package/src/components/Tree.vue +188 -0
- package/src/composables/toast.js +54 -0
- package/src/composables/useClickOutside.js +23 -0
- package/src/composables/useMention.js +291 -0
- package/src/composables/usePointerDrag.js +39 -0
- package/src/histoire-setup.js +1 -0
- package/src/index.js +43 -0
- package/src/style.css +96 -0
- package/stories/Badge.story.vue +24 -0
- package/stories/Button.story.vue +45 -0
- package/stories/Checkbox.story.vue +31 -0
- package/stories/CheckboxCards.story.vue +51 -0
- package/stories/CodeEditor.story.vue +71 -0
- package/stories/Collapsible.story.vue +84 -0
- package/stories/Combobox.story.vue +44 -0
- package/stories/ContextMenu.story.vue +59 -0
- package/stories/DataTable.story.vue +185 -0
- package/stories/Dropdown.story.vue +49 -0
- package/stories/GhostInput.story.vue +24 -0
- package/stories/Input.story.vue +23 -0
- package/stories/KeyValue.story.vue +104 -0
- package/stories/LabeledTextarea.story.vue +44 -0
- package/stories/Mention.story.vue +166 -0
- package/stories/Modal.story.vue +86 -0
- package/stories/MultiCombobox.story.vue +76 -0
- package/stories/NavTree.story.vue +184 -0
- package/stories/NumberInput.story.vue +31 -0
- package/stories/Overview.story.vue +85 -0
- package/stories/PopConfirm.story.vue +39 -0
- package/stories/RadioCards.story.vue +66 -0
- package/stories/RadioGroup.story.vue +52 -0
- package/stories/RangeSlider.story.vue +75 -0
- package/stories/ScrollBox.story.vue +54 -0
- package/stories/SectionHeader.story.vue +22 -0
- package/stories/Select.story.vue +34 -0
- package/stories/Switch.story.vue +42 -0
- package/stories/Tabs.story.vue +34 -0
- package/stories/TagInput.story.vue +54 -0
- package/stories/Textarea.story.vue +28 -0
- package/stories/Toast.story.vue +28 -0
- package/stories/ToggleButtons.story.vue +57 -0
- package/stories/ToggleGroup.story.vue +34 -0
- package/stories/Tooltip.story.vue +55 -0
- package/stories/Tree.story.vue +115 -0
- package/tailwind.config.js +9 -0
- package/tailwind.preset.js +79 -0
- package/vite.config.js +6 -0
package/src/style.css
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--bg-0: #fcfcfe;
|
|
7
|
+
--bg-1: #f3f4f7;
|
|
8
|
+
--bg-2: #e8eaee;
|
|
9
|
+
--bg-3: #dbdde3;
|
|
10
|
+
--bg-4: #ccd0d8;
|
|
11
|
+
--bg-5: #b8bdc7;
|
|
12
|
+
--bg-6: #a0a6b2;
|
|
13
|
+
|
|
14
|
+
--fg-0: #1a1a1a;
|
|
15
|
+
--fg-1: #4a4a4a;
|
|
16
|
+
--fg-2: #7a7a7a;
|
|
17
|
+
--fg-3: #787878;
|
|
18
|
+
|
|
19
|
+
--border: #c8c8c8;
|
|
20
|
+
--border-subtle: #d8d8d8;
|
|
21
|
+
|
|
22
|
+
--accent: #f06f00;
|
|
23
|
+
--accent-hover: #d96300;
|
|
24
|
+
--accent-subtle: #fef4ec;
|
|
25
|
+
|
|
26
|
+
--success: #4a9;
|
|
27
|
+
--warning: #f06f00;
|
|
28
|
+
--error: #c44;
|
|
29
|
+
--info: #6a9;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (prefers-color-scheme: dark) {
|
|
33
|
+
:root {
|
|
34
|
+
--bg-0: #111214;
|
|
35
|
+
--bg-1: #191a1e;
|
|
36
|
+
--bg-2: #24262b;
|
|
37
|
+
--bg-3: #31343a;
|
|
38
|
+
--bg-4: #3f434b;
|
|
39
|
+
--bg-5: #4f545e;
|
|
40
|
+
--bg-6: #616872;
|
|
41
|
+
|
|
42
|
+
--fg-0: #e5e5e5;
|
|
43
|
+
--fg-1: #b0b0b0;
|
|
44
|
+
--fg-2: #808080;
|
|
45
|
+
--fg-3: #888888;
|
|
46
|
+
|
|
47
|
+
--border: #3a3a3a;
|
|
48
|
+
--border-subtle: #2e2e2e;
|
|
49
|
+
|
|
50
|
+
--accent: #b65400;
|
|
51
|
+
--accent-hover: #cf6510;
|
|
52
|
+
--accent-subtle: #2a1c10;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dark {
|
|
57
|
+
--bg-0: #111214;
|
|
58
|
+
--bg-1: #191a1e;
|
|
59
|
+
--bg-2: #24262b;
|
|
60
|
+
--bg-3: #31343a;
|
|
61
|
+
--bg-4: #3f434b;
|
|
62
|
+
--bg-5: #4f545e;
|
|
63
|
+
--bg-6: #616872;
|
|
64
|
+
|
|
65
|
+
--fg-0: #e5e5e5;
|
|
66
|
+
--fg-1: #b0b0b0;
|
|
67
|
+
--fg-2: #808080;
|
|
68
|
+
--fg-3: #888888;
|
|
69
|
+
|
|
70
|
+
--border: #3a3a3a;
|
|
71
|
+
--border-subtle: #2e2e2e;
|
|
72
|
+
|
|
73
|
+
--accent: #b65400;
|
|
74
|
+
--accent-hover: #cf6510;
|
|
75
|
+
--accent-subtle: #2a1c10;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
* {
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
html, body {
|
|
83
|
+
margin: 0;
|
|
84
|
+
padding: 0;
|
|
85
|
+
background: var(--bg-0);
|
|
86
|
+
color: var(--fg-0);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
body {
|
|
90
|
+
font-family: "JetBrains Mono", "Fira Code", "SF Mono", monospace;
|
|
91
|
+
font-size: 12px;
|
|
92
|
+
background: var(--bg-0);
|
|
93
|
+
color: var(--fg-0);
|
|
94
|
+
-webkit-font-smoothing: antialiased;
|
|
95
|
+
-moz-osx-font-smoothing: grayscale;
|
|
96
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import Badge from "../src/components/Badge.vue"
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<Story title="Badge">
|
|
7
|
+
<Variant title="All Variants">
|
|
8
|
+
<div class="flex gap-2 items-center">
|
|
9
|
+
<Badge variant="success">Success</Badge>
|
|
10
|
+
<Badge variant="warning">Warning</Badge>
|
|
11
|
+
<Badge variant="error">Error</Badge>
|
|
12
|
+
<Badge variant="info">Info</Badge>
|
|
13
|
+
<Badge variant="neutral">Neutral</Badge>
|
|
14
|
+
</div>
|
|
15
|
+
</Variant>
|
|
16
|
+
<Variant title="With Content">
|
|
17
|
+
<div class="flex gap-2 items-center">
|
|
18
|
+
<Badge variant="success">3 passed</Badge>
|
|
19
|
+
<Badge variant="error">1 failed</Badge>
|
|
20
|
+
<Badge variant="info">v2.1.0</Badge>
|
|
21
|
+
</div>
|
|
22
|
+
</Variant>
|
|
23
|
+
</Story>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Icon } from "@iconify/vue"
|
|
3
|
+
import Button from "../src/components/Button.vue"
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<Story title="Button">
|
|
8
|
+
<Variant title="Default">
|
|
9
|
+
<Button>Default</Button>
|
|
10
|
+
</Variant>
|
|
11
|
+
<Variant title="Primary">
|
|
12
|
+
<Button variant="primary">Primary</Button>
|
|
13
|
+
</Variant>
|
|
14
|
+
<Variant title="Outline">
|
|
15
|
+
<Button variant="outline">Outline</Button>
|
|
16
|
+
</Variant>
|
|
17
|
+
<Variant title="Ghost">
|
|
18
|
+
<Button variant="ghost">Ghost</Button>
|
|
19
|
+
</Variant>
|
|
20
|
+
<Variant title="Danger">
|
|
21
|
+
<Button variant="danger">Danger</Button>
|
|
22
|
+
</Variant>
|
|
23
|
+
<Variant title="Icon">
|
|
24
|
+
<Button variant="icon">
|
|
25
|
+
<Icon icon="material-symbols:settings" class="text-base" />
|
|
26
|
+
</Button>
|
|
27
|
+
</Variant>
|
|
28
|
+
<Variant title="Small">
|
|
29
|
+
<div class="flex gap-2">
|
|
30
|
+
<Button size="small">Small Default</Button>
|
|
31
|
+
<Button size="small" variant="primary">Small Primary</Button>
|
|
32
|
+
<Button size="small" variant="outline">Small Outline</Button>
|
|
33
|
+
</div>
|
|
34
|
+
</Variant>
|
|
35
|
+
<Variant title="All Variants">
|
|
36
|
+
<div class="flex gap-2 items-center">
|
|
37
|
+
<Button>Default</Button>
|
|
38
|
+
<Button variant="primary">Primary</Button>
|
|
39
|
+
<Button variant="outline">Outline</Button>
|
|
40
|
+
<Button variant="ghost">Ghost</Button>
|
|
41
|
+
<Button variant="danger">Danger</Button>
|
|
42
|
+
</div>
|
|
43
|
+
</Variant>
|
|
44
|
+
</Story>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue"
|
|
3
|
+
import Checkbox from "../src/components/Checkbox.vue"
|
|
4
|
+
|
|
5
|
+
const checked = ref(false)
|
|
6
|
+
const indeterminate = ref(false)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<Story title="Checkbox">
|
|
11
|
+
<Variant title="With Label">
|
|
12
|
+
<Checkbox v-model="checked" label="Enable notifications" />
|
|
13
|
+
<template #controls>
|
|
14
|
+
<div class="text-xs text-fg-2 p-2">checked: {{ checked }}</div>
|
|
15
|
+
</template>
|
|
16
|
+
</Variant>
|
|
17
|
+
<Variant title="Without Label">
|
|
18
|
+
<Checkbox v-model="checked" />
|
|
19
|
+
</Variant>
|
|
20
|
+
<Variant title="Indeterminate">
|
|
21
|
+
<Checkbox v-model="indeterminate" :indeterminate="true" label="Select all" />
|
|
22
|
+
</Variant>
|
|
23
|
+
<Variant title="Multiple">
|
|
24
|
+
<div class="flex flex-col gap-1">
|
|
25
|
+
<Checkbox v-model="checked" label="Option A" />
|
|
26
|
+
<Checkbox v-model="indeterminate" label="Option B" />
|
|
27
|
+
<Checkbox :model-value="true" label="Option C (always on)" />
|
|
28
|
+
</div>
|
|
29
|
+
</Variant>
|
|
30
|
+
</Story>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue"
|
|
3
|
+
import { logEvent } from "histoire/client"
|
|
4
|
+
import CheckboxCards from "../src/components/CheckboxCards.vue"
|
|
5
|
+
|
|
6
|
+
const tools = ref(["vector_search", "web_search"])
|
|
7
|
+
const toolOptions = [
|
|
8
|
+
{ value: "vector_search", label: "Vector Search", description: "Semantic similarity search across document embeddings" },
|
|
9
|
+
{ value: "sql_query", label: "SQL Query", description: "Run queries against structured datasets" },
|
|
10
|
+
{ value: "web_search", label: "Web Search", description: "Search the web for real-time information" },
|
|
11
|
+
{ value: "fetch_url", label: "Fetch URL", description: "Retrieve and read web page content" }
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
const features = ref(["dark_mode"])
|
|
15
|
+
const featureOptions = [
|
|
16
|
+
{ value: "dark_mode", label: "Dark Mode" },
|
|
17
|
+
{ value: "notifications", label: "Notifications" },
|
|
18
|
+
{ value: "analytics", label: "Analytics" },
|
|
19
|
+
{ value: "export", label: "Export" }
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
function handleUpdate(name, value) {
|
|
23
|
+
logEvent("update:modelValue", { name, value })
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<Story title="CheckboxCards">
|
|
29
|
+
<Variant title="Tools">
|
|
30
|
+
<div class="w-[320px]">
|
|
31
|
+
<CheckboxCards
|
|
32
|
+
v-model="tools"
|
|
33
|
+
:options="toolOptions"
|
|
34
|
+
@update:model-value="v => handleUpdate('tools', v)"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
<template #controls>
|
|
38
|
+
<div class="text-xs text-fg-2 p-2">selected: {{ tools.join(", ") }}</div>
|
|
39
|
+
</template>
|
|
40
|
+
</Variant>
|
|
41
|
+
<Variant title="No Descriptions">
|
|
42
|
+
<div class="w-[240px]">
|
|
43
|
+
<CheckboxCards
|
|
44
|
+
v-model="features"
|
|
45
|
+
:options="featureOptions"
|
|
46
|
+
@update:model-value="v => handleUpdate('features', v)"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</Variant>
|
|
50
|
+
</Story>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue"
|
|
3
|
+
import CodeEditor from "../src/components/CodeEditor.vue"
|
|
4
|
+
|
|
5
|
+
const basic = ref("")
|
|
6
|
+
const prefilled = ref("SELECT c.name, c.email, COUNT(o.id) AS order_count\nFROM customers c\nJOIN orders o ON o.customer_id = c.id\nWHERE c.active = true\nGROUP BY c.name, c.email\nORDER BY order_count DESC\nLIMIT 50")
|
|
7
|
+
const withSchema = ref("SELECT ")
|
|
8
|
+
const readonly = ref("SELECT * FROM users WHERE role = 'admin'")
|
|
9
|
+
|
|
10
|
+
const schema = {
|
|
11
|
+
customers: ["id", "name", "email", "industry", "active", "created_at"],
|
|
12
|
+
orders: ["id", "customer_id", "total", "status", "placed_at"],
|
|
13
|
+
products: ["id", "sku", "name", "price", "category"],
|
|
14
|
+
order_items: ["id", "order_id", "product_id", "quantity", "unit_price"],
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<Story title="CodeEditor">
|
|
20
|
+
<Variant title="Empty">
|
|
21
|
+
<CodeEditor v-model="basic" placeholder="SELECT * FROM ..." />
|
|
22
|
+
<template #controls>
|
|
23
|
+
<div class="text-xs text-fg-2 p-2">{{ basic.length }} chars</div>
|
|
24
|
+
</template>
|
|
25
|
+
</Variant>
|
|
26
|
+
|
|
27
|
+
<Variant title="Prefilled SQL">
|
|
28
|
+
<CodeEditor v-model="prefilled" />
|
|
29
|
+
<template #controls>
|
|
30
|
+
<div class="text-xs text-fg-2 p-2 font-mono whitespace-pre">{{ prefilled }}</div>
|
|
31
|
+
</template>
|
|
32
|
+
</Variant>
|
|
33
|
+
|
|
34
|
+
<Variant title="With Schema Autocomplete">
|
|
35
|
+
<div class="flex flex-col gap-2">
|
|
36
|
+
<div class="text-xs text-fg-2">
|
|
37
|
+
tables: {{ Object.keys(schema).join(", ") }} - type a table name to trigger autocomplete
|
|
38
|
+
</div>
|
|
39
|
+
<CodeEditor v-model="withSchema" :schema="schema" placeholder="try typing a table name..." />
|
|
40
|
+
</div>
|
|
41
|
+
<template #controls>
|
|
42
|
+
<div class="text-xs text-fg-2 p-2">{{ withSchema.length }} chars</div>
|
|
43
|
+
</template>
|
|
44
|
+
</Variant>
|
|
45
|
+
|
|
46
|
+
<Variant title="Readonly">
|
|
47
|
+
<CodeEditor v-model="readonly" :readonly="true" />
|
|
48
|
+
</Variant>
|
|
49
|
+
|
|
50
|
+
<Variant title="Multiple Editors">
|
|
51
|
+
<div class="flex flex-col gap-3">
|
|
52
|
+
<div>
|
|
53
|
+
<div class="text-[10px] text-fg-2 uppercase tracking-wide mb-1">source query</div>
|
|
54
|
+
<CodeEditor
|
|
55
|
+
v-model="basic"
|
|
56
|
+
:schema="schema"
|
|
57
|
+
placeholder="SELECT id, name FROM customers WHERE active = true"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
<div>
|
|
61
|
+
<div class="text-[10px] text-fg-2 uppercase tracking-wide mb-1">retrieval query</div>
|
|
62
|
+
<CodeEditor
|
|
63
|
+
v-model="withSchema"
|
|
64
|
+
:schema="schema"
|
|
65
|
+
placeholder="SELECT * FROM orders WHERE customer_id = '{{row.id}}'"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</Variant>
|
|
70
|
+
</Story>
|
|
71
|
+
</template>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue"
|
|
3
|
+
import Collapsible from "../src/components/Collapsible.vue"
|
|
4
|
+
import CollapsibleGroup from "../src/components/CollapsibleGroup.vue"
|
|
5
|
+
|
|
6
|
+
const controlled = ref(true)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<Story title="Collapsible">
|
|
11
|
+
<Variant title="Standalone">
|
|
12
|
+
<div class="max-w-sm">
|
|
13
|
+
<Collapsible title="Details">
|
|
14
|
+
<p class="text-base text-fg-1">
|
|
15
|
+
This content can be expanded or collapsed.
|
|
16
|
+
Useful for progressive disclosure of information.
|
|
17
|
+
</p>
|
|
18
|
+
</Collapsible>
|
|
19
|
+
</div>
|
|
20
|
+
</Variant>
|
|
21
|
+
<Variant title="Controlled">
|
|
22
|
+
<div class="max-w-sm">
|
|
23
|
+
<Collapsible v-model:open="controlled" title="Controlled section">
|
|
24
|
+
<p class="text-base text-fg-1">
|
|
25
|
+
This section is controlled via v-model:open.
|
|
26
|
+
</p>
|
|
27
|
+
</Collapsible>
|
|
28
|
+
</div>
|
|
29
|
+
<template #controls>
|
|
30
|
+
<div class="text-xs text-fg-2 p-2">open: {{ controlled }}</div>
|
|
31
|
+
</template>
|
|
32
|
+
</Variant>
|
|
33
|
+
<Variant title="Accordion (exclusive)">
|
|
34
|
+
<div class="max-w-sm">
|
|
35
|
+
<CollapsibleGroup exclusive>
|
|
36
|
+
<Collapsible title="General">
|
|
37
|
+
<p class="text-base text-fg-1">General settings and preferences for your account.</p>
|
|
38
|
+
</Collapsible>
|
|
39
|
+
<Collapsible title="Appearance">
|
|
40
|
+
<p class="text-base text-fg-1">Theme, font size, and display options.</p>
|
|
41
|
+
</Collapsible>
|
|
42
|
+
<Collapsible title="Keyboard shortcuts">
|
|
43
|
+
<p class="text-base text-fg-1">Customize keybindings and shortcut mappings.</p>
|
|
44
|
+
</Collapsible>
|
|
45
|
+
<Collapsible title="Advanced">
|
|
46
|
+
<p class="text-base text-fg-1">Experimental features and developer options.</p>
|
|
47
|
+
</Collapsible>
|
|
48
|
+
</CollapsibleGroup>
|
|
49
|
+
</div>
|
|
50
|
+
</Variant>
|
|
51
|
+
<Variant title="Non-exclusive group">
|
|
52
|
+
<div class="max-w-sm">
|
|
53
|
+
<CollapsibleGroup>
|
|
54
|
+
<Collapsible title="Section A">
|
|
55
|
+
<p class="text-base text-fg-1">Multiple sections can be open simultaneously.</p>
|
|
56
|
+
</Collapsible>
|
|
57
|
+
<Collapsible title="Section B">
|
|
58
|
+
<p class="text-base text-fg-1">This one too.</p>
|
|
59
|
+
</Collapsible>
|
|
60
|
+
<Collapsible title="Section C">
|
|
61
|
+
<p class="text-base text-fg-1">And this one.</p>
|
|
62
|
+
</Collapsible>
|
|
63
|
+
</CollapsibleGroup>
|
|
64
|
+
</div>
|
|
65
|
+
</Variant>
|
|
66
|
+
<Variant title="Custom trigger">
|
|
67
|
+
<div class="max-w-sm">
|
|
68
|
+
<Collapsible>
|
|
69
|
+
<template #trigger>
|
|
70
|
+
<span class="flex items-center gap-1">
|
|
71
|
+
<span class="text-accent">3 items</span>
|
|
72
|
+
<span class="text-fg-2">in this group</span>
|
|
73
|
+
</span>
|
|
74
|
+
</template>
|
|
75
|
+
<ul class="text-base text-fg-1 flex flex-col gap-1 list-none p-0 m-0">
|
|
76
|
+
<li>Item one</li>
|
|
77
|
+
<li>Item two</li>
|
|
78
|
+
<li>Item three</li>
|
|
79
|
+
</ul>
|
|
80
|
+
</Collapsible>
|
|
81
|
+
</div>
|
|
82
|
+
</Variant>
|
|
83
|
+
</Story>
|
|
84
|
+
</template>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue"
|
|
3
|
+
import Combobox from "../src/components/Combobox.vue"
|
|
4
|
+
|
|
5
|
+
const selected = ref(null)
|
|
6
|
+
const country = ref(null)
|
|
7
|
+
|
|
8
|
+
const fruits = ["Apple", "Banana", "Cherry", "Date", "Elderberry", "Fig", "Grape", "Honeydew", "Kiwi", "Lemon", "Mango", "Nectarine", "Orange", "Papaya", "Quince", "Raspberry", "Strawberry"]
|
|
9
|
+
|
|
10
|
+
const countries = [
|
|
11
|
+
{ value: "us", label: "United States" },
|
|
12
|
+
{ value: "gb", label: "United Kingdom" },
|
|
13
|
+
{ value: "de", label: "Germany" },
|
|
14
|
+
{ value: "fr", label: "France" },
|
|
15
|
+
{ value: "jp", label: "Japan" },
|
|
16
|
+
{ value: "kr", label: "South Korea" },
|
|
17
|
+
{ value: "au", label: "Australia" },
|
|
18
|
+
{ value: "ca", label: "Canada" },
|
|
19
|
+
{ value: "br", label: "Brazil" },
|
|
20
|
+
{ value: "mx", label: "Mexico" },
|
|
21
|
+
{ value: "in", label: "India" },
|
|
22
|
+
{ value: "cn", label: "China" },
|
|
23
|
+
{ value: "it", label: "Italy" },
|
|
24
|
+
{ value: "es", label: "Spain" },
|
|
25
|
+
{ value: "nl", label: "Netherlands" }
|
|
26
|
+
]
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<Story title="Combobox">
|
|
31
|
+
<Variant title="String Options">
|
|
32
|
+
<Combobox v-model="selected" :options="fruits" placeholder="pick a fruit..." />
|
|
33
|
+
<template #controls>
|
|
34
|
+
<div class="text-xs text-fg-2 p-2">selected: {{ selected ?? 'null' }}</div>
|
|
35
|
+
</template>
|
|
36
|
+
</Variant>
|
|
37
|
+
<Variant title="Object Options">
|
|
38
|
+
<Combobox v-model="country" :options="countries" placeholder="select country..." />
|
|
39
|
+
<template #controls>
|
|
40
|
+
<div class="text-xs text-fg-2 p-2">selected: {{ country ?? 'null' }}</div>
|
|
41
|
+
</template>
|
|
42
|
+
</Variant>
|
|
43
|
+
</Story>
|
|
44
|
+
</template>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue"
|
|
3
|
+
import ContextMenu from "../src/components/ContextMenu.vue"
|
|
4
|
+
|
|
5
|
+
const clipboard = ref("")
|
|
6
|
+
|
|
7
|
+
const basicItems = [
|
|
8
|
+
{ label: "Cut", icon: "material-symbols:content-cut", kbd: "Cmd+X", action: () => clipboard.value = "cut" },
|
|
9
|
+
{ label: "Copy", icon: "material-symbols:content-copy", kbd: "Cmd+C", action: () => clipboard.value = "copy" },
|
|
10
|
+
{ label: "Paste", icon: "material-symbols:content-paste", kbd: "Cmd+V", action: () => clipboard.value = "paste" },
|
|
11
|
+
{ type: "separator" },
|
|
12
|
+
{ label: "Delete", icon: "material-symbols:delete-outline", action: () => clipboard.value = "delete" },
|
|
13
|
+
{ label: "Disabled item", icon: "material-symbols:block", disabled: true }
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
const viewMode = ref("grid")
|
|
17
|
+
|
|
18
|
+
const richItems = [
|
|
19
|
+
{ type: "header", label: "View" },
|
|
20
|
+
{ label: "Grid", checked: true, action: () => viewMode.value = "grid" },
|
|
21
|
+
{ label: "List", action: () => viewMode.value = "list" },
|
|
22
|
+
{ type: "separator" },
|
|
23
|
+
{ type: "header", label: "Actions" },
|
|
24
|
+
{ label: "New file", icon: "material-symbols:add", kbd: "Cmd+N" },
|
|
25
|
+
{ label: "Open...", icon: "material-symbols:folder-open-outline", kbd: "Cmd+O" },
|
|
26
|
+
{ type: "separator" },
|
|
27
|
+
{ label: "Share", icon: "material-symbols:share", children: [
|
|
28
|
+
{ label: "Copy link", icon: "material-symbols:link", kbd: "Cmd+L" },
|
|
29
|
+
{ label: "Email", icon: "material-symbols:mail-outline" },
|
|
30
|
+
{ label: "Export", icon: "material-symbols:download", children: [
|
|
31
|
+
{ label: "as PNG" },
|
|
32
|
+
{ label: "as SVG" },
|
|
33
|
+
{ label: "as PDF" }
|
|
34
|
+
]}
|
|
35
|
+
]}
|
|
36
|
+
]
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<Story title="ContextMenu">
|
|
41
|
+
<Variant title="Basic">
|
|
42
|
+
<ContextMenu :items="basicItems">
|
|
43
|
+
<div class="p-8 bg-2 border border-line rounded-sm text-fg-1 text-base cursor-default select-none">
|
|
44
|
+
right-click here
|
|
45
|
+
</div>
|
|
46
|
+
</ContextMenu>
|
|
47
|
+
<template #controls>
|
|
48
|
+
<div class="text-xs text-fg-2 p-2">last action: {{ clipboard || 'none' }}</div>
|
|
49
|
+
</template>
|
|
50
|
+
</Variant>
|
|
51
|
+
<Variant title="Headers, Checked, Submenus">
|
|
52
|
+
<ContextMenu :items="richItems">
|
|
53
|
+
<div class="p-8 bg-2 border border-line rounded-sm text-fg-1 text-base cursor-default select-none">
|
|
54
|
+
right-click for rich menu
|
|
55
|
+
</div>
|
|
56
|
+
</ContextMenu>
|
|
57
|
+
</Variant>
|
|
58
|
+
</Story>
|
|
59
|
+
</template>
|