Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: Android

# Reusable native Android pipeline. ci.yml decides whether the Gradle toolchain is affected.

on:
workflow_call:
inputs:
affected:
description: Skip jobs when this toolchain is unaffected
type: boolean
default: true
workflow_dispatch:
inputs:
affected:
description: Skip jobs when this toolchain is unaffected
type: boolean
default: true

concurrency:
group: Android-${{github.ref_name}}-${{github.event_name == 'pull_request' && github.event.pull_request.number || github.sha}}
Expand All @@ -19,6 +27,7 @@ env:
jobs:
build-test:
name: Build & Test
if: ${{ inputs.affected == true }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,24 @@ jobs:
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: node tools/ci/classifyToolchains.mjs

# Always call so required checks report; jobs skip when unaffected.
node:
name: Node
needs: changes
if: needs.changes.outputs.node == 'true'
uses: ./.github/workflows/node.yml
with:
affected: ${{ needs.changes.outputs.node == 'true' }}

android:
name: Android
needs: changes
if: needs.changes.outputs.gradle == 'true'
uses: ./.github/workflows/android.yml
with:
affected: ${{ needs.changes.outputs.gradle == 'true' }}

ios:
name: iOS
needs: changes
if: needs.changes.outputs.xcode == 'true'
uses: ./.github/workflows/ios.yml
with:
affected: ${{ needs.changes.outputs.xcode == 'true' }}
14 changes: 12 additions & 2 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: iOS

# Reusable native iOS pipeline. ci.yml decides whether the Xcode toolchain is affected.

on:
workflow_call:
inputs:
affected:
description: Skip jobs when this toolchain is unaffected
type: boolean
default: true
workflow_dispatch:
inputs:
affected:
description: Skip jobs when this toolchain is unaffected
type: boolean
default: true

concurrency:
group: iOS-${{github.ref_name}}-${{github.event_name == 'pull_request' && github.event.pull_request.number || github.sha}}
Expand All @@ -21,6 +29,7 @@ env:
jobs:
test:
name: Build & Test (theme library)
if: ${{ inputs.affected == true }}
runs-on: macos-15
timeout-minutes: 30
steps:
Expand All @@ -36,6 +45,7 @@ jobs:

simulator-build:
name: iOS Simulator build (gallery app)
if: ${{ inputs.affected == true }}
runs-on: macos-15
timeout-minutes: 30
steps:
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ name: Node

on:
workflow_call:
inputs:
affected:
description: Skip jobs when this toolchain is unaffected
type: boolean
default: true
workflow_dispatch:
inputs:
affected:
description: Skip jobs when this toolchain is unaffected
type: boolean
default: true

concurrency:
group: Node-${{github.ref_name}}-${{github.event_name == 'pull_request' && github.event.pull_request.number || github.sha}}
Expand All @@ -20,6 +30,7 @@ env:
jobs:
validate:
name: Validate
if: ${{ inputs.affected == true }}
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -43,6 +54,7 @@ jobs:

lint:
name: Lint
if: ${{ inputs.affected == true }}
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -63,6 +75,7 @@ jobs:

format:
name: Format
if: ${{ inputs.affected == true }}
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -78,6 +91,7 @@ jobs:

test:
name: Test
if: ${{ inputs.affected == true }}
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -93,6 +107,7 @@ jobs:

typecheck:
name: Typecheck
if: ${{ inputs.affected == true }}
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -108,6 +123,7 @@ jobs:

build:
name: Build
if: ${{ inputs.affected == true }}
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -125,7 +141,7 @@ jobs:
name: Depcheck
runs-on: ubuntu-latest
# Only run on master pushes (to cache baseline) or PRs targeting master (to compare)
if: github.ref_name == 'master' || (github.event_name == 'pull_request' && github.base_ref == 'master')
if: ${{ inputs.affected == true && (github.ref_name == 'master' || (github.event_name == 'pull_request' && github.base_ref == 'master')) }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
Expand Down Expand Up @@ -171,7 +187,7 @@ jobs:
name: Bundle Stats
runs-on: ubuntu-latest
# Only run on master pushes (to cache baseline) or PRs targeting master (to compare)
if: github.ref_name == 'master' || (github.event_name == 'pull_request' && github.base_ref == 'master')
if: ${{ inputs.affected == true && (github.ref_name == 'master' || (github.event_name == 'pull_request' && github.base_ref == 'master')) }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
Expand Down Expand Up @@ -220,6 +236,7 @@ jobs:

lint-styles:
name: Lint Styles
if: ${{ inputs.affected == true }}
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.coinbase.cds.theme.CdsBorderRadiusToken
import com.coinbase.cds.theme.CdsBorderWidthToken
import com.coinbase.cds.theme.CdsIconSizeToken
import com.coinbase.cds.theme.CdsShadow
import com.coinbase.cds.theme.CdsShadowToken
import com.coinbase.cds.theme.CdsSpaceToken
import com.coinbase.cds.theme.CdsTheme

Expand Down Expand Up @@ -186,8 +187,9 @@ internal fun ShadowSection() {
Column(verticalArrangement = Arrangement.spacedBy(CdsTheme.space.x2)) {
GallerySectionTitle("Shadow")
Row(horizontalArrangement = Arrangement.spacedBy(CdsTheme.space.x3)) {
ShadowSample("elevation1", shadows.elevation1)
ShadowSample("elevation2", shadows.elevation2)
for (token in CdsShadowToken.entries) {
ShadowSample(token.tokenName, shadows[token])
}
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions apps/ios-gallery/Sources/AcmeTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ extension CDSThemeSet {
let brandLight = Color(cdsHex: 0x7C3AED)
let brandDark = Color(cdsHex: 0xA78BFA)

$0.light.bgPrimary = brandLight
$0.light.fgPrimary = brandLight
$0.light.bgLinePrimary = brandLight
$0.light.accentBoldBlue = brandLight
$0.lightColors.bgPrimary = brandLight
$0.lightColors.fgPrimary = brandLight
$0.lightColors.bgLinePrimary = brandLight
$0.lightColors.accentBoldBlue = brandLight

$0.dark.bgPrimary = brandDark
$0.dark.fgPrimary = brandDark
$0.dark.bgLinePrimary = brandDark
$0.dark.accentBoldBlue = brandDark
$0.darkColors.bgPrimary = brandDark
$0.darkColors.fgPrimary = brandDark
$0.darkColors.bgLinePrimary = brandDark
$0.darkColors.accentBoldBlue = brandDark

// Rounder corners and a touch more breathing room, to make the brand visibly distinct.
$0.radius.r300 = 20
$0.spacing.x2 = 20
$0.borderRadius.radius300 = 20
$0.space.x2 = 20
}
}
10 changes: 5 additions & 5 deletions apps/ios-gallery/Sources/ColorGallery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct ColorGallery: View {

var body: some View {
SectionCard("Semantic colors", subtitle: "\(CDSColorToken.allCases.count) tokens · theme.colors[token]") {
LazyVGrid(columns: columns, alignment: .leading, spacing: cds.spacing.x1_5) {
LazyVGrid(columns: columns, alignment: .leading, spacing: cds.space.x1_5) {
ForEach(CDSColorToken.allCases, id: \.self) { token in
Swatch(color: cds.colors[token], label: token.tokenName)
}
Expand All @@ -28,7 +28,7 @@ struct IllustrationGallery: View {

var body: some View {
SectionCard("Illustration colors", subtitle: "\(CDSIllustrationColorToken.allCases.count) tokens · theme.illustrationColors[token]") {
LazyVGrid(columns: columns, alignment: .leading, spacing: cds.spacing.x1_5) {
LazyVGrid(columns: columns, alignment: .leading, spacing: cds.space.x1_5) {
ForEach(CDSIllustrationColorToken.allCases, id: \.self) { token in
Swatch(color: cds.illustrationColors[token], label: token.tokenName)
}
Expand All @@ -44,9 +44,9 @@ struct SpectrumGallery: View {

var body: some View {
SectionCard("Spectrum", subtitle: "11 hues × 13 steps · theme.spectrum[hue][step]") {
VStack(alignment: .leading, spacing: cds.spacing.x1_5) {
VStack(alignment: .leading, spacing: cds.space.x1_5) {
ForEach(CDSSpectrumHueToken.allCases, id: \.self) { hue in
VStack(alignment: .leading, spacing: cds.spacing.x0_5) {
VStack(alignment: .leading, spacing: cds.space.x0_5) {
CDSDesignSystem.Text(hue.tokenName, style: .legal, color: cds.colors.fgMuted)
HStack(spacing: 2) {
ForEach(CDSColorRampToken.allCases, id: \.self) { step in
Expand All @@ -58,7 +58,7 @@ struct SpectrumGallery: View {
}
.overlay(
RoundedRectangle(cornerRadius: 3)
.strokeBorder(cds.colors.bgLine, lineWidth: cds.borderWidth.w100)
.strokeBorder(cds.colors.bgLine, lineWidth: cds.borderWidth.borderWidth100)
)
}
}
Expand Down
18 changes: 9 additions & 9 deletions apps/ios-gallery/Sources/ComponentsGallery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct ComponentsGallery: View {

var body: some View {
SectionCard("Components", subtitle: "Text · Button · SlideButton · ProgressCircle · inverted theme") {
VStack(alignment: .leading, spacing: cds.spacing.x3) {
VStack(alignment: .leading, spacing: cds.space.x3) {
text
buttons
slideButton
Expand All @@ -20,7 +20,7 @@ struct ComponentsGallery: View {
}

private var text: some View {
VStack(alignment: .leading, spacing: cds.spacing.x1) {
VStack(alignment: .leading, spacing: cds.space.x1) {
CDSDesignSystem.Text("Text", style: .label1, color: cds.colors.fgMuted)
CDSDesignSystem.Text("Default foreground", style: .body)
CDSDesignSystem.Text("Muted foreground", style: .body, color: cds.colors.fgMuted)
Expand All @@ -31,7 +31,7 @@ struct ComponentsGallery: View {
}

private var buttons: some View {
VStack(alignment: .leading, spacing: cds.spacing.x1) {
VStack(alignment: .leading, spacing: cds.space.x1) {
CDSDesignSystem.Text("Button", style: .label1, color: cds.colors.fgMuted)
CDSDesignSystem.Button(text: "Primary", action: {})
CDSDesignSystem.Button(text: "Secondary", action: {}, variant: .secondary)
Expand All @@ -46,7 +46,7 @@ struct ComponentsGallery: View {
}

private var slideButton: some View {
VStack(alignment: .leading, spacing: cds.spacing.x1) {
VStack(alignment: .leading, spacing: cds.space.x1) {
CDSDesignSystem.Text("SlideButton", style: .label1, color: cds.colors.fgMuted)
SlideButton(
checked: $slideChecked,
Expand All @@ -58,9 +58,9 @@ struct ComponentsGallery: View {
}

private var progressCircle: some View {
VStack(alignment: .leading, spacing: cds.spacing.x1) {
VStack(alignment: .leading, spacing: cds.space.x1) {
CDSDesignSystem.Text("ProgressCircle", style: .label1, color: cds.colors.fgMuted)
HStack(spacing: cds.spacing.x3) {
HStack(spacing: cds.space.x3) {
ProgressCircle(size: .s)
ProgressCircle(size: .m)
ProgressCircle(size: .l)
Expand All @@ -70,7 +70,7 @@ struct ComponentsGallery: View {

/// Same content rendered under `InvertedThemeProvider`, which flips the scheme for its subtree.
private var invertedDemo: some View {
VStack(alignment: .leading, spacing: cds.spacing.x1) {
VStack(alignment: .leading, spacing: cds.space.x1) {
CDSDesignSystem.Text("InvertedThemeProvider", style: .label1, color: cds.colors.fgMuted)
InvertedThemeProvider {
InvertedCard()
Expand All @@ -86,9 +86,9 @@ private struct InvertedCard: View {

var body: some View {
CDSDesignSystem.Text("Content on the opposite scheme", style: .body)
.padding(cds.spacing.x2)
.padding(cds.space.x2)
.frame(maxWidth: .infinity, alignment: .leading)
.background(cds.colors.bg)
.cdsBorderedCard(radius: cds.radius.r300)
.cdsBorderedCard(radius: cds.borderRadius.radius300)
}
}
18 changes: 9 additions & 9 deletions apps/ios-gallery/Sources/GalleryComponents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private struct BorderedCard: ViewModifier {
.clipShape(RoundedRectangle(cornerRadius: radius))
.overlay(
RoundedRectangle(cornerRadius: radius)
.strokeBorder(cds.colors.bgLine, lineWidth: cds.borderWidth.w100)
.strokeBorder(cds.colors.bgLine, lineWidth: cds.borderWidth.borderWidth100)
)
}
}
Expand All @@ -36,19 +36,19 @@ struct SectionCard<Content: View>: View {
}

var body: some View {
VStack(alignment: .leading, spacing: cds.spacing.x1_5) {
VStack(alignment: .leading, spacing: cds.spacing.x0_5) {
VStack(alignment: .leading, spacing: cds.space.x1_5) {
VStack(alignment: .leading, spacing: cds.space.x0_5) {
CDSDesignSystem.Text(title, style: .title4)
if let subtitle {
CDSDesignSystem.Text(subtitle, style: .label2, color: cds.colors.fgMuted)
}
}
content
}
.padding(cds.spacing.x2)
.padding(cds.space.x2)
.frame(maxWidth: .infinity, alignment: .leading)
.background(cds.colors.bgElevation1)
.cdsBorderedCard(radius: cds.radius.r300)
.cdsBorderedCard(radius: cds.borderRadius.radius300)
}
}

Expand All @@ -59,11 +59,11 @@ struct Swatch: View {
let label: String

var body: some View {
VStack(alignment: .leading, spacing: cds.spacing.x0_5) {
RoundedRectangle(cornerRadius: cds.radius.r200)
VStack(alignment: .leading, spacing: cds.space.x0_5) {
RoundedRectangle(cornerRadius: cds.borderRadius.radius200)
.fill(color)
.frame(height: 44)
.cdsBorderedCard(radius: cds.radius.r200)
.cdsBorderedCard(radius: cds.borderRadius.radius200)
CDSDesignSystem.Text(label, style: .legal, color: cds.colors.fgMuted)
.lineLimit(1)
}
Expand All @@ -77,7 +77,7 @@ struct SampleRow<Sample: View>: View {
@ViewBuilder let sample: Sample

var body: some View {
HStack(alignment: .center, spacing: cds.spacing.x2) {
HStack(alignment: .center, spacing: cds.space.x2) {
CDSDesignSystem.Text(label, style: .label2)
.frame(width: 96, alignment: .leading)
sample
Expand Down
Loading
Loading