@sky.ui/core 0.0.40 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +2011 -1275
- package/dist/helper/controllers/animation-controller.d.ts +4 -4
- package/dist/helper/controllers/animation-controller.js.map +1 -1
- package/dist/helper/controllers/index.d.ts +1 -0
- package/dist/helper/controllers/index.js +1 -1
- package/dist/helper/controllers/popover-controller.d.ts +12 -12
- package/dist/helper/controllers/popover-controller.js.map +1 -1
- package/dist/helper/controllers/preset-controller.d.ts +55 -0
- package/dist/helper/controllers/preset-controller.js +2 -0
- package/dist/helper/controllers/preset-controller.js.map +1 -0
- package/dist/helper/iconify-offline.js.map +1 -1
- package/dist/helper/index.js +1 -1
- package/dist/helper/internals/form-control-base.d.ts +6 -6
- package/dist/helper/internals/form-control-base.js.map +1 -1
- package/dist/helper/styles/focus-ring.d.ts +10 -0
- package/dist/helper/styles/focus-ring.js +10 -0
- package/dist/helper/styles/focus-ring.js.map +1 -0
- package/dist/helper/utils/color-resolver.d.ts +0 -14
- package/dist/helper/utils/color-resolver.js +1 -1
- package/dist/helper/utils/color-resolver.js.map +1 -1
- package/dist/helper/utils/component-presets.d.ts +132 -0
- package/dist/helper/utils/component-presets.js +2 -0
- package/dist/helper/utils/component-presets.js.map +1 -0
- package/dist/helper/utils/contrast-color.d.ts +6 -6
- package/dist/helper/utils/contrast-color.js.map +1 -1
- package/dist/helper/utils/index.d.ts +1 -0
- package/dist/helper/utils/index.js +1 -1
- package/dist/helper/utils/size-resolver.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/sky-alert/sky-alert.d.ts +15 -7
- package/dist/sky-alert/sky-alert.js +10 -20
- package/dist/sky-alert/sky-alert.js.map +1 -1
- package/dist/sky-appbar/sky-appbar.d.ts +9 -3
- package/dist/sky-appbar/sky-appbar.js +27 -19
- package/dist/sky-appbar/sky-appbar.js.map +1 -1
- package/dist/sky-avatar/sky-avatar.d.ts +6 -2
- package/dist/sky-avatar/sky-avatar.js +17 -14
- package/dist/sky-avatar/sky-avatar.js.map +1 -1
- package/dist/sky-badge/sky-badge.d.ts +9 -5
- package/dist/sky-badge/sky-badge.js +12 -16
- package/dist/sky-badge/sky-badge.js.map +1 -1
- package/dist/sky-button/sky-button.d.ts +27 -7
- package/dist/sky-button/sky-button.js +24 -32
- package/dist/sky-button/sky-button.js.map +1 -1
- package/dist/sky-card/sky-card.d.ts +13 -5
- package/dist/sky-card/sky-card.js +24 -24
- package/dist/sky-card/sky-card.js.map +1 -1
- package/dist/sky-checkbox/sky-checkbox.d.ts +6 -3
- package/dist/sky-checkbox/sky-checkbox.js +43 -44
- package/dist/sky-checkbox/sky-checkbox.js.map +1 -1
- package/dist/sky-chip/sky-chip.d.ts +7 -3
- package/dist/sky-chip/sky-chip.js +35 -43
- package/dist/sky-chip/sky-chip.js.map +1 -1
- package/dist/sky-col/sky-col.d.ts +7 -3
- package/dist/sky-col/sky-col.js +6 -11
- package/dist/sky-col/sky-col.js.map +1 -1
- package/dist/sky-combobox/sky-combobox.d.ts +15 -8
- package/dist/sky-combobox/sky-combobox.js +193 -257
- package/dist/sky-combobox/sky-combobox.js.map +1 -1
- package/dist/sky-dialog/sky-dialog.d.ts +7 -3
- package/dist/sky-dialog/sky-dialog.js +22 -20
- package/dist/sky-dialog/sky-dialog.js.map +1 -1
- package/dist/sky-divider/sky-divider.d.ts +6 -2
- package/dist/sky-divider/sky-divider.js +5 -5
- package/dist/sky-divider/sky-divider.js.map +1 -1
- package/dist/sky-flexbox/sky-flexbox.d.ts +10 -6
- package/dist/sky-flexbox/sky-flexbox.js +6 -6
- package/dist/sky-flexbox/sky-flexbox.js.map +1 -1
- package/dist/sky-flexcol/sky-flexcol.d.ts +6 -2
- package/dist/sky-flexcol/sky-flexcol.js +2 -2
- package/dist/sky-flexcol/sky-flexcol.js.map +1 -1
- package/dist/sky-form/sky-form.d.ts +15 -11
- package/dist/sky-form/sky-form.js +14 -14
- package/dist/sky-form/sky-form.js.map +1 -1
- package/dist/sky-grid/sky-grid.d.ts +5 -1
- package/dist/sky-grid/sky-grid.js +3 -3
- package/dist/sky-grid/sky-grid.js.map +1 -1
- package/dist/sky-icon/sky-icon.d.ts +3 -0
- package/dist/sky-icon/sky-icon.js +4 -4
- package/dist/sky-icon/sky-icon.js.map +1 -1
- package/dist/sky-image/sky-image.d.ts +8 -4
- package/dist/sky-image/sky-image.js +5 -5
- package/dist/sky-image/sky-image.js.map +1 -1
- package/dist/sky-image/srcset-utils.js.map +1 -1
- package/dist/sky-input/sky-input.d.ts +9 -5
- package/dist/sky-input/sky-input.js +155 -170
- package/dist/sky-input/sky-input.js.map +1 -1
- package/dist/sky-list/sky-list.d.ts +7 -3
- package/dist/sky-list/sky-list.js +6 -4
- package/dist/sky-list/sky-list.js.map +1 -1
- package/dist/sky-listitem/sky-listitem.d.ts +5 -1
- package/dist/sky-listitem/sky-listitem.js +10 -7
- package/dist/sky-listitem/sky-listitem.js.map +1 -1
- package/dist/sky-radio/sky-radio.d.ts +9 -4
- package/dist/sky-radio/sky-radio.js +7 -9
- package/dist/sky-radio/sky-radio.js.map +1 -1
- package/dist/sky-row/sky-row.d.ts +4 -1
- package/dist/sky-row/sky-row.js +2 -2
- package/dist/sky-row/sky-row.js.map +1 -1
- package/dist/sky-sheet/sky-sheet.d.ts +11 -6
- package/dist/sky-sheet/sky-sheet.js +23 -23
- package/dist/sky-sheet/sky-sheet.js.map +1 -1
- package/dist/sky-simple-table/sky-simple-table.d.ts +7 -3
- package/dist/sky-simple-table/sky-simple-table.js +4 -7
- package/dist/sky-simple-table/sky-simple-table.js.map +1 -1
- package/dist/sky-theme-provider/sky-theme-provider.d.ts +26 -26
- package/dist/sky-theme-provider/sky-theme-provider.js +2 -2
- package/dist/sky-theme-provider/sky-theme-provider.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as e,LitElement as t,html as r}from"lit";import{property as o,customElement as
|
|
1
|
+
import{css as e,LitElement as t,html as r}from"lit";import{property as o,customElement as s}from"lit/decorators.js";import{classMap as a}from"lit/directives/class-map.js";import{resolveRadius as i}from"../helper/utils/size-resolver.js";import{resolveColor as n}from"../helper/utils/color-resolver.js";import{PresetController as d}from"../helper/controllers/preset-controller.js";var l=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(e,t,r,o)=>{for(var s,a=o>1?void 0:o?p(t,r):t,i=e.length-1;i>=0;i--)(s=e[i])&&(a=(o?s(t,r,a):s(a))||a);return o&&a&&l(t,r,a),a};let c=class extends t{constructor(){super(...arguments),this.bg="primary",this.blurLevel="none",this.radius="md",this.bodyPadding="none",this.elevation="md",this.outlined=!1,this.clickable=!1,this.headerBg="transparent",this.headerBlur="none",this.headerPadding="md",this.headerLayout="inline",this.headerInsetGap="sm",this.headerRadius="md",this.headerSeparatorColor="border-light",this.footerBg="transparent",this.footerBlur="none",this.footerPadding="md",this.footerLayout="inline",this.footerInsetGap="sm",this.footerRadius="md",this.footerSeparatorColor="border-light",this.padRatio=1,this.separators="none",this.overlays="none",this.insets="none",this._effHeaderSeparator=!1,this._effFooterSeparator=!1,this._effHeaderOverlay=!1,this._effFooterOverlay=!1,this._effHeaderInset=!1,this._effFooterInset=!1,this._varsCache={},this.preset="",this._presets=new d(this)}static _composeBackdrop(e){const t=c.BLUR_MAP[e]??e;return"none"===t?"none":`${t} var(--sky-saturation-secondary) var(--sky-brightness-secondary)`}static _composeElevation(e){const t={none:null,sm:"var(--sky-box-shadow-primary)",md:"var(--sky-box-shadow-secondary)",lg:"var(--sky-box-shadow-tertiary)"}[e];return null===t?"none":void 0===t?e:`var(--sky-box-shadow-inset), ${t}`}firstUpdated(){this._wireSlotChangeHandlers(),this._syncHeader(),this._syncFooter()}update(e){(e.has("separators")||e.has("overlays")||e.has("insets"))&&this._computeEffectiveFlags(),(e.has("bg")||e.has("blurLevel")||e.has("radius")||e.has("elevation")||e.has("preset"))&&this._applyCardVars(),(e.has("headerPadding")||e.has("bodyPadding")||e.has("footerPadding")||e.has("padRatio")||e.has("preset"))&&this._applyPaddingVars(),(e.has("headerBg")||e.has("footerBg")||e.has("headerBlur")||e.has("footerBlur")||e.has("headerRadius")||e.has("footerRadius")||e.has("headerInsetGap")||e.has("footerInsetGap")||e.has("headerSeparatorColor")||e.has("footerSeparatorColor")||e.has("separators")||e.has("insets")||e.has("overlays")||e.has("preset"))&&this._applySectionChrome(),super.update(e)}_wireSlotChangeHandlers(){this.renderRoot.querySelector("#slot-title")?.addEventListener("slotchange",()=>this._syncHeader()),this.renderRoot.querySelector("#slot-subtitle")?.addEventListener("slotchange",()=>this._syncHeader()),this.renderRoot.querySelector("#slot-actions")?.addEventListener("slotchange",()=>this._syncHeader()),this.renderRoot.querySelector("#slot-f-title")?.addEventListener("slotchange",()=>this._syncFooter()),this.renderRoot.querySelector("#slot-f-subtitle")?.addEventListener("slotchange",()=>this._syncFooter()),this.renderRoot.querySelector("#slot-f-actions")?.addEventListener("slotchange",()=>this._syncFooter())}_syncHeader(){const e=this.renderRoot.querySelector("#hdr"),t=[this.renderRoot.querySelector("#slot-title"),this.renderRoot.querySelector("#slot-subtitle"),this.renderRoot.querySelector("#slot-actions")].filter(Boolean),r=t.some(e=>e.assignedNodes({flatten:!0}).length>0);e?.toggleAttribute("has-content",r),t.forEach(e=>e.toggleAttribute("empty",0===e.assignedNodes({flatten:!0}).length))}_syncFooter(){const e=this.renderRoot.querySelector("#ftr"),t=[this.renderRoot.querySelector("#slot-f-title"),this.renderRoot.querySelector("#slot-f-subtitle"),this.renderRoot.querySelector("#slot-f-actions")].filter(Boolean),r=t.some(e=>e.assignedNodes({flatten:!0}).length>0);e?.toggleAttribute("has-content",r),t.forEach(e=>e.toggleAttribute("empty",0===e.assignedNodes({flatten:!0}).length))}_expandPair(e){switch(e){case"both":return[!0,!0];case"header":return[!0,!1];case"footer":return[!1,!0];default:return[!1,!1]}}_computeEffectiveFlags(){[this._effHeaderSeparator,this._effFooterSeparator]=this._expandPair(this.separators),[this._effHeaderOverlay,this._effFooterOverlay]=this._expandPair(this.overlays),[this._effHeaderInset,this._effFooterInset]=this._expandPair(this.insets)}_setVar(e,t){this._varsCache[e]!==t&&(this.style.setProperty(e,t),this._varsCache[e]=t)}_resolveSectionBg(e,t,r){return t&&!r?c.SECTION_INSET_BG_MAP[e]??e:c.BG_MAP[e]??e}_resolveSectionGlassSurface(e){return c.GLASS_BG_TIERS.has(e)?"var(--sky-glass-surface)":"none"}_applyCardVars(){this._setVar("--_card-bg",c.BG_MAP[this.bg]??this.bg),this._setVar("--_card-glass-surface",c.GLASS_BG_TIERS.has(this.bg)?"var(--sky-glass-surface)":"none"),this._setVar("--_card-backdrop",c._composeBackdrop(this.blurLevel)),this._setVar("--_card-radius",i(this.radius)),this._setVar("--_card-shadow",c._composeElevation(this.elevation)),this._setVar("--_card-shadow-hover","var(--sky-box-shadow-inset), var(--sky-box-shadow-hover)")}_applyPaddingVars(){const e=c.SIZE_MAP[this.headerPadding]??this.headerPadding,t=c.SIZE_MAP[this.bodyPadding]??this.bodyPadding,r=c.SIZE_MAP[this.footerPadding]??this.footerPadding,o=Number.isFinite(this.padRatio)?Math.max(0,this.padRatio):1;this._setVar("--_header-pad-y",e),this._setVar("--_header-pad-x",`calc(${e} * ${o})`),this._setVar("--_body-pad-y",t),this._setVar("--_body-pad-x",`calc(${t} * ${o})`),this._setVar("--_footer-pad-y",r),this._setVar("--_footer-pad-x",`calc(${r} * ${o})`)}_applySectionChrome(){const e=this._effHeaderInset?"0px":this._effHeaderSeparator?"1px":"0px",t=this._effFooterInset?"0px":this._effFooterSeparator?"1px":"0px";this._setVar("--_header-separator",e),this._setVar("--_footer-separator",t),this._setVar("--_header-separator-color",n(this.headerSeparatorColor)),this._setVar("--_footer-separator-color",n(this.footerSeparatorColor));const r=this._effHeaderInset&&this._effHeaderSeparator?"1px solid var(--sky-border-light)":"0 solid transparent",o=this._effFooterInset&&this._effFooterSeparator?"1px solid var(--sky-border-light)":"0 solid transparent";this._setVar("--_header-inset-border",r),this._setVar("--_footer-inset-border",o),this._setVar("--_header-bg",this._resolveSectionBg(this.headerBg,this._effHeaderInset,this._effHeaderOverlay)),this._setVar("--_footer-bg",this._resolveSectionBg(this.footerBg,this._effFooterInset,this._effFooterOverlay)),this._setVar("--_header-glass-surface",this._effHeaderOverlay?this._resolveSectionGlassSurface(this.headerBg):"none"),this._setVar("--_footer-glass-surface",this._effFooterOverlay?this._resolveSectionGlassSurface(this.footerBg):"none"),this._setVar("--_header-backdrop",this._effHeaderOverlay?c._composeBackdrop(this.headerBlur):"none"),this._setVar("--_footer-backdrop",this._effFooterOverlay?c._composeBackdrop(this.footerBlur):"none"),this._setVar("--_header-radius",i(this.headerRadius)),this._setVar("--_footer-radius",i(this.footerRadius)),this._setVar("--_header-inset-gap",c.SIZE_MAP[this.headerInsetGap]??this.headerInsetGap),this._setVar("--_footer-inset-gap",c.SIZE_MAP[this.footerInsetGap]??this.footerInsetGap)}refreshLayout(){this._computeEffectiveFlags(),this._applyCardVars(),this._applyPaddingVars(),this._applySectionChrome(),this._syncHeader(),this._syncFooter()}render(){const e="inline"===this.headerLayout?"row":"stack",t="inline"===this.footerLayout?"row":"stack",o=a({section:!0,[e]:!0,"overlay-top":!!this._effHeaderOverlay,inset:!!this._effHeaderInset}),s=a({section:!0,[t]:!0,"overlay-bottom":!!this._effFooterOverlay,inset:!!this._effFooterInset});return r`
|
|
2
2
|
<div class="card" part="card">
|
|
3
3
|
<div class=${o} part="header" id="hdr">
|
|
4
4
|
<div class="main">
|
|
@@ -10,7 +10,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,customE
|
|
|
10
10
|
|
|
11
11
|
<slot></slot>
|
|
12
12
|
|
|
13
|
-
<div class=${
|
|
13
|
+
<div class=${s} part="footer" id="ftr">
|
|
14
14
|
<div class="main">
|
|
15
15
|
<slot name="footer-title" id="slot-f-title"></slot>
|
|
16
16
|
<slot name="footer-subtitle" id="slot-f-subtitle"></slot>
|
|
@@ -18,7 +18,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,customE
|
|
|
18
18
|
<slot name="footer-actions" id="slot-f-actions"></slot>
|
|
19
19
|
</div>
|
|
20
20
|
</div>
|
|
21
|
-
`}};
|
|
21
|
+
`}};c.BG_MAP={primary:"var(--sky-glass-primary)",secondary:"var(--sky-glass-secondary)",tertiary:"var(--sky-glass-tertiary)",transparent:"transparent"},c.BLUR_MAP={none:"none",xs:"blur(2px)",sm:"var(--sky-blur-secondary)",md:"var(--sky-blur-secondary)",lg:"var(--sky-blur-tertiary)"},c.SIZE_MAP={none:"0",sm:"var(--sky-space-1\\.5, 6px)",md:"var(--sky-space-4, 16px)",lg:"var(--sky-space-6, 24px)",xl:"var(--sky-space-8, 32px)"},c.GLASS_BG_TIERS=new Set(["primary","secondary","tertiary"]),c.SECTION_INSET_BG_MAP={primary:"var(--sky-hover-primary)",secondary:"var(--sky-hover-secondary)",tertiary:"var(--sky-hover-tertiary)",transparent:"transparent"},c.styles=e`
|
|
22
22
|
:host {
|
|
23
23
|
display: block;
|
|
24
24
|
}
|
|
@@ -99,11 +99,11 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,customE
|
|
|
99
99
|
overflow: hidden;
|
|
100
100
|
box-shadow: none;
|
|
101
101
|
}
|
|
102
|
-
.section.inset[part=
|
|
102
|
+
.section.inset[part="header"] {
|
|
103
103
|
border: var(--_header-inset-border, 0 solid transparent);
|
|
104
104
|
border-radius: var(--_header-radius, var(--sky-radius-secondary));
|
|
105
105
|
}
|
|
106
|
-
.section.inset[part=
|
|
106
|
+
.section.inset[part="footer"] {
|
|
107
107
|
border: var(--_footer-inset-border, 0 solid transparent);
|
|
108
108
|
border-radius: var(--_footer-radius, var(--sky-radius-secondary));
|
|
109
109
|
}
|
|
@@ -118,39 +118,39 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,customE
|
|
|
118
118
|
right: var(--_footer-inset-gap, var(--sky-space-2, 8px));
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
.section[part=
|
|
122
|
-
.section[part=
|
|
121
|
+
.section[part="header"]:has(slot:not([empty])),
|
|
122
|
+
.section[part="header"][has-content] {
|
|
123
123
|
background: var(--_header-bg);
|
|
124
124
|
background-image: var(--_header-glass-surface, none);
|
|
125
125
|
padding-block: var(--_header-pad-y, var(--sky-space-3, 12px));
|
|
126
126
|
padding-inline: var(--_header-pad-x, var(--sky-space-4, 16px));
|
|
127
127
|
}
|
|
128
|
-
.section[part=
|
|
129
|
-
.section[part=
|
|
128
|
+
.section[part="footer"]:has(slot:not([empty])),
|
|
129
|
+
.section[part="footer"][has-content] {
|
|
130
130
|
background: var(--_footer-bg);
|
|
131
131
|
background-image: var(--_footer-glass-surface, none);
|
|
132
132
|
padding-block: var(--_footer-pad-y, var(--sky-space-3, 12px));
|
|
133
133
|
padding-inline: var(--_footer-pad-x, var(--sky-space-4, 16px));
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.section[part=
|
|
137
|
-
.section[part=
|
|
136
|
+
.section[part="header"].overlay-top:has(slot:not([empty])),
|
|
137
|
+
.section[part="header"].overlay-top[has-content] {
|
|
138
138
|
backdrop-filter: var(--_header-backdrop, none);
|
|
139
139
|
-webkit-backdrop-filter: var(--_header-backdrop, none);
|
|
140
140
|
}
|
|
141
|
-
.section[part=
|
|
142
|
-
.section[part=
|
|
141
|
+
.section[part="footer"].overlay-bottom:has(slot:not([empty])),
|
|
142
|
+
.section[part="footer"].overlay-bottom[has-content] {
|
|
143
143
|
backdrop-filter: var(--_footer-backdrop, none);
|
|
144
144
|
-webkit-backdrop-filter: var(--_footer-backdrop, none);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
.section[part=
|
|
148
|
-
.section[part=
|
|
147
|
+
.section[part="header"]:not(.inset):has(slot:not([empty])),
|
|
148
|
+
.section[part="header"]:not(.inset)[has-content] {
|
|
149
149
|
border-bottom: var(--_header-separator, 0px) solid
|
|
150
150
|
var(--_header-separator-color, var(--sky-border-light));
|
|
151
151
|
}
|
|
152
|
-
.section[part=
|
|
153
|
-
.section[part=
|
|
152
|
+
.section[part="footer"]:not(.inset):has(slot:not([empty])),
|
|
153
|
+
.section[part="footer"]:not(.inset)[has-content] {
|
|
154
154
|
border-top: var(--_footer-separator, 0px) solid
|
|
155
155
|
var(--_footer-separator-color, var(--sky-border-light));
|
|
156
156
|
}
|
|
@@ -164,7 +164,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,customE
|
|
|
164
164
|
display: none;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
::slotted([slot=
|
|
167
|
+
::slotted([slot="title"]) {
|
|
168
168
|
font-size: var(--sky-font-size-lg, 18px);
|
|
169
169
|
font-weight: var(--sky-font-weight-semibold, 600);
|
|
170
170
|
margin: 0;
|
|
@@ -172,33 +172,33 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,customE
|
|
|
172
172
|
text-align: start;
|
|
173
173
|
text-shadow: var(--sky-text-shadow-on-glass, none);
|
|
174
174
|
}
|
|
175
|
-
::slotted([slot=
|
|
175
|
+
::slotted([slot="subtitle"]) {
|
|
176
176
|
font-size: var(--sky-font-size-sm, 14px);
|
|
177
177
|
margin: 0;
|
|
178
178
|
color: var(--sky-text-secondary);
|
|
179
179
|
text-align: start;
|
|
180
180
|
text-shadow: var(--sky-text-shadow-on-glass, none);
|
|
181
181
|
}
|
|
182
|
-
::slotted([slot=
|
|
182
|
+
::slotted([slot="actions"]) {
|
|
183
183
|
display: inline-flex;
|
|
184
184
|
gap: var(--sky-space-1\\.5, 6px);
|
|
185
185
|
align-items: center;
|
|
186
186
|
margin-left: auto;
|
|
187
187
|
}
|
|
188
|
-
::slotted([slot=
|
|
188
|
+
::slotted([slot="footer-title"]) {
|
|
189
189
|
font-size: var(--sky-font-size-md, 16px);
|
|
190
190
|
font-weight: var(--sky-font-weight-medium, 500);
|
|
191
191
|
margin: 0;
|
|
192
192
|
color: var(--sky-text-primary);
|
|
193
193
|
text-align: start;
|
|
194
194
|
}
|
|
195
|
-
::slotted([slot=
|
|
195
|
+
::slotted([slot="footer-subtitle"]) {
|
|
196
196
|
font-size: var(--sky-font-size-xs, 12px);
|
|
197
197
|
margin: 0;
|
|
198
198
|
color: var(--sky-text-secondary);
|
|
199
199
|
text-align: start;
|
|
200
200
|
}
|
|
201
|
-
::slotted([slot=
|
|
201
|
+
::slotted([slot="footer-actions"]) {
|
|
202
202
|
display: inline-flex;
|
|
203
203
|
gap: var(--sky-space-1\\.5, 6px);
|
|
204
204
|
align-items: center;
|
|
@@ -214,5 +214,5 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,customE
|
|
|
214
214
|
transition: none;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
`,h([o({type:String,reflect:!0})],
|
|
217
|
+
`,h([o({type:String,reflect:!0})],c.prototype,"bg",2),h([o({type:String,reflect:!0})],c.prototype,"blurLevel",2),h([o({type:String,reflect:!0})],c.prototype,"radius",2),h([o({type:String,reflect:!0})],c.prototype,"bodyPadding",2),h([o({type:String,reflect:!0})],c.prototype,"elevation",2),h([o({type:Boolean,reflect:!0})],c.prototype,"outlined",2),h([o({type:Boolean,reflect:!0})],c.prototype,"clickable",2),h([o({type:String,reflect:!0})],c.prototype,"headerBg",2),h([o({type:String,reflect:!0})],c.prototype,"headerBlur",2),h([o({type:String,reflect:!0})],c.prototype,"headerPadding",2),h([o({type:String})],c.prototype,"headerLayout",2),h([o({type:String,reflect:!0})],c.prototype,"headerInsetGap",2),h([o({type:String,reflect:!0})],c.prototype,"headerRadius",2),h([o({type:String})],c.prototype,"headerSeparatorColor",2),h([o({type:String,reflect:!0})],c.prototype,"footerBg",2),h([o({type:String,reflect:!0})],c.prototype,"footerBlur",2),h([o({type:String,reflect:!0})],c.prototype,"footerPadding",2),h([o({type:String})],c.prototype,"footerLayout",2),h([o({type:String,reflect:!0})],c.prototype,"footerInsetGap",2),h([o({type:String,reflect:!0})],c.prototype,"footerRadius",2),h([o({type:String})],c.prototype,"footerSeparatorColor",2),h([o({type:Number})],c.prototype,"padRatio",2),h([o({type:String})],c.prototype,"separators",2),h([o({type:String})],c.prototype,"overlays",2),h([o({type:String})],c.prototype,"insets",2),h([o({type:String,reflect:!0})],c.prototype,"preset",2),c=h([s("sky-card")],c);export{c as SkyCard};
|
|
218
218
|
//# sourceMappingURL=sky-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky-card.js","sources":["../../src/sky-card/sky-card.ts"],"sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { resolveRadius } from '../helper/utils/size-resolver';\nimport { resolveColor } from '../helper/utils/color-resolver';\n\nexport type SkyCardElevation = 'none' | 'sm' | 'md' | 'lg';\nexport type SkyCardSectionLayout = 'inline' | 'stack';\nexport type SkyCardSectionTarget = 'both' | 'header' | 'footer' | 'none';\n\n/**\n * @element sky-card\n *\n * @summary Customizable card with configurable header/footer sections, blur/background styles, elevation, insets, overlays, and separators.\n *\n * @status stable\n * @since 1.0.0\n *\n * @documentation https://sky-ui.com/components/card\n *\n * @slot - Default slot for the card body content (replaces `bodyPadding` property if used).\n * @slot title - Slot for the card title.\n * @slot subtitle - Slot for the card subtitle.\n * @slot actions - Slot for the card actions (usually buttons).\n * @slot footer-title - Slot for the footer title.\n * @slot footer-subtitle - Slot for the footer subtitle.\n * @slot footer-actions - Slot for the footer actions (usually buttons).\n *\n * @csspart card - The main card container element.\n * @csspart header - The card header section.\n * @csspart footer - The card footer section.\n * @csspart ripple - The ripple animation element injected when the card is clicked.\n *\n * @property {string} bg - Background color of the card. Accepts color tokens or custom CSS colors. Default: `\"primary\"`.\n * @property {string} blurLevel - Level of blur applied to the background. Default: `\"none\"`.\n * @property {string} radius - Border radius of the card. Default: `\"md\"`.\n * @property {string} bodyPadding - Padding for the card body. Default: `\"none\"`.\n * @property {SkyCardElevation} elevation - Shadow depth of the card. Default: `\"md\"`.\n * @property {boolean} outlined - Whether the card has an outline. Default: `false`.\n * @property {boolean} clickable - Whether the card is clickable. Default: `false`.\n * @property {string} headerBg - Background color of the header. Default: `\"transparent\"`.\n * @property {string} headerBlur - Blur level for the header background. Default: `\"none\"`.\n * @property {string} headerPadding - Padding for the header. Default: `\"md\"`.\n * @property {SkyCardSectionLayout} headerLayout - Layout of the header content. Default: `\"inline\"`.\n * @property {string} headerInsetGap - Inset gap for the header section. Default: `\"sm\"`.\n * @property {string} headerRadius - Border radius for the header. Default: `\"md\"`.\n * @property {string} headerSeparatorColor - Color for the header separator. Default: `\"border-light\"`.\n * @property {string} footerBg - Background color of the footer. Default: `\"transparent\"`.\n * @property {string} footerBlur - Blur level for the footer background. Default: `\"none\"`.\n * @property {string} footerPadding - Padding for the footer. Default: `\"md\"`.\n * @property {SkyCardSectionLayout} footerLayout - Layout of the footer content. Default: `\"inline\"`.\n * @property {string} footerInsetGap - Inset gap for the footer section. Default: `\"sm\"`.\n * @property {string} footerRadius - Border radius for the footer. Default: `\"md\"`.\n * @property {string} footerSeparatorColor - Color for the footer separator. Default: `\"border-light\"`.\n * @property {number} padRatio - Ratio to adjust padding. Default: `1`.\n * @property {SkyCardSectionTarget} separators - Determines where separators should appear. Default: `\"none\"`.\n * @property {SkyCardSectionTarget} overlays - Determines where overlays should appear. Default: `\"none\"`.\n * @property {SkyCardSectionTarget} insets - Determines where insets should appear. Default: `\"none\"`.\n * @method refreshLayout Recomputes card variables and section synchronization.\n *\n * @example\n * ```html\n * <sky-card bg=\"primary\" elevation=\"lg\" headerpadding=\"md\">\n * <span slot=\"title\">Monthly Report</span>\n * <span slot=\"subtitle\">April 2026</span>\n * <div>Total revenue increased by 18%.</div>\n * <button slot=\"actions\">View Details</button>\n * </sky-card>\n * ```\n * ```vue\n * <template>\n * <sky-card bg=\"primary\" elevation=\"lg\" headerpadding=\"md\">\n * <span slot=\"title\">Monthly Report</span>\n * <span slot=\"subtitle\">April 2026</span>\n * <div>Total revenue increased by 18%.</div>\n * <button slot=\"actions\">View Details</button>\n * </sky-card>\n * </template>\n * ```\n * ```jsx\n * export default function Demo() {\n * return (\n * <sky-card bg=\"primary\" elevation=\"lg\" headerpadding=\"md\">\n * <span slot=\"title\">Monthly Report</span>\n * <span slot=\"subtitle\">April 2026</span>\n * <div>Total revenue increased by 18%.</div>\n * <button slot=\"actions\">View Details</button>\n * </sky-card>\n * );\n * }\n * ```\n */\n@customElement('sky-card')\nexport class SkyCard extends LitElement {\n @property({ type: String, reflect: true }) bg = 'primary';\n @property({ type: String, reflect: true }) blurLevel = 'none';\n @property({ type: String, reflect: true }) radius = 'md';\n @property({ type: String, reflect: true }) bodyPadding = 'none';\n @property({ type: String, reflect: true }) elevation: SkyCardElevation = 'md';\n @property({ type: Boolean, reflect: true }) outlined = false;\n @property({ type: Boolean, reflect: true }) clickable = false;\n\n @property({ type: String, reflect: true }) headerBg = 'transparent';\n @property({ type: String, reflect: true })\n headerBlur = 'none';\n @property({ type: String, reflect: true })\n headerPadding = 'md';\n @property({ type: String }) headerLayout: SkyCardSectionLayout = 'inline';\n @property({ type: String, reflect: true })\n headerInsetGap = 'sm';\n @property({ type: String, reflect: true })\n headerRadius = 'md';\n @property({ type: String })\n headerSeparatorColor = 'border-light';\n\n @property({ type: String, reflect: true }) footerBg = 'transparent';\n @property({ type: String, reflect: true })\n footerBlur = 'none';\n @property({ type: String, reflect: true })\n footerPadding = 'md';\n @property({ type: String }) footerLayout: SkyCardSectionLayout = 'inline';\n @property({ type: String, reflect: true })\n footerInsetGap = 'sm';\n @property({ type: String, reflect: true })\n footerRadius = 'md';\n @property({ type: String })\n footerSeparatorColor = 'border-light';\n\n @property({ type: Number }) padRatio = 1;\n\n @property({ type: String }) separators: SkyCardSectionTarget = 'none';\n @property({ type: String }) overlays: SkyCardSectionTarget = 'none';\n @property({ type: String }) insets: SkyCardSectionTarget = 'none';\n\n private _effHeaderSeparator = false;\n private _effFooterSeparator = false;\n private _effHeaderOverlay = false;\n private _effFooterOverlay = false;\n private _effHeaderInset = false;\n private _effFooterInset = false;\n private _varsCache: Record<string, string> = {};\n\n private static readonly BG_MAP = {\n primary: 'var(--sky-glass-primary)',\n secondary: 'var(--sky-glass-secondary)',\n tertiary: 'var(--sky-glass-tertiary)',\n transparent: 'transparent',\n } as const;\n\n private static readonly BLUR_MAP = {\n none: 'none',\n xs: 'blur(2px)',\n sm: 'var(--sky-blur-secondary)',\n md: 'var(--sky-blur-secondary)',\n lg: 'var(--sky-blur-tertiary)',\n } as const;\n\n private static readonly SIZE_MAP = {\n none: '0',\n sm: 'var(--sky-space-1\\\\.5, 6px)',\n md: 'var(--sky-space-4, 16px)',\n lg: 'var(--sky-space-6, 24px)',\n xl: 'var(--sky-space-8, 32px)',\n } as const;\n\n private static readonly GLASS_BG_TIERS = new Set([\n 'primary',\n 'secondary',\n 'tertiary',\n ]);\n\n /** Non-overlay inset bars use hover tints — overlay sections own their own blur. */\n private static readonly SECTION_INSET_BG_MAP = {\n primary: 'var(--sky-hover-primary)',\n secondary: 'var(--sky-hover-secondary)',\n tertiary: 'var(--sky-hover-tertiary)',\n transparent: 'transparent',\n } as const;\n\n private static _composeBackdrop(blurLevel: string): string {\n const blur =\n SkyCard.BLUR_MAP[blurLevel as keyof typeof SkyCard.BLUR_MAP] ?? blurLevel;\n if (blur === 'none') return 'none';\n return `${blur} var(--sky-saturation-secondary) var(--sky-brightness-secondary)`;\n }\n\n private static _composeElevation(level: SkyCardElevation | string): string {\n const depthMap: Record<SkyCardElevation, string | null> = {\n none: null,\n sm: 'var(--sky-box-shadow-primary)',\n md: 'var(--sky-box-shadow-secondary)',\n lg: 'var(--sky-box-shadow-tertiary)',\n };\n const depth = depthMap[level as SkyCardElevation];\n if (depth === null) return 'none';\n if (depth === undefined) return level;\n return `var(--sky-box-shadow-inset), ${depth}`;\n }\n\n static styles = css`\n :host {\n display: block;\n }\n\n .card {\n display: flex;\n flex-direction: column;\n width: 100%;\n position: relative;\n overflow: hidden;\n box-sizing: border-box;\n color: var(--sky-text-primary);\n background: var(--_card-bg, var(--sky-glass-primary));\n background-image: var(--_card-glass-surface, var(--sky-glass-surface));\n border-radius: var(--_card-radius, var(--sky-radius-secondary));\n backdrop-filter: var(--_card-backdrop, none);\n -webkit-backdrop-filter: var(--_card-backdrop, none);\n box-shadow: var(\n --_card-shadow,\n var(--sky-box-shadow-inset),\n var(--sky-box-shadow-primary)\n );\n border: var(--_card-border, var(--sky-border-primary));\n transition: var(--sky-transition-default);\n }\n\n :host([outlined]) .card {\n box-shadow: none;\n border: var(--sky-border-primary);\n }\n :host([clickable]) .card {\n cursor: pointer;\n }\n :host([clickable]) .card:hover {\n box-shadow: var(\n --_card-shadow-hover,\n var(--sky-box-shadow-inset),\n var(--sky-box-shadow-hover)\n );\n }\n\n .section {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--sky-space-1\\\\.5, 6px);\n box-sizing: border-box;\n min-width: 0;\n background: transparent;\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n }\n .section.stack {\n flex-direction: column;\n align-items: stretch;\n gap: var(--sky-space-1\\\\.5, 6px);\n }\n .section.row {\n flex-direction: row;\n }\n\n .overlay-top {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 1;\n }\n .overlay-bottom {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1;\n }\n\n .inset {\n overflow: hidden;\n box-shadow: none;\n }\n .section.inset[part='header'] {\n border: var(--_header-inset-border, 0 solid transparent);\n border-radius: var(--_header-radius, var(--sky-radius-secondary));\n }\n .section.inset[part='footer'] {\n border: var(--_footer-inset-border, 0 solid transparent);\n border-radius: var(--_footer-radius, var(--sky-radius-secondary));\n }\n .overlay-top.inset {\n top: var(--_header-inset-gap, var(--sky-space-2, 8px));\n left: var(--_header-inset-gap, var(--sky-space-2, 8px));\n right: var(--_header-inset-gap, var(--sky-space-2, 8px));\n }\n .overlay-bottom.inset {\n bottom: var(--_footer-inset-gap, var(--sky-space-2, 8px));\n left: var(--_footer-inset-gap, var(--sky-space-2, 8px));\n right: var(--_footer-inset-gap, var(--sky-space-2, 8px));\n }\n\n .section[part='header']:has(slot:not([empty])),\n .section[part='header'][has-content] {\n background: var(--_header-bg);\n background-image: var(--_header-glass-surface, none);\n padding-block: var(--_header-pad-y, var(--sky-space-3, 12px));\n padding-inline: var(--_header-pad-x, var(--sky-space-4, 16px));\n }\n .section[part='footer']:has(slot:not([empty])),\n .section[part='footer'][has-content] {\n background: var(--_footer-bg);\n background-image: var(--_footer-glass-surface, none);\n padding-block: var(--_footer-pad-y, var(--sky-space-3, 12px));\n padding-inline: var(--_footer-pad-x, var(--sky-space-4, 16px));\n }\n\n .section[part='header'].overlay-top:has(slot:not([empty])),\n .section[part='header'].overlay-top[has-content] {\n backdrop-filter: var(--_header-backdrop, none);\n -webkit-backdrop-filter: var(--_header-backdrop, none);\n }\n .section[part='footer'].overlay-bottom:has(slot:not([empty])),\n .section[part='footer'].overlay-bottom[has-content] {\n backdrop-filter: var(--_footer-backdrop, none);\n -webkit-backdrop-filter: var(--_footer-backdrop, none);\n }\n\n .section[part='header']:not(.inset):has(slot:not([empty])),\n .section[part='header']:not(.inset)[has-content] {\n border-bottom: var(--_header-separator, 0px) solid\n var(--_header-separator-color, var(--sky-border-light));\n }\n .section[part='footer']:not(.inset):has(slot:not([empty])),\n .section[part='footer']:not(.inset)[has-content] {\n border-top: var(--_footer-separator, 0px) solid\n var(--_footer-separator-color, var(--sky-border-light));\n }\n\n ::slotted(:not([slot])) {\n box-sizing: border-box;\n padding-block: var(--_body-pad-y, var(--sky-space-3, 12px));\n padding-inline: var(--_body-pad-x, var(--sky-space-4, 16px));\n }\n slot[empty] {\n display: none;\n }\n\n ::slotted([slot='title']) {\n font-size: var(--sky-font-size-lg, 18px);\n font-weight: var(--sky-font-weight-semibold, 600);\n margin: 0;\n color: var(--sky-text-primary);\n text-align: start;\n text-shadow: var(--sky-text-shadow-on-glass, none);\n }\n ::slotted([slot='subtitle']) {\n font-size: var(--sky-font-size-sm, 14px);\n margin: 0;\n color: var(--sky-text-secondary);\n text-align: start;\n text-shadow: var(--sky-text-shadow-on-glass, none);\n }\n ::slotted([slot='actions']) {\n display: inline-flex;\n gap: var(--sky-space-1\\\\.5, 6px);\n align-items: center;\n margin-left: auto;\n }\n ::slotted([slot='footer-title']) {\n font-size: var(--sky-font-size-md, 16px);\n font-weight: var(--sky-font-weight-medium, 500);\n margin: 0;\n color: var(--sky-text-primary);\n text-align: start;\n }\n ::slotted([slot='footer-subtitle']) {\n font-size: var(--sky-font-size-xs, 12px);\n margin: 0;\n color: var(--sky-text-secondary);\n text-align: start;\n }\n ::slotted([slot='footer-actions']) {\n display: inline-flex;\n gap: var(--sky-space-1\\\\.5, 6px);\n align-items: center;\n margin-left: auto;\n }\n\n .main {\n width: 100%;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .card {\n transition: none;\n }\n }\n `;\n\n override firstUpdated(): void {\n this._wireSlotChangeHandlers();\n\n this._syncHeader();\n this._syncFooter();\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (\n changed.has('separators') ||\n changed.has('overlays') ||\n changed.has('insets')\n ) {\n this._computeEffectiveFlags();\n }\n\n if (\n changed.has('bg') ||\n changed.has('blurLevel') ||\n changed.has('radius') ||\n changed.has('elevation')\n ) {\n this._applyCardVars();\n }\n if (\n changed.has('headerPadding') ||\n changed.has('bodyPadding') ||\n changed.has('footerPadding') ||\n changed.has('padRatio')\n ) {\n this._applyPaddingVars();\n }\n if (\n changed.has('headerBg') ||\n changed.has('footerBg') ||\n changed.has('headerBlur') ||\n changed.has('footerBlur') ||\n changed.has('headerRadius') ||\n changed.has('footerRadius') ||\n changed.has('headerInsetGap') ||\n changed.has('footerInsetGap') ||\n changed.has('headerSeparatorColor') ||\n changed.has('footerSeparatorColor') ||\n changed.has('separators') ||\n changed.has('insets') ||\n changed.has('overlays')\n ) {\n this._applySectionChrome();\n }\n }\n\n private _wireSlotChangeHandlers(): void {\n this.renderRoot\n .querySelector('#slot-title')\n ?.addEventListener('slotchange', () => this._syncHeader());\n this.renderRoot\n .querySelector('#slot-subtitle')\n ?.addEventListener('slotchange', () => this._syncHeader());\n this.renderRoot\n .querySelector('#slot-actions')\n ?.addEventListener('slotchange', () => this._syncHeader());\n\n this.renderRoot\n .querySelector('#slot-f-title')\n ?.addEventListener('slotchange', () => this._syncFooter());\n this.renderRoot\n .querySelector('#slot-f-subtitle')\n ?.addEventListener('slotchange', () => this._syncFooter());\n this.renderRoot\n .querySelector('#slot-f-actions')\n ?.addEventListener('slotchange', () => this._syncFooter());\n }\n\n private _syncHeader(): void {\n const hdr = this.renderRoot.querySelector('#hdr');\n const slots = [\n this.renderRoot.querySelector('#slot-title') as HTMLSlotElement | null,\n this.renderRoot.querySelector('#slot-subtitle') as HTMLSlotElement | null,\n this.renderRoot.querySelector('#slot-actions') as HTMLSlotElement | null,\n ].filter(Boolean) as HTMLSlotElement[];\n\n const has = slots.some(\n (s) => s.assignedNodes({ flatten: true }).length > 0\n );\n hdr?.toggleAttribute('has-content', has);\n\n slots.forEach((s) =>\n s.toggleAttribute(\n 'empty',\n s.assignedNodes({ flatten: true }).length === 0\n )\n );\n }\n\n private _syncFooter(): void {\n const ftr = this.renderRoot.querySelector('#ftr');\n const slots = [\n this.renderRoot.querySelector('#slot-f-title') as HTMLSlotElement | null,\n this.renderRoot.querySelector(\n '#slot-f-subtitle'\n ) as HTMLSlotElement | null,\n this.renderRoot.querySelector(\n '#slot-f-actions'\n ) as HTMLSlotElement | null,\n ].filter(Boolean) as HTMLSlotElement[];\n\n const has = slots.some(\n (s) => s.assignedNodes({ flatten: true }).length > 0\n );\n ftr?.toggleAttribute('has-content', has);\n slots.forEach((s) =>\n s.toggleAttribute(\n 'empty',\n s.assignedNodes({ flatten: true }).length === 0\n )\n );\n }\n\n private _expandPair(sh: SkyCardSectionTarget): [boolean, boolean] {\n switch (sh) {\n case 'both':\n return [true, true];\n case 'header':\n return [true, false];\n case 'footer':\n return [false, true];\n case 'none':\n default:\n return [false, false];\n }\n }\n\n private _computeEffectiveFlags(): void {\n [this._effHeaderSeparator, this._effFooterSeparator] = this._expandPair(\n this.separators\n );\n [this._effHeaderOverlay, this._effFooterOverlay] = this._expandPair(\n this.overlays\n );\n [this._effHeaderInset, this._effFooterInset] = this._expandPair(\n this.insets\n );\n }\n\n private _setVar(name: string, value: string): void {\n if (this._varsCache[name] === value) return;\n this.style.setProperty(name, value);\n this._varsCache[name] = value;\n }\n\n private _resolveSectionBg(\n token: string,\n isInset: boolean,\n isOverlay: boolean\n ): string {\n if (isInset && !isOverlay) {\n return (\n SkyCard.SECTION_INSET_BG_MAP[\n token as keyof typeof SkyCard.SECTION_INSET_BG_MAP\n ] ?? token\n );\n }\n return SkyCard.BG_MAP[token as keyof typeof SkyCard.BG_MAP] ?? token;\n }\n\n private _resolveSectionGlassSurface(token: string): string {\n return SkyCard.GLASS_BG_TIERS.has(token)\n ? 'var(--sky-glass-surface)'\n : 'none';\n }\n\n private _applyCardVars(): void {\n this._setVar(\n '--_card-bg',\n SkyCard.BG_MAP[this.bg as keyof typeof SkyCard.BG_MAP] ?? this.bg\n );\n this._setVar(\n '--_card-glass-surface',\n SkyCard.GLASS_BG_TIERS.has(this.bg) ? 'var(--sky-glass-surface)' : 'none'\n );\n\n this._setVar('--_card-backdrop', SkyCard._composeBackdrop(this.blurLevel));\n\n this._setVar('--_card-radius', resolveRadius(this.radius));\n this._setVar('--_card-shadow', SkyCard._composeElevation(this.elevation));\n this._setVar(\n '--_card-shadow-hover',\n 'var(--sky-box-shadow-inset), var(--sky-box-shadow-hover)'\n );\n }\n\n private _applyPaddingVars(): void {\n const h =\n SkyCard.SIZE_MAP[this.headerPadding as keyof typeof SkyCard.SIZE_MAP] ??\n this.headerPadding;\n const b =\n SkyCard.SIZE_MAP[this.bodyPadding as keyof typeof SkyCard.SIZE_MAP] ??\n this.bodyPadding;\n const f =\n SkyCard.SIZE_MAP[this.footerPadding as keyof typeof SkyCard.SIZE_MAP] ??\n this.footerPadding;\n\n const ratio = Number.isFinite(this.padRatio)\n ? Math.max(0, this.padRatio)\n : 1;\n\n this._setVar('--_header-pad-y', h);\n this._setVar('--_header-pad-x', `calc(${h} * ${ratio})`);\n\n this._setVar('--_body-pad-y', b);\n this._setVar('--_body-pad-x', `calc(${b} * ${ratio})`);\n\n this._setVar('--_footer-pad-y', f);\n this._setVar('--_footer-pad-x', `calc(${f} * ${ratio})`);\n }\n\n private _applySectionChrome(): void {\n const headerSep = this._effHeaderInset\n ? '0px'\n : this._effHeaderSeparator\n ? '1px'\n : '0px';\n const footerSep = this._effFooterInset\n ? '0px'\n : this._effFooterSeparator\n ? '1px'\n : '0px';\n this._setVar('--_header-separator', headerSep);\n this._setVar('--_footer-separator', footerSep);\n\n this._setVar(\n '--_header-separator-color',\n resolveColor(this.headerSeparatorColor)\n );\n this._setVar(\n '--_footer-separator-color',\n resolveColor(this.footerSeparatorColor)\n );\n\n const headerInsetBorder =\n this._effHeaderInset && this._effHeaderSeparator\n ? '1px solid var(--sky-border-light)'\n : '0 solid transparent';\n const footerInsetBorder =\n this._effFooterInset && this._effFooterSeparator\n ? '1px solid var(--sky-border-light)'\n : '0 solid transparent';\n this._setVar('--_header-inset-border', headerInsetBorder);\n this._setVar('--_footer-inset-border', footerInsetBorder);\n\n this._setVar(\n '--_header-bg',\n this._resolveSectionBg(\n this.headerBg,\n this._effHeaderInset,\n this._effHeaderOverlay\n )\n );\n this._setVar(\n '--_footer-bg',\n this._resolveSectionBg(\n this.footerBg,\n this._effFooterInset,\n this._effFooterOverlay\n )\n );\n this._setVar(\n '--_header-glass-surface',\n this._effHeaderOverlay\n ? this._resolveSectionGlassSurface(this.headerBg)\n : 'none'\n );\n this._setVar(\n '--_footer-glass-surface',\n this._effFooterOverlay\n ? this._resolveSectionGlassSurface(this.footerBg)\n : 'none'\n );\n this._setVar(\n '--_header-backdrop',\n this._effHeaderOverlay\n ? SkyCard._composeBackdrop(this.headerBlur)\n : 'none'\n );\n this._setVar(\n '--_footer-backdrop',\n this._effFooterOverlay\n ? SkyCard._composeBackdrop(this.footerBlur)\n : 'none'\n );\n\n this._setVar('--_header-radius', resolveRadius(this.headerRadius));\n this._setVar('--_footer-radius', resolveRadius(this.footerRadius));\n this._setVar(\n '--_header-inset-gap',\n SkyCard.SIZE_MAP[this.headerInsetGap as keyof typeof SkyCard.SIZE_MAP] ??\n this.headerInsetGap\n );\n this._setVar(\n '--_footer-inset-gap',\n SkyCard.SIZE_MAP[this.footerInsetGap as keyof typeof SkyCard.SIZE_MAP] ??\n this.footerInsetGap\n );\n }\n /**\n * Recomputes card variables and section synchronization.\n *\n * @returns {void}\n */\n public refreshLayout(): void {\n this._computeEffectiveFlags();\n this._applyCardVars();\n this._applyPaddingVars();\n this._applySectionChrome();\n this._syncHeader();\n this._syncFooter();\n }\n\n override render() {\n const headerLayoutClass = this.headerLayout === 'inline' ? 'row' : 'stack';\n const footerLayoutClass = this.footerLayout === 'inline' ? 'row' : 'stack';\n const headerClasses = classMap({\n section: true,\n [headerLayoutClass]: true,\n 'overlay-top': !!this._effHeaderOverlay,\n inset: !!this._effHeaderInset,\n });\n const footerClasses = classMap({\n section: true,\n [footerLayoutClass]: true,\n 'overlay-bottom': !!this._effFooterOverlay,\n inset: !!this._effFooterInset,\n });\n\n return html`\n <div class=\"card\" part=\"card\">\n <div class=${headerClasses} part=\"header\" id=\"hdr\">\n <div class=\"main\">\n <slot name=\"title\" id=\"slot-title\"></slot>\n <slot name=\"subtitle\" id=\"slot-subtitle\"></slot>\n </div>\n <slot name=\"actions\" id=\"slot-actions\"></slot>\n </div>\n\n <slot></slot>\n\n <div class=${footerClasses} part=\"footer\" id=\"ftr\">\n <div class=\"main\">\n <slot name=\"footer-title\" id=\"slot-f-title\"></slot>\n <slot name=\"footer-subtitle\" id=\"slot-f-subtitle\"></slot>\n </div>\n <slot name=\"footer-actions\" id=\"slot-f-actions\"></slot>\n </div>\n </div>\n `;\n }\n}\n"],"names":["SkyCard","LitElement","constructor","super","arguments","this","bg","blurLevel","radius","bodyPadding","elevation","outlined","clickable","headerBg","headerBlur","headerPadding","headerLayout","headerInsetGap","headerRadius","headerSeparatorColor","footerBg","footerBlur","footerPadding","footerLayout","footerInsetGap","footerRadius","footerSeparatorColor","padRatio","separators","overlays","insets","_effHeaderSeparator","_effFooterSeparator","_effHeaderOverlay","_effFooterOverlay","_effHeaderInset","_effFooterInset","_varsCache","_composeBackdrop","blur","BLUR_MAP","_composeElevation","level","depth","none","sm","md","lg","firstUpdated","_wireSlotChangeHandlers","_syncHeader","_syncFooter","willUpdate","changed","has","_computeEffectiveFlags","_applyCardVars","_applyPaddingVars","_applySectionChrome","renderRoot","querySelector","addEventListener","hdr","slots","filter","Boolean","some","s","assignedNodes","flatten","length","toggleAttribute","forEach","ftr","_expandPair","sh","_setVar","name","value","style","setProperty","_resolveSectionBg","token","isInset","isOverlay","SECTION_INSET_BG_MAP","BG_MAP","_resolveSectionGlassSurface","GLASS_BG_TIERS","resolveRadius","h","SIZE_MAP","b","f","ratio","Number","isFinite","Math","max","headerSep","footerSep","resolveColor","headerInsetBorder","footerInsetBorder","refreshLayout","render","headerLayoutClass","footerLayoutClass","headerClasses","classMap","section","inset","footerClasses","html","primary","secondary","tertiary","transparent","xs","xl","Set","styles","css","__decorateClass","property","type","String","reflect","prototype","customElement"],"mappings":"6eA6FO,IAAMA,EAAN,cAAsBC,EAAtB,WAAAC,GAAAC,SAAAC,WACsCC,KAAAC,GAAK,UACLD,KAAAE,UAAY,OACZF,KAAAG,OAAS,KACTH,KAAAI,YAAc,OACdJ,KAAAK,UAA8B,KAC7BL,KAAAM,UAAW,EACXN,KAAAO,WAAY,EAEbP,KAAAQ,SAAW,cAEtDR,KAAAS,WAAa,OAEbT,KAAAU,cAAgB,KACYV,KAAAW,aAAqC,SAEjEX,KAAAY,eAAiB,KAEjBZ,KAAAa,aAAe,KAEfb,KAAAc,qBAAuB,eAEoBd,KAAAe,SAAW,cA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AAA,CAA3BC,EAAS,CAAEC,KAAMC,UAvCP9H,EAuCiBgI,UAAA,SAAA,GAvCjBhI,EAAN2H,EAAA,CADNM,EAAc,aACFjI"}
|
|
1
|
+
{"version":3,"file":"sky-card.js","sources":["../../src/sky-card/sky-card.ts"],"sourcesContent":["import { LitElement, html, css, PropertyValues } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { resolveRadius } from \"../helper/utils/size-resolver\";\nimport { resolveColor } from \"../helper/utils/color-resolver\";\nimport { PresetController } from \"../helper/controllers/preset-controller\";\n\nexport type SkyCardElevation = \"none\" | \"sm\" | \"md\" | \"lg\";\nexport type SkyCardSectionLayout = \"inline\" | \"stack\";\nexport type SkyCardSectionTarget = \"both\" | \"header\" | \"footer\" | \"none\";\n\n/**\n * @element sky-card\n *\n * @summary Customizable card with configurable header/footer sections, blur/background styles, elevation, insets, overlays, and separators.\n *\n * @status stable\n * @since 1.0.0\n *\n * @documentation https://sky-ui.com/components/card\n *\n * @slot - Default slot for the card body content (replaces `bodyPadding` property if used).\n * @slot title - Slot for the card title.\n * @slot subtitle - Slot for the card subtitle.\n * @slot actions - Slot for the card actions (usually buttons).\n * @slot footer-title - Slot for the footer title.\n * @slot footer-subtitle - Slot for the footer subtitle.\n * @slot footer-actions - Slot for the footer actions (usually buttons).\n *\n * @csspart card - The main card container element.\n * @csspart header - The card header section.\n * @csspart footer - The card footer section.\n * @csspart ripple - The ripple animation element injected when the card is clicked.\n *\n * @property {string} bg - Background color of the card. Accepts color tokens or custom CSS colors. Default: `\"primary\"`.\n * @property {string} blurLevel - Level of blur applied to the background. Default: `\"none\"`.\n * @property {string} radius - Border radius of the card. Default: `\"md\"`.\n * @property {string} bodyPadding - Padding for the card body. Default: `\"none\"`.\n * @property {SkyCardElevation} elevation - Shadow depth of the card. Default: `\"md\"`.\n * @property {boolean} outlined - Whether the card has an outline. Default: `false`.\n * @property {boolean} clickable - Whether the card is clickable. Default: `false`.\n * @property {string} headerBg - Background color of the header. Default: `\"transparent\"`.\n * @property {string} headerBlur - Blur level for the header background. Default: `\"none\"`.\n * @property {string} headerPadding - Padding for the header. Default: `\"md\"`.\n * @property {SkyCardSectionLayout} headerLayout - Layout of the header content. Default: `\"inline\"`.\n * @property {string} headerInsetGap - Inset gap for the header section. Default: `\"sm\"`.\n * @property {string} headerRadius - Border radius for the header. Default: `\"md\"`.\n * @property {string} headerSeparatorColor - Color for the header separator. Default: `\"border-light\"`.\n * @property {string} footerBg - Background color of the footer. Default: `\"transparent\"`.\n * @property {string} footerBlur - Blur level for the footer background. Default: `\"none\"`.\n * @property {string} footerPadding - Padding for the footer. Default: `\"md\"`.\n * @property {SkyCardSectionLayout} footerLayout - Layout of the footer content. Default: `\"inline\"`.\n * @property {string} footerInsetGap - Inset gap for the footer section. Default: `\"sm\"`.\n * @property {string} footerRadius - Border radius for the footer. Default: `\"md\"`.\n * @property {string} footerSeparatorColor - Color for the footer separator. Default: `\"border-light\"`.\n * @property {number} padRatio - Ratio to adjust padding. Default: `1`.\n * @property {SkyCardSectionTarget} separators - Determines where separators should appear. Default: `\"none\"`.\n * @property {SkyCardSectionTarget} overlays - Determines where overlays should appear. Default: `\"none\"`.\n * @property {SkyCardSectionTarget} insets - Determines where insets should appear. Default: `\"none\"`.\n * @property {string} preset - Named prop preset from nearest `sky-config-provider`. Default: `\"\"`.\n * @method refreshLayout Recomputes card variables and section synchronization.\n *\n * @example\n * ```html\n * <sky-card bg=\"primary\" elevation=\"lg\" headerpadding=\"md\">\n * <span slot=\"title\">Monthly Report</span>\n * <span slot=\"subtitle\">April 2026</span>\n * <div>Total revenue increased by 18%.</div>\n * <button slot=\"actions\">View Details</button>\n * </sky-card>\n * ```\n * ```vue\n * <template>\n * <sky-card bg=\"primary\" elevation=\"lg\" headerpadding=\"md\">\n * <span slot=\"title\">Monthly Report</span>\n * <span slot=\"subtitle\">April 2026</span>\n * <div>Total revenue increased by 18%.</div>\n * <button slot=\"actions\">View Details</button>\n * </sky-card>\n * </template>\n * ```\n * ```jsx\n * export default function Demo() {\n * return (\n * <sky-card bg=\"primary\" elevation=\"lg\" headerpadding=\"md\">\n * <span slot=\"title\">Monthly Report</span>\n * <span slot=\"subtitle\">April 2026</span>\n * <div>Total revenue increased by 18%.</div>\n * <button slot=\"actions\">View Details</button>\n * </sky-card>\n * );\n * }\n * ```\n */\n@customElement(\"sky-card\")\nexport class SkyCard extends LitElement {\n @property({ type: String, reflect: true }) bg = \"primary\";\n @property({ type: String, reflect: true }) blurLevel = \"none\";\n @property({ type: String, reflect: true }) radius = \"md\";\n @property({ type: String, reflect: true }) bodyPadding = \"none\";\n @property({ type: String, reflect: true }) elevation: SkyCardElevation = \"md\";\n @property({ type: Boolean, reflect: true }) outlined = false;\n @property({ type: Boolean, reflect: true }) clickable = false;\n\n @property({ type: String, reflect: true }) headerBg =\n \"transparent\";\n @property({ type: String, reflect: true })\n headerBlur = \"none\";\n @property({ type: String, reflect: true })\n headerPadding = \"md\";\n @property({ type: String }) headerLayout: SkyCardSectionLayout = \"inline\";\n @property({ type: String, reflect: true })\n headerInsetGap = \"sm\";\n @property({ type: String, reflect: true })\n headerRadius = \"md\";\n @property({ type: String })\n headerSeparatorColor = \"border-light\";\n\n @property({ type: String, reflect: true }) footerBg =\n \"transparent\";\n @property({ type: String, reflect: true })\n footerBlur = \"none\";\n @property({ type: String, reflect: true })\n footerPadding = \"md\";\n @property({ type: String }) footerLayout: SkyCardSectionLayout = \"inline\";\n @property({ type: String, reflect: true })\n footerInsetGap = \"sm\";\n @property({ type: String, reflect: true })\n footerRadius = \"md\";\n @property({ type: String })\n footerSeparatorColor = \"border-light\";\n\n @property({ type: Number }) padRatio = 1;\n\n @property({ type: String }) separators: SkyCardSectionTarget = \"none\";\n @property({ type: String }) overlays: SkyCardSectionTarget = \"none\";\n @property({ type: String }) insets: SkyCardSectionTarget = \"none\";\n\n private _effHeaderSeparator = false;\n private _effFooterSeparator = false;\n private _effHeaderOverlay = false;\n private _effFooterOverlay = false;\n private _effHeaderInset = false;\n private _effFooterInset = false;\n private _varsCache: Record<string, string> = {};\n\n private static readonly BG_MAP = {\n primary: \"var(--sky-glass-primary)\",\n secondary: \"var(--sky-glass-secondary)\",\n tertiary: \"var(--sky-glass-tertiary)\",\n transparent: \"transparent\",\n } as const;\n\n private static readonly BLUR_MAP = {\n none: \"none\",\n xs: \"blur(2px)\",\n sm: \"var(--sky-blur-secondary)\",\n md: \"var(--sky-blur-secondary)\",\n lg: \"var(--sky-blur-tertiary)\",\n } as const;\n\n private static readonly SIZE_MAP = {\n none: \"0\",\n sm: \"var(--sky-space-1\\\\.5, 6px)\",\n md: \"var(--sky-space-4, 16px)\",\n lg: \"var(--sky-space-6, 24px)\",\n xl: \"var(--sky-space-8, 32px)\",\n } as const;\n\n private static readonly GLASS_BG_TIERS = new Set([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n ]);\n\n /** Non-overlay inset bars use hover tints — overlay sections own their own blur. */\n private static readonly SECTION_INSET_BG_MAP = {\n primary: \"var(--sky-hover-primary)\",\n secondary: \"var(--sky-hover-secondary)\",\n tertiary: \"var(--sky-hover-tertiary)\",\n transparent: \"transparent\",\n } as const;\n\n private static _composeBackdrop(blurLevel: string): string {\n const blur =\n SkyCard.BLUR_MAP[blurLevel as keyof typeof SkyCard.BLUR_MAP] ?? blurLevel;\n if (blur === \"none\") return \"none\";\n return `${blur} var(--sky-saturation-secondary) var(--sky-brightness-secondary)`;\n }\n\n private static _composeElevation(level: SkyCardElevation | string): string {\n const depthMap: Record<SkyCardElevation, string | null> = {\n none: null,\n sm: \"var(--sky-box-shadow-primary)\",\n md: \"var(--sky-box-shadow-secondary)\",\n lg: \"var(--sky-box-shadow-tertiary)\",\n };\n const depth = depthMap[level as SkyCardElevation];\n if (depth === null) return \"none\";\n if (depth === undefined) return level;\n return `var(--sky-box-shadow-inset), ${depth}`;\n }\n\n\n /** Named prop preset from nearest `sky-config-provider`. */\n @property({ type: String, reflect: true }) preset = \"\";\n\n private _presets = new PresetController(this);\n\n static styles = css`\n :host {\n display: block;\n }\n\n .card {\n display: flex;\n flex-direction: column;\n width: 100%;\n position: relative;\n overflow: hidden;\n box-sizing: border-box;\n color: var(--sky-text-primary);\n background: var(--_card-bg, var(--sky-glass-primary));\n background-image: var(--_card-glass-surface, var(--sky-glass-surface));\n border-radius: var(--_card-radius, var(--sky-radius-secondary));\n backdrop-filter: var(--_card-backdrop, none);\n -webkit-backdrop-filter: var(--_card-backdrop, none);\n box-shadow: var(\n --_card-shadow,\n var(--sky-box-shadow-inset),\n var(--sky-box-shadow-primary)\n );\n border: var(--_card-border, var(--sky-border-primary));\n transition: var(--sky-transition-default);\n }\n\n :host([outlined]) .card {\n box-shadow: none;\n border: var(--sky-border-primary);\n }\n :host([clickable]) .card {\n cursor: pointer;\n }\n :host([clickable]) .card:hover {\n box-shadow: var(\n --_card-shadow-hover,\n var(--sky-box-shadow-inset),\n var(--sky-box-shadow-hover)\n );\n }\n\n .section {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--sky-space-1\\\\.5, 6px);\n box-sizing: border-box;\n min-width: 0;\n background: transparent;\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n }\n .section.stack {\n flex-direction: column;\n align-items: stretch;\n gap: var(--sky-space-1\\\\.5, 6px);\n }\n .section.row {\n flex-direction: row;\n }\n\n .overlay-top {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 1;\n }\n .overlay-bottom {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1;\n }\n\n .inset {\n overflow: hidden;\n box-shadow: none;\n }\n .section.inset[part=\"header\"] {\n border: var(--_header-inset-border, 0 solid transparent);\n border-radius: var(--_header-radius, var(--sky-radius-secondary));\n }\n .section.inset[part=\"footer\"] {\n border: var(--_footer-inset-border, 0 solid transparent);\n border-radius: var(--_footer-radius, var(--sky-radius-secondary));\n }\n .overlay-top.inset {\n top: var(--_header-inset-gap, var(--sky-space-2, 8px));\n left: var(--_header-inset-gap, var(--sky-space-2, 8px));\n right: var(--_header-inset-gap, var(--sky-space-2, 8px));\n }\n .overlay-bottom.inset {\n bottom: var(--_footer-inset-gap, var(--sky-space-2, 8px));\n left: var(--_footer-inset-gap, var(--sky-space-2, 8px));\n right: var(--_footer-inset-gap, var(--sky-space-2, 8px));\n }\n\n .section[part=\"header\"]:has(slot:not([empty])),\n .section[part=\"header\"][has-content] {\n background: var(--_header-bg);\n background-image: var(--_header-glass-surface, none);\n padding-block: var(--_header-pad-y, var(--sky-space-3, 12px));\n padding-inline: var(--_header-pad-x, var(--sky-space-4, 16px));\n }\n .section[part=\"footer\"]:has(slot:not([empty])),\n .section[part=\"footer\"][has-content] {\n background: var(--_footer-bg);\n background-image: var(--_footer-glass-surface, none);\n padding-block: var(--_footer-pad-y, var(--sky-space-3, 12px));\n padding-inline: var(--_footer-pad-x, var(--sky-space-4, 16px));\n }\n\n .section[part=\"header\"].overlay-top:has(slot:not([empty])),\n .section[part=\"header\"].overlay-top[has-content] {\n backdrop-filter: var(--_header-backdrop, none);\n -webkit-backdrop-filter: var(--_header-backdrop, none);\n }\n .section[part=\"footer\"].overlay-bottom:has(slot:not([empty])),\n .section[part=\"footer\"].overlay-bottom[has-content] {\n backdrop-filter: var(--_footer-backdrop, none);\n -webkit-backdrop-filter: var(--_footer-backdrop, none);\n }\n\n .section[part=\"header\"]:not(.inset):has(slot:not([empty])),\n .section[part=\"header\"]:not(.inset)[has-content] {\n border-bottom: var(--_header-separator, 0px) solid\n var(--_header-separator-color, var(--sky-border-light));\n }\n .section[part=\"footer\"]:not(.inset):has(slot:not([empty])),\n .section[part=\"footer\"]:not(.inset)[has-content] {\n border-top: var(--_footer-separator, 0px) solid\n var(--_footer-separator-color, var(--sky-border-light));\n }\n\n ::slotted(:not([slot])) {\n box-sizing: border-box;\n padding-block: var(--_body-pad-y, var(--sky-space-3, 12px));\n padding-inline: var(--_body-pad-x, var(--sky-space-4, 16px));\n }\n slot[empty] {\n display: none;\n }\n\n ::slotted([slot=\"title\"]) {\n font-size: var(--sky-font-size-lg, 18px);\n font-weight: var(--sky-font-weight-semibold, 600);\n margin: 0;\n color: var(--sky-text-primary);\n text-align: start;\n text-shadow: var(--sky-text-shadow-on-glass, none);\n }\n ::slotted([slot=\"subtitle\"]) {\n font-size: var(--sky-font-size-sm, 14px);\n margin: 0;\n color: var(--sky-text-secondary);\n text-align: start;\n text-shadow: var(--sky-text-shadow-on-glass, none);\n }\n ::slotted([slot=\"actions\"]) {\n display: inline-flex;\n gap: var(--sky-space-1\\\\.5, 6px);\n align-items: center;\n margin-left: auto;\n }\n ::slotted([slot=\"footer-title\"]) {\n font-size: var(--sky-font-size-md, 16px);\n font-weight: var(--sky-font-weight-medium, 500);\n margin: 0;\n color: var(--sky-text-primary);\n text-align: start;\n }\n ::slotted([slot=\"footer-subtitle\"]) {\n font-size: var(--sky-font-size-xs, 12px);\n margin: 0;\n color: var(--sky-text-secondary);\n text-align: start;\n }\n ::slotted([slot=\"footer-actions\"]) {\n display: inline-flex;\n gap: var(--sky-space-1\\\\.5, 6px);\n align-items: center;\n margin-left: auto;\n }\n\n .main {\n width: 100%;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .card {\n transition: none;\n }\n }\n `;\n\n override firstUpdated(): void {\n this._wireSlotChangeHandlers();\n\n this._syncHeader();\n this._syncFooter();\n }\n\n /**\n * After PresetController hostUpdate — card chrome may come from presets.\n * Keep flag recompute + CSS var apply here (not willUpdate).\n */\n protected override update(changed: PropertyValues): void {\n if (\n changed.has(\"separators\") ||\n changed.has(\"overlays\") ||\n changed.has(\"insets\")\n ) {\n this._computeEffectiveFlags();\n }\n\n if (\n changed.has(\"bg\") ||\n changed.has(\"blurLevel\") ||\n changed.has(\"radius\") ||\n changed.has(\"elevation\") ||\n changed.has(\"preset\")\n ) {\n this._applyCardVars();\n }\n if (\n changed.has(\"headerPadding\") ||\n changed.has(\"bodyPadding\") ||\n changed.has(\"footerPadding\") ||\n changed.has(\"padRatio\") ||\n changed.has(\"preset\")\n ) {\n this._applyPaddingVars();\n }\n if (\n changed.has(\"headerBg\") ||\n changed.has(\"footerBg\") ||\n changed.has(\"headerBlur\") ||\n changed.has(\"footerBlur\") ||\n changed.has(\"headerRadius\") ||\n changed.has(\"footerRadius\") ||\n changed.has(\"headerInsetGap\") ||\n changed.has(\"footerInsetGap\") ||\n changed.has(\"headerSeparatorColor\") ||\n changed.has(\"footerSeparatorColor\") ||\n changed.has(\"separators\") ||\n changed.has(\"insets\") ||\n changed.has(\"overlays\") ||\n changed.has(\"preset\")\n ) {\n this._applySectionChrome();\n }\n super.update(changed);\n }\n\n private _wireSlotChangeHandlers(): void {\n this.renderRoot\n .querySelector(\"#slot-title\")\n ?.addEventListener(\"slotchange\", () => this._syncHeader());\n this.renderRoot\n .querySelector(\"#slot-subtitle\")\n ?.addEventListener(\"slotchange\", () => this._syncHeader());\n this.renderRoot\n .querySelector(\"#slot-actions\")\n ?.addEventListener(\"slotchange\", () => this._syncHeader());\n\n this.renderRoot\n .querySelector(\"#slot-f-title\")\n ?.addEventListener(\"slotchange\", () => this._syncFooter());\n this.renderRoot\n .querySelector(\"#slot-f-subtitle\")\n ?.addEventListener(\"slotchange\", () => this._syncFooter());\n this.renderRoot\n .querySelector(\"#slot-f-actions\")\n ?.addEventListener(\"slotchange\", () => this._syncFooter());\n }\n\n private _syncHeader(): void {\n const hdr = this.renderRoot.querySelector(\"#hdr\");\n const slots = [\n this.renderRoot.querySelector(\"#slot-title\") as HTMLSlotElement | null,\n this.renderRoot.querySelector(\"#slot-subtitle\") as HTMLSlotElement | null,\n this.renderRoot.querySelector(\"#slot-actions\") as HTMLSlotElement | null,\n ].filter(Boolean) as HTMLSlotElement[];\n\n const has = slots.some(\n (s) => s.assignedNodes({ flatten: true }).length > 0\n );\n hdr?.toggleAttribute(\"has-content\", has);\n\n slots.forEach((s) =>\n s.toggleAttribute(\n \"empty\",\n s.assignedNodes({ flatten: true }).length === 0\n )\n );\n }\n\n private _syncFooter(): void {\n const ftr = this.renderRoot.querySelector(\"#ftr\");\n const slots = [\n this.renderRoot.querySelector(\"#slot-f-title\") as HTMLSlotElement | null,\n this.renderRoot.querySelector(\n \"#slot-f-subtitle\"\n ) as HTMLSlotElement | null,\n this.renderRoot.querySelector(\n \"#slot-f-actions\"\n ) as HTMLSlotElement | null,\n ].filter(Boolean) as HTMLSlotElement[];\n\n const has = slots.some(\n (s) => s.assignedNodes({ flatten: true }).length > 0\n );\n ftr?.toggleAttribute(\"has-content\", has);\n slots.forEach((s) =>\n s.toggleAttribute(\n \"empty\",\n s.assignedNodes({ flatten: true }).length === 0\n )\n );\n }\n\n private _expandPair(sh: SkyCardSectionTarget): [boolean, boolean] {\n switch (sh) {\n case \"both\":\n return [true, true];\n case \"header\":\n return [true, false];\n case \"footer\":\n return [false, true];\n case \"none\":\n default:\n return [false, false];\n }\n }\n\n private _computeEffectiveFlags(): void {\n [this._effHeaderSeparator, this._effFooterSeparator] = this._expandPair(\n this.separators\n );\n [this._effHeaderOverlay, this._effFooterOverlay] = this._expandPair(\n this.overlays\n );\n [this._effHeaderInset, this._effFooterInset] = this._expandPair(\n this.insets\n );\n }\n\n private _setVar(name: string, value: string): void {\n if (this._varsCache[name] === value) return;\n this.style.setProperty(name, value);\n this._varsCache[name] = value;\n }\n\n private _resolveSectionBg(\n token: string,\n isInset: boolean,\n isOverlay: boolean\n ): string {\n if (isInset && !isOverlay) {\n return (\n SkyCard.SECTION_INSET_BG_MAP[\n token as keyof typeof SkyCard.SECTION_INSET_BG_MAP\n ] ?? token\n );\n }\n return SkyCard.BG_MAP[token as keyof typeof SkyCard.BG_MAP] ?? token;\n }\n\n private _resolveSectionGlassSurface(token: string): string {\n return SkyCard.GLASS_BG_TIERS.has(token)\n ? \"var(--sky-glass-surface)\"\n : \"none\";\n }\n\n private _applyCardVars(): void {\n this._setVar(\n \"--_card-bg\",\n SkyCard.BG_MAP[this.bg as keyof typeof SkyCard.BG_MAP] ?? this.bg\n );\n this._setVar(\n \"--_card-glass-surface\",\n SkyCard.GLASS_BG_TIERS.has(this.bg)\n ? \"var(--sky-glass-surface)\"\n : \"none\"\n );\n\n this._setVar(\n \"--_card-backdrop\",\n SkyCard._composeBackdrop(this.blurLevel)\n );\n\n this._setVar(\"--_card-radius\", resolveRadius(this.radius));\n this._setVar(\n \"--_card-shadow\",\n SkyCard._composeElevation(this.elevation)\n );\n this._setVar(\n \"--_card-shadow-hover\",\n \"var(--sky-box-shadow-inset), var(--sky-box-shadow-hover)\"\n );\n }\n\n private _applyPaddingVars(): void {\n const h =\n SkyCard.SIZE_MAP[this.headerPadding as keyof typeof SkyCard.SIZE_MAP] ??\n this.headerPadding;\n const b =\n SkyCard.SIZE_MAP[this.bodyPadding as keyof typeof SkyCard.SIZE_MAP] ??\n this.bodyPadding;\n const f =\n SkyCard.SIZE_MAP[this.footerPadding as keyof typeof SkyCard.SIZE_MAP] ??\n this.footerPadding;\n\n const ratio = Number.isFinite(this.padRatio)\n ? Math.max(0, this.padRatio)\n : 1;\n\n this._setVar(\"--_header-pad-y\", h);\n this._setVar(\"--_header-pad-x\", `calc(${h} * ${ratio})`);\n\n this._setVar(\"--_body-pad-y\", b);\n this._setVar(\"--_body-pad-x\", `calc(${b} * ${ratio})`);\n\n this._setVar(\"--_footer-pad-y\", f);\n this._setVar(\"--_footer-pad-x\", `calc(${f} * ${ratio})`);\n }\n\n private _applySectionChrome(): void {\n const headerSep = this._effHeaderInset\n ? \"0px\"\n : this._effHeaderSeparator\n ? \"1px\"\n : \"0px\";\n const footerSep = this._effFooterInset\n ? \"0px\"\n : this._effFooterSeparator\n ? \"1px\"\n : \"0px\";\n this._setVar(\"--_header-separator\", headerSep);\n this._setVar(\"--_footer-separator\", footerSep);\n\n this._setVar(\"--_header-separator-color\", resolveColor(this.headerSeparatorColor));\n this._setVar(\"--_footer-separator-color\", resolveColor(this.footerSeparatorColor));\n\n const headerInsetBorder =\n this._effHeaderInset && this._effHeaderSeparator\n ? \"1px solid var(--sky-border-light)\"\n : \"0 solid transparent\";\n const footerInsetBorder =\n this._effFooterInset && this._effFooterSeparator\n ? \"1px solid var(--sky-border-light)\"\n : \"0 solid transparent\";\n this._setVar(\"--_header-inset-border\", headerInsetBorder);\n this._setVar(\"--_footer-inset-border\", footerInsetBorder);\n\n this._setVar(\n \"--_header-bg\",\n this._resolveSectionBg(\n this.headerBg,\n this._effHeaderInset,\n this._effHeaderOverlay\n )\n );\n this._setVar(\n \"--_footer-bg\",\n this._resolveSectionBg(\n this.footerBg,\n this._effFooterInset,\n this._effFooterOverlay\n )\n );\n this._setVar(\n \"--_header-glass-surface\",\n this._effHeaderOverlay\n ? this._resolveSectionGlassSurface(this.headerBg)\n : \"none\"\n );\n this._setVar(\n \"--_footer-glass-surface\",\n this._effFooterOverlay\n ? this._resolveSectionGlassSurface(this.footerBg)\n : \"none\"\n );\n this._setVar(\n \"--_header-backdrop\",\n this._effHeaderOverlay\n ? SkyCard._composeBackdrop(this.headerBlur)\n : \"none\"\n );\n this._setVar(\n \"--_footer-backdrop\",\n this._effFooterOverlay\n ? SkyCard._composeBackdrop(this.footerBlur)\n : \"none\"\n );\n\n this._setVar(\n \"--_header-radius\",\n resolveRadius(this.headerRadius)\n );\n this._setVar(\n \"--_footer-radius\",\n resolveRadius(this.footerRadius)\n );\n this._setVar(\n \"--_header-inset-gap\",\n SkyCard.SIZE_MAP[this.headerInsetGap as keyof typeof SkyCard.SIZE_MAP] ??\n this.headerInsetGap\n );\n this._setVar(\n \"--_footer-inset-gap\",\n SkyCard.SIZE_MAP[this.footerInsetGap as keyof typeof SkyCard.SIZE_MAP] ??\n this.footerInsetGap\n );\n }\n /**\n * Recomputes card variables and section synchronization.\n *\n * @returns {void}\n */\n public refreshLayout(): void {\n this._computeEffectiveFlags();\n this._applyCardVars();\n this._applyPaddingVars();\n this._applySectionChrome();\n this._syncHeader();\n this._syncFooter();\n }\n\n override render() {\n const headerLayoutClass = this.headerLayout === \"inline\" ? \"row\" : \"stack\";\n const footerLayoutClass = this.footerLayout === \"inline\" ? \"row\" : \"stack\";\n const headerClasses = classMap({\n section: true,\n [headerLayoutClass]: true,\n \"overlay-top\": !!this._effHeaderOverlay,\n inset: !!this._effHeaderInset,\n });\n const footerClasses = classMap({\n section: true,\n [footerLayoutClass]: true,\n \"overlay-bottom\": !!this._effFooterOverlay,\n inset: !!this._effFooterInset,\n });\n\n return html`\n <div class=\"card\" part=\"card\">\n <div class=${headerClasses} part=\"header\" id=\"hdr\">\n <div class=\"main\">\n <slot name=\"title\" id=\"slot-title\"></slot>\n <slot name=\"subtitle\" id=\"slot-subtitle\"></slot>\n </div>\n <slot name=\"actions\" id=\"slot-actions\"></slot>\n </div>\n\n <slot></slot>\n\n <div class=${footerClasses} part=\"footer\" id=\"ftr\">\n <div class=\"main\">\n <slot name=\"footer-title\" id=\"slot-f-title\"></slot>\n <slot name=\"footer-subtitle\" id=\"slot-f-subtitle\"></slot>\n </div>\n <slot name=\"footer-actions\" id=\"slot-f-actions\"></slot>\n </div>\n </div>\n `;\n }\n}\n"],"names":["SkyCard","LitElement","constructor","super","arguments","this","bg","blurLevel","radius","bodyPadding","elevation","outlined","clickable","headerBg","headerBlur","headerPadding","headerLayout","headerInsetGap","headerRadius","headerSeparatorColor","footerBg","footerBlur","footerPadding","footerLayout","footerInsetGap","footerRadius","footerSeparatorColor","padRatio","separators","overlays","insets","_effHeaderSeparator","_effFooterSeparator","_effHeaderOverlay","_effFooterOverlay","_effHeaderInset","_effFooterInset","_varsCache","preset","_presets","PresetController","_composeBackdrop","blur","BLUR_MAP","_composeElevation","level","depth","none","sm","md","lg","firstUpdated","_wireSlotChangeHandlers","_syncHeader","_syncFooter","update","changed","has","_computeEffectiveFlags","_applyCardVars","_applyPaddingVars","_applySectionChrome","renderRoot","querySelector","addEventListener","hdr","slots","filter","Boolean","some","s","assignedNodes","flatten","length","toggleAttribute","forEach","ftr","_expandPair","sh","_setVar","name","value","style","setProperty","_resolveSectionBg","token","isInset","isOverlay","SECTION_INSET_BG_MAP","BG_MAP","_resolveSectionGlassSurface","GLASS_BG_TIERS","resolveRadius","h","SIZE_MAP","b","f","ratio","Number","isFinite","Math","max","headerSep","footerSep","resolveColor","headerInsetBorder","footerInsetBorder","refreshLayout","render","headerLayoutClass","footerLayoutClass","headerClasses","classMap","section","inset","footerClasses","html","primary","secondary","tertiary","transparent","xs","xl","Set","styles","css","__decorateClass","property","type","String","reflect","prototype","customElement"],"mappings":"2jBA+FO,IAAMA,EAAN,cAAsBC,EAAtB,WAAAC,GAAAC,SAAAC,WACsCC,KAAAC,GAAK,UACLD,KAAAE,UAAY,OACZF,KAAAG,OAAS,KACTH,KAAAI,YAAc,OACdJ,KAAAK,UAA8B,KAC7BL,KAAAM,UAAW,EACXN,KAAAO,WAAY,EAEbP,KAAAQ,SACzC,cAEFR,KAAAS,WAAa,OAEbT,KAAAU,cAAgB,KACYV,KAAAW,aAAqC,SAEjEX,KAAAY,eAAiB,KAEjBZ,KAAAa,aAAe,KAEfb,KAAAc,qBAAuB,eAEoBd,KAAAe,SACzC,cAEFf,KAAAgB,WAAa,OAEbhB,KAAAiB,cAAgB,KACYjB,KAAAkB,aAAqC,SAEjElB,KAAAmB,eAAiB,KAEjBnB,KAAAoB,aAAe,KAEfpB,KAAAqB,qBAAuB,eAEKrB,KAAAsB,SAAW,EAEXtB,KAAAuB,WAAmC,OACnCvB,KAAAwB,SAAiC,OACjCxB,KAAAyB,OAA+B,OAE3DzB,KAAQ0B,qBAAsB,EAC9B1B,KAAQ2B,qBAAsB,EAC9B3B,KAAQ4B,mBAAoB,EAC5B5B,KAAQ6B,mBAAoB,EAC5B7B,KAAQ8B,iBAAkB,EAC1B9B,KAAQ+B,iBAAkB,EAC1B/B,KAAQgC,WAAqC,CAAA,EA6DFhC,KAAAiC,OAAS,GAEpDjC,KAAQkC,SAAW,IAAIC,EAAiBnC,KAAI,CAxB5C,uBAAeoC,CAAiBlC,GAC9B,MAAMmC,EACJ1C,EAAQ2C,SAAS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CL,EAAA,CAA1CC,EAAS,CAAEC,KAAMC,OAAQC,SAAS,KAvBxBlI,EAuBgCmI,UAAA,WAAA,GAG3CL,EAAA,CADCC,EAAS,CAAEC,KAAMC,OAAQC,SAAS,KAzBxBlI,EA0BXmI,UAAA,aAAA,GAEAL,EAAA,CADCC,EAAS,CAAEC,KAAMC,OAAQC,SAAS,KA3BxBlI,EA4BXmI,UAAA,gBAAA,GAC4BL,EAAA,CAA3BC,EAAS,CAAEC,KAAMC,UA7BPjI,EA6BiBmI,UAAA,eAAA,GAE5BL,EAAA,CADCC,EAAS,CAAEC,KAAMC,OAAQC,SAAS,KA9BxBlI,EA+BXmI,UAAA,iBAAA,GAEAL,EAAA,CADCC,EAAS,CAAEC,KAAMC,OAAQC,SAAS,KAhCxBlI,EAiCXmI,UAAA,eAAA,GAEAL,EAAA,CADCC,EAAS,CAAEC,KAAMC,UAlCPjI,EAmCXmI,UAAA,uBAAA,GAE4BL,EAAA,CAA3BC,EAAS,CAAEC,KAAM9B,UArCPlG,EAqCiBmI,UAAA,WAAA,GAEAL,EAAA,CAA3BC,EAAS,CAAEC,KAAMC,UAvCPjI,EAuCiBmI,UAAA,aAAA,GACAL,EAAA,CAA3BC,EAAS,CAAEC,KAAMC,UAxCPjI,EAwCiBmI,UAAA,WAAA,GACAL,EAAA,CAA3BC,EAAS,CAAEC,KAAMC,UAzCPjI,EAyCiBmI,UAAA,SAAA,GAqEeL,EAAA,CAA1CC,EAAS,CAAEC,KAAMC,OAAQC,SAAS,KA9GxBlI,EA8GgCmI,UAAA,SAAA,GA9GhCnI,EAAN8H,EAAA,CADNM,EAAc,aACFpI"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormControlBase, FormState } from
|
|
1
|
+
import { FormControlBase, FormState } from "../helper/internals/form-control-base";
|
|
2
2
|
export interface CheckboxProperties {
|
|
3
3
|
label: string;
|
|
4
4
|
checked: boolean;
|
|
@@ -65,6 +65,7 @@ export type SkyCheckboxValueClearedDetail = {
|
|
|
65
65
|
* @property {string} prefixColor - The color for the prefix text. Default: `""`.
|
|
66
66
|
* @property {string} suffixColor - The color for the suffix text. Default: `""`.
|
|
67
67
|
* @property {boolean} defaultChecked - Default checked state for reset operations. Default: `false`.
|
|
68
|
+
* @property {string} preset - Named prop preset from nearest `sky-config-provider`. Default: `""`.
|
|
68
69
|
* @method check Sets checked state to `true`.
|
|
69
70
|
* @method uncheck Sets checked state to `false`.
|
|
70
71
|
* @method toggle Toggles checked state.
|
|
@@ -120,14 +121,16 @@ export declare class SkyCheckbox extends FormControlBase {
|
|
|
120
121
|
set checked(v: boolean);
|
|
121
122
|
get indeterminate(): boolean;
|
|
122
123
|
set indeterminate(v: boolean);
|
|
123
|
-
|
|
124
|
+
/** Named prop preset from nearest `sky-config-provider`. */
|
|
125
|
+
preset: string;
|
|
126
|
+
private _presets;
|
|
127
|
+
static styles: import("lit").CSSResult[];
|
|
124
128
|
protected getFormValue(): FormState;
|
|
125
129
|
protected setValueFromFormState(state: FormState): void;
|
|
126
130
|
protected getValidityAnchor(): HTMLElement | undefined;
|
|
127
131
|
protected isEmpty(): boolean;
|
|
128
132
|
protected getNativeControl(): HTMLElement | null;
|
|
129
133
|
protected onFormReset(): void;
|
|
130
|
-
willUpdate(changed: Map<string | number | symbol, unknown>): void;
|
|
131
134
|
updated(changed: Map<string, unknown>): void;
|
|
132
135
|
private handleChange;
|
|
133
136
|
private validateInput;
|