'',
'sparkles' => '',
'building' => '',
'briefcase' => '',
'truck' => '',
'key' => '',
'sofa' => '',
'window' => '',
'droplets' => '',
'trash' => '',
'leaf' => '',
'brush' => '',
'shirt' => '',
'paw' => '',
'fridge' => '',
'oven' => '',
// Pricing unit icons.
'bed' => '',
'bath' => '',
'ruler' => '',
'clock' => '',
'box' => '',
// Interface icons.
'dashboard' => '',
'calendar' => '',
'calendar-check' => '',
'layers' => '',
'users' => '',
'user' => '',
'hard-hat' => '',
'settings' => '',
'lock' => '',
'crown' => '',
'plus' => '',
'minus' => '',
'search' => '',
'save' => '',
'check' => '',
'check-circle' => '',
'x' => '',
'chevron-right' => '',
'chevron-left' => '',
'chevron-down' => '',
'arrow-right' => '',
'arrow-left' => '',
'mail' => '',
'phone' => '',
'map-pin' => '',
'map' => '',
'banknote' => '',
'credit-card' => '',
'trending-up' => '',
'trending-down' => '',
'bar-chart' => '',
'eye' => '',
'pencil' => '',
'external-link' => '',
'copy' => '',
'star' => '',
'camera' => '',
'message' => '',
'zap' => '',
'rocket' => '',
'clipboard' => '',
'clipboard-check' => '',
'info' => '',
'alert' => '',
'shield-check' => '',
'smartphone' => '',
'repeat' => '',
'file-text' => '',
'tag' => '',
'gift' => '',
'plug' => '',
'bell' => '',
'palette' => '',
'store' => '',
'database' => '',
'wand' => '',
'link' => '',
'percent' => '',
'sunrise' => '',
'sun' => '',
'moon' => '',
'more' => '',
];
public static function svg( string $icon_name, int $size = 20, string $extra_class = '' ): string {
$paths = self::PATHS[ $icon_name ] ?? self::PATHS['sparkles'];
$class = trim( 'cln-icon ' . $extra_class );
return sprintf(
'',
esc_attr( $class ),
$size,
$paths
);
}
/**
* Echoes an icon. Markup is built from the internal whitelist above.
*/
public static function render( string $icon_name, int $size = 20, string $extra_class = '' ): void {
echo self::svg( $icon_name, $size, $extra_class ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Static SVG whitelist.
}
public static function exists( string $icon_name ): bool {
return isset( self::PATHS[ $icon_name ] );
}
/**
* Icons selectable for services and add-ons (key => label).
*/
public static function service_choices(): array {
return [
'home' => __( 'House', 'cleannetic' ),
'sparkles' => __( 'Sparkle', 'cleannetic' ),
'building' => __( 'Apartment', 'cleannetic' ),
'briefcase' => __( 'Office', 'cleannetic' ),
'key' => __( 'Move in / out', 'cleannetic' ),
'truck' => __( 'Moving', 'cleannetic' ),
'sofa' => __( 'Upholstery', 'cleannetic' ),
'window' => __( 'Windows', 'cleannetic' ),
'droplets' => __( 'Pressure wash', 'cleannetic' ),
'trash' => __( 'Junk removal', 'cleannetic' ),
'leaf' => __( 'Eco clean', 'cleannetic' ),
'brush' => __( 'Deep scrub', 'cleannetic' ),
'shirt' => __( 'Laundry', 'cleannetic' ),
'paw' => __( 'Pet friendly', 'cleannetic' ),
'fridge' => __( 'Fridge', 'cleannetic' ),
'oven' => __( 'Oven', 'cleannetic' ),
];
}
/**
* SVG markup map for the given icon names, used to hand icons to JavaScript.
*/
public static function svg_map( array $icon_names, int $size = 20 ): array {
$svg_map = [];
foreach ( $icon_names as $icon_name ) {
$svg_map[ $icon_name ] = self::svg( $icon_name, $size );
}
return $svg_map;
}
}