@gridui/steps 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 +33 -2
- package/dist/index.d.ts +8 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +7 -0
- package/dist/steps.d.ts +14 -0
- package/dist/styles.css +154 -0
- package/package.json +53 -3
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Steps
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@gridui/steps` renders a passive semantic ordered list. Import `Steps` and
|
|
4
|
+
`StepsProps` from the package root and load `@gridui/steps/styles.css` after the
|
|
5
|
+
shared theme. The package has no Controls, Data, Grid, or Layout dependency.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Steps orientation={{ base: "vertical", md: "horizontal" }} connector="line">
|
|
9
|
+
<li>Observe the work.</li>
|
|
10
|
+
<li>Agree on the scope.</li>
|
|
11
|
+
<li>Deliver the result.</li>
|
|
12
|
+
</Steps>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`orientation` accepts `vertical` or `horizontal`, including the existing
|
|
16
|
+
`Responsive<T>` shape at GridUI's 40rem and 64rem breakpoints. The default is
|
|
17
|
+
vertical. Horizontal lists use equal-width columns; callers choose a responsive
|
|
18
|
+
vertical layout when content needs more space.
|
|
19
|
+
|
|
20
|
+
`marker` accepts `decimal-leading-zero` (default), `decimal`, or `none`.
|
|
21
|
+
An explicitly provided marker overrides native `type` visually. Without a
|
|
22
|
+
marker prop, native `type` is honored when provided. `start`, `reversed`, and
|
|
23
|
+
`li[value]` keep native list-counter behavior. Removing decorative markers
|
|
24
|
+
preserves the ordered-list accessibility role.
|
|
25
|
+
|
|
26
|
+
`connector` accepts `none` (default) or `line`. Lines are decorative, follow the
|
|
27
|
+
orientation, and do not imply completion. Each child remains a native `li`;
|
|
28
|
+
applications own its content, typography, and business meaning. Native ol props,
|
|
29
|
+
ARIA attributes, className, style, and ref are forwarded. There is no active
|
|
30
|
+
step, completion state, click handler, or navigation model added by Steps.
|
|
31
|
+
|
|
32
|
+
## Release history
|
|
33
|
+
|
|
34
|
+
Package-owned records live in [.changeset/history](.changeset/history/).
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// src/steps.tsx
|
|
2
|
+
import { cn } from "@gridui/style-utils";
|
|
3
|
+
import { resolveResponsive } from "@gridui/style-utils/responsive";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var Steps = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
orientation = "vertical",
|
|
8
|
+
marker,
|
|
9
|
+
connector = "none",
|
|
10
|
+
type,
|
|
11
|
+
className,
|
|
12
|
+
role = "list",
|
|
13
|
+
...restProps
|
|
14
|
+
} = props;
|
|
15
|
+
const directions = resolveResponsive(orientation);
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
"ol",
|
|
18
|
+
{
|
|
19
|
+
...restProps,
|
|
20
|
+
role,
|
|
21
|
+
type,
|
|
22
|
+
className: cn("gridui-steps grid gap-gridui-16 m-0 p-0 text-muted", className),
|
|
23
|
+
"data-orientation": directions.base,
|
|
24
|
+
"data-orientation-md": directions.md,
|
|
25
|
+
"data-orientation-lg": directions.lg,
|
|
26
|
+
"data-marker": marker ?? (type ? "native" : "decimal-leading-zero"),
|
|
27
|
+
"data-connector": connector
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
Steps
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/steps.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Steps\n * @namespace Root\n * @description Steps\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { Responsive } from \"@gridui/style-utils/responsive\";\nimport { resolveResponsive } from \"@gridui/style-utils/responsive\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type StepsProps = ComponentPropsWithRef<\"ol\"> & {\n readonly orientation?: Responsive<\"vertical\" | \"horizontal\">;\n readonly marker?: \"decimal-leading-zero\" | \"decimal\" | \"none\";\n readonly connector?: \"none\" | \"line\";\n};\n\nexport const Steps: FC<StepsProps> = (props: StepsProps) => {\n const { orientation = \"vertical\", marker, connector = \"none\", type,\n className, role = \"list\", ...restProps } = props;\n const directions = resolveResponsive(orientation);\n return (<ol\n {...restProps}\n role={role}\n type={type}\n className={cn(\"gridui-steps grid gap-gridui-16 m-0 p-0 text-muted\", className)}\n data-orientation={directions.base}\n data-orientation-md={directions.md}\n data-orientation-lg={directions.lg}\n data-marker={marker ?? (type ? \"native\" : \"decimal-leading-zero\")}\n data-connector={connector}\n />);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,UAAU;AAEnB,SAAS,yBAAyB;AAatB;AAJL,IAAM,QAAwB,CAAC,UAAsB;AACxD,QAAM;AAAA,IAAE,cAAc;AAAA,IAAY;AAAA,IAAQ,YAAY;AAAA,IAAQ;AAAA,IAC1D;AAAA,IAAW,OAAO;AAAA,IAAQ,GAAG;AAAA,EAAU,IAAI;AAC/C,QAAM,aAAa,kBAAkB,WAAW;AAChD,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,WAAW,GAAG,sDAAsD,SAAS;AAAA,MAC7E,oBAAkB,WAAW;AAAA,MAC7B,uBAAqB,WAAW;AAAA,MAChC,uBAAqB,WAAW;AAAA,MAChC,eAAa,WAAW,OAAO,WAAW;AAAA,MAC1C,kBAAgB;AAAA;AAAA,EACpB;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/steps.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Steps
|
|
4
|
+
* @namespace Root
|
|
5
|
+
* @description Steps
|
|
6
|
+
*/
|
|
7
|
+
import type { Responsive } from "@gridui/style-utils/responsive";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type StepsProps = ComponentPropsWithRef<"ol"> & {
|
|
10
|
+
readonly orientation?: Responsive<"vertical" | "horizontal">;
|
|
11
|
+
readonly marker?: "decimal-leading-zero" | "decimal" | "none";
|
|
12
|
+
readonly connector?: "none" | "line";
|
|
13
|
+
};
|
|
14
|
+
export declare const Steps: FC<StepsProps>;
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer theme, base, components, utilities;
|
|
3
|
+
@layer utilities {
|
|
4
|
+
.m-0 {
|
|
5
|
+
margin: 0px;
|
|
6
|
+
}
|
|
7
|
+
.grid {
|
|
8
|
+
display: grid;
|
|
9
|
+
}
|
|
10
|
+
.gap-gridui-16 {
|
|
11
|
+
gap: var(--gridui-space-16);
|
|
12
|
+
}
|
|
13
|
+
.p-0 {
|
|
14
|
+
padding: 0px;
|
|
15
|
+
}
|
|
16
|
+
.text-muted {
|
|
17
|
+
color: var(--gridui-muted);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
@layer components {
|
|
21
|
+
.gridui-steps {
|
|
22
|
+
list-style-type: decimal-leading-zero;
|
|
23
|
+
grid-auto-flow: var(--gridui-steps-flow);
|
|
24
|
+
grid-auto-columns: var(--gridui-steps-columns);
|
|
25
|
+
}
|
|
26
|
+
.gridui-steps > li {
|
|
27
|
+
position: relative;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
padding-inline-start: var(--gridui-steps-padding-inline);
|
|
30
|
+
padding-block-start: var(--gridui-steps-padding-block);
|
|
31
|
+
overflow-wrap: anywhere;
|
|
32
|
+
}
|
|
33
|
+
.gridui-steps > li::marker {
|
|
34
|
+
content: "";
|
|
35
|
+
}
|
|
36
|
+
.gridui-steps > li::before {
|
|
37
|
+
position: absolute;
|
|
38
|
+
inset-inline-start: 0;
|
|
39
|
+
inset-block-start: 0;
|
|
40
|
+
color: var(--gridui-foreground);
|
|
41
|
+
font-family: var(--font-mono);
|
|
42
|
+
font-variant-numeric: tabular-nums;
|
|
43
|
+
content: counter(list-item, decimal-leading-zero);
|
|
44
|
+
}
|
|
45
|
+
.gridui-steps[data-marker="none"] > li::before {
|
|
46
|
+
content: none;
|
|
47
|
+
}
|
|
48
|
+
.gridui-steps[data-marker="decimal"] > li::before, .gridui-steps[data-marker="native"][type="1"] > li::before {
|
|
49
|
+
content: counter(list-item, decimal);
|
|
50
|
+
}
|
|
51
|
+
.gridui-steps[data-marker="native"][type="a"] > li::before {
|
|
52
|
+
content: counter(list-item, lower-alpha);
|
|
53
|
+
}
|
|
54
|
+
.gridui-steps[data-marker="native"][type="A"] > li::before {
|
|
55
|
+
content: counter(list-item, upper-alpha);
|
|
56
|
+
}
|
|
57
|
+
.gridui-steps[data-marker="native"][type="i"] > li::before {
|
|
58
|
+
content: counter(list-item, lower-roman);
|
|
59
|
+
}
|
|
60
|
+
.gridui-steps[data-marker="native"][type="I"] > li::before {
|
|
61
|
+
content: counter(list-item, upper-roman);
|
|
62
|
+
}
|
|
63
|
+
.gridui-steps[data-marker="none"][data-connector="none"] > li {
|
|
64
|
+
padding: 0;
|
|
65
|
+
}
|
|
66
|
+
.gridui-steps[data-connector="line"] > li:not(:last-child)::after {
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset-inline-start: var(--gridui-steps-line-start);
|
|
69
|
+
inset-inline-end: var(--gridui-steps-line-end);
|
|
70
|
+
inset-block-start: var(--gridui-steps-line-top);
|
|
71
|
+
inset-block-end: var(--gridui-steps-line-bottom);
|
|
72
|
+
width: var(--gridui-steps-line-width);
|
|
73
|
+
height: var(--gridui-steps-line-height);
|
|
74
|
+
background: var(--gridui-border);
|
|
75
|
+
content: "";
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
}
|
|
78
|
+
.gridui-steps[data-orientation="vertical"] {
|
|
79
|
+
--gridui-steps-flow: row;
|
|
80
|
+
--gridui-steps-columns: auto;
|
|
81
|
+
--gridui-steps-padding-inline: var(--gridui-space-48);
|
|
82
|
+
--gridui-steps-padding-block: 0;
|
|
83
|
+
--gridui-steps-line-start: 1ch;
|
|
84
|
+
--gridui-steps-line-end: auto;
|
|
85
|
+
--gridui-steps-line-top: calc(1lh + var(--gridui-space-4));
|
|
86
|
+
--gridui-steps-line-bottom: calc(-1 * var(--gridui-space-8));
|
|
87
|
+
--gridui-steps-line-width: 1px;
|
|
88
|
+
--gridui-steps-line-height: auto;
|
|
89
|
+
}
|
|
90
|
+
.gridui-steps[data-orientation="horizontal"] {
|
|
91
|
+
--gridui-steps-flow: column;
|
|
92
|
+
--gridui-steps-columns: minmax(0, 1fr);
|
|
93
|
+
--gridui-steps-padding-inline: 0;
|
|
94
|
+
--gridui-steps-padding-block: calc(1lh + var(--gridui-space-16));
|
|
95
|
+
--gridui-steps-line-start: 3ch;
|
|
96
|
+
--gridui-steps-line-end: 0;
|
|
97
|
+
--gridui-steps-line-top: 0.5lh;
|
|
98
|
+
--gridui-steps-line-bottom: auto;
|
|
99
|
+
--gridui-steps-line-width: auto;
|
|
100
|
+
--gridui-steps-line-height: 1px;
|
|
101
|
+
}
|
|
102
|
+
@media (min-width: 40rem) {
|
|
103
|
+
.gridui-steps[data-orientation-md="vertical"] {
|
|
104
|
+
--gridui-steps-flow: row;
|
|
105
|
+
--gridui-steps-columns: auto;
|
|
106
|
+
--gridui-steps-padding-inline: var(--gridui-space-48);
|
|
107
|
+
--gridui-steps-padding-block: 0;
|
|
108
|
+
--gridui-steps-line-start: 1ch;
|
|
109
|
+
--gridui-steps-line-end: auto;
|
|
110
|
+
--gridui-steps-line-top: calc(1lh + var(--gridui-space-4));
|
|
111
|
+
--gridui-steps-line-bottom: calc(-1 * var(--gridui-space-8));
|
|
112
|
+
--gridui-steps-line-width: 1px;
|
|
113
|
+
--gridui-steps-line-height: auto;
|
|
114
|
+
}
|
|
115
|
+
.gridui-steps[data-orientation-md="horizontal"] {
|
|
116
|
+
--gridui-steps-flow: column;
|
|
117
|
+
--gridui-steps-columns: minmax(0, 1fr);
|
|
118
|
+
--gridui-steps-padding-inline: 0;
|
|
119
|
+
--gridui-steps-padding-block: calc(1lh + var(--gridui-space-16));
|
|
120
|
+
--gridui-steps-line-start: 3ch;
|
|
121
|
+
--gridui-steps-line-end: 0;
|
|
122
|
+
--gridui-steps-line-top: 0.5lh;
|
|
123
|
+
--gridui-steps-line-bottom: auto;
|
|
124
|
+
--gridui-steps-line-width: auto;
|
|
125
|
+
--gridui-steps-line-height: 1px;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
@media (min-width: 64rem) {
|
|
129
|
+
.gridui-steps[data-orientation-lg="vertical"] {
|
|
130
|
+
--gridui-steps-flow: row;
|
|
131
|
+
--gridui-steps-columns: auto;
|
|
132
|
+
--gridui-steps-padding-inline: var(--gridui-space-48);
|
|
133
|
+
--gridui-steps-padding-block: 0;
|
|
134
|
+
--gridui-steps-line-start: 1ch;
|
|
135
|
+
--gridui-steps-line-end: auto;
|
|
136
|
+
--gridui-steps-line-top: calc(1lh + var(--gridui-space-4));
|
|
137
|
+
--gridui-steps-line-bottom: calc(-1 * var(--gridui-space-8));
|
|
138
|
+
--gridui-steps-line-width: 1px;
|
|
139
|
+
--gridui-steps-line-height: auto;
|
|
140
|
+
}
|
|
141
|
+
.gridui-steps[data-orientation-lg="horizontal"] {
|
|
142
|
+
--gridui-steps-flow: column;
|
|
143
|
+
--gridui-steps-columns: minmax(0, 1fr);
|
|
144
|
+
--gridui-steps-padding-inline: 0;
|
|
145
|
+
--gridui-steps-padding-block: calc(1lh + var(--gridui-space-16));
|
|
146
|
+
--gridui-steps-line-start: 3ch;
|
|
147
|
+
--gridui-steps-line-end: 0;
|
|
148
|
+
--gridui-steps-line-top: 0.5lh;
|
|
149
|
+
--gridui-steps-line-bottom: auto;
|
|
150
|
+
--gridui-steps-line-width: auto;
|
|
151
|
+
--gridui-steps-line-height: 1px;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/steps",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Semantic ordered process lists",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/sudo-ui/GridUI-React-Monorepo.git",
|
|
10
|
+
"directory": "packages/steps"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"**/*.css"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./styles.css": "./dist/styles.css"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@gridui/style-utils": "^2.1.1",
|
|
31
|
+
"@gridui/theme": "^2.1.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@gridui-internal/configuration": "0.0.0",
|
|
35
|
+
"@jest/globals": "30.5.2",
|
|
36
|
+
"@storybook/react-vite": "10.6.3",
|
|
37
|
+
"@types/jest": "30.0.0",
|
|
38
|
+
"@types/node": "26.6.5",
|
|
39
|
+
"@types/react": "19.3.0",
|
|
40
|
+
"@types/react-dom": "19.3.0",
|
|
41
|
+
"jest": "30.5.2",
|
|
42
|
+
"react": "19.3.1",
|
|
43
|
+
"react-dom": "19.3.1",
|
|
44
|
+
"typescript": "6.0.3"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^19.0.0",
|
|
48
|
+
"react-dom": "^19.0.0"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "node ../../scripts/compilation/package.ts",
|
|
52
|
+
"compile": "tsc --project tsconfig.json",
|
|
53
|
+
"test": "jest",
|
|
54
|
+
"coverage": "jest --coverage"
|
|
55
|
+
}
|
|
6
56
|
}
|