feat: complete release preparation, 10+ ad mediation, CI/CD, and docker deployment
Some checks failed
CI Pipeline / Code Quality & Typecheck (push) Waiting to run
CI Pipeline / Test Suite (macos-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (ubuntu-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (windows-latest) (push) Blocked by required conditions
CI Pipeline / Build Validation (admin) (push) Blocked by required conditions
CI Pipeline / Build Validation (desktop) (push) Blocked by required conditions
Deploy Landing Page / deploy (push) Blocked by required conditions
Deploy Landing Page / build (push) Waiting to run
Release & Packaging Pipeline / Build & Publish Admin Docker Image (push) Failing after 8s
Release & Code Signing CA Pipeline / build-and-sign-windows (push) Failing after 1m51s
Build macOS / Build & Package (macOS) (push) Failing after 4s
Build macOS / Build & Package (macOS)-1 (push) Failing after 5s
Release & Code Signing CA Pipeline / build-and-sign-macos (push) Failing after 3s
Release & Packaging Pipeline / Package macOS Desktop App (push) Failing after 4s
Release & Packaging Pipeline / Package Windows Desktop App (push) Failing after 2m28s
Release & Packaging Pipeline / Publish Official GitHub Release (push) Has been skipped
Some checks failed
CI Pipeline / Code Quality & Typecheck (push) Waiting to run
CI Pipeline / Test Suite (macos-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (ubuntu-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (windows-latest) (push) Blocked by required conditions
CI Pipeline / Build Validation (admin) (push) Blocked by required conditions
CI Pipeline / Build Validation (desktop) (push) Blocked by required conditions
Deploy Landing Page / deploy (push) Blocked by required conditions
Deploy Landing Page / build (push) Waiting to run
Release & Packaging Pipeline / Build & Publish Admin Docker Image (push) Failing after 8s
Release & Code Signing CA Pipeline / build-and-sign-windows (push) Failing after 1m51s
Build macOS / Build & Package (macOS) (push) Failing after 4s
Build macOS / Build & Package (macOS)-1 (push) Failing after 5s
Release & Code Signing CA Pipeline / build-and-sign-macos (push) Failing after 3s
Release & Packaging Pipeline / Package macOS Desktop App (push) Failing after 4s
Release & Packaging Pipeline / Package Windows Desktop App (push) Failing after 2m28s
Release & Packaging Pipeline / Publish Official GitHub Release (push) Has been skipped
This commit is contained in:
parent
5cd1de6859
commit
708e20f747
406 changed files with 42464 additions and 6199 deletions
123
packages/ui/src/components/ds/SegmentControl.tsx
Normal file
123
packages/ui/src/components/ds/SegmentControl.tsx
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
'use client'
|
||||
|
||||
// packages/ui/src/components/ds/SegmentControl.tsx
|
||||
// Linear / Apple-tier segmented pill control with tactile active state
|
||||
|
||||
import React from 'react'
|
||||
import { Box, Typography } from '@mui/material'
|
||||
import { d3roPalette, d3roRadius, d3roShadow, typoSx } from '../../theme'
|
||||
|
||||
export interface SegmentOption<T extends string = string> {
|
||||
value: T
|
||||
label: string
|
||||
icon?: React.ReactNode
|
||||
badge?: string | number
|
||||
}
|
||||
|
||||
export interface SegmentControlProps<T extends string = string> {
|
||||
options?: SegmentOption<T>[]
|
||||
/** Alias for options */
|
||||
items?: SegmentOption<T>[]
|
||||
value: T
|
||||
onChange: (value: T) => void
|
||||
size?: 'small' | 'medium'
|
||||
sx?: object
|
||||
}
|
||||
|
||||
export function SegmentControl<T extends string = string>({
|
||||
options,
|
||||
items,
|
||||
value,
|
||||
onChange,
|
||||
size = 'medium',
|
||||
sx,
|
||||
}: SegmentControlProps<T>): React.ReactElement {
|
||||
const isSmall = size === 'small'
|
||||
const list = options || items || []
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
p: '3px',
|
||||
bgcolor: d3roPalette.bg.inset,
|
||||
borderRadius: d3roRadius.pill,
|
||||
border: `1px solid ${d3roPalette.glass.hairline}`,
|
||||
gap: '2px',
|
||||
...sx,
|
||||
}}
|
||||
>
|
||||
{list.map((opt) => {
|
||||
const isSelected = opt.value === value
|
||||
return (
|
||||
<Box
|
||||
key={opt.value}
|
||||
onClick={() => onChange(opt.value)}
|
||||
sx={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 0.75,
|
||||
px: isSmall ? 1.5 : 2,
|
||||
py: isSmall ? 0.5 : 0.75,
|
||||
borderRadius: d3roRadius.pill,
|
||||
bgcolor: isSelected ? d3roPalette.glass.raised : 'transparent',
|
||||
color: isSelected ? d3roPalette.text.primary : d3roPalette.text.secondary,
|
||||
border: isSelected ? `1px solid ${d3roPalette.glass.hairlineStrong}` : '1px solid transparent',
|
||||
boxShadow: isSelected ? d3roShadow.buttonRaised : 'none',
|
||||
cursor: 'pointer',
|
||||
userSelect: 'none',
|
||||
transition: 'all 0.2s cubic-bezier(0.16, 1, 0.3, 1)',
|
||||
'&:hover': {
|
||||
color: d3roPalette.text.primary,
|
||||
bgcolor: isSelected ? d3roPalette.glass.raised : d3roPalette.glass.surface,
|
||||
},
|
||||
'&:active': {
|
||||
transform: 'scale(0.97)',
|
||||
},
|
||||
}}
|
||||
>
|
||||
{opt.icon && (
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
color: isSelected ? d3roPalette.accent.light : 'inherit',
|
||||
'& svg': { width: isSmall ? 14 : 16, height: isSmall ? 14 : 16 },
|
||||
}}
|
||||
>
|
||||
{opt.icon}
|
||||
</Box>
|
||||
)}
|
||||
<Typography
|
||||
sx={{
|
||||
...typoSx('compact'),
|
||||
fontSize: isSmall ? '12px' : '13px',
|
||||
fontWeight: isSelected ? 600 : 500,
|
||||
lineHeight: 1,
|
||||
}}
|
||||
>
|
||||
{opt.label}
|
||||
</Typography>
|
||||
{opt.badge !== undefined && (
|
||||
<Box
|
||||
sx={{
|
||||
ml: 0.5,
|
||||
px: 0.75,
|
||||
py: 0.15,
|
||||
borderRadius: d3roRadius.pill,
|
||||
bgcolor: isSelected ? d3roPalette.accent.dim : d3roPalette.bg.chassis,
|
||||
color: isSelected ? d3roPalette.accent.light : d3roPalette.text.dimLabel,
|
||||
fontSize: '10px',
|
||||
fontWeight: 700,
|
||||
}}
|
||||
>
|
||||
{opt.badge}
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
)
|
||||
})}
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue