@ttt-productions/ui-core 0.11.36 → 0.11.37

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.
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/react/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAG9D,UAAU,aAAc,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC;IAC3F,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,QAAA,MAAM,QAAQ,sFAgBb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/react/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAG9D,UAAU,aAAc,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC;IAC3F,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,QAAA,MAAM,QAAQ,sFAuBb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -3,7 +3,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from 'react';
4
4
  import * as ProgressPrimitive from '@radix-ui/react-progress';
5
5
  import { cn } from '../../lib/utils.js';
6
- const Progress = React.forwardRef(({ className, value, indicatorClassName, ...props }, ref) => (_jsx(ProgressPrimitive.Root, { ref: ref, className: cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className), ...props, children: _jsx(ProgressPrimitive.Indicator, { className: cn('h-full w-full flex-1 bg-primary transition-transform duration-[var(--motion-base)] ease-[var(--motion-ease)]', indicatorClassName), style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
6
+ const DEFAULT_MAX = 100;
7
+ const Progress = React.forwardRef(({ className, value, max = DEFAULT_MAX, indicatorClassName, ...props }, ref) => {
8
+ const known = typeof value === 'number' && Number.isFinite(value);
9
+ const clamped = known ? Math.min(Math.max(value, 0), max) : null;
10
+ const percent = clamped === null || max <= 0 ? 0 : (clamped / max) * 100;
11
+ return (_jsx(ProgressPrimitive.Root, { ref: ref, value: clamped, max: max, className: cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className), ...props, children: _jsx(ProgressPrimitive.Indicator, { className: cn('h-full w-full flex-1 bg-primary transition-transform duration-[var(--motion-base)] ease-[var(--motion-ease)]', indicatorClassName), style: { transform: `translateX(-${100 - percent}%)` } }) }));
12
+ });
7
13
  Progress.displayName = ProgressPrimitive.Root.displayName;
8
14
  export { Progress };
9
15
  //# sourceMappingURL=progress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/react/components/progress.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAMxC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC3D,KAAC,iBAAiB,CAAC,IAAI,IACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,+DAA+D,EAAE,SAAS,CAAC,KACrF,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,IAC1B,SAAS,EAAE,EAAE,CACX,8GAA8G,EAC9G,kBAAkB,CACnB,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,GAAG,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,EAAE,GAC3D,GACqB,CAC1B,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as ProgressPrimitive from '@radix-ui/react-progress';\nimport { cn } from '../../lib/utils.js';\n\ninterface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {\n indicatorClassName?: string;\n}\n\nconst Progress = React.forwardRef<React.ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n ({ className, value, indicatorClassName, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className={cn(\n 'h-full w-full flex-1 bg-primary transition-transform duration-[var(--motion-base)] ease-[var(--motion-ease)]',\n indicatorClassName,\n )}\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n ),\n);\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n"]}
1
+ {"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/react/components/progress.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAMxC,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,WAAW,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC7E,MAAM,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACjE,MAAM,OAAO,GAAG,OAAO,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACzE,OAAO,CACL,KAAC,iBAAiB,CAAC,IAAI,IACrB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,+DAA+D,EAAE,SAAS,CAAC,KACrF,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,IAC1B,SAAS,EAAE,EAAE,CACX,8GAA8G,EAC9G,kBAAkB,CACnB,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,GAAG,GAAG,OAAO,IAAI,EAAE,GACtD,GACqB,CAC1B,CAAC;AACJ,CAAC,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as ProgressPrimitive from '@radix-ui/react-progress';\nimport { cn } from '../../lib/utils.js';\n\ninterface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {\n indicatorClassName?: string;\n}\n\nconst DEFAULT_MAX = 100;\n\nconst Progress = React.forwardRef<React.ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n ({ className, value, max = DEFAULT_MAX, indicatorClassName, ...props }, ref) => {\n const known = typeof value === 'number' && Number.isFinite(value);\n const clamped = known ? Math.min(Math.max(value, 0), max) : null;\n const percent = clamped === null || max <= 0 ? 0 : (clamped / max) * 100;\n return (\n <ProgressPrimitive.Root\n ref={ref}\n value={clamped}\n max={max}\n className={cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className={cn(\n 'h-full w-full flex-1 bg-primary transition-transform duration-[var(--motion-base)] ease-[var(--motion-ease)]',\n indicatorClassName,\n )}\n style={{ transform: `translateX(-${100 - percent}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n },\n);\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/ui-core",
3
- "version": "0.11.36",
3
+ "version": "0.11.37",
4
4
  "description": "Shared UI components for TTT Productions projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,7 +53,7 @@
53
53
  "react-dom": ">=19.0.0",
54
54
  "react-hook-form": ">=7.0.0",
55
55
  "@hookform/resolvers": ">=3.0.0",
56
- "@ttt-productions/firebase-helpers": "^0.12.17",
56
+ "@ttt-productions/firebase-helpers": "^0.12.18",
57
57
  "lucide-react": "^1.30.0",
58
58
  "date-fns": ">=3.0.0"
59
59
  },
@@ -107,7 +107,7 @@
107
107
  "react-dom": "^19.2.0",
108
108
  "react-hook-form": "^7.69.0",
109
109
  "@hookform/resolvers": "^5.2.2",
110
- "@ttt-productions/firebase-helpers": "^0.12.17",
110
+ "@ttt-productions/firebase-helpers": "^0.12.18",
111
111
  "lucide-react": "^1.30.0",
112
112
  "date-fns": "^4.1.0"
113
113
  },