@medway-ui/core 1.47.0 → 1.48.0
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/COMPONENTS.md +26 -11
- package/COMPONENTS_SUMMARY.md +2 -2
- package/dist/COMPONENTS.md +26 -11
- package/dist/COMPONENTS_SUMMARY.md +2 -2
- package/dist/components/Alert.d.ts +3 -3
- package/dist/components/Alert.js +1 -1
- package/dist/components/Alert.mjs +1 -1
- package/dist/components/Collapsible.mjs +1 -1
- package/dist/components/ConnectorNode.d.ts +104 -14
- package/dist/components/ConnectorNode.js +1 -1
- package/dist/components/ConnectorNode.mjs +1 -1
- package/dist/components/TrailStep.d.ts +4 -6
- package/dist/components/TrailStep.js +1 -1
- package/dist/components/TrailStep.mjs +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/COMPONENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @medway-ui/core — Component Reference
|
|
2
2
|
|
|
3
3
|
> **Auto-generated — do not edit manually.**
|
|
4
|
-
> Package `@medway-ui/core` · v1.
|
|
4
|
+
> Package `@medway-ui/core` · v1.48.0 · Generated 2026-11-18
|
|
5
5
|
|
|
6
6
|
All components require React 18+ and are client components (`"use client"`).
|
|
7
7
|
|
|
@@ -100,7 +100,7 @@ import type { ButtonProps } from "@medway-ui/core";
|
|
|
100
100
|
|
|
101
101
|
**`variant`** *(default: `"regular"`)*:
|
|
102
102
|
|
|
103
|
-
`"regular"` \| `"emphasis"` \| `"success"` \| `"warning"` \| `"error"`
|
|
103
|
+
`"regular"` \| `"emphasis"` \| `"success"` \| `"warning"` \| `"error"` \| `"new"`
|
|
104
104
|
|
|
105
105
|
### `alertButtonVariants` — CVA Variants
|
|
106
106
|
|
|
@@ -110,13 +110,13 @@ import type { ButtonProps } from "@medway-ui/core";
|
|
|
110
110
|
|
|
111
111
|
**`alertVariant`** *(default: `"regular"`)*:
|
|
112
112
|
|
|
113
|
-
`"regular"` \| `"emphasis"` \| `"success"` \| `"warning"` \| `"error"`
|
|
113
|
+
`"regular"` \| `"emphasis"` \| `"success"` \| `"warning"` \| `"error"` \| `"new"`
|
|
114
114
|
|
|
115
115
|
### `AlertProps`
|
|
116
116
|
|
|
117
117
|
| Prop | Type | Required |
|
|
118
118
|
|------|------|:--------:|
|
|
119
|
-
| `variant` | `"regular" \| "emphasis" \| "success" \| "warning" \| "error"` | |
|
|
119
|
+
| `variant` | `"regular" \| "emphasis" \| "success" \| "warning" \| "error" \| "new"` | |
|
|
120
120
|
| `onClose` | `() => void` | |
|
|
121
121
|
| `closeLabel` | `string` | |
|
|
122
122
|
|
|
@@ -1108,7 +1108,7 @@ type ConnectorPosition = `${ConnectorAnchor}-to-${ConnectorAnchor}`
|
|
|
1108
1108
|
|
|
1109
1109
|
**Sub-components:** `ConnectorNode`
|
|
1110
1110
|
|
|
1111
|
-
**Exported types:** `ConnectorNodeProps`, `ConnectorNodeStatus`
|
|
1111
|
+
**Exported types:** `ConnectorNodeCard`, `ConnectorNodeProps`, `ConnectorNodeStatus`
|
|
1112
1112
|
|
|
1113
1113
|
### `ringVariants` — CVA Variants
|
|
1114
1114
|
|
|
@@ -1140,10 +1140,22 @@ type ConnectorPosition = `${ConnectorAnchor}-to-${ConnectorAnchor}`
|
|
|
1140
1140
|
type ConnectorNodeStatus = "done" | "current" | "upcoming"
|
|
1141
1141
|
```
|
|
1142
1142
|
|
|
1143
|
+
### `ConnectorNodeCard` *(type)*
|
|
1144
|
+
|
|
1145
|
+
```typescript
|
|
1146
|
+
type ConnectorNodeCard = {
|
|
1147
|
+
badge?: string;
|
|
1148
|
+
title: string;
|
|
1149
|
+
description: ReactNode;
|
|
1150
|
+
}
|
|
1151
|
+
```
|
|
1152
|
+
|
|
1143
1153
|
### `ConnectorNodeProps` *(type)*
|
|
1144
1154
|
|
|
1145
1155
|
```typescript
|
|
1146
|
-
type ConnectorNodeProps =
|
|
1156
|
+
type ConnectorNodeProps = | ConnectorNodeButtonProps
|
|
1157
|
+
| ConnectorNodeCardProps
|
|
1158
|
+
| ConnectorNodeStaticProps
|
|
1147
1159
|
```
|
|
1148
1160
|
|
|
1149
1161
|
---
|
|
@@ -2835,7 +2847,7 @@ type ToastActionElement = ReactElement<typeof ToastAction>
|
|
|
2835
2847
|
|
|
2836
2848
|
**Sub-components:** `TrailStep`
|
|
2837
2849
|
|
|
2838
|
-
**Exported types:** `TrailStepItem`, `TrailStepPosition`, `TrailStepProps`, `TrailStepStatus`
|
|
2850
|
+
**Exported types:** `TrailStepCard`, `TrailStepItem`, `TrailStepPosition`, `TrailStepProps`, `TrailStepStatus`
|
|
2839
2851
|
|
|
2840
2852
|
### `TrailStepStatus` *(type)*
|
|
2841
2853
|
|
|
@@ -2843,6 +2855,12 @@ type ToastActionElement = ReactElement<typeof ToastAction>
|
|
|
2843
2855
|
type TrailStepStatus = ConnectorNodeStatus
|
|
2844
2856
|
```
|
|
2845
2857
|
|
|
2858
|
+
### `TrailStepCard` *(type)*
|
|
2859
|
+
|
|
2860
|
+
```typescript
|
|
2861
|
+
type TrailStepCard = ConnectorNodeCard
|
|
2862
|
+
```
|
|
2863
|
+
|
|
2846
2864
|
### `TrailStepPosition` *(type)*
|
|
2847
2865
|
|
|
2848
2866
|
```typescript
|
|
@@ -2859,6 +2877,7 @@ type TrailStepItem = {
|
|
|
2859
2877
|
status: TrailStepStatus;
|
|
2860
2878
|
position?: TrailStepPosition;
|
|
2861
2879
|
disabled?: boolean;
|
|
2880
|
+
card?: TrailStepCard | null;
|
|
2862
2881
|
}
|
|
2863
2882
|
```
|
|
2864
2883
|
|
|
@@ -2867,10 +2886,6 @@ type TrailStepItem = {
|
|
|
2867
2886
|
```typescript
|
|
2868
2887
|
type TrailStepProps = Omit<ComponentProps<"ol">, "children" | "onClick"> & {
|
|
2869
2888
|
steps: readonly TrailStepItem[];
|
|
2870
|
-
/**
|
|
2871
|
-
* Torna as etapas botões. Mantenha estável: alternar entre função e
|
|
2872
|
-
* `undefined` troca o elemento de cada etapa e remonta a trilha.
|
|
2873
|
-
*/
|
|
2874
2889
|
onStepClick?: (step: TrailStepItem, index: number) => void;
|
|
2875
2890
|
}
|
|
2876
2891
|
```
|
package/COMPONENTS_SUMMARY.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @medway-ui/core — Component Summary
|
|
2
2
|
|
|
3
|
-
> v1.
|
|
3
|
+
> v1.48.0 · For the full prop/variant reference see `COMPONENTS.md`.
|
|
4
4
|
|
|
5
5
|
## Components
|
|
6
6
|
|
|
7
|
-
- **Alert** — variants: regular, emphasis, success, warning, error, basic | alertVariant: regular, emphasis, success, warning, error | sub: AlertActions, AlertButton, AlertContainer, AlertContent, AlertDescription, AlertIcon, AlertTitle
|
|
7
|
+
- **Alert** — variants: regular, emphasis, success, warning, error, new, basic | alertVariant: regular, emphasis, success, warning, error, new | sub: AlertActions, AlertButton, AlertContainer, AlertContent, AlertDescription, AlertIcon, AlertTitle
|
|
8
8
|
- **AlertDialog** — variants: regular, emphasis, warning, error, success | Radix: AlertDialog | sub: AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogIcon, AlertDialogOverlay, AlertDialogPortal, AlertDialogTag, AlertDialogTitle, AlertDialogTrigger
|
|
9
9
|
- **Autocomplete** — sizes: lg, md | sub: AutocompleteContent, AutocompleteContentFooter, AutocompleteGroup, AutocompleteItem, AutocompleteText, AutocompleteTrigger, AutocompleteWrapper
|
|
10
10
|
- **Avatar** — sizes: sm, md, lg, xl | Radix: Avatar | sub: AvatarFallback, AvatarImage
|
package/dist/COMPONENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @medway-ui/core — Component Reference
|
|
2
2
|
|
|
3
3
|
> **Auto-generated — do not edit manually.**
|
|
4
|
-
> Package `@medway-ui/core` · v1.
|
|
4
|
+
> Package `@medway-ui/core` · v1.48.0 · Generated 2026-11-18
|
|
5
5
|
|
|
6
6
|
All components require React 18+ and are client components (`"use client"`).
|
|
7
7
|
|
|
@@ -100,7 +100,7 @@ import type { ButtonProps } from "@medway-ui/core";
|
|
|
100
100
|
|
|
101
101
|
**`variant`** *(default: `"regular"`)*:
|
|
102
102
|
|
|
103
|
-
`"regular"` \| `"emphasis"` \| `"success"` \| `"warning"` \| `"error"`
|
|
103
|
+
`"regular"` \| `"emphasis"` \| `"success"` \| `"warning"` \| `"error"` \| `"new"`
|
|
104
104
|
|
|
105
105
|
### `alertButtonVariants` — CVA Variants
|
|
106
106
|
|
|
@@ -110,13 +110,13 @@ import type { ButtonProps } from "@medway-ui/core";
|
|
|
110
110
|
|
|
111
111
|
**`alertVariant`** *(default: `"regular"`)*:
|
|
112
112
|
|
|
113
|
-
`"regular"` \| `"emphasis"` \| `"success"` \| `"warning"` \| `"error"`
|
|
113
|
+
`"regular"` \| `"emphasis"` \| `"success"` \| `"warning"` \| `"error"` \| `"new"`
|
|
114
114
|
|
|
115
115
|
### `AlertProps`
|
|
116
116
|
|
|
117
117
|
| Prop | Type | Required |
|
|
118
118
|
|------|------|:--------:|
|
|
119
|
-
| `variant` | `"regular" \| "emphasis" \| "success" \| "warning" \| "error"` | |
|
|
119
|
+
| `variant` | `"regular" \| "emphasis" \| "success" \| "warning" \| "error" \| "new"` | |
|
|
120
120
|
| `onClose` | `() => void` | |
|
|
121
121
|
| `closeLabel` | `string` | |
|
|
122
122
|
|
|
@@ -1108,7 +1108,7 @@ type ConnectorPosition = `${ConnectorAnchor}-to-${ConnectorAnchor}`
|
|
|
1108
1108
|
|
|
1109
1109
|
**Sub-components:** `ConnectorNode`
|
|
1110
1110
|
|
|
1111
|
-
**Exported types:** `ConnectorNodeProps`, `ConnectorNodeStatus`
|
|
1111
|
+
**Exported types:** `ConnectorNodeCard`, `ConnectorNodeProps`, `ConnectorNodeStatus`
|
|
1112
1112
|
|
|
1113
1113
|
### `ringVariants` — CVA Variants
|
|
1114
1114
|
|
|
@@ -1140,10 +1140,22 @@ type ConnectorPosition = `${ConnectorAnchor}-to-${ConnectorAnchor}`
|
|
|
1140
1140
|
type ConnectorNodeStatus = "done" | "current" | "upcoming"
|
|
1141
1141
|
```
|
|
1142
1142
|
|
|
1143
|
+
### `ConnectorNodeCard` *(type)*
|
|
1144
|
+
|
|
1145
|
+
```typescript
|
|
1146
|
+
type ConnectorNodeCard = {
|
|
1147
|
+
badge?: string;
|
|
1148
|
+
title: string;
|
|
1149
|
+
description: ReactNode;
|
|
1150
|
+
}
|
|
1151
|
+
```
|
|
1152
|
+
|
|
1143
1153
|
### `ConnectorNodeProps` *(type)*
|
|
1144
1154
|
|
|
1145
1155
|
```typescript
|
|
1146
|
-
type ConnectorNodeProps =
|
|
1156
|
+
type ConnectorNodeProps = | ConnectorNodeButtonProps
|
|
1157
|
+
| ConnectorNodeCardProps
|
|
1158
|
+
| ConnectorNodeStaticProps
|
|
1147
1159
|
```
|
|
1148
1160
|
|
|
1149
1161
|
---
|
|
@@ -2835,7 +2847,7 @@ type ToastActionElement = ReactElement<typeof ToastAction>
|
|
|
2835
2847
|
|
|
2836
2848
|
**Sub-components:** `TrailStep`
|
|
2837
2849
|
|
|
2838
|
-
**Exported types:** `TrailStepItem`, `TrailStepPosition`, `TrailStepProps`, `TrailStepStatus`
|
|
2850
|
+
**Exported types:** `TrailStepCard`, `TrailStepItem`, `TrailStepPosition`, `TrailStepProps`, `TrailStepStatus`
|
|
2839
2851
|
|
|
2840
2852
|
### `TrailStepStatus` *(type)*
|
|
2841
2853
|
|
|
@@ -2843,6 +2855,12 @@ type ToastActionElement = ReactElement<typeof ToastAction>
|
|
|
2843
2855
|
type TrailStepStatus = ConnectorNodeStatus
|
|
2844
2856
|
```
|
|
2845
2857
|
|
|
2858
|
+
### `TrailStepCard` *(type)*
|
|
2859
|
+
|
|
2860
|
+
```typescript
|
|
2861
|
+
type TrailStepCard = ConnectorNodeCard
|
|
2862
|
+
```
|
|
2863
|
+
|
|
2846
2864
|
### `TrailStepPosition` *(type)*
|
|
2847
2865
|
|
|
2848
2866
|
```typescript
|
|
@@ -2859,6 +2877,7 @@ type TrailStepItem = {
|
|
|
2859
2877
|
status: TrailStepStatus;
|
|
2860
2878
|
position?: TrailStepPosition;
|
|
2861
2879
|
disabled?: boolean;
|
|
2880
|
+
card?: TrailStepCard | null;
|
|
2862
2881
|
}
|
|
2863
2882
|
```
|
|
2864
2883
|
|
|
@@ -2867,10 +2886,6 @@ type TrailStepItem = {
|
|
|
2867
2886
|
```typescript
|
|
2868
2887
|
type TrailStepProps = Omit<ComponentProps<"ol">, "children" | "onClick"> & {
|
|
2869
2888
|
steps: readonly TrailStepItem[];
|
|
2870
|
-
/**
|
|
2871
|
-
* Torna as etapas botões. Mantenha estável: alternar entre função e
|
|
2872
|
-
* `undefined` troca o elemento de cada etapa e remonta a trilha.
|
|
2873
|
-
*/
|
|
2874
2889
|
onStepClick?: (step: TrailStepItem, index: number) => void;
|
|
2875
2890
|
}
|
|
2876
2891
|
```
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @medway-ui/core — Component Summary
|
|
2
2
|
|
|
3
|
-
> v1.
|
|
3
|
+
> v1.48.0 · For the full prop/variant reference see `COMPONENTS.md`.
|
|
4
4
|
|
|
5
5
|
## Components
|
|
6
6
|
|
|
7
|
-
- **Alert** — variants: regular, emphasis, success, warning, error, basic | alertVariant: regular, emphasis, success, warning, error | sub: AlertActions, AlertButton, AlertContainer, AlertContent, AlertDescription, AlertIcon, AlertTitle
|
|
7
|
+
- **Alert** — variants: regular, emphasis, success, warning, error, new, basic | alertVariant: regular, emphasis, success, warning, error, new | sub: AlertActions, AlertButton, AlertContainer, AlertContent, AlertDescription, AlertIcon, AlertTitle
|
|
8
8
|
- **AlertDialog** — variants: regular, emphasis, warning, error, success | Radix: AlertDialog | sub: AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogIcon, AlertDialogOverlay, AlertDialogPortal, AlertDialogTag, AlertDialogTitle, AlertDialogTrigger
|
|
9
9
|
- **Autocomplete** — sizes: lg, md | sub: AutocompleteContent, AutocompleteContentFooter, AutocompleteGroup, AutocompleteItem, AutocompleteText, AutocompleteTrigger, AutocompleteWrapper
|
|
10
10
|
- **Avatar** — sizes: sm, md, lg, xl | Radix: Avatar | sub: AvatarFallback, AvatarImage
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
interface AlertProps extends ComponentProps<"div"> {
|
|
4
|
-
variant?: "regular" | "emphasis" | "success" | "warning" | "error";
|
|
4
|
+
variant?: "regular" | "emphasis" | "success" | "warning" | "error" | "new";
|
|
5
5
|
onClose?: () => void;
|
|
6
6
|
closeLabel?: string;
|
|
7
7
|
}
|
|
8
8
|
declare const alertVariants: (props?: ({
|
|
9
|
-
variant?: "regular" | "error" | "warning" | "emphasis" | "success" | null | undefined;
|
|
9
|
+
variant?: "regular" | "error" | "warning" | "emphasis" | "success" | "new" | null | undefined;
|
|
10
10
|
} & ({ class: import("clsx").ClassValue; className?: never } | { class?: never; className: import("clsx").ClassValue } | { class?: never; className?: never })) | undefined) => string;
|
|
11
11
|
declare function Alert({ className, variant, onClose, closeLabel, role, children, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
declare function AlertContainer({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,7 +19,7 @@ declare function AlertDescription({ className, ...props }: ComponentProps<"div">
|
|
|
19
19
|
declare function AlertActions({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
declare const alertButtonVariants: (props?: ({
|
|
21
21
|
variant?: "regular" | "basic" | null | undefined;
|
|
22
|
-
alertVariant?: "regular" | "error" | "warning" | "emphasis" | "success" | null | undefined;
|
|
22
|
+
alertVariant?: "regular" | "error" | "warning" | "emphasis" | "success" | "new" | null | undefined;
|
|
23
23
|
} & ({ class: import("clsx").ClassValue; className?: never } | { class?: never; className: import("clsx").ClassValue } | { class?: never; className?: never })) | undefined) => string;
|
|
24
24
|
interface AlertButtonProps extends ComponentProps<"button">, VariantProps<typeof alertButtonVariants> {
|
|
25
25
|
}
|
package/dist/components/Alert.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var
|
|
3
|
+
"use strict";var s=require("react/jsx-runtime"),i=require("react"),h=require("class-variance-authority"),O=require("./Button.js"),V=require("./Dismiss.js"),o=require("../lib/utils.js"),A=Object.defineProperty,C=Object.defineProperties,q=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,y=(e,r,a)=>r in e?A(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,l=(e,r)=>{for(var a in r||(r={}))w.call(r,a)&&y(e,a,r[a]);if(f)for(var a of f(r))_.call(r,a)&&y(e,a,r[a]);return e},p=(e,r)=>C(e,q(r)),c=(e,r)=>{var a={};for(var t in e)w.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&f)for(var t of f(e))r.indexOf(t)<0&&_.call(e,t)&&(a[t]=e[t]);return a};const b={regular:{regular:"regular-soft",basic:"regular-basic"},emphasis:{regular:"emphasis-soft",basic:"emphasis-basic"},success:{regular:"success-soft",basic:"success-basic"},warning:{regular:"warning-soft",basic:"warning-basic"},error:{regular:"error-soft",basic:"error-basic"},new:{regular:"regular-soft",basic:"regular-basic"}},u=i.createContext(null),P={regular:"text-primary-foreground-emphasis",emphasis:"text-secondary-foreground-emphasis",success:"text-feedback-success-foreground-emphasis",warning:"text-feedback-warning-foreground-emphasis",error:"text-feedback-error-foreground-emphasis",new:"text-cm-foreground-onfill text-xs leading-xs font-medium"},D={new:"text-sm leading-sm"},z={new:"flex-1 items-center gap-2.5"},B={new:"text-cm-foreground-onfill hover:bg-white-16 hover:text-cm-foreground-onfill focus-visible:ring-cm-foreground-onfill"},E={new:{regular:"bg-white-16 text-cm-foreground-onfill hover:bg-white-24 hover:text-cm-foreground-onfill focus-visible:ring-cm-foreground-onfill",basic:"bg-transparent text-cm-foreground-onfill hover:bg-white-16 hover:text-cm-foreground-onfill focus-visible:ring-cm-foreground-onfill"}},k=h.cva("relative flex flex-col items-center justify-between gap-5 w-full rounded-md px-4 py-3 text-sm has-[>svg]:gap-x-9 gap-y-1 [&>svg]:translate-y-0 [&>svg]:text-current lg:flex-row",{variants:{variant:{regular:"[background:linear-gradient(0deg,_var(--color-primary-background-soft)_0%,_var(--color-primary-background-soft)_100%),_var(--color-surface-card)] text-primary-foreground [&>svg]:text-primary-foreground",emphasis:"[background:linear-gradient(0deg,_var(--color-secondary-background-soft)_0%,_var(--color-secondary-background-soft)_100%),_var(--color-surface-card)] text-secondary-foreground [&>svg]:text-secondary-foreground",success:"[background:linear-gradient(0deg,_var(--color-feedback-success-background-soft)_0%,_var(--color-feedback-success-background-soft)_100%),_var(--color-surface-card)] text-feedback-success-foreground [&>svg]:text-feedback-success-foreground",warning:"[background:linear-gradient(0deg,_var(--color-feedback-warning-background-soft)_0%,_var(--color-feedback-warning-background-soft)_100%),_var(--color-surface-card)] text-feedback-warning-foreground [&>svg]:text-feedback-warning-foreground",error:"[background:linear-gradient(0deg,_var(--color-feedback-error-background-soft)_0%,_var(--color-feedback-error-background-soft)_100%),_var(--color-surface-card)] text-feedback-error-foreground [&>svg]:text-feedback-error-foreground",new:"flex-row flex-wrap items-center gap-2.5 has-[>svg]:gap-x-2.5 rounded-lg [background:linear-gradient(170deg,var(--color-cm)_0%,var(--color-secondary-lighten-1)_100%)] shadow-[inset_4px_0_8px_0_var(--color-secondary-24),inset_-4px_0_8px_0_var(--color-prev-16),inset_0_0_8px_0_var(--color-cm-16)] text-cm-foreground-onfill [&>svg]:text-cm-foreground-onfill [&>[data-slot=tag]]:shrink-0"}},defaultVariants:{variant:"regular"}});function I(e){var r=e,{className:a,variant:t="regular",onClose:n,closeLabel:m="Fechar alerta",role:v="alert",children:x}=r,d=c(r,["className","variant","onClose","closeLabel","role","children"]);const g=i.useMemo(()=>({variant:t}),[t]);return s.jsx(u.Provider,{value:g,children:s.jsxs("div",p(l({"data-slot":"alert",role:v,className:o.cn(k({variant:t}),n&&"pe-12",n&&t!=="new"&&"gap-x-9",a)},d),{children:[x,n&&s.jsx(V.Dismiss,{label:m,onClick:n,className:o.cn("absolute right-2.5 top-2.5",B[t])})]}))})}function L(e){var r=e,{className:a}=r,t=c(r,["className"]);const n=i.useContext(u);return s.jsx("div",l({"data-slot":"alert-container",className:o.cn("flex min-w-0 gap-3",n&&z[n.variant],a)},t))}function M(e){var r=e,{className:a}=r,t=c(r,["className"]);return s.jsx("div",l({"data-slot":"alert-content",className:o.cn("flex min-w-0 flex-col gap-1",a)},t))}function $(e){var r=e,{className:a,icon:t}=r,n=c(r,["className","icon"]);return s.jsx("div",p(l({"data-slot":"alert-icon",className:o.cn("size-6 max-[500px]:hidden",a)},n),{children:t}))}function F(e){var r=e,{className:a}=r,t=c(r,["className"]);const n=i.useContext(u);return s.jsx("div",l({"data-slot":"alert-title",className:o.cn("line-clamp-1 min-h-4 text-md font-semibold",n&&D[n.variant],a)},t))}function T(e){var r=e,{className:a}=r,t=c(r,["className"]);const n=i.useContext(u);return s.jsx("div",l({"data-slot":"alert-description",className:o.cn("!line-clamp-3 grid justify-items-start gap-1 text-sm leading-sm",n&&P[n.variant],a)},t))}function W(e){var r=e,{className:a}=r,t=c(r,["className"]);return s.jsx("div",l({"data-slot":"alert-actions",className:o.cn("relative mt-2 flex max-w-full shrink-0 flex-wrap items-center gap-x-2 max-[500px]:w-full max-[500px]:flex-col max-[500px]:flex-nowrap max-[500px]:items-stretch max-[500px]:gap-y-2 lg:mt-0 lg:flex-nowrap",a)},t))}function G(e){return e.split(" ").filter(r=>!r.startsWith("disabled:")).join(" ")}const N=h.cva("text-center max-[500px]:w-full max-[500px]:whitespace-normal disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{regular:"",basic:""},alertVariant:{regular:"",emphasis:"",success:"",warning:"",error:"",new:""}},compoundVariants:Object.keys(b).flatMap(e=>Object.keys(b[e]).map(r=>{var a;return{variant:r,alertVariant:e,class:o.cn(G(O.buttonVariants({variant:b[e][r],size:"md"})),(a=E[e])==null?void 0:a[r])}})),defaultVariants:{variant:"regular",alertVariant:"regular"}});function H(e){const r=[];let a=[];const t=()=>{a.length&&(r.push(s.jsx("span",{className:"min-w-0 truncate max-[500px]:whitespace-normal",children:a},`text-${r.length}`)),a=[])};return i.Children.toArray(e).forEach(n=>{if(typeof n=="string"||typeof n=="number"){a.push(n);return}t(),r.push(n)}),t(),r}function J(e){var r=e,{className:a,variant:t,alertVariant:n,type:m="button",children:v}=r,x=c(r,["className","variant","alertVariant","type","children"]),d;const g=i.useContext(u),j=(d=n!=null?n:g==null?void 0:g.variant)!=null?d:"regular";return s.jsx("button",p(l({type:m,"data-slot":"alert-button",className:o.cn(N({variant:t,alertVariant:j}),a)},x),{children:H(v)}))}exports.Alert=I,exports.AlertActions=W,exports.AlertButton=J,exports.AlertContainer=L,exports.AlertContent=M,exports.AlertDescription=T,exports.AlertIcon=$,exports.AlertTitle=F,exports.alertButtonVariants=N,exports.alertVariants=k;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as n,jsxs as j}from"react/jsx-runtime";import{createContext as V,useMemo as A,useContext as
|
|
3
|
+
import{jsx as n,jsxs as j}from"react/jsx-runtime";import{createContext as V,useMemo as A,useContext as f,Children as C}from"react";import{cva as h}from"class-variance-authority";import{buttonVariants as P}from"./Button.mjs";import{Dismiss as I}from"./Dismiss.mjs";import{cn as s}from"../lib/utils.mjs";var $=Object.defineProperty,z=Object.defineProperties,D=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,k=(e,r,a)=>r in e?$(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,l=(e,r)=>{for(var a in r||(r={}))w.call(r,a)&&k(e,a,r[a]);if(g)for(var a of g(r))_.call(r,a)&&k(e,a,r[a]);return e},x=(e,r)=>z(e,D(r)),c=(e,r)=>{var a={};for(var t in e)w.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&g)for(var t of g(e))r.indexOf(t)<0&&_.call(e,t)&&(a[t]=e[t]);return a};const b={regular:{regular:"regular-soft",basic:"regular-basic"},emphasis:{regular:"emphasis-soft",basic:"emphasis-basic"},success:{regular:"success-soft",basic:"success-basic"},warning:{regular:"warning-soft",basic:"warning-basic"},error:{regular:"error-soft",basic:"error-basic"},new:{regular:"regular-soft",basic:"regular-basic"}},i=V(null),E={regular:"text-primary-foreground-emphasis",emphasis:"text-secondary-foreground-emphasis",success:"text-feedback-success-foreground-emphasis",warning:"text-feedback-warning-foreground-emphasis",error:"text-feedback-error-foreground-emphasis",new:"text-cm-foreground-onfill text-xs leading-xs font-medium"},L={new:"text-sm leading-sm"},M={new:"flex-1 items-center gap-2.5"},B={new:"text-cm-foreground-onfill hover:bg-white-16 hover:text-cm-foreground-onfill focus-visible:ring-cm-foreground-onfill"},F={new:{regular:"bg-white-16 text-cm-foreground-onfill hover:bg-white-24 hover:text-cm-foreground-onfill focus-visible:ring-cm-foreground-onfill",basic:"bg-transparent text-cm-foreground-onfill hover:bg-white-16 hover:text-cm-foreground-onfill focus-visible:ring-cm-foreground-onfill"}},y=h("relative flex flex-col items-center justify-between gap-5 w-full rounded-md px-4 py-3 text-sm has-[>svg]:gap-x-9 gap-y-1 [&>svg]:translate-y-0 [&>svg]:text-current lg:flex-row",{variants:{variant:{regular:"[background:linear-gradient(0deg,_var(--color-primary-background-soft)_0%,_var(--color-primary-background-soft)_100%),_var(--color-surface-card)] text-primary-foreground [&>svg]:text-primary-foreground",emphasis:"[background:linear-gradient(0deg,_var(--color-secondary-background-soft)_0%,_var(--color-secondary-background-soft)_100%),_var(--color-surface-card)] text-secondary-foreground [&>svg]:text-secondary-foreground",success:"[background:linear-gradient(0deg,_var(--color-feedback-success-background-soft)_0%,_var(--color-feedback-success-background-soft)_100%),_var(--color-surface-card)] text-feedback-success-foreground [&>svg]:text-feedback-success-foreground",warning:"[background:linear-gradient(0deg,_var(--color-feedback-warning-background-soft)_0%,_var(--color-feedback-warning-background-soft)_100%),_var(--color-surface-card)] text-feedback-warning-foreground [&>svg]:text-feedback-warning-foreground",error:"[background:linear-gradient(0deg,_var(--color-feedback-error-background-soft)_0%,_var(--color-feedback-error-background-soft)_100%),_var(--color-surface-card)] text-feedback-error-foreground [&>svg]:text-feedback-error-foreground",new:"flex-row flex-wrap items-center gap-2.5 has-[>svg]:gap-x-2.5 rounded-lg [background:linear-gradient(170deg,var(--color-cm)_0%,var(--color-secondary-lighten-1)_100%)] shadow-[inset_4px_0_8px_0_var(--color-secondary-24),inset_-4px_0_8px_0_var(--color-prev-16),inset_0_0_8px_0_var(--color-cm-16)] text-cm-foreground-onfill [&>svg]:text-cm-foreground-onfill [&>[data-slot=tag]]:shrink-0"}},defaultVariants:{variant:"regular"}});function T(e){var r=e,{className:a,variant:t="regular",onClose:o,closeLabel:m="Fechar alerta",role:v="alert",children:p}=r,u=c(r,["className","variant","onClose","closeLabel","role","children"]);const d=A(()=>({variant:t}),[t]);return n(i.Provider,{value:d,children:j("div",x(l({"data-slot":"alert",role:v,className:s(y({variant:t}),o&&"pe-12",o&&t!=="new"&&"gap-x-9",a)},u),{children:[p,o&&n(I,{label:m,onClick:o,className:s("absolute right-2.5 top-2.5",B[t])})]}))})}function W(e){var r=e,{className:a}=r,t=c(r,["className"]);const o=f(i);return n("div",l({"data-slot":"alert-container",className:s("flex min-w-0 gap-3",o&&M[o.variant],a)},t))}function q(e){var r=e,{className:a}=r,t=c(r,["className"]);return n("div",l({"data-slot":"alert-content",className:s("flex min-w-0 flex-col gap-1",a)},t))}function G(e){var r=e,{className:a,icon:t}=r,o=c(r,["className","icon"]);return n("div",x(l({"data-slot":"alert-icon",className:s("size-6 max-[500px]:hidden",a)},o),{children:t}))}function H(e){var r=e,{className:a}=r,t=c(r,["className"]);const o=f(i);return n("div",l({"data-slot":"alert-title",className:s("line-clamp-1 min-h-4 text-md font-semibold",o&&L[o.variant],a)},t))}function J(e){var r=e,{className:a}=r,t=c(r,["className"]);const o=f(i);return n("div",l({"data-slot":"alert-description",className:s("!line-clamp-3 grid justify-items-start gap-1 text-sm leading-sm",o&&E[o.variant],a)},t))}function K(e){var r=e,{className:a}=r,t=c(r,["className"]);return n("div",l({"data-slot":"alert-actions",className:s("relative mt-2 flex max-w-full shrink-0 flex-wrap items-center gap-x-2 max-[500px]:w-full max-[500px]:flex-col max-[500px]:flex-nowrap max-[500px]:items-stretch max-[500px]:gap-y-2 lg:mt-0 lg:flex-nowrap",a)},t))}function S(e){return e.split(" ").filter(r=>!r.startsWith("disabled:")).join(" ")}const N=h("text-center max-[500px]:w-full max-[500px]:whitespace-normal disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{regular:"",basic:""},alertVariant:{regular:"",emphasis:"",success:"",warning:"",error:"",new:""}},compoundVariants:Object.keys(b).flatMap(e=>Object.keys(b[e]).map(r=>{var a;return{variant:r,alertVariant:e,class:s(S(P({variant:b[e][r],size:"md"})),(a=F[e])==null?void 0:a[r])}})),defaultVariants:{variant:"regular",alertVariant:"regular"}});function Q(e){const r=[];let a=[];const t=()=>{a.length&&(r.push(n("span",{className:"min-w-0 truncate max-[500px]:whitespace-normal",children:a},`text-${r.length}`)),a=[])};return C.toArray(e).forEach(o=>{if(typeof o=="string"||typeof o=="number"){a.push(o);return}t(),r.push(o)}),t(),r}function R(e){var r=e,{className:a,variant:t,alertVariant:o,type:m="button",children:v}=r,p=c(r,["className","variant","alertVariant","type","children"]),u;const d=f(i),O=(u=o!=null?o:d==null?void 0:d.variant)!=null?u:"regular";return n("button",x(l({type:m,"data-slot":"alert-button",className:s(N({variant:t,alertVariant:O}),a)},p),{children:Q(v)}))}export{T as Alert,K as AlertActions,R as AlertButton,W as AlertContainer,q as AlertContent,J as AlertDescription,G as AlertIcon,H as AlertTitle,N as alertButtonVariants,y as alertVariants};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as o}from"react/jsx-runtime";import{createContext as b,forwardRef as v,
|
|
3
|
+
import{jsx as o}from"react/jsx-runtime";import{createContext as b,forwardRef as v,useContext as C,useMemo as g}from"react";import{Collapsible as l}from"radix-ui";import{cn as O}from"../lib/utils.mjs";var x=Object.defineProperty,n=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,m=(e,a,t)=>a in e?x(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,i=(e,a)=>{for(var t in a||(a={}))c.call(a,t)&&m(e,t,a[t]);if(n)for(var t of n(a))f.call(a,t)&&m(e,t,a[t]);return e},p=(e,a)=>{var t={};for(var r in e)c.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&n)for(var r of n(e))a.indexOf(r)<0&&f.call(e,r)&&(t[r]=e[r]);return t};const d=b({animation:void 0});function y(e){var a=e,{animation:t}=a,r=p(a,["animation"]);return o(d.Provider,{value:g(()=>({animation:t}),[t]),children:o(l.Root,i({"data-slot":"collapsible"},r))})}const w=v(function(e,a){return o(l.Trigger,i({ref:a,"data-slot":"collapsible-trigger"},e))});function j(e){var a=e,{className:t}=a,r=p(a,["className"]);const{animation:s}=C(d),u={accordion:"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down motion-reduce:!animate-none",fade:"data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in"};return o(l.Content,i({"data-slot":"collapsible-content",className:O(s&&u[s],t)},r))}export{y as Collapsible,j as CollapsibleContent,w as CollapsibleTrigger};
|
|
@@ -1,30 +1,120 @@
|
|
|
1
1
|
import { type ComponentProps, type MouseEventHandler, type ReactNode } from "react";
|
|
2
|
-
import { type ConnectorPosition } from "./Connector.js";
|
|
2
|
+
import { type ConnectorAnchor, type ConnectorPosition } from "./Connector.js";
|
|
3
3
|
type ConnectorNodeStatus = "done" | "current" | "upcoming";
|
|
4
|
+
type ConnectorNodeCard = {
|
|
5
|
+
badge?: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: ReactNode;
|
|
8
|
+
};
|
|
4
9
|
type ConnectorNodeOwn = {
|
|
5
10
|
status?: ConnectorNodeStatus | null;
|
|
6
11
|
label: string;
|
|
7
12
|
icon?: ReactNode;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
connector?:
|
|
13
|
-
|
|
13
|
+
} & ({
|
|
14
|
+
connector: ConnectorPosition;
|
|
15
|
+
position?: never;
|
|
16
|
+
} | {
|
|
17
|
+
connector?: null;
|
|
18
|
+
position?: ConnectorAnchor;
|
|
19
|
+
});
|
|
14
20
|
type ConnectorNodeButtonProps = ConnectorNodeOwn & Omit<ComponentProps<"button">, "children" | "type"> & {
|
|
15
|
-
/**
|
|
16
|
-
* Torna a etapa um botão. Mantenha estável durante a vida da etapa:
|
|
17
|
-
* alternar entre função e `undefined` troca o elemento raiz e remonta a etapa.
|
|
18
|
-
*/
|
|
19
21
|
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
22
|
+
card?: ConnectorNodeCard | null;
|
|
23
|
+
};
|
|
24
|
+
type ConnectorNodeCardProps = ConnectorNodeOwn & Omit<ComponentProps<"button">, "children" | "type"> & {
|
|
25
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
26
|
+
card: ConnectorNodeCard;
|
|
20
27
|
};
|
|
21
28
|
type ButtonOnlyKey = Exclude<keyof ComponentProps<"button">, keyof ComponentProps<"div">>;
|
|
22
29
|
type ConnectorNodeStaticProps = ConnectorNodeOwn & Omit<ComponentProps<"div">, "children" | "onClick"> & {
|
|
23
30
|
onClick?: undefined;
|
|
31
|
+
card?: null;
|
|
24
32
|
} & {
|
|
25
33
|
[K in ButtonOnlyKey]?: never;
|
|
26
34
|
};
|
|
27
|
-
type ConnectorNodeProps = ConnectorNodeButtonProps | ConnectorNodeStaticProps;
|
|
28
|
-
declare const ConnectorNode: import("react").ForwardRefExoticComponent<(Omit<
|
|
35
|
+
type ConnectorNodeProps = ConnectorNodeButtonProps | ConnectorNodeCardProps | ConnectorNodeStaticProps;
|
|
36
|
+
declare const ConnectorNode: import("react").ForwardRefExoticComponent<(Omit<{
|
|
37
|
+
status?: ConnectorNodeStatus | null;
|
|
38
|
+
label: string;
|
|
39
|
+
icon?: ReactNode;
|
|
40
|
+
} & {
|
|
41
|
+
connector: ConnectorPosition;
|
|
42
|
+
position?: never;
|
|
43
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "children"> & {
|
|
44
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
45
|
+
card?: ConnectorNodeCard | null;
|
|
46
|
+
}, "ref"> | Omit<{
|
|
47
|
+
status?: ConnectorNodeStatus | null;
|
|
48
|
+
label: string;
|
|
49
|
+
icon?: ReactNode;
|
|
50
|
+
} & {
|
|
51
|
+
connector?: null;
|
|
52
|
+
position?: ConnectorAnchor;
|
|
53
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "children"> & {
|
|
54
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
55
|
+
card?: ConnectorNodeCard | null;
|
|
56
|
+
}, "ref"> | Omit<{
|
|
57
|
+
status?: ConnectorNodeStatus | null;
|
|
58
|
+
label: string;
|
|
59
|
+
icon?: ReactNode;
|
|
60
|
+
} & {
|
|
61
|
+
connector: ConnectorPosition;
|
|
62
|
+
position?: never;
|
|
63
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "children"> & {
|
|
64
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
65
|
+
card: ConnectorNodeCard;
|
|
66
|
+
}, "ref"> | Omit<{
|
|
67
|
+
status?: ConnectorNodeStatus | null;
|
|
68
|
+
label: string;
|
|
69
|
+
icon?: ReactNode;
|
|
70
|
+
} & {
|
|
71
|
+
connector?: null;
|
|
72
|
+
position?: ConnectorAnchor;
|
|
73
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "children"> & {
|
|
74
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
75
|
+
card: ConnectorNodeCard;
|
|
76
|
+
}, "ref"> | Omit<{
|
|
77
|
+
status?: ConnectorNodeStatus | null;
|
|
78
|
+
label: string;
|
|
79
|
+
icon?: ReactNode;
|
|
80
|
+
} & {
|
|
81
|
+
connector: ConnectorPosition;
|
|
82
|
+
position?: never;
|
|
83
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "onClick"> & {
|
|
84
|
+
onClick?: undefined;
|
|
85
|
+
card?: null;
|
|
86
|
+
} & {
|
|
87
|
+
form?: undefined;
|
|
88
|
+
name?: undefined;
|
|
89
|
+
type?: undefined;
|
|
90
|
+
disabled?: undefined;
|
|
91
|
+
formAction?: undefined;
|
|
92
|
+
formEncType?: undefined;
|
|
93
|
+
formMethod?: undefined;
|
|
94
|
+
formNoValidate?: undefined;
|
|
95
|
+
formTarget?: undefined;
|
|
96
|
+
value?: undefined;
|
|
97
|
+
}, "ref"> | Omit<{
|
|
98
|
+
status?: ConnectorNodeStatus | null;
|
|
99
|
+
label: string;
|
|
100
|
+
icon?: ReactNode;
|
|
101
|
+
} & {
|
|
102
|
+
connector?: null;
|
|
103
|
+
position?: ConnectorAnchor;
|
|
104
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "onClick"> & {
|
|
105
|
+
onClick?: undefined;
|
|
106
|
+
card?: null;
|
|
107
|
+
} & {
|
|
108
|
+
form?: undefined;
|
|
109
|
+
name?: undefined;
|
|
110
|
+
type?: undefined;
|
|
111
|
+
disabled?: undefined;
|
|
112
|
+
formAction?: undefined;
|
|
113
|
+
formEncType?: undefined;
|
|
114
|
+
formMethod?: undefined;
|
|
115
|
+
formNoValidate?: undefined;
|
|
116
|
+
formTarget?: undefined;
|
|
117
|
+
value?: undefined;
|
|
118
|
+
}, "ref">) & import("react").RefAttributes<HTMLButtonElement | HTMLDivElement>>;
|
|
29
119
|
export { ConnectorNode };
|
|
30
|
-
export type { ConnectorNodeProps, ConnectorNodeStatus };
|
|
120
|
+
export type { ConnectorNodeCard, ConnectorNodeProps, ConnectorNodeStatus };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var
|
|
3
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("class-variance-authority"),D=require("react"),F=require("./Badge.js"),v=require("./Collapsible.js"),h=require("./Connector.js"),H=require("../hooks/use-id.js"),d=require("../lib/utils.js"),L=Object.defineProperty,T=Object.defineProperties,$=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,A=(r,t,n)=>t in r?L(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,p=(r,t)=>{for(var n in t||(t={}))w.call(t,n)&&A(r,n,t[n]);if(u)for(var n of u(t))q.call(t,n)&&A(r,n,t[n]);return r},P=(r,t)=>T(r,$(t)),R=(r,t)=>{var n={};for(var o in r)w.call(r,o)&&t.indexOf(o)<0&&(n[o]=r[o]);if(r!=null&&u)for(var o of u(r))t.indexOf(o)<0&&q.call(r,o)&&(n[o]=r[o]);return n};const V={done:"Conclu\xEDdo",current:"Atual",upcoming:"Pr\xF3ximo"},K=i.cva("pointer-events-none absolute inset-0 block origin-center rounded-lg border-2 group-disabled/connector-node:border-gray-stroke-muted group-disabled/connector-node:animate-none",{variants:{status:{done:"border-solid border-secondary-stroke-emphasis",current:"border-solid border-secondary-stroke-emphasis animate-connector-node-pulse motion-reduce:animate-none",upcoming:"border-dashed border-gray-stroke-muted"}}}),M=i.cva("absolute inset-2 flex flex-col overflow-hidden rounded-[10px] px-0.5 pb-1.5 pt-0.5 transition-colors motion-reduce:transition-none group-disabled/connector-node:bg-gray-stroke-muted",{variants:{status:{done:"bg-secondary-stroke-emphasis",current:"bg-gray-stroke-muted [@media(hover:hover)]:group-hover/connector-node:bg-gray-stroke",upcoming:"bg-gray-stroke-muted [@media(hover:hover)]:group-hover/connector-node:bg-gray-stroke"}}}),Q=i.cva("flex w-full flex-1 items-center justify-center rounded-md [&_svg]:size-6 [&_svg]:shrink-0 group-disabled/connector-node:text-gray-foreground-muted group-disabled/connector-node:[background:var(--color-surface-card)]",{variants:{status:{done:"text-secondary-foreground-muted [background:linear-gradient(0deg,var(--color-secondary-background-soft-muted),var(--color-secondary-background-soft-muted)),var(--color-surface-card)]",current:"bg-surface-card text-gray-stroke-emphasis",upcoming:"bg-surface-card text-gray-stroke-emphasis"}}}),X=i.cva("w-full text-center text-sm font-semibold leading-sm group-disabled/connector-node:text-gray-foreground-muted",{variants:{status:{done:"text-gray-stroke-emphasis line-through",current:"text-primary-foreground",upcoming:"text-gray-stroke-emphasis"}}}),Y={left:"left-[calc(16.75%-6px)]",center:"left-[calc(50%-6px)]",right:"left-[calc(83.25%-6px)]"},Z=D.forwardRef(function(r,t){var n;const o=(n=r.status)!=null?n:"current",{label:y,className:_,icon:z,connector:c,position:l,card:a}=r,k=H.useId(),g=typeof r.onClick=="function"||a!=null,m=g&&o==="current"?void 0:V[o],j=e.jsxs(e.Fragment,{children:[e.jsxs("span",{"data-slot":"connector-node-shape",className:"relative block size-[72px] shrink-0",children:[e.jsx("span",{"data-slot":"connector-node-ring",className:K({status:o})}),e.jsx("span",{"data-slot":"connector-node-base",className:M({status:o}),children:e.jsx("span",{"data-slot":"connector-node-face",className:Q({status:o}),children:z})})]}),e.jsx("span",{"data-slot":"connector-node-label","aria-hidden":m?!0:void 0,className:X({status:o}),children:y}),m?e.jsx("span",{className:"sr-only",children:`${y}, ${m}`}):null]}),E=d.cn("inline-flex w-[72px] shrink-0 flex-col items-center gap-1.5 border-0 bg-transparent p-0",g&&"group/connector-node rounded-lg hover:cursor-pointer disabled:pointer-events-none focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",_),N={"data-slot":"connector-node","data-status":o,"aria-current":o==="current"?"step":void 0,className:E};if(g){const s=r,{status:b,label:f,className:x,icon:ne,connector:ae,position:se,card:ce,onClick:I}=s,B=R(s,["status","label","className","icon","connector","position","card","onClick"]);return O(e.jsx("button",P(p(p({ref:t},B),N),{type:"button",onClick:I,children:j})))}const C=r,{status:G,label:J,className:U,icon:W,connector:ee,position:re,card:oe,onClick:te}=C,S=R(C,["status","label","className","icon","connector","position","card","onClick"]);return O(e.jsx("div",P(p(p({ref:t},S),N),{children:j})));function O(s){if(!c&&!a)return l?e.jsx("div",{"data-slot":"connector-node-anchor",className:d.cn("w-fit",h.CONNECTOR_ANCHOR_CLASS[l]),children:s}):s;const b=c?c.split("-to-")[0]:l!=null?l:"center",f="flex w-[400px] min-w-0 max-w-full flex-col",x=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:d.cn("w-fit",h.CONNECTOR_ANCHOR_CLASS[b]),children:a?e.jsx(v.CollapsibleTrigger,{asChild:!0,children:s}):s}),a?e.jsx(v.CollapsibleContent,{role:"region","aria-labelledby":k,"data-slot":"connector-node-card",className:"w-full",children:e.jsxs("div",{className:"relative pb-2 pt-2",children:[e.jsxs("div",{className:"flex flex-col items-start gap-2 rounded-lg border border-gray-stroke-muted bg-surface-card p-5",children:[a.badge?e.jsx(F.Badge,{size:"lg",variant:o==="upcoming"?"primary-soft":"secondary-soft",className:"mb-1 uppercase",children:a.badge}):null,e.jsx("p",{id:k,className:"m-0 text-md font-bold leading-md text-primary-foreground",children:a.title}),e.jsx("div",{className:"text-sm leading-sm text-gray-foreground",children:a.description})]}),e.jsx("span",{"aria-hidden":"true","data-slot":"connector-node-card-arrow",className:d.cn("absolute top-0.5 size-3 rotate-45 border-l border-t border-gray-stroke-muted bg-surface-card",Y[b])})]})}):null,c?e.jsx(h.Connector,{position:c,done:o==="done"}):null]});return a?e.jsx(v.Collapsible,{animation:"accordion","data-slot":"connector-node-item",className:f,children:x}):e.jsx("div",{"data-slot":"connector-node-item",className:f,children:x})}});exports.ConnectorNode=Z;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsxs as
|
|
3
|
+
import{jsxs as l,Fragment as O,jsx as t}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";import{forwardRef as F}from"react";import{Badge as H}from"./Badge.mjs";import{CollapsibleTrigger as L,CollapsibleContent as T,Collapsible as V}from"./Collapsible.mjs";import{CONNECTOR_ANCHOR_CLASS as j,Connector as K}from"./Connector.mjs";import{useId as M}from"../hooks/use-id.mjs";import{cn as u}from"../lib/utils.mjs";var Q=Object.defineProperty,X=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,z=(e,o,n)=>o in e?Q(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,p=(e,o)=>{for(var n in o||(o={}))P.call(o,n)&&z(e,n,o[n]);if(m)for(var n of m(o))$.call(o,n)&&z(e,n,o[n]);return e},R=(e,o)=>X(e,Y(o)),_=(e,o)=>{var n={};for(var r in e)P.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&m)for(var r of m(e))o.indexOf(r)<0&&$.call(e,r)&&(n[r]=e[r]);return n};const Z={done:"Conclu\xEDdo",current:"Atual",upcoming:"Pr\xF3ximo"},q=i("pointer-events-none absolute inset-0 block origin-center rounded-lg border-2 group-disabled/connector-node:border-gray-stroke-muted group-disabled/connector-node:animate-none",{variants:{status:{done:"border-solid border-secondary-stroke-emphasis",current:"border-solid border-secondary-stroke-emphasis animate-connector-node-pulse motion-reduce:animate-none",upcoming:"border-dashed border-gray-stroke-muted"}}}),G=i("absolute inset-2 flex flex-col overflow-hidden rounded-[10px] px-0.5 pb-1.5 pt-0.5 transition-colors motion-reduce:transition-none group-disabled/connector-node:bg-gray-stroke-muted",{variants:{status:{done:"bg-secondary-stroke-emphasis",current:"bg-gray-stroke-muted [@media(hover:hover)]:group-hover/connector-node:bg-gray-stroke",upcoming:"bg-gray-stroke-muted [@media(hover:hover)]:group-hover/connector-node:bg-gray-stroke"}}}),J=i("flex w-full flex-1 items-center justify-center rounded-md [&_svg]:size-6 [&_svg]:shrink-0 group-disabled/connector-node:text-gray-foreground-muted group-disabled/connector-node:[background:var(--color-surface-card)]",{variants:{status:{done:"text-secondary-foreground-muted [background:linear-gradient(0deg,var(--color-secondary-background-soft-muted),var(--color-secondary-background-soft-muted)),var(--color-surface-card)]",current:"bg-surface-card text-gray-stroke-emphasis",upcoming:"bg-surface-card text-gray-stroke-emphasis"}}}),U=i("w-full text-center text-sm font-semibold leading-sm group-disabled/connector-node:text-gray-foreground-muted",{variants:{status:{done:"text-gray-stroke-emphasis line-through",current:"text-primary-foreground",upcoming:"text-gray-stroke-emphasis"}}}),W={left:"left-[calc(16.75%-6px)]",center:"left-[calc(50%-6px)]",right:"left-[calc(83.25%-6px)]"},ee=F(function(e,o){var n;const r=(n=e.status)!=null?n:"current",{label:x,className:A,icon:E,connector:c,position:d,card:a}=e,y=M(),g=typeof e.onClick=="function"||a!=null,f=g&&r==="current"?void 0:Z[r],k=l(O,{children:[l("span",{"data-slot":"connector-node-shape",className:"relative block size-[72px] shrink-0",children:[t("span",{"data-slot":"connector-node-ring",className:q({status:r})}),t("span",{"data-slot":"connector-node-base",className:G({status:r}),children:t("span",{"data-slot":"connector-node-face",className:J({status:r}),children:E})})]}),t("span",{"data-slot":"connector-node-label","aria-hidden":f?!0:void 0,className:U({status:r}),children:x}),f?t("span",{className:"sr-only",children:`${x}, ${f}`}):null]}),I=u("inline-flex w-[72px] shrink-0 flex-col items-center gap-1.5 border-0 bg-transparent p-0",g&&"group/connector-node rounded-lg hover:cursor-pointer disabled:pointer-events-none focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus",A),N={"data-slot":"connector-node","data-status":r,"aria-current":r==="current"?"step":void 0,className:I};if(g){const s=e,{status:b,label:v,className:h,icon:de,connector:ie,position:ue,card:me,onClick:S}=s,B=_(s,["status","label","className","icon","connector","position","card","onClick"]);return w(t("button",R(p(p({ref:o},B),N),{type:"button",onClick:S,children:k})))}const C=e,{status:re,label:oe,className:te,icon:ne,connector:ae,position:se,card:ce,onClick:le}=C,D=_(C,["status","label","className","icon","connector","position","card","onClick"]);return w(t("div",R(p(p({ref:o},D),N),{children:k})));function w(s){if(!c&&!a)return d?t("div",{"data-slot":"connector-node-anchor",className:u("w-fit",j[d]),children:s}):s;const b=c?c.split("-to-")[0]:d!=null?d:"center",v="flex w-[400px] min-w-0 max-w-full flex-col",h=l(O,{children:[t("div",{className:u("w-fit",j[b]),children:a?t(L,{asChild:!0,children:s}):s}),a?t(T,{role:"region","aria-labelledby":y,"data-slot":"connector-node-card",className:"w-full",children:l("div",{className:"relative pb-2 pt-2",children:[l("div",{className:"flex flex-col items-start gap-2 rounded-lg border border-gray-stroke-muted bg-surface-card p-5",children:[a.badge?t(H,{size:"lg",variant:r==="upcoming"?"primary-soft":"secondary-soft",className:"mb-1 uppercase",children:a.badge}):null,t("p",{id:y,className:"m-0 text-md font-bold leading-md text-primary-foreground",children:a.title}),t("div",{className:"text-sm leading-sm text-gray-foreground",children:a.description})]}),t("span",{"aria-hidden":"true","data-slot":"connector-node-card-arrow",className:u("absolute top-0.5 size-3 rotate-45 border-l border-t border-gray-stroke-muted bg-surface-card",W[b])})]})}):null,c?t(K,{position:c,done:r==="done"}):null]});return a?t(V,{animation:"accordion","data-slot":"connector-node-item",className:v,children:h}):t("div",{"data-slot":"connector-node-item",className:v,children:h})}});export{ee as ConnectorNode};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
2
|
import { type ConnectorAnchor } from "./Connector.js";
|
|
3
|
-
import { type ConnectorNodeStatus } from "./ConnectorNode.js";
|
|
3
|
+
import { type ConnectorNodeCard, type ConnectorNodeStatus } from "./ConnectorNode.js";
|
|
4
4
|
type TrailStepStatus = ConnectorNodeStatus;
|
|
5
|
+
type TrailStepCard = ConnectorNodeCard;
|
|
5
6
|
type TrailStepPosition = ConnectorAnchor;
|
|
6
7
|
type TrailStepItem = {
|
|
7
8
|
id: string;
|
|
@@ -10,15 +11,12 @@ type TrailStepItem = {
|
|
|
10
11
|
status: TrailStepStatus;
|
|
11
12
|
position?: TrailStepPosition;
|
|
12
13
|
disabled?: boolean;
|
|
14
|
+
card?: TrailStepCard | null;
|
|
13
15
|
};
|
|
14
16
|
type TrailStepProps = Omit<ComponentProps<"ol">, "children" | "onClick"> & {
|
|
15
17
|
steps: readonly TrailStepItem[];
|
|
16
|
-
/**
|
|
17
|
-
* Torna as etapas botões. Mantenha estável: alternar entre função e
|
|
18
|
-
* `undefined` troca o elemento de cada etapa e remonta a trilha.
|
|
19
|
-
*/
|
|
20
18
|
onStepClick?: (step: TrailStepItem, index: number) => void;
|
|
21
19
|
};
|
|
22
20
|
declare const TrailStep: import("react").ForwardRefExoticComponent<Omit<TrailStepProps, "ref"> & import("react").RefAttributes<HTMLOListElement>>;
|
|
23
21
|
export { TrailStep };
|
|
24
|
-
export type { TrailStepItem, TrailStepPosition, TrailStepProps, TrailStepStatus, };
|
|
22
|
+
export type { TrailStepCard, TrailStepItem, TrailStepPosition, TrailStepProps, TrailStepStatus, };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var
|
|
3
|
+
"use strict";var a=require("react/jsx-runtime"),P=require("react"),d=require("./ConnectorNode.js"),h=require("../lib/utils.js"),k=Object.defineProperty,q=Object.defineProperties,g=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,O=(e,r,l)=>r in e?k(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l,o=(e,r)=>{for(var l in r||(r={}))m.call(r,l)&&O(e,l,r[l]);if(i)for(var l of i(r))j.call(r,l)&&O(e,l,r[l]);return e},p=(e,r)=>q(e,g(r)),R=(e,r)=>{var l={};for(var t in e)m.call(e,t)&&r.indexOf(t)<0&&(l[t]=e[t]);if(e!=null&&i)for(var t of i(e))r.indexOf(t)<0&&j.call(e,t)&&(l[t]=e[t]);return l};const S=P.forwardRef(function(e,r){var l=e,{steps:t,onStepClick:u,className:y}=l,N=R(l,["steps","onStepClick","className"]);return a.jsx("ol",p(o({ref:r},N),{"data-slot":"trail-step",className:h.cn("m-0 flex w-[400px] max-w-full list-none flex-col p-0",y),children:t.map((n,f)=>{var b,v;const s=(b=n.position)!=null?b:"center",x=t[f+1],w=x?{connector:`${s}-to-${(v=x.position)!=null?v:"center"}`}:{position:s},c=o({status:n.status,label:n.label,icon:n.icon},w),C=u?a.jsx(d.ConnectorNode,p(o({},c),{card:n.card,onClick:()=>u(n,f),disabled:n.disabled})):n.card?a.jsx(d.ConnectorNode,p(o({},c),{card:n.card,disabled:n.disabled})):a.jsx(d.ConnectorNode,o({},c));return a.jsx("li",{"data-slot":"trail-step-item","data-position":s,className:"flex flex-col",children:C},n.id)})}))});exports.TrailStep=S;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as a}from"react/jsx-runtime";import{forwardRef as P}from"react";import{ConnectorNode as p}from"./ConnectorNode.mjs";import{cn as h}from"../lib/utils.mjs";var k=Object.defineProperty,g=Object.defineProperties,S=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,y=(e,r,l)=>r in e?k(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l,i=(e,r)=>{for(var l in r||(r={}))x.call(r,l)&&y(e,l,r[l]);if(n)for(var l of n(r))O.call(r,l)&&y(e,l,r[l]);return e},f=(e,r)=>g(e,S(r)),I=(e,r)=>{var l={};for(var t in e)x.call(e,t)&&r.indexOf(t)<0&&(l[t]=e[t]);if(e!=null&&n)for(var t of n(e))r.indexOf(t)<0&&O.call(e,t)&&(l[t]=e[t]);return l};const R=P(function(e,r){var l=e,{steps:t,onStepClick:d,className:w}=l,j=I(l,["steps","onStepClick","className"]);return a("ol",f(i({ref:r},j),{"data-slot":"trail-step",className:h("m-0 flex w-[400px] max-w-full list-none flex-col p-0",w),children:t.map((o,m)=>{var u,b;const s=(u=o.position)!=null?u:"center",v=t[m+1],N=v?{connector:`${s}-to-${(b=v.position)!=null?b:"center"}`}:{position:s},c=i({status:o.status,label:o.label,icon:o.icon},N),C=d?a(p,f(i({},c),{card:o.card,onClick:()=>d(o,m),disabled:o.disabled})):o.card?a(p,f(i({},c),{card:o.card,disabled:o.disabled})):a(p,i({},c));return a("li",{"data-slot":"trail-step-item","data-position":s,className:"flex flex-col",children:C},o.id)})}))});export{R as TrailStep};
|
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export type { ConfirmDeleteButtonProps } from "./components/ConfirmDeleteButton.
|
|
|
38
38
|
export { Connector } from "./components/Connector.js";
|
|
39
39
|
export type { ConnectorAnchor, ConnectorPosition, ConnectorProps, } from "./components/Connector.js";
|
|
40
40
|
export { ConnectorNode } from "./components/ConnectorNode.js";
|
|
41
|
-
export type { ConnectorNodeProps, ConnectorNodeStatus, } from "./components/ConnectorNode.js";
|
|
41
|
+
export type { ConnectorNodeCard, ConnectorNodeProps, ConnectorNodeStatus, } from "./components/ConnectorNode.js";
|
|
42
42
|
export { Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./components/Dialog.js";
|
|
43
43
|
export type { DialogContainerProps, DialogContentProps, DialogFooterProps, DialogHeaderProps, DialogTitleProps, } from "./components/Dialog.js";
|
|
44
44
|
export { Dismiss, dismissVariants } from "./components/Dismiss.js";
|
|
@@ -116,5 +116,5 @@ export type { ToastActionElement, ToastActionProps, ToastActionVariant, ToastClo
|
|
|
116
116
|
export { useToast } from "./hooks/use-toast.js";
|
|
117
117
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./components/Tooltip.js";
|
|
118
118
|
export { TrailStep } from "./components/TrailStep.js";
|
|
119
|
-
export type { TrailStepItem, TrailStepPosition, TrailStepProps, TrailStepStatus, } from "./components/TrailStep.js";
|
|
119
|
+
export type { TrailStepCard, TrailStepItem, TrailStepPosition, TrailStepProps, TrailStepStatus, } from "./components/TrailStep.js";
|
|
120
120
|
export { useIsMobile } from "./hooks/use-mobile.js";
|