@scania/tegel 0.0.1-beta.3 → 0.0.1-beta.5
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/dist/cjs/index-e1c79686.js +1912 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/popper-11d5f714.js +1801 -0
- package/dist/cjs/sdds-accordion-item.cjs.entry.js +34 -0
- package/dist/cjs/sdds-accordion.cjs.entry.js +21 -0
- package/dist/cjs/sdds-badges.cjs.entry.js +55 -0
- package/dist/cjs/sdds-body-cell_2.cjs.entry.js +173 -0
- package/dist/cjs/sdds-button.cjs.entry.js +36 -0
- package/dist/cjs/sdds-datetime.cjs.entry.js +66 -0
- package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +92 -0
- package/dist/cjs/sdds-dropdown_2.cjs.entry.js +335 -0
- package/dist/cjs/sdds-header-cell.cjs.entry.js +141 -0
- package/dist/cjs/sdds-icon.cjs.entry.js +42 -0
- package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +96 -0
- package/dist/cjs/sdds-inline-tabs.cjs.entry.js +211 -0
- package/dist/cjs/sdds-modal.cjs.entry.js +49 -0
- package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +95 -0
- package/dist/cjs/sdds-popover-canvas.cjs.entry.js +76 -0
- package/dist/cjs/sdds-popover-menu.cjs.entry.js +75 -0
- package/dist/cjs/sdds-slider.cjs.entry.js +336 -0
- package/dist/cjs/sdds-spinner.cjs.entry.js +21 -0
- package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +81 -0
- package/dist/cjs/sdds-table-body.cjs.entry.js +289 -0
- package/dist/cjs/sdds-table-footer.cjs.entry.js +165 -0
- package/dist/cjs/sdds-table-header.cjs.entry.js +100 -0
- package/dist/cjs/sdds-table-toolbar.cjs.entry.js +66 -0
- package/dist/cjs/sdds-table.cjs.entry.js +69 -0
- package/dist/cjs/sdds-textarea.cjs.entry.js +61 -0
- package/dist/cjs/sdds-textfield.cjs.entry.js +82 -0
- package/dist/cjs/sdds-tooltip.cjs.entry.js +95 -0
- package/dist/cjs/tegel.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +40 -0
- package/dist/collection/components/accordion/accordion-item/accordion-item.css +134 -0
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +146 -0
- package/dist/collection/components/accordion/accordion.css +77 -0
- package/dist/collection/components/accordion/accordion.js +62 -0
- package/dist/collection/components/accordion/accordion.stories.js +91 -0
- package/dist/collection/components/badge/badge.stories.js +101 -0
- package/dist/collection/components/badge/badges.css +42 -0
- package/dist/collection/components/badge/badges.js +150 -0
- package/dist/collection/components/banner/banner.stories.js +93 -0
- package/dist/collection/components/block/block.stories.js +46 -0
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +26 -0
- package/dist/collection/components/button/button-component.js +154 -0
- package/dist/collection/components/button/button-native.stories.js +183 -0
- package/dist/collection/components/button/button-webcomponent.stories.js +182 -0
- package/dist/collection/components/button/button.css +658 -0
- package/dist/collection/components/card/card.stories.js +181 -0
- package/dist/collection/components/checkbox/checkbox.stories.js +54 -0
- package/dist/collection/components/chips/chips.stories.js +124 -0
- package/dist/collection/components/data-table/native-table.stories.js +182 -0
- package/dist/collection/components/data-table/table/table.css +15 -0
- package/dist/collection/components/data-table/table/table.js +253 -0
- package/dist/collection/components/data-table/table-body/table-body.css +22 -0
- package/dist/collection/components/data-table/table-body/table-body.js +425 -0
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +40 -0
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +169 -0
- package/dist/collection/components/data-table/table-body-row/table-body-row.css +196 -0
- package/dist/collection/components/data-table/table-body-row/table-body-row.js +164 -0
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +79 -0
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +155 -0
- package/dist/collection/components/data-table/table-component-basic.stories.js +163 -0
- package/dist/collection/components/data-table/table-component-batch-actions.stories.js +129 -0
- package/dist/collection/components/data-table/table-component-bodydata.stories.js +58 -0
- package/dist/collection/components/data-table/table-component-custom-width.stories.js +198 -0
- package/dist/collection/components/data-table/table-component-event-listeners.stories.js +153 -0
- package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +137 -0
- package/dist/collection/components/data-table/table-component-filtering.stories.js +139 -0
- package/dist/collection/components/data-table/table-component-multiselect.stories.js +160 -0
- package/dist/collection/components/data-table/table-component-pagination.stories.js +129 -0
- package/dist/collection/components/data-table/table-component-sorting.stories.js +107 -0
- package/dist/collection/components/data-table/table-footer/table-footer.css +93 -0
- package/dist/collection/components/data-table/table-footer/table-footer.js +355 -0
- package/dist/collection/components/data-table/table-header/table-header.css +204 -0
- package/dist/collection/components/data-table/table-header/table-header.js +153 -0
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +126 -0
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +320 -0
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +92 -0
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +142 -0
- package/dist/collection/components/datetime/datetime.css +375 -0
- package/dist/collection/components/datetime/datetime.js +251 -0
- package/dist/collection/components/datetime/datetime.stories.js +149 -0
- package/dist/collection/components/divider/divider.stories.js +116 -0
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +339 -0
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +130 -0
- package/dist/collection/components/dropdown/dropdown-native.stories.js +90 -0
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +185 -0
- package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +151 -0
- package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +146 -0
- package/dist/collection/components/dropdown/dropdown.css +891 -0
- package/dist/collection/components/dropdown/dropdown.js +554 -0
- package/dist/collection/components/footer/footer.stories.js +100 -0
- package/dist/collection/components/header/header-all.stories.js +217 -0
- package/dist/collection/components/header/header-default.stories.js +47 -0
- package/dist/collection/components/header/header-inline.stories.js +113 -0
- package/dist/collection/components/header/header-search.stories.js +263 -0
- package/dist/collection/components/header/header-toolbar.stories.js +204 -0
- package/dist/collection/components/icon/icon-font.stories.js +57 -0
- package/dist/collection/components/icon/icon-web-component.stories.js +51 -0
- package/dist/collection/components/icon/icon.css +16 -0
- package/dist/collection/components/icon/icon.js +89 -0
- package/dist/collection/components/icon/iconsArray.js +2 -0
- package/dist/collection/components/link/link.stories.js +45 -0
- package/dist/collection/components/message/message.stories.js +117 -0
- package/dist/collection/components/modal/modal-native.stories.js +121 -0
- package/dist/collection/components/modal/modal-webcomponent.stories.js +78 -0
- package/dist/collection/components/modal/modal.css +324 -0
- package/dist/collection/components/modal/modal.js +146 -0
- package/dist/collection/components/popover-canvas/popover-canvas.css +20 -0
- package/dist/collection/components/popover-canvas/popover-canvas.js +190 -0
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +87 -0
- package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +132 -0
- package/dist/collection/components/popover-menu/popover-menu.css +19 -0
- package/dist/collection/components/popover-menu/popover-menu.js +189 -0
- package/dist/collection/components/popover-menu/popover-menu.stories.js +109 -0
- package/dist/collection/components/radio-button/radio-button.stories.js +68 -0
- package/dist/collection/components/side-menu/side-menu.stories.js +182 -0
- package/dist/collection/components/slider/slider.css +260 -0
- package/dist/collection/components/slider/slider.js +682 -0
- package/dist/collection/components/slider/slider.stories.js +251 -0
- package/dist/collection/components/spinner/spinner.css +79 -0
- package/dist/collection/components/spinner/spinner.js +61 -0
- package/dist/collection/components/spinner/spinner.stories.js +59 -0
- package/dist/collection/components/stepper/stepper.stories.js +139 -0
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +159 -0
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +302 -0
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +65 -0
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +172 -0
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +126 -0
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +43 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +153 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +103 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +32 -0
- package/dist/collection/components/textarea/textarea.css +283 -0
- package/dist/collection/components/textarea/textarea.js +336 -0
- package/dist/collection/components/textarea/textarea.stories.js +149 -0
- package/dist/collection/components/textfield/textfield.css +494 -0
- package/dist/collection/components/textfield/textfield.js +359 -0
- package/dist/collection/components/textfield/textfield.stories.js +222 -0
- package/dist/collection/components/toast/toast.stories.js +119 -0
- package/dist/collection/components/toggle/toggle.stories.js +62 -0
- package/dist/collection/components/tooltip/tooltip.css +46 -0
- package/dist/collection/components/tooltip/tooltip.js +200 -0
- package/dist/collection/components/tooltip/tooltip.stories.js +113 -0
- package/dist/collection/components/utility/colour/background-color.stories.js +96 -0
- package/dist/collection/components/utility/colour/text-color.stories.js +94 -0
- package/dist/collection/foundations-stories/colour/colour-brand.stories.js +38 -0
- package/dist/collection/foundations-stories/colour/colour-scales.stories.js +71 -0
- package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +40 -0
- package/dist/collection/foundations-stories/grid/grid.stories.js +386 -0
- package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +100 -0
- package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +94 -0
- package/dist/collection/foundations-stories/typography/typography-body.stories.js +16 -0
- package/dist/collection/foundations-stories/typography/typography-detail.stories.js +17 -0
- package/dist/collection/foundations-stories/typography/typography-headline.stories.js +39 -0
- package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +12 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/stories/assets/code-brackets.svg +1 -0
- package/dist/collection/stories/assets/colors.svg +1 -0
- package/dist/collection/stories/assets/comments.svg +1 -0
- package/dist/collection/stories/assets/direction.svg +1 -0
- package/dist/collection/stories/assets/flow.svg +1 -0
- package/dist/collection/stories/assets/plugin.svg +1 -0
- package/dist/collection/stories/assets/repo.svg +1 -0
- package/dist/collection/stories/assets/stackalt.svg +1 -0
- package/dist/collection/utils/utils.js +12 -0
- package/dist/components/dropdown-option.js +0 -1
- package/dist/components/dropdown.js +0 -1
- package/dist/components/icon.js +0 -1
- package/dist/components/sdds-accordion-item.js +0 -1
- package/dist/components/sdds-accordion.js +0 -1
- package/dist/components/sdds-badges.js +0 -1
- package/dist/components/sdds-button.js +0 -1
- package/dist/components/sdds-datetime.js +0 -1
- package/dist/components/sdds-dropdown-filter.js +0 -1
- package/dist/components/sdds-header-cell.js +0 -1
- package/dist/components/sdds-inline-tabs-fullbleed.js +0 -1
- package/dist/components/sdds-inline-tabs.js +0 -1
- package/dist/components/sdds-modal.js +0 -1
- package/dist/components/sdds-navigation-tabs.js +0 -1
- package/dist/components/sdds-popover-canvas.js +0 -1
- package/dist/components/sdds-popover-menu.js +0 -1
- package/dist/components/sdds-slider.js +0 -1
- package/dist/components/sdds-spinner.js +0 -1
- package/dist/components/sdds-table-body-row-expandable.js +0 -1
- package/dist/components/sdds-table-body.js +0 -1
- package/dist/components/sdds-table-footer.js +0 -1
- package/dist/components/sdds-table-header.js +0 -1
- package/dist/components/sdds-table-toolbar.js +0 -1
- package/dist/components/sdds-table.js +0 -1
- package/dist/components/sdds-textarea.js +0 -1
- package/dist/components/sdds-textfield.js +0 -1
- package/dist/components/sdds-tooltip.js +0 -1
- package/dist/components/table-body-cell.js +0 -1
- package/dist/components/table-body-row.js +0 -1
- package/dist/esm/index-b67b15a6.js +1884 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/popper-f860750c.js +1799 -0
- package/dist/esm/sdds-accordion-item.entry.js +30 -0
- package/dist/esm/sdds-accordion.entry.js +17 -0
- package/dist/esm/sdds-badges.entry.js +51 -0
- package/dist/esm/sdds-body-cell_2.entry.js +168 -0
- package/dist/esm/sdds-button.entry.js +32 -0
- package/dist/esm/sdds-datetime.entry.js +62 -0
- package/dist/esm/sdds-dropdown-filter.entry.js +88 -0
- package/dist/esm/sdds-dropdown_2.entry.js +330 -0
- package/dist/esm/sdds-header-cell.entry.js +137 -0
- package/dist/esm/sdds-icon.entry.js +38 -0
- package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +92 -0
- package/dist/esm/sdds-inline-tabs.entry.js +207 -0
- package/dist/esm/sdds-modal.entry.js +45 -0
- package/dist/esm/sdds-navigation-tabs.entry.js +91 -0
- package/dist/esm/sdds-popover-canvas.entry.js +72 -0
- package/dist/esm/sdds-popover-menu.entry.js +71 -0
- package/dist/esm/sdds-slider.entry.js +332 -0
- package/dist/esm/sdds-spinner.entry.js +17 -0
- package/dist/esm/sdds-table-body-row-expandable.entry.js +77 -0
- package/dist/esm/sdds-table-body.entry.js +285 -0
- package/dist/esm/sdds-table-footer.entry.js +161 -0
- package/dist/esm/sdds-table-header.entry.js +96 -0
- package/dist/esm/sdds-table-toolbar.entry.js +62 -0
- package/dist/esm/sdds-table.entry.js +65 -0
- package/dist/esm/sdds-textarea.entry.js +57 -0
- package/dist/esm/sdds-textfield.entry.js +78 -0
- package/dist/esm/sdds-tooltip.entry.js +91 -0
- package/dist/esm/tegel.js +17 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/tegel/index.esm.js +0 -0
- package/dist/tegel/p-040efb32.entry.js +1 -0
- package/dist/tegel/p-12ca5cfa.entry.js +1 -0
- package/dist/tegel/p-157e1618.js +2 -0
- package/dist/tegel/p-1fe61cf6.entry.js +1 -0
- package/dist/tegel/p-2f376504.entry.js +1 -0
- package/dist/tegel/p-44ced895.entry.js +1 -0
- package/dist/tegel/p-4880f03d.entry.js +1 -0
- package/dist/tegel/p-4aba73a3.entry.js +1 -0
- package/dist/tegel/p-4b58a02c.entry.js +1 -0
- package/dist/tegel/p-4cb85347.entry.js +1 -0
- package/dist/tegel/p-52031b5a.entry.js +1 -0
- package/dist/tegel/p-677baf7f.entry.js +1 -0
- package/dist/tegel/p-71797eaf.entry.js +1 -0
- package/dist/tegel/p-7373284c.entry.js +1 -0
- package/dist/tegel/p-7451779b.entry.js +1 -0
- package/dist/tegel/p-77aeea3b.entry.js +1 -0
- package/dist/tegel/p-8582d6a7.entry.js +1 -0
- package/dist/tegel/p-96021bd0.entry.js +1 -0
- package/dist/tegel/p-9d8caf51.entry.js +1 -0
- package/dist/tegel/p-a5919930.entry.js +1 -0
- package/dist/tegel/p-b01cface.entry.js +1 -0
- package/dist/tegel/p-bf896643.entry.js +1 -0
- package/dist/tegel/p-c311725c.entry.js +1 -0
- package/dist/tegel/p-cf72dfd9.entry.js +1 -0
- package/dist/tegel/p-d91caec6.entry.js +1 -0
- package/dist/tegel/p-e10eec33.entry.js +1 -0
- package/dist/tegel/p-ec26fc38.js +1 -0
- package/dist/tegel/p-f2262a69.entry.js +1 -0
- package/dist/tegel/p-f2f7aa45.entry.js +1 -0
- package/dist/tegel/tegel.css +101 -0
- package/dist/tegel/tegel.esm.js +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +4 -4
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/Toggle',
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: 'centered',
|
|
6
|
+
design: [
|
|
7
|
+
{
|
|
8
|
+
name: 'Figma',
|
|
9
|
+
type: 'figma',
|
|
10
|
+
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2479%3A108951&t=Ne6myqwca5m00de7-1',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'Link',
|
|
14
|
+
type: 'link',
|
|
15
|
+
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2479%3A108951&t=Ne6myqwca5m00de7-1',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
size: {
|
|
21
|
+
name: 'Size',
|
|
22
|
+
control: {
|
|
23
|
+
type: 'radio',
|
|
24
|
+
},
|
|
25
|
+
options: ['Default', 'Small'],
|
|
26
|
+
description: 'Size of the toggle',
|
|
27
|
+
},
|
|
28
|
+
headline: {
|
|
29
|
+
name: 'Headline',
|
|
30
|
+
description: 'Optional value to be used to clarify what the toggle is switching on / off',
|
|
31
|
+
control: {
|
|
32
|
+
type: 'text',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
name: 'Disabled',
|
|
37
|
+
description: 'Should it be disabled?',
|
|
38
|
+
control: {
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
args: {
|
|
44
|
+
size: 'Default',
|
|
45
|
+
headline: '',
|
|
46
|
+
disabled: false,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
const Template = ({ size, disabled = false, headline = '' }) => {
|
|
50
|
+
const sizeValue = size === 'Small' ? 'sdds-toggle-sm' : '';
|
|
51
|
+
const headlineDiv = headline.length > 0 ? `<div class="sdds-toggle-headline">${headline}</div>` : '';
|
|
52
|
+
return formatHtmlPreview(`
|
|
53
|
+
<div class="sdds-toggle ${sizeValue} ${disabled ? 'disabled' : ''}" tabindex="0">
|
|
54
|
+
${headlineDiv}
|
|
55
|
+
<input type="checkbox" class="sdds-toggle-input" id="customSwitch1" ${disabled ? 'disabled' : ''}>
|
|
56
|
+
<span class="sdds-toggle-switch"></span>
|
|
57
|
+
<label class="sdds-toggle-label" for="customSwitch1">Toggle this switch element</label>
|
|
58
|
+
</div>
|
|
59
|
+
`);
|
|
60
|
+
};
|
|
61
|
+
export const Default = Template.bind({});
|
|
62
|
+
Default.args = {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
.sdds-theme-light {
|
|
3
|
+
--sdds-tooltip-background: var(--sdds-grey-800);
|
|
4
|
+
--sdds-tooltip-color: var(--sdds-white);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sdds-theme-dark {
|
|
8
|
+
--sdds-tooltip-background: var(--sdds-grey-200);
|
|
9
|
+
--sdds-tooltip-color: var(--sdds-grey-958);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.sdds-tooltip {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
font: var(--sdds-detail-05);
|
|
15
|
+
letter-spacing: var(--sdds-detail-05-ls);
|
|
16
|
+
color: var(--sdds-tooltip-color);
|
|
17
|
+
background-color: var(--sdds-tooltip-background);
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
padding: 8px;
|
|
20
|
+
word-wrap: break-word;
|
|
21
|
+
max-width: 192px;
|
|
22
|
+
z-index: 20000;
|
|
23
|
+
opacity: 0;
|
|
24
|
+
visibility: hidden;
|
|
25
|
+
transition: opacity 200ms ease-in, visibility 200ms ease-in;
|
|
26
|
+
}
|
|
27
|
+
.sdds-tooltip * {
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
}
|
|
30
|
+
.sdds-tooltip.sdds-tooltip-top-left {
|
|
31
|
+
border-radius: 0 4px 4px;
|
|
32
|
+
}
|
|
33
|
+
.sdds-tooltip.sdds-tooltip-top-right {
|
|
34
|
+
border-radius: 4px 0 4px 4px;
|
|
35
|
+
}
|
|
36
|
+
.sdds-tooltip.sdds-tooltip-bottom-right {
|
|
37
|
+
border-radius: 4px 4px 0;
|
|
38
|
+
}
|
|
39
|
+
.sdds-tooltip.sdds-tooltip-bottom-left {
|
|
40
|
+
border-radius: 4px 4px 4px 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.sdds-tooltip-show {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
visibility: visible;
|
|
46
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { createPopper } from '@popperjs/core';
|
|
3
|
+
export class Tooltip {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.offsetSkidding = 0;
|
|
6
|
+
this.offsetDistance = 8;
|
|
7
|
+
this.text = '';
|
|
8
|
+
this.selector = '';
|
|
9
|
+
this.mouseOverTooltip = false;
|
|
10
|
+
this.show = false;
|
|
11
|
+
this.placement = 'bottom';
|
|
12
|
+
this.target = undefined;
|
|
13
|
+
}
|
|
14
|
+
componentDidLoad() {
|
|
15
|
+
this.target = document.querySelector(this.selector);
|
|
16
|
+
const thisValue = this;
|
|
17
|
+
createPopper(this.target, this.tooltip, {
|
|
18
|
+
placement: thisValue.placement,
|
|
19
|
+
modifiers: [
|
|
20
|
+
{
|
|
21
|
+
name: 'positionCalc',
|
|
22
|
+
enabled: true,
|
|
23
|
+
phase: 'main',
|
|
24
|
+
fn({ state }) {
|
|
25
|
+
if (state.placement === 'bottom-start' || state.placement === 'right-start') {
|
|
26
|
+
thisValue.border = 'top-left';
|
|
27
|
+
}
|
|
28
|
+
else if (state.placement === 'bottom-end' || state.placement === 'left-start') {
|
|
29
|
+
thisValue.border = 'top-right';
|
|
30
|
+
}
|
|
31
|
+
else if (state.placement === 'top-end' || state.placement === 'left-end') {
|
|
32
|
+
thisValue.border = 'bottom-right';
|
|
33
|
+
}
|
|
34
|
+
else if (state.placement === 'top-start' || state.placement === 'right-end') {
|
|
35
|
+
thisValue.border = 'bottom-left';
|
|
36
|
+
}
|
|
37
|
+
else if (state.placement === 'bottom' || state.placement === 'top') {
|
|
38
|
+
thisValue.border = 'default';
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'offset',
|
|
44
|
+
options: {
|
|
45
|
+
offset: [this.offsetSkidding, this.offsetDistance],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
const showTooltip = () => {
|
|
51
|
+
this.show = true;
|
|
52
|
+
};
|
|
53
|
+
const hideTooltip = () => {
|
|
54
|
+
this.show = false;
|
|
55
|
+
};
|
|
56
|
+
// For tabbing over element
|
|
57
|
+
this.target.addEventListener('focusin', () => {
|
|
58
|
+
showTooltip();
|
|
59
|
+
});
|
|
60
|
+
this.target.addEventListener('focusout', () => {
|
|
61
|
+
hideTooltip();
|
|
62
|
+
});
|
|
63
|
+
// For hovering over element with selector
|
|
64
|
+
this.target.addEventListener('mouseenter', () => {
|
|
65
|
+
showTooltip();
|
|
66
|
+
});
|
|
67
|
+
this.target.addEventListener('mouseleave', () => {
|
|
68
|
+
hideTooltip();
|
|
69
|
+
});
|
|
70
|
+
// For hovering over tooltip itself:
|
|
71
|
+
if (this.mouseOverTooltip === true) {
|
|
72
|
+
this.tooltip.addEventListener('mouseenter', () => {
|
|
73
|
+
showTooltip();
|
|
74
|
+
});
|
|
75
|
+
this.tooltip.addEventListener('mouseleave', () => {
|
|
76
|
+
hideTooltip();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/* Slot on line 118 is added to support adding HTML elements to component */
|
|
81
|
+
render() {
|
|
82
|
+
return (h("span", { ref: (el) => (this.tooltip = el), class: `sdds-tooltip sdds-tooltip-${this.border} ${this.show ? 'sdds-tooltip-show' : ''}` }, this.text, h("slot", null)));
|
|
83
|
+
}
|
|
84
|
+
static get is() { return "sdds-tooltip"; }
|
|
85
|
+
static get encapsulation() { return "shadow"; }
|
|
86
|
+
static get originalStyleUrls() {
|
|
87
|
+
return {
|
|
88
|
+
"$": ["tooltip.scss"]
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
static get styleUrls() {
|
|
92
|
+
return {
|
|
93
|
+
"$": ["tooltip.css"]
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
static get properties() {
|
|
97
|
+
return {
|
|
98
|
+
"text": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"mutable": false,
|
|
101
|
+
"complexType": {
|
|
102
|
+
"original": "string",
|
|
103
|
+
"resolved": "string",
|
|
104
|
+
"references": {}
|
|
105
|
+
},
|
|
106
|
+
"required": false,
|
|
107
|
+
"optional": false,
|
|
108
|
+
"docs": {
|
|
109
|
+
"tags": [],
|
|
110
|
+
"text": "In case tooltip contains only text, no HTML, text can be passed by this prop"
|
|
111
|
+
},
|
|
112
|
+
"attribute": "text",
|
|
113
|
+
"reflect": false,
|
|
114
|
+
"defaultValue": "''"
|
|
115
|
+
},
|
|
116
|
+
"selector": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "string",
|
|
121
|
+
"resolved": "string",
|
|
122
|
+
"references": {}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": false,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": "CSS selector of element on which tooltip is used on."
|
|
129
|
+
},
|
|
130
|
+
"attribute": "selector",
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"defaultValue": "''"
|
|
133
|
+
},
|
|
134
|
+
"mouseOverTooltip": {
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"mutable": false,
|
|
137
|
+
"complexType": {
|
|
138
|
+
"original": "boolean",
|
|
139
|
+
"resolved": "boolean",
|
|
140
|
+
"references": {}
|
|
141
|
+
},
|
|
142
|
+
"required": false,
|
|
143
|
+
"optional": false,
|
|
144
|
+
"docs": {
|
|
145
|
+
"tags": [],
|
|
146
|
+
"text": "Allow mouse over tooltip. Useful when tooltip contains clickable elements like link or button."
|
|
147
|
+
},
|
|
148
|
+
"attribute": "mouse-over-tooltip",
|
|
149
|
+
"reflect": false,
|
|
150
|
+
"defaultValue": "false"
|
|
151
|
+
},
|
|
152
|
+
"show": {
|
|
153
|
+
"type": "boolean",
|
|
154
|
+
"mutable": true,
|
|
155
|
+
"complexType": {
|
|
156
|
+
"original": "boolean",
|
|
157
|
+
"resolved": "boolean",
|
|
158
|
+
"references": {}
|
|
159
|
+
},
|
|
160
|
+
"required": false,
|
|
161
|
+
"optional": false,
|
|
162
|
+
"docs": {
|
|
163
|
+
"tags": [],
|
|
164
|
+
"text": "Prop in control of showing and hiding prop"
|
|
165
|
+
},
|
|
166
|
+
"attribute": "show",
|
|
167
|
+
"reflect": false,
|
|
168
|
+
"defaultValue": "false"
|
|
169
|
+
},
|
|
170
|
+
"placement": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"mutable": false,
|
|
173
|
+
"complexType": {
|
|
174
|
+
"original": "Placement",
|
|
175
|
+
"resolved": "\"auto\" | \"auto-end\" | \"auto-start\" | \"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
176
|
+
"references": {
|
|
177
|
+
"Placement": {
|
|
178
|
+
"location": "import",
|
|
179
|
+
"path": "@popperjs/core"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"required": false,
|
|
184
|
+
"optional": false,
|
|
185
|
+
"docs": {
|
|
186
|
+
"tags": [],
|
|
187
|
+
"text": "Placement of tooltip. Possible values: auto, auto-start, auto-end, top, top-start, top-end, bottom, bottom-start, bottom-end, right, right-start, right-end, left, left-start, left-end."
|
|
188
|
+
},
|
|
189
|
+
"attribute": "placement",
|
|
190
|
+
"reflect": false,
|
|
191
|
+
"defaultValue": "'bottom'"
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
static get states() {
|
|
196
|
+
return {
|
|
197
|
+
"target": {}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
+
import readme from './readme.md';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Tooltip',
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: 'centered',
|
|
7
|
+
notes: readme,
|
|
8
|
+
docs: {
|
|
9
|
+
source: {
|
|
10
|
+
state: 'closed',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
design: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Figma',
|
|
16
|
+
type: 'figma',
|
|
17
|
+
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2620%3A4152&t=Ne6myqwca5m00de7-1',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Link',
|
|
21
|
+
type: 'link',
|
|
22
|
+
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2620%3A4152&t=Ne6myqwca5m00de7-1',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
tooltipPosition: {
|
|
28
|
+
name: 'Tooltip position',
|
|
29
|
+
control: {
|
|
30
|
+
type: 'select',
|
|
31
|
+
options: [
|
|
32
|
+
'Bottom-start',
|
|
33
|
+
'Bottom',
|
|
34
|
+
'Bottom-end',
|
|
35
|
+
'Top-start',
|
|
36
|
+
'Top',
|
|
37
|
+
'Top-end',
|
|
38
|
+
'Left-start',
|
|
39
|
+
'Left',
|
|
40
|
+
'Left-end',
|
|
41
|
+
'Right-start',
|
|
42
|
+
'Right',
|
|
43
|
+
'Right-end',
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
description: 'Position of the tooltip',
|
|
47
|
+
},
|
|
48
|
+
text: {
|
|
49
|
+
name: 'Tooltip text',
|
|
50
|
+
description: 'Text that will be displayed inside tooltip',
|
|
51
|
+
control: {
|
|
52
|
+
type: 'text',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
slot: {
|
|
56
|
+
name: 'Tooltip html content',
|
|
57
|
+
description: 'A slot for the tooltip to pass in html.',
|
|
58
|
+
control: {
|
|
59
|
+
type: 'text',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
mouseOverTooltip: {
|
|
63
|
+
name: 'Open while hovering over tooltip',
|
|
64
|
+
control: 'boolean',
|
|
65
|
+
description: 'Keep the tooltip visible as long as the mouse hover over it',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
args: {
|
|
69
|
+
tooltipPosition: 'Bottom',
|
|
70
|
+
text: 'Text inside tooltip',
|
|
71
|
+
slot: '<p class="sdds-detail-05 sdds-u-m0"> Paragraph tag inside of Tooltip with <b>bold</b> and <i>italic</i> tags too. </p>',
|
|
72
|
+
mouseOverTooltip: true,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
const positionLookup = {
|
|
76
|
+
'Bottom-start': 'bottom-start',
|
|
77
|
+
'Bottom': 'bottom',
|
|
78
|
+
'Bottom-end': 'bottom-end',
|
|
79
|
+
'Top-start': 'top-start',
|
|
80
|
+
'Top': 'top',
|
|
81
|
+
'Top-end': 'top-end',
|
|
82
|
+
'Left-start': 'left-start',
|
|
83
|
+
'Left': 'left',
|
|
84
|
+
'Left-end': 'left-end',
|
|
85
|
+
'Right-start': 'right-start',
|
|
86
|
+
'Right': 'right',
|
|
87
|
+
'Right-end': 'right-end',
|
|
88
|
+
};
|
|
89
|
+
const ComponentTooltip = ({ tooltipPosition, mouseOverTooltip, text, slot }) => formatHtmlPreview(`
|
|
90
|
+
<style>
|
|
91
|
+
/* demo-wrapper is for demonstration purposes only*/
|
|
92
|
+
.demo-wrapper{
|
|
93
|
+
height: 300px;
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
align-items: center;
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
99
|
+
|
|
100
|
+
<div class="demo-wrapper">
|
|
101
|
+
<sdds-tooltip
|
|
102
|
+
placement="${positionLookup[tooltipPosition]}"
|
|
103
|
+
selector="#button-1"
|
|
104
|
+
text="${text}"
|
|
105
|
+
mouse-over-tooltip="${mouseOverTooltip}">
|
|
106
|
+
${slot}
|
|
107
|
+
</sdds-tooltip>
|
|
108
|
+
|
|
109
|
+
<!-- Demo button for presentation purposes -->
|
|
110
|
+
<sdds-button size= 'sm' id="button-1" text='Hover me'></sdds-button>
|
|
111
|
+
</div>
|
|
112
|
+
`);
|
|
113
|
+
export const Default = ComponentTooltip.bind({});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../../utils/utils';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Utilities/Colours',
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: 'centered',
|
|
6
|
+
},
|
|
7
|
+
argTypes: {
|
|
8
|
+
backgroundColor: {
|
|
9
|
+
name: 'Background colour',
|
|
10
|
+
description: 'The colour of the text',
|
|
11
|
+
control: {
|
|
12
|
+
type: 'select',
|
|
13
|
+
},
|
|
14
|
+
options: { Red: 'red', Blue: 'blue', Grey: 'grey' },
|
|
15
|
+
},
|
|
16
|
+
greyScale: {
|
|
17
|
+
name: 'Scale',
|
|
18
|
+
description: 'The colour scale used.',
|
|
19
|
+
control: {
|
|
20
|
+
type: 'select',
|
|
21
|
+
},
|
|
22
|
+
options: [
|
|
23
|
+
'50',
|
|
24
|
+
'100',
|
|
25
|
+
'200',
|
|
26
|
+
'300',
|
|
27
|
+
'400',
|
|
28
|
+
'500',
|
|
29
|
+
'600',
|
|
30
|
+
'700',
|
|
31
|
+
'800',
|
|
32
|
+
'846',
|
|
33
|
+
'868',
|
|
34
|
+
'900',
|
|
35
|
+
'958',
|
|
36
|
+
],
|
|
37
|
+
if: { arg: 'backgroundColor', eq: 'grey' },
|
|
38
|
+
},
|
|
39
|
+
redScale: {
|
|
40
|
+
name: 'Scale',
|
|
41
|
+
description: 'The colour scale used.',
|
|
42
|
+
control: {
|
|
43
|
+
type: 'select',
|
|
44
|
+
},
|
|
45
|
+
options: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
46
|
+
if: { arg: 'backgroundColor', eq: 'red' },
|
|
47
|
+
},
|
|
48
|
+
blueScale: {
|
|
49
|
+
name: 'Scale',
|
|
50
|
+
description: 'The colour scale used.',
|
|
51
|
+
control: {
|
|
52
|
+
type: 'select',
|
|
53
|
+
},
|
|
54
|
+
options: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
55
|
+
if: { arg: 'backgroundColor', eq: 'blue' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
const Template = ({ backgroundColor, greyScale, blueScale, redScale }) => {
|
|
60
|
+
let scale = 100;
|
|
61
|
+
switch (backgroundColor) {
|
|
62
|
+
case 'blue':
|
|
63
|
+
scale = blueScale;
|
|
64
|
+
break;
|
|
65
|
+
case 'grey':
|
|
66
|
+
scale = greyScale;
|
|
67
|
+
break;
|
|
68
|
+
case 'red':
|
|
69
|
+
scale = redScale;
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
scale = blueScale;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
return formatHtmlPreview(`
|
|
76
|
+
<style>
|
|
77
|
+
.demo-wrapper{
|
|
78
|
+
height: 400px;
|
|
79
|
+
width: 400px;
|
|
80
|
+
display: flex;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
align-items: center;
|
|
83
|
+
}
|
|
84
|
+
</style>
|
|
85
|
+
<div class="sdds-background-${backgroundColor}-${scale} demo-wrapper">
|
|
86
|
+
<h1>background-color:${backgroundColor}</h1>
|
|
87
|
+
</div>
|
|
88
|
+
`);
|
|
89
|
+
};
|
|
90
|
+
export const backgroundColor = Template.bind({});
|
|
91
|
+
backgroundColor.args = {
|
|
92
|
+
backgroundColor: 'blue',
|
|
93
|
+
blueScale: '500',
|
|
94
|
+
redScale: '500',
|
|
95
|
+
greyScale: '958',
|
|
96
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../../utils/utils';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Utilities/Colours',
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: 'centered',
|
|
6
|
+
},
|
|
7
|
+
argTypes: {
|
|
8
|
+
colour: {
|
|
9
|
+
name: 'Colour',
|
|
10
|
+
description: 'The colour of the text',
|
|
11
|
+
control: {
|
|
12
|
+
type: 'select',
|
|
13
|
+
},
|
|
14
|
+
options: { Red: 'red', Blue: 'blue', Grey: 'grey' },
|
|
15
|
+
},
|
|
16
|
+
greyScale: {
|
|
17
|
+
name: 'Scale',
|
|
18
|
+
description: 'The colour scale used.',
|
|
19
|
+
control: {
|
|
20
|
+
type: 'select',
|
|
21
|
+
},
|
|
22
|
+
options: [
|
|
23
|
+
'50',
|
|
24
|
+
'100',
|
|
25
|
+
'200',
|
|
26
|
+
'300',
|
|
27
|
+
'400',
|
|
28
|
+
'500',
|
|
29
|
+
'600',
|
|
30
|
+
'700',
|
|
31
|
+
'800',
|
|
32
|
+
'846',
|
|
33
|
+
'868',
|
|
34
|
+
'900',
|
|
35
|
+
'958',
|
|
36
|
+
],
|
|
37
|
+
if: { arg: 'colour', eq: 'grey' },
|
|
38
|
+
},
|
|
39
|
+
redScale: {
|
|
40
|
+
name: 'Scale',
|
|
41
|
+
description: 'The colour scale used.',
|
|
42
|
+
control: {
|
|
43
|
+
type: 'select',
|
|
44
|
+
},
|
|
45
|
+
options: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
46
|
+
if: { arg: 'colour', eq: 'red' },
|
|
47
|
+
},
|
|
48
|
+
blueScale: {
|
|
49
|
+
name: 'Scale',
|
|
50
|
+
description: 'The colour scale used.',
|
|
51
|
+
control: {
|
|
52
|
+
type: 'select',
|
|
53
|
+
},
|
|
54
|
+
options: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
55
|
+
if: { arg: 'colour', eq: 'blue' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
const Template = ({ colour, greyScale, blueScale, redScale }) => {
|
|
60
|
+
let scale = 100;
|
|
61
|
+
switch (colour) {
|
|
62
|
+
case 'blue':
|
|
63
|
+
scale = blueScale;
|
|
64
|
+
break;
|
|
65
|
+
case 'grey':
|
|
66
|
+
scale = greyScale;
|
|
67
|
+
break;
|
|
68
|
+
case 'red':
|
|
69
|
+
scale = redScale;
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
scale = blueScale;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
return formatHtmlPreview(`
|
|
76
|
+
<style>
|
|
77
|
+
.demo-wrapper h1 {
|
|
78
|
+
margin: 0;
|
|
79
|
+
width: 300px;
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
82
|
+
<div class="demo-wrapper">
|
|
83
|
+
<h1 class="sdds-text-${colour}-${scale}">A text ${colour} heading</h1>
|
|
84
|
+
<p class="sdds-text-${colour}-${scale}">A text ${colour} paragraph</p>
|
|
85
|
+
</div>
|
|
86
|
+
`);
|
|
87
|
+
};
|
|
88
|
+
export const textColor = Template.bind({});
|
|
89
|
+
textColor.args = {
|
|
90
|
+
colour: 'blue',
|
|
91
|
+
blueScale: '500',
|
|
92
|
+
redScale: '500',
|
|
93
|
+
greyScale: '958',
|
|
94
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Foundations/Colour',
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: 'fullscreen',
|
|
6
|
+
docs: {
|
|
7
|
+
source: {
|
|
8
|
+
state: 'closed',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
const Template = () => formatHtmlPreview(`
|
|
14
|
+
<style>
|
|
15
|
+
/* Demo code for presentation purposes */
|
|
16
|
+
.demo-wrapper {
|
|
17
|
+
height: 90px;
|
|
18
|
+
}
|
|
19
|
+
.demo-wrapper span {
|
|
20
|
+
color: white;
|
|
21
|
+
background-color: black;
|
|
22
|
+
border: 1px solid white;
|
|
23
|
+
padding: 4px;
|
|
24
|
+
position: absolute;
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
27
|
+
|
|
28
|
+
<div class="demo-wrapper" style="background-color: var(--sdds-black)">
|
|
29
|
+
<span>--sdds-black</span>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="demo-wrapper" style="background-color: var(--sdds-white)">
|
|
32
|
+
<span>--sdds-white</span>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="demo-wrapper" style="background-color: var(--sdds-blue)">
|
|
35
|
+
<span>--sdds-blue</span>
|
|
36
|
+
</div>
|
|
37
|
+
`);
|
|
38
|
+
export const Brand = Template.bind({});
|