Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | /**
* @fds-uif/schema - Resolved UIF Types
*
* Types for resolved/merged UIFs where $extends chains have been processed.
* A resolved UIF combines foundation and system properties into a single object.
*/
import type { Extensions, RenderWhen } from './shared.js';
/**
* Resolved UIF - the output of $extends resolution
*
* This is what consumers work with after the build process resolves
* all inheritance chains. It contains properties from both foundations
* and systems merged together.
*/
export interface ResolvedUIF {
/** UIF format version */
apiVersion: string;
/** Component name in PascalCase */
name: string;
/** Component description */
description: string;
/** Root structure definition */
structure: ResolvedStructure;
/** States from foundation (inherited) */
states?: ResolvedState[];
/** Modifiers from system */
modifiers?: ResolvedModifier[];
/** Variants from system */
variants?: ResolvedVariant[];
/** State-to-class mappings from system */
stateClasses?: ResolvedStateClass[];
/** Accessibility requirements from foundation */
accessibility?: ResolvedAccessibility;
/** Behavior module path from foundation */
behavior?: string;
/** Namespaced metadata for third-party tooling */
extensions?: Extensions;
}
/**
* Resolved structure node
*/
export interface ResolvedStructure {
/** Structure node name/identifier */
name?: string;
/** Allowed element types (first is default) */
restrict?: string[];
/** Structure description */
description?: string;
/** Reference to another UIF component (instead of HTML element) */
component?: string;
/** Configuration for how the composed component is wired */
componentProps?: ResolvedComponentProps;
/** Attributes configuration */
attributes?: ResolvedAttributes;
/** Child structure nodes */
children?: ResolvedStructure[];
/** Slot definition for this node */
slot?: ResolvedSlot;
/** Modifiers that apply to this node */
modifiers?: ResolvedModifier[];
/** Variants that affect this node */
variants?: ResolvedVariant[];
/** Conditional rendering expression */
renderWhen?: RenderWhen;
/** Whether this node repeats */
repeats?: boolean;
/** Namespaced metadata for third-party tooling */
extensions?: Extensions;
}
/**
* Resolved attributes
*/
export interface ResolvedAttributes {
/** Static attribute values. The `class` key accepts `string | string[]`. */
static?: Record<string, string | boolean | number | string[]>;
/** Bound attributes (dynamic) */
bound?: Record<string, ResolvedBoundAttribute>;
/** Conditional attributes */
conditional?: ResolvedConditionalAttribute[];
}
/**
* Resolved bound attribute
*/
export interface ResolvedBoundAttribute {
/** Prop name to bind to */
prop: string;
/** Whether the prop is required */
required?: boolean;
}
/**
* Resolved conditional attribute
*/
export interface ResolvedConditionalAttribute {
/** Attribute name */
name: string;
/** Attribute to set */
attribute: string;
/** Value to set */
value: string;
/** Condition expression */
when: string;
}
/**
* Resolved slot definition
*/
export interface ResolvedSlot {
/** Slot name */
name: string;
/** Allowed child types */
restrict?: string[];
/** Whether slot content is required */
required?: boolean;
/** Namespaced metadata for third-party tooling */
extensions?: Extensions;
}
/**
* Resolved state definition (from foundation)
*/
export interface ResolvedState {
/** State name */
name: string;
/** State type */
type: 'boolean' | 'enum';
/** ARIA attribute mapping */
aria?: string;
/** State description */
description?: string;
/** Enum options (when type is 'enum') */
options?: string[];
/** Default value */
default?: unknown;
/** Namespaced metadata for third-party tooling */
extensions?: Extensions;
}
/**
* One option in a grouped (enum) modifier.
*/
export interface ResolvedModifierOption {
/** The prop value passed by consumers (e.g. 'small') */
propValue: string;
/** The CSS class applied for this option (e.g. 'slds-icon_small'; empty string = no class) */
value: string;
}
/**
* Resolved modifier definition (from system).
*
* Two forms:
* - Boolean modifier: `value` is present, `options` is absent.
* - Grouped modifier: `options` is present, `value` is absent.
*/
export interface ResolvedModifier {
/** Modifier name */
name: string;
/** Attribute to modify */
attribute: string;
/** CSS value to apply when active (boolean modifiers only) */
value?: string;
/** Modifier description */
description?: string;
/** Default option propValue (grouped modifiers only) */
default?: string;
/** Available options (grouped modifiers only) */
options?: ResolvedModifierOption[];
/** Namespaced metadata for third-party tooling */
extensions?: Extensions;
}
/**
* Resolved variant definition (from system)
*/
export interface ResolvedVariant {
/** Variant name */
name: string;
/** Variant description */
description?: string;
/** Variant options */
options: ResolvedVariantOption[];
/** Default option value */
default?: string;
/** Namespaced metadata for third-party tooling */
extensions?: Extensions;
}
/**
* Resolved variant option
*/
export interface ResolvedVariantOption {
/** Option value */
value: string;
/** CSS class to apply */
class?: string;
/** Element restrictions for this option */
restrict?: string[];
/** Child structures for this option */
children?: ResolvedStructure[];
/** Slot visibility for this option */
slots?: Record<string, boolean>;
/** Namespaced metadata for third-party tooling */
extensions?: Extensions;
}
/**
* Resolved state class mapping (from system)
*/
export interface ResolvedStateClass {
/** State name */
state: string;
/** CSS class to apply */
class: string;
/** Namespaced metadata for third-party tooling */
extensions?: Extensions;
}
/**
* Resolved accessibility requirements
*/
export interface ResolvedAccessibility {
/** ARIA role */
role?: string;
/** Required ARIA props */
requiredProps?: string[];
/** Landmark mappings */
landmarks?: Record<string, string>;
/** Accessibility requirements */
requirements?: ResolvedAccessibilityRequirement[];
/** Namespaced metadata for third-party tooling */
extensions?: Extensions;
}
/**
* Resolved accessibility requirement
*/
export interface ResolvedAccessibilityRequirement {
/** Requirement ID */
id: string;
/** Requirement description */
description: string;
}
/**
* Resolved component props configuration for composed components
*/
export interface ResolvedComponentProps {
/** Hardcoded prop values, always applied */
static?: Record<string, unknown>;
/** Props bound to parent component props */
bound?: Record<string, string>;
/** Props passed through from parent unchanged */
forwarded?: string[];
/** Props determined by parent's variant value (variant name → option value → props) */
byVariant?: Record<string, Record<string, Record<string, unknown>>>;
/** Whitelist of allowed props (narrows the child's interface) */
restrict?: string[];
}
|