@extrachill/components 0.4.0 → 0.4.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.2] - 2026-03-25
4
+
5
+ ### Changed
6
+ - Add mobile edge-to-edge behavior for shared panels
7
+
8
+ ## [0.4.1] - 2026-03-25
9
+
10
+ ### Changed
11
+ - add shared badge primitive
12
+
3
13
  ## [0.2.0] - 2026-03-25
4
14
 
5
15
  ### Changed
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface BadgeProps {
3
+ children: ReactNode;
4
+ tone?: 'default' | 'muted' | 'success' | 'error' | 'warning' | 'info';
5
+ variant?: 'solid' | 'outline' | 'subtle';
6
+ size?: 'sm' | 'md';
7
+ className?: string;
8
+ classPrefix?: string;
9
+ }
10
+ export declare function Badge({ children, tone, variant, size, className, classPrefix, }: BadgeProps): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=Badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../src/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,UAAU;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACtE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;IACzC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,KAAK,CAAE,EACtB,QAAQ,EACR,IAAgB,EAChB,OAAkB,EAClB,IAAW,EACX,SAAc,EACd,WAAwB,GACxB,EAAE,UAAU,2CAUZ"}
package/dist/Badge.js ADDED
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function Badge({ children, tone = 'default', variant = 'subtle', size = 'sm', className = '', classPrefix = 'ec-badge', }) {
3
+ const classes = [
4
+ classPrefix,
5
+ `${classPrefix}--${tone}`,
6
+ `${classPrefix}--${variant}`,
7
+ `${classPrefix}--${size}`,
8
+ className,
9
+ ].filter(Boolean).join(' ');
10
+ return _jsx("span", { className: classes, children: children });
11
+ }
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export { PanelHeader, type PanelHeaderProps } from './PanelHeader.tsx';
13
13
  export { ActionRow, type ActionRowProps } from './ActionRow.tsx';
14
14
  export { FieldGroup, type FieldGroupProps } from './FieldGroup.tsx';
15
15
  export { InlineStatus, type InlineStatusProps } from './InlineStatus.tsx';
16
+ export { Badge, type BadgeProps } from './Badge.tsx';
16
17
  export { ImagePreview, type ImagePreviewProps } from './ImagePreview.tsx';
17
18
  export { MediaField, type MediaFieldProps } from './MediaField.tsx';
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,KA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EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -13,5 +13,6 @@ export { PanelHeader } from "./PanelHeader.js";
13
13
  export { ActionRow } from "./ActionRow.js";
14
14
  export { FieldGroup } from "./FieldGroup.js";
15
15
  export { InlineStatus } from "./InlineStatus.js";
16
+ export { Badge } from "./Badge.js";
16
17
  export { ImagePreview } from "./ImagePreview.js";
17
18
  export { MediaField } from "./MediaField.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrachill/components",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Shared React components for the Extra Chill Platform.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/Badge.tsx ADDED
@@ -0,0 +1,29 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export interface BadgeProps {
4
+ children: ReactNode;
5
+ tone?: 'default' | 'muted' | 'success' | 'error' | 'warning' | 'info';
6
+ variant?: 'solid' | 'outline' | 'subtle';
7
+ size?: 'sm' | 'md';
8
+ className?: string;
9
+ classPrefix?: string;
10
+ }
11
+
12
+ export function Badge( {
13
+ children,
14
+ tone = 'default',
15
+ variant = 'subtle',
16
+ size = 'sm',
17
+ className = '',
18
+ classPrefix = 'ec-badge',
19
+ }: BadgeProps ) {
20
+ const classes = [
21
+ classPrefix,
22
+ `${ classPrefix }--${ tone }`,
23
+ `${ classPrefix }--${ variant }`,
24
+ `${ classPrefix }--${ size }`,
25
+ className,
26
+ ].filter( Boolean ).join( ' ' );
27
+
28
+ return <span className={ classes }>{ children }</span>;
29
+ }
package/src/index.tsx CHANGED
@@ -14,5 +14,6 @@ export { PanelHeader, type PanelHeaderProps } from './PanelHeader.tsx';
14
14
  export { ActionRow, type ActionRowProps } from './ActionRow.tsx';
15
15
  export { FieldGroup, type FieldGroupProps } from './FieldGroup.tsx';
16
16
  export { InlineStatus, type InlineStatusProps } from './InlineStatus.tsx';
17
+ export { Badge, type BadgeProps } from './Badge.tsx';
17
18
  export { ImagePreview, type ImagePreviewProps } from './ImagePreview.tsx';
18
19
  export { MediaField, type MediaFieldProps } from './MediaField.tsx';
@@ -249,6 +249,32 @@
249
249
  color: #004085;
250
250
  }
251
251
 
252
+ // Mobile edge-to-edge panel principle
253
+ // Matches the established theme pattern: small phone screens go full-width,
254
+ // drop rounded corners, and reduce wasted side space.
255
+ @media screen and (max-width: 480px) {
256
+ .ec-panel {
257
+ border-radius: 0;
258
+ padding: var(--spacing-sm, 0.5rem) 0;
259
+ margin-left: calc(var(--spacing-md, 1rem) * -1);
260
+ margin-right: calc(var(--spacing-md, 1rem) * -1);
261
+ padding-left: var(--spacing-md, 1rem);
262
+ padding-right: var(--spacing-md, 1rem);
263
+ }
264
+
265
+ .ec-panel-header {
266
+ padding-bottom: var(--spacing-sm, 0.5rem);
267
+ }
268
+
269
+ .ec-action-row {
270
+ align-items: stretch;
271
+ }
272
+
273
+ .ec-action-row > * {
274
+ max-width: 100%;
275
+ }
276
+ }
277
+
252
278
  // Image Preview
253
279
  .ec-image-preview {
254
280
  display: inline-flex;
@@ -313,33 +339,133 @@
313
339
  margin-top: 0;
314
340
  }
315
341
 
316
- // Badges (commonly used with tables)
342
+ // Badges
317
343
  .ec-badge {
318
- display: inline-block;
344
+ display: inline-flex;
345
+ align-items: center;
346
+ gap: var(--spacing-xs, 0.25rem);
319
347
  padding: 3px 8px;
320
- border-radius: 3px;
321
- font-size: 12px;
348
+ border-radius: var(--border-radius-pill, 999px);
349
+ font-size: var(--font-size-xs, 0.75rem);
322
350
  font-weight: 500;
351
+ line-height: 1;
352
+ text-decoration: none;
353
+ border: 1px solid transparent;
354
+ box-sizing: border-box;
355
+ }
323
356
 
324
- &--yes,
325
- &--success {
326
- background: #d4edda;
327
- color: #155724;
328
- }
357
+ .ec-badge--sm {
358
+ padding: 2px 8px;
359
+ }
329
360
 
330
- &--no,
331
- &--error {
332
- background: #f8d7da;
333
- color: #721c24;
334
- }
361
+ .ec-badge--md {
362
+ padding: var(--spacing-xs, 0.25rem) var(--spacing-sm, 0.5rem);
363
+ font-size: var(--font-size-sm, 0.875rem);
364
+ }
335
365
 
336
- &--info {
337
- background: #cce5ff;
338
- color: #004085;
339
- }
366
+ .ec-badge--default.ec-badge--subtle {
367
+ background: var(--card-background, #f8f8f8);
368
+ color: var(--link-color, #1a1a1a);
369
+ border-color: var(--border-color, #ddd);
370
+ }
340
371
 
341
- &--warning {
342
- background: #fff3cd;
343
- color: #856404;
344
- }
372
+ .ec-badge--muted.ec-badge--subtle {
373
+ background: var(--border-color, #ddd);
374
+ color: var(--muted-text, #666);
375
+ border-color: var(--border-color, #ddd);
376
+ }
377
+
378
+ .ec-badge--success.ec-badge--subtle,
379
+ .ec-badge--yes.ec-badge--subtle {
380
+ background: #d4edda;
381
+ color: #155724;
382
+ border-color: #c3e6cb;
383
+ }
384
+
385
+ .ec-badge--error.ec-badge--subtle,
386
+ .ec-badge--no.ec-badge--subtle {
387
+ background: #f8d7da;
388
+ color: #721c24;
389
+ border-color: #f5c6cb;
390
+ }
391
+
392
+ .ec-badge--info.ec-badge--subtle {
393
+ background: #cce5ff;
394
+ color: #004085;
395
+ border-color: #b8daff;
396
+ }
397
+
398
+ .ec-badge--warning.ec-badge--subtle {
399
+ background: #fff3cd;
400
+ color: #856404;
401
+ border-color: #ffeeba;
402
+ }
403
+
404
+ .ec-badge--default.ec-badge--outline,
405
+ .ec-badge--muted.ec-badge--outline,
406
+ .ec-badge--success.ec-badge--outline,
407
+ .ec-badge--error.ec-badge--outline,
408
+ .ec-badge--warning.ec-badge--outline,
409
+ .ec-badge--info.ec-badge--outline {
410
+ background: transparent;
411
+ }
412
+
413
+ .ec-badge--default.ec-badge--outline {
414
+ color: var(--link-color, #1a1a1a);
415
+ border-color: var(--border-color, #ddd);
416
+ }
417
+
418
+ .ec-badge--muted.ec-badge--outline {
419
+ color: var(--muted-text, #666);
420
+ border-color: var(--border-color, #ddd);
421
+ }
422
+
423
+ .ec-badge--success.ec-badge--outline {
424
+ color: #155724;
425
+ border-color: #c3e6cb;
426
+ }
427
+
428
+ .ec-badge--error.ec-badge--outline {
429
+ color: #721c24;
430
+ border-color: #f5c6cb;
431
+ }
432
+
433
+ .ec-badge--warning.ec-badge--outline {
434
+ color: #856404;
435
+ border-color: #ffeeba;
436
+ }
437
+
438
+ .ec-badge--info.ec-badge--outline {
439
+ color: #004085;
440
+ border-color: #b8daff;
441
+ }
442
+
443
+ .ec-badge--default.ec-badge--solid {
444
+ background: var(--link-color, #1a1a1a);
445
+ color: var(--button-text-color, #fff);
446
+ }
447
+
448
+ .ec-badge--muted.ec-badge--solid {
449
+ background: var(--muted-text, #666);
450
+ color: var(--background-color, #fff);
451
+ }
452
+
453
+ .ec-badge--success.ec-badge--solid {
454
+ background: var(--accent, #53940b);
455
+ color: var(--background-color, #fff);
456
+ }
457
+
458
+ .ec-badge--error.ec-badge--solid {
459
+ background: var(--error-color, #dc3232);
460
+ color: var(--background-color, #fff);
461
+ }
462
+
463
+ .ec-badge--warning.ec-badge--solid {
464
+ background: #f0ad4e;
465
+ color: #000;
466
+ }
467
+
468
+ .ec-badge--info.ec-badge--solid {
469
+ background: #0d6efd;
470
+ color: #fff;
345
471
  }