@dscout/particle 1.0.0-alpha.54 → 1.0.0-alpha.55

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/AGENTS.md ADDED
@@ -0,0 +1,99 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for AI agents working in an application that **consumes** `@dscout/particle`.
4
+
5
+ > This file ships inside the published package. It describes how to *use* Particle, not how to develop it. (Contributors to Particle itself should read `CLAUDE.md` in the repo root instead.)
6
+
7
+ ## What Particle is
8
+
9
+ Particle is dscout's design system: a React component library plus a set of SCSS/CSS stylesheets, published as `@dscout/particle`. You import components, utility classes, and styles from it; you do not modify it from a consuming app.
10
+
11
+ The authoritative reference for what components exist, their props, and their variants is the hosted Storybook: https://dscout.github.io/particle/v1/storybook/ — prefer it over guessing a component or prop name.
12
+
13
+ ## Installing and peer dependencies
14
+
15
+ ```bash
16
+ yarn add @dscout/particle react react-dom react-router-dom
17
+ ```
18
+
19
+ - **Peer dependencies (you install these):** `react`, `react-dom` (18.x or 19.x), and `react-router-dom` (6.x or 7.x).
20
+ - **`@floating-ui/dom`** is a regular dependency of Particle — it is installed automatically and powers `TooltipContainer` and `DropdownContainer`. You do not add it yourself.
21
+
22
+ Particle is built against React 18 but supports React 19 with no code changes; validate behavior when running on 19.
23
+
24
+ ## Importing components
25
+
26
+ Everything is a **named export** off the package root. There are no deep component import paths.
27
+
28
+ ```tsx
29
+ import { Container, Heading, Button } from '@dscout/particle';
30
+ ```
31
+
32
+ Components accept text as props rather than hardcoding copy — e.g. `Button` takes its label as a prop. Supply all user-facing strings from the consuming app.
33
+
34
+ ## Importing styles
35
+
36
+ Components are unstyled, and the utility classes below are unavailable, until you import Particle's stylesheet once near your app entry point.
37
+
38
+ Pre-compiled CSS (no build tooling required):
39
+
40
+ ```css
41
+ @import 'node_modules/@dscout/particle/lib/stylesheets/particle.css';
42
+ /* or the minified build */
43
+ @import 'node_modules/@dscout/particle/lib/stylesheets/particle.min.css';
44
+ ```
45
+
46
+ SCSS source (if your app compiles SCSS):
47
+
48
+ ```scss
49
+ @import '@dscout/particle/styles/particle.scss';
50
+ ```
51
+
52
+ ## Utility classes
53
+
54
+ Importing the stylesheet also brings in Particle's utility classes — single-purpose classes that apply design-system values for layout, spacing, color, typography, etc. **Prefer these over hand-written CSS or inline styles in a consuming app**: they keep you on the system's scale and tokens, and they're the intended way to compose layouts around Particle components.
55
+
56
+ The class-name convention is `category--value` (a double dash before the value). Categories live in the package's `styles/utilities/` directory. The common ones:
57
+
58
+ | Category | Examples | What it does |
59
+ |---|---|---|
60
+ | Display | `.display--f` (flex), `.display--ib` (inline-block), `.display--n` (none) | `display` |
61
+ | Flex / alignment | `.flex`, `.flex--1`, `.direction--column`, `.align-items--center`, `.align-content--between` | flexbox layout |
62
+ | Spacing — gap | `.flex-gap--1em`, `.flex-gap-v--0.5em`, `.flex-gap-h--1em` | `gap` between flex children |
63
+ | Spacing — margin | `.margin--1em`, `.margin-t--0.5em`, `.margin-h--2em` | `margin` (t/b/l/r/v/h variants) |
64
+ | Spacing — padding | `.padding--1em`, `.padding-v--0.5em`, `.padding-h--1em` | `padding` |
65
+ | Color | `.color--gray-500`, `.bg-color--blue-500`, `.b-color--gray-50` | text / background / border color |
66
+ | Typography | `.font-size--base`, `.font-weight--bold`, `.font--monospace` | type scale, weight, family |
67
+
68
+ Spacing values come from a fixed em-based scale — `none`, `0.25em`, `0.5em`, `0.75em`, `1em`, `1.25em`, `1.5em`, `2em`, `3em`, `4em`. Use a value from the scale; don't expect arbitrary values like `.margin--13px` to exist.
69
+
70
+ Color utility values mirror the base color tokens (e.g. `gray-5`…`gray-900`, `blue-500`, `red-500`, `green-500`). If you're unsure a class exists, check `styles/utilities/` in the installed package rather than guessing.
71
+
72
+ ## Theming and overrides: the token naming pattern
73
+
74
+ For per-component look-and-feel, Particle exposes **CSS variables (design tokens)**, so a consuming app can re-theme components without targeting their class names. This is the intended override mechanism — overriding raw class names is not.
75
+
76
+ The token naming convention is precise, and getting a separator wrong silently does nothing. The pattern is:
77
+
78
+ ```
79
+ --[ComponentName][--variant][__NestedElement][____property]
80
+ ```
81
+
82
+ - **Four underscores (`____`)** separate the component (or nested element) from the property.
83
+ - **Double dash (`--`)** separates a variant.
84
+ - **Two underscores (`__`)** separate a nested element.
85
+
86
+ | Example token | Meaning |
87
+ |---|---|
88
+ | `--Button____bg-color` | Button background color |
89
+ | `--Button--outline____b-color` | Outline-variant button border color |
90
+ | `--Input____border-color` | Input border color |
91
+ | `--Checkbox--checked__Icon____color` | Icon color inside a checked checkbox |
92
+
93
+ Do not invent token names. If you can't confirm a token exists, check Storybook or the package's `styles/` directory rather than approximating one.
94
+
95
+ ## Links
96
+
97
+ - Storybook (components, props, variants): https://dscout.github.io/particle/v1/storybook/
98
+ - Documentation site: https://dscout.github.io/particle/
99
+ - npm: https://www.npmjs.com/package/@dscout/particle
package/README.md CHANGED
@@ -25,7 +25,7 @@ yarn add @dscout/particle react@^19.0.0 react-dom@^19.0.0
25
25
 
26
26
  ### Peer dependencies
27
27
 
28
- Particle requires the implementing application install React and React Router. Optionally the implementing application can also install `lodash` and `@floating-ui/dom`. These optional peer dependencies are **required** when using the tooltip or dropdown components from Particle, but can be omitted if those are not used.
28
+ Particle requires the implementing application install React (`react`, `react-dom`) and React Router (`react-router-dom`). `@floating-ui/dom` which powers the tooltip and dropdown components is a regular dependency of Particle and installs automatically; the implementing application does not need to add it.
29
29
 
30
30
  ### Importing
31
31
 
Binary file
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@dscout/particle",
3
- "version": "1.0.0-alpha.54",
3
+ "version": "1.0.0-alpha.55",
4
4
  "description": "A pattern library for building dscout user interfaces",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",
7
7
  "files": [
8
8
  "lib/",
9
- "styles/"
9
+ "styles/",
10
+ "AGENTS.md"
10
11
  ],
11
12
  "sideEffects": [
12
13
  "styles/particle.scss"