@plexui/ui 0.10.0 → 0.11.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,14 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import clsx from "clsx";
4
+ import {} from "react";
5
+ import { Progress as RadixProgress } from "radix-ui";
6
+ import s from "./Progress.module.css";
7
+ export const Progress = ({ value = null, max = 100, className, ...restProps }) => {
8
+ const resolved = value == null ? null : Math.max(0, Math.min(max, value));
9
+ const percentage = resolved == null ? null : (resolved / max) * 100;
10
+ return (_jsx(RadixProgress.Root, { value: resolved, max: max, className: clsx(s.Root, className), ...restProps, children: _jsx(RadixProgress.Indicator, { className: s.Indicator, style: {
11
+ transform: percentage == null ? undefined : `translateX(-${100 - percentage}%)`,
12
+ }, "data-indeterminate": percentage == null ? "" : undefined }) }));
13
+ };
14
+ //# sourceMappingURL=Progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Progress.js","sourceRoot":"","sources":["../../../../src/components/Progress/Progress.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAuB,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,CAAC,MAAM,uBAAuB,CAAA;AAmBrC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EACvB,KAAK,GAAG,IAAI,EACZ,GAAG,GAAG,GAAG,EACT,SAAS,EACT,GAAG,SAAS,EACE,EAAE,EAAE;IAClB,MAAM,QAAQ,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;IACzE,MAAM,UAAU,GAAG,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,GAAG,CAAA;IAEnE,OAAO,CACL,KAAC,aAAa,CAAC,IAAI,IACjB,KAAK,EAAE,QAAQ,EACf,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,KAC9B,SAAS,YAEb,KAAC,aAAa,CAAC,SAAS,IACtB,SAAS,EAAE,CAAC,CAAC,SAAS,EACtB,KAAK,EAAE;gBACL,SAAS,EACP,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,GAAG,GAAG,UAAU,IAAI;aACvE,wBACmB,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,GACvD,GACiB,CACtB,CAAA;AACH,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { type ComponentProps } from \"react\"\nimport { Progress as RadixProgress } from \"radix-ui\"\nimport s from \"./Progress.module.css\"\n\nexport type ProgressProps = Omit<\n ComponentProps<typeof RadixProgress.Root>,\n \"children\"\n> & {\n /**\n * Current progress value, between `0` and `max`.\n * Omit (or pass `null`) for an indeterminate state.\n */\n value?: number | null\n /**\n * Maximum value.\n * @default 100\n */\n max?: number\n className?: string\n}\n\nexport const Progress = ({\n value = null,\n max = 100,\n className,\n ...restProps\n}: ProgressProps) => {\n const resolved = value == null ? null : Math.max(0, Math.min(max, value))\n const percentage = resolved == null ? null : (resolved / max) * 100\n\n return (\n <RadixProgress.Root\n value={resolved}\n max={max}\n className={clsx(s.Root, className)}\n {...restProps}\n >\n <RadixProgress.Indicator\n className={s.Indicator}\n style={{\n transform:\n percentage == null ? undefined : `translateX(-${100 - percentage}%)`,\n }}\n data-indeterminate={percentage == null ? \"\" : undefined}\n />\n </RadixProgress.Root>\n )\n}\n"]}
@@ -0,0 +1,33 @@
1
+ @layer components {.Root {
2
+ position: relative;
3
+ overflow: hidden;
4
+ width: 100%;
5
+ height: var(--progress-height);
6
+ background: var(--progress-track-color);
7
+ border-radius: var(--progress-radius);
8
+ /* Prevent accidental clipping of the translateX indicator */
9
+ transform: translateZ(0);
10
+ }.Indicator {
11
+ width: 100%;
12
+ height: 100%;
13
+ background: var(--progress-indicator-color);
14
+ transition: transform var(--progress-transition-duration) var(--progress-transition-ease);
15
+ }
16
+
17
+ /* Indeterminate — sweeping animation */
18
+ .Indicator:where([data-indeterminate]) {
19
+ transform: translateX(-100%);
20
+ animation: progress-sweep var(--progress-indeterminate-duration) ease-in-out infinite;
21
+ width: 40%;
22
+ }@keyframes progress-sweep {
23
+ 0% {
24
+ transform: translateX(-100%);
25
+ }
26
+ 50% {
27
+ transform: translateX(150%);
28
+ }
29
+ 100% {
30
+ transform: translateX(-100%);
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,2 @@
1
+ export { Progress } from "./Progress";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Progress/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,YAAY,CAAA","sourcesContent":["export { Progress, type ProgressProps } from \"./Progress\"\n"]}
@@ -110,6 +110,17 @@
110
110
  --label-font-weight: var(--font-weight-medium);
111
111
  --label-line-height: 1;
112
112
 
113
+ /* =============================================
114
+ Progress
115
+ ============================================= */
116
+ --progress-height: 4px;
117
+ --progress-radius: var(--radius-full);
118
+ --progress-track-color: var(--color-background-secondary-soft);
119
+ --progress-indicator-color: var(--color-text);
120
+ --progress-transition-duration: var(--transition-duration-basic);
121
+ --progress-transition-ease: var(--transition-ease-basic);
122
+ --progress-indeterminate-duration: 1.5s;
123
+
113
124
  /* =============================================
114
125
  Separator
115
126
  ============================================= */
@@ -0,0 +1,16 @@
1
+ import { type ComponentProps } from "react";
2
+ import { Progress as RadixProgress } from "radix-ui";
3
+ export type ProgressProps = Omit<ComponentProps<typeof RadixProgress.Root>, "children"> & {
4
+ /**
5
+ * Current progress value, between `0` and `max`.
6
+ * Omit (or pass `null`) for an indeterminate state.
7
+ */
8
+ value?: number | null;
9
+ /**
10
+ * Maximum value.
11
+ * @default 100
12
+ */
13
+ max?: number;
14
+ className?: string;
15
+ };
16
+ export declare const Progress: ({ value, max, className, ...restProps }: ProgressProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { Progress, type ProgressProps } from "./Progress";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/ui",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Modern design system for building high-quality applications",
5
5
  "type": "module",
6
6
  "license": "MIT",