@limetech/lime-elements 37.1.0-next.79 → 37.1.0-next.80
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/CHANGELOG.md +10 -0
- package/README.md +57 -5
- package/dist/cjs/limel-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-button.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +1 -1
- package/dist/cjs/limel-select.cjs.entry.js.map +1 -1
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +3 -0
- package/dist/collection/components/badge/badge.css +3 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.css +3 -0
- package/dist/collection/components/button/button.css +8 -0
- package/dist/collection/components/button-group/button-group.css +3 -0
- package/dist/collection/components/checkbox/checkbox.css +3 -0
- package/dist/collection/components/chip-set/chip-set.css +6 -0
- package/dist/collection/components/circular-progress/circular-progress.css +3 -0
- package/dist/collection/components/code-editor/code-editor.css +3 -0
- package/dist/collection/components/collapsible-section/collapsible-section.css +3 -0
- package/dist/collection/components/color-picker/color-picker-palette.css +6 -0
- package/dist/collection/components/color-picker/color-picker.css +3 -0
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +3 -0
- package/dist/collection/components/dialog/dialog.css +3 -0
- package/dist/collection/components/dock/dock-button/dock-button.css +3 -0
- package/dist/collection/components/dock/dock.css +3 -0
- package/dist/collection/components/file-viewer/file-viewer.css +3 -0
- package/dist/collection/components/form/form.css +3 -0
- package/dist/collection/components/header/header.css +3 -0
- package/dist/collection/components/help/help.css +3 -0
- package/dist/collection/components/help/limel-help-content.css +3 -0
- package/dist/collection/components/icon/icon.js +13 -38
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/icon-button/icon-button.css +8 -0
- package/dist/collection/components/info-tile/info-tile.css +3 -0
- package/dist/collection/components/input-field/input-field.css +3 -0
- package/dist/collection/components/list/list.css +12 -0
- package/dist/collection/components/menu-list/menu-list.css +12 -0
- package/dist/collection/components/popover-surface/popover-surface.css +3 -0
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +3 -0
- package/dist/collection/components/select/select.css +9 -0
- package/dist/collection/components/shortcut/shortcut.css +3 -0
- package/dist/collection/components/slider/slider.css +3 -0
- package/dist/collection/components/split-button/split-button.css +3 -0
- package/dist/collection/components/switch/switch.css +3 -0
- package/dist/collection/components/table/table.css +12 -0
- package/dist/collection/style/mixins.scss +13 -0
- package/dist/esm/limel-button.entry.js +1 -1
- package/dist/esm/limel-button.entry.js.map +1 -1
- package/dist/esm/limel-icon-button.entry.js +1 -1
- package/dist/esm/limel-icon-button.entry.js.map +1 -1
- package/dist/esm/limel-icon.entry.js.map +1 -1
- package/dist/esm/limel-info-tile.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js.map +1 -1
- package/dist/esm/limel-select.entry.js +1 -1
- package/dist/esm/limel-select.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-5c987e04.entry.js +2 -0
- package/dist/lime-elements/p-5c987e04.entry.js.map +1 -0
- package/dist/lime-elements/p-9a45ad26.entry.js.map +1 -1
- package/dist/lime-elements/p-aa40cef5.entry.js +2 -0
- package/dist/lime-elements/p-aa40cef5.entry.js.map +1 -0
- package/dist/lime-elements/{p-b6e7bdac.entry.js → p-d6135363.entry.js} +2 -2
- package/dist/lime-elements/{p-b6e7bdac.entry.js.map → p-d6135363.entry.js.map} +1 -1
- package/dist/lime-elements/p-de0d78b6.entry.js +2 -0
- package/dist/lime-elements/{p-46cc02dc.entry.js.map → p-de0d78b6.entry.js.map} +1 -1
- package/dist/lime-elements/style/mixins.scss +13 -0
- package/dist/scss/mixins.scss +13 -0
- package/dist/types/components/icon/icon.d.ts +13 -38
- package/dist/types/components.d.ts +44 -124
- package/package.json +1 -1
- package/dist/lime-elements/p-46cc02dc.entry.js +0 -2
- package/dist/lime-elements/p-95bc3de9.entry.js +0 -2
- package/dist/lime-elements/p-95bc3de9.entry.js.map +0 -1
- package/dist/lime-elements/p-d2e8c721.entry.js +0 -2
- package/dist/lime-elements/p-d2e8c721.entry.js.map +0 -1
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
*
|
|
74
74
|
* Or, just don't import anything, that works too.
|
|
75
75
|
*/
|
|
76
|
+
/**
|
|
77
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
78
|
+
*/
|
|
76
79
|
/**
|
|
77
80
|
* This mixin will mask out the content that is close to
|
|
78
81
|
* the edges of a scrollable area.
|
|
@@ -591,6 +591,9 @@
|
|
|
591
591
|
*
|
|
592
592
|
* Or, just don't import anything, that works too.
|
|
593
593
|
*/
|
|
594
|
+
/**
|
|
595
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
596
|
+
*/
|
|
594
597
|
/**
|
|
595
598
|
* This mixin will mask out the content that is close to
|
|
596
599
|
* the edges of a scrollable area.
|
|
@@ -631,6 +634,9 @@
|
|
|
631
634
|
*
|
|
632
635
|
* Or, just don't import anything, that works too.
|
|
633
636
|
*/
|
|
637
|
+
/**
|
|
638
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
639
|
+
*/
|
|
634
640
|
/**
|
|
635
641
|
* This mixin will mask out the content that is close to
|
|
636
642
|
* the edges of a scrollable area.
|
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
*
|
|
74
74
|
* Or, just don't import anything, that works too.
|
|
75
75
|
*/
|
|
76
|
+
/**
|
|
77
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
78
|
+
*/
|
|
76
79
|
/**
|
|
77
80
|
* This mixin will mask out the content that is close to
|
|
78
81
|
* the edges of a scrollable area.
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Or, just don't import anything, that works too.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
18
|
+
*/
|
|
16
19
|
/**
|
|
17
20
|
* This mixin will mask out the content that is close to
|
|
18
21
|
* the edges of a scrollable area.
|
|
@@ -79,6 +79,9 @@
|
|
|
79
79
|
*
|
|
80
80
|
* Or, just don't import anything, that works too.
|
|
81
81
|
*/
|
|
82
|
+
/**
|
|
83
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
84
|
+
*/
|
|
82
85
|
/**
|
|
83
86
|
* This mixin will mask out the content that is close to
|
|
84
87
|
* the edges of a scrollable area.
|
|
@@ -644,6 +644,9 @@ limel-code-editor {
|
|
|
644
644
|
*
|
|
645
645
|
* Or, just don't import anything, that works too.
|
|
646
646
|
*/
|
|
647
|
+
/**
|
|
648
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
649
|
+
*/
|
|
647
650
|
/**
|
|
648
651
|
* This mixin will mask out the content that is close to
|
|
649
652
|
* the edges of a scrollable area.
|
|
@@ -2,55 +2,30 @@ import { h } from '@stencil/core';
|
|
|
2
2
|
import config from '../../global/config';
|
|
3
3
|
import iconCache from '../../global/icon-cache/factory';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* relevant Lime products. If you are using Lime Elements in a non-Lime product,
|
|
8
|
-
* you will have to supply your own icons.
|
|
9
|
-
*
|
|
10
|
-
* The size and color of the icon is set in CSS, however there are a few
|
|
11
|
-
* standard sizes defined that can be used with the `size` property.
|
|
12
|
-
*
|
|
13
|
-
* ### Setup
|
|
14
|
-
* To use **@lundalogik/lime-icons8**, the `/assets` folder from
|
|
15
|
-
* __@lundalogik/lime-icons8__ must be made available on the webserver.
|
|
16
|
-
* To use a different icon set, the icons must be placed in a folder structure
|
|
17
|
-
* that looks like this: `assets/icons/<name-of-icon>.svg`
|
|
18
|
-
*
|
|
19
|
-
* If `assets` is placed in the root, no other setup is needed. The icons will
|
|
20
|
-
* be fetched with a relative URL from `/assets/icons/<name-of-icon>.svg`.
|
|
5
|
+
* Search for an icon and **click on it to copy its name to clipboard**.
|
|
6
|
+
* <limel-example-icon-finder />
|
|
21
7
|
*
|
|
22
|
-
*
|
|
23
|
-
* icons available is to use the HTML `base` element:
|
|
8
|
+
* *******
|
|
24
9
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
10
|
+
* :::important
|
|
11
|
+
* To install your icon set correctly, please read the [documentation here](#/).
|
|
12
|
+
* :::
|
|
28
13
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* element:
|
|
32
|
-
* ```
|
|
33
|
-
* <limel-config config={{iconPath: '/my/parent/path/'}} />
|
|
34
|
-
* ```
|
|
14
|
+
* The size and color of the icon is normally set in CSS, however there are a few
|
|
15
|
+
* standard sizes defined that can be used with the `size` property.
|
|
35
16
|
*
|
|
36
|
-
*
|
|
37
|
-
* There are icons included in the
|
|
17
|
+
* :::note
|
|
18
|
+
* There are icons included in the `@lundalogik/lime-icons8` package which are
|
|
38
19
|
* designed by our designers at Lime.
|
|
39
20
|
* The names of these icons start with `-lime-`, which makes them easy to
|
|
40
21
|
* find using the Icon Finder tool below.
|
|
41
|
-
*
|
|
42
|
-
* Some of the `-lime-` icons
|
|
43
|
-
* instead of HEX or RGB values to visualize their colors. Thus, you must import
|
|
22
|
+
*
|
|
23
|
+
* Some of the multi-colored `-lime-` icons use our own CSS variables
|
|
24
|
+
* (instead of HEX or RGB) values to visualize their colors. Thus, you must import
|
|
44
25
|
* our color palette css files into your project to render the icons properly.
|
|
45
26
|
* Read more about our [Color System](#/DesignGuidelines/color-system.md/)
|
|
46
27
|
* and how to do this.
|
|
47
28
|
* :::
|
|
48
|
-
*
|
|
49
|
-
* ### Icon Finder
|
|
50
|
-
*
|
|
51
|
-
* Search for an icon and **click on it to copy its name to clipboard**.
|
|
52
|
-
*
|
|
53
|
-
* <limel-example-icon-finder />
|
|
54
29
|
* @exampleComponent limel-example-icon
|
|
55
30
|
* @exampleComponent limel-example-icon-background
|
|
56
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,SAAS,MAAM,iCAAiC,CAAC;AAGxD
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,SAAS,MAAM,iCAAiC,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,MAAM,OAAO,IAAI;;;;;;EAuBN,gBAAgB;IACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAC7B,CAAC;EAEM,MAAM;IACT,OAAO,WAAK,KAAK,EAAC,WAAW,GAAG,CAAC;EACrC,CAAC;EAGS,KAAK,CAAC,QAAQ,CAAC,IAAY;IACjC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,EAAE;MACnC,OAAO;KACV;IAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;EAC5B,CAAC;EAED;;;;KAIG;EACK,OAAO,CAAC,IAAY;IACxB,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;EAChD,CAAC;EAED;;;;;KAKG;EACK,SAAS,CAAC,OAAe;IAC7B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IACtE,IAAI,SAAS,EAAE;MACX,SAAS,CAAC,SAAS,GAAG,OAAO,CAAC;KACjC;EACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Element, h, Prop, Watch } from '@stencil/core';\nimport config from '../../global/config';\nimport iconCache from '../../global/icon-cache/factory';\nimport { IconSize } from '../../interface';\n\n/**\n * Search for an icon and **click on it to copy its name to clipboard**.\n * <limel-example-icon-finder />\n *\n * *******\n *\n * :::important\n * To install your icon set correctly, please read the [documentation here](#/).\n * :::\n *\n * The size and color of the icon is normally set in CSS, however there are a few\n * standard sizes defined that can be used with the `size` property.\n *\n * :::note\n * There are icons included in the `@lundalogik/lime-icons8` package which are\n * designed by our designers at Lime.\n * The names of these icons start with `-lime-`, which makes them easy to\n * find using the Icon Finder tool below.\n *\n * Some of the multi-colored `-lime-` icons use our own CSS variables\n * (instead of HEX or RGB) values to visualize their colors. Thus, you must import\n * our color palette css files into your project to render the icons properly.\n * Read more about our [Color System](#/DesignGuidelines/color-system.md/)\n * and how to do this.\n * :::\n * @exampleComponent limel-example-icon\n * @exampleComponent limel-example-icon-background\n */\n@Component({\n tag: 'limel-icon',\n shadow: true,\n styleUrl: 'icon.scss',\n})\nexport class Icon {\n /**\n * Size of the icon\n */\n @Prop({ reflect: true })\n public size: IconSize;\n\n /**\n * Name of the icon\n */\n @Prop({ reflect: true })\n public name: string;\n\n /**\n * Set to `true` to give the icon a round background with some padding.\n * Only works when the `size` attribute is also set.\n */\n @Prop({ reflect: true })\n public badge: boolean;\n\n @Element()\n private host: HTMLLimelIconElement;\n\n public componentDidLoad() {\n this.loadIcon(this.name);\n }\n\n public render() {\n return <div class=\"container\" />;\n }\n\n @Watch('name')\n protected async loadIcon(name: string) {\n if (name === undefined || name === '') {\n return;\n }\n\n const svgData = await this.loadSvg(name);\n this.renderSvg(svgData);\n }\n\n /**\n * Load the SVG data for the icon from the icon cache\n * @param {string} name name of the icon\n * @returns {string} the icon SVG data\n */\n private loadSvg(name: string) {\n return iconCache.get(name, config.iconPath);\n }\n\n /*\n * There is no way to style external SVG files with CSS, i.e. SVGs loaded\n * with <img src=\"file.svg\" /> or <object data=\"file.svg\" type=\"image/svg+xml\" />\n * will remain the way they look in the file.\n * Therefore we inject the svg as inline markup instead.\n */\n private renderSvg(svgData: string) {\n const container = this.host.shadowRoot.querySelector('div.container');\n if (container) {\n container.innerHTML = svgData;\n }\n }\n}\n"]}
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Or, just don't import anything, that works too.
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* This mixin will mask out the content that is close to
|
|
12
15
|
* the edges of a scrollable area.
|
|
@@ -50,6 +53,11 @@
|
|
|
50
53
|
pointer-events: none;
|
|
51
54
|
}
|
|
52
55
|
|
|
56
|
+
:host([aria-expanded=true]) button,
|
|
57
|
+
:host([aria-expanded]:not([aria-expanded=false])) button {
|
|
58
|
+
box-shadow: var(--button-shadow-inset-pressed) !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
53
61
|
button {
|
|
54
62
|
all: unset;
|
|
55
63
|
transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
*
|
|
74
74
|
* Or, just don't import anything, that works too.
|
|
75
75
|
*/
|
|
76
|
+
/**
|
|
77
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
78
|
+
*/
|
|
76
79
|
/**
|
|
77
80
|
* This mixin will mask out the content that is close to
|
|
78
81
|
* the edges of a scrollable area.
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Or, just don't import anything, that works too.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
18
|
+
*/
|
|
16
19
|
/**
|
|
17
20
|
* This mixin will mask out the content that is close to
|
|
18
21
|
* the edges of a scrollable area.
|
|
@@ -863,6 +866,9 @@
|
|
|
863
866
|
*
|
|
864
867
|
* Or, just don't import anything, that works too.
|
|
865
868
|
*/
|
|
869
|
+
/**
|
|
870
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
871
|
+
*/
|
|
866
872
|
/**
|
|
867
873
|
* This mixin will mask out the content that is close to
|
|
868
874
|
* the edges of a scrollable area.
|
|
@@ -5318,6 +5324,9 @@ a.mdc-list-item {
|
|
|
5318
5324
|
*
|
|
5319
5325
|
* Or, just don't import anything, that works too.
|
|
5320
5326
|
*/
|
|
5327
|
+
/**
|
|
5328
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
5329
|
+
*/
|
|
5321
5330
|
/**
|
|
5322
5331
|
* This mixin will mask out the content that is close to
|
|
5323
5332
|
* the edges of a scrollable area.
|
|
@@ -5840,6 +5849,9 @@ a.mdc-list-item {
|
|
|
5840
5849
|
*
|
|
5841
5850
|
* Or, just don't import anything, that works too.
|
|
5842
5851
|
*/
|
|
5852
|
+
/**
|
|
5853
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
5854
|
+
*/
|
|
5843
5855
|
/**
|
|
5844
5856
|
* This mixin will mask out the content that is close to
|
|
5845
5857
|
* the edges of a scrollable area.
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
*
|
|
20
20
|
* Or, just don't import anything, that works too.
|
|
21
21
|
*/
|
|
22
|
+
/**
|
|
23
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
24
|
+
*/
|
|
22
25
|
/**
|
|
23
26
|
* This mixin will mask out the content that is close to
|
|
24
27
|
* the edges of a scrollable area.
|
|
@@ -933,6 +936,9 @@
|
|
|
933
936
|
*
|
|
934
937
|
* Or, just don't import anything, that works too.
|
|
935
938
|
*/
|
|
939
|
+
/**
|
|
940
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
941
|
+
*/
|
|
936
942
|
/**
|
|
937
943
|
* This mixin will mask out the content that is close to
|
|
938
944
|
* the edges of a scrollable area.
|
|
@@ -5392,6 +5398,9 @@ a.mdc-list-item {
|
|
|
5392
5398
|
*
|
|
5393
5399
|
* Or, just don't import anything, that works too.
|
|
5394
5400
|
*/
|
|
5401
|
+
/**
|
|
5402
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
5403
|
+
*/
|
|
5395
5404
|
/**
|
|
5396
5405
|
* This mixin will mask out the content that is close to
|
|
5397
5406
|
* the edges of a scrollable area.
|
|
@@ -5914,6 +5923,9 @@ a.mdc-list-item {
|
|
|
5914
5923
|
*
|
|
5915
5924
|
* Or, just don't import anything, that works too.
|
|
5916
5925
|
*/
|
|
5926
|
+
/**
|
|
5927
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
5928
|
+
*/
|
|
5917
5929
|
/**
|
|
5918
5930
|
* This mixin will mask out the content that is close to
|
|
5919
5931
|
* the edges of a scrollable area.
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Or, just don't import anything, that works too.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
18
|
+
*/
|
|
16
19
|
/**
|
|
17
20
|
* This mixin will mask out the content that is close to
|
|
18
21
|
* the edges of a scrollable area.
|
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
*
|
|
74
74
|
* Or, just don't import anything, that works too.
|
|
75
75
|
*/
|
|
76
|
+
/**
|
|
77
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
78
|
+
*/
|
|
76
79
|
/**
|
|
77
80
|
* This mixin will mask out the content that is close to
|
|
78
81
|
* the edges of a scrollable area.
|
|
@@ -1724,6 +1727,9 @@
|
|
|
1724
1727
|
.limel-select:not(.mdc-select--disabled) .limel-select-trigger.limel-select--focused .mdc-select__dropdown-icon-graphic {
|
|
1725
1728
|
transform: rotate(-180deg);
|
|
1726
1729
|
}
|
|
1730
|
+
.limel-select:not(.mdc-select--disabled) .limel-select-trigger[aria-expanded]:not([aria-expanded=false]), .limel-select:not(.mdc-select--disabled) .limel-select-trigger[aria-expanded=true] {
|
|
1731
|
+
box-shadow: var(--button-shadow-inset-pressed);
|
|
1732
|
+
}
|
|
1727
1733
|
.limel-select.limel-select--required .mdc-floating-label::after {
|
|
1728
1734
|
content: "*";
|
|
1729
1735
|
}
|
|
@@ -1790,6 +1796,9 @@ select.limel-select__native-control {
|
|
|
1790
1796
|
*
|
|
1791
1797
|
* Or, just don't import anything, that works too.
|
|
1792
1798
|
*/
|
|
1799
|
+
/**
|
|
1800
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
1801
|
+
*/
|
|
1793
1802
|
/**
|
|
1794
1803
|
* This mixin will mask out the content that is close to
|
|
1795
1804
|
* the edges of a scrollable area.
|
|
@@ -922,6 +922,9 @@
|
|
|
922
922
|
*
|
|
923
923
|
* Or, just don't import anything, that works too.
|
|
924
924
|
*/
|
|
925
|
+
/**
|
|
926
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
927
|
+
*/
|
|
925
928
|
/**
|
|
926
929
|
* This mixin will mask out the content that is close to
|
|
927
930
|
* the edges of a scrollable area.
|
|
@@ -872,6 +872,9 @@ label.disabled {
|
|
|
872
872
|
*
|
|
873
873
|
* Or, just don't import anything, that works too.
|
|
874
874
|
*/
|
|
875
|
+
/**
|
|
876
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
877
|
+
*/
|
|
875
878
|
/**
|
|
876
879
|
* This mixin will mask out the content that is close to
|
|
877
880
|
* the edges of a scrollable area.
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Or, just don't import anything, that works too.
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* This mixin will mask out the content that is close to
|
|
12
15
|
* the edges of a scrollable area.
|
|
@@ -1246,6 +1249,9 @@ body.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) {
|
|
|
1246
1249
|
*
|
|
1247
1250
|
* Or, just don't import anything, that works too.
|
|
1248
1251
|
*/
|
|
1252
|
+
/**
|
|
1253
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
1254
|
+
*/
|
|
1249
1255
|
/**
|
|
1250
1256
|
* This mixin will mask out the content that is close to
|
|
1251
1257
|
* the edges of a scrollable area.
|
|
@@ -1422,6 +1428,9 @@ button.tabulator-page[data-page=first]:not([disabled]):hover:after, button.tabul
|
|
|
1422
1428
|
*
|
|
1423
1429
|
* Or, just don't import anything, that works too.
|
|
1424
1430
|
*/
|
|
1431
|
+
/**
|
|
1432
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
1433
|
+
*/
|
|
1425
1434
|
/**
|
|
1426
1435
|
* This mixin will mask out the content that is close to
|
|
1427
1436
|
* the edges of a scrollable area.
|
|
@@ -1572,6 +1581,9 @@ button.tabulator-page[data-page=first]:not([disabled]):hover:after, button.tabul
|
|
|
1572
1581
|
*
|
|
1573
1582
|
* Or, just don't import anything, that works too.
|
|
1574
1583
|
*/
|
|
1584
|
+
/**
|
|
1585
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
1586
|
+
*/
|
|
1575
1587
|
/**
|
|
1576
1588
|
* This mixin will mask out the content that is close to
|
|
1577
1589
|
* the edges of a scrollable area.
|
|
@@ -18,6 +18,19 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
@mixin visualize-aria-expanded($trigger-element) {
|
|
26
|
+
:host([aria-expanded='true']),
|
|
27
|
+
:host([aria-expanded]:not([aria-expanded='false'])) {
|
|
28
|
+
#{$trigger-element} {
|
|
29
|
+
box-shadow: var(--button-shadow-inset-pressed) !important;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
21
34
|
@mixin in($media) {
|
|
22
35
|
// ⛔️ As long as we don't have a script that generates a
|
|
23
36
|
// `.css` files automatically, we cannot use this mixin.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-232e9616.js';
|
|
2
2
|
import { m as makeEnterClickable, r as removeEnterClickable } from './make-enter-clickable-0473e94a.js';
|
|
3
3
|
|
|
4
|
-
const buttonCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host{display:inline-block}:host([hidden]){display:none}:host([disabled]){pointer-events:none}button{display:flex;align-items:center;justify-content:center;gap:0.125rem;border:none;border-radius:0.4rem;padding-top:0;padding-right:var(--button-padding-right, 0.5rem);padding-bottom:0;padding-left:var(--button-padding-left, 0.5rem);min-height:2.25rem;width:100%}button:disabled.outlined{border-color:rgba(var(--contrast-1700), 0.2)}button:not(:disabled){transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}button:not(:disabled):focus{outline:none}button:not(:disabled):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button:not(:disabled):hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button:not(:disabled):active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}:host(limel-button[primary]) button:not(:disabled){color:var(--mdc-theme-on-primary, rgb(var(--color-white)));background-color:var(--mdc-theme-primary, rgb(var(--color-teal-default)))}:host(limel-button[primary]) button:disabled{background-color:rgba(var(--contrast-1700), 0.15)}:host(limel-button:not([primary])) button:not(:disabled){color:var(--mdc-theme-primary, rgb(var(--color-teal-default)))}:host(limel-button:not([primary])) button:disabled{color:rgba(var(--contrast-1600), 0.37);background-color:rgba(var(--contrast-1600), 0.1)}.icon{width:1.25rem;flex-shrink:0}.label{font-family:Roboto, sans-serif;font-size:0.875rem;font-weight:500;letter-spacing:0.0625rem;opacity:1;padding:0 0.25rem}limel-spinner{position:absolute}limel-icon{vertical-align:top}svg{height:1.875rem;opacity:0;pointer-events:none;position:absolute;width:1.875rem}svg line{stroke:rgb(var(--color-white));stroke-width:2}limel-icon,.label,limel-spinner,svg{transition:opacity 300ms ease-in-out}.loading limel-icon,.loading .label{opacity:0}.loading limel-spinner{opacity:1}.just-loaded limel-icon,.just-loaded .label,.just-failed limel-icon,.just-failed .label{opacity:0}.just-loaded svg,.just-failed svg{opacity:1}.just-failed{background-color:var(--lime-error-text-color) !important;animation:shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both}.outlined{border:1px solid;border-color:var(--mdc-theme-primary)}@keyframes shake{10%,90%{transform:translate3d(-0.0625rem, 0, 0)}20%,80%{transform:translate3d(0.125rem, 0, 0)}30%,50%,70%{transform:translate3d(-0.1875rem, 0, 0)}40%,60%{transform:translate3d(0.1875rem, 0, 0)}}@keyframes reduced-presence{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.7)}}:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded){animation:reduced-presence 0.3s ease forwards;transition:padding 0.3s ease, min-width 0.3s ease;transition-delay:0.3s;padding:0;min-width:0}:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) .label{transition:font-size 0.8s ease;transition-delay:0.3s;font-size:0;opacity:0}:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-icon,:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-spinner,:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) svg,:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) .icon{transition:all 0.3s ease;transition-delay:0.3s;opacity:0;width:0;height:0}";
|
|
4
|
+
const buttonCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host{display:inline-block}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([aria-expanded=true]) button,:host([aria-expanded]:not([aria-expanded=false])) button{box-shadow:var(--button-shadow-inset-pressed) !important}button{display:flex;align-items:center;justify-content:center;gap:0.125rem;border:none;border-radius:0.4rem;padding-top:0;padding-right:var(--button-padding-right, 0.5rem);padding-bottom:0;padding-left:var(--button-padding-left, 0.5rem);min-height:2.25rem;width:100%}button:disabled.outlined{border-color:rgba(var(--contrast-1700), 0.2)}button:not(:disabled){transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}button:not(:disabled):focus{outline:none}button:not(:disabled):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button:not(:disabled):hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button:not(:disabled):active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}:host(limel-button[primary]) button:not(:disabled){color:var(--mdc-theme-on-primary, rgb(var(--color-white)));background-color:var(--mdc-theme-primary, rgb(var(--color-teal-default)))}:host(limel-button[primary]) button:disabled{background-color:rgba(var(--contrast-1700), 0.15)}:host(limel-button:not([primary])) button:not(:disabled){color:var(--mdc-theme-primary, rgb(var(--color-teal-default)))}:host(limel-button:not([primary])) button:disabled{color:rgba(var(--contrast-1600), 0.37);background-color:rgba(var(--contrast-1600), 0.1)}.icon{width:1.25rem;flex-shrink:0}.label{font-family:Roboto, sans-serif;font-size:0.875rem;font-weight:500;letter-spacing:0.0625rem;opacity:1;padding:0 0.25rem}limel-spinner{position:absolute}limel-icon{vertical-align:top}svg{height:1.875rem;opacity:0;pointer-events:none;position:absolute;width:1.875rem}svg line{stroke:rgb(var(--color-white));stroke-width:2}limel-icon,.label,limel-spinner,svg{transition:opacity 300ms ease-in-out}.loading limel-icon,.loading .label{opacity:0}.loading limel-spinner{opacity:1}.just-loaded limel-icon,.just-loaded .label,.just-failed limel-icon,.just-failed .label{opacity:0}.just-loaded svg,.just-failed svg{opacity:1}.just-failed{background-color:var(--lime-error-text-color) !important;animation:shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both}.outlined{border:1px solid;border-color:var(--mdc-theme-primary)}@keyframes shake{10%,90%{transform:translate3d(-0.0625rem, 0, 0)}20%,80%{transform:translate3d(0.125rem, 0, 0)}30%,50%,70%{transform:translate3d(-0.1875rem, 0, 0)}40%,60%{transform:translate3d(0.1875rem, 0, 0)}}@keyframes reduced-presence{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.7)}}:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded){animation:reduced-presence 0.3s ease forwards;transition:padding 0.3s ease, min-width 0.3s ease;transition-delay:0.3s;padding:0;min-width:0}:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) .label{transition:font-size 0.8s ease;transition-delay:0.3s;font-size:0;opacity:0}:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-icon,:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-spinner,:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) svg,:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) .icon{transition:all 0.3s ease;transition-delay:0.3s;opacity:0;width:0;height:0}";
|
|
5
5
|
|
|
6
6
|
const Button = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"limel-button.entry.js","mappings":";;;AAAA,MAAM,SAAS,GAAG
|
|
1
|
+
{"file":"limel-button.entry.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,+0JAA+0J;;MCwBp1J,MAAM;;;;mBAWE,KAAK;oBAMJ,KAAK;;oBAYL,KAAK;mBAON,KAAK;yBAOC,KAAK;sBAGP,KAAK;;EAOnB,iBAAiB;IACpB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACjC;EAEM,oBAAoB;IACvB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACnC;EAEM,MAAM;IACT,QACI,cACI,KAAK,EAAE;QACH,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,aAAa;QACrD,aAAa,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,aAAa;QACpD,QAAQ,EAAE,IAAI,CAAC,QAAQ;OAC1B,EACD,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,IAEtC,IAAI,CAAC,UAAU,EAAE,EACjB,IAAI,CAAC,WAAW,EAAE,EAClB,IAAI,CAAC,aAAa,EAAE,EACrB,WAAK,OAAO,EAAC,WAAW,IAAE,IAAI,CAAC,kBAAkB,EAAE,CAAO,CACrD,EACX;GACL;EAGS,cAAc,CAAC,QAAiB,EAAE,QAAiB;IACzD,IAAI,QAAQ,IAAI,CAAC,QAAQ,EAAE;MACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;MACvB,MAAM,OAAO,GAAG,IAAI,CAAC;MACrB,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;OAC3B,EAAE,OAAO,CAAC,CAAC;KACf;SAAM,IAAI,QAAQ,EAAE;MACjB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;MACxB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;KAC/C;GACJ;EAEO,kBAAkB;IACtB,IAAI,IAAI,CAAC,aAAa,EAAE;MACpB,OAAO;QACH,YAAM,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAG;QACtC,YAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,GAAG;OACzC,CAAC;KACL;IAED,OAAO;MACH,YAAM,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAG;MACvC,YAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAG;KAC1C,CAAC;GACL;EAEO,UAAU;IACd,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;MACZ,OAAO;KACV;IAED,OAAO,kBAAY,KAAK,EAAC,MAAM,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CAAC;GACvD;EAEO,WAAW;IACf,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;MACb,OAAO;KACV;IAED,OAAO,YAAM,KAAK,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAQ,CAAC;GAClD;EAEO,aAAa;IACjB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;MACf,OAAO;KACV;IAED,OAAO,qBAAe,WAAW,EAAE,KAAK,GAAI,CAAC;GAChD;;;;;;;;;;","names":[],"sources":["./src/components/button/button.scss?tag=limel-button&encapsulation=shadow","./src/components/button/button.tsx"],"sourcesContent":["@use '../../style/functions';\n@use '../../style/mixins';\n\n@use '../../style/internal/lime-theme';\n\n:host {\n display: inline-block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host([disabled]) {\n pointer-events: none;\n}\n\n@include mixins.visualize-aria-expanded('button');\n\nbutton {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.125rem;\n\n border: none;\n border-radius: 0.4rem;\n padding: {\n top: 0;\n right: var(--button-padding-right, 0.5rem);\n bottom: 0;\n left: var(--button-padding-left, 0.5rem);\n }\n\n min-height: 2.25rem;\n width: 100%;\n\n &:disabled {\n &.outlined {\n border-color: rgba(var(--contrast-1700), 0.2);\n }\n }\n\n &:not(:disabled) {\n @include mixins.visualize-keyboard-focus;\n @include mixins.is-elevated-clickable();\n }\n\n :host(limel-button[primary]) & {\n &:not(:disabled) {\n color: var(--mdc-theme-on-primary, rgb(var(--color-white)));\n background-color: var(\n --mdc-theme-primary,\n rgb(var(--color-teal-default))\n );\n }\n &:disabled {\n background-color: rgba(var(--contrast-1700), 0.15);\n }\n }\n\n :host(limel-button:not([primary])) & {\n &:not(:disabled) {\n color: var(--mdc-theme-primary, rgb(var(--color-teal-default)));\n }\n &:disabled {\n color: rgba(var(--contrast-1600), 0.37);\n background-color: rgba(var(--contrast-1600), 0.1);\n }\n }\n}\n\n.icon {\n width: 1.25rem;\n flex-shrink: 0;\n}\n\n.label {\n font-family: Roboto, sans-serif;\n font-size: 0.875rem;\n font-weight: 500;\n letter-spacing: functions.pxToRem(1);\n opacity: 1;\n padding: 0 0.25rem;\n}\n\nlimel-spinner {\n position: absolute;\n}\n\nlimel-icon {\n vertical-align: top;\n}\n\nsvg {\n height: functions.pxToRem(30);\n opacity: 0;\n pointer-events: none;\n position: absolute;\n width: functions.pxToRem(30);\n\n line {\n stroke: rgb(var(--color-white));\n stroke-width: 2;\n }\n}\n\nlimel-icon,\n.label,\nlimel-spinner,\nsvg {\n transition: opacity 300ms ease-in-out;\n}\n\n.loading {\n limel-icon,\n .label {\n opacity: 0;\n }\n limel-spinner {\n opacity: 1;\n }\n}\n\n.just-loaded,\n.just-failed {\n limel-icon,\n .label {\n opacity: 0;\n }\n svg {\n opacity: 1;\n }\n}\n\n.just-failed {\n background-color: var(--lime-error-text-color) !important;\n animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;\n}\n\n.outlined {\n border: 1px solid;\n border-color: var(--mdc-theme-primary);\n}\n\n@keyframes shake {\n 10%,\n 90% {\n transform: translate3d(#{functions.pxToRem(-1)}, 0, 0);\n }\n\n 20%,\n 80% {\n transform: translate3d(#{functions.pxToRem(2)}, 0, 0);\n }\n\n 30%,\n 50%,\n 70% {\n transform: translate3d(#{functions.pxToRem(-3)}, 0, 0);\n }\n\n 40%,\n 60% {\n transform: translate3d(#{functions.pxToRem(3)}, 0, 0);\n }\n}\n\n@import './partial-styles/_has-reduced-presence';\n","import { Component, h, Prop, State, Watch, Element } from '@stencil/core';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\n\n/**\n * @exampleComponent limel-example-button-basic\n * @exampleComponent limel-example-button-primary\n * @exampleComponent limel-example-button-outlined\n * @exampleComponent limel-example-button-disabled\n * @exampleComponent limel-example-button-icon\n * @exampleComponent limel-example-button-loading\n * @exampleComponent limel-example-button-click-success\n * @exampleComponent limel-example-button-click-fail\n * @exampleComponent limel-example-button-reduce-presence\n * @exampleComponent limel-example-button-colors\n * @exampleComponent limel-example-button-composite\n */\n@Component({\n tag: 'limel-button',\n shadow: true,\n styleUrl: 'button.scss',\n})\nexport class Button {\n /**\n * The text to show on the button.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to make the button primary.\n */\n @Prop({ reflect: true })\n public primary = false;\n\n /**\n * Set to `true` to make the button outlined.\n */\n @Prop({ reflect: true })\n public outlined = false;\n\n /**\n * Set icon for the button\n */\n @Prop({ reflect: true })\n public icon: string;\n\n /**\n * Set to `true` to disable the button.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to put the button in the `loading` state.\n * This also disables the button.\n */\n @Prop({ reflect: true })\n public loading = false;\n\n /**\n * Set to `true` to indicate failure instead of success when the button is\n * no longer in the `loading` state.\n */\n @Prop({ reflect: true })\n public loadingFailed = false;\n\n @State()\n private justLoaded = false;\n\n @Element()\n private host: HTMLElement;\n\n private justLoadedTimeout?: number;\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n public render() {\n return (\n <button\n class={{\n loading: this.loading,\n 'just-loaded': this.justLoaded && !this.loadingFailed,\n 'just-failed': this.justLoaded && this.loadingFailed,\n outlined: this.outlined,\n }}\n disabled={this.disabled || this.loading}\n >\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderSpinner()}\n <svg viewBox=\"0 0 30 30\">{this.renderLoadingIcons()}</svg>\n </button>\n );\n }\n\n @Watch('loading')\n protected loadingWatcher(newValue: boolean, oldValue: boolean) {\n if (oldValue && !newValue) {\n this.justLoaded = true;\n const TIMEOUT = 2000;\n this.justLoadedTimeout = window.setTimeout(() => {\n this.justLoaded = false;\n }, TIMEOUT);\n } else if (newValue) {\n this.justLoaded = false;\n window.clearTimeout(this.justLoadedTimeout);\n }\n }\n\n private renderLoadingIcons() {\n if (this.loadingFailed) {\n return [\n <line x1=\"9\" y1=\"9\" x2=\"21\" y2=\"21\" />,\n <line x1=\"21\" y1=\"9\" x2=\"9\" y2=\"21\" />,\n ];\n }\n\n return [\n <line x1=\"8\" y1=\"14\" x2=\"15\" y2=\"20\" />,\n <line x1=\"23\" y1=\"9\" x2=\"14\" y2=\"20\" />,\n ];\n }\n\n private renderIcon() {\n if (!this.icon) {\n return;\n }\n\n return <limel-icon class=\"icon\" name={this.icon} />;\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return <span class=\"label\">{this.label}</span>;\n }\n\n private renderSpinner() {\n if (!this.loading) {\n return;\n }\n\n return <limel-spinner limeBranded={false} />;\n }\n}\n"],"version":3}
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, h, g as getElement } from './index-232e9616.js';
|
|
|
2
2
|
import { m as makeEnterClickable, r as removeEnterClickable } from './make-enter-clickable-0473e94a.js';
|
|
3
3
|
import { c as createRandomString } from './random-string-812b1c35.js';
|
|
4
4
|
|
|
5
|
-
const iconButtonCss = "@charset \"UTF-8\";:host([hidden]){display:none}:host([disabled]){pointer-events:none}button{all:unset;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--icon-background-color, transparent);display:inline-flex;align-items:center;justify-content:center;height:2.25rem;width:2.25rem;border-radius:50%}button:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}button:focus{outline:none}button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}:host([elevated]) button:not(:hover):not(:active):not(:focus-visible){box-shadow:var(--button-shadow-normal)}button:disabled{color:var(--mdc-theme-text-disabled-on-background)}limel-icon{width:1.25rem}";
|
|
5
|
+
const iconButtonCss = "@charset \"UTF-8\";:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([aria-expanded=true]) button,:host([aria-expanded]:not([aria-expanded=false])) button{box-shadow:var(--button-shadow-inset-pressed) !important}button{all:unset;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--icon-background-color, transparent);display:inline-flex;align-items:center;justify-content:center;height:2.25rem;width:2.25rem;border-radius:50%}button:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}button:focus{outline:none}button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}:host([elevated]) button:not(:hover):not(:active):not(:focus-visible){box-shadow:var(--button-shadow-normal)}button:disabled{color:var(--mdc-theme-text-disabled-on-background)}limel-icon{width:1.25rem}";
|
|
6
6
|
|
|
7
7
|
const IconButton = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"limel-icon-button.entry.js","mappings":";;;;AAAA,MAAM,aAAa,GAAG,
|
|
1
|
+
{"file":"limel-icon-button.entry.js","mappings":";;;;AAAA,MAAM,aAAa,GAAG,4lCAA4lC;;MCmBrmC,UAAU;;;IA6CX,cAAS,GAAG,kBAAkB,EAAE,CAAC;;oBAjCvB,KAAK;;oBAYL,KAAK;;EAKhB,iBAAiB;IACpB,IAAI,CAAC,UAAU,EAAE,CAAC;GACrB;EAEM,iBAAiB;IACpB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACjC;EAEM,oBAAoB;IACvB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACnC;EAEM,gBAAgB;IACnB,IAAI,CAAC,UAAU,EAAE,CAAC;GACrB;EAIO,UAAU;IACd,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACvE,IAAI,CAAC,OAAO,EAAE;MACV,OAAO;KACV;GACJ;EAEM,MAAM;IACT,MAAM,gBAAgB,GAA0B,EAAE,CAAC;IAEnD,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE;MACpC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;KAClE;IAED,QACI,4BACI,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAE,IAAI,CAAC,SAAS,IACd,gBAAgB,GAEpB,kBAAY,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,GAAI,EAC3C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAC9B,EACX;GACL;EACO,aAAa,CAAC,SAAS;IAC3B,IAAI,IAAI,CAAC,KAAK,EAAE;MACZ,OAAO,qBAAe,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI,CAAC;KACrE;GACJ;;;;;;;","names":[],"sources":["./src/components/icon-button/icon-button.scss?tag=limel-icon-button&encapsulation=shadow","./src/components/icon-button/icon-button.tsx"],"sourcesContent":["@use '../../style/mixins';\n\n/**\n * @prop --icon-background-color: Background color of the button.\n */\n\n:host([hidden]) {\n display: none;\n}\n\n:host([disabled]) {\n pointer-events: none;\n}\n\n@include mixins.visualize-aria-expanded('button');\n\nbutton {\n all: unset;\n @include mixins.is-flat-clickable(\n $background-color: var(--icon-background-color, transparent)\n );\n @include mixins.visualize-keyboard-focus;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n height: 2.25rem;\n width: 2.25rem;\n border-radius: 50%;\n\n :host([elevated]) & {\n &:not(:hover):not(:active):not(:focus-visible) {\n box-shadow: var(--button-shadow-normal);\n }\n }\n\n &:disabled {\n color: var(--mdc-theme-text-disabled-on-background);\n }\n}\n\nlimel-icon {\n width: 1.25rem;\n}\n","import { Component, Element, h, Prop } from '@stencil/core';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from 'src/util/make-enter-clickable';\nimport { createRandomString } from '../../util/random-string';\n\n/**\n * @exampleComponent limel-example-icon-button-basic\n * @exampleComponent limel-example-icon-button-disabled\n * @exampleComponent limel-example-icon-button-elevated\n * @exampleComponent limel-example-icon-button-toggle-state\n * @exampleComponent limel-example-icon-button-composite\n */\n@Component({\n tag: 'limel-icon-button',\n shadow: true,\n styleUrl: 'icon-button.scss',\n})\nexport class IconButton {\n /**\n * The icon to display.\n */\n @Prop({ reflect: true })\n public icon: string;\n\n /**\n * Set to `true` to give the button our standard \"elevated\" look, lifting\n * it off the flat layout.\n */\n @Prop({ reflect: true })\n public elevated = false;\n\n /**\n * The text to show to screenreaders and other assistive tech.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to disable the button.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n @Element()\n private host: HTMLLimelIconButtonElement;\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n private tooltipId = createRandomString();\n\n private initialize() {\n const element = this.host.shadowRoot.querySelector('.mdc-icon-button');\n if (!element) {\n return;\n }\n }\n\n public render() {\n const buttonAttributes: { tabindex?: string } = {};\n\n if (this.host.hasAttribute('tabindex')) {\n buttonAttributes.tabindex = this.host.getAttribute('tabindex');\n }\n\n return (\n <button\n disabled={this.disabled}\n id={this.tooltipId}\n {...buttonAttributes}\n >\n <limel-icon name={this.icon} badge={true} />\n {this.renderTooltip(this.tooltipId)}\n </button>\n );\n }\n private renderTooltip(tooltipId) {\n if (this.label) {\n return <limel-tooltip elementId={tooltipId} label={this.label} />;\n }\n }\n}\n"],"version":3}
|