@vectoriox/iox-builder 4.32.0 → 4.32.1

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.
@@ -10075,18 +10075,6 @@ const QUIET = {
10075
10075
  backgroundColor: 'transparent', color: TOKEN$1('inkMuted', '#4a453f'),
10076
10076
  fontSize: '11px', fontWeight: '400', padding: '2px 4px', textDecoration: 'underline',
10077
10077
  };
10078
- const SMALL_ALLOW = {
10079
- backgroundColor: 'transparent', color: TOKEN$1('ink', '#1f1d1b'),
10080
- borderWidth: '1px', borderStyle: 'solid', borderColor: TOKEN$1('ink', '#1f1d1b'),
10081
- fontSize: '11px', fontWeight: '600', padding: '5px 10px',
10082
- borderRadius: TOKEN$1('radius-control', '4px'),
10083
- };
10084
- const SMALL_REFUSE = {
10085
- backgroundColor: 'transparent', color: TOKEN$1('inkMuted', '#6b6560'),
10086
- borderWidth: '1px', borderStyle: 'solid', borderColor: TOKEN$1('line', '#d8d4d1'),
10087
- fontSize: '11px', fontWeight: '600', padding: '5px 10px',
10088
- borderRadius: TOKEN$1('radius-control', '4px'),
10089
- };
10090
10078
  function row(createConfig, styles, children) {
10091
10079
  const container = createConfig('Container');
10092
10080
  if (!container || children.some(c => !c))
@@ -10166,15 +10154,19 @@ function buildConsentPreset(createConfig) {
10166
10154
  textColOf('Necessary', 'Keeps the site working: your session, your language, this very choice. Always on.'),
10167
10155
  alwaysOn,
10168
10156
  ]);
10157
+ // Board C2's switches, for real: a Field in switch clothing whose NAME carries the
10158
+ // category ('consent-<category>') — the engine's consent runtime binds checked-state to
10159
+ // the decision and records on change. State lives in the cookie, never in the tree.
10169
10160
  const categoryCard = (category, name, desc) => {
10170
- const allow = button('Allow', createConfig, click([
10171
- { type: 'setConsentCategory', params: { category, granted: true } },
10172
- ]), SMALL_ALLOW);
10173
- const refuse = button('Refuse', createConfig, click([
10174
- { type: 'setConsentCategory', params: { category, granted: false } },
10175
- ]), SMALL_REFUSE);
10176
- const pair = row(createConfig, { display: 'flex', gap: '6px' }, [allow, refuse]);
10177
- return row(createConfig, CARD, [textColOf(name, desc), pair]);
10161
+ const sw = createConfig('Field');
10162
+ if (!sw)
10163
+ return null;
10164
+ setTrait(sw, 'label', name);
10165
+ setTrait(sw, 'labelHidden', true); // the card's own texts carry the words
10166
+ setTrait(sw, 'control', 'switch');
10167
+ setTrait(sw, 'name', `consent-${category}`);
10168
+ setStyleTrait(sw, 'width', 'auto');
10169
+ return row(createConfig, CARD, [textColOf(name, desc), sw]);
10178
10170
  };
10179
10171
  const analyticsCard = categoryCard('analytics', 'Analytics', 'Anonymous counts of visits and pages. Off means the analytics script never loads.');
10180
10172
  const marketingCard = categoryCard('marketing', 'Marketing', 'Ads measurement and remarketing. Off means no ad cookies and no data shared.');