@limetech/lime-elements 36.3.0-next.8 → 36.3.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/README.md +2 -2
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-badge.cjs.entry.js +4 -6
- package/dist/cjs/limel-button-group.cjs.entry.js +21 -6
- package/dist/cjs/limel-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +54 -0
- package/dist/cjs/limel-chip-set.cjs.entry.js +13 -3
- package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +3 -12
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +1 -1
- package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +47 -7
- package/dist/cjs/limel-dialog.cjs.entry.js +1 -1
- package/dist/cjs/limel-dock-button.cjs.entry.js +7 -2
- package/dist/cjs/limel-dock.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +99 -118
- package/dist/cjs/limel-form.cjs.entry.js +79 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +4 -1
- package/dist/cjs/limel-input-field.cjs.entry.js +2 -2
- package/dist/cjs/limel-list_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-menu-list.cjs.entry.js +7 -1
- package/dist/cjs/limel-menu.cjs.entry.js +10 -2
- package/dist/cjs/limel-portal.cjs.entry.js +3 -4
- package/dist/cjs/limel-select.cjs.entry.js +1 -1
- package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
- package/dist/cjs/limel-slider.cjs.entry.js +5 -5
- package/dist/cjs/limel-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/limel-spinner.cjs.entry.js +1 -1
- package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dateFormatter-d7a8d40d.js → sv-dffe48b5.js} +222 -173
- package/dist/cjs/{translations-ca7279bc.js → translations-f8080c48.js} +30 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/badge/badge.css +34 -19
- package/dist/collection/components/badge/badge.js +7 -7
- package/dist/collection/components/banner/banner.css +1 -2
- package/dist/collection/components/button/button.css +31 -41
- package/dist/collection/components/button-group/button-group.css +44 -42
- package/dist/collection/components/button-group/button-group.js +25 -6
- package/dist/collection/components/callout/callout.css +77 -0
- package/dist/collection/components/callout/callout.helpers.js +27 -0
- package/dist/collection/components/callout/callout.js +139 -0
- package/dist/collection/components/callout/callout.types.js +1 -0
- package/dist/collection/components/checkbox/checkbox.css +22 -45
- package/dist/collection/components/chip-set/chip-set.css +222 -405
- package/dist/collection/components/chip-set/chip-set.js +6 -2
- package/dist/collection/components/circular-progress/circular-progress.css +8 -0
- package/dist/collection/components/code-editor/code-editor.css +11 -8
- package/dist/collection/components/collapsible-section/collapsible-section.css +87 -55
- package/dist/collection/components/collapsible-section/collapsible-section.js +2 -11
- package/dist/collection/components/color-picker/color-picker-palette.css +16 -14
- package/dist/collection/components/color-picker/color-picker.css +7 -5
- package/dist/collection/components/date-picker/date-picker.js +30 -5
- package/dist/collection/components/date-picker/dateFormatter.js +7 -3
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +11 -1
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +23 -8
- package/dist/collection/components/date-picker/pickers/Picker.js +11 -8
- package/dist/collection/components/dialog/dialog.css +14 -27
- package/dist/collection/components/dock/dock-button/dock-button.css +17 -2
- package/dist/collection/components/dock/dock-button/dock-button.js +6 -1
- package/dist/collection/components/dock/dock.css +19 -1
- package/dist/collection/components/dock/dock.js +1 -0
- package/dist/collection/components/file/file.js +1 -1
- package/dist/collection/components/form/form.css +122 -18
- package/dist/collection/components/form/form.js +1 -0
- package/dist/collection/components/form/form.types.js +8 -0
- package/dist/collection/components/form/row/row.js +47 -0
- package/dist/collection/components/form/templates/object-field.js +5 -0
- package/dist/collection/components/form/templates/row-layout.js +20 -0
- package/dist/collection/components/header/header.css +8 -0
- package/dist/collection/components/icon-button/icon-button.css +15 -12
- package/dist/collection/components/info-tile/info-tile.css +13 -17
- package/dist/collection/components/info-tile/info-tile.js +3 -0
- package/dist/collection/components/input-field/input-field.css +199 -363
- package/dist/collection/components/input-field/input-field.js +1 -1
- package/dist/collection/components/linear-progress/linear-progress.css +7 -14
- package/dist/collection/components/list/list.css +388 -751
- package/dist/collection/components/menu/menu.css +19 -1
- package/dist/collection/components/menu/menu.js +10 -1
- package/dist/collection/components/menu-list/menu-list-renderer.js +6 -1
- package/dist/collection/components/menu-list/menu-list.css +400 -752
- package/dist/collection/components/menu-surface/menu-surface.css +13 -26
- package/dist/collection/components/popover-surface/popover-surface.css +8 -0
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +8 -0
- package/dist/collection/components/select/select.css +174 -323
- package/dist/collection/components/shortcut/shortcut.css +9 -7
- package/dist/collection/components/slider/slider.css +87 -98
- package/dist/collection/components/slider/slider.js +5 -5
- package/dist/collection/components/snackbar/snackbar.css +19 -34
- package/dist/collection/components/snackbar/snackbar.js +1 -1
- package/dist/collection/components/spinner/spinner.css +4 -0
- package/dist/collection/components/split-button/split-button.css +15 -4
- package/dist/collection/components/switch/switch.css +21 -49
- package/dist/collection/components/tab-bar/tab-bar.css +20 -19
- package/dist/collection/components/tab-panel/tab-panel.css +5 -0
- package/dist/collection/components/table/table.css +33 -0
- package/dist/collection/icons/idea.svg +593 -0
- package/dist/collection/icons/info.svg +593 -0
- package/dist/collection/style/internal/shared_input-select-picker.scss +4 -0
- package/dist/collection/style/internal/z-index.scss +0 -1
- package/dist/collection/style/mixins.scss +15 -4
- package/dist/collection/translations/da.js +5 -0
- package/dist/collection/translations/en.js +5 -0
- package/dist/collection/translations/fi.js +5 -0
- package/dist/collection/translations/nl.js +5 -0
- package/dist/collection/translations/no.js +5 -0
- package/dist/collection/translations/sv.js +5 -0
- package/dist/esm/{keycodes-9f971b46.js → keycodes-44c01beb.js} +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-badge.entry.js +4 -6
- package/dist/esm/limel-button-group.entry.js +21 -6
- package/dist/esm/limel-button.entry.js +1 -1
- package/dist/esm/limel-callout.entry.js +50 -0
- package/dist/esm/limel-chip-set.entry.js +14 -4
- package/dist/esm/limel-code-editor.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +3 -12
- package/dist/esm/limel-color-picker-palette.entry.js +1 -1
- package/dist/esm/limel-color-picker.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +46 -6
- package/dist/esm/limel-dialog.entry.js +1 -1
- package/dist/esm/limel-dock-button.entry.js +7 -2
- package/dist/esm/limel-dock.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +99 -118
- package/dist/esm/limel-form.entry.js +79 -1
- package/dist/esm/limel-icon-button.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js +4 -1
- package/dist/esm/limel-input-field.entry.js +3 -3
- package/dist/esm/limel-list_2.entry.js +2 -2
- package/dist/esm/limel-menu-list.entry.js +7 -1
- package/dist/esm/limel-menu.entry.js +10 -2
- package/dist/esm/limel-picker.entry.js +1 -1
- package/dist/esm/limel-popover_4.entry.js +1 -1
- package/dist/esm/limel-portal.entry.js +3 -4
- package/dist/esm/limel-select.entry.js +2 -2
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-slider.entry.js +6 -6
- package/dist/esm/limel-snackbar.entry.js +2 -2
- package/dist/esm/limel-spinner.entry.js +1 -1
- package/dist/esm/limel-split-button.entry.js +1 -1
- package/dist/esm/limel-tab-bar.entry.js +1 -1
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dateFormatter-784c3334.js → sv-336c4576.js} +222 -173
- package/dist/esm/{translations-0d0ee941.js → translations-f88bb584.js} +30 -0
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-a8d38277.entry.js → p-10e259de.entry.js} +1 -1
- package/dist/lime-elements/{p-934456bc.entry.js → p-123f5fbb.entry.js} +1 -1
- package/dist/lime-elements/{p-c234a991.entry.js → p-157e0417.entry.js} +2 -2
- package/dist/lime-elements/p-2f9918a3.entry.js +1 -0
- package/dist/lime-elements/p-2fd478df.entry.js +1 -0
- package/dist/lime-elements/p-3be2dfc7.entry.js +1 -0
- package/dist/lime-elements/{p-06f2f6b4.entry.js → p-3fda3473.entry.js} +1 -1
- package/dist/lime-elements/p-46a76d55.entry.js +1 -0
- package/dist/lime-elements/p-4a62273c.entry.js +1 -0
- package/dist/lime-elements/{p-73df4d83.js → p-4dd9a5a5.js} +5 -3
- package/dist/lime-elements/{p-d1187867.entry.js → p-4eeabc1f.entry.js} +1 -1
- package/dist/lime-elements/{p-2f2ea041.entry.js → p-4fcd3337.entry.js} +1 -1
- package/dist/lime-elements/{p-029360c8.entry.js → p-50dbd665.entry.js} +1 -1
- package/dist/lime-elements/{p-e5213a54.entry.js → p-55c8cb64.entry.js} +4 -4
- package/dist/lime-elements/{p-cad7cda1.entry.js → p-58e9df30.entry.js} +1 -1
- package/dist/lime-elements/p-73613abb.entry.js +82 -0
- package/dist/lime-elements/{p-6784c5c3.entry.js → p-7d7d19de.entry.js} +1 -1
- package/dist/lime-elements/{p-9ec08ebc.entry.js → p-8178b348.entry.js} +3 -3
- package/dist/lime-elements/{p-004aad18.entry.js → p-9336fd7f.entry.js} +1 -1
- package/dist/lime-elements/{p-a0c78744.entry.js → p-a88f2922.entry.js} +2 -2
- package/dist/lime-elements/p-b1ae3d1f.entry.js +126 -0
- package/dist/lime-elements/p-b40f37d7.entry.js +1 -0
- package/dist/lime-elements/p-b59e4287.js +1 -0
- package/dist/lime-elements/{p-405207fa.entry.js → p-b80de0ea.entry.js} +1 -1
- package/dist/lime-elements/p-c47cb4c3.entry.js +1 -0
- package/dist/lime-elements/{p-b079fc71.entry.js → p-cc3529bb.entry.js} +1 -1
- package/dist/lime-elements/{p-93ad8b90.entry.js → p-d0084a70.entry.js} +1 -1
- package/dist/lime-elements/p-d16b27b9.entry.js +1 -0
- package/dist/lime-elements/{p-216ffe20.js → p-d7801e00.js} +1 -1
- package/dist/lime-elements/p-d87e2f26.entry.js +1 -0
- package/dist/lime-elements/p-d955c169.entry.js +59 -0
- package/dist/lime-elements/p-da536426.entry.js +1 -0
- package/dist/lime-elements/p-e69231c2.entry.js +16 -0
- package/dist/lime-elements/p-eda87f8c.entry.js +1 -0
- package/dist/lime-elements/{p-0bf916a0.entry.js → p-edbd8d62.entry.js} +1 -1
- package/dist/lime-elements/p-f11e7ce1.entry.js +1 -0
- package/dist/lime-elements/{p-5409b92f.entry.js → p-f979c0f2.entry.js} +1 -1
- package/dist/lime-elements/style/internal/shared_input-select-picker.scss +4 -0
- package/dist/lime-elements/style/internal/z-index.scss +0 -1
- package/dist/lime-elements/style/mixins.scss +15 -4
- package/dist/scss/mixins.scss +186 -0
- package/dist/types/components/badge/badge.d.ts +4 -2
- package/dist/types/components/button/button.types.d.ts +4 -0
- package/dist/types/components/button-group/button-group.d.ts +4 -0
- package/dist/types/components/callout/callout.d.ts +52 -0
- package/dist/types/components/callout/callout.helpers.d.ts +2 -0
- package/dist/types/components/callout/callout.types.d.ts +11 -0
- package/dist/types/components/chip-set/chip-set.d.ts +1 -1
- package/dist/types/components/collapsible-section/collapsible-section.d.ts +0 -1
- package/dist/types/components/date-picker/date-picker.d.ts +10 -0
- package/dist/types/components/date-picker/date.types.d.ts +1 -1
- package/dist/types/components/date-picker/dateFormatter.d.ts +3 -2
- package/dist/types/components/date-picker/flatpickr-adapter/flatpickr-adapter.d.ts +1 -1
- package/dist/types/components/date-picker/pickers/Picker.d.ts +4 -2
- package/dist/types/components/dock/dock-button/dock-button.d.ts +1 -0
- package/dist/types/components/dock/dock.d.ts +1 -0
- package/dist/types/components/dock/dock.types.d.ts +4 -0
- package/dist/types/components/form/form.d.ts +1 -0
- package/dist/types/components/form/form.types.d.ts +16 -1
- package/dist/types/components/form/row/row.d.ts +16 -0
- package/dist/types/components/form/templates/row-layout.d.ts +11 -0
- package/dist/types/components/form/templates/types.d.ts +3 -0
- package/dist/types/components/menu/menu.d.ts +3 -0
- package/dist/types/components/menu/menu.types.d.ts +4 -0
- package/dist/types/components/menu-list/menu-list-renderer.d.ts +1 -0
- package/dist/types/components.d.ts +57 -1
- package/dist/types/interface.d.ts +1 -0
- package/dist/types/translations/da.d.ts +5 -0
- package/dist/types/translations/en.d.ts +5 -0
- package/dist/types/translations/fi.d.ts +5 -0
- package/dist/types/translations/nl.d.ts +5 -0
- package/dist/types/translations/no.d.ts +5 -0
- package/dist/types/translations/sv.d.ts +5 -0
- package/package.json +23 -20
- package/dist/lime-elements/p-246862ec.js +0 -1
- package/dist/lime-elements/p-52e18d94.entry.js +0 -1
- package/dist/lime-elements/p-5393213b.entry.js +0 -1
- package/dist/lime-elements/p-61b3352f.entry.js +0 -1
- package/dist/lime-elements/p-65a3be2c.entry.js +0 -1
- package/dist/lime-elements/p-864db270.entry.js +0 -126
- package/dist/lime-elements/p-8ca53aa2.entry.js +0 -1
- package/dist/lime-elements/p-90961075.entry.js +0 -1
- package/dist/lime-elements/p-91604294.entry.js +0 -1
- package/dist/lime-elements/p-95fd48d0.entry.js +0 -82
- package/dist/lime-elements/p-c4a89055.entry.js +0 -16
- package/dist/lime-elements/p-cc9f89a9.entry.js +0 -1
- package/dist/lime-elements/p-d379f4d6.entry.js +0 -59
- package/dist/lime-elements/p-d512656b.entry.js +0 -1
- package/dist/lime-elements/p-e6a11b73.entry.js +0 -1
- package/dist/lime-elements/p-f9958763.entry.js +0 -1
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
* Nothing in this file may output any CSS
|
|
5
5
|
* without being explicitly called by outside code.
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* Note! This file is exported to `dist/scss/` in the published
|
|
9
|
+
* node module, for consumer projects to import.
|
|
10
|
+
* That means this file cannot import from any file that isn't
|
|
11
|
+
* also exported, keeping the same relative path.
|
|
12
|
+
*
|
|
13
|
+
* Or, just don't import anything, that works too.
|
|
14
|
+
*/
|
|
7
15
|
/*
|
|
8
16
|
* This file is imported into every component that uses MDC!
|
|
9
17
|
*
|
|
@@ -103,8 +111,7 @@
|
|
|
103
111
|
width: 100%;
|
|
104
112
|
height: 100%;
|
|
105
113
|
top: 0;
|
|
106
|
-
/* @noflip */
|
|
107
|
-
/*rtl:ignore*/
|
|
114
|
+
/* @noflip */ /*rtl:ignore*/
|
|
108
115
|
left: 0;
|
|
109
116
|
}
|
|
110
117
|
.mdc-button::-moz-focus-inner {
|
|
@@ -122,11 +129,9 @@
|
|
|
122
129
|
pointer-events: none;
|
|
123
130
|
}
|
|
124
131
|
.mdc-button .mdc-button__icon {
|
|
125
|
-
/* @noflip */
|
|
126
|
-
/*rtl:ignore*/
|
|
132
|
+
/* @noflip */ /*rtl:ignore*/
|
|
127
133
|
margin-left: 0;
|
|
128
|
-
/* @noflip */
|
|
129
|
-
/*rtl:ignore*/
|
|
134
|
+
/* @noflip */ /*rtl:ignore*/
|
|
130
135
|
margin-right: 8px;
|
|
131
136
|
display: inline-block;
|
|
132
137
|
position: relative;
|
|
@@ -134,11 +139,9 @@
|
|
|
134
139
|
}
|
|
135
140
|
[dir=rtl] .mdc-button .mdc-button__icon, .mdc-button .mdc-button__icon[dir=rtl] {
|
|
136
141
|
/*rtl:begin:ignore*/
|
|
137
|
-
/* @noflip */
|
|
138
|
-
/*rtl:ignore*/
|
|
142
|
+
/* @noflip */ /*rtl:ignore*/
|
|
139
143
|
margin-left: 8px;
|
|
140
|
-
/* @noflip */
|
|
141
|
-
/*rtl:ignore*/
|
|
144
|
+
/* @noflip */ /*rtl:ignore*/
|
|
142
145
|
margin-right: 0;
|
|
143
146
|
/*rtl:end:ignore*/
|
|
144
147
|
}
|
|
@@ -156,20 +159,16 @@
|
|
|
156
159
|
}
|
|
157
160
|
|
|
158
161
|
.mdc-button__label + .mdc-button__icon {
|
|
159
|
-
/* @noflip */
|
|
160
|
-
/*rtl:ignore*/
|
|
162
|
+
/* @noflip */ /*rtl:ignore*/
|
|
161
163
|
margin-left: 8px;
|
|
162
|
-
/* @noflip */
|
|
163
|
-
/*rtl:ignore*/
|
|
164
|
+
/* @noflip */ /*rtl:ignore*/
|
|
164
165
|
margin-right: 0;
|
|
165
166
|
}
|
|
166
167
|
[dir=rtl] .mdc-button__label + .mdc-button__icon, .mdc-button__label + .mdc-button__icon[dir=rtl] {
|
|
167
168
|
/*rtl:begin:ignore*/
|
|
168
|
-
/* @noflip */
|
|
169
|
-
/*rtl:ignore*/
|
|
169
|
+
/* @noflip */ /*rtl:ignore*/
|
|
170
170
|
margin-left: 0;
|
|
171
|
-
/* @noflip */
|
|
172
|
-
/*rtl:ignore*/
|
|
171
|
+
/* @noflip */ /*rtl:ignore*/
|
|
173
172
|
margin-right: 8px;
|
|
174
173
|
/*rtl:end:ignore*/
|
|
175
174
|
}
|
|
@@ -290,16 +289,14 @@ svg.mdc-button__icon {
|
|
|
290
289
|
}
|
|
291
290
|
.mdc-button.mdc-ripple-upgraded .mdc-button__ripple::after {
|
|
292
291
|
top: 0;
|
|
293
|
-
/* @noflip */
|
|
294
|
-
/*rtl:ignore*/
|
|
292
|
+
/* @noflip */ /*rtl:ignore*/
|
|
295
293
|
left: 0;
|
|
296
294
|
transform: scale(0);
|
|
297
295
|
transform-origin: center center;
|
|
298
296
|
}
|
|
299
297
|
.mdc-button.mdc-ripple-upgraded--unbounded .mdc-button__ripple::after {
|
|
300
298
|
top: var(--mdc-ripple-top, 0);
|
|
301
|
-
/* @noflip */
|
|
302
|
-
/*rtl:ignore*/
|
|
299
|
+
/* @noflip */ /*rtl:ignore*/
|
|
303
300
|
left: var(--mdc-ripple-left, 0);
|
|
304
301
|
}
|
|
305
302
|
.mdc-button.mdc-ripple-upgraded--foreground-activation .mdc-button__ripple::after {
|
|
@@ -312,8 +309,7 @@ svg.mdc-button__icon {
|
|
|
312
309
|
.mdc-button .mdc-button__ripple::before,
|
|
313
310
|
.mdc-button .mdc-button__ripple::after {
|
|
314
311
|
top: calc(50% - 100%);
|
|
315
|
-
/* @noflip */
|
|
316
|
-
/*rtl:ignore*/
|
|
312
|
+
/* @noflip */ /*rtl:ignore*/
|
|
317
313
|
left: calc(50% - 100%);
|
|
318
314
|
width: 200%;
|
|
319
315
|
height: 200%;
|
|
@@ -740,20 +736,16 @@ svg.mdc-button__icon {
|
|
|
740
736
|
.mdc-button--raised .mdc-button__icon,
|
|
741
737
|
.mdc-button--unelevated .mdc-button__icon,
|
|
742
738
|
.mdc-button--outlined .mdc-button__icon {
|
|
743
|
-
/* @noflip */
|
|
744
|
-
/*rtl:ignore*/
|
|
739
|
+
/* @noflip */ /*rtl:ignore*/
|
|
745
740
|
margin-left: -4px;
|
|
746
|
-
/* @noflip */
|
|
747
|
-
/*rtl:ignore*/
|
|
741
|
+
/* @noflip */ /*rtl:ignore*/
|
|
748
742
|
margin-right: 8px;
|
|
749
743
|
}
|
|
750
744
|
[dir=rtl] .mdc-button--raised .mdc-button__icon, [dir=rtl] .mdc-button--unelevated .mdc-button__icon, [dir=rtl] .mdc-button--outlined .mdc-button__icon, .mdc-button--raised .mdc-button__icon[dir=rtl], .mdc-button--unelevated .mdc-button__icon[dir=rtl], .mdc-button--outlined .mdc-button__icon[dir=rtl] {
|
|
751
745
|
/*rtl:begin:ignore*/
|
|
752
|
-
/* @noflip */
|
|
753
|
-
/*rtl:ignore*/
|
|
746
|
+
/* @noflip */ /*rtl:ignore*/
|
|
754
747
|
margin-left: 8px;
|
|
755
|
-
/* @noflip */
|
|
756
|
-
/*rtl:ignore*/
|
|
748
|
+
/* @noflip */ /*rtl:ignore*/
|
|
757
749
|
margin-right: -4px;
|
|
758
750
|
/*rtl:end:ignore*/
|
|
759
751
|
}
|
|
@@ -761,20 +753,16 @@ svg.mdc-button__icon {
|
|
|
761
753
|
.mdc-button--raised .mdc-button__label + .mdc-button__icon,
|
|
762
754
|
.mdc-button--unelevated .mdc-button__label + .mdc-button__icon,
|
|
763
755
|
.mdc-button--outlined .mdc-button__label + .mdc-button__icon {
|
|
764
|
-
/* @noflip */
|
|
765
|
-
/*rtl:ignore*/
|
|
756
|
+
/* @noflip */ /*rtl:ignore*/
|
|
766
757
|
margin-left: 8px;
|
|
767
|
-
/* @noflip */
|
|
768
|
-
/*rtl:ignore*/
|
|
758
|
+
/* @noflip */ /*rtl:ignore*/
|
|
769
759
|
margin-right: -4px;
|
|
770
760
|
}
|
|
771
761
|
[dir=rtl] .mdc-button--raised .mdc-button__label + .mdc-button__icon, [dir=rtl] .mdc-button--unelevated .mdc-button__label + .mdc-button__icon, [dir=rtl] .mdc-button--outlined .mdc-button__label + .mdc-button__icon, .mdc-button--raised .mdc-button__label + .mdc-button__icon[dir=rtl], .mdc-button--unelevated .mdc-button__label + .mdc-button__icon[dir=rtl], .mdc-button--outlined .mdc-button__label + .mdc-button__icon[dir=rtl] {
|
|
772
762
|
/*rtl:begin:ignore*/
|
|
773
|
-
/* @noflip */
|
|
774
|
-
/*rtl:ignore*/
|
|
763
|
+
/* @noflip */ /*rtl:ignore*/
|
|
775
764
|
margin-left: -4px;
|
|
776
|
-
/* @noflip */
|
|
777
|
-
/*rtl:ignore*/
|
|
765
|
+
/* @noflip */ /*rtl:ignore*/
|
|
778
766
|
margin-right: 8px;
|
|
779
767
|
/*rtl:end:ignore*/
|
|
780
768
|
}
|
|
@@ -803,6 +791,7 @@ button.mdc-button {
|
|
|
803
791
|
}
|
|
804
792
|
button.mdc-button:not(:disabled) {
|
|
805
793
|
transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
794
|
+
cursor: pointer;
|
|
806
795
|
color: var(--mdc-theme-on-surface);
|
|
807
796
|
background-color: var(--lime-elevated-surface-background-color);
|
|
808
797
|
box-shadow: var(--button-shadow-normal);
|
|
@@ -954,7 +943,8 @@ button.just-failed {
|
|
|
954
943
|
}
|
|
955
944
|
:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-icon,
|
|
956
945
|
:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-spinner,
|
|
957
|
-
:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) svg
|
|
946
|
+
:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) svg,
|
|
947
|
+
:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) .mdc-button__icon {
|
|
958
948
|
transition: all 0.3s ease;
|
|
959
949
|
transition-delay: 0.3s;
|
|
960
950
|
opacity: 0;
|
|
@@ -64,6 +64,14 @@
|
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Note! This file is exported to `dist/scss/` in the published
|
|
69
|
+
* node module, for consumer projects to import.
|
|
70
|
+
* That means this file cannot import from any file that isn't
|
|
71
|
+
* also exported, keeping the same relative path.
|
|
72
|
+
*
|
|
73
|
+
* Or, just don't import anything, that works too.
|
|
74
|
+
*/
|
|
67
75
|
.mdc-touch-target-wrapper {
|
|
68
76
|
display: inline;
|
|
69
77
|
}
|
|
@@ -72,8 +80,7 @@
|
|
|
72
80
|
position: absolute;
|
|
73
81
|
top: 50%;
|
|
74
82
|
height: 48px;
|
|
75
|
-
/* @noflip */
|
|
76
|
-
/*rtl:ignore*/
|
|
83
|
+
/* @noflip */ /*rtl:ignore*/
|
|
77
84
|
left: 50%;
|
|
78
85
|
width: 48px;
|
|
79
86
|
transform: translate(-50%, -50%);
|
|
@@ -171,16 +178,14 @@
|
|
|
171
178
|
}
|
|
172
179
|
.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded .mdc-deprecated-chip-trailing-action__ripple::after {
|
|
173
180
|
top: 0;
|
|
174
|
-
/* @noflip */
|
|
175
|
-
/*rtl:ignore*/
|
|
181
|
+
/* @noflip */ /*rtl:ignore*/
|
|
176
182
|
left: 0;
|
|
177
183
|
transform: scale(0);
|
|
178
184
|
transform-origin: center center;
|
|
179
185
|
}
|
|
180
186
|
.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded--unbounded .mdc-deprecated-chip-trailing-action__ripple::after {
|
|
181
187
|
top: var(--mdc-ripple-top, 0);
|
|
182
|
-
/* @noflip */
|
|
183
|
-
/*rtl:ignore*/
|
|
188
|
+
/* @noflip */ /*rtl:ignore*/
|
|
184
189
|
left: var(--mdc-ripple-left, 0);
|
|
185
190
|
}
|
|
186
191
|
.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded--foreground-activation .mdc-deprecated-chip-trailing-action__ripple::after {
|
|
@@ -193,8 +198,7 @@
|
|
|
193
198
|
.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action__ripple::before,
|
|
194
199
|
.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action__ripple::after {
|
|
195
200
|
top: calc(50% - 50%);
|
|
196
|
-
/* @noflip */
|
|
197
|
-
/*rtl:ignore*/
|
|
201
|
+
/* @noflip */ /*rtl:ignore*/
|
|
198
202
|
left: calc(50% - 50%);
|
|
199
203
|
width: 100%;
|
|
200
204
|
height: 100%;
|
|
@@ -202,8 +206,7 @@
|
|
|
202
206
|
.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded .mdc-deprecated-chip-trailing-action__ripple::before,
|
|
203
207
|
.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded .mdc-deprecated-chip-trailing-action__ripple::after {
|
|
204
208
|
top: var(--mdc-ripple-top, calc(50% - 50%));
|
|
205
|
-
/* @noflip */
|
|
206
|
-
/*rtl:ignore*/
|
|
209
|
+
/* @noflip */ /*rtl:ignore*/
|
|
207
210
|
left: var(--mdc-ripple-left, calc(50% - 50%));
|
|
208
211
|
width: var(--mdc-ripple-fg-size, 100%);
|
|
209
212
|
height: var(--mdc-ripple-fg-size, 100%);
|
|
@@ -285,39 +288,31 @@
|
|
|
285
288
|
}
|
|
286
289
|
|
|
287
290
|
.mdc-deprecated-chip-trailing-action {
|
|
288
|
-
/* @noflip */
|
|
289
|
-
/*rtl:ignore*/
|
|
291
|
+
/* @noflip */ /*rtl:ignore*/
|
|
290
292
|
margin-left: 4px;
|
|
291
|
-
/* @noflip */
|
|
292
|
-
/*rtl:ignore*/
|
|
293
|
+
/* @noflip */ /*rtl:ignore*/
|
|
293
294
|
margin-right: -4px;
|
|
294
295
|
}
|
|
295
296
|
[dir=rtl] .mdc-deprecated-chip-trailing-action, .mdc-deprecated-chip-trailing-action[dir=rtl] {
|
|
296
297
|
/*rtl:begin:ignore*/
|
|
297
|
-
/* @noflip */
|
|
298
|
-
/*rtl:ignore*/
|
|
298
|
+
/* @noflip */ /*rtl:ignore*/
|
|
299
299
|
margin-left: -4px;
|
|
300
|
-
/* @noflip */
|
|
301
|
-
/*rtl:ignore*/
|
|
300
|
+
/* @noflip */ /*rtl:ignore*/
|
|
302
301
|
margin-right: 4px;
|
|
303
302
|
/*rtl:end:ignore*/
|
|
304
303
|
}
|
|
305
304
|
|
|
306
305
|
.mdc-chip__icon--trailing {
|
|
307
|
-
/* @noflip */
|
|
308
|
-
/*rtl:ignore*/
|
|
306
|
+
/* @noflip */ /*rtl:ignore*/
|
|
309
307
|
margin-left: 4px;
|
|
310
|
-
/* @noflip */
|
|
311
|
-
/*rtl:ignore*/
|
|
308
|
+
/* @noflip */ /*rtl:ignore*/
|
|
312
309
|
margin-right: -4px;
|
|
313
310
|
}
|
|
314
311
|
[dir=rtl] .mdc-chip__icon--trailing, .mdc-chip__icon--trailing[dir=rtl] {
|
|
315
312
|
/*rtl:begin:ignore*/
|
|
316
|
-
/* @noflip */
|
|
317
|
-
/*rtl:ignore*/
|
|
313
|
+
/* @noflip */ /*rtl:ignore*/
|
|
318
314
|
margin-left: -4px;
|
|
319
|
-
/* @noflip */
|
|
320
|
-
/*rtl:ignore*/
|
|
315
|
+
/* @noflip */ /*rtl:ignore*/
|
|
321
316
|
margin-right: 4px;
|
|
322
317
|
/*rtl:end:ignore*/
|
|
323
318
|
}
|
|
@@ -382,20 +377,16 @@
|
|
|
382
377
|
}
|
|
383
378
|
.mdc-chip.mdc-chip--selected .mdc-chip__checkmark,
|
|
384
379
|
.mdc-chip .mdc-chip__icon--leading:not(.mdc-chip__icon--leading-hidden) {
|
|
385
|
-
/* @noflip */
|
|
386
|
-
/*rtl:ignore*/
|
|
380
|
+
/* @noflip */ /*rtl:ignore*/
|
|
387
381
|
margin-left: -4px;
|
|
388
|
-
/* @noflip */
|
|
389
|
-
/*rtl:ignore*/
|
|
382
|
+
/* @noflip */ /*rtl:ignore*/
|
|
390
383
|
margin-right: 4px;
|
|
391
384
|
}
|
|
392
385
|
[dir=rtl] .mdc-chip.mdc-chip--selected .mdc-chip__checkmark, [dir=rtl] .mdc-chip .mdc-chip__icon--leading:not(.mdc-chip__icon--leading-hidden), .mdc-chip.mdc-chip--selected .mdc-chip__checkmark[dir=rtl], .mdc-chip .mdc-chip__icon--leading:not(.mdc-chip__icon--leading-hidden)[dir=rtl] {
|
|
393
386
|
/*rtl:begin:ignore*/
|
|
394
|
-
/* @noflip */
|
|
395
|
-
/*rtl:ignore*/
|
|
387
|
+
/* @noflip */ /*rtl:ignore*/
|
|
396
388
|
margin-left: 4px;
|
|
397
|
-
/* @noflip */
|
|
398
|
-
/*rtl:ignore*/
|
|
389
|
+
/* @noflip */ /*rtl:ignore*/
|
|
399
390
|
margin-right: -4px;
|
|
400
391
|
/*rtl:end:ignore*/
|
|
401
392
|
}
|
|
@@ -404,8 +395,7 @@
|
|
|
404
395
|
width: 100%;
|
|
405
396
|
height: 100%;
|
|
406
397
|
top: 0;
|
|
407
|
-
/* @noflip */
|
|
408
|
-
/*rtl:ignore*/
|
|
398
|
+
/* @noflip */ /*rtl:ignore*/
|
|
409
399
|
left: 0;
|
|
410
400
|
}
|
|
411
401
|
.mdc-chip::-moz-focus-inner {
|
|
@@ -566,16 +556,14 @@
|
|
|
566
556
|
}
|
|
567
557
|
.mdc-chip.mdc-ripple-upgraded .mdc-chip__ripple::after {
|
|
568
558
|
top: 0;
|
|
569
|
-
/* @noflip */
|
|
570
|
-
/*rtl:ignore*/
|
|
559
|
+
/* @noflip */ /*rtl:ignore*/
|
|
571
560
|
left: 0;
|
|
572
561
|
transform: scale(0);
|
|
573
562
|
transform-origin: center center;
|
|
574
563
|
}
|
|
575
564
|
.mdc-chip.mdc-ripple-upgraded--unbounded .mdc-chip__ripple::after {
|
|
576
565
|
top: var(--mdc-ripple-top, 0);
|
|
577
|
-
/* @noflip */
|
|
578
|
-
/*rtl:ignore*/
|
|
566
|
+
/* @noflip */ /*rtl:ignore*/
|
|
579
567
|
left: var(--mdc-ripple-left, 0);
|
|
580
568
|
}
|
|
581
569
|
.mdc-chip.mdc-ripple-upgraded--foreground-activation .mdc-chip__ripple::after {
|
|
@@ -588,8 +576,7 @@
|
|
|
588
576
|
.mdc-chip .mdc-chip__ripple::before,
|
|
589
577
|
.mdc-chip .mdc-chip__ripple::after {
|
|
590
578
|
top: calc(50% - 100%);
|
|
591
|
-
/* @noflip */
|
|
592
|
-
/*rtl:ignore*/
|
|
579
|
+
/* @noflip */ /*rtl:ignore*/
|
|
593
580
|
left: calc(50% - 100%);
|
|
594
581
|
width: 200%;
|
|
595
582
|
height: 200%;
|
|
@@ -703,6 +690,7 @@
|
|
|
703
690
|
*/
|
|
704
691
|
.mdc-chip {
|
|
705
692
|
transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
693
|
+
cursor: pointer;
|
|
706
694
|
color: var(--mdc-theme-on-surface);
|
|
707
695
|
background-color: transparent;
|
|
708
696
|
max-width: 100%;
|
|
@@ -740,6 +728,11 @@
|
|
|
740
728
|
.mdc-chip label {
|
|
741
729
|
cursor: pointer;
|
|
742
730
|
transition: color 0.2s ease;
|
|
731
|
+
display: flex;
|
|
732
|
+
align-items: center;
|
|
733
|
+
}
|
|
734
|
+
.mdc-chip label:has(> limel-badge) .mdc-chip__text {
|
|
735
|
+
padding-right: 0.25rem;
|
|
743
736
|
}
|
|
744
737
|
.mdc-chip input[type=radio] {
|
|
745
738
|
width: 0;
|
|
@@ -800,4 +793,13 @@
|
|
|
800
793
|
cursor: not-allowed;
|
|
801
794
|
pointer-events: none;
|
|
802
795
|
opacity: 0.4;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
limel-badge {
|
|
799
|
+
margin-right: 0.25rem;
|
|
800
|
+
pointer-events: none;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.mdc-chip:not(.mdc-chip--selected) {
|
|
804
|
+
--badge-background-color: rgb(var(--contrast-200));
|
|
803
805
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
1
|
+
import { h, } from '@stencil/core';
|
|
2
2
|
import { createRandomString } from '../../util/random-string';
|
|
3
3
|
/**
|
|
4
4
|
* A button group control is a linear set of two or more buttons.
|
|
@@ -33,11 +33,18 @@ import { createRandomString } from '../../util/random-string';
|
|
|
33
33
|
* @exampleComponent limel-example-button-group-icons
|
|
34
34
|
* @exampleComponent limel-example-button-group
|
|
35
35
|
* @exampleComponent limel-example-button-group-mix
|
|
36
|
+
* @exampleComponent limel-example-button-group-badges
|
|
36
37
|
* @exampleComponent limel-example-button-group-composite
|
|
37
38
|
*/
|
|
38
39
|
export class ButtonGroup {
|
|
39
40
|
constructor() {
|
|
40
41
|
this.radioGroupName = createRandomString();
|
|
42
|
+
this.setSelectedButton = () => {
|
|
43
|
+
var _a;
|
|
44
|
+
this.selectedButtonId = (_a = this.value.find((button) => {
|
|
45
|
+
return button.selected;
|
|
46
|
+
})) === null || _a === void 0 ? void 0 : _a.id;
|
|
47
|
+
};
|
|
41
48
|
this.value = [];
|
|
42
49
|
this.disabled = false;
|
|
43
50
|
this.selectedButtonId = undefined;
|
|
@@ -46,10 +53,7 @@ export class ButtonGroup {
|
|
|
46
53
|
this.renderContent = this.renderContent.bind(this);
|
|
47
54
|
}
|
|
48
55
|
componentWillLoad() {
|
|
49
|
-
|
|
50
|
-
this.selectedButtonId = (_a = this.value.find((button) => {
|
|
51
|
-
return button.selected;
|
|
52
|
-
})) === null || _a === void 0 ? void 0 : _a.id;
|
|
56
|
+
this.setSelectedButton();
|
|
53
57
|
}
|
|
54
58
|
render() {
|
|
55
59
|
const classes = {
|
|
@@ -67,7 +71,7 @@ export class ButtonGroup {
|
|
|
67
71
|
'mdc-chip': true,
|
|
68
72
|
'mdc-chip--selected': this.isButtonChecked(button),
|
|
69
73
|
};
|
|
70
|
-
return (h("div", { class: classes, role: "row" }, h("span", { role: "gridcell" }, h("input", { type: "radio", name: this.radioGroupName, checked: this.isButtonChecked(button), id: buttonId, onChange: this.onChange }), h("label", { htmlFor: buttonId }, this.renderContent(button)))));
|
|
74
|
+
return (h("div", { class: classes, role: "row" }, h("span", { role: "gridcell" }, h("input", { type: "radio", name: this.radioGroupName, checked: this.isButtonChecked(button), id: buttonId, onChange: this.onChange }), h("label", { htmlFor: buttonId }, this.renderContent(button), this.renderBadge(button)))));
|
|
71
75
|
}
|
|
72
76
|
renderContent(button) {
|
|
73
77
|
if (button.icon) {
|
|
@@ -90,6 +94,12 @@ export class ButtonGroup {
|
|
|
90
94
|
h("limel-tooltip", { elementId: iconId, label: button.title }),
|
|
91
95
|
];
|
|
92
96
|
}
|
|
97
|
+
renderBadge(button) {
|
|
98
|
+
if (!button.badge) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
return h("limel-badge", { label: button.badge });
|
|
102
|
+
}
|
|
93
103
|
onChange(event) {
|
|
94
104
|
event.stopPropagation();
|
|
95
105
|
const target = event.target;
|
|
@@ -100,6 +110,9 @@ export class ButtonGroup {
|
|
|
100
110
|
});
|
|
101
111
|
this.change.emit(button);
|
|
102
112
|
}
|
|
113
|
+
valueChanged() {
|
|
114
|
+
this.setSelectedButton();
|
|
115
|
+
}
|
|
103
116
|
static get is() { return "limel-button-group"; }
|
|
104
117
|
static get encapsulation() { return "shadow"; }
|
|
105
118
|
static get originalStyleUrls() {
|
|
@@ -183,4 +196,10 @@ export class ButtonGroup {
|
|
|
183
196
|
}
|
|
184
197
|
}];
|
|
185
198
|
}
|
|
199
|
+
static get watchers() {
|
|
200
|
+
return [{
|
|
201
|
+
"propName": "value",
|
|
202
|
+
"methodName": "valueChanged"
|
|
203
|
+
}];
|
|
204
|
+
}
|
|
186
205
|
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @prop --callout-text-color: Text color of the component. Defaults to `--contrast-1100`.
|
|
3
|
+
* @prop --callout-background-color: Background color of the component. Defaults to `--contrast-300`.
|
|
4
|
+
* @prop --callout-color: Color used in the UI to add more contextual meaning about the type of the information. This color is different based on the chosen `type`, but you can override it using this prop.
|
|
5
|
+
*/
|
|
6
|
+
:host(limel-callout) {
|
|
7
|
+
display: flex;
|
|
8
|
+
border-radius: 0.5rem;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
color: var(--callout-text-color, rgb(var(--contrast-1100)));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host([type=note]) {
|
|
14
|
+
--limel-callout-tint-color: var(
|
|
15
|
+
--callout-color,
|
|
16
|
+
rgb(var(--color-gray-default))
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([type=important]) {
|
|
21
|
+
--limel-callout-tint-color: var(
|
|
22
|
+
--callout-color,
|
|
23
|
+
rgb(var(--color-sky-default))
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host([type=tip]) {
|
|
28
|
+
--limel-callout-tint-color: var(
|
|
29
|
+
--callout-color,
|
|
30
|
+
rgb(var(--color-green-default))
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([type=caution]) {
|
|
35
|
+
--limel-callout-tint-color: var(
|
|
36
|
+
--callout-color,
|
|
37
|
+
rgb(var(--color-orange-light))
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([type=warning]) {
|
|
42
|
+
--limel-callout-tint-color: var(
|
|
43
|
+
--callout-color,
|
|
44
|
+
rgb(var(--color-red-dark))
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.side {
|
|
49
|
+
padding: 0.25rem;
|
|
50
|
+
position: relative;
|
|
51
|
+
}
|
|
52
|
+
.side:before {
|
|
53
|
+
content: "";
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
opacity: 0.2;
|
|
57
|
+
background-color: var(--limel-callout-tint-color);
|
|
58
|
+
}
|
|
59
|
+
.side limel-icon {
|
|
60
|
+
width: 1.5rem;
|
|
61
|
+
color: var(--limel-callout-tint-color);
|
|
62
|
+
margin-top: 0.0625rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.main {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex: 1;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
gap: 0.5rem;
|
|
70
|
+
padding: 0.25rem 0.5rem 0.5rem 0.5rem;
|
|
71
|
+
background-color: var(--callout-background-color, rgb(var(--contrast-300)));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.heading {
|
|
75
|
+
margin: 0;
|
|
76
|
+
font-size: 1rem;
|
|
77
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import translate from '../../global/translations';
|
|
2
|
+
const calloutIcons = {
|
|
3
|
+
note: 'info',
|
|
4
|
+
important: 'exclamation_mark',
|
|
5
|
+
tip: 'idea',
|
|
6
|
+
caution: 'high_priority',
|
|
7
|
+
warning: 'error',
|
|
8
|
+
};
|
|
9
|
+
export function getIcon(icon, type = 'note') {
|
|
10
|
+
var _a;
|
|
11
|
+
if (icon) {
|
|
12
|
+
return icon;
|
|
13
|
+
}
|
|
14
|
+
return (_a = calloutIcons[type]) !== null && _a !== void 0 ? _a : calloutIcons.note;
|
|
15
|
+
}
|
|
16
|
+
export function getHeading(heading, type = 'note', language = 'en') {
|
|
17
|
+
if (heading) {
|
|
18
|
+
return heading;
|
|
19
|
+
}
|
|
20
|
+
const key = `callout.${type}`;
|
|
21
|
+
try {
|
|
22
|
+
return translate.get(key, language);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
return translate.get(key, 'en');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { getHeading, getIcon } from './callout.helpers';
|
|
3
|
+
/**
|
|
4
|
+
* Callouts—also known as Admonitions—are useful for including supportive or
|
|
5
|
+
* special content within a large piece of text, or even inside a user
|
|
6
|
+
* interface.
|
|
7
|
+
*
|
|
8
|
+
* When used in a document or text based user interface, the callout attracts
|
|
9
|
+
* the reader's attention to a particular piece of information, without
|
|
10
|
+
* significantly interrupting their flow of reading the document.
|
|
11
|
+
*
|
|
12
|
+
* In a user interface, a callout is more intrusive to the end-user. Still, it
|
|
13
|
+
* could be a good choice when you intend to slightly disturb the user's
|
|
14
|
+
* attention, and challenge them to pay extra attention to the information
|
|
15
|
+
* presented. In such cases, a callout should not be used as a static and
|
|
16
|
+
* constantly present element of the UI. Rather, it should be displayed when
|
|
17
|
+
* something unusual or remarkable demands the user's attention.
|
|
18
|
+
*
|
|
19
|
+
* @exampleComponent limel-example-callout-note
|
|
20
|
+
* @exampleComponent limel-example-callout-important
|
|
21
|
+
* @exampleComponent limel-example-callout-tip
|
|
22
|
+
* @exampleComponent limel-example-callout-caution
|
|
23
|
+
* @exampleComponent limel-example-callout-warning
|
|
24
|
+
* @exampleComponent limel-example-callout-rich-content
|
|
25
|
+
* @exampleComponent limel-example-callout-custom-heading
|
|
26
|
+
* @exampleComponent limel-example-callout-custom-icon
|
|
27
|
+
* @exampleComponent limel-example-callout-styles
|
|
28
|
+
* @exampleComponent limel-example-callout-composite
|
|
29
|
+
*/
|
|
30
|
+
export class Callout {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.heading = undefined;
|
|
33
|
+
this.icon = undefined;
|
|
34
|
+
this.type = 'note';
|
|
35
|
+
this.language = 'en';
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
return [
|
|
39
|
+
h("div", { class: "side", role: "presentation" }, h("limel-icon", { name: getIcon(this.icon, this.type) })),
|
|
40
|
+
h("div", { class: "main" }, h("h1", { class: "heading" }, getHeading(this.heading, this.type, this.language)), h("slot", null)),
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
static get is() { return "limel-callout"; }
|
|
44
|
+
static get encapsulation() { return "shadow"; }
|
|
45
|
+
static get originalStyleUrls() {
|
|
46
|
+
return {
|
|
47
|
+
"$": ["callout.scss"]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
static get styleUrls() {
|
|
51
|
+
return {
|
|
52
|
+
"$": ["callout.css"]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
static get properties() {
|
|
56
|
+
return {
|
|
57
|
+
"heading": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"mutable": false,
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "string",
|
|
62
|
+
"resolved": "string",
|
|
63
|
+
"references": {}
|
|
64
|
+
},
|
|
65
|
+
"required": false,
|
|
66
|
+
"optional": true,
|
|
67
|
+
"docs": {
|
|
68
|
+
"tags": [],
|
|
69
|
+
"text": "Heading of the callout, which can be used to override the\ndefault heading which is displayed based on the chosen `type`."
|
|
70
|
+
},
|
|
71
|
+
"attribute": "heading",
|
|
72
|
+
"reflect": true
|
|
73
|
+
},
|
|
74
|
+
"icon": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "string",
|
|
79
|
+
"resolved": "string",
|
|
80
|
+
"references": {}
|
|
81
|
+
},
|
|
82
|
+
"required": false,
|
|
83
|
+
"optional": true,
|
|
84
|
+
"docs": {
|
|
85
|
+
"tags": [],
|
|
86
|
+
"text": "Icon of the callout, which can be used to override the\ndefault icon which is displayed based on the chosen `type`."
|
|
87
|
+
},
|
|
88
|
+
"attribute": "icon",
|
|
89
|
+
"reflect": true
|
|
90
|
+
},
|
|
91
|
+
"type": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"mutable": false,
|
|
94
|
+
"complexType": {
|
|
95
|
+
"original": "CalloutType",
|
|
96
|
+
"resolved": "\"caution\" | \"important\" | \"note\" | \"tip\" | \"warning\"",
|
|
97
|
+
"references": {
|
|
98
|
+
"CalloutType": {
|
|
99
|
+
"location": "import",
|
|
100
|
+
"path": "./callout.types"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": true,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": "Defines how the component is visualized, for example\nwhich heading, color or icon is used in its user interface."
|
|
109
|
+
},
|
|
110
|
+
"attribute": "type",
|
|
111
|
+
"reflect": true,
|
|
112
|
+
"defaultValue": "'note'"
|
|
113
|
+
},
|
|
114
|
+
"language": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"mutable": false,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "Languages",
|
|
119
|
+
"resolved": "\"da\" | \"de\" | \"en\" | \"fi\" | \"fr\" | \"nb\" | \"nl\" | \"no\" | \"sv\"",
|
|
120
|
+
"references": {
|
|
121
|
+
"Languages": {
|
|
122
|
+
"location": "import",
|
|
123
|
+
"path": "@limetech/lime-elements"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"required": false,
|
|
128
|
+
"optional": false,
|
|
129
|
+
"docs": {
|
|
130
|
+
"tags": [],
|
|
131
|
+
"text": "Defines the language for translations.\nWill translate the default headings for supported languages."
|
|
132
|
+
},
|
|
133
|
+
"attribute": "language",
|
|
134
|
+
"reflect": false,
|
|
135
|
+
"defaultValue": "'en'"
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|