@brandsync/wc 0.0.7 → 0.0.9
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/custom-elements.json +1810 -355
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/p-0d64ea40.entry.js +1 -0
- package/dist/brandsync-wc/{p-c63d16e1.entry.js → p-1515498e.entry.js} +1 -1
- package/dist/brandsync-wc/p-16a54578.entry.js +1 -0
- package/dist/brandsync-wc/p-18af02df.entry.js +1 -0
- package/dist/brandsync-wc/p-30a0e168.entry.js +1 -0
- package/dist/brandsync-wc/p-3dacae70.entry.js +1 -0
- package/dist/brandsync-wc/p-5333bb5a.entry.js +1 -0
- package/dist/brandsync-wc/p-575ce905.entry.js +1 -0
- package/dist/brandsync-wc/{p-dd0fea0e.entry.js → p-7776b57b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-bfd09c98.entry.js → p-805644e4.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f88d9a6e.entry.js → p-8a78d6ea.entry.js} +1 -1
- package/dist/brandsync-wc/p-8d12ed96.entry.js +1 -0
- package/dist/brandsync-wc/p-94ed898a.entry.js +1 -0
- package/dist/brandsync-wc/{p-9e5d2211.entry.js → p-96f374be.entry.js} +1 -1
- package/dist/brandsync-wc/{p-ab5cc7af.entry.js → p-a34f460d.entry.js} +1 -1
- package/dist/brandsync-wc/p-bc72439a.entry.js +1 -0
- package/dist/brandsync-wc/{p-76eca100.entry.js → p-ce0914a7.entry.js} +1 -1
- package/dist/brandsync-wc/{p-5a0fe72e.entry.js → p-d682675e.entry.js} +1 -1
- package/dist/brandsync-wc/p-dad4a92c.entry.js +1 -0
- package/dist/brandsync-wc/{p-cfc3421b.entry.js → p-dd747a12.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2742ecef.entry.js → p-eb4d87f0.entry.js} +1 -1
- package/dist/cjs/brandsync-wc.cjs.js +1 -1
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +17 -0
- package/dist/cjs/bs-ai-greeting.cjs.entry.js +24 -0
- package/dist/cjs/bs-ai-thinking.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment-list.cjs.entry.js +47 -0
- package/dist/cjs/bs-attachment.cjs.entry.js +46 -0
- package/dist/cjs/bs-badge.cjs.entry.js +1 -1
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bs-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-card.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +94 -0
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +38 -0
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +43 -0
- package/dist/cjs/bs-composer.cjs.entry.js +16 -2
- package/dist/cjs/bs-data-table.cjs.entry.js +2 -2
- package/dist/cjs/bs-input.cjs.entry.js +270 -4
- package/dist/cjs/{bs-menu-item.cjs.entry.js → bs-menu_2.cjs.entry.js} +14 -1
- package/dist/cjs/bs-source-link.cjs.entry.js +39 -0
- package/dist/cjs/bs-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +8 -0
- package/dist/collection/components/bs-ai-chatbot/bs-ai-chatbot.stories.js +180 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.cmp.test.js +14 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.css +27 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +41 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.stories.js +15 -0
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.cmp.test.js +22 -0
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.css +53 -0
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +103 -0
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.stories.js +23 -0
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.css +31 -17
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +9 -11
- package/dist/collection/components/bs-attachment/bs-attachment.cmp.test.js +41 -0
- package/dist/collection/components/bs-attachment/bs-attachment.css +184 -0
- package/dist/collection/components/bs-attachment/bs-attachment.js +230 -0
- package/dist/collection/components/bs-attachment/bs-attachment.stories.js +58 -0
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.cmp.test.js +28 -0
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.css +56 -0
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +105 -0
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.stories.js +47 -0
- package/dist/collection/components/bs-badge/bs-badge.js +1 -1
- package/dist/collection/components/bs-button/bs-button.js +1 -1
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
- package/dist/collection/components/bs-card/bs-card.js +1 -1
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.cmp.test.js +73 -0
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.css +253 -0
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +324 -0
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.stories.js +54 -0
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.cmp.test.js +34 -0
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.css +106 -0
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +142 -0
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.stories.js +44 -0
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
- package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +12 -0
- package/dist/collection/components/bs-composer/bs-composer.css +10 -0
- package/dist/collection/components/bs-composer/bs-composer.js +25 -1
- package/dist/collection/components/bs-composer/bs-composer.stories.js +13 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.js +42 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.css +173 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +270 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.stories.js +75 -0
- package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
- package/dist/collection/components/bs-input/bs-input.cmp.test.js +296 -0
- package/dist/collection/components/bs-input/bs-input.css +333 -23
- package/dist/collection/components/bs-input/bs-input.js +647 -11
- package/dist/collection/components/bs-input/bs-input.stories.js +128 -1
- package/dist/collection/components/bs-menu/bs-menu.js +1 -1
- package/dist/collection/components/bs-menu-item/bs-menu-item.js +1 -1
- package/dist/collection/components/bs-source-link/bs-source-link.cmp.test.js +42 -0
- package/dist/collection/components/bs-source-link/bs-source-link.css +114 -0
- package/dist/collection/components/bs-source-link/bs-source-link.js +192 -0
- package/dist/collection/components/bs-source-link/bs-source-link.stories.js +33 -0
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/components/bs-ai-disclaimer.d.ts +11 -0
- package/dist/components/bs-ai-disclaimer.js +1 -0
- package/dist/components/bs-ai-greeting.d.ts +11 -0
- package/dist/components/bs-ai-greeting.js +1 -0
- package/dist/components/bs-ai-thinking.js +1 -1
- package/dist/components/bs-attachment-list.d.ts +11 -0
- package/dist/components/bs-attachment-list.js +1 -0
- package/dist/components/bs-attachment.d.ts +11 -0
- package/dist/components/bs-attachment.js +1 -0
- package/dist/components/bs-badge.js +1 -1
- package/dist/components/bs-button-skeleton.js +1 -1
- package/dist/components/bs-button.js +1 -1
- package/dist/components/bs-card.js +1 -1
- package/dist/components/bs-chatbot-feedback.d.ts +11 -0
- package/dist/components/bs-chatbot-feedback.js +1 -0
- package/dist/components/bs-chatbot-header.js +1 -1
- package/dist/components/bs-chatbot-response-action.js +1 -1
- package/dist/components/bs-chatbot-sources-drawer.d.ts +11 -0
- package/dist/components/bs-chatbot-sources-drawer.js +1 -0
- package/dist/components/bs-chatbot-suggestion-button.js +1 -1
- package/dist/components/bs-composer-status-banner.d.ts +11 -0
- package/dist/components/bs-composer-status-banner.js +1 -0
- package/dist/components/bs-composer.js +1 -1
- package/dist/components/bs-data-table.js +1 -1
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-source-link.d.ts +11 -0
- package/dist/components/bs-source-link.js +1 -0
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/{p-CoC4LQCI.js → p-Cz2nfz2j.js} +1 -1
- package/dist/components/p-DndQiCMP.js +1 -0
- package/dist/components/p-_vXDfB3V.js +1 -0
- package/dist/esm/brandsync-wc.js +1 -1
- package/dist/esm/bs-ai-disclaimer.entry.js +15 -0
- package/dist/esm/bs-ai-greeting.entry.js +22 -0
- package/dist/esm/bs-ai-thinking.entry.js +2 -2
- package/dist/esm/bs-attachment-list.entry.js +45 -0
- package/dist/esm/bs-attachment.entry.js +44 -0
- package/dist/esm/bs-badge.entry.js +1 -1
- package/dist/esm/bs-button-skeleton.entry.js +1 -1
- package/dist/esm/bs-button.entry.js +1 -1
- package/dist/esm/bs-card.entry.js +1 -1
- package/dist/esm/bs-chatbot-feedback.entry.js +92 -0
- package/dist/esm/bs-chatbot-header.entry.js +1 -1
- package/dist/esm/bs-chatbot-response-action.entry.js +1 -1
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +36 -0
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +1 -1
- package/dist/esm/bs-composer-status-banner.entry.js +41 -0
- package/dist/esm/bs-composer.entry.js +17 -3
- package/dist/esm/bs-data-table.entry.js +2 -2
- package/dist/esm/bs-input.entry.js +271 -5
- package/dist/esm/{bs-menu-item.entry.js → bs-menu_2.entry.js} +15 -3
- package/dist/esm/bs-source-link.entry.js +37 -0
- package/dist/esm/bs-tooltip.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/bs-ai-chatbot/bs-ai-chatbot.stories.d.ts +18 -0
- package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.d.ts +26 -0
- package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.stories.d.ts +8 -0
- package/dist/types/components/bs-ai-greeting/bs-ai-greeting.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-ai-greeting/bs-ai-greeting.d.ts +42 -0
- package/dist/types/components/bs-ai-greeting/bs-ai-greeting.stories.d.ts +10 -0
- package/dist/types/components/bs-ai-thinking/bs-ai-thinking.d.ts +8 -10
- package/dist/types/components/bs-attachment/bs-attachment.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-attachment/bs-attachment.d.ts +59 -0
- package/dist/types/components/bs-attachment/bs-attachment.stories.d.ts +17 -0
- package/dist/types/components/bs-attachment-list/bs-attachment-list.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-attachment-list/bs-attachment-list.d.ts +42 -0
- package/dist/types/components/bs-attachment-list/bs-attachment-list.stories.d.ts +10 -0
- package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.d.ts +90 -0
- package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.stories.d.ts +16 -0
- package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.d.ts +54 -0
- package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.stories.d.ts +10 -0
- package/dist/types/components/bs-composer/bs-composer.d.ts +14 -0
- package/dist/types/components/bs-composer/bs-composer.stories.d.ts +1 -0
- package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.d.ts +88 -0
- package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.stories.d.ts +20 -0
- package/dist/types/components/bs-input/bs-input.d.ts +139 -6
- package/dist/types/components/bs-input/bs-input.stories.d.ts +19 -0
- package/dist/types/components/bs-source-link/bs-source-link.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-source-link/bs-source-link.d.ts +51 -0
- package/dist/types/components/bs-source-link/bs-source-link.stories.d.ts +13 -0
- package/dist/types/components.d.ts +1778 -55
- package/package.json +1 -1
- package/dist/brandsync-wc/p-6abdfaf0.entry.js +0 -1
- package/dist/brandsync-wc/p-6c1fa4da.entry.js +0 -1
- package/dist/brandsync-wc/p-a12d0a60.entry.js +0 -1
- package/dist/brandsync-wc/p-f5f443e2.entry.js +0 -1
- package/dist/cjs/bs-menu.cjs.entry.js +0 -17
- package/dist/esm/bs-menu.entry.js +0 -15
|
@@ -1,30 +1,77 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
2
|
import { componentDescription, propDescription } from "../../stories-utils";
|
|
3
|
+
const inputTypes = [
|
|
4
|
+
'text',
|
|
5
|
+
'email',
|
|
6
|
+
'password',
|
|
7
|
+
'number',
|
|
8
|
+
'search',
|
|
9
|
+
'date',
|
|
10
|
+
'dropdown',
|
|
11
|
+
'select',
|
|
12
|
+
'textarea',
|
|
13
|
+
'chip',
|
|
14
|
+
'initials',
|
|
15
|
+
'country',
|
|
16
|
+
'pin',
|
|
17
|
+
];
|
|
18
|
+
const mailIcon = html `
|
|
19
|
+
<svg slot="icon" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
20
|
+
<path
|
|
21
|
+
d="M2 4L8 9L14 4M2 4H14V12H2V4Z"
|
|
22
|
+
stroke="currentColor"
|
|
23
|
+
stroke-width="1.3"
|
|
24
|
+
stroke-linecap="round"
|
|
25
|
+
stroke-linejoin="round"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
`;
|
|
29
|
+
const chevronIcon = html `
|
|
30
|
+
<svg slot="end-icon" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
31
|
+
<path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" />
|
|
32
|
+
</svg>
|
|
33
|
+
`;
|
|
3
34
|
const meta = {
|
|
4
35
|
title: 'Components/bs-input',
|
|
5
36
|
parameters: { docs: { description: { component: componentDescription('bs-input') } } },
|
|
6
37
|
render: args => html `
|
|
7
38
|
<bs-input
|
|
39
|
+
type=${args.type}
|
|
8
40
|
label=${args.label}
|
|
9
41
|
placeholder=${args.placeholder}
|
|
10
42
|
description=${args.description}
|
|
11
43
|
error=${args.error}
|
|
12
44
|
?disabled=${args.disabled}
|
|
13
|
-
|
|
45
|
+
?required=${args.required}
|
|
46
|
+
>
|
|
47
|
+
${args.icon ? mailIcon : ''} ${args.endIcon ? chevronIcon : ''}
|
|
48
|
+
</bs-input>
|
|
14
49
|
`,
|
|
15
50
|
argTypes: {
|
|
51
|
+
type: { control: 'select', options: inputTypes, description: propDescription('bs-input', 'type') },
|
|
16
52
|
label: { control: 'text', description: propDescription('bs-input', 'label') },
|
|
17
53
|
placeholder: { control: 'text', description: propDescription('bs-input', 'placeholder') },
|
|
18
54
|
description: { control: 'text', description: propDescription('bs-input', 'description') },
|
|
19
55
|
error: { control: 'text', description: propDescription('bs-input', 'error') },
|
|
20
56
|
disabled: { control: 'boolean', description: propDescription('bs-input', 'disabled') },
|
|
57
|
+
required: { control: 'boolean', description: propDescription('bs-input', 'required') },
|
|
58
|
+
icon: { control: 'boolean', description: 'Toggles a leading icon (not a real attribute -- see the `icon` slot).' },
|
|
59
|
+
endIcon: {
|
|
60
|
+
control: 'boolean',
|
|
61
|
+
name: 'end-icon',
|
|
62
|
+
description: 'Toggles a trailing icon (not a real attribute -- see the `end-icon` slot).',
|
|
63
|
+
},
|
|
21
64
|
},
|
|
22
65
|
args: {
|
|
66
|
+
type: 'text',
|
|
23
67
|
label: 'Email address',
|
|
24
68
|
placeholder: 'you@example.com',
|
|
25
69
|
description: '',
|
|
26
70
|
error: '',
|
|
27
71
|
disabled: false,
|
|
72
|
+
required: false,
|
|
73
|
+
icon: false,
|
|
74
|
+
endIcon: false,
|
|
28
75
|
},
|
|
29
76
|
};
|
|
30
77
|
export default meta;
|
|
@@ -38,3 +85,83 @@ export const WithError = {
|
|
|
38
85
|
export const Disabled = {
|
|
39
86
|
args: { disabled: true },
|
|
40
87
|
};
|
|
88
|
+
export const WithIcon = {
|
|
89
|
+
name: 'With icon',
|
|
90
|
+
args: { icon: true },
|
|
91
|
+
};
|
|
92
|
+
export const WithEndIcon = {
|
|
93
|
+
name: 'With end icon',
|
|
94
|
+
args: { endIcon: true },
|
|
95
|
+
};
|
|
96
|
+
export const Required = {
|
|
97
|
+
args: { required: true },
|
|
98
|
+
};
|
|
99
|
+
export const Search = {
|
|
100
|
+
render: () => html `<bs-input type="search" label="Search" placeholder="Search..."></bs-input>`,
|
|
101
|
+
};
|
|
102
|
+
export const NumberInput = {
|
|
103
|
+
name: 'Number',
|
|
104
|
+
render: () => html `<bs-input type="number" label="Quantity" value="1" min="0" max="10" step="1"></bs-input>`,
|
|
105
|
+
};
|
|
106
|
+
export const Password = {
|
|
107
|
+
render: () => html `<bs-input type="password" label="Password" placeholder="Enter your password"></bs-input>`,
|
|
108
|
+
};
|
|
109
|
+
export const DateInput = {
|
|
110
|
+
name: 'Date',
|
|
111
|
+
render: () => html `<bs-input type="date" label="Date of birth"></bs-input>`,
|
|
112
|
+
};
|
|
113
|
+
export const Dropdown = {
|
|
114
|
+
render: () => html `
|
|
115
|
+
<bs-input
|
|
116
|
+
type="dropdown"
|
|
117
|
+
label="Country"
|
|
118
|
+
placeholder="Select a country"
|
|
119
|
+
value="Denmark"
|
|
120
|
+
.options=${[
|
|
121
|
+
{ label: 'Denmark', value: 'dk' },
|
|
122
|
+
{ label: 'Sweden', value: 'se' },
|
|
123
|
+
{ label: 'Norway', value: 'no' },
|
|
124
|
+
]}
|
|
125
|
+
></bs-input>
|
|
126
|
+
`,
|
|
127
|
+
};
|
|
128
|
+
export const Select = {
|
|
129
|
+
render: () => html `
|
|
130
|
+
<bs-input
|
|
131
|
+
type="select"
|
|
132
|
+
label="Role"
|
|
133
|
+
.options=${[
|
|
134
|
+
{ label: 'Admin', value: 'admin' },
|
|
135
|
+
{ label: 'Editor', value: 'editor' },
|
|
136
|
+
{ label: 'Viewer', value: 'viewer' },
|
|
137
|
+
]}
|
|
138
|
+
></bs-input>
|
|
139
|
+
`,
|
|
140
|
+
};
|
|
141
|
+
export const TextArea = {
|
|
142
|
+
name: 'Text area',
|
|
143
|
+
render: () => html `<bs-input type="textarea" label="Comments" rows="4" placeholder="Type your comments here..."></bs-input>`,
|
|
144
|
+
};
|
|
145
|
+
export const Chip = {
|
|
146
|
+
render: () => html `<bs-input type="chip" label="Tags" .chips=${['design', 'frontend']} placeholder="Add a tag..."></bs-input>`,
|
|
147
|
+
};
|
|
148
|
+
export const Initials = {
|
|
149
|
+
render: () => html `<bs-input type="initials" label="Name" .titleOptions=${['Mrs.', 'Mr.', 'Dr.']} placeholder="Full name"></bs-input>`,
|
|
150
|
+
};
|
|
151
|
+
export const Country = {
|
|
152
|
+
render: () => html `
|
|
153
|
+
<bs-input
|
|
154
|
+
type="country"
|
|
155
|
+
label="Phone number"
|
|
156
|
+
.countryOptions=${[
|
|
157
|
+
{ code: 'DK', label: 'Denmark' },
|
|
158
|
+
{ code: 'US', label: 'United States' },
|
|
159
|
+
{ code: 'GB', label: 'United Kingdom' },
|
|
160
|
+
]}
|
|
161
|
+
placeholder="Phone number"
|
|
162
|
+
></bs-input>
|
|
163
|
+
`,
|
|
164
|
+
};
|
|
165
|
+
export const Pin = {
|
|
166
|
+
render: () => html `<bs-input type="pin" label="Verification code" length="4"></bs-input>`,
|
|
167
|
+
};
|
|
@@ -22,7 +22,7 @@ import { h } from "@stencil/core";
|
|
|
22
22
|
*/
|
|
23
23
|
export class BsMenu {
|
|
24
24
|
render() {
|
|
25
|
-
return (h("div", { key: '
|
|
25
|
+
return (h("div", { key: 'e49c52a18ea8c10399d818a00e0c6b748f0c9b8f', part: "list", class: "bs-menu", role: "menu" }, h("slot", { key: '7e8cef2af1a068d0ab31fc3aee0abf8b59645a08' })));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "bs-menu"; }
|
|
28
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -39,7 +39,7 @@ export class BsMenuItem {
|
|
|
39
39
|
this.bsSelect.emit();
|
|
40
40
|
};
|
|
41
41
|
render() {
|
|
42
|
-
return (h("button", { key: '
|
|
42
|
+
return (h("button", { key: 'dee92b0e122d1a1d100e950ac5b3a368a94d075b', type: "button", part: "item", role: "menuitem", class: "bs-menu-item", onClick: this.onClick }, h("span", { key: 'e4ce02b4df1ec40bf0f3f72bd1611816e8851909', part: "icon", class: `bs-menu-item__icon ${this.hasIcon ? 'bs-menu-item__icon--has-content' : ''}` }, h("slot", { key: '9e19fea7d90078577047b5aea0170c09d27fb340', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '179ce497185c4f9f5bbd238bd0c781a189743ad1', part: "label", class: "bs-menu-item__label" }, h("slot", { key: 'dfe5de71a770cc9ff9847d8f687bba01ae9e1b1e' }))));
|
|
43
43
|
}
|
|
44
44
|
static get is() { return "bs-menu-item"; }
|
|
45
45
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
|
+
describe('bs-source-link', () => {
|
|
3
|
+
it('renders the file icon nested alongside the filename, not as a top-level sibling', async () => {
|
|
4
|
+
const { root } = await render(h("bs-source-link", { "file-name": "report.pdf" }));
|
|
5
|
+
const filenameRow = root.shadowRoot.querySelector('.bs-source-link__filename-row');
|
|
6
|
+
expect(filenameRow.querySelector('[part="icon"]')).not.toBeNull();
|
|
7
|
+
expect(filenameRow).toHaveTextContent('report.pdf');
|
|
8
|
+
});
|
|
9
|
+
it('renders as a native button when href is not set, and emits bsOpen on click', async () => {
|
|
10
|
+
const { root, spyOnEvent } = await render(h("bs-source-link", { "file-name": "report.pdf" }));
|
|
11
|
+
const spy = spyOnEvent('bsOpen');
|
|
12
|
+
const el = root.shadowRoot.querySelector('.bs-source-link');
|
|
13
|
+
expect(el.tagName).toBe('BUTTON');
|
|
14
|
+
el.click();
|
|
15
|
+
expect(spy).toHaveReceivedEventTimes(1);
|
|
16
|
+
});
|
|
17
|
+
it('renders as a link when href is set, with target="_blank" by default', async () => {
|
|
18
|
+
const { root } = await render(h("bs-source-link", { "file-name": "report.pdf", href: "https://example.com/report.pdf" }));
|
|
19
|
+
const el = root.shadowRoot.querySelector('.bs-source-link');
|
|
20
|
+
expect(el.tagName).toBe('A');
|
|
21
|
+
expect(el).toEqualAttribute('href', 'https://example.com/report.pdf');
|
|
22
|
+
expect(el).toEqualAttribute('target', '_blank');
|
|
23
|
+
expect(el).toEqualAttribute('rel', 'noopener noreferrer');
|
|
24
|
+
});
|
|
25
|
+
it('renders source name and version separated by a dot when both are set', async () => {
|
|
26
|
+
const { root } = await render(h("bs-source-link", { "source-name": "HoltePortalen", version: "v3.2" }));
|
|
27
|
+
expect(root.shadowRoot.querySelector('[part="source"]')).toHaveTextContent('HoltePortalen');
|
|
28
|
+
expect(root.shadowRoot.querySelector('[part="version"]')).toHaveTextContent('v3.2');
|
|
29
|
+
expect(root.shadowRoot.querySelector('.bs-source-link__dot')).not.toBeNull();
|
|
30
|
+
});
|
|
31
|
+
it('does not render the meta row content or dot when sourceName and version are unset', async () => {
|
|
32
|
+
const { root } = await render(h("bs-source-link", null));
|
|
33
|
+
expect(root.shadowRoot.querySelector('[part="source"]')).toBeNull();
|
|
34
|
+
expect(root.shadowRoot.querySelector('[part="version"]')).toBeNull();
|
|
35
|
+
expect(root.shadowRoot.querySelector('.bs-source-link__dot')).toBeNull();
|
|
36
|
+
});
|
|
37
|
+
it('renders slotted content in the icon slot instead of the default file icon', async () => {
|
|
38
|
+
const { root } = await render(h("bs-source-link", null, h("svg", { slot: "icon", "data-testid": "custom-icon" })));
|
|
39
|
+
const slot = root.shadowRoot.querySelector('slot[name="icon"]');
|
|
40
|
+
expect(slot.assignedElements()).toHaveLength(1);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
--bs-source-link-radius: var(--bs-border-radius-150);
|
|
4
|
+
--bs-source-link-padding: var(--bs-spacing-150);
|
|
5
|
+
--bs-source-link-gap: var(--bs-spacing-50);
|
|
6
|
+
--bs-source-link-icon-gap: var(--bs-spacing-75);
|
|
7
|
+
--bs-source-link-hover: var(--bs-surface-hover);
|
|
8
|
+
--bs-source-link-pressed: var(--bs-surface-pressed);
|
|
9
|
+
--bs-source-link-focus: var(--bs-border-neutral-focus);
|
|
10
|
+
--bs-source-link-filename-color: var(--bs-text-default);
|
|
11
|
+
--bs-source-link-meta-color: var(--bs-text-secondary);
|
|
12
|
+
--bs-source-link-icon-color: var(--bs-icon-default);
|
|
13
|
+
--bs-source-link-dot-color: var(--bs-text-secondary);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.bs-source-link {
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--bs-source-link-gap);
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding: var(--bs-source-link-padding);
|
|
23
|
+
background: none;
|
|
24
|
+
border: none;
|
|
25
|
+
border-radius: var(--bs-source-link-radius);
|
|
26
|
+
font-family: inherit;
|
|
27
|
+
text-align: left;
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
transition: background-color var(--bs-duration-fast) var(--bs-easing-standard);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.bs-source-link:hover,
|
|
34
|
+
.bs-source-link:focus-visible {
|
|
35
|
+
background: var(--bs-source-link-hover);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.bs-source-link:active {
|
|
39
|
+
background: var(--bs-source-link-pressed);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.bs-source-link:focus-visible {
|
|
43
|
+
outline: 2px solid var(--bs-source-link-focus);
|
|
44
|
+
outline-offset: 1px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.bs-source-link__icon {
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
width: 16px;
|
|
53
|
+
height: 16px;
|
|
54
|
+
color: var(--bs-source-link-icon-color);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.bs-source-link__left {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex: 1 0 0;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
gap: 2px;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.bs-source-link__filename-row {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: var(--bs-source-link-icon-gap);
|
|
69
|
+
width: 100%;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.bs-source-link__filename {
|
|
73
|
+
margin: 0;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
color: var(--bs-source-link-filename-color);
|
|
76
|
+
font-size: var(--bs-font-size-md);
|
|
77
|
+
font-weight: var(--bs-font-weight-semibold);
|
|
78
|
+
line-height: var(--bs-line-height-normal);
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.bs-source-link__meta {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: var(--bs-spacing-50);
|
|
87
|
+
padding-left: 22px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.bs-source-link__source,
|
|
91
|
+
.bs-source-link__version {
|
|
92
|
+
color: var(--bs-source-link-meta-color);
|
|
93
|
+
font-size: var(--bs-font-size-sm);
|
|
94
|
+
line-height: var(--bs-line-height-normal);
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.bs-source-link__dot {
|
|
99
|
+
width: 4px;
|
|
100
|
+
height: 4px;
|
|
101
|
+
border-radius: 50%;
|
|
102
|
+
background: var(--bs-source-link-dot-color);
|
|
103
|
+
flex-shrink: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.bs-source-link__arrow {
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
flex-shrink: 0;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
width: 24px;
|
|
112
|
+
height: 24px;
|
|
113
|
+
color: var(--bs-source-link-icon-color);
|
|
114
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A single citation row inside `bs-chatbot-sources-drawer` -- a file icon + filename on the first
|
|
4
|
+
* line, the originating system and version on the second, and a trailing "open" arrow.
|
|
5
|
+
*
|
|
6
|
+
* ## When to use
|
|
7
|
+
* - One row per source Genie cited in a response, slotted into `bs-chatbot-sources-drawer`.
|
|
8
|
+
*
|
|
9
|
+
* ## When not to use
|
|
10
|
+
* - Outside the sources drawer context -- this is a purpose-built citation row, not a generic
|
|
11
|
+
* link/list-item component.
|
|
12
|
+
*
|
|
13
|
+
* @slot icon - Overrides the default file icon.
|
|
14
|
+
* @part icon - The leading file-type icon.
|
|
15
|
+
* @part filename - The filename text.
|
|
16
|
+
* @part source - The source system name.
|
|
17
|
+
* @part version - The version label.
|
|
18
|
+
* @part arrow - The trailing "open" arrow icon.
|
|
19
|
+
* @prop --bs-source-link-radius - Corner radius of the row. Aliased to `--bs-border-radius-150`.
|
|
20
|
+
* @prop --bs-source-link-padding - Padding around the row. Aliased to `--bs-spacing-150`.
|
|
21
|
+
* @prop --bs-source-link-gap - Gap between the filename+meta block and the trailing arrow.
|
|
22
|
+
* Aliased to `--bs-spacing-50`.
|
|
23
|
+
* @prop --bs-source-link-icon-gap - Gap between the leading icon and the filename text. Aliased
|
|
24
|
+
* to `--bs-spacing-75`.
|
|
25
|
+
* @prop --bs-source-link-hover - Row background on hover/focus. Aliased to `--bs-surface-hover`.
|
|
26
|
+
* @prop --bs-source-link-pressed - Row background while active/pressed. Aliased to
|
|
27
|
+
* `--bs-surface-pressed`.
|
|
28
|
+
* @prop --bs-source-link-focus - Focus-visible outline color. Aliased to
|
|
29
|
+
* `--bs-border-neutral-focus`.
|
|
30
|
+
* @prop --bs-source-link-filename-color - Filename text color. Aliased to `--bs-text-default`.
|
|
31
|
+
* @prop --bs-source-link-meta-color - Source/version text color. Aliased to `--bs-text-secondary`.
|
|
32
|
+
* @prop --bs-source-link-icon-color - File icon and arrow color. Aliased to `--bs-icon-default`.
|
|
33
|
+
* @prop --bs-source-link-dot-color - Separator dot between source and version. Aliased to
|
|
34
|
+
* `--bs-text-secondary`.
|
|
35
|
+
*/
|
|
36
|
+
export class BsSourceLink {
|
|
37
|
+
/** The cited document's filename. */
|
|
38
|
+
fileName = 'Source';
|
|
39
|
+
/** The system/app the document came from (e.g. "HoltePortalen"). */
|
|
40
|
+
sourceName;
|
|
41
|
+
/** The document's version label (e.g. "v3.2"). Omit if the source has no version. */
|
|
42
|
+
version;
|
|
43
|
+
/** If set, renders the row as a link that opens this URL; otherwise as a button that only emits `bsOpen`. */
|
|
44
|
+
href;
|
|
45
|
+
/** `target` used when `href` is set. */
|
|
46
|
+
target = '_blank';
|
|
47
|
+
/** Fires on click/activation, whether or not `href` is set -- lets the consuming app log or handle the open. */
|
|
48
|
+
bsOpen;
|
|
49
|
+
onClick = () => {
|
|
50
|
+
this.bsOpen.emit();
|
|
51
|
+
};
|
|
52
|
+
render() {
|
|
53
|
+
const inner = [
|
|
54
|
+
h("span", { key: '0e55cdcd04b7d6574835c1b5b21c20ad804fc36c', class: "bs-source-link__left" }, h("span", { key: '989f52e1b6b0a353470d65f5e3d75e40486b3842', class: "bs-source-link__filename-row" }, h("span", { key: 'e21ccdb9b78d4db3b18ca07039d61632b4390d80', part: "icon", class: "bs-source-link__icon" }, h("slot", { key: 'fe35c5c3084af9ddba25db3c46c2d8bbe7e927d0', name: "icon" }, h(FileTextIcon, { key: '5612acc39809cca4d483ab22f2e0b1cb95cdb2e8' }))), h("p", { key: '39d92f5e7e7a50e943ff9a85efd314df5a2abf0b', part: "filename", class: "bs-source-link__filename" }, this.fileName)), h("span", { key: 'd2eace60d67a344cd2bf522af38950fd3275bea2', class: "bs-source-link__meta" }, this.sourceName && (h("span", { key: 'd8d3fa79fa888db77ef44f402fd8747eb2cecad1', part: "source", class: "bs-source-link__source" }, this.sourceName)), this.sourceName && this.version && h("span", { key: '738770f5c4b091e59832100a17bda2f2d251ed75', class: "bs-source-link__dot", "aria-hidden": "true" }), this.version && (h("span", { key: '56fcf72b43eebb138745d212e8bcaa680f808cd0', part: "version", class: "bs-source-link__version" }, this.version)))),
|
|
55
|
+
h("span", { key: 'da453b51265f923c19505645cb33832c93863179', part: "arrow", class: "bs-source-link__arrow", "aria-hidden": "true" }, h(ArrowUpRightIcon, { key: 'c23d308322df780d109691f87945bb511461304f' })),
|
|
56
|
+
];
|
|
57
|
+
return this.href ? (h("a", { class: "bs-source-link", href: this.href, target: this.target, rel: "noopener noreferrer", onClick: this.onClick }, inner)) : (h("button", { type: "button", class: "bs-source-link", onClick: this.onClick }, inner));
|
|
58
|
+
}
|
|
59
|
+
static get is() { return "bs-source-link"; }
|
|
60
|
+
static get encapsulation() { return "shadow"; }
|
|
61
|
+
static get originalStyleUrls() {
|
|
62
|
+
return {
|
|
63
|
+
"$": ["bs-source-link.css"]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
static get styleUrls() {
|
|
67
|
+
return {
|
|
68
|
+
"$": ["bs-source-link.css"]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static get properties() {
|
|
72
|
+
return {
|
|
73
|
+
"fileName": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"mutable": false,
|
|
76
|
+
"complexType": {
|
|
77
|
+
"original": "string",
|
|
78
|
+
"resolved": "string",
|
|
79
|
+
"references": {}
|
|
80
|
+
},
|
|
81
|
+
"required": false,
|
|
82
|
+
"optional": false,
|
|
83
|
+
"docs": {
|
|
84
|
+
"tags": [],
|
|
85
|
+
"text": "The cited document's filename."
|
|
86
|
+
},
|
|
87
|
+
"getter": false,
|
|
88
|
+
"setter": false,
|
|
89
|
+
"reflect": false,
|
|
90
|
+
"attribute": "file-name",
|
|
91
|
+
"defaultValue": "'Source'"
|
|
92
|
+
},
|
|
93
|
+
"sourceName": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"mutable": false,
|
|
96
|
+
"complexType": {
|
|
97
|
+
"original": "string",
|
|
98
|
+
"resolved": "string",
|
|
99
|
+
"references": {}
|
|
100
|
+
},
|
|
101
|
+
"required": false,
|
|
102
|
+
"optional": true,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": "The system/app the document came from (e.g. \"HoltePortalen\")."
|
|
106
|
+
},
|
|
107
|
+
"getter": false,
|
|
108
|
+
"setter": false,
|
|
109
|
+
"reflect": false,
|
|
110
|
+
"attribute": "source-name"
|
|
111
|
+
},
|
|
112
|
+
"version": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "string",
|
|
117
|
+
"resolved": "string",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": true,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "The document's version label (e.g. \"v3.2\"). Omit if the source has no version."
|
|
125
|
+
},
|
|
126
|
+
"getter": false,
|
|
127
|
+
"setter": false,
|
|
128
|
+
"reflect": false,
|
|
129
|
+
"attribute": "version"
|
|
130
|
+
},
|
|
131
|
+
"href": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "string",
|
|
136
|
+
"resolved": "string",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": true,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "If set, renders the row as a link that opens this URL; otherwise as a button that only emits `bsOpen`."
|
|
144
|
+
},
|
|
145
|
+
"getter": false,
|
|
146
|
+
"setter": false,
|
|
147
|
+
"reflect": false,
|
|
148
|
+
"attribute": "href"
|
|
149
|
+
},
|
|
150
|
+
"target": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"mutable": false,
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "string",
|
|
155
|
+
"resolved": "string",
|
|
156
|
+
"references": {}
|
|
157
|
+
},
|
|
158
|
+
"required": false,
|
|
159
|
+
"optional": false,
|
|
160
|
+
"docs": {
|
|
161
|
+
"tags": [],
|
|
162
|
+
"text": "`target` used when `href` is set."
|
|
163
|
+
},
|
|
164
|
+
"getter": false,
|
|
165
|
+
"setter": false,
|
|
166
|
+
"reflect": false,
|
|
167
|
+
"attribute": "target",
|
|
168
|
+
"defaultValue": "'_blank'"
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
static get events() {
|
|
173
|
+
return [{
|
|
174
|
+
"method": "bsOpen",
|
|
175
|
+
"name": "bsOpen",
|
|
176
|
+
"bubbles": true,
|
|
177
|
+
"cancelable": true,
|
|
178
|
+
"composed": true,
|
|
179
|
+
"docs": {
|
|
180
|
+
"tags": [],
|
|
181
|
+
"text": "Fires on click/activation, whether or not `href` is set -- lets the consuming app log or handle the open."
|
|
182
|
+
},
|
|
183
|
+
"complexType": {
|
|
184
|
+
"original": "void",
|
|
185
|
+
"resolved": "void",
|
|
186
|
+
"references": {}
|
|
187
|
+
}
|
|
188
|
+
}];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const FileTextIcon = () => (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M9.5 1.5H4C3.73478 1.5 3.48043 1.60536 3.29289 1.79289C3.10536 1.98043 3 2.23478 3 2.5V13.5C3 13.7652 3.10536 14.0196 3.29289 14.2071C3.48043 14.3946 3.73478 14.5 4 14.5H12C12.2652 14.5 12.5196 14.3946 12.7071 14.2071C12.8946 14.0196 13 13.7652 13 13.5V5L9.5 1.5Z", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M9.5 1.5V5H13", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M5.5 8.5H10.5", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M5.5 11H10.5", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
192
|
+
const ArrowUpRightIcon = () => (h("svg", { width: "24", height: "24", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M6.25 13.75L13.75 6.25", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M7.5 6.25H13.75V12.5", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { componentDescription, propDescription } from "../../stories-utils";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Genie AI Components/bs-source-link',
|
|
5
|
+
parameters: { docs: { description: { component: componentDescription('bs-source-link') } } },
|
|
6
|
+
render: args => html `
|
|
7
|
+
<bs-source-link file-name=${args.fileName} source-name=${args.sourceName} version=${args.version} href=${args.href}></bs-source-link>
|
|
8
|
+
`,
|
|
9
|
+
argTypes: {
|
|
10
|
+
fileName: { control: 'text', description: propDescription('bs-source-link', 'fileName') },
|
|
11
|
+
sourceName: { control: 'text', description: propDescription('bs-source-link', 'sourceName') },
|
|
12
|
+
version: { control: 'text', description: propDescription('bs-source-link', 'version') },
|
|
13
|
+
href: { control: 'text', description: propDescription('bs-source-link', 'href') },
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
fileName: 'Employee Handbook 2026',
|
|
17
|
+
sourceName: 'HoltePortalen',
|
|
18
|
+
version: 'v3.2',
|
|
19
|
+
// No href by default -- renders as a button (bsOpen only) instead of a real link, so clicking
|
|
20
|
+
// it in Storybook doesn't navigate away. Set one via the control to see the <a> rendering.
|
|
21
|
+
href: '',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export default meta;
|
|
25
|
+
export const Default = {};
|
|
26
|
+
export const WithoutVersion = {
|
|
27
|
+
name: 'Without version',
|
|
28
|
+
args: { version: '' },
|
|
29
|
+
};
|
|
30
|
+
export const WithoutSourceOrVersion = {
|
|
31
|
+
name: 'Without source or version',
|
|
32
|
+
args: { sourceName: '', version: '' },
|
|
33
|
+
};
|
|
@@ -42,7 +42,7 @@ export class BsTooltip {
|
|
|
42
42
|
*/
|
|
43
43
|
placement = 'top';
|
|
44
44
|
render() {
|
|
45
|
-
return (h("div", { key: '
|
|
45
|
+
return (h("div", { key: '7020be9b961d1370449ce37570ae0c9162bd6176', class: "bs-tooltip" }, h("span", { key: 'e21d62d8f701917c7a074c105a7509c9f4582f64', part: "arrow", class: "bs-tooltip__arrow" }), h("div", { key: 'f011584e85c9d10371f961e49d44b67a3983bd2e', part: "bubble", class: "bs-tooltip__bubble" }, h("slot", { key: 'f27da1c55a31d3e1a7ee330440ee9b4a3c577e9a' }))));
|
|
46
46
|
}
|
|
47
47
|
static get is() { return "bs-tooltip"; }
|
|
48
48
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface BsAiDisclaimer extends Components.BsAiDisclaimer, HTMLElement {}
|
|
4
|
+
export const BsAiDisclaimer: {
|
|
5
|
+
prototype: BsAiDisclaimer;
|
|
6
|
+
new (): BsAiDisclaimer;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as i,p as e,H as s,h as a}from"./p-BpvhHQSw.js";const t=e(class extends s{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow()}render(){return a("div",{key:"c306fa7e8f7f9dca07642e1038708847847e2d7e",class:"bs-ai-disclaimer"},a("p",{key:"7f42e2094e7baf287c886ce966a3813657a99a61",part:"text",class:"bs-ai-disclaimer__text"},a("slot",{key:"c5a66f6093b413274c20de59e7f82d4f7372b56c"})))}static get style(){return":host{display:block;--bs-ai-disclaimer-padding-x:var(--bs-spacing-200);--bs-ai-disclaimer-text-color:var(--bs-text-secondary);--bs-ai-disclaimer-font-size:var(--bs-font-size-sm);--bs-ai-disclaimer-line-height:var(--bs-line-height-body-sm)}.bs-ai-disclaimer{box-sizing:border-box;display:flex;align-items:center;justify-content:center;padding:0 var(--bs-ai-disclaimer-padding-x);font-family:inherit}.bs-ai-disclaimer__text{margin:0;flex:1 0 0;min-width:0;color:var(--bs-ai-disclaimer-text-color);font-size:var(--bs-ai-disclaimer-font-size);line-height:calc(var(--bs-ai-disclaimer-line-height) * 1px);text-align:center;word-break:break-word}"}},[257,"bs-ai-disclaimer"]);function r(){"undefined"!=typeof customElements&&["bs-ai-disclaimer"].forEach((e=>{"bs-ai-disclaimer"===e&&(customElements.get(i(e))||customElements.define(i(e),t))}))}r();const c=t,l=r;export{c as BsAiDisclaimer,l as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface BsAiGreeting extends Components.BsAiGreeting, HTMLElement {}
|
|
4
|
+
export const BsAiGreeting: {
|
|
5
|
+
prototype: BsAiGreeting;
|
|
6
|
+
new (): BsAiGreeting;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as i,H as t,h as a}from"./p-BpvhHQSw.js";const n=i(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}assistantName="Genie";productName;render(){const e=this.productName?`How can I help you with ${this.productName} today?`:"How can I help you today?";return a("div",{key:"7931e7404b70476a5488e31f07981c97617c1e5b",class:"bs-ai-greeting"},a("div",{key:"1ba75538642eebb9fe7c24eae2aae9a4eed176cf",part:"heading",class:"bs-ai-greeting__heading"},a("p",{key:"6cf5d97d81249298d02d3983a039e664a75fbb40",class:"bs-ai-greeting__heading-line"},"Hi. I'm ",this.assistantName,","),a("p",{key:"f7a1b0235b5b32b1319bc7748e0073fae0defef0",class:"bs-ai-greeting__heading-line"},"your AI assistant.")),a("p",{key:"5f07b44ca8d000c39204374f99c6608ecbfc22d3",part:"subtext",class:"bs-ai-greeting__subtext"},e))}static get style(){return":host{display:block;--bs-ai-greeting-gap:var(--bs-spacing-200);--bs-ai-greeting-max-width:490px;--bs-ai-greeting-heading-color:var(--bs-text-default);--bs-ai-greeting-heading-font-size:var(--bs-font-size-4xl);--bs-ai-greeting-heading-line-height:var(--bs-line-height-body-lg);--bs-ai-greeting-heading-weight:var(--bs-font-weight-bold);--bs-ai-greeting-heading-gap:var(--bs-spacing-200);--bs-ai-greeting-subtext-color:var(--bs-text-secondary);--bs-ai-greeting-subtext-font-size:var(--bs-font-size-xl);--bs-ai-greeting-subtext-line-height:var(--bs-line-height-body-lg)}.bs-ai-greeting{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--bs-ai-greeting-gap);max-width:var(--bs-ai-greeting-max-width);margin:0 auto;text-align:center;font-family:inherit}.bs-ai-greeting__heading{display:flex;flex-direction:column;gap:var(--bs-ai-greeting-heading-gap);color:var(--bs-ai-greeting-heading-color);font-size:var(--bs-ai-greeting-heading-font-size);font-weight:var(--bs-ai-greeting-heading-weight);line-height:calc(var(--bs-ai-greeting-heading-line-height) * 1px)}.bs-ai-greeting__heading-line{margin:0}.bs-ai-greeting__subtext{margin:0;color:var(--bs-ai-greeting-subtext-color);font-size:var(--bs-ai-greeting-subtext-font-size);font-weight:var(--bs-font-weight-regular);line-height:calc(var(--bs-ai-greeting-subtext-line-height) * 1px)}"}},[513,"bs-ai-greeting",{assistantName:[1,"assistant-name"],productName:[1,"product-name"]}]);function s(){"undefined"!=typeof customElements&&["bs-ai-greeting"].forEach((i=>{"bs-ai-greeting"===i&&(customElements.get(e(i))||customElements.define(e(i),n))}))}s();const g=n,r=s;export{g as BsAiGreeting,r as defineCustomElement}
|