@limetech/lime-elements 40.17.0 → 40.18.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/CHANGELOG.md +15 -0
- package/dist/cjs/heading-level-BxCuIKkm.js +14 -0
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +4 -9
- package/dist/cjs/limel-file-viewer.cjs.entry.js +422 -248
- package/dist/cjs/limel-form-header.cjs.entry.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +30 -21
- package/dist/collection/components/collapsible-section/collapsible-section.js +11 -9
- package/dist/collection/components/form/fields/schema-field.js +8 -1
- package/dist/collection/components/form/form.js +9 -6
- package/dist/collection/components/form/form.test-schemas.js +154 -0
- package/dist/collection/components/form/templates/array-field-collapsible-item.js +13 -3
- package/dist/collection/components/form/templates/heading-level.js +0 -10
- package/dist/collection/components/form/templates/object-field.js +6 -3
- package/dist/collection/components/form-header/form-header.js +3 -3
- package/dist/collection/global/shared-types/heading-level.types.js +1 -0
- package/dist/collection/interface.js +1 -0
- package/dist/collection/util/heading-level.js +10 -0
- package/dist/esm/heading-level-B3C0kDpZ.js +12 -0
- package/dist/esm/limel-collapsible-section.entry.js +2 -7
- package/dist/esm/limel-file-viewer.entry.js +422 -248
- package/dist/esm/limel-form-header.entry.js +1 -1
- package/dist/esm/limel-form.entry.js +28 -19
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-49a53f0b.entry.js +1 -0
- package/dist/lime-elements/{p-72907ffd.entry.js → p-68129487.entry.js} +1 -1
- package/dist/lime-elements/p-B3C0kDpZ.js +1 -0
- package/dist/lime-elements/{p-9436aba6.entry.js → p-be84c9f2.entry.js} +4 -4
- package/dist/lime-elements/p-e8255f0b.entry.js +1 -0
- package/dist/types/components/collapsible-section/collapsible-section.d.ts +2 -1
- package/dist/types/components/form/fields/schema-field.d.ts +1 -0
- package/dist/types/components/form/form.d.ts +5 -2
- package/dist/types/components/form/form.test-schemas.d.ts +7 -0
- package/dist/types/components/form/form.types.d.ts +17 -7
- package/dist/types/components/form/row/row.d.ts +1 -1
- package/dist/types/components/form/templates/array-field-collapsible-item.d.ts +5 -1
- package/dist/types/components/form/templates/heading-level.d.ts +1 -6
- package/dist/types/components/form/templates/object-field.d.ts +2 -0
- package/dist/types/components/form-header/form-header.d.ts +1 -1
- package/dist/types/components.d.ts +13 -7
- package/dist/types/global/shared-types/heading-level.types.d.ts +7 -0
- package/dist/types/interface.d.ts +2 -1
- package/dist/types/util/heading-level.d.ts +7 -0
- package/package.json +2 -2
- package/dist/lime-elements/p-1d13245d.entry.js +0 -1
- package/dist/lime-elements/p-e6be5819.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as o,h as t,a as i}from"./p-BU9IJqli.js";import{d as n}from"./p-z_E3sq3p.js";import{m as s,r}from"./p-CIf8aGSd.js";import{c as a}from"./p-BrjD-ITe.js";import{b as l,d as c,g as d}from"./p-CgNJbSP4.js";import{t as p}from"./p-B26k4gw8.js";import{i as h}from"./p-B3C0kDpZ.js";import"./p-ChagAaNf.js";const g=class{constructor(i){e(this,i),this.open=o(this,"open",7),this.close=o(this,"close",7),this.action=o(this,"action",7),this.isOpen=!1,this.headingLevel=2,this.invalid=!1,this.language="en",this.bodyId=a(),this.headingId=a(),this.onClick=()=>{this.handleInteraction()},this.handleInteraction=()=>{this.isOpen=!this.isOpen,this.isOpen?(this.open.emit(),setTimeout(n,100)):this.close.emit()},this.renderExpandCollapseSign=()=>t("div",{class:"expand-icon",role:"presentation","aria-hidden":"true"},t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"})),this.renderIcon=()=>{if(!this.icon)return;const e=d(this.icon),o=l(this.icon),i=c(this.icon);return t("limel-icon",{name:e,"aria-label":i,"aria-hidden":i?null:"true",style:{color:`${o}`}})},this.renderHeading=()=>{if(!this.header)return;const e=`h${this.getHeadingLevel()}`;return t(e,{class:"title mdc-typography mdc-typography--headline2",id:this.headingId},this.header)},this.renderActions=()=>{if(this.actions)return t("div",{class:"actions"},this.actions.map(this.renderActionButton))},this.renderActionButton=e=>t("limel-icon-button",{icon:e.icon,label:e.label,disabled:e.disabled,onClick:this.handleActionClick(e)}),this.handleActionClick=e=>o=>{o.stopPropagation(),this.action.emit(e)},this.getCollapsibleSectionAriaLabel=()=>p.get(this.isOpen?"collapsible-section.close":"collapsible-section.open",this.language,{header:this.header?`"${this.header}"`:" "})}componentWillLoad(){this.warnIfHeadingLevelIsInvalid()}handleHeadingLevelChange(){this.warnIfHeadingLevelIsInvalid()}componentDidRender(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");s(e)}disconnectedCallback(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");r(e)}render(){return t("section",{key:"ff18dacc5e74d3bd8d16da55be3e5340922acf86",class:this.isOpen?"open":"","aria-invalid":this.invalid,"aria-labelledby":this.header?this.headingId:null},t("header",{key:"f4dba35493c7ce7344ff34d2fbaeeb769f8c87eb"},t("button",{key:"d3a632b4002d01774c9bb88f250be4e196340ef3",class:"open-close-toggle",onClick:this.onClick,"aria-controls":this.bodyId,"aria-expanded":this.isOpen?"true":"false","aria-label":this.getCollapsibleSectionAriaLabel(),type:"button"}),this.renderExpandCollapseSign(),this.renderIcon(),this.renderHeading(),t("div",{key:"8d8489917d5e1bfa8de3cca8294651f448c8129c",class:"divider-line",role:"presentation"}),this.renderHeaderSlot(),this.renderActions()),t("div",{key:"fd7e13cf3bd26815d62c3fbac0ef04ed4db364b5",class:"body",inert:!this.isOpen,"aria-hidden":String(!this.isOpen),id:this.bodyId,role:"region"},t("slot",{key:"90ed08286c1091f5c5c5feec827729cfa65588fc"})))}getHeadingLevel(){return h(this.headingLevel)?this.headingLevel:2}warnIfHeadingLevelIsInvalid(){h(this.headingLevel)||console.warn(`limel-collapsible-section: headingLevel must be a whole number from 1 to 6, but it is ${this.headingLevel}. The heading is drawn as an h2 instead.`)}renderHeaderSlot(){return t("slot",{name:"header"})}get host(){return i(this)}static get watchers(){return{headingLevel:[{handleHeadingLevelChange:0}]}}};g.style='@charset "UTF-8";.expand-icon{position:relative;display:flex;align-items:center;justify-content:center;height:1.875rem;margin:0 0 0 0.5rem;width:0.75rem;flex-shrink:0}.line{position:absolute;inset:auto;margin:auto;width:100%;border-radius:1rem;height:0.125rem}.line:first-of-type,.line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s;opacity:0;background-color:var(--header-stroke-color, rgb(var(--contrast-900)))}.line:nth-of-type(2){transform:translate3d(0, 0.25rem, 0) rotate(90deg)}.line:nth-of-type(3){transform:translate3d(0, -0.25rem, 0) rotate(-90deg)}.line:nth-of-type(2),.line:nth-of-type(3){transition:opacity 0.2s ease, transform 0.18s ease}.line:nth-of-type(2):before,.line:nth-of-type(2):after,.line:nth-of-type(3):before,.line:nth-of-type(3):after{content:"";position:absolute;inset:0;margin:auto;width:50%;height:100%;border-radius:inherit;background-color:var(--header-stroke-color, rgb(var(--contrast-900)))}.line:nth-of-type(2):before,.line:nth-of-type(3):before{transform:translate3d(0, -0.1rem, 0) rotate(45deg)}.line:nth-of-type(2):after,.line:nth-of-type(3):after{transform:translate3d(0, 0.1rem, 0) rotate(-45deg)}.open-close-toggle:hover+.expand-icon .line:first-of-type,.open-close-toggle:hover+.expand-icon .line:last-of-type,.open-close-toggle:focus-visible+.expand-icon .line:first-of-type,.open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transition:opacity 0.8s ease 0.4s, transform 0.4s ease 0.3s;opacity:1}.open-close-toggle:hover+.expand-icon .line:first-of-type,.open-close-toggle:focus-visible+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:last-of-type,.open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2),.open-close-toggle:hover+.expand-icon .line:nth-of-type(3),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transition:opacity 0.5s ease 0.4s, transform 0.7s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2){transform:translate3d(0, 0.5rem, 0) rotate(90deg);opacity:0.4}.open-close-toggle:hover+.expand-icon .line:nth-of-type(3),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transform:translate3d(0, -0.5rem, 0) rotate(-90deg);opacity:0.4}section.open .line:first-of-type,section.open .line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s;opacity:1}section.open .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:nth-of-type(2),section.open .line:nth-of-type(3){transition:opacity 1s ease, transform 0.4s ease}section.open .line:nth-of-type(2){transform:translate3d(0, 1rem, 0) rotate(90deg);opacity:0}section.open .line:nth-of-type(3){transform:translate3d(0, -1rem, 0) rotate(-90deg);opacity:0}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type,section.open .open-close-toggle:hover+.expand-icon .line:last-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:first-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transition:opacity 0.2s ease 0.4s, transform 0.4s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 45deg)}section.open .open-close-toggle:hover+.expand-icon .line:last-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, -45deg)}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(2),section.open .open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2){transform:translate3d(0, 1rem, 0) rotate(90deg);opacity:0}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(3),section.open .open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transform:translate3d(0, -1rem, 0) rotate(-90deg);opacity:0}:host(limel-collapsible-section){--border-radius-of-header:0.75rem;display:block}:host([hidden]){display:none}button.open-close-toggle{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;position:absolute;inset:0;width:100%}button.open-close-toggle:focus{outline:none}button.open-close-toggle:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button.open-close-toggle{transition:background-color 0.4s ease, border-radius 0.1s ease;cursor:pointer;z-index:-1;background-color:var(--closed-header-background-color, rgb(var(--contrast-200)));border-radius:var(--border-radius-of-header)}button.open-close-toggle:hover,button.open-close-toggle:focus-visible{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}section.open button.open-close-toggle{background-color:var(--open-header-background-color, rgb(var(--contrast-100)));border-radius:var(--border-radius-of-header) var(--border-radius-of-header) var(--limel-cs-open-header-bottom-border-radius, 0) var(--limel-cs-open-header-bottom-border-radius, 0)}section.open button.open-close-toggle:hover,section.open button.open-close-toggle:focus-visible{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}.title,.divider-line,.expand-icon{pointer-events:none}section{transition:box-shadow 0.4s ease;border-radius:var(--border-radius-of-header)}section[aria-invalid]:not([aria-invalid=false]){--header-stroke-color:rgb(var(--color-red-default)) !important}section[aria-invalid]:not([aria-invalid=false]):not(.open){box-shadow:0 0 0 1px rgb(var(--color-red-default))}header{isolation:isolate;position:relative;align-items:center;display:flex;justify-content:space-between;gap:0.5rem;padding-left:0.5rem;height:2.5rem}limel-icon{width:1.5rem;flex-shrink:0}.title{font-size:1rem;font-weight:300;color:var(--limel-theme-on-surface-color);justify-self:flex-start;user-select:none;height:auto;max-height:3rem;line-height:1.2rem;display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.divider-line{transition:opacity 0.3s ease 0.3s;flex-grow:1;height:0.125rem;border-radius:1rem;background-color:var(--header-stroke-color, rgb(var(--contrast-900)));opacity:0;margin-right:0.5rem}section.open .divider-line{opacity:0.16}.actions{justify-self:flex-end;flex-shrink:0}::slotted([slot=header]){margin-right:0.5rem}.body{background-color:var(--body-background-color, var(--contrast-100));padding-left:var(--body-padding, 1.25rem);padding-right:var(--body-padding, 1.25rem);border-radius:0 0 var(--border-radius-of-header) var(--border-radius-of-header)}.body{transition:grid-template-rows var(--limel-cs-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89);display:grid;grid-template-rows:var(--limel-cs-grid-template-rows)}.body slot{transition:opacity var(--limel-cs-opacity-transition-speed) ease var(--limel-cs-opacity-transition-delay);display:block;overflow:hidden}:host(limel-collapsible-section:not([is-open])){--limel-cs-opacity-transition-speed:0.1s;--limel-cs-opacity-transition-delay:0s;--limel-cs-grid-template-rows-transition-speed:0.3s;--limel-cs-grid-template-rows:0fr}:host(limel-collapsible-section:not([is-open])) slot{opacity:0}:host(limel-collapsible-section[is-open]){--limel-cs-opacity-transition-speed:0.4s;--limel-cs-opacity-transition-delay:0.3s;--limel-cs-grid-template-rows-transition-speed:0.46s;--limel-cs-grid-template-rows:1fr}:host(limel-collapsible-section[is-open]) slot{opacity:1}header:hover+.body,header:has(.open-close-toggle:hover)+.body,header:has(.open-close-toggle:focus-visible)+.body{will-change:grid-template-rows}header:hover+.body slot,header:has(.open-close-toggle:hover)+.body slot,header:has(.open-close-toggle:focus-visible)+.body slot{will-change:opacity}';export{g as limel_collapsible_section}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Action } from './action';
|
|
2
2
|
import { Icon, IconName } from '../../global/shared-types/icon.types';
|
|
3
3
|
import { Languages } from '../date-picker/date.types';
|
|
4
|
+
import { HeadingLevel } from '../../global/shared-types/heading-level.types';
|
|
4
5
|
/**
|
|
5
6
|
* A collapsible section can be used to group related content together
|
|
6
7
|
* and hide the group when not needed.
|
|
@@ -40,7 +41,7 @@ export declare class CollapsibleSection {
|
|
|
40
41
|
* For example, when the section is below an `h2`, set it to `3`.
|
|
41
42
|
* It does not change how the heading looks.
|
|
42
43
|
*/
|
|
43
|
-
headingLevel:
|
|
44
|
+
headingLevel: HeadingLevel;
|
|
44
45
|
/**
|
|
45
46
|
* Icon to display in the header of the section
|
|
46
47
|
*/
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import { FormError, FormSchema,
|
|
2
|
+
import { FormError, FormSchema, ValidationError, ValidationStatus } from './form.types';
|
|
3
|
+
import { HeadingLevel } from '../../global/shared-types/heading-level.types';
|
|
3
4
|
/**
|
|
4
5
|
* @exampleComponent limel-example-form
|
|
5
6
|
* @exampleComponent limel-example-nested-form
|
|
6
7
|
* @exampleComponent limel-example-list-form
|
|
7
8
|
* @exampleComponent limel-example-dynamic-form
|
|
8
9
|
* @exampleComponent limel-example-custom-component-form
|
|
10
|
+
* @exampleComponent limel-example-custom-component-header-form
|
|
9
11
|
* @exampleComponent limel-example-props-factory-form
|
|
10
12
|
* @exampleComponent limel-example-form-layout
|
|
11
13
|
* @exampleComponent limel-example-form-span-fields
|
|
@@ -55,7 +57,8 @@ export declare class Form {
|
|
|
55
57
|
/**
|
|
56
58
|
* The level, from `1` to `6`, of the topmost headings in the form.
|
|
57
59
|
* The headings of the sections inside them get one level more for each
|
|
58
|
-
* level of nesting, down to `6`.
|
|
60
|
+
* level of nesting, down to `6`. A collapsible section, and each item
|
|
61
|
+
* of a list that is shown as one, counts as a level too.
|
|
59
62
|
*
|
|
60
63
|
* Set it so that the headings of the form fit below the headings of
|
|
61
64
|
* the page around it. For example, when the form is in a section with
|
|
@@ -26,6 +26,10 @@ export declare const integerSchema: FormSchema;
|
|
|
26
26
|
export declare const serverErrorsSchema: FormSchema;
|
|
27
27
|
export declare const transformErrorsSchema: FormSchema;
|
|
28
28
|
export declare const customComponentSchema: FormSchema;
|
|
29
|
+
export declare const customComponentWithHeaderSchema: FormSchema;
|
|
30
|
+
export declare const requiredCustomComponentWithHeaderSchema: FormSchema;
|
|
31
|
+
export declare const customComponentWithHelpSchema: FormSchema;
|
|
32
|
+
export declare const rowLayoutWithCustomComponentHeaderSchema: FormSchema;
|
|
29
33
|
export declare const undefinedComponentSchema: FormSchema;
|
|
30
34
|
export declare const emptySchema: FormSchema;
|
|
31
35
|
export declare const hiddenFieldSchema: FormSchema;
|
|
@@ -35,6 +39,7 @@ export declare const arrayItemControlsSchema: FormSchema;
|
|
|
35
39
|
export declare const rowLayoutSchema: FormSchema;
|
|
36
40
|
export declare const rowLayoutWithCustomComponentSchema: FormSchema;
|
|
37
41
|
export declare const nestedArrayObjectSchema: FormSchema;
|
|
42
|
+
export declare const arrayItemWithEmptyListSchema: FormSchema;
|
|
38
43
|
export declare const topLevelStringCustomComponentSchema: FormSchema;
|
|
39
44
|
export declare const stringWithDefaultCustomComponentSchema: FormSchema;
|
|
40
45
|
export declare const arrayItemWithDependenciesSchema: FormSchema;
|
|
@@ -48,5 +53,7 @@ export declare const requiredCheckboxSchema: FormSchema;
|
|
|
48
53
|
export declare const nestedTitlesSchema: FormSchema;
|
|
49
54
|
export declare const titledRowLayoutSchema: FormSchema;
|
|
50
55
|
export declare const untitledRootSchema: FormSchema;
|
|
56
|
+
export declare const nestedCollapsibleSchema: FormSchema;
|
|
57
|
+
export declare const untitledCollapsibleSchema: FormSchema;
|
|
51
58
|
export declare const untitledRowSchema: FormSchema;
|
|
52
59
|
//# sourceMappingURL=form.test-schemas.d.ts.map
|
|
@@ -72,12 +72,6 @@ export type ValidationError = {
|
|
|
72
72
|
*/
|
|
73
73
|
[key: string]: string[] | ValidationError;
|
|
74
74
|
};
|
|
75
|
-
/**
|
|
76
|
-
* The level of a heading, from `1` for an `h1` to `6` for an `h6`.
|
|
77
|
-
*
|
|
78
|
-
* @public
|
|
79
|
-
*/
|
|
80
|
-
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
81
75
|
/**
|
|
82
76
|
* @public
|
|
83
77
|
*/
|
|
@@ -110,7 +104,8 @@ export interface FormComponent<T = any> {
|
|
|
110
104
|
*/
|
|
111
105
|
label?: string;
|
|
112
106
|
/**
|
|
113
|
-
* The helper text for the current property
|
|
107
|
+
* The helper text for the current property. While the property has a
|
|
108
|
+
* validation error to show, this is the error.
|
|
114
109
|
*/
|
|
115
110
|
helperText?: string;
|
|
116
111
|
/**
|
|
@@ -230,6 +225,21 @@ export interface FormComponentOptions {
|
|
|
230
225
|
* specified on the `FormComponent` interface
|
|
231
226
|
*/
|
|
232
227
|
props?: Record<string, any>;
|
|
228
|
+
/**
|
|
229
|
+
* Let the form draw the title, the description and the help of the field
|
|
230
|
+
* above the component, as a heading that fits how deep the field is.
|
|
231
|
+
*
|
|
232
|
+
* The component still gets `label` and `helperText`, so a component that
|
|
233
|
+
* draws its own title or description should read this option in
|
|
234
|
+
* `formInfo.schema` and leave them out. It should still show `helperText`
|
|
235
|
+
* while `invalid` is `true`, because that is where the form puts a
|
|
236
|
+
* validation error.
|
|
237
|
+
*
|
|
238
|
+
* A row layout draws its own header, so the option has no effect there.
|
|
239
|
+
*
|
|
240
|
+
* Defaults to `false`.
|
|
241
|
+
*/
|
|
242
|
+
showHeader?: boolean;
|
|
233
243
|
}
|
|
234
244
|
/**
|
|
235
245
|
* @public
|
|
@@ -3,7 +3,7 @@ import { RowProps } from '../templates/types';
|
|
|
3
3
|
import { HeadingLevelContext } from '../templates/heading-level';
|
|
4
4
|
export declare class Row extends React.Component<RowProps> {
|
|
5
5
|
props: RowProps;
|
|
6
|
-
static readonly contextType: React.Context<import("
|
|
6
|
+
static readonly contextType: React.Context<import("../../..").HeadingLevel>;
|
|
7
7
|
context: React.ContextType<typeof HeadingLevelContext>;
|
|
8
8
|
constructor(props: RowProps);
|
|
9
9
|
render(): React.DetailedReactHTMLElement<{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { ArrayFieldItemButtonsTemplateProps, ErrorSchema } from '@rjsf/utils';
|
|
3
3
|
import { JSONSchema7 } from 'json-schema';
|
|
4
|
+
import { HeadingLevelContext } from './heading-level';
|
|
4
5
|
export interface CollapsibleItemProps {
|
|
5
6
|
buttonsProps: ArrayFieldItemButtonsTemplateProps;
|
|
6
7
|
/**
|
|
@@ -46,6 +47,8 @@ export interface CollapsibleItemProps {
|
|
|
46
47
|
}
|
|
47
48
|
export declare class CollapsibleItemTemplate extends React.Component<PropsWithChildren<CollapsibleItemProps>> {
|
|
48
49
|
props: PropsWithChildren<CollapsibleItemProps>;
|
|
50
|
+
static readonly contextType: React.Context<import("../../..").HeadingLevel>;
|
|
51
|
+
context: React.ContextType<typeof HeadingLevelContext>;
|
|
49
52
|
state: {
|
|
50
53
|
isOpen: boolean;
|
|
51
54
|
};
|
|
@@ -55,7 +58,8 @@ export declare class CollapsibleItemTemplate extends React.Component<PropsWithCh
|
|
|
55
58
|
componentDidUpdate(): void;
|
|
56
59
|
componentWillUnmount(): void;
|
|
57
60
|
render(): React.ReactElement<{
|
|
58
|
-
header:
|
|
61
|
+
header: string;
|
|
62
|
+
headingLevel: import("../../..").HeadingLevel;
|
|
59
63
|
class: string;
|
|
60
64
|
ref: (section: HTMLLimelCollapsibleSectionElement) => void;
|
|
61
65
|
'is-open': boolean;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Help } from '../../help/help.types';
|
|
3
|
-
import { HeadingLevel } from '
|
|
4
|
-
/**
|
|
5
|
-
* @param level - any value
|
|
6
|
-
* @returns whether the value is a heading level, from `1` to `6`
|
|
7
|
-
*/
|
|
8
|
-
export declare function isHeadingLevel(level: unknown): level is HeadingLevel;
|
|
3
|
+
import { HeadingLevel } from '../../../global/shared-types/heading-level.types';
|
|
9
4
|
/**
|
|
10
5
|
* The heading level that a title at the current depth in the form gets.
|
|
11
6
|
*/
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LimeObjectFieldTemplateProps } from './types';
|
|
3
|
+
import { HeadingLevel } from '../../../global/shared-types/heading-level.types';
|
|
3
4
|
export declare const ObjectFieldTemplate: (props: LimeObjectFieldTemplateProps) => React.FunctionComponentElement<React.FragmentProps> | React.ReactElement<{
|
|
4
5
|
header: string;
|
|
6
|
+
headingLevel: HeadingLevel;
|
|
5
7
|
id: string;
|
|
6
8
|
'is-open': boolean;
|
|
7
9
|
invalid: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Help } from '../help/help.types';
|
|
2
|
-
import { HeadingLevel } from '
|
|
2
|
+
import { HeadingLevel } from '../../global/shared-types/heading-level.types';
|
|
3
3
|
/**
|
|
4
4
|
* This is an internal and private component that `limel-form` uses to
|
|
5
5
|
* draw the heading of a section, a list or a custom component, together
|
|
@@ -24,6 +24,7 @@ import { MenuItem as MenuItem1 } from "./components";
|
|
|
24
24
|
import { CircularProgressSize } from "./components/circular-progress/circular-progress.types";
|
|
25
25
|
import { CodeDiffLayout } from "./components/code-diff/code-diff.types";
|
|
26
26
|
import { ColorScheme, Language } from "./components/code-editor/code-editor.types";
|
|
27
|
+
import { HeadingLevel } from "./global/shared-types/heading-level.types";
|
|
27
28
|
import { Action } from "./components/collapsible-section/action";
|
|
28
29
|
import { CustomColorSwatch, CustomPalette } from "./components/color-picker/color-picker.types";
|
|
29
30
|
import { Config } from "./global/config";
|
|
@@ -34,7 +35,7 @@ import { FileInfo } from "./global/shared-types/file.types";
|
|
|
34
35
|
import { ResizeOptions } from "./util/image-resize";
|
|
35
36
|
import { OfficeViewer } from "./components/file-viewer/file-viewer.types";
|
|
36
37
|
import { FlexContainerAlign, FlexContainerDirection, FlexContainerJustify } from "./components/flex-container/flex-container.types";
|
|
37
|
-
import { FormError, FormSchema,
|
|
38
|
+
import { FormError, FormSchema, ValidationError, ValidationStatus } from "./components/form/form.types";
|
|
38
39
|
import { Help } from "./components/help/help.types";
|
|
39
40
|
import { IconSize } from "./components/icon/icon.types";
|
|
40
41
|
import { InfoTileProgress } from "./components/info-tile/info-tile.types";
|
|
@@ -75,6 +76,7 @@ export { MenuItem as MenuItem1 } from "./components";
|
|
|
75
76
|
export { CircularProgressSize } from "./components/circular-progress/circular-progress.types";
|
|
76
77
|
export { CodeDiffLayout } from "./components/code-diff/code-diff.types";
|
|
77
78
|
export { ColorScheme, Language } from "./components/code-editor/code-editor.types";
|
|
79
|
+
export { HeadingLevel } from "./global/shared-types/heading-level.types";
|
|
78
80
|
export { Action } from "./components/collapsible-section/action";
|
|
79
81
|
export { CustomColorSwatch, CustomPalette } from "./components/color-picker/color-picker.types";
|
|
80
82
|
export { Config } from "./global/config";
|
|
@@ -85,7 +87,7 @@ export { FileInfo } from "./global/shared-types/file.types";
|
|
|
85
87
|
export { ResizeOptions } from "./util/image-resize";
|
|
86
88
|
export { OfficeViewer } from "./components/file-viewer/file-viewer.types";
|
|
87
89
|
export { FlexContainerAlign, FlexContainerDirection, FlexContainerJustify } from "./components/flex-container/flex-container.types";
|
|
88
|
-
export { FormError, FormSchema,
|
|
90
|
+
export { FormError, FormSchema, ValidationError, ValidationStatus } from "./components/form/form.types";
|
|
89
91
|
export { Help } from "./components/help/help.types";
|
|
90
92
|
export { IconSize } from "./components/icon/icon.types";
|
|
91
93
|
export { InfoTileProgress } from "./components/info-tile/info-tile.types";
|
|
@@ -1180,7 +1182,7 @@ export namespace Components {
|
|
|
1180
1182
|
* The level of the heading that the `header` is drawn with, from `1` for an `h1` to `6` for an `h6`. Set it so that the heading fits below the headings around the section. For example, when the section is below an `h2`, set it to `3`. It does not change how the heading looks.
|
|
1181
1183
|
* @default 2
|
|
1182
1184
|
*/
|
|
1183
|
-
"headingLevel":
|
|
1185
|
+
"headingLevel": HeadingLevel;
|
|
1184
1186
|
/**
|
|
1185
1187
|
* Icon to display in the header of the section
|
|
1186
1188
|
*/
|
|
@@ -1897,6 +1899,7 @@ export namespace Components {
|
|
|
1897
1899
|
* @exampleComponent limel-example-list-form
|
|
1898
1900
|
* @exampleComponent limel-example-dynamic-form
|
|
1899
1901
|
* @exampleComponent limel-example-custom-component-form
|
|
1902
|
+
* @exampleComponent limel-example-custom-component-header-form
|
|
1900
1903
|
* @exampleComponent limel-example-props-factory-form
|
|
1901
1904
|
* @exampleComponent limel-example-form-layout
|
|
1902
1905
|
* @exampleComponent limel-example-form-span-fields
|
|
@@ -1922,7 +1925,7 @@ export namespace Components {
|
|
|
1922
1925
|
*/
|
|
1923
1926
|
"errors": ValidationError;
|
|
1924
1927
|
/**
|
|
1925
|
-
* The level, from `1` to `6`, of the topmost headings in the form. The headings of the sections inside them get one level more for each level of nesting, down to `6`. Set it so that the headings of the form fit below the headings of the page around it. For example, when the form is in a section with an `h2` heading, set it to `3`.
|
|
1928
|
+
* The level, from `1` to `6`, of the topmost headings in the form. The headings of the sections inside them get one level more for each level of nesting, down to `6`. A collapsible section, and each item of a list that is shown as one, counts as a level too. Set it so that the headings of the form fit below the headings of the page around it. For example, when the form is in a section with an `h2` heading, set it to `3`.
|
|
1926
1929
|
* @default 1
|
|
1927
1930
|
*/
|
|
1928
1931
|
"headingLevel": HeadingLevel;
|
|
@@ -5745,6 +5748,7 @@ declare global {
|
|
|
5745
5748
|
* @exampleComponent limel-example-list-form
|
|
5746
5749
|
* @exampleComponent limel-example-dynamic-form
|
|
5747
5750
|
* @exampleComponent limel-example-custom-component-form
|
|
5751
|
+
* @exampleComponent limel-example-custom-component-header-form
|
|
5748
5752
|
* @exampleComponent limel-example-props-factory-form
|
|
5749
5753
|
* @exampleComponent limel-example-form-layout
|
|
5750
5754
|
* @exampleComponent limel-example-form-span-fields
|
|
@@ -8426,7 +8430,7 @@ declare namespace LocalJSX {
|
|
|
8426
8430
|
* The level of the heading that the `header` is drawn with, from `1` for an `h1` to `6` for an `h6`. Set it so that the heading fits below the headings around the section. For example, when the section is below an `h2`, set it to `3`. It does not change how the heading looks.
|
|
8427
8431
|
* @default 2
|
|
8428
8432
|
*/
|
|
8429
|
-
"headingLevel"?:
|
|
8433
|
+
"headingLevel"?: HeadingLevel;
|
|
8430
8434
|
/**
|
|
8431
8435
|
* Icon to display in the header of the section
|
|
8432
8436
|
*/
|
|
@@ -9232,6 +9236,7 @@ declare namespace LocalJSX {
|
|
|
9232
9236
|
* @exampleComponent limel-example-list-form
|
|
9233
9237
|
* @exampleComponent limel-example-dynamic-form
|
|
9234
9238
|
* @exampleComponent limel-example-custom-component-form
|
|
9239
|
+
* @exampleComponent limel-example-custom-component-header-form
|
|
9235
9240
|
* @exampleComponent limel-example-props-factory-form
|
|
9236
9241
|
* @exampleComponent limel-example-form-layout
|
|
9237
9242
|
* @exampleComponent limel-example-form-span-fields
|
|
@@ -9257,7 +9262,7 @@ declare namespace LocalJSX {
|
|
|
9257
9262
|
*/
|
|
9258
9263
|
"errors"?: ValidationError;
|
|
9259
9264
|
/**
|
|
9260
|
-
* The level, from `1` to `6`, of the topmost headings in the form. The headings of the sections inside them get one level more for each level of nesting, down to `6`. Set it so that the headings of the form fit below the headings of the page around it. For example, when the form is in a section with an `h2` heading, set it to `3`.
|
|
9265
|
+
* The level, from `1` to `6`, of the topmost headings in the form. The headings of the sections inside them get one level more for each level of nesting, down to `6`. A collapsible section, and each item of a list that is shown as one, counts as a level too. Set it so that the headings of the form fit below the headings of the page around it. For example, when the form is in a section with an `h2` heading, set it to `3`.
|
|
9261
9266
|
* @default 1
|
|
9262
9267
|
*/
|
|
9263
9268
|
"headingLevel"?: HeadingLevel;
|
|
@@ -12158,7 +12163,7 @@ declare namespace LocalJSX {
|
|
|
12158
12163
|
interface LimelCollapsibleSectionAttributes {
|
|
12159
12164
|
"isOpen": boolean;
|
|
12160
12165
|
"header": string;
|
|
12161
|
-
"headingLevel":
|
|
12166
|
+
"headingLevel": HeadingLevel;
|
|
12162
12167
|
"icon": IconName | Icon;
|
|
12163
12168
|
"invalid": boolean;
|
|
12164
12169
|
"language": Languages;
|
|
@@ -13384,6 +13389,7 @@ declare module "@stencil/core" {
|
|
|
13384
13389
|
* @exampleComponent limel-example-list-form
|
|
13385
13390
|
* @exampleComponent limel-example-dynamic-form
|
|
13386
13391
|
* @exampleComponent limel-example-custom-component-form
|
|
13392
|
+
* @exampleComponent limel-example-custom-component-header-form
|
|
13387
13393
|
* @exampleComponent limel-example-props-factory-form
|
|
13388
13394
|
* @exampleComponent limel-example-form-layout
|
|
13389
13395
|
* @exampleComponent limel-example-form-span-fields
|
|
@@ -19,7 +19,7 @@ export * from './components/flex-container/flex-container.types';
|
|
|
19
19
|
export * from './global/shared-types/custom-element.types';
|
|
20
20
|
export * from './global/config';
|
|
21
21
|
export * from './global/shared-types/link.types';
|
|
22
|
-
export { EventEmitter, ValidationStatus, FormError, ValidationError, FormComponent, FormInfo, FormSchema,
|
|
22
|
+
export { EventEmitter, ValidationStatus, FormError, ValidationError, FormComponent, FormInfo, FormSchema, LimeSchemaOptions, LimeLayoutOptions, FormComponentOptions, FormLayoutOptions, GridLayoutOptions, RowLayoutOptions, FormLayoutType, ReplaceObjectType, FormSchemaArrayItem, FormSubKeySchema, } from './components/form/form.types';
|
|
23
23
|
export * from './components/help/help.types';
|
|
24
24
|
export * from './components/icon/icon.types';
|
|
25
25
|
export * from './components/info-tile/info-tile.types';
|
|
@@ -45,6 +45,7 @@ export * from './global/shared-types/separator.types';
|
|
|
45
45
|
export * from './global/shared-types/icon.types';
|
|
46
46
|
export * from './global/shared-types/image.types';
|
|
47
47
|
export * from './global/shared-types/color.types';
|
|
48
|
+
export * from './global/shared-types/heading-level.types';
|
|
48
49
|
export * from './components/text-editor/text-editor.types';
|
|
49
50
|
export * from './components/text-editor/types';
|
|
50
51
|
export * from './components/text-editor/prosemirror-adapter/menu/types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HeadingLevel } from '../global/shared-types/heading-level.types';
|
|
2
|
+
/**
|
|
3
|
+
* @param level - any value
|
|
4
|
+
* @returns whether the value is a heading level, from `1` to `6`
|
|
5
|
+
*/
|
|
6
|
+
export declare function isHeadingLevel(level: unknown): level is HeadingLevel;
|
|
7
|
+
//# sourceMappingURL=heading-level.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-elements",
|
|
3
|
-
"version": "40.
|
|
3
|
+
"version": "40.18.0",
|
|
4
4
|
"description": "Lime Elements",
|
|
5
5
|
"author": "Lime Technologies",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"morphdom": "^2.7.8",
|
|
94
94
|
"number-abbreviate": "^2.0.0",
|
|
95
95
|
"parse-css-color": "^0.2.1",
|
|
96
|
-
"postal-mime": "^4.
|
|
96
|
+
"postal-mime": "^4.1.4",
|
|
97
97
|
"prettier": "^3.9.10",
|
|
98
98
|
"prosemirror-example-setup": "^1.2.3",
|
|
99
99
|
"prosemirror-markdown": "^1.13.9",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as o,h as t,a as i}from"./p-BU9IJqli.js";import{d as n}from"./p-z_E3sq3p.js";import{m as s,r}from"./p-CIf8aGSd.js";import{c as a}from"./p-BrjD-ITe.js";import{b as l,d as c,g as d}from"./p-CgNJbSP4.js";import{t as p}from"./p-B26k4gw8.js";import"./p-ChagAaNf.js";function h(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=1&&e<=6}const g=class{constructor(i){e(this,i),this.open=o(this,"open",7),this.close=o(this,"close",7),this.action=o(this,"action",7),this.isOpen=!1,this.headingLevel=2,this.invalid=!1,this.language="en",this.bodyId=a(),this.headingId=a(),this.onClick=()=>{this.handleInteraction()},this.handleInteraction=()=>{this.isOpen=!this.isOpen,this.isOpen?(this.open.emit(),setTimeout(n,100)):this.close.emit()},this.renderExpandCollapseSign=()=>t("div",{class:"expand-icon",role:"presentation","aria-hidden":"true"},t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"})),this.renderIcon=()=>{if(!this.icon)return;const e=d(this.icon),o=l(this.icon),i=c(this.icon);return t("limel-icon",{name:e,"aria-label":i,"aria-hidden":i?null:"true",style:{color:`${o}`}})},this.renderHeading=()=>{if(!this.header)return;const e=`h${this.getHeadingLevel()}`;return t(e,{class:"title mdc-typography mdc-typography--headline2",id:this.headingId},this.header)},this.renderActions=()=>{if(this.actions)return t("div",{class:"actions"},this.actions.map(this.renderActionButton))},this.renderActionButton=e=>t("limel-icon-button",{icon:e.icon,label:e.label,disabled:e.disabled,onClick:this.handleActionClick(e)}),this.handleActionClick=e=>o=>{o.stopPropagation(),this.action.emit(e)},this.getCollapsibleSectionAriaLabel=()=>p.get(this.isOpen?"collapsible-section.close":"collapsible-section.open",this.language,{header:this.header?`"${this.header}"`:" "})}componentWillLoad(){this.warnIfHeadingLevelIsInvalid()}handleHeadingLevelChange(){this.warnIfHeadingLevelIsInvalid()}componentDidRender(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");s(e)}disconnectedCallback(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");r(e)}render(){return t("section",{key:"1cb8db604bbbc8f8dbb7ca97895b3cfcf4dcd80b",class:this.isOpen?"open":"","aria-invalid":this.invalid,"aria-labelledby":this.header?this.headingId:null},t("header",{key:"4e55c5b636b1d049df4d77a77a35285648096ea0"},t("button",{key:"29eefb5499fb0f00cbdf513698acf8f357a935a6",class:"open-close-toggle",onClick:this.onClick,"aria-controls":this.bodyId,"aria-expanded":this.isOpen?"true":"false","aria-label":this.getCollapsibleSectionAriaLabel(),type:"button"}),this.renderExpandCollapseSign(),this.renderIcon(),this.renderHeading(),t("div",{key:"16ec84abfe81a812c9d30188a714b58d363ca8a3",class:"divider-line",role:"presentation"}),this.renderHeaderSlot(),this.renderActions()),t("div",{key:"f28ff7d73f05dc1a6ca0dcd9948cb67107647598",class:"body",inert:!this.isOpen,"aria-hidden":String(!this.isOpen),id:this.bodyId,role:"region"},t("slot",{key:"33d0fda5501c178f92dff4a1b0361a43829fe095"})))}getHeadingLevel(){return h(this.headingLevel)?this.headingLevel:2}warnIfHeadingLevelIsInvalid(){h(this.headingLevel)||console.warn(`limel-collapsible-section: headingLevel must be a whole number from 1 to 6, but it is ${this.headingLevel}. The heading is drawn as an h2 instead.`)}renderHeaderSlot(){return t("slot",{name:"header"})}get host(){return i(this)}static get watchers(){return{headingLevel:[{handleHeadingLevelChange:0}]}}};g.style='@charset "UTF-8";.expand-icon{position:relative;display:flex;align-items:center;justify-content:center;height:1.875rem;margin:0 0 0 0.5rem;width:0.75rem;flex-shrink:0}.line{position:absolute;inset:auto;margin:auto;width:100%;border-radius:1rem;height:0.125rem}.line:first-of-type,.line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s;opacity:0;background-color:var(--header-stroke-color, rgb(var(--contrast-900)))}.line:nth-of-type(2){transform:translate3d(0, 0.25rem, 0) rotate(90deg)}.line:nth-of-type(3){transform:translate3d(0, -0.25rem, 0) rotate(-90deg)}.line:nth-of-type(2),.line:nth-of-type(3){transition:opacity 0.2s ease, transform 0.18s ease}.line:nth-of-type(2):before,.line:nth-of-type(2):after,.line:nth-of-type(3):before,.line:nth-of-type(3):after{content:"";position:absolute;inset:0;margin:auto;width:50%;height:100%;border-radius:inherit;background-color:var(--header-stroke-color, rgb(var(--contrast-900)))}.line:nth-of-type(2):before,.line:nth-of-type(3):before{transform:translate3d(0, -0.1rem, 0) rotate(45deg)}.line:nth-of-type(2):after,.line:nth-of-type(3):after{transform:translate3d(0, 0.1rem, 0) rotate(-45deg)}.open-close-toggle:hover+.expand-icon .line:first-of-type,.open-close-toggle:hover+.expand-icon .line:last-of-type,.open-close-toggle:focus-visible+.expand-icon .line:first-of-type,.open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transition:opacity 0.8s ease 0.4s, transform 0.4s ease 0.3s;opacity:1}.open-close-toggle:hover+.expand-icon .line:first-of-type,.open-close-toggle:focus-visible+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:last-of-type,.open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2),.open-close-toggle:hover+.expand-icon .line:nth-of-type(3),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transition:opacity 0.5s ease 0.4s, transform 0.7s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2){transform:translate3d(0, 0.5rem, 0) rotate(90deg);opacity:0.4}.open-close-toggle:hover+.expand-icon .line:nth-of-type(3),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transform:translate3d(0, -0.5rem, 0) rotate(-90deg);opacity:0.4}section.open .line:first-of-type,section.open .line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s;opacity:1}section.open .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:nth-of-type(2),section.open .line:nth-of-type(3){transition:opacity 1s ease, transform 0.4s ease}section.open .line:nth-of-type(2){transform:translate3d(0, 1rem, 0) rotate(90deg);opacity:0}section.open .line:nth-of-type(3){transform:translate3d(0, -1rem, 0) rotate(-90deg);opacity:0}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type,section.open .open-close-toggle:hover+.expand-icon .line:last-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:first-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transition:opacity 0.2s ease 0.4s, transform 0.4s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 45deg)}section.open .open-close-toggle:hover+.expand-icon .line:last-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, -45deg)}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(2),section.open .open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2){transform:translate3d(0, 1rem, 0) rotate(90deg);opacity:0}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(3),section.open .open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transform:translate3d(0, -1rem, 0) rotate(-90deg);opacity:0}:host(limel-collapsible-section){--border-radius-of-header:0.75rem;display:block}:host([hidden]){display:none}button.open-close-toggle{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;position:absolute;inset:0;width:100%}button.open-close-toggle:focus{outline:none}button.open-close-toggle:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button.open-close-toggle{transition:background-color 0.4s ease, border-radius 0.1s ease;cursor:pointer;z-index:-1;background-color:var(--closed-header-background-color, rgb(var(--contrast-200)));border-radius:var(--border-radius-of-header)}button.open-close-toggle:hover,button.open-close-toggle:focus-visible{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}section.open button.open-close-toggle{background-color:var(--open-header-background-color, rgb(var(--contrast-100)));border-radius:var(--border-radius-of-header) var(--border-radius-of-header) var(--limel-cs-open-header-bottom-border-radius, 0) var(--limel-cs-open-header-bottom-border-radius, 0)}section.open button.open-close-toggle:hover,section.open button.open-close-toggle:focus-visible{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}.title,.divider-line,.expand-icon{pointer-events:none}section{transition:box-shadow 0.4s ease;border-radius:var(--border-radius-of-header)}section[aria-invalid]:not([aria-invalid=false]){--header-stroke-color:rgb(var(--color-red-default)) !important}section[aria-invalid]:not([aria-invalid=false]):not(.open){box-shadow:0 0 0 1px rgb(var(--color-red-default))}header{isolation:isolate;position:relative;align-items:center;display:flex;justify-content:space-between;gap:0.5rem;padding-left:0.5rem;height:2.5rem}limel-icon{width:1.5rem;flex-shrink:0}.title{font-size:1rem;font-weight:300;color:var(--limel-theme-on-surface-color);justify-self:flex-start;user-select:none;height:auto;max-height:3rem;line-height:1.2rem;display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.divider-line{transition:opacity 0.3s ease 0.3s;flex-grow:1;height:0.125rem;border-radius:1rem;background-color:var(--header-stroke-color, rgb(var(--contrast-900)));opacity:0;margin-right:0.5rem}section.open .divider-line{opacity:0.16}.actions{justify-self:flex-end;flex-shrink:0}::slotted([slot=header]){margin-right:0.5rem}.body{background-color:var(--body-background-color, var(--contrast-100));padding-left:var(--body-padding, 1.25rem);padding-right:var(--body-padding, 1.25rem);border-radius:0 0 var(--border-radius-of-header) var(--border-radius-of-header)}.body{transition:grid-template-rows var(--limel-cs-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89);display:grid;grid-template-rows:var(--limel-cs-grid-template-rows)}.body slot{transition:opacity var(--limel-cs-opacity-transition-speed) ease var(--limel-cs-opacity-transition-delay);display:block;overflow:hidden}:host(limel-collapsible-section:not([is-open])){--limel-cs-opacity-transition-speed:0.1s;--limel-cs-opacity-transition-delay:0s;--limel-cs-grid-template-rows-transition-speed:0.3s;--limel-cs-grid-template-rows:0fr}:host(limel-collapsible-section:not([is-open])) slot{opacity:0}:host(limel-collapsible-section[is-open]){--limel-cs-opacity-transition-speed:0.4s;--limel-cs-opacity-transition-delay:0.3s;--limel-cs-grid-template-rows-transition-speed:0.46s;--limel-cs-grid-template-rows:1fr}:host(limel-collapsible-section[is-open]) slot{opacity:1}header:hover+.body,header:has(.open-close-toggle:hover)+.body,header:has(.open-close-toggle:focus-visible)+.body{will-change:grid-template-rows}header:hover+.body slot,header:has(.open-close-toggle:hover)+.body slot,header:has(.open-close-toggle:focus-visible)+.body slot{will-change:opacity}';export{g as limel_collapsible_section}
|