@gjsify/adwaita-nativescript 0.38.1 → 0.39.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.
@@ -1,2 +1,2 @@
1
- import"../_virtual/_rolldown/runtime.js";import{adwaitaAccentBgColor as e,adwaitaAccentColor as t}from"@gjsify/adwaita-core";const n=[{selector:`.adw-switch`,property:`color`,role:`fill`},{selector:`.adw-slider`,property:`color`,role:`fill`},{selector:`.adw-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.adw-button.suggested-action:highlighted`,property:`background-color`,role:`shade`},{selector:`.adw-banner-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.adw-avatar`,property:`background-color`,role:`fill`},{selector:`.adw-viewswitcherbar-button.active .adw-viewswitcherbar-button-label`,property:`color`,role:`fill`},{selector:`.adw-viewswitcherbar-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-button-row`,property:`color`,role:`fill`},{selector:`.adw-button-row-title`,property:`color`,role:`fill`},{selector:`.adw-button-row-start-icon`,property:`color`,role:`fill`},{selector:`.adw-view-switcher-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-inline-view-switcher-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-carousel-dot.active`,property:`color`,role:`fill`},{selector:`.ns-dark .adw-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.ns-dark .adw-avatar`,property:`background-color`,role:`shade`}];function adwaitaNsAccentColor(n,r){return r===`fill`?e(n):t(n,!1)}function adwaitaNsAccentCss(e){return n.map(t=>`${t.selector} { ${t.property}: ${adwaitaNsAccentColor(e,t.role)}; }`).join(`
1
+ import"../_virtual/_rolldown/runtime.js";import{adwaitaAccentBgColor as e,adwaitaAccentColor as t}from"@gjsify/adwaita-core";const n=[{selector:`.adw-switch`,property:`color`,role:`fill`},{selector:`.adw-slider`,property:`color`,role:`fill`},{selector:`.adw-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.adw-button.suggested-action:highlighted`,property:`background-color`,role:`shade`},{selector:`.adw-banner-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.adw-avatar`,property:`background-color`,role:`fill`},{selector:`.adw-viewswitcherbar-button.active .adw-viewswitcherbar-button-label`,property:`color`,role:`fill`},{selector:`.adw-viewswitcherbar-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-button-row`,property:`color`,role:`fill`},{selector:`.adw-button-row-title`,property:`color`,role:`fill`},{selector:`.adw-view-switcher-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-inline-view-switcher-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-carousel-dot.active`,property:`color`,role:`fill`},{selector:`.adw-image-button.adw-entry-apply`,property:`background-color`,role:`fill`},{selector:`.adw-image-button.adw-entry-apply:highlighted`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.ns-dark .adw-button.suggested-action:highlighted`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-avatar`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-image-button.adw-entry-apply:highlighted`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-switch`,property:`color`,role:`standalone-dark`},{selector:`.ns-dark .adw-viewswitcherbar-button.active .adw-viewswitcherbar-button-label`,property:`color`,role:`standalone-dark`},{selector:`.ns-dark .adw-button-row-title, .ns-dark .adw-button-row-start-icon`,property:`color`,role:`standalone-dark`},{selector:`.ns-dark .adw-carousel-dot.active`,property:`color`,role:`standalone-dark`}];function adwaitaNsAccentColor(n,r){return r===`fill`?e(n):t(n,r===`standalone-dark`)}function adwaitaNsAccentCss(e){return n.map(t=>`${t.selector} { ${t.property}: ${adwaitaNsAccentColor(e,t.role)}; }`).join(`
2
2
  `)}export{n as ADWAITA_NS_ACCENT_RULES,adwaitaNsAccentColor,adwaitaNsAccentCss};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{adwaitaNsAccentCss as e}from"./accent-theme.js";import{Application as t}from"@nativescript/core";import{ADW_DEFAULT_ACCENT_COLOR as n}from"@gjsify/adwaita-core";function applyAdwaitaNsAccent(n){t.addCss(e(n))}function clearAdwaitaNsAccent(){t.addCss(e(n))}export{applyAdwaitaNsAccent,clearAdwaitaNsAccent};
1
+ import"../_virtual/_rolldown/runtime.js";import{adwaitaNsAccentCss as e}from"./accent-theme.js";import{Application as t}from"@nativescript/core";import{ADW_DEFAULT_ACCENT_COLOR as n,setAdwaitaAccent as r}from"@gjsify/adwaita-core";function applyAdwaitaNsAccent(n){r(n),t.addCss(e(n))}function clearAdwaitaNsAccent(){r(n),t.addCss(e(n))}export{applyAdwaitaNsAccent,clearAdwaitaNsAccent};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{ButtonRowState as e,buttonRowIconVisuals as t}from"./row-state.js";import{ACTIVATED as n,AdwActionRow as r}from"./adw-action-row.js";import{AdwIcon as i}from"./adw-icon.js";import{attachRowPressFeedback as a}from"./row-press.js";import{StackLayout as o}from"@nativescript/core";const s=`#3584e4`;var c=class AdwButtonRow extends r{isActionRow=!1;_contentBox;_startIcon;_endIcon;_buttonState=new e;constructor(){super(),this.className=`adw-row adw-action-row adw-button-row`,this._titleLabel.className=`adw-button-row-title`,this._titleLabel.horizontalAlignment=`center`,this._textStack.removeChild(this._titleLabel);let e=new o;e.orientation=`horizontal`,e.className=`adw-button-row-content`,e.horizontalAlignment=`center`,this._startIcon=AdwButtonRow._makeIcon(`adw-button-row-start-icon`),this._endIcon=AdwButtonRow._makeIcon(`adw-button-row-end-icon`),e.addChild(this._startIcon),e.addChild(this._titleLabel),e.addChild(this._endIcon),this._textStack.addChild(e),this._textStack.horizontalAlignment=`center`,this._contentBox=e,this.activatable=!0,this._applyIcons(),a(this)}static _makeIcon(e){let t=new i;return t.className=`${t.className} ${e}`.trim(),t.verticalAlignment=`middle`,t.iconColor=s,t}get startIcon(){return this._buttonState.startIconName}set startIcon(e){this._buttonState.setStartIconName(e)&&this._applyIcons()}get endIcon(){return this._buttonState.endIconName}set endIcon(e){this._buttonState.setEndIconName(e)&&this._applyIcons()}get startIconColor(){return this._startIcon.iconColor}set startIconColor(e){this._startIcon.iconColor=e||s,this._endIcon.iconColor=e||s}_applyIcons(){let e=t(this._buttonState.state);this._startIcon.icon=e.startIcon,this._startIcon.visibility=e.startIconVisibility,this._endIcon.icon=e.endIcon,this._endIcon.visibility=e.endIconVisibility}};export{n as ACTIVATED,c as AdwButtonRow};
1
+ import"../_virtual/_rolldown/runtime.js";import{ButtonRowState as e,buttonRowIconColor as t,buttonRowIconVisuals as n}from"./row-state.js";import{ACTIVATED as r,AdwActionRow as i}from"./adw-action-row.js";import{AdwIcon as a}from"./adw-icon.js";import{attachRowPressFeedback as o}from"./row-press.js";import{StackLayout as s}from"@nativescript/core";import{adwaitaAccent as c,onAdwaitaAccentChanged as l}from"@gjsify/adwaita-core";var u=class AdwButtonRow extends i{isActionRow=!1;_contentBox;_startIcon;_endIcon;_pinnedIconColor=null;_unsubAccent=null;_buttonState=new e;constructor(){super(),this.className=`adw-row adw-action-row adw-button-row`,this._titleLabel.className=`adw-button-row-title`,this._titleLabel.horizontalAlignment=`center`,this._textStack.removeChild(this._titleLabel);let e=new s;e.orientation=`horizontal`,e.className=`adw-button-row-content`,e.horizontalAlignment=`center`,this._startIcon=AdwButtonRow._makeIcon(`adw-button-row-start-icon`),this._endIcon=AdwButtonRow._makeIcon(`adw-button-row-end-icon`),this._applyIconColor(),this.addEventListener(`loaded`,()=>{this._applyIconColor(),this._unsubAccent??=l(()=>this._applyIconColor())}),this.addEventListener(`unloaded`,()=>{this._unsubAccent?.(),this._unsubAccent=null}),e.addChild(this._startIcon),e.addChild(this._titleLabel),e.addChild(this._endIcon),this._textStack.addChild(e),this._textStack.horizontalAlignment=`center`,this._contentBox=e,this.activatable=!0,this._applyIcons(),o(this)}static _makeIcon(e){let t=new a;return t.className=`${t.className} ${e}`.trim(),t.verticalAlignment=`middle`,t}get startIcon(){return this._buttonState.startIconName}set startIcon(e){this._buttonState.setStartIconName(e)&&this._applyIcons()}get endIcon(){return this._buttonState.endIconName}set endIcon(e){this._buttonState.setEndIconName(e)&&this._applyIcons()}get startIconColor(){return this._startIcon.iconColor}set startIconColor(e){this._pinnedIconColor=e||null,this._applyIconColor()}_applyIconColor(){let e=t(this._pinnedIconColor,c());this._startIcon.iconColor=e,this._endIcon.iconColor=e}_applyIcons(){let e=n(this._buttonState.state);this._startIcon.icon=e.startIcon,this._startIcon.visibility=e.startIconVisibility,this._endIcon.icon=e.endIcon,this._endIcon.visibility=e.endIconVisibility}};export{r as ACTIVATED,u as AdwButtonRow};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{AdwIcon as t}from"./adw-icon.js";import{AdwImageButton as n}from"./adw-image-button.js";import{NS_EDIT_ICON_CLASS as r,NS_ENTRY_ROW_CLASS as i,applyEntryRowState as a}from"./entry-row-view.js";import{Label as o,StackLayout as s,TextField as c}from"@nativescript/core";import{EntryRowState as l,EntryRowState as u}from"@gjsify/adwaita-core";import{documentEditSymbolic as d,objectSelectSymbolic as f}from"@gjsify/adwaita-icons/actions";const p=`notify::text`,m=`notify::text-length`,h=`apply`,g=`entry-activated`;var AdwEntryRow=class extends e{isActionRow=!1;_state=new u;_field;_emptyTitle;_suffixes;_editIcon;_indicator;_applyButton;_slotSuffix=null;_lastText=``;_lastLength=0;constructor(){super(),this._titleLabel.className=`adw-row-title adw-entry-title`,this._managesTitleVisibility=!1;let e=new o;e.className=`adw-row-title adw-entry-empty-title`,e.textWrap=!0,this._textStack.insertChild(e,0),this._emptyTitle=e;let i=new c;i.className=`adw-entry-field`,i.set(`backgroundColor`,`transparent`),i.set(`borderWidth`,0),this._textStack.addChild(i),this._field=i;let a=new s;a.orientation=`horizontal`,a.className=`adw-entry-row-suffixes`,this._suffixes=a;let l=new t;l.className=`adw-icon adw-entry-indicator`,a.addChild(l),this._indicator=l;let u=new n;u.className=`${u.className} adw-entry-apply`.trim(),u.icon=f,u.addEventListener(`tap`,()=>this.apply()),a.addChild(u),this._applyButton=u;let p=new t;p.className=r,p.icon=d,a.addChild(p),this._editIcon=p,super.setSuffix(a),this._field.addEventListener(`textChange`,()=>{this._state.setText(this._field.text??``)}),this._field.addEventListener(`focus`,()=>this._state.setEditing(!0)),this._field.addEventListener(`blur`,()=>this._state.setEditing(!1)),this._field.addEventListener(`returnPress`,()=>this._activate()),this._lastText=this._state.text,this._lastLength=this._state.textLength,this._render(this._state.state),this._state.subscribe(e=>this._onStateChanged(e))}get text(){return this._state.text}set text(e){this._state.setText(e??``)}get textLength(){return this._state.textLength}get maxLength(){return this._state.maxLength}set maxLength(e){this._state.setMaxLength(e)}get editable(){return this._state.editable}set editable(e){this._state.setEditable(e)}get showApplyButton(){return this._state.showApplyButton}set showApplyButton(e){this._state.setShowApplyButton(e)}get activatesDefault(){return this._state.activatesDefault}set activatesDefault(e){this._state.setActivatesDefault(e)}get editing(){return this._state.editing}addSuffix(e){e.className=`${e.className??``} adw-row-suffix`.trim(),this._suffixes.addChild(e)}setSuffix(e){this._slotSuffix&&=(this._suffixes.removeChild(this._slotSuffix),null),e&&(this.addSuffix(e),this._slotSuffix=e)}get suffix(){return this._slotSuffix}setShowIndicator(e){this._state.setShowIndicator(e)}setIndicatorIcon(e){this._indicator.icon=e}apply(){this._state.apply(),this.notify({eventName:h,object:this})}_activate(){let e=this._state.activate();if(e.signal===`apply`){this.notify({eventName:h,object:this});return}let t={eventName:g,object:this,activateDefault:e.activateDefault};this.notify(t)}_render(e){a({row:this,emptyTitle:this._emptyTitle,title:this._titleLabel,field:this._field,editIcon:this._editIcon,indicator:this._indicator,applyButton:this._applyButton},e,this._baseClassName)}get _baseClassName(){return i}_onStateChanged(e){if(this._render(e),e.text!==this._lastText){this._lastText=e.text;let t={eventName:p,object:this,text:e.text};this.notify(t)}if(e.textLength!==this._lastLength){this._lastLength=e.textLength;let t={eventName:m,object:this,textLength:e.textLength};this.notify(t)}}};export{AdwEntryRow,l as EntryRowState,p as NOTIFY_TEXT,m as NOTIFY_TEXT_LENGTH,h as SIGNAL_APPLY,g as SIGNAL_ENTRY_ACTIVATED};
1
+ import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{AdwIcon as t}from"./adw-icon.js";import{AdwImageButton as n}from"./adw-image-button.js";import{NS_EDIT_ICON_CLASS as r,NS_ENTRY_ROW_CLASS as i,applyEntryRowState as a}from"./entry-row-view.js";import{Label as o,StackLayout as s,TextField as c}from"@nativescript/core";import{ADW_ACCENT_FG_COLOR as l,EntryRowState as u,EntryRowState as d}from"@gjsify/adwaita-core";import{documentEditSymbolic as f,objectSelectSymbolic as p}from"@gjsify/adwaita-icons/actions";const m=`notify::text`,h=`notify::text-length`,g=`apply`,_=`entry-activated`;var AdwEntryRow=class extends e{isActionRow=!1;_state=new d;_field;_emptyTitle;_suffixes;_editIcon;_indicator;_applyButton;_slotSuffix=null;_lastText=``;_lastLength=0;constructor(){super(),this._titleLabel.className=`adw-row-title adw-entry-title`,this._managesTitleVisibility=!1;let e=new o;e.className=`adw-row-title adw-entry-empty-title`,e.textWrap=!0,this._textStack.insertChild(e,0),this._emptyTitle=e;let i=new c;i.className=`adw-entry-field`,i.set(`backgroundColor`,`transparent`),i.set(`borderWidth`,0),this._textStack.addChild(i),this._field=i;let a=new s;a.orientation=`horizontal`,a.className=`adw-entry-row-suffixes`,this._suffixes=a;let u=new t;u.className=`adw-icon adw-entry-indicator`,a.addChild(u),this._indicator=u;let d=new n;d.className=`${d.className} adw-entry-apply`.trim(),d.icon=p,d.iconColor=l,d.addEventListener(`tap`,()=>this.apply()),a.addChild(d),this._applyButton=d;let m=new t;m.className=r,m.icon=f,a.addChild(m),this._editIcon=m,super.setSuffix(a),this._field.addEventListener(`textChange`,()=>{this._state.setText(this._field.text??``)}),this._field.addEventListener(`focus`,()=>this._state.setEditing(!0)),this._field.addEventListener(`blur`,()=>this._state.setEditing(!1)),this._field.addEventListener(`returnPress`,()=>this._activate()),this._lastText=this._state.text,this._lastLength=this._state.textLength,this._render(this._state.state),this._state.subscribe(e=>this._onStateChanged(e))}get text(){return this._state.text}set text(e){this._state.setText(e??``)}get textLength(){return this._state.textLength}get maxLength(){return this._state.maxLength}set maxLength(e){this._state.setMaxLength(e)}get editable(){return this._state.editable}set editable(e){this._state.setEditable(e)}get showApplyButton(){return this._state.showApplyButton}set showApplyButton(e){this._state.setShowApplyButton(e)}get activatesDefault(){return this._state.activatesDefault}set activatesDefault(e){this._state.setActivatesDefault(e)}get editing(){return this._state.editing}addSuffix(e){e.className=`${e.className??``} adw-row-suffix`.trim(),this._suffixes.addChild(e)}setSuffix(e){this._slotSuffix&&=(this._suffixes.removeChild(this._slotSuffix),null),e&&(this.addSuffix(e),this._slotSuffix=e)}get suffix(){return this._slotSuffix}setShowIndicator(e){this._state.setShowIndicator(e)}setIndicatorIcon(e){this._indicator.icon=e}apply(){this._state.apply(),this.notify({eventName:g,object:this})}_activate(){let e=this._state.activate();if(e.signal===`apply`){this.notify({eventName:g,object:this});return}let t={eventName:_,object:this,activateDefault:e.activateDefault};this.notify(t)}_render(e){a({row:this,emptyTitle:this._emptyTitle,title:this._titleLabel,field:this._field,editIcon:this._editIcon,indicator:this._indicator,applyButton:this._applyButton},e,this._baseClassName)}get _baseClassName(){return i}_onStateChanged(e){if(this._render(e),e.text!==this._lastText){this._lastText=e.text;let t={eventName:m,object:this,text:e.text};this.notify(t)}if(e.textLength!==this._lastLength){this._lastLength=e.textLength;let t={eventName:h,object:this,textLength:e.textLength};this.notify(t)}}};export{AdwEntryRow,u as EntryRowState,m as NOTIFY_TEXT,h as NOTIFY_TEXT_LENGTH,g as SIGNAL_APPLY,_ as SIGNAL_ENTRY_ACTIVATED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{AdwIcon as t}from"./adw-icon.js";import{GridLayout as n,ItemSpec as r,StackLayout as i}from"@nativescript/core";import{ExpanderState as a,ExpanderState as o}from"@gjsify/adwaita-core";import{panDownSymbolic as s,panUpSymbolic as c}from"@gjsify/adwaita-icons/ui";const l=`notify::expanded`;var AdwExpanderRow=class extends e{isActionRow=!1;_toggle;_disclosure;_state=new o;constructor(){super(),this.className=`adw-row adw-action-row adw-expander-row`,this.addRow(new r(1,`auto`));let e=new i;e.orientation=`vertical`,e.className=`adw-expander-disclosure`,e.visibility=`collapse`,n.setRow(e,1),n.setColumn(e,0),n.setColumnSpan(e,3),this.addChild(e),this._disclosure=e;let a=new t;a.icon=s,a.className=`${a.className} adw-expander-toggle`.trim(),this.setSuffix(a),this._toggle=a,this._state.subscribe(e=>{this._disclosure.visibility=e?`visible`:`collapse`,this._toggle.icon=e?c:s;let t={eventName:l,object:this,expanded:e};this.notify(t)}),a.addEventListener(`tap`,()=>{this._state.toggle()})}addRow(e){if(e instanceof r){super.addRow(e);return}this._disclosure.addChild(e)}removeRow(e){this._disclosure.removeChild(e)}get expanded(){return this._state.expanded}set expanded(e){this._state.setExpanded(e)}};export{AdwExpanderRow,a as ExpanderState,l as NOTIFY_EXPANDED};
1
+ import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{AdwIcon as t}from"./adw-icon.js";import{GridLayout as n,ItemSpec as r,StackLayout as i}from"@nativescript/core";import{ExpanderState as a,ExpanderState as o}from"@gjsify/adwaita-core";import{panDownSymbolic as s,panUpSymbolic as c}from"@gjsify/adwaita-icons/ui";const l=`notify::expanded`;var AdwExpanderRow=class extends e{isActionRow=!1;_toggle;_disclosure;_state=new o;constructor(){super(),this.className=`adw-row adw-action-row adw-expander-row`,this.addRow(new r(1,`auto`));let e=new i;e.orientation=`vertical`,e.className=`adw-expander-disclosure`,e.visibility=`collapse`,n.setRow(e,1),n.setColumn(e,0),n.setColumnSpan(e,3),this.addChild(e),this._disclosure=e;let a=new t;a.icon=s,a.className=`${a.className} adw-expander-toggle`.trim(),this.setSuffix(a),this._toggle=a,this._state.subscribe(e=>{this._disclosure.visibility=e?`visible`:`collapse`,this._toggle.icon=e?c:s;let t={eventName:l,object:this,expanded:e};this.notify(t)});let toggleOnTap=()=>{this._state.toggle()};this._textStack.addEventListener(`tap`,toggleOnTap),a.addEventListener(`tap`,toggleOnTap)}addRow(e){if(e instanceof r){super.addRow(e);return}this._disclosure.addChild(e)}removeRow(e){this._disclosure.removeChild(e)}get expanded(){return this._state.expanded}set expanded(e){this._state.setExpanded(e)}};export{AdwExpanderRow,a as ExpanderState,l as NOTIFY_EXPANDED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{viewConcealSymbolic as e,viewRevealSymbolic as t}from"@gjsify/adwaita-icons/actions";const n=`adw-row adw-action-row adw-entry-row`,r=`${n} adw-password-entry-row`,i=`adw-icon adw-entry-edit`,a=`adw-insensitive`,o=.4;function nsVisibility(e){return e?`visible`:`collapse`}function entryRowClassName(e,t){let n=e;return t.editing&&(n+=` focused`),t.empty&&(n+=` empty`),n}function applyEntryRowState(e,t,n){e.row.className=entryRowClassName(n,t),e.field.text!==t.text&&(e.field.text=t.text),e.field.editable=t.editable,e.emptyTitle.visibility=nsVisibility(t.emptyTarget===0),e.title.visibility=nsVisibility(t.emptyTarget===1),e.editIcon.visibility=nsVisibility(t.editIconVisible),e.editIcon.className=t.editIconSensitive?i:`${i} ${a}`,e.editIcon.opacity=t.editIconSensitive?1:o,e.indicator.visibility=nsVisibility(t.indicatorVisible),e.applyButton.visibility=nsVisibility(t.applyButtonVisible)}function peekIconSvg(n){return n===`view-conceal-symbolic`?e:t}function applyPasswordEntryRowState(e,t){e.field.secure=!t.revealed,e.peekButton.icon=peekIconSvg(t.peekIconName)}export{i as NS_EDIT_ICON_CLASS,n as NS_ENTRY_ROW_CLASS,a as NS_INSENSITIVE_CLASS,o as NS_INSENSITIVE_OPACITY,r as NS_PASSWORD_ENTRY_ROW_CLASS,applyEntryRowState,applyPasswordEntryRowState,entryRowClassName,nsVisibility,peekIconSvg};
1
+ import"../_virtual/_rolldown/runtime.js";import{viewConcealSymbolic as e,viewRevealSymbolic as t}from"@gjsify/adwaita-icons/actions";const n=`adw-row adw-action-row adw-entry-row`,r=`${n} adw-password-entry-row`,i=`adw-icon adw-entry-edit`,a=`adw-insensitive`,o=.3;function nsVisibility(e){return e?`visible`:`collapse`}function entryRowClassName(e,t){let n=e;return t.editing&&(n+=` focused`),t.empty&&(n+=` empty`),n}function applyEntryRowState(e,t,n){e.row.className=entryRowClassName(n,t),e.field.text!==t.text&&(e.field.text=t.text),e.field.editable=t.editable,e.emptyTitle.visibility=nsVisibility(t.emptyTarget===0),e.title.visibility=nsVisibility(t.emptyTarget===1),e.editIcon.visibility=nsVisibility(t.editIconVisible),e.editIcon.className=t.editIconSensitive?i:`${i} ${a}`,e.editIcon.opacity=t.editIconSensitive?1:o,e.indicator.visibility=nsVisibility(t.indicatorVisible),e.applyButton.visibility=nsVisibility(t.applyButtonVisible)}function peekIconSvg(n){return n===`view-conceal-symbolic`?e:t}function applyPasswordEntryRowState(e,t){e.field.secure=!t.revealed,e.peekButton.icon=peekIconSvg(t.peekIconName)}export{i as NS_EDIT_ICON_CLASS,n as NS_ENTRY_ROW_CLASS,a as NS_INSENSITIVE_CLASS,o as NS_INSENSITIVE_OPACITY,r as NS_PASSWORD_ENTRY_ROW_CLASS,applyEntryRowState,applyPasswordEntryRowState,entryRowClassName,nsVisibility,peekIconSvg};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{ActionRowState as e,ButtonRowState as t,SwitchRowState as n,WindowTitleState as r,deriveRowLabels as i}from"@gjsify/adwaita-core";function nsVisibility(e){return e?`visible`:`collapse`}function rowLabelVisuals(e){return toLabelVisuals(i(e))}function toLabelVisuals(e){return{title:e.title,titleVisibility:nsVisibility(e.titleVisible),subtitle:e.subtitle,subtitleVisibility:nsVisibility(e.subtitleVisible)}}function buttonRowIconVisuals(e){return{startIcon:e.startIconName,startIconVisibility:nsVisibility(e.startIconVisible),endIcon:e.endIconName,endIconVisibility:nsVisibility(e.endIconVisible)}}function isViewSensitive(e){return e?e.isUserInteractionEnabled!==!1:!0}export{e as ActionRowState,t as ButtonRowState,n as SwitchRowState,r as WindowTitleState,buttonRowIconVisuals,isViewSensitive,nsVisibility,rowLabelVisuals,toLabelVisuals};
1
+ import"../_virtual/_rolldown/runtime.js";import{ActionRowState as e,ButtonRowState as t,SwitchRowState as n,WindowTitleState as r,adwaitaAccentBgColor as i,deriveRowLabels as a}from"@gjsify/adwaita-core";function nsVisibility(e){return e?`visible`:`collapse`}function rowLabelVisuals(e){return toLabelVisuals(a(e))}function toLabelVisuals(e){return{title:e.title,titleVisibility:nsVisibility(e.titleVisible),subtitle:e.subtitle,subtitleVisibility:nsVisibility(e.subtitleVisible)}}function buttonRowIconVisuals(e){return{startIcon:e.startIconName,startIconVisibility:nsVisibility(e.startIconVisible),endIcon:e.endIconName,endIconVisibility:nsVisibility(e.endIconVisible)}}function buttonRowIconColor(e,t){return e||i(t)}function isViewSensitive(e){return e?e.isUserInteractionEnabled!==!1:!0}export{e as ActionRowState,t as ButtonRowState,n as SwitchRowState,r as WindowTitleState,buttonRowIconColor,buttonRowIconVisuals,isViewSensitive,nsVisibility,rowLabelVisuals,toLabelVisuals};
@@ -1,6 +1,6 @@
1
1
  import { type AdwAccentColorName } from '@gjsify/adwaita-core';
2
- /** Which of the two accent shades a declaration carries. */
3
- export type AccentRole = 'fill' | 'shade';
2
+ /** Which accent shade a declaration carries. */
3
+ export type AccentRole = 'fill' | 'shade' | 'standalone-dark';
4
4
  /** One accent-carrying declaration in `theme/adwaita.css`. */
5
5
  export interface AccentRule {
6
6
  /** The selector, exactly as the theme spells it. */
@@ -1,5 +1,15 @@
1
1
  import { type AdwAccentColorName } from '@gjsify/adwaita-core';
2
- /** Repaint every accent-coloured rule in the theme for `accent`. */
2
+ /**
3
+ * Repaint every accent-coloured rule in the theme for `accent`.
4
+ *
5
+ * The core's accent state is set FIRST, and that is not bookkeeping. A widget
6
+ * whose accent lands somewhere CSS cannot reach — a symbolic icon is a bitmap
7
+ * rendered in its fill colour — can only follow by re-rendering on
8
+ * `onAdwaitaAccentChanged`, and that fires from here. `setAdwaitaAccent`'s own
9
+ * documentation names this as the renderer's half of the contract; the two were
10
+ * simply never connected on this port, so `adwaitaAccent()` stayed `'blue'`
11
+ * however many times the stylesheet was replaced.
12
+ */
3
13
  export declare function applyAdwaitaNsAccent(accent: AdwAccentColorName): void;
4
14
  /**
5
15
  * Go back to libadwaita's default blue.
@@ -13,6 +13,10 @@ export declare class AdwButtonRow extends AdwActionRow {
13
13
  protected readonly _startIcon: AdwIcon;
14
14
  /** The trailing symbolic icon. */
15
15
  protected readonly _endIcon: AdwIcon;
16
+ /** An explicit icon fill (the destructive red), or `null` to follow the accent. */
17
+ private _pinnedIconColor;
18
+ /** Live accent subscription — held only while the row is on screen. */
19
+ private _unsubAccent;
16
20
  /**
17
21
  * The headless start/end icon state (ADR 0004).
18
22
  *
@@ -23,7 +27,8 @@ export declare class AdwButtonRow extends AdwActionRow {
23
27
  */
24
28
  private readonly _buttonState;
25
29
  constructor();
26
- /** A centered, accent-coloured symbolic icon, collapsed until it has content. */
30
+ /** A centered symbolic icon, collapsed until it has content. Its fill is set by
31
+ * {@link _applyIconColor}, which is also what follows an accent change. */
27
32
  private static _makeIcon;
28
33
  /**
29
34
  * A leading Adwaita symbolic SVG string before the centered title (e.g.
@@ -45,6 +50,8 @@ export declare class AdwButtonRow extends AdwActionRow {
45
50
  */
46
51
  get startIconColor(): string;
47
52
  set startIconColor(value: string);
53
+ /** Paint both icons in the pinned colour, or in the active accent's fill. */
54
+ private _applyIconColor;
48
55
  /** Push the derived icon payload + visibility onto the two `AdwIcon`s. */
49
56
  private _applyIcons;
50
57
  }
@@ -54,8 +54,16 @@ export declare const NS_EDIT_ICON_CLASS = "adw-icon adw-entry-edit";
54
54
  * actually sees.
55
55
  */
56
56
  export declare const NS_INSENSITIVE_CLASS = "adw-insensitive";
57
- /** Opacity of a desensitized part (`gtk_widget_set_sensitive (…, FALSE)`, C:150). */
58
- export declare const NS_INSENSITIVE_OPACITY = 0.4;
57
+ /**
58
+ * Opacity of the desensitized pencil — `$strong_disabled_opacity` 30%
59
+ * (_colors.scss:311), which `> .edit-icon:disabled` takes (_lists.scss:205-207).
60
+ *
61
+ * NOT the general `--disabled-opacity` (50% light / 40% dark): libadwaita gives
62
+ * this one icon a stronger dim than a disabled widget gets, and 0.4 here was the
63
+ * general value applied to the one place that has its own. A second user of
64
+ * {@link NS_INSENSITIVE_CLASS} needs its own number, not this one.
65
+ */
66
+ export declare const NS_INSENSITIVE_OPACITY = 0.3;
59
67
  /** Map a boolean onto NativeScript's `visibility`. */
60
68
  export declare function nsVisibility(visible: boolean): NsVisibility;
61
69
  /**
@@ -1,5 +1,5 @@
1
1
  import { ActionRowState, ButtonRowState, SwitchRowState, WindowTitleState } from '@gjsify/adwaita-core';
2
- import type { AdwRowLabelInput, AdwRowLabels, ButtonRowRenderState } from '@gjsify/adwaita-core';
2
+ import type { AdwAccentColorName, AdwRowLabelInput, AdwRowLabels, ButtonRowRenderState } from '@gjsify/adwaita-core';
3
3
  import type { View } from '@nativescript/core';
4
4
  export { ActionRowState, ButtonRowState, SwitchRowState, WindowTitleState };
5
5
  export type { AdwRowLabels, ButtonRowRenderState };
@@ -42,6 +42,21 @@ export interface NsButtonRowIconVisuals {
42
42
  * is `string_is_not_empty`, which reads the first byte.
43
43
  */
44
44
  export declare function buttonRowIconVisuals(state: ButtonRowRenderState): NsButtonRowIconVisuals;
45
+ /**
46
+ * The fill an `AdwButtonRow`'s two symbolic icons take.
47
+ *
48
+ * `row.button` paints its title in `--accent-color` and libadwaita moves it with
49
+ * the accent; here the icons are bitmaps rendered in a colour, so the value has
50
+ * to be RESOLVED rather than inherited, and it has to be resolved again whenever
51
+ * the accent changes. An explicit `pinned` colour wins — that is how a caller
52
+ * gives a `destructive-action` row its red — and an empty pin means "follow",
53
+ * not "freeze on the blue that was current when you asked".
54
+ *
55
+ * Lives here, in the module with no `@nativescript/core` value imports, because
56
+ * `AdwButtonRow extends AdwActionRow extends GridLayout` and no spec can import
57
+ * it off-device. A rule inside that class is a rule nothing checks.
58
+ */
59
+ export declare function buttonRowIconColor(pinned: string | null | undefined, accent: AdwAccentColorName): string;
45
60
  /**
46
61
  * Whether a view is "sensitive" in the sense the `activatable-widget` binding reads
47
62
  * (`GtkWidget:sensitive` → `GtkListBoxRow:activatable`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/adwaita-nativescript",
3
- "version": "0.38.1",
3
+ "version": "0.39.0",
4
4
  "description": "Native Adwaita widgets for the NativeScript runtime — real NativeScript components (StackLayout/GridLayout/Switch/Label) styled like Libadwaita, not a webview",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -47,10 +47,10 @@
47
47
  "design-system"
48
48
  ],
49
49
  "dependencies": {
50
- "@gjsify/adwaita-core": "^0.38.1",
51
- "@gjsify/adwaita-fonts": "^0.38.1",
52
- "@gjsify/adwaita-icons": "^0.38.1",
53
- "@gjsify/native-platform": "^0.38.1"
50
+ "@gjsify/adwaita-core": "^0.39.0",
51
+ "@gjsify/adwaita-fonts": "^0.39.0",
52
+ "@gjsify/adwaita-icons": "^0.39.0",
53
+ "@gjsify/native-platform": "^0.39.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@nativescript/core": "*"
@@ -61,8 +61,8 @@
61
61
  }
62
62
  },
63
63
  "devDependencies": {
64
- "@gjsify/cli": "^0.38.1",
65
- "@gjsify/unit": "^0.38.1",
64
+ "@gjsify/cli": "^0.39.0",
65
+ "@gjsify/unit": "^0.39.0",
66
66
  "@types/node": "^25.9.2",
67
67
  "typescript": "^6.0.3"
68
68
  },
@@ -55,11 +55,15 @@ Page.adw-window {
55
55
  /* NS has no text-transform; author titles in upper-case in markup if desired. */
56
56
  }
57
57
 
58
- /* Dimmed description line below the title. */
58
+ /* Dimmed description line below the title.
59
+ *
60
+ * The 6 above it is `box.labels`'s `border-spacing: 6px` (_preferences.scss:7-9)
61
+ * — the labels box carries nothing else, and the NS subset has no property for a
62
+ * spacing, so the gap rides on the second child. It was 2. */
59
63
  .adw-preferences-group-description {
60
64
  font-size: 12;
61
65
  color: rgba(0, 0, 0, 0.55);
62
- margin: 2 0 0 0;
66
+ margin: 6 0 0 0;
63
67
  }
64
68
 
65
69
  /* The boxed list: rounded card holding the rows. */
@@ -185,6 +189,58 @@ Page.adw-window {
185
189
  margin: 2 0 0 0;
186
190
  }
187
191
 
192
+ /* The large placeholder shown while the row is EMPTY. `empty_title` carries
193
+ * `.title` AND `.dimmed` (adw-entry-row.ui), so it is a full-size title at
194
+ * `--dim-opacity` 55% (_colors.scss:319) — not a full-strength one. It inherits
195
+ * `.adw-row-title`'s size and colour and only dims here.
196
+ *
197
+ * `opacity`, not a dimmer `color` as most of this file spells "dim": the two
198
+ * titles are the endpoints of a cross-fade, so what this reproduces IS an alpha,
199
+ * and one value then answers both schemes. */
200
+ .adw-entry-empty-title {
201
+ opacity: 0.55;
202
+ }
203
+
204
+ /* The trailing cluster — caps-lock indicator, apply button, pencil.
205
+ *
206
+ * libadwaita separates the three with `margin-left: 6px` EACH (_lists.scss:200-203,
207
+ * LTR), not with a spacing on the box that holds them: the NS subset has no
208
+ * `border-spacing`, so the same 6 rides on the children, as it does between the
209
+ * keycaps in `.adw-shortcut-label`.
210
+ *
211
+ * Their 24×24 + 5 padding box (_lists.scss:194-198) is deliberately NOT
212
+ * reproduced. It is a hit/alignment box around a 16 glyph, and NS would read a
213
+ * `min-width` on an `Image` as room to SCALE the bitmap into — an icon half
214
+ * again too large rather than a roomier one. The glyph size is AdwIcon's own. */
215
+ .adw-entry-indicator,
216
+ .adw-entry-edit {
217
+ margin: 0 0 0 6;
218
+ }
219
+
220
+ /* The caps-lock warning sits at `$dimmer_opacity` 30% (_colors.scss:309, applied
221
+ * _lists.scss:209-214) — dimmer than `.dimmed`, because it is a passive warning
222
+ * rather than a label. */
223
+ .adw-entry-indicator {
224
+ opacity: 0.3;
225
+ }
226
+
227
+ /* `apply_button` is built `suggested-action circular` (adw-entry-row.ui:91-102):
228
+ * an ACCENT-FILLED round button, not the flat rounded square every other
229
+ * `AdwImageButton` is. Compound selector so it beats the later `.adw-image-button`
230
+ * rule, as `.adw-spin-button` does. The 34×34 the base gives it already IS
231
+ * `%circular_button`'s minimum (_buttons.scss:312-317), so only the fill, the
232
+ * full radius and the 6 gap change. The checkmark is turned white in the widget:
233
+ * `--accent-fg-color` lands on a bitmap fill, which no CSS rule here can reach. */
234
+ .adw-image-button.adw-entry-apply {
235
+ background-color: #3584e4;
236
+ border-radius: 9999;
237
+ margin: 0 0 0 6;
238
+ }
239
+
240
+ .adw-image-button.adw-entry-apply:highlighted {
241
+ background-color: #1c71d8;
242
+ }
243
+
188
244
  .adw-password-field {
189
245
  /* secure handled in code; styling identical to a normal entry field. */
190
246
  color: rgba(0, 0, 0, 0.8);
@@ -333,14 +389,24 @@ Page.adw-window {
333
389
 
334
390
  /* ===== Expander row (disclosure) ===== */
335
391
 
392
+ /* The disclosure chevron. `expander-widget > box > title > expander` sits at 70%
393
+ * and goes opaque on hover/press (_expanders.scss:16-21); NS has no hover, so the
394
+ * resting 70% is the whole of it.
395
+ *
396
+ * The `width: 32` / `height: 32` that used to be here NEVER APPLIED. NativeScript
397
+ * ignores a CSS value for a property the widget has set as a LOCAL one
398
+ * (properties/index.js:585-598), and `AdwIcon` assigns `width`/`height` in its
399
+ * constructor — so the chevron has always been the 16 `expander`'s own minimum
400
+ * asks for (_expanders.scss:2-3), which is right, while the stylesheet claimed
401
+ * a 32 tap target it never got. `color` and `font-size` were dead for the other
402
+ * reason: it is an `Image` of a pre-coloured bitmap.
403
+ *
404
+ * The tap target is a separate matter, filed as #1155 — libadwaita toggles from
405
+ * the HEADER ROW ("must be activatable to toggle expansion by clicking or
406
+ * tapping anywhere on it", adw-expander-row.ui:25-27), and this port listens on
407
+ * the chevron alone. */
336
408
  .adw-expander-toggle {
337
- width: 32;
338
- height: 32;
339
- /* Flat chevron affordance — transparent, no button chrome. */
340
- background-color: transparent;
341
- color: rgba(0, 0, 0, 0.55);
342
- font-size: 16;
343
- padding: 0;
409
+ opacity: 0.7;
344
410
  margin: 0;
345
411
  }
346
412
 
@@ -836,10 +902,21 @@ Page.adw-window {
836
902
  margin: 0;
837
903
  }
838
904
 
905
+ /* The two glyphs either side of the centered title. `row.button > box` spaces its
906
+ * three children with `border-spacing: 6px` (_lists.scss:458-462), which the NS
907
+ * subset has no property for — so the 6 rides on the icons, mirrored.
908
+ *
909
+ * MARGIN ONLY. Both are `AdwIcon`s, i.e. `Image`s showing a bitmap that was
910
+ * rendered in its fill colour, so `color` here reaches nothing and `font-size`
911
+ * has no text to size. They used to be declared anyway, which put a dead accent
912
+ * declaration in the runtime-accent table as well; the colour now follows the
913
+ * accent through `iconColor`, which is the only thing that can carry it. */
839
914
  .adw-button-row-start-icon {
840
- font-size: 15;
841
- color: #3584e4;
842
- margin: 0 8 0 0;
915
+ margin: 0 6 0 0;
916
+ }
917
+
918
+ .adw-button-row-end-icon {
919
+ margin: 0 0 0 6;
843
920
  }
844
921
 
845
922
  /* ===== Button content (icon + label) ===== */
@@ -1494,6 +1571,27 @@ Page.ns-dark.adw-window {
1494
1571
  color: #ffffff;
1495
1572
  }
1496
1573
 
1574
+ /* The apply button keeps the SAME accent in both schemes (`--accent-bg-color`
1575
+ * does not change), so only the press shade is restated — and it HAS to be.
1576
+ * NativeScript sums specificity flat (class, attribute and pseudo-class are 10
1577
+ * each; css-selector.js:205,292) and breaks ties by source order, so the light
1578
+ * `.adw-image-button.adw-entry-apply:highlighted` (30) TIES the generic
1579
+ * `.ns-dark .adw-image-button:highlighted` (30) further down and loses to it.
1580
+ * Naming the scheme here (40) is what settles it; without this rule a pressed
1581
+ * apply button flashes grey on a dark page.
1582
+ *
1583
+ * It carries the SHADE role, the same one the light press uses — `.ns-dark
1584
+ * .adw-avatar` already spells a shade under a dark selector, and the role is
1585
+ * scheme-independent by construction (accent-theme.ts). The dark button press two
1586
+ * sections down used to hand-pick its own literal instead; #1154 made it carry
1587
+ * this same role, so the two dark presses now agree. */
1588
+ .ns-dark .adw-image-button.adw-entry-apply:highlighted {
1589
+ background-color: #1c71d8;
1590
+ }
1591
+
1592
+ /* The two dims are alphas, not colours — they answer both schemes unchanged, so
1593
+ * `.adw-entry-empty-title` and `.adw-entry-indicator` need no dark counterpart. */
1594
+
1497
1595
  /* ===== Dark: entry (standalone) ===== */
1498
1596
 
1499
1597
  /* The dark `$button_color`: currentColor at 10% over a white foreground. */
@@ -1551,11 +1649,9 @@ Page.ns-dark.adw-window {
1551
1649
 
1552
1650
  /* ===== Dark: expander row ===== */
1553
1651
 
1554
- .ns-dark .adw-expander-toggle {
1555
- /* Flat chevron — transparent, dim foreground. */
1556
- background-color: transparent;
1557
- color: rgba(255, 255, 255, 0.55);
1558
- }
1652
+ /* No dark counterpart for the chevron: the 70% is an alpha over whatever the
1653
+ * bitmap was rendered in, and AdwIcon re-renders that on a scheme change. The
1654
+ * `color` this rule used to set reached an `Image` and did nothing. */
1559
1655
 
1560
1656
  .ns-dark .adw-expander-disclosure {
1561
1657
  background-color: #222226;
@@ -1592,8 +1688,16 @@ Page.ns-dark.adw-window {
1592
1688
  background-color: rgba(255, 255, 255, 0.22);
1593
1689
  }
1594
1690
 
1691
+ /* The SHADE, not a lighter press. libadwaita presses an opaque button — which is
1692
+ * what `.suggested-action` extends — with `background-image: image(RGB(0 0 6 /
1693
+ * 20%))`, a darkening overlay that is identical in both schemes
1694
+ * (_buttons.scss:165-167). The lighter press two rules up belongs to the plain
1695
+ * button, whose fill is itself an overlay; an accent button has no lighter state
1696
+ * in either scheme. This used to hand-pick `#2c75d6`, a third literal the accent
1697
+ * override could not reach, so the button turned orange and its pressed state
1698
+ * flashed blue (#1154). */
1595
1699
  .ns-dark .adw-button.suggested-action:highlighted {
1596
- background-color: #2c75d6;
1700
+ background-color: #1c71d8;
1597
1701
  }
1598
1702
 
1599
1703
  .ns-dark .adw-button.destructive-action:highlighted {