Skip to content

chore(Docs): Add component docs#1517

Open
aweell wants to merge 20 commits intomasterfrom
aweell-component-docs
Open

chore(Docs): Add component docs#1517
aweell wants to merge 20 commits intomasterfrom
aweell-component-docs

Conversation

@aweell
Copy link
Contributor

@aweell aweell commented Mar 12, 2026

Add component docs under docs/component

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

Size stats

master this branch diff
Total JS 16.1 MB 16.1 MB 0 B
JS without icons 2.01 MB 2.01 MB 0 B
Lib overhead 92.5 kB 92.5 kB 0 B
Lib overhead (gzip) 19.9 kB 19.9 kB 0 B

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-2lv4pixtu-flows-projects-65bb050e.vercel.app

Built with commit de134fc.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@aweell aweell requested review from AnaMontes11 and Marcosld March 17, 2026 13:12
@aweell aweell marked this pull request as ready for review March 17, 2026 13:12
Copy link
Contributor

@Marcosld Marcosld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we already define how do we intend to transition between this and a shared doc for devs and LLMs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is very very complex for what it does. Do we really need to parse component props to create a table? I feel like if we tell the LLM where the source file is localted it will do a similar job at understanding its props... I would spend some time (not necessarily now) refactoring it or finding an easier solution.

})
}
>
{" "}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed


When to create a custom component

- The UI requirement cannot be satisfied by composition of existing Mistica components without repeated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could add an instruction requiring the llm to explicitly requiring confirmation by the user before creating a custom component

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Included!


# Badge

Badge is a compact, decorative indicator used to signal unread or pending status on top of another UI element.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decorative? I would say functional xD

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use functional only in cases where it has any behaviour based on interaction, so in this case we can use informative instead of decorative it works better?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

informative fit better


### Don't use for

- Do not use it as a standalone content element; it should decorate another component
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't really like the word "decorate" because isnt a decoration (in terms of accessibility for example)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, actually badge is hidden to screen readers, so we could state that is decorative, but i would't use that wording either. I've removed this point since we use badges standalone.

- Do not use secondary styling for the main conversion or progression action
- Do not present too many secondary actions in one group, which can dilute clarity
- Do not style destructive actions as secondary when risk needs explicit emphasis

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see a lot of "style" verb in this rules... Looks like is talking about style css or something similar. I have doubts about let this kind of "doors" open (mainly to avoid confusion in a human or a machine that can think the buttons can be customize)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased

#### Use for

- Browsing related cards or modules when horizontal exploration is the intended interaction
- Revealing progressive content with clear page feedback (bullets) and optional directional controls
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would replace "bullet" by "page indicator" or similar maybe to make it more agnostic (also in description maybe)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may collision with new carousel definition? I was using page bullets / page counter


#### Use for

- Showing a small sequence of prominent slides (for example hero banners or featured stories) one page at a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mayb can we include Hero component to expose the possibility to combine with this component? (the same in hero component)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, added


## ButtonLinkDanger

ButtonLinkDanger is a low-emphasis destructive action used when risk exists but should not dominate the
Copy link
Contributor

@AnaMontes11 AnaMontes11 Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would clarify the usage between ButtonDanger vs ButtonLinkDanger. Maybe something like: "Use ButtonDanger for primary destructive actions with maximum prominence; use ButtonLinkDanger for secondary destructive actions that need lighter emphasis."

- Do not use ToggleIconButton for multi-step or multi-option choices beyond two states
- Do not use the same icon/label for checked and unchecked states when meaning changes
- Do not omit accessible naming for each state; state intent must be understandable to assistive tech
- Do not use toggle interactions when the action is not reversible or does not represent a true on/off state
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd simplify this to: "Do not use ToggleIconButton for actions that are not truly binary (on/off)." The "reversible" part is implied.

- Do not use large primary actions in this pattern when compact action treatment is expected
- Do not present decorative visuals without clear supporting message and intent

## CardActionIconButton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component have no description or usage guidelines.


## CardActionIconButton

## CardActionSpinner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component have no description or usage guidelines.

- Do not rely on deprecated small-card patterns when `NakedCard size="snap"` is the intended approach
- Do not overload transparent cards with excessive actions that reduce scanability on busy backgrounds

## HighlightedCard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if they're still in the library we should document them. We could either:
-Keep individual files but add status: deprecated in the frontmatter with a note pointing to the replacement
-Group all deprecated cards into a single DeprecatedCards.md file with each as a subsection
Wdyt?

@@ -0,0 +1,369 @@
// @ts-check
// Component categories based on Storybook structure (src/__stories__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The categories file looks good. After looking into this, adding a synonyms field could help improve search and LLM understanding for categories that might be searched by different names (eg "collapse" for accordions, "toggle" for switch, "tag" for chip). We can keep it as a future idea if we see it's needed

- Do not rely on decorative circles alone to communicate critical information
- Do not use low-contrast background and border combinations that reduce legibility

## Touchable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between Touchable and TouchableElement?


# StackingGroup

Use stacking group to display a compact set of similarly sized items, optionally overlapped, with a `+N` overflow indicator.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add information about the +N element?

- Binary preferences or settings that can be turned on and off independently
- Cases where the state change is immediate and does not require a separate confirmation action
- Interfaces with short, explicit labels (or accessible labels) so users understand the effect of each toggle
- Optional custom switch row compositions where the control remains semantically exposed as a switch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we clarify what "switch row composition" means?

@@ -0,0 +1,22 @@

# Tag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this distinction explicit between Tag and Chip? We could reinforce in each component's documentation that they serve different purposes. Tag is for status/category (non-interactive), while Chip is for actions or selection (interactive).

- Do not rely on overlay dismissal for destructive or irreversible flows without explicit confirmation
- Do not stack multiple independent overlays when a single coordinated layer can manage focus and dismissal

## FocusTrap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FocusTrap, Portal, and applyAlpha have ambiguous descriptions. Could we follow how Overlay is documented to improve them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants