@nimbus-ds/patterns 1.39.1 → 1.40.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/CHANGELOG.md +14 -0
- package/dist/CHANGELOG.md +14 -0
- package/dist/SummaryStats/index.d.ts +23 -4
- package/dist/SummaryStats/index.js +1 -1
- package/dist/components-props.json +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/prototypes/README.md +145 -0
package/package.json
CHANGED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Nimbus Playground
|
|
2
|
+
|
|
3
|
+
This directory is Nimbus's execution surface for disposable prototypes. It lets a
|
|
4
|
+
person or agent turn an uncertain interaction into a temporary Storybook preview
|
|
5
|
+
before deciding whether the result belongs in Nimbus Core, Nimbus Patterns, or a
|
|
6
|
+
product.
|
|
7
|
+
|
|
8
|
+
This file defines the mechanics of working in Nimbus Patterns, following the
|
|
9
|
+
[Playground workflow introduced in Nimbus Design System](https://github.com/TiendaNube/nimbus-design-system/pull/549).
|
|
10
|
+
|
|
11
|
+
## Start with an intention
|
|
12
|
+
|
|
13
|
+
Before building, record in the prototype pull request:
|
|
14
|
+
|
|
15
|
+
- what someone wants to be able to do;
|
|
16
|
+
- who would use it and in which situation;
|
|
17
|
+
- the question the prototype should help answer;
|
|
18
|
+
- the owner or contact who can clarify and close the exploration.
|
|
19
|
+
|
|
20
|
+
For an agent-mediated request, also record the requester and a permalink to the original
|
|
21
|
+
request. This preserves the human source of the intention; it is not an approval.
|
|
22
|
+
|
|
23
|
+
A prototype does not need a specification, public API, classification, release
|
|
24
|
+
plan, or evidence that the idea should ship.
|
|
25
|
+
|
|
26
|
+
## Branch and directory
|
|
27
|
+
|
|
28
|
+
Create the prototype from current `master` on a branch named
|
|
29
|
+
`prototype/<slug>`. Keep all implementation files below one directory:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
packages/react/src/prototypes/
|
|
33
|
+
└── <PrototypeName>/
|
|
34
|
+
├── <PrototypeName>.tsx
|
|
35
|
+
└── <prototypeName>.stories.tsx
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Do not add a `package.json`, webpack configuration, changelog, generated docs,
|
|
39
|
+
release declaration, or production export. A prototype is not a workspace or a
|
|
40
|
+
published package.
|
|
41
|
+
|
|
42
|
+
## Required stories
|
|
43
|
+
|
|
44
|
+
Every prototype stories file must use a `Prototypes/<PrototypeName>` title and
|
|
45
|
+
export both:
|
|
46
|
+
|
|
47
|
+
- `Playground`: the internal working view. Use args and controls when they help
|
|
48
|
+
the team explore states or variants.
|
|
49
|
+
- `FullScreen`: the shareable experience. Set its display name to `Full screen`,
|
|
50
|
+
use Storybook's fullscreen layout, and disable controls when they would distract
|
|
51
|
+
from trying the interaction.
|
|
52
|
+
|
|
53
|
+
The pull-request preview reads both story IDs from Storybook's generated
|
|
54
|
+
`index.json`. Missing either story produces a warning in the preview comment.
|
|
55
|
+
Keep the story title and both export names stable while the exploration is active;
|
|
56
|
+
the direct preview URL should remain the same across feedback iterations.
|
|
57
|
+
|
|
58
|
+
## Nimbus imports
|
|
59
|
+
|
|
60
|
+
Compose published Nimbus components and local patterns:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { Box, Button } from "@nimbus-ds/components";
|
|
64
|
+
import { Page } from "@nimbus-ds/patterns";
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Package-level aliases such as `@nimbus-ds/page` also work. Patterns aliases resolve
|
|
68
|
+
to local source in Storybook; components, styles, tokens, and icons come from
|
|
69
|
+
published dependencies and do not need local builds.
|
|
70
|
+
|
|
71
|
+
## What can be rough
|
|
72
|
+
|
|
73
|
+
A prototype may use local state, mock data, temporary styles, simulated
|
|
74
|
+
navigation, and hardcoded behavior. It does not require automated tests or the
|
|
75
|
+
architecture and quality gates expected from production components.
|
|
76
|
+
|
|
77
|
+
Record every mocked, hardcoded, or simulated part in the pull request so nobody
|
|
78
|
+
mistakes the preview for a complete product flow.
|
|
79
|
+
|
|
80
|
+
The following boundaries are mandatory:
|
|
81
|
+
|
|
82
|
+
- never import prototype code from production code;
|
|
83
|
+
- never add a production export or package entry;
|
|
84
|
+
- never use secrets, credentials, personal data, real customer data, or
|
|
85
|
+
confidential information;
|
|
86
|
+
- use only material safe for public disclosure: preview URLs are unauthenticated and
|
|
87
|
+
predictable from the pull-request number;
|
|
88
|
+
- never publish or merge a prototype;
|
|
89
|
+
- do not modify production code merely to make the prototype work.
|
|
90
|
+
|
|
91
|
+
## Run locally
|
|
92
|
+
|
|
93
|
+
Use the repository's normal Storybook commands:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
yarn storybook
|
|
97
|
+
yarn build:storybook
|
|
98
|
+
|
|
99
|
+
# Build only prototype stories (at least one prototype must exist)
|
|
100
|
+
STORYBOOK_PROTOTYPE_ONLY=true yarn exec storybook build --test -o .build-storybook
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The local `tsconfig.json` keeps editor autocomplete while deliberately relaxing
|
|
104
|
+
prototype-only type restrictions. Root typecheck, lint, Jest, Sonar, versioning,
|
|
105
|
+
and publication exclude this directory. Those controls remain unchanged for
|
|
106
|
+
production source.
|
|
107
|
+
|
|
108
|
+
## Pull request and preview
|
|
109
|
+
|
|
110
|
+
Open a draft pull request using
|
|
111
|
+
`.github/PULL_REQUEST_TEMPLATE/prototype.md`. Prototype pull requests remain
|
|
112
|
+
draft and are never merged.
|
|
113
|
+
|
|
114
|
+
The preview comment exposes:
|
|
115
|
+
|
|
116
|
+
- a Storybook deep link to `Playground`;
|
|
117
|
+
- a direct `iframe.html` link to `Full screen`.
|
|
118
|
+
|
|
119
|
+
Keep the pull request open while the temporary preview is needed. Updating the
|
|
120
|
+
branch updates both views.
|
|
121
|
+
|
|
122
|
+
The process owner performs a monthly manual sweep of open draft `prototype/*` pull requests.
|
|
123
|
+
List them with:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
gh pr list --state open --draft --json number,headRefName,updatedAt --jq '.[] | select(.headRefName | startswith("prototype/"))'
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
For each inactive prototype, record an extension with its owner or close it after preserving
|
|
130
|
+
the outcome. This is a manual process for the initial volume.
|
|
131
|
+
|
|
132
|
+
## Record the outcome and close
|
|
133
|
+
|
|
134
|
+
Before closing the pull request, preserve:
|
|
135
|
+
|
|
136
|
+
- who tried the prototype and which task they attempted;
|
|
137
|
+
- observations and changes in understanding;
|
|
138
|
+
- mocks, hardcodes, simulations, limitations, and open questions;
|
|
139
|
+
- screenshots or a recording when the result must remain understandable after
|
|
140
|
+
the preview disappears;
|
|
141
|
+
- the outcome: discard, new exploration, or formal handoff.
|
|
142
|
+
|
|
143
|
+
Closing the pull request removes the preview. Delete the branch once neither the
|
|
144
|
+
active exploration nor its handoff needs it. A prototype with no activity for 30
|
|
145
|
+
days expires unless its owner records an active extension.
|