@oods/components-react 0.3.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.
@@ -0,0 +1,163 @@
1
+ import * as React from 'react';
2
+ import { ComponentEmphasis, BadgeProps, ComponentTone } from './types.cjs';
3
+
4
+ interface StatusBadgeProps extends Omit<BadgeProps, 'children' | 'content' | 'status' | 'tone'> {
5
+ readonly children?: React.ReactNode;
6
+ readonly content?: React.ReactNode;
7
+ readonly status?: string;
8
+ readonly value?: string;
9
+ readonly label?: string;
10
+ readonly tone?: ComponentTone | 'lifecycle';
11
+ readonly field?: string;
12
+ readonly statusField?: string;
13
+ readonly domainField?: string;
14
+ readonly readOnly?: boolean;
15
+ readonly compact?: boolean;
16
+ readonly variant?: string;
17
+ }
18
+ declare const StatusBadge: React.ForwardRefExoticComponent<StatusBadgeProps & React.RefAttributes<HTMLSpanElement>>;
19
+ interface PriceBadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
20
+ readonly children?: React.ReactNode;
21
+ readonly amountCents?: number;
22
+ readonly unitAmountCents?: number;
23
+ readonly minorUnits?: number;
24
+ readonly amount?: number;
25
+ readonly unitAmount?: number;
26
+ readonly currency?: string;
27
+ readonly currencyCode?: string;
28
+ readonly label?: React.ReactNode;
29
+ readonly value?: string | number;
30
+ readonly emphasis?: ComponentEmphasis;
31
+ readonly field?: string;
32
+ readonly amountField?: string;
33
+ readonly currencyField?: string;
34
+ readonly intervalField?: string;
35
+ readonly minorUnitsParameter?: string;
36
+ }
37
+ declare const PriceBadge: React.ForwardRefExoticComponent<PriceBadgeProps & React.RefAttributes<HTMLSpanElement>>;
38
+ type TimelineEvent = {
39
+ readonly id?: string;
40
+ readonly label?: React.ReactNode;
41
+ readonly title?: React.ReactNode;
42
+ readonly from?: string;
43
+ readonly to?: string;
44
+ readonly status?: string;
45
+ readonly state?: string;
46
+ readonly timestamp?: string;
47
+ readonly datetime?: string;
48
+ readonly actor?: string;
49
+ readonly actorId?: string;
50
+ readonly actor_id?: string;
51
+ readonly reason?: React.ReactNode;
52
+ readonly detail?: React.ReactNode;
53
+ readonly description?: React.ReactNode;
54
+ };
55
+ interface TimelineBaseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {
56
+ readonly title?: React.ReactNode;
57
+ readonly events?: readonly unknown[];
58
+ readonly history?: readonly unknown[];
59
+ readonly entries?: readonly unknown[];
60
+ readonly stateHistory?: readonly unknown[];
61
+ readonly showActorId?: boolean;
62
+ readonly showReason?: boolean;
63
+ readonly maxVisible?: number;
64
+ readonly children?: React.ReactNode;
65
+ readonly field?: string;
66
+ readonly historyField?: string;
67
+ readonly statesParameter?: string;
68
+ readonly auditLogField?: string;
69
+ readonly createdField?: string;
70
+ readonly updatedField?: string;
71
+ readonly eventField?: string;
72
+ readonly eventTimestampField?: string;
73
+ readonly eventOptionsParameter?: string;
74
+ readonly showFromState?: boolean;
75
+ }
76
+ interface StatusTimelineProps extends TimelineBaseProps {
77
+ readonly status?: string;
78
+ readonly allowedTransitions?: readonly string[];
79
+ }
80
+ interface AuditTimelineProps extends TimelineBaseProps {
81
+ readonly auditLog?: readonly unknown[];
82
+ }
83
+ declare const StatusTimeline: React.ForwardRefExoticComponent<StatusTimelineProps & React.RefAttributes<HTMLDivElement>>;
84
+ declare const AuditTimeline: React.ForwardRefExoticComponent<AuditTimelineProps & React.RefAttributes<HTMLDivElement>>;
85
+ interface CancellationSummaryProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'title'> {
86
+ readonly label?: React.ReactNode;
87
+ readonly title?: React.ReactNode;
88
+ readonly cancelAtPeriodEnd?: boolean;
89
+ readonly requestedAt?: string;
90
+ readonly reason?: React.ReactNode;
91
+ readonly code?: string;
92
+ readonly children?: React.ReactNode;
93
+ readonly field?: string;
94
+ readonly cancelAtPeriodEndField?: string;
95
+ readonly requestedAtField?: string;
96
+ readonly reasonField?: string;
97
+ readonly codeField?: string;
98
+ }
99
+ declare const CancellationSummary: React.ForwardRefExoticComponent<CancellationSummaryProps & React.RefAttributes<HTMLElement>>;
100
+ type NativeSearchInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children' | 'type' | 'onChange' | 'value' | 'defaultValue'>;
101
+ interface SearchInputProps extends NativeSearchInputProps {
102
+ readonly label?: string;
103
+ readonly value?: string;
104
+ readonly defaultValue?: string;
105
+ readonly clearable?: boolean;
106
+ readonly debounceMs?: number;
107
+ readonly debounce?: number;
108
+ readonly minQueryLength?: number;
109
+ readonly field?: string;
110
+ readonly placeholderParameter?: string;
111
+ readonly debounceParameter?: string;
112
+ readonly minQueryLengthParameter?: string;
113
+ readonly clearableParameter?: string;
114
+ readonly onChange?: React.ChangeEventHandler<HTMLInputElement>;
115
+ readonly onValueChange?: (value: string) => void;
116
+ readonly onUpdate?: (value: string) => void;
117
+ readonly onSearch?: (value: string) => void;
118
+ readonly onClear?: () => void;
119
+ }
120
+ declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
121
+ interface PaginationBarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'onChange'> {
122
+ readonly page?: number;
123
+ readonly pageSize?: number;
124
+ readonly totalItems?: number;
125
+ readonly totalPages?: number;
126
+ readonly pageSizeOptions?: readonly number[];
127
+ readonly showPageSizeSelector?: boolean;
128
+ readonly showGotoPage?: boolean;
129
+ readonly showItemRange?: boolean;
130
+ readonly pageField?: string;
131
+ readonly pageSizeField?: string;
132
+ readonly totalItemsField?: string;
133
+ readonly totalPagesField?: string;
134
+ readonly pageSizeOptionsParameter?: string;
135
+ readonly showPageSizeSelectorParameter?: string;
136
+ readonly showGotoPageParameter?: string;
137
+ readonly showItemRangeParameter?: string;
138
+ readonly onPageChange?: (page: number) => void;
139
+ readonly onPageSizeChange?: (pageSize: number) => void;
140
+ readonly onChange?: (page: number) => void;
141
+ readonly onUpdate?: (page: number) => void;
142
+ }
143
+ declare const PaginationBar: React.ForwardRefExoticComponent<PaginationBarProps & React.RefAttributes<HTMLElement>>;
144
+ interface RelativeTimestampProps extends Omit<React.TimeHTMLAttributes<HTMLTimeElement>, 'children' | 'dateTime'> {
145
+ readonly children?: React.ReactNode;
146
+ readonly datetime?: string | number | Date;
147
+ readonly timestamp?: string | number | Date;
148
+ readonly value?: string | number | Date;
149
+ readonly updatedAt?: string | number | Date;
150
+ readonly createdAt?: string | number | Date;
151
+ readonly relative?: React.ReactNode;
152
+ readonly label?: React.ReactNode;
153
+ readonly text?: React.ReactNode;
154
+ readonly timezone?: string;
155
+ readonly hideWhenEmpty?: boolean;
156
+ readonly now?: string | number | Date;
157
+ readonly field?: string;
158
+ readonly fallbackField?: string;
159
+ readonly timezoneParameter?: string;
160
+ }
161
+ declare const RelativeTimestamp: React.ForwardRefExoticComponent<RelativeTimestampProps & React.RefAttributes<HTMLTimeElement>>;
162
+
163
+ export { AuditTimeline, type AuditTimelineProps, CancellationSummary, type CancellationSummaryProps, PaginationBar, type PaginationBarProps, PriceBadge, type PriceBadgeProps, RelativeTimestamp, type RelativeTimestampProps, SearchInput, type SearchInputProps, StatusBadge, type StatusBadgeProps, StatusTimeline, type StatusTimelineProps, type TimelineEvent };
@@ -0,0 +1,163 @@
1
+ import * as React from 'react';
2
+ import { ComponentEmphasis, BadgeProps, ComponentTone } from './types.js';
3
+
4
+ interface StatusBadgeProps extends Omit<BadgeProps, 'children' | 'content' | 'status' | 'tone'> {
5
+ readonly children?: React.ReactNode;
6
+ readonly content?: React.ReactNode;
7
+ readonly status?: string;
8
+ readonly value?: string;
9
+ readonly label?: string;
10
+ readonly tone?: ComponentTone | 'lifecycle';
11
+ readonly field?: string;
12
+ readonly statusField?: string;
13
+ readonly domainField?: string;
14
+ readonly readOnly?: boolean;
15
+ readonly compact?: boolean;
16
+ readonly variant?: string;
17
+ }
18
+ declare const StatusBadge: React.ForwardRefExoticComponent<StatusBadgeProps & React.RefAttributes<HTMLSpanElement>>;
19
+ interface PriceBadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
20
+ readonly children?: React.ReactNode;
21
+ readonly amountCents?: number;
22
+ readonly unitAmountCents?: number;
23
+ readonly minorUnits?: number;
24
+ readonly amount?: number;
25
+ readonly unitAmount?: number;
26
+ readonly currency?: string;
27
+ readonly currencyCode?: string;
28
+ readonly label?: React.ReactNode;
29
+ readonly value?: string | number;
30
+ readonly emphasis?: ComponentEmphasis;
31
+ readonly field?: string;
32
+ readonly amountField?: string;
33
+ readonly currencyField?: string;
34
+ readonly intervalField?: string;
35
+ readonly minorUnitsParameter?: string;
36
+ }
37
+ declare const PriceBadge: React.ForwardRefExoticComponent<PriceBadgeProps & React.RefAttributes<HTMLSpanElement>>;
38
+ type TimelineEvent = {
39
+ readonly id?: string;
40
+ readonly label?: React.ReactNode;
41
+ readonly title?: React.ReactNode;
42
+ readonly from?: string;
43
+ readonly to?: string;
44
+ readonly status?: string;
45
+ readonly state?: string;
46
+ readonly timestamp?: string;
47
+ readonly datetime?: string;
48
+ readonly actor?: string;
49
+ readonly actorId?: string;
50
+ readonly actor_id?: string;
51
+ readonly reason?: React.ReactNode;
52
+ readonly detail?: React.ReactNode;
53
+ readonly description?: React.ReactNode;
54
+ };
55
+ interface TimelineBaseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {
56
+ readonly title?: React.ReactNode;
57
+ readonly events?: readonly unknown[];
58
+ readonly history?: readonly unknown[];
59
+ readonly entries?: readonly unknown[];
60
+ readonly stateHistory?: readonly unknown[];
61
+ readonly showActorId?: boolean;
62
+ readonly showReason?: boolean;
63
+ readonly maxVisible?: number;
64
+ readonly children?: React.ReactNode;
65
+ readonly field?: string;
66
+ readonly historyField?: string;
67
+ readonly statesParameter?: string;
68
+ readonly auditLogField?: string;
69
+ readonly createdField?: string;
70
+ readonly updatedField?: string;
71
+ readonly eventField?: string;
72
+ readonly eventTimestampField?: string;
73
+ readonly eventOptionsParameter?: string;
74
+ readonly showFromState?: boolean;
75
+ }
76
+ interface StatusTimelineProps extends TimelineBaseProps {
77
+ readonly status?: string;
78
+ readonly allowedTransitions?: readonly string[];
79
+ }
80
+ interface AuditTimelineProps extends TimelineBaseProps {
81
+ readonly auditLog?: readonly unknown[];
82
+ }
83
+ declare const StatusTimeline: React.ForwardRefExoticComponent<StatusTimelineProps & React.RefAttributes<HTMLDivElement>>;
84
+ declare const AuditTimeline: React.ForwardRefExoticComponent<AuditTimelineProps & React.RefAttributes<HTMLDivElement>>;
85
+ interface CancellationSummaryProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'title'> {
86
+ readonly label?: React.ReactNode;
87
+ readonly title?: React.ReactNode;
88
+ readonly cancelAtPeriodEnd?: boolean;
89
+ readonly requestedAt?: string;
90
+ readonly reason?: React.ReactNode;
91
+ readonly code?: string;
92
+ readonly children?: React.ReactNode;
93
+ readonly field?: string;
94
+ readonly cancelAtPeriodEndField?: string;
95
+ readonly requestedAtField?: string;
96
+ readonly reasonField?: string;
97
+ readonly codeField?: string;
98
+ }
99
+ declare const CancellationSummary: React.ForwardRefExoticComponent<CancellationSummaryProps & React.RefAttributes<HTMLElement>>;
100
+ type NativeSearchInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children' | 'type' | 'onChange' | 'value' | 'defaultValue'>;
101
+ interface SearchInputProps extends NativeSearchInputProps {
102
+ readonly label?: string;
103
+ readonly value?: string;
104
+ readonly defaultValue?: string;
105
+ readonly clearable?: boolean;
106
+ readonly debounceMs?: number;
107
+ readonly debounce?: number;
108
+ readonly minQueryLength?: number;
109
+ readonly field?: string;
110
+ readonly placeholderParameter?: string;
111
+ readonly debounceParameter?: string;
112
+ readonly minQueryLengthParameter?: string;
113
+ readonly clearableParameter?: string;
114
+ readonly onChange?: React.ChangeEventHandler<HTMLInputElement>;
115
+ readonly onValueChange?: (value: string) => void;
116
+ readonly onUpdate?: (value: string) => void;
117
+ readonly onSearch?: (value: string) => void;
118
+ readonly onClear?: () => void;
119
+ }
120
+ declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
121
+ interface PaginationBarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'onChange'> {
122
+ readonly page?: number;
123
+ readonly pageSize?: number;
124
+ readonly totalItems?: number;
125
+ readonly totalPages?: number;
126
+ readonly pageSizeOptions?: readonly number[];
127
+ readonly showPageSizeSelector?: boolean;
128
+ readonly showGotoPage?: boolean;
129
+ readonly showItemRange?: boolean;
130
+ readonly pageField?: string;
131
+ readonly pageSizeField?: string;
132
+ readonly totalItemsField?: string;
133
+ readonly totalPagesField?: string;
134
+ readonly pageSizeOptionsParameter?: string;
135
+ readonly showPageSizeSelectorParameter?: string;
136
+ readonly showGotoPageParameter?: string;
137
+ readonly showItemRangeParameter?: string;
138
+ readonly onPageChange?: (page: number) => void;
139
+ readonly onPageSizeChange?: (pageSize: number) => void;
140
+ readonly onChange?: (page: number) => void;
141
+ readonly onUpdate?: (page: number) => void;
142
+ }
143
+ declare const PaginationBar: React.ForwardRefExoticComponent<PaginationBarProps & React.RefAttributes<HTMLElement>>;
144
+ interface RelativeTimestampProps extends Omit<React.TimeHTMLAttributes<HTMLTimeElement>, 'children' | 'dateTime'> {
145
+ readonly children?: React.ReactNode;
146
+ readonly datetime?: string | number | Date;
147
+ readonly timestamp?: string | number | Date;
148
+ readonly value?: string | number | Date;
149
+ readonly updatedAt?: string | number | Date;
150
+ readonly createdAt?: string | number | Date;
151
+ readonly relative?: React.ReactNode;
152
+ readonly label?: React.ReactNode;
153
+ readonly text?: React.ReactNode;
154
+ readonly timezone?: string;
155
+ readonly hideWhenEmpty?: boolean;
156
+ readonly now?: string | number | Date;
157
+ readonly field?: string;
158
+ readonly fallbackField?: string;
159
+ readonly timezoneParameter?: string;
160
+ }
161
+ declare const RelativeTimestamp: React.ForwardRefExoticComponent<RelativeTimestampProps & React.RefAttributes<HTMLTimeElement>>;
162
+
163
+ export { AuditTimeline, type AuditTimelineProps, CancellationSummary, type CancellationSummaryProps, PaginationBar, type PaginationBarProps, PriceBadge, type PriceBadgeProps, RelativeTimestamp, type RelativeTimestampProps, SearchInput, type SearchInputProps, StatusBadge, type StatusBadgeProps, StatusTimeline, type StatusTimelineProps, type TimelineEvent };
package/dist/ported.js ADDED
@@ -0,0 +1,2 @@
1
+ export { AuditTimeline, CancellationSummary, PaginationBar, PriceBadge, RelativeTimestamp, SearchInput, StatusBadge, StatusTimeline } from './chunk-A4T7OOIY.js';
2
+ import './chunk-G74PKSW3.js';
@@ -0,0 +1,346 @@
1
+ 'use strict';
2
+
3
+ // src/status-map.json
4
+ var status_map_default = {
5
+ domains: {
6
+ subscription: {
7
+ future: {
8
+ description: "Subscription is scheduled but not yet active.",
9
+ chip: {
10
+ foreground: "color.text.info",
11
+ background: "color.background.info.subtle",
12
+ border: "color.border.info",
13
+ icon: "icon.status.scheduled"
14
+ },
15
+ banner: {
16
+ foreground: "color.text.info",
17
+ background: "color.background.surface.default",
18
+ border: "color.border.info",
19
+ icon: "icon.status.scheduled"
20
+ }
21
+ },
22
+ trialing: {
23
+ description: "Subscription is in a trial period before billing begins.",
24
+ chip: {
25
+ foreground: "color.text.accent",
26
+ background: "color.background.accent.subtle",
27
+ border: "color.border.accent",
28
+ icon: "icon.status.trial"
29
+ },
30
+ banner: {
31
+ foreground: "color.text.accent",
32
+ background: "color.background.surface.default",
33
+ border: "color.border.accent",
34
+ icon: "icon.status.trial"
35
+ }
36
+ },
37
+ active: {
38
+ description: "Subscription is paid and service is provisioned.",
39
+ chip: {
40
+ foreground: "color.text.positive",
41
+ background: "color.background.positive.subtle",
42
+ border: "color.border.positive",
43
+ icon: "icon.status.success"
44
+ },
45
+ banner: {
46
+ foreground: "color.text.positive",
47
+ background: "color.background.surface.default",
48
+ border: "color.border.positive",
49
+ icon: "icon.status.success"
50
+ }
51
+ },
52
+ paused: {
53
+ description: "Billing paused temporarily by finance or customer request.",
54
+ chip: {
55
+ foreground: "color.text.neutral",
56
+ background: "color.background.neutral.subtle",
57
+ border: "color.border.neutral",
58
+ icon: "icon.status.paused"
59
+ },
60
+ banner: {
61
+ foreground: "color.text.neutral",
62
+ background: "color.background.surface.muted",
63
+ border: "color.border.neutral",
64
+ icon: "icon.status.paused"
65
+ }
66
+ },
67
+ pending_cancellation: {
68
+ description: "Subscription will cancel at period end but remains active now.",
69
+ chip: {
70
+ foreground: "color.text.info",
71
+ background: "color.background.info.subtle",
72
+ border: "color.border.info",
73
+ icon: "icon.status.pending"
74
+ },
75
+ banner: {
76
+ foreground: "color.text.info",
77
+ background: "color.background.surface.default",
78
+ border: "color.border.info",
79
+ icon: "icon.status.pending"
80
+ }
81
+ },
82
+ past_due: {
83
+ description: "Renewal payment failed; smart retries ongoing and access retained during the grace window.",
84
+ chip: {
85
+ foreground: "color.text.danger",
86
+ background: "color.background.danger.subtle",
87
+ border: "color.border.danger",
88
+ icon: "icon.status.warning"
89
+ },
90
+ banner: {
91
+ foreground: "color.text.onbold",
92
+ background: "color.background.danger.bold",
93
+ border: "color.border.danger",
94
+ icon: "icon.status.warning"
95
+ }
96
+ },
97
+ unpaid: {
98
+ description: "Payment retries exhausted; service access revoked.",
99
+ chip: {
100
+ foreground: "color.text.danger",
101
+ background: "color.background.danger.subtle",
102
+ border: "color.border.danger",
103
+ icon: "icon.status.error"
104
+ },
105
+ banner: {
106
+ foreground: "color.text.onbold",
107
+ background: "color.background.danger.bold",
108
+ border: "color.border.danger",
109
+ icon: "icon.status.error"
110
+ }
111
+ },
112
+ terminated: {
113
+ description: "Subscription ended; service access revoked and billing stopped.",
114
+ chip: {
115
+ foreground: "color.text.disabled",
116
+ background: "color.background.disabled",
117
+ border: "color.border.disabled",
118
+ icon: "icon.status.canceled"
119
+ },
120
+ banner: {
121
+ foreground: "color.text.neutral",
122
+ background: "color.background.neutral.subtle",
123
+ border: "color.border.neutral",
124
+ icon: "icon.status.canceled"
125
+ }
126
+ }
127
+ },
128
+ invoice: {
129
+ draft: {
130
+ description: "Invoice is editable and not yet finalized.",
131
+ chip: {
132
+ foreground: "color.text.neutral",
133
+ background: "color.background.neutral.subtle",
134
+ border: "color.border.neutral",
135
+ icon: "icon.status.draft"
136
+ },
137
+ banner: {
138
+ foreground: "color.text.neutral",
139
+ background: "color.background.surface.muted",
140
+ border: "color.border.neutral",
141
+ icon: "icon.status.draft"
142
+ }
143
+ },
144
+ posted: {
145
+ description: "Invoice finalized with terms before collection.",
146
+ chip: {
147
+ foreground: "color.text.info",
148
+ background: "color.background.info.subtle",
149
+ border: "color.border.info",
150
+ icon: "icon.status.pending"
151
+ },
152
+ banner: {
153
+ foreground: "color.text.info",
154
+ background: "color.background.surface.default",
155
+ border: "color.border.info",
156
+ icon: "icon.status.pending"
157
+ }
158
+ },
159
+ paid: {
160
+ description: "Invoice collected successfully in full.",
161
+ chip: {
162
+ foreground: "color.text.positive",
163
+ background: "color.background.positive.subtle",
164
+ border: "color.border.positive",
165
+ icon: "icon.status.success"
166
+ },
167
+ banner: {
168
+ foreground: "color.text.positive",
169
+ background: "color.background.surface.default",
170
+ border: "color.border.positive",
171
+ icon: "icon.status.success"
172
+ }
173
+ },
174
+ past_due: {
175
+ description: "Invoice is unpaid past its due date.",
176
+ chip: {
177
+ foreground: "color.text.danger",
178
+ background: "color.background.danger.subtle",
179
+ border: "color.border.danger",
180
+ icon: "icon.status.error"
181
+ },
182
+ banner: {
183
+ foreground: "color.text.onbold",
184
+ background: "color.background.danger.bold",
185
+ border: "color.border.danger",
186
+ icon: "icon.status.error"
187
+ }
188
+ },
189
+ void: {
190
+ description: "Invoice canceled and no longer payable.",
191
+ chip: {
192
+ foreground: "color.text.disabled",
193
+ background: "color.background.disabled",
194
+ border: "color.border.disabled",
195
+ icon: "icon.status.void"
196
+ },
197
+ banner: {
198
+ foreground: "color.text.neutral",
199
+ background: "color.background.neutral.subtle",
200
+ border: "color.border.neutral",
201
+ icon: "icon.status.void"
202
+ }
203
+ }
204
+ }
205
+ }
206
+ };
207
+
208
+ // src/status.ts
209
+ var TONE_ALIASES = {
210
+ info: "info",
211
+ informational: "info",
212
+ accent: "accent",
213
+ highlight: "accent",
214
+ positive: "success",
215
+ success: "success",
216
+ ok: "success",
217
+ warning: "warning",
218
+ caution: "warning",
219
+ danger: "critical",
220
+ critical: "critical",
221
+ error: "critical",
222
+ negative: "critical",
223
+ neutral: "neutral",
224
+ pending: "info"
225
+ };
226
+ var toLabel = (status) => status.split(/[_-]/).filter(Boolean).map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join(" ");
227
+ var inferTone = (entry) => {
228
+ if (!entry) return "neutral";
229
+ for (const reference of [entry.foreground, entry.background, entry.border]) {
230
+ const segments = reference.replace(/^\{|\}$/g, "").split(/[\s./_-]+/).reverse();
231
+ for (const segment of segments) {
232
+ const tone = TONE_ALIASES[segment.toLowerCase()];
233
+ if (tone) return tone;
234
+ }
235
+ }
236
+ return "neutral";
237
+ };
238
+ var componentTokenSet = (tone) => {
239
+ const normalized = tone === "positive" ? "success" : tone === "danger" ? "critical" : tone;
240
+ return {
241
+ background: `var(--sys-status-${normalized}-surface)`,
242
+ border: `var(--sys-status-${normalized}-border)`,
243
+ foreground: `var(--sys-status-${normalized}-text)`
244
+ };
245
+ };
246
+ var rawTokenSet = (entry) => {
247
+ const tone = inferTone(entry);
248
+ return componentTokenSet(tone);
249
+ };
250
+ var bannerFallback = (tone) => tone === "neutral" ? {
251
+ background: "var(--cmp-banner-background)",
252
+ border: "var(--cmp-banner-border)",
253
+ foreground: "var(--cmp-banner-text)"
254
+ } : componentTokenSet(tone);
255
+ var fallback = (domain, status, tone = "neutral") => ({
256
+ domain,
257
+ status,
258
+ label: toLabel(status || "Unknown"),
259
+ description: "Status not found in registry; falling back to the requested token set.",
260
+ tone,
261
+ badge: { subtle: componentTokenSet(tone), solid: componentTokenSet(tone) },
262
+ banner: { subtle: bannerFallback(tone), solid: componentTokenSet(tone) }
263
+ });
264
+ var registry = /* @__PURE__ */ new Map();
265
+ for (const [domain, entries] of Object.entries(status_map_default.domains)) {
266
+ const domainEntries = /* @__PURE__ */ new Map();
267
+ for (const [status, entry] of Object.entries(entries)) {
268
+ const tone = inferTone(entry.chip);
269
+ domainEntries.set(status.toLowerCase(), {
270
+ domain,
271
+ status,
272
+ label: toLabel(status),
273
+ description: entry.description,
274
+ tone,
275
+ iconName: entry.chip.icon ?? entry.banner?.icon,
276
+ badge: { subtle: rawTokenSet(entry.chip), solid: componentTokenSet(tone) },
277
+ banner: {
278
+ subtle: entry.banner ? rawTokenSet(entry.banner) : bannerFallback(tone),
279
+ solid: componentTokenSet(tone)
280
+ }
281
+ });
282
+ }
283
+ registry.set(domain, domainEntries);
284
+ }
285
+ var LEGACY_STATUS_ALIASES = {
286
+ subscription: { delinquent: "unpaid" }
287
+ };
288
+ var STATUS_DOMAINS = Object.freeze([...registry.keys()]);
289
+ function getStatusPresentation(domain, status) {
290
+ const entries = registry.get(domain);
291
+ if (!entries) return fallback(domain, status);
292
+ const normalized = status.toLowerCase();
293
+ const direct = entries.get(normalized);
294
+ if (direct) return direct;
295
+ const alias = LEGACY_STATUS_ALIASES[domain]?.[normalized];
296
+ const aliased = alias ? entries.get(alias) : void 0;
297
+ return aliased ? { ...aliased, status, label: toLabel(status) } : fallback(domain, status);
298
+ }
299
+ function listStatuses(domain) {
300
+ return [...registry.get(domain)?.values() ?? []];
301
+ }
302
+ function getToneTokenSet(tone) {
303
+ return componentTokenSet(tone);
304
+ }
305
+ function getBannerToneTokenSet(tone) {
306
+ return bannerFallback(tone);
307
+ }
308
+ var ICON_GLYPHS = {
309
+ success: "\u2714\uFE0E",
310
+ warning: "\u26A0\uFE0E",
311
+ critical: "\u2A2F",
312
+ danger: "\u2A2F",
313
+ error: "\u2A2F",
314
+ negative: "\u2A2F",
315
+ pending: "\u2026",
316
+ processing: "\u27F3",
317
+ paused: "\u23F8",
318
+ canceled: "\u2205",
319
+ cancelled: "\u2205",
320
+ draft: "\u270E",
321
+ void: "\u2205",
322
+ paid: "\u2714\uFE0E",
323
+ info: "\u2139\uFE0E",
324
+ trial: "\u2605",
325
+ future: "\u23F2",
326
+ scheduled: "\u23F2",
327
+ refunded: "\u21BA",
328
+ locked: "\u{1F512}",
329
+ unlocked: "\u{1F513}",
330
+ default: "\u2022"
331
+ };
332
+ function resolveStatusGlyph(iconName) {
333
+ const segment = iconName?.split(".").pop()?.toLowerCase();
334
+ return segment ? ICON_GLYPHS[segment] ?? ICON_GLYPHS.default : void 0;
335
+ }
336
+ function defaultStatusGlyph() {
337
+ return ICON_GLYPHS.default;
338
+ }
339
+
340
+ exports.STATUS_DOMAINS = STATUS_DOMAINS;
341
+ exports.defaultStatusGlyph = defaultStatusGlyph;
342
+ exports.getBannerToneTokenSet = getBannerToneTokenSet;
343
+ exports.getStatusPresentation = getStatusPresentation;
344
+ exports.getToneTokenSet = getToneTokenSet;
345
+ exports.listStatuses = listStatuses;
346
+ exports.resolveStatusGlyph = resolveStatusGlyph;