@gridui/progress 0.0.0-stage → 0.0.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/README.md CHANGED
@@ -1,3 +1,8 @@
1
- # Temporary Holding Version
1
+ # @gridui/progress
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Core family. Public API: `Progress`, `ProgressProps`.
4
+
5
+ Import components from `@gridui/progress` and load `@gridui/progress/styles.css` after Theme.
6
+ Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
7
+
8
+ See [component ownership](../../docs/component-ownership.md) and [release history](.changeset/history/).
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Progress
4
+ * @namespace Root
5
+ * @description Index
6
+ */
7
+ export type { ProgressProps } from "./progress/progress";
8
+ export { Progress } from "./progress/progress";
package/dist/index.js ADDED
@@ -0,0 +1,41 @@
1
+ // src/progress/progress.tsx
2
+ import { cn } from "@gridui/style-utils";
3
+ import * as Primitive from "@radix-ui/react-progress";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var Progress = (props) => {
6
+ const { value, max = 100, className, "aria-valuetext": valueText, ...restProps } = props;
7
+ if (!Number.isFinite(max) || max <= 0) {
8
+ throw new RangeError("Progress max must be a finite positive number.");
9
+ }
10
+ const normalized = value === null || !Number.isFinite(value) ? null : Math.min(max, Math.max(0, value));
11
+ return /* @__PURE__ */ jsx(
12
+ Primitive.Root,
13
+ {
14
+ ...restProps,
15
+ value: normalized,
16
+ max,
17
+ getValueLabel: () => {
18
+ return valueText ?? "";
19
+ },
20
+ "aria-valuetext": valueText,
21
+ className: cn("gridui-progress", className),
22
+ children: /* @__PURE__ */ jsx(
23
+ "div",
24
+ {
25
+ className: "gridui-progress-track",
26
+ children: /* @__PURE__ */ jsx(
27
+ Primitive.Indicator,
28
+ {
29
+ className: "gridui-progress-indicator",
30
+ style: normalized === null ? void 0 : { width: `${normalized / max * 100}%` }
31
+ }
32
+ )
33
+ }
34
+ )
35
+ }
36
+ );
37
+ };
38
+ export {
39
+ Progress
40
+ };
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/progress/progress.tsx"],
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Progress\n * @namespace Progress\n * @description Progress\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-progress\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ProgressProps = Omit<ComponentPropsWithRef<\"div\">,\n \"children\" | \"role\" | \"aria-valuemin\" | \"aria-valuemax\" | \"aria-valuenow\"> & {\n readonly value: number | null;\n readonly max?: number;\n };\n\nexport const Progress: FC<ProgressProps> = (props: ProgressProps) => {\n const { value, max = 100, className, \"aria-valuetext\": valueText, ...restProps } = props;\n if (!Number.isFinite(max) || max <= 0) {\n throw new RangeError(\"Progress max must be a finite positive number.\");\n }\n const normalized = value === null || !Number.isFinite(value) ? null : Math.min(max, Math.max(0, value));\n return (<Primitive.Root\n {...restProps}\n value={normalized}\n max={max}\n getValueLabel={() => {\n return valueText ?? \"\";\n }}\n aria-valuetext={valueText}\n className={cn(\"gridui-progress\", className)}\n >\n <div\n className=\"gridui-progress-track\"\n >\n <Primitive.Indicator\n className=\"gridui-progress-indicator\"\n style={normalized === null ? undefined : { width: `${normalized / max * 100}%` }}\n />\n </div>\n </Primitive.Root>);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,UAAU;AACnB,YAAY,eAAe;AA4Bf;AAnBL,IAAM,WAA8B,CAAC,UAAyB;AACjE,QAAM,EAAE,OAAO,MAAM,KAAK,WAAW,kBAAkB,WAAW,GAAG,UAAU,IAAI;AACnF,MAAI,CAAC,OAAO,SAAS,GAAG,KAAK,OAAO,GAAG;AACnC,UAAM,IAAI,WAAW,gDAAgD;AAAA,EACzE;AACA,QAAM,aAAa,UAAU,QAAQ,CAAC,OAAO,SAAS,KAAK,IAAI,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC;AACtG,SAAQ;AAAA,IAAW;AAAA,IAAV;AAAA,MACJ,GAAG;AAAA,MACJ,OAAO;AAAA,MACP;AAAA,MACA,eAAe,MAAM;AACjB,eAAO,aAAa;AAAA,MACxB;AAAA,MACA,kBAAgB;AAAA,MAChB,WAAW,GAAG,mBAAmB,SAAS;AAAA,MAE1C;AAAA,QAAC;AAAA;AAAA,UACG,WAAU;AAAA,UAEV;AAAA,YAAW;AAAA,YAAV;AAAA,cACG,WAAU;AAAA,cACV,OAAO,eAAe,OAAO,SAAY,EAAE,OAAO,GAAG,aAAa,MAAM,GAAG,IAAI;AAAA;AAAA,UACnF;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Progress
4
+ * @namespace Progress
5
+ * @description Progress
6
+ */
7
+ import type { ComponentPropsWithRef, FC } from "react";
8
+ export type ProgressProps = Omit<ComponentPropsWithRef<"div">, "children" | "role" | "aria-valuemin" | "aria-valuemax" | "aria-valuenow"> & {
9
+ readonly value: number | null;
10
+ readonly max?: number;
11
+ };
12
+ export declare const Progress: FC<ProgressProps>;
@@ -0,0 +1,45 @@
1
+ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
+ @layer theme, base, components, utilities;
3
+ @layer utilities;
4
+ @layer components {
5
+ .gridui-progress {
6
+ min-width: 0;
7
+ width: 100%;
8
+ }
9
+ .gridui-progress-track {
10
+ position: relative;
11
+ height: var(--gridui-space-8);
12
+ overflow: hidden;
13
+ background: var(--gridui-surface);
14
+ }
15
+ .gridui-progress-indicator {
16
+ height: 100%;
17
+ background: var(--gridui-accent-background);
18
+ transition: width var(--gridui-motion-duration-quick) var(--gridui-motion-ease-out);
19
+ }
20
+ .gridui-progress-indicator[data-state="indeterminate"] {
21
+ --gridui-progress-travel: 150%;
22
+ width: 40%;
23
+ animation: gridui-progress-travel var(--gridui-motion-duration-loop) var(--gridui-motion-ease-in-out) infinite alternate;
24
+ }
25
+ .gridui-progress-indicator[data-state="indeterminate"]:dir(rtl) {
26
+ --gridui-progress-travel: -150%;
27
+ }
28
+ @keyframes gridui-progress-travel {
29
+ from {
30
+ transform: translateX(0);
31
+ }
32
+ to {
33
+ transform: translateX(var(--gridui-progress-travel));
34
+ }
35
+ }
36
+ @media (prefers-reduced-motion: reduce) {
37
+ .gridui-progress-indicator {
38
+ transition: none;
39
+ }
40
+ .gridui-progress-indicator[data-state="indeterminate"] {
41
+ animation: none;
42
+ margin-inline-start: 30%;
43
+ }
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,6 +1,51 @@
1
1
  {
2
2
  "name": "@gridui/progress",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.0",
4
+ "description": "GridUI React progress",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "files": [
8
+ "dist",
9
+ "README.md"
10
+ ],
11
+ "sideEffects": [
12
+ "**/*.css"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./styles.css": "./dist/styles.css"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "peerDependencies": {
25
+ "react": "^19.2.0",
26
+ "react-dom": "^19.2.0"
27
+ },
28
+ "dependencies": {
29
+ "@gridui/style-utils": "^2.1.2",
30
+ "@gridui/theme": "^2.1.2",
31
+ "@radix-ui/react-progress": "1.2.1"
32
+ },
33
+ "devDependencies": {
34
+ "@gridui-internal/configuration": "0.0.0",
35
+ "@jest/globals": "30.5.2",
36
+ "@types/jest": "30.0.0",
37
+ "@types/node": "26.6.5",
38
+ "@types/react": "19.3.0",
39
+ "@types/react-dom": "19.3.0",
40
+ "jest": "30.5.2",
41
+ "react": "19.3.1",
42
+ "react-dom": "19.3.1",
43
+ "typescript": "6.0.3"
44
+ },
45
+ "scripts": {
46
+ "build": "node ../../scripts/compilation/package.ts",
47
+ "compile": "tsc --project tsconfig.json",
48
+ "test": "jest",
49
+ "coverage": "jest --coverage"
50
+ }
6
51
  }