@sofya-ds/react 1.12.0 → 1.13.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.
- package/README.md +45 -45
- package/dist/index.cjs +159 -27
- package/dist/index.css +3 -3
- package/dist/index.d.cts +27 -10
- package/dist/index.d.ts +27 -10
- package/dist/index.js +155 -27
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
# @sofya-ds/react
|
|
2
|
-
|
|
3
|
-
React design system package for Sofya.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm add @sofya-ds/react
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Se voce tambem quiser consumir os tokens diretamente no app, instale o pacote complementar:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
pnpm add @sofya-ds/tokens
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
```tsx
|
|
20
|
-
import "@sofya-ds/react/styles.css";
|
|
21
|
-
import { Button, DocumentCard, Logo, SofyaProvider, Stack, Text } from "@sofya-ds/react";
|
|
22
|
-
|
|
23
|
-
export function App() {
|
|
24
|
-
return (
|
|
25
|
-
<SofyaProvider>
|
|
26
|
-
<Logo variant="mono" size={52} monoColor="#08194D" />
|
|
27
|
-
<Button>Entrar</Button>
|
|
28
|
-
<Text size="h2" variant="gradient">
|
|
29
|
-
Titulo com gradiente oficial da marca
|
|
30
|
-
</Text>
|
|
31
|
-
<Stack gap="compact">
|
|
32
|
-
<Text size="encounter-title">Encontro clinico</Text>
|
|
33
|
-
<DocumentCard title="Resumo clinico" description="Documento salvo" />
|
|
34
|
-
</Stack>
|
|
35
|
-
</SofyaProvider>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Includes
|
|
41
|
-
|
|
42
|
-
- Components like `Button`, `Badge`, `Card`, `Checkbox`, `DocumentCard`, `Icon`, `Input`, `InputOTP`, `Link`, `Logo`, `ProseDialogContent`, `RightRailAction`, `Surface` and `Text`
|
|
43
|
-
- Layout primitives like `Stack`, `Cluster`, `Inline` and `Container` backed by shared spacing tokens
|
|
44
|
-
- `SofyaProvider` for theme application
|
|
45
|
-
- Distributed stylesheet at `@sofya-ds/react/styles.css`
|
|
1
|
+
# @sofya-ds/react
|
|
2
|
+
|
|
3
|
+
React design system package for Sofya.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @sofya-ds/react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Se voce tambem quiser consumir os tokens diretamente no app, instale o pacote complementar:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @sofya-ds/tokens
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import "@sofya-ds/react/styles.css";
|
|
21
|
+
import { Button, DocumentCard, Logo, SofyaProvider, Stack, Text } from "@sofya-ds/react";
|
|
22
|
+
|
|
23
|
+
export function App() {
|
|
24
|
+
return (
|
|
25
|
+
<SofyaProvider>
|
|
26
|
+
<Logo variant="mono" size={52} monoColor="#08194D" />
|
|
27
|
+
<Button>Entrar</Button>
|
|
28
|
+
<Text size="h2" variant="gradient">
|
|
29
|
+
Titulo com gradiente oficial da marca
|
|
30
|
+
</Text>
|
|
31
|
+
<Stack gap="compact">
|
|
32
|
+
<Text size="encounter-title">Encontro clinico</Text>
|
|
33
|
+
<DocumentCard title="Resumo clinico" description="Documento salvo" />
|
|
34
|
+
</Stack>
|
|
35
|
+
</SofyaProvider>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Includes
|
|
41
|
+
|
|
42
|
+
- Components like `Button`, `Badge`, `Card`, `Checkbox`, `DocumentCard`, `Icon`, `Input`, `InputOTP`, `Link`, `Logo`, `ProseDialogContent`, `RightRailAction`, `Surface` and `Text`
|
|
43
|
+
- Layout primitives like `Stack`, `Cluster`, `Inline` and `Container` backed by shared spacing tokens
|
|
44
|
+
- `SofyaProvider` for theme application
|
|
45
|
+
- Distributed stylesheet at `@sofya-ds/react/styles.css`
|
package/dist/index.cjs
CHANGED
|
@@ -134,7 +134,11 @@ __export(index_exports, {
|
|
|
134
134
|
SelectValue: () => SelectValue,
|
|
135
135
|
Separator: () => Separator2,
|
|
136
136
|
SettingsNavItem: () => SettingsNavItem,
|
|
137
|
+
SidebarNav: () => SidebarNav,
|
|
137
138
|
SidebarNavItem: () => SidebarNavItem,
|
|
139
|
+
SidebarNavSection: () => SidebarNavSection,
|
|
140
|
+
SidebarNavSectionItems: () => SidebarNavSectionItems,
|
|
141
|
+
SidebarNavSectionLabel: () => SidebarNavSectionLabel,
|
|
138
142
|
Skeleton: () => Skeleton,
|
|
139
143
|
Slider: () => Slider,
|
|
140
144
|
SofyaProvider: () => SofyaProvider,
|
|
@@ -657,6 +661,9 @@ var defaultElements = {
|
|
|
657
661
|
"heading-xl": "h1",
|
|
658
662
|
"heading-lg": "h2",
|
|
659
663
|
"heading-md": "h3",
|
|
664
|
+
"settings-page-title": "h1",
|
|
665
|
+
"home-inline-encounter-title": "h1",
|
|
666
|
+
"home-inline-encounter-action": "span",
|
|
660
667
|
h1: "h1",
|
|
661
668
|
h2: "h2",
|
|
662
669
|
h3: "h3",
|
|
@@ -670,6 +677,7 @@ var defaultElements = {
|
|
|
670
677
|
"body-sm": "p",
|
|
671
678
|
body: "p",
|
|
672
679
|
"label-md": "span",
|
|
680
|
+
"settings-section-title": "span",
|
|
673
681
|
"section-label": "span",
|
|
674
682
|
"eyebrow-md": "span",
|
|
675
683
|
"overline-md": "span",
|
|
@@ -696,7 +704,8 @@ var textSizeStyles = Object.fromEntries(
|
|
|
696
704
|
fontSize: `var(--sofya-text-${size}-font-size)`,
|
|
697
705
|
fontWeight: `var(--sofya-text-${size}-font-weight)`,
|
|
698
706
|
lineHeight: `var(--sofya-text-${size}-line-height)`,
|
|
699
|
-
letterSpacing: `var(--sofya-text-${size}-letter-spacing)
|
|
707
|
+
letterSpacing: `var(--sofya-text-${size}-letter-spacing)`,
|
|
708
|
+
...size === "settings-section-title" ? { textTransform: "uppercase" } : {}
|
|
700
709
|
}
|
|
701
710
|
])
|
|
702
711
|
);
|
|
@@ -1190,6 +1199,7 @@ var buttonRippleVariantClasses = {
|
|
|
1190
1199
|
icon: "bg-[hsl(var(--sofya-primary)/0.34)]",
|
|
1191
1200
|
language: "bg-[hsl(var(--sofya-background)/0.76)] mix-blend-screen",
|
|
1192
1201
|
secondary: "bg-[hsl(var(--sofya-primary)/0.30)]",
|
|
1202
|
+
"auth-outline": "bg-[hsl(var(--sofya-primary)/0.24)]",
|
|
1193
1203
|
outline: "bg-[hsl(var(--sofya-primary)/0.32)]",
|
|
1194
1204
|
ghost: "bg-[hsl(var(--sofya-primary)/0.28)]",
|
|
1195
1205
|
destructive: "bg-[hsl(var(--sofya-destructive-foreground)/0.78)] mix-blend-screen"
|
|
@@ -1198,6 +1208,8 @@ var buttonRippleBaseSize = {
|
|
|
1198
1208
|
default: 20,
|
|
1199
1209
|
sm: 18,
|
|
1200
1210
|
lg: 22,
|
|
1211
|
+
toolbar: 20,
|
|
1212
|
+
auth: 22,
|
|
1201
1213
|
icon: 18
|
|
1202
1214
|
};
|
|
1203
1215
|
function useButtonRippleState({
|
|
@@ -1450,11 +1462,12 @@ var buttonVariantOptions = [
|
|
|
1450
1462
|
"icon",
|
|
1451
1463
|
"language",
|
|
1452
1464
|
"secondary",
|
|
1465
|
+
"auth-outline",
|
|
1453
1466
|
"outline",
|
|
1454
1467
|
"ghost",
|
|
1455
1468
|
"destructive"
|
|
1456
1469
|
];
|
|
1457
|
-
var buttonSizeOptions = ["default", "sm", "lg", "icon"];
|
|
1470
|
+
var buttonSizeOptions = ["default", "sm", "lg", "toolbar", "auth", "icon"];
|
|
1458
1471
|
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
1459
1472
|
"relative isolate inline-flex items-center justify-center gap-2 overflow-hidden whitespace-nowrap rounded-full font-medium tracking-[0.025em] transform-gpu transition-[width,transform,filter,background-color,border-color,color,box-shadow] duration-sofya ease-sofya motion-safe:active:scale-[0.985] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none data-[disabled=true]:cursor-not-allowed",
|
|
1460
1473
|
{
|
|
@@ -1468,6 +1481,7 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
1468
1481
|
icon: "border-0 bg-transparent text-[color:var(--sofya-text-soft)] shadow-none hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)] data-[disabled=true]:bg-transparent data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:shadow-none",
|
|
1469
1482
|
language: "border-0 bg-muted bg-cover bg-center bg-no-repeat text-primary-foreground shadow-none hover:brightness-[1.03]",
|
|
1470
1483
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 data-[disabled=true]:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1484
|
+
"auth-outline": "rounded-[10px] border border-[color:var(--sofya-border-strong)] bg-card text-[color:var(--sofya-text-default)] shadow-none hover:border-[color:var(--sofya-border-strong)] hover:bg-card active:bg-card data-[disabled=true]:border-[color:var(--sofya-border-soft)] data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1471
1485
|
outline: "border border-primary/15 bg-background text-foreground hover:border-primary/30 hover:bg-background active:bg-background data-[disabled=true]:border-[color:var(--sofya-border-soft)] data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1472
1486
|
ghost: "bg-transparent text-foreground hover:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1473
1487
|
destructive: "bg-destructive text-destructive-foreground hover:brightness-[1.04] data-[disabled=true]:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]"
|
|
@@ -1476,6 +1490,8 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
1476
1490
|
default: "h-11 px-10",
|
|
1477
1491
|
sm: "h-10 px-6",
|
|
1478
1492
|
lg: "h-12 px-12",
|
|
1493
|
+
toolbar: "h-[42px] px-7",
|
|
1494
|
+
auth: "h-[46px] px-6",
|
|
1479
1495
|
icon: "h-11 w-11"
|
|
1480
1496
|
}
|
|
1481
1497
|
},
|
|
@@ -1489,12 +1505,16 @@ var loadingSpinnerSizeClasses = {
|
|
|
1489
1505
|
default: "h-4 w-4",
|
|
1490
1506
|
sm: "h-3.5 w-3.5",
|
|
1491
1507
|
lg: "h-[18px] w-[18px]",
|
|
1508
|
+
toolbar: "h-4 w-4",
|
|
1509
|
+
auth: "h-4 w-4",
|
|
1492
1510
|
icon: "h-4 w-4"
|
|
1493
1511
|
};
|
|
1494
1512
|
var languageButtonSizeClasses = {
|
|
1495
1513
|
default: "h-11 w-11 rounded-full p-0",
|
|
1496
1514
|
sm: "h-10 w-10 rounded-full p-0",
|
|
1497
1515
|
lg: "h-12 w-12 rounded-full p-0",
|
|
1516
|
+
toolbar: "h-[42px] w-[42px] rounded-full p-0",
|
|
1517
|
+
auth: "h-[46px] w-[46px] rounded-full p-0",
|
|
1498
1518
|
icon: "h-11 w-11 rounded-full p-0"
|
|
1499
1519
|
};
|
|
1500
1520
|
function ButtonSpinner({
|
|
@@ -1538,6 +1558,7 @@ var Button = React7.forwardRef(
|
|
|
1538
1558
|
const resolvedSize = size ?? (isIconOnly ? "icon" : "default");
|
|
1539
1559
|
const resolvedVariant = variant ?? "default";
|
|
1540
1560
|
const isLanguageButton = variant === "language";
|
|
1561
|
+
const textSize = resolvedVariant === "auth-outline" ? "body-md" : "tiny";
|
|
1541
1562
|
const resolvedLanguageLocale = isLanguageButton ? languageLocale ?? "en-US" : void 0;
|
|
1542
1563
|
const resolvedLanguageFlagSrc = resolvedLanguageLocale ? buttonLanguageFlagSrc[resolvedLanguageLocale] : void 0;
|
|
1543
1564
|
const resolvedLanguageLabel = resolvedLanguageLocale ? buttonLanguageLabels[resolvedLanguageLocale] : void 0;
|
|
@@ -1596,7 +1617,7 @@ var Button = React7.forwardRef(
|
|
|
1596
1617
|
hasChildren ? renderTextContent(children, {
|
|
1597
1618
|
as: "span",
|
|
1598
1619
|
className: "inline-flex items-center text-current",
|
|
1599
|
-
size:
|
|
1620
|
+
size: textSize,
|
|
1600
1621
|
style: {
|
|
1601
1622
|
fontWeight: "inherit",
|
|
1602
1623
|
letterSpacing: "inherit"
|
|
@@ -3264,6 +3285,7 @@ InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
|
3264
3285
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3265
3286
|
var inputVariantOptions = [
|
|
3266
3287
|
"default",
|
|
3288
|
+
"auth-login",
|
|
3267
3289
|
"search",
|
|
3268
3290
|
"otp",
|
|
3269
3291
|
"upload"
|
|
@@ -3396,6 +3418,7 @@ var Input = React16.forwardRef((props, ref) => {
|
|
|
3396
3418
|
...nativeProps
|
|
3397
3419
|
} = props;
|
|
3398
3420
|
const isSearch = variant === "search";
|
|
3421
|
+
const isAuthLogin = variant === "auth-login";
|
|
3399
3422
|
const resolvedType = type ?? (isSearch ? "search" : void 0);
|
|
3400
3423
|
const ariaLabel = nativeProps["aria-label"] ?? (typeof label === "string" ? label : isSearch ? "Search" : void 0);
|
|
3401
3424
|
const nativeControl = isSearch ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex h-[88px] w-full items-center gap-6 rounded-full border border-[color:var(--sofya-border-strong)] bg-card px-8 shadow-none transition-[border-color,box-shadow,background-color] duration-sofya ease-sofya hover:border-[color:var(--sofya-border-hover)] hover:ring-2 hover:ring-[color:var(--sofya-focus-ring-soft)] focus-within:border-transparent focus-within:ring-2 focus-within:ring-[color:var(--sofya-focus-ring-soft)] has-[:active]:border-transparent has-[:active]:ring-2 has-[:active]:ring-[color:var(--sofya-focus-ring-soft)]", children: [
|
|
@@ -3431,7 +3454,8 @@ var Input = React16.forwardRef((props, ref) => {
|
|
|
3431
3454
|
ref,
|
|
3432
3455
|
type: resolvedType,
|
|
3433
3456
|
className: cn(
|
|
3434
|
-
"flex
|
|
3457
|
+
"flex w-full rounded-[10px] border border-[color:var(--sofya-border-strong)] bg-card text-[color:var(--sofya-text-default)] shadow-none transition-[border-color,box-shadow,background-color,color] duration-sofya ease-sofya placeholder:text-[color:var(--sofya-text-placeholder)] hover:border-[color:var(--sofya-border-hover)] focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[color:var(--sofya-focus-ring-soft)] focus:ring-offset-0 active:border-transparent active:ring-2 active:ring-[color:var(--sofya-focus-ring-soft)] disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50",
|
|
3458
|
+
isAuthLogin ? "h-[46px] px-6 py-3 [font-family:var(--sofya-text-tiny-font-family)] text-[14px] [font-weight:500] leading-[24px] tracking-[var(--sofya-text-tiny-letter-spacing)] placeholder:font-medium" : "h-10 px-4 py-2 [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] [font-weight:var(--sofya-text-tiny-font-weight)] leading-[var(--sofya-text-tiny-line-height)] tracking-[var(--sofya-text-tiny-letter-spacing)]",
|
|
3435
3459
|
className
|
|
3436
3460
|
),
|
|
3437
3461
|
...nativeProps,
|
|
@@ -3441,10 +3465,12 @@ var Input = React16.forwardRef((props, ref) => {
|
|
|
3441
3465
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3442
3466
|
FieldShell,
|
|
3443
3467
|
{
|
|
3444
|
-
containerClassName,
|
|
3468
|
+
containerClassName: cn(isAuthLogin ? "gap-2.5" : void 0, containerClassName),
|
|
3445
3469
|
control: nativeControl,
|
|
3446
3470
|
label: isSearch ? void 0 : label,
|
|
3447
3471
|
labelClassName: isSearch ? void 0 : labelClassName,
|
|
3472
|
+
labelTextSize: isAuthLogin ? "body-md" : void 0,
|
|
3473
|
+
labelTextStyle: isAuthLogin ? { fontWeight: 500 } : void 0,
|
|
3448
3474
|
labelHtmlFor: isSearch ? void 0 : resolvedId
|
|
3449
3475
|
}
|
|
3450
3476
|
);
|
|
@@ -5453,8 +5479,88 @@ Separator2.displayName = SeparatorPrimitive.Root.displayName;
|
|
|
5453
5479
|
// src/components/sidebar-nav-item.tsx
|
|
5454
5480
|
var React36 = __toESM(require("react"), 1);
|
|
5455
5481
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5482
|
+
var sidebarNavItemAppearanceClassNames = {
|
|
5483
|
+
settings: "rounded-[var(--sofya-radius-md)] py-[var(--sofya-space-2)] pl-[var(--sofya-space-3)] pr-[var(--sofya-space-3)] text-[color:var(--sofya-text-soft)] hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)] data-[active=true]:bg-[color:var(--sofya-surface-selected)] data-[active=true]:text-[color:var(--sofya-text-default)] data-[active=true]:hover:bg-[color:var(--sofya-surface-selected-strong)] data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:hover:bg-transparent",
|
|
5484
|
+
workspace: "rounded-[var(--sofya-radius-sm)] bg-transparent px-0 py-0 text-[color:var(--sofya-text-subtle)] hover:bg-transparent hover:text-[color:var(--sofya-text-default)] data-[active=true]:bg-transparent data-[active=true]:text-primary data-[active=true]:hover:bg-transparent data-[active=true]:hover:text-primary data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:hover:bg-transparent"
|
|
5485
|
+
};
|
|
5486
|
+
var sidebarNavItemIconClassNames = {
|
|
5487
|
+
settings: "flex h-5 w-5 shrink-0 items-center justify-center [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
5488
|
+
workspace: "flex h-[var(--sofya-text-sidebar-title-font-size)] w-[var(--sofya-text-sidebar-title-font-size)] shrink-0 items-center justify-center [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0"
|
|
5489
|
+
};
|
|
5490
|
+
var sidebarNavItemTextSize = {
|
|
5491
|
+
settings: "sidebar-title",
|
|
5492
|
+
workspace: "sidebar-title-regular"
|
|
5493
|
+
};
|
|
5494
|
+
var SidebarNav = React36.forwardRef(
|
|
5495
|
+
({ as, className, ...props }, ref) => {
|
|
5496
|
+
const Comp = as ?? "nav";
|
|
5497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5498
|
+
Comp,
|
|
5499
|
+
{
|
|
5500
|
+
ref,
|
|
5501
|
+
"data-slot": "sidebar-nav",
|
|
5502
|
+
className: cn("flex w-full min-w-0 flex-col gap-[var(--sofya-rhythm-group)]", className),
|
|
5503
|
+
...props
|
|
5504
|
+
}
|
|
5505
|
+
);
|
|
5506
|
+
}
|
|
5507
|
+
);
|
|
5508
|
+
SidebarNav.displayName = "SidebarNav";
|
|
5509
|
+
var SidebarNavSection = React36.forwardRef(
|
|
5510
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5511
|
+
"div",
|
|
5512
|
+
{
|
|
5513
|
+
ref,
|
|
5514
|
+
"data-slot": "sidebar-nav-section",
|
|
5515
|
+
className: cn("flex min-w-0 flex-col gap-[var(--sofya-rhythm-group)]", className),
|
|
5516
|
+
...props
|
|
5517
|
+
}
|
|
5518
|
+
)
|
|
5519
|
+
);
|
|
5520
|
+
SidebarNavSection.displayName = "SidebarNavSection";
|
|
5521
|
+
var SidebarNavSectionLabel = React36.forwardRef(
|
|
5522
|
+
({ as, className, children, ...props }, ref) => {
|
|
5523
|
+
const Comp = as ?? "h5";
|
|
5524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5525
|
+
Comp,
|
|
5526
|
+
{
|
|
5527
|
+
ref,
|
|
5528
|
+
"data-slot": "sidebar-nav-section-label",
|
|
5529
|
+
className: cn("m-0 min-w-0 text-muted-foreground uppercase", className),
|
|
5530
|
+
...props,
|
|
5531
|
+
children: renderTextContent(children, {
|
|
5532
|
+
as: "span",
|
|
5533
|
+
className: "block min-w-0 truncate text-inherit",
|
|
5534
|
+
size: "sidebar-title"
|
|
5535
|
+
})
|
|
5536
|
+
}
|
|
5537
|
+
);
|
|
5538
|
+
}
|
|
5539
|
+
);
|
|
5540
|
+
SidebarNavSectionLabel.displayName = "SidebarNavSectionLabel";
|
|
5541
|
+
var SidebarNavSectionItems = React36.forwardRef(
|
|
5542
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5543
|
+
"div",
|
|
5544
|
+
{
|
|
5545
|
+
ref,
|
|
5546
|
+
"data-slot": "sidebar-nav-section-items",
|
|
5547
|
+
className: cn("flex min-w-0 flex-col gap-[var(--sofya-gap-comfortable)]", className),
|
|
5548
|
+
...props
|
|
5549
|
+
}
|
|
5550
|
+
)
|
|
5551
|
+
);
|
|
5552
|
+
SidebarNavSectionItems.displayName = "SidebarNavSectionItems";
|
|
5456
5553
|
var SidebarNavItem = React36.forwardRef(
|
|
5457
|
-
function SidebarNavItem2({
|
|
5554
|
+
function SidebarNavItem2({
|
|
5555
|
+
as,
|
|
5556
|
+
active = false,
|
|
5557
|
+
appearance = "settings",
|
|
5558
|
+
disabled = false,
|
|
5559
|
+
icon,
|
|
5560
|
+
className,
|
|
5561
|
+
children,
|
|
5562
|
+
...props
|
|
5563
|
+
}, ref) {
|
|
5458
5564
|
const Comp = as ?? (props.href ? "a" : "button");
|
|
5459
5565
|
const isNativeButton = Comp === "button";
|
|
5460
5566
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
@@ -5468,19 +5574,17 @@ var SidebarNavItem = React36.forwardRef(
|
|
|
5468
5574
|
"aria-disabled": disabled || void 0,
|
|
5469
5575
|
...isNativeButton ? { type: "button", disabled } : {},
|
|
5470
5576
|
className: cn(
|
|
5471
|
-
"group relative flex w-full items-center gap-[var(--sofya-gap-compact)]
|
|
5577
|
+
"group relative flex w-full items-center gap-[var(--sofya-gap-compact)] text-left no-underline outline-none",
|
|
5472
5578
|
"[font-family:var(--sofya-text-sidebar-title-font-family)] text-[length:var(--sofya-text-sidebar-title-font-size)] [font-weight:var(--sofya-text-sidebar-title-font-weight)] leading-[var(--sofya-text-sidebar-title-line-height)] tracking-[var(--sofya-text-sidebar-title-letter-spacing)]",
|
|
5473
|
-
"
|
|
5474
|
-
"hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)]",
|
|
5579
|
+
"transition-colors duration-sofya ease-sofya",
|
|
5475
5580
|
"focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0",
|
|
5476
|
-
"data-[
|
|
5477
|
-
|
|
5478
|
-
"data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:hover:bg-transparent",
|
|
5581
|
+
"data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed",
|
|
5582
|
+
sidebarNavItemAppearanceClassNames[appearance],
|
|
5479
5583
|
className
|
|
5480
5584
|
),
|
|
5481
5585
|
...props,
|
|
5482
5586
|
children: [
|
|
5483
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5587
|
+
appearance === "settings" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5484
5588
|
"span",
|
|
5485
5589
|
{
|
|
5486
5590
|
"aria-hidden": "true",
|
|
@@ -5490,12 +5594,19 @@ var SidebarNavItem = React36.forwardRef(
|
|
|
5490
5594
|
active ? "opacity-100" : "opacity-0"
|
|
5491
5595
|
)
|
|
5492
5596
|
}
|
|
5493
|
-
),
|
|
5494
|
-
icon ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5597
|
+
) : null,
|
|
5598
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5599
|
+
"span",
|
|
5600
|
+
{
|
|
5601
|
+
"data-slot": "sidebar-nav-item-icon",
|
|
5602
|
+
className: sidebarNavItemIconClassNames[appearance],
|
|
5603
|
+
children: icon
|
|
5604
|
+
}
|
|
5605
|
+
) : null,
|
|
5495
5606
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "min-w-0 flex-1 truncate", children: renderTextContent(children, {
|
|
5496
5607
|
as: "span",
|
|
5497
5608
|
className: "block min-w-0 truncate text-inherit",
|
|
5498
|
-
size:
|
|
5609
|
+
size: sidebarNavItemTextSize[appearance]
|
|
5499
5610
|
}) })
|
|
5500
5611
|
]
|
|
5501
5612
|
}
|
|
@@ -6300,7 +6411,8 @@ var Table = React43.forwardRef(function Table2({ className, density = "default",
|
|
|
6300
6411
|
"data-slot": "table",
|
|
6301
6412
|
ref,
|
|
6302
6413
|
className: cn(
|
|
6303
|
-
"w-full min-w-[1040px] caption-bottom border-separate border-spacing-0 bg-card",
|
|
6414
|
+
"w-full min-w-[1040px] caption-bottom border-separate border-spacing-x-0 bg-card",
|
|
6415
|
+
density === "compact" ? "border-spacing-y-2" : "border-spacing-y-0",
|
|
6304
6416
|
className
|
|
6305
6417
|
),
|
|
6306
6418
|
...props
|
|
@@ -6380,7 +6492,7 @@ var TableHead = React43.forwardRef(function TableHead2({ className, children, ..
|
|
|
6380
6492
|
ref,
|
|
6381
6493
|
className: cn(
|
|
6382
6494
|
"whitespace-nowrap px-4 text-left align-middle [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] font-medium uppercase leading-4 tracking-[0.08em] text-[color:var(--sofya-text-default)] [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
6383
|
-
headerDensity === "compact" ? "py-
|
|
6495
|
+
headerDensity === "compact" ? "h-[45px] py-0" : "py-4",
|
|
6384
6496
|
className
|
|
6385
6497
|
),
|
|
6386
6498
|
...props,
|
|
@@ -6586,10 +6698,11 @@ var tagVariants = (0, import_class_variance_authority9.cva)(
|
|
|
6586
6698
|
variant: {
|
|
6587
6699
|
neutral: "border-[color:var(--sofya-tone-default-border)] bg-[color:var(--sofya-tone-default-background)] text-[color:var(--sofya-tone-default-foreground)]",
|
|
6588
6700
|
organization: "border-[color:var(--sofya-tone-info-border)] bg-[color:var(--sofya-tone-info-background)] text-[color:var(--sofya-tone-info-foreground)]",
|
|
6589
|
-
// Brand/content label
|
|
6590
|
-
//
|
|
6591
|
-
//
|
|
6592
|
-
|
|
6701
|
+
// Brand/content label (e.g. a clinical-domain pill): a soft
|
|
6702
|
+
// secondary-tinted fill (`--sofya-secondary` @ 10%) with primary text.
|
|
6703
|
+
// Distinct from `organization`'s primary-tinted info look, and roomier
|
|
6704
|
+
// padding (16/4) to match the content-label spec. Borderless filled pill.
|
|
6705
|
+
brand: "border-[color:var(--sofya-tone-brand-border)] bg-[color:var(--sofya-tone-brand-background)] text-[color:var(--sofya-tone-brand-foreground)] px-[var(--sofya-space-4)] py-[var(--sofya-space-1)]",
|
|
6593
6706
|
privacy: "border-transparent bg-[color:var(--sofya-surface-muted)] text-[color:var(--sofya-text-subtle)]",
|
|
6594
6707
|
status: ""
|
|
6595
6708
|
}
|
|
@@ -6732,7 +6845,11 @@ var TemplateCard = React45.forwardRef(
|
|
|
6732
6845
|
const titleNode = renderTextContent(title, {
|
|
6733
6846
|
as: "span",
|
|
6734
6847
|
className: "block min-w-0 truncate font-semibold text-[color:var(--sofya-text-default)]",
|
|
6735
|
-
size: "title-sm"
|
|
6848
|
+
size: "title-sm",
|
|
6849
|
+
// Selectable rows use the exact picker-title ramp (15/26, semibold). The
|
|
6850
|
+
// size tokens are applied via inline style by `Text`, so the precise
|
|
6851
|
+
// values must be passed as `style` to win over the `title-sm` defaults.
|
|
6852
|
+
style: selectable ? { fontSize: "15px", lineHeight: "26px", fontWeight: 600 } : void 0
|
|
6736
6853
|
});
|
|
6737
6854
|
const hasInlineTitleExtras = showInlineStar || showInlineMeta;
|
|
6738
6855
|
const titleRow = hasInlineTitleExtras ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex min-w-0 items-center gap-[var(--sofya-gap-tight)]", children: [
|
|
@@ -6752,10 +6869,17 @@ var TemplateCard = React45.forwardRef(
|
|
|
6752
6869
|
description ? renderTextContent(description, {
|
|
6753
6870
|
as: "span",
|
|
6754
6871
|
className: cn(
|
|
6755
|
-
"block min-w-0
|
|
6872
|
+
"block min-w-0",
|
|
6873
|
+
// Selectable rows use the full foreground tone (not the softer
|
|
6874
|
+
// ramp) to match the picker spec.
|
|
6875
|
+
selectable ? "text-[color:var(--sofya-text-default)]" : "text-[color:var(--sofya-text-soft)]",
|
|
6756
6876
|
(isList || selectable) && "truncate"
|
|
6757
6877
|
),
|
|
6758
|
-
size: descriptionSize
|
|
6878
|
+
size: descriptionSize,
|
|
6879
|
+
// Exact picker-description ramp (14/18, regular). Passed as inline
|
|
6880
|
+
// style so it wins over the line-height/weight applied by `Text`,
|
|
6881
|
+
// independent of which size ramp `descriptionSize` resolves to.
|
|
6882
|
+
style: selectable ? { fontSize: "14px", lineHeight: "18px", fontWeight: 400 } : void 0
|
|
6759
6883
|
}) : null
|
|
6760
6884
|
] });
|
|
6761
6885
|
const blockMeta = showBlockMeta ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
@@ -6799,8 +6923,12 @@ var TemplateCard = React45.forwardRef(
|
|
|
6799
6923
|
className: cn(
|
|
6800
6924
|
"group rounded-[var(--sofya-radius-md)] border border-[color:var(--sofya-border-soft)] bg-card transition-colors duration-sofya ease-sofya",
|
|
6801
6925
|
"hover:border-[color:var(--sofya-border-strong)] hover:bg-[color:var(--sofya-surface-hover)]",
|
|
6802
|
-
"data-[selected=true]:
|
|
6803
|
-
|
|
6926
|
+
"data-[selected=true]:bg-[color:var(--sofya-surface-selected)]",
|
|
6927
|
+
// In card/list usage the selected state also strengthens the border.
|
|
6928
|
+
// Selectable picker rows are distinguished by the fill alone and keep
|
|
6929
|
+
// the same soft border in every state.
|
|
6930
|
+
!selectable && "data-[selected=true]:border-primary",
|
|
6931
|
+
selectable ? "flex cursor-pointer items-center gap-[var(--sofya-space-6)] rounded-[var(--sofya-radius-sm)] p-[var(--sofya-space-4)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0" : isList ? "flex items-center gap-[var(--sofya-gap-default)] px-[var(--sofya-space-4)] py-[var(--sofya-space-3)]" : "flex flex-col gap-[var(--sofya-space-3)] p-[var(--sofya-space-4)]",
|
|
6804
6932
|
className
|
|
6805
6933
|
),
|
|
6806
6934
|
...props,
|
|
@@ -7280,7 +7408,11 @@ var import_tokens4 = require("@sofya-ds/tokens");
|
|
|
7280
7408
|
SelectValue,
|
|
7281
7409
|
Separator,
|
|
7282
7410
|
SettingsNavItem,
|
|
7411
|
+
SidebarNav,
|
|
7283
7412
|
SidebarNavItem,
|
|
7413
|
+
SidebarNavSection,
|
|
7414
|
+
SidebarNavSectionItems,
|
|
7415
|
+
SidebarNavSectionLabel,
|
|
7284
7416
|
Skeleton,
|
|
7285
7417
|
Slider,
|
|
7286
7418
|
SofyaProvider,
|