@deriv-com/dds-marketing 0.2.0 → 1.0.1
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/.llm/components/accordion.md +9 -1
- package/.llm/components/accordionitem.md +9 -1
- package/.llm/components/aspectratio.md +9 -1
- package/.llm/components/badge.md +9 -1
- package/.llm/components/bottomsheet.md +9 -1
- package/.llm/components/breadcrumb.md +9 -1
- package/.llm/components/breadcrumbitem.md +9 -1
- package/.llm/components/button.md +55 -27
- package/.llm/components/buttonicon.md +16 -8
- package/.llm/components/card.md +16 -2
- package/.llm/components/cardbody.md +29 -3
- package/.llm/components/cardbutton.md +16 -2
- package/.llm/components/checkbox.md +9 -1
- package/.llm/components/ctabanner.md +186 -0
- package/.llm/components/ctabannerslider.md +204 -0
- package/.llm/components/divider.md +9 -1
- package/.llm/components/dropdownmenu.md +15 -7
- package/.llm/components/faqaccordion.md +217 -0
- package/.llm/components/featurebullets.md +254 -0
- package/.llm/components/featurecards.md +313 -0
- package/.llm/components/featurescroll.md +284 -0
- package/.llm/components/featuresplit.md +249 -0
- package/.llm/components/filterchip.md +9 -1
- package/.llm/components/footer.md +9 -1
- package/.llm/components/footergroup.md +9 -1
- package/.llm/components/grid.md +9 -1
- package/.llm/components/icon.md +21 -3
- package/.llm/components/landinghero.md +254 -0
- package/.llm/components/link.md +13 -5
- package/.llm/components/logocolumns.md +235 -0
- package/.llm/components/logorows.md +212 -0
- package/.llm/components/menuitem.md +9 -1
- package/.llm/components/navbar.md +80 -16
- package/.llm/components/navbaritem.md +10 -2
- package/.llm/components/navbarmenu.md +9 -1
- package/.llm/components/navbarmenugroup.md +9 -1
- package/.llm/components/navbarpanel.md +10 -2
- package/.llm/components/navbarswitcher.md +10 -2
- package/.llm/components/navbarswitcheroption.md +9 -1
- package/.llm/components/option.md +9 -1
- package/.llm/components/pageheader.md +231 -0
- package/.llm/components/pagination.md +27 -90
- package/.llm/components/paginationdots.md +215 -0
- package/.llm/components/producthero.md +248 -0
- package/.llm/components/removablechip.md +9 -1
- package/.llm/components/row.md +9 -1
- package/.llm/components/scroller.md +9 -1
- package/.llm/components/searchinput.md +9 -1
- package/.llm/components/segmentedcontrol.md +9 -1
- package/.llm/components/segmentedcontrolitem.md +9 -1
- package/.llm/components/select.md +9 -1
- package/.llm/components/selectchip.md +57 -16
- package/.llm/components/spinner.md +9 -1
- package/.llm/components/stack.md +9 -1
- package/.llm/components/statusdot.md +9 -1
- package/.llm/components/subdomainnavbar.md +9 -1
- package/.llm/components/tab.md +11 -3
- package/.llm/components/table.md +9 -1
- package/.llm/components/tablebody.md +9 -1
- package/.llm/components/tablecell.md +9 -1
- package/.llm/components/tablehead.md +9 -1
- package/.llm/components/tableheadercell.md +9 -1
- package/.llm/components/tablerow.md +9 -1
- package/.llm/components/tablist.md +9 -1
- package/.llm/components/testimonialrow.md +235 -0
- package/.llm/components/testimonialslider.md +254 -0
- package/.llm/components/textarea.md +9 -1
- package/.llm/components/textinput.md +9 -1
- package/.llm/components/tooltip.md +9 -1
- package/.llm/components/typography.md +9 -1
- package/.llm/digest/button.md +11 -6
- package/.llm/digest/buttonicon.md +2 -2
- package/.llm/digest/card.md +1 -0
- package/.llm/digest/cardbody.md +3 -1
- package/.llm/digest/cardbutton.md +1 -0
- package/.llm/digest/ctabanner.md +44 -0
- package/.llm/digest/ctabannerslider.md +45 -0
- package/.llm/digest/dropdownmenu.md +1 -1
- package/.llm/digest/faqaccordion.md +43 -0
- package/.llm/digest/featurebullets.md +52 -0
- package/.llm/digest/featurecards.md +49 -0
- package/.llm/digest/featurescroll.md +52 -0
- package/.llm/digest/featuresplit.md +54 -0
- package/.llm/digest/landinghero.md +53 -0
- package/.llm/digest/logocolumns.md +55 -0
- package/.llm/digest/logorows.md +48 -0
- package/.llm/digest/navbar.md +18 -3
- package/.llm/digest/pageheader.md +49 -0
- package/.llm/digest/pagination.md +6 -17
- package/.llm/digest/paginationdots.md +43 -0
- package/.llm/digest/producthero.md +53 -0
- package/.llm/digest/selectchip.md +6 -1
- package/.llm/digest/testimonialrow.md +51 -0
- package/.llm/digest/testimonialslider.md +51 -0
- package/.llm/index.md +24 -3
- package/.llm/rules.md +43 -9
- package/.llm/tokens.md +56 -12
- package/AGENTS.md +32 -8
- package/README.md +41 -21
- package/dist/components/banner-data.d.ts +38 -0
- package/dist/components/banner-data.js +15 -0
- package/dist/components/blocks/block-reveal.css +90 -0
- package/dist/components/blocks/cta-banner/CtaBanner.css +66 -0
- package/dist/components/blocks/cta-banner/CtaBanner.d.ts +22 -0
- package/dist/components/blocks/cta-banner/CtaBanner.js +31 -0
- package/dist/components/blocks/cta-banner/CtaBanner.types.d.ts +29 -0
- package/dist/components/blocks/cta-banner/CtaBanner.types.js +13 -0
- package/dist/components/blocks/cta-banner/cta-banner-impl.css +29 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.css +90 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.d.ts +39 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.js +60 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.d.ts +41 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.js +15 -0
- package/dist/components/blocks/cta-banner-slider/cta-banner-slider-impl.css +73 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.css +54 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.d.ts +20 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.js +28 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.types.d.ts +25 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.types.js +10 -0
- package/dist/components/blocks/faq-accordion/faq-accordion-impl.css +54 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.css +139 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.d.ts +31 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.js +55 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.types.d.ts +39 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.types.js +16 -0
- package/dist/components/blocks/feature-bullets/feature-bullets-impl.css +104 -0
- package/dist/components/blocks/feature-cards/FeatureCards.css +84 -0
- package/dist/components/blocks/feature-cards/FeatureCards.d.ts +24 -0
- package/dist/components/blocks/feature-cards/FeatureCards.js +66 -0
- package/dist/components/blocks/feature-cards/FeatureCards.types.d.ts +33 -0
- package/dist/components/blocks/feature-cards/FeatureCards.types.js +14 -0
- package/dist/components/blocks/feature-cards/feature-cards-impl.css +245 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.css +137 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.d.ts +39 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.js +167 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.types.d.ts +40 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.types.js +17 -0
- package/dist/components/blocks/feature-scroll/feature-scroll-impl.css +292 -0
- package/dist/components/blocks/feature-split/FeatureSplit.css +95 -0
- package/dist/components/blocks/feature-split/FeatureSplit.d.ts +30 -0
- package/dist/components/blocks/feature-split/FeatureSplit.js +38 -0
- package/dist/components/blocks/feature-split/FeatureSplit.types.d.ts +39 -0
- package/dist/components/blocks/feature-split/FeatureSplit.types.js +14 -0
- package/dist/components/blocks/feature-split/feature-split-impl.css +83 -0
- package/dist/components/blocks/landing-hero/LandingHero.css +85 -0
- package/dist/components/blocks/landing-hero/LandingHero.d.ts +41 -0
- package/dist/components/blocks/landing-hero/LandingHero.js +54 -0
- package/dist/components/blocks/landing-hero/LandingHero.types.d.ts +37 -0
- package/dist/components/blocks/landing-hero/LandingHero.types.js +15 -0
- package/dist/components/blocks/landing-hero/landing-hero-impl.css +355 -0
- package/dist/components/blocks/logo-columns/LogoColumns.css +161 -0
- package/dist/components/blocks/logo-columns/LogoColumns.d.ts +23 -0
- package/dist/components/blocks/logo-columns/LogoColumns.js +46 -0
- package/dist/components/blocks/logo-columns/LogoColumns.types.d.ts +46 -0
- package/dist/components/blocks/logo-columns/LogoColumns.types.js +18 -0
- package/dist/components/blocks/logo-columns/logo-columns-impl.css +188 -0
- package/dist/components/blocks/logo-rows/LogoRows.css +122 -0
- package/dist/components/blocks/logo-rows/LogoRows.d.ts +20 -0
- package/dist/components/blocks/logo-rows/LogoRows.js +43 -0
- package/dist/components/blocks/logo-rows/LogoRows.types.d.ts +36 -0
- package/dist/components/blocks/logo-rows/LogoRows.types.js +16 -0
- package/dist/components/blocks/logo-rows/logo-rows-impl.css +179 -0
- package/dist/components/blocks/page-header/PageHeader.css +79 -0
- package/dist/components/blocks/page-header/PageHeader.d.ts +34 -0
- package/dist/components/blocks/page-header/PageHeader.js +43 -0
- package/dist/components/blocks/page-header/PageHeader.types.d.ts +32 -0
- package/dist/components/blocks/page-header/PageHeader.types.js +14 -0
- package/dist/components/blocks/page-header/page-header-impl.css +176 -0
- package/dist/components/blocks/product-hero/ProductHero.css +86 -0
- package/dist/components/blocks/product-hero/ProductHero.d.ts +35 -0
- package/dist/components/blocks/product-hero/ProductHero.js +48 -0
- package/dist/components/blocks/product-hero/ProductHero.types.d.ts +37 -0
- package/dist/components/blocks/product-hero/ProductHero.types.js +15 -0
- package/dist/components/blocks/product-hero/product-hero-impl.css +354 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.css +245 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.d.ts +20 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.js +128 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.d.ts +54 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.js +26 -0
- package/dist/components/blocks/testimonial-row/testimonial-row-impl.css +195 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.css +181 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.d.ts +22 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.js +36 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.d.ts +49 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.js +21 -0
- package/dist/components/blocks/testimonial-slider/testimonial-slider-impl.css +202 -0
- package/dist/components/blocks/use-reveal.d.ts +46 -0
- package/dist/components/blocks/use-reveal.js +120 -0
- package/dist/components/blocks/use-rotation.d.ts +62 -0
- package/dist/components/blocks/use-rotation.js +176 -0
- package/dist/components/core/accordion-item/AccordionItem.css +6 -5
- package/dist/components/core/bottom-sheet/BottomSheet.css +1 -1
- package/dist/components/core/button/Button.css +63 -16
- package/dist/components/core/button/Button.d.ts +14 -12
- package/dist/components/core/button/Button.js +43 -14
- package/dist/components/core/button/Button.types.d.ts +9 -14
- package/dist/components/core/button/button-impl.css +25 -0
- package/dist/components/core/button-icon/ButtonIcon.css +31 -15
- package/dist/components/core/button-icon/ButtonIcon.d.ts +2 -2
- package/dist/components/core/button-icon/ButtonIcon.js +2 -2
- package/dist/components/core/button-icon/ButtonIcon.types.d.ts +4 -4
- package/dist/components/core/card/Card.css +13 -4
- package/dist/components/core/card/Card.types.d.ts +2 -1
- package/dist/components/core/card-body/CardBody.css +11 -6
- package/dist/components/core/card-body/CardBody.d.ts +1 -1
- package/dist/components/core/card-body/CardBody.js +2 -2
- package/dist/components/core/card-body/CardBody.types.d.ts +4 -1
- package/dist/components/core/card-body/CardBody.types.js +1 -0
- package/dist/components/core/card-button/CardButton.css +13 -4
- package/dist/components/core/card-button/CardButton.types.d.ts +2 -1
- package/dist/components/core/checkbox/Checkbox.css +8 -1
- package/dist/components/core/dropdown-menu/DropdownMenu.css +13 -12
- package/dist/components/core/dropdown-menu/DropdownMenu.d.ts +5 -3
- package/dist/components/core/dropdown-menu/DropdownMenu.js +5 -3
- package/dist/components/core/filter-chip/FilterChip.css +2 -1
- package/dist/components/core/footer/footer-impl.css +1 -1
- package/dist/components/core/footer-group/FooterGroup.css +8 -7
- package/dist/components/core/icon/Icon.css +1 -1
- package/dist/components/core/link/Link.css +1 -1
- package/dist/components/core/link/Link.js +5 -5
- package/dist/components/core/menu-item/MenuItem.css +1 -1
- package/dist/components/core/navbar/Navbar.css +7 -8
- package/dist/components/core/navbar/Navbar.d.ts +17 -1
- package/dist/components/core/navbar/Navbar.js +139 -12
- package/dist/components/core/navbar/Navbar.types.d.ts +23 -4
- package/dist/components/core/navbar/Navbar.types.js +1 -1
- package/dist/components/core/navbar/navbar-impl.css +10 -3
- package/dist/components/core/navbar/navbar-material.css +96 -0
- package/dist/components/core/navbar-item/NavbarItem.css +4 -4
- package/dist/components/core/navbar-menu/NavbarMenu.css +7 -5
- package/dist/components/core/navbar-menu/NavbarMenu.d.ts +1 -0
- package/dist/components/core/navbar-menu/NavbarMenu.js +1 -0
- package/dist/components/core/navbar-menu/navbar-menu-impl.css +7 -7
- package/dist/components/core/navbar-switcher/NavbarSwitcher.css +6 -5
- package/dist/components/core/navbar-switcher/NavbarSwitcher.d.ts +1 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.js +2 -1
- package/dist/components/core/option/Option.css +1 -1
- package/dist/components/core/pagination/Pagination.css +1 -75
- package/dist/components/core/pagination/Pagination.d.ts +4 -4
- package/dist/components/core/pagination/Pagination.js +11 -51
- package/dist/components/core/pagination/Pagination.types.d.ts +5 -17
- package/dist/components/core/pagination/Pagination.types.js +1 -3
- package/dist/components/core/pagination-dots/PaginationDots.css +60 -0
- package/dist/components/core/pagination-dots/PaginationDots.d.ts +25 -0
- package/dist/components/core/pagination-dots/PaginationDots.js +104 -0
- package/dist/components/core/pagination-dots/PaginationDots.types.d.ts +38 -0
- package/dist/components/core/pagination-dots/PaginationDots.types.js +9 -0
- package/dist/components/core/removable-chip/RemovableChip.css +3 -3
- package/dist/components/core/search-input/SearchInput.css +1 -1
- package/dist/components/core/segmented-control/SegmentedControl.css +1 -1
- package/dist/components/core/segmented-control-item/SegmentedControlItem.css +1 -1
- package/dist/components/core/select/Select.css +2 -1
- package/dist/components/core/select-chip/SelectChip.css +14 -7
- package/dist/components/core/select-chip/SelectChip.d.ts +1 -1
- package/dist/components/core/select-chip/SelectChip.js +7 -4
- package/dist/components/core/select-chip/SelectChip.types.d.ts +7 -1
- package/dist/components/core/select-chip/SelectChip.types.js +1 -1
- package/dist/components/core/select-chip/select-chip-impl.css +14 -3
- package/dist/components/core/status-dot/StatusDot.css +1 -1
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.css +3 -3
- package/dist/components/core/tab/Tab.css +1 -1
- package/dist/components/core/tab/Tab.types.d.ts +1 -1
- package/dist/components/core/tab-list/TabList.css +1 -1
- package/dist/components/core/table/table-impl.css +36 -14
- package/dist/components/core/table-header-cell/TableHeaderCell.css +5 -5
- package/dist/components/core/text-area/TextArea.css +1 -1
- package/dist/components/core/text-input/TextInput.css +1 -1
- package/dist/components/core/tooltip/Tooltip.css +1 -1
- package/dist/components/core/typography/Typography.css +5 -5
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +30 -0
- package/dist/components/logo-data.d.ts +24 -0
- package/dist/components/logo-data.js +11 -0
- package/dist/components/scroll-data.d.ts +64 -0
- package/dist/components/scroll-data.js +17 -0
- package/dist/components/testimonial-row-data.d.ts +51 -0
- package/dist/components/testimonial-row-data.js +11 -0
- package/dist/components/testimonial-slider-data.d.ts +26 -0
- package/dist/components/testimonial-slider-data.js +10 -0
- package/dist/marketing.css +385 -14
- package/package.json +1 -6
|
@@ -74,7 +74,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
74
74
|
|
|
75
75
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
76
76
|
Guidance only — cannot be checked automatically.
|
|
77
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
77
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
78
78
|
Guidance only — cannot be checked automatically.
|
|
79
79
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
80
80
|
|
|
@@ -126,6 +126,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
126
126
|
|
|
127
127
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
128
128
|
Guidance only — cannot be checked automatically.
|
|
129
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
130
|
+
|
|
131
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
132
|
+
|
|
133
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
134
|
+
|
|
135
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
136
|
+
Guidance only — cannot be checked automatically.
|
|
129
137
|
|
|
130
138
|
## Anti-examples
|
|
131
139
|
|
|
@@ -138,7 +138,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
138
138
|
|
|
139
139
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
140
140
|
Guidance only — cannot be checked automatically.
|
|
141
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
141
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
142
142
|
Guidance only — cannot be checked automatically.
|
|
143
143
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
144
144
|
|
|
@@ -190,6 +190,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
190
190
|
|
|
191
191
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
192
192
|
Guidance only — cannot be checked automatically.
|
|
193
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
194
|
+
|
|
195
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
196
|
+
|
|
197
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
198
|
+
|
|
199
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
200
|
+
Guidance only — cannot be checked automatically.
|
|
193
201
|
|
|
194
202
|
## Anti-examples
|
|
195
203
|
|
|
@@ -94,7 +94,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
94
94
|
|
|
95
95
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
96
96
|
Guidance only — cannot be checked automatically.
|
|
97
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
97
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
98
98
|
Guidance only — cannot be checked automatically.
|
|
99
99
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
100
100
|
|
|
@@ -146,6 +146,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
146
146
|
|
|
147
147
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
148
148
|
Guidance only — cannot be checked automatically.
|
|
149
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
150
|
+
|
|
151
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
152
|
+
|
|
153
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
154
|
+
|
|
155
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
156
|
+
Guidance only — cannot be checked automatically.
|
|
149
157
|
|
|
150
158
|
## Anti-examples
|
|
151
159
|
|
package/.llm/components/badge.md
CHANGED
|
@@ -109,7 +109,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
109
109
|
|
|
110
110
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
111
111
|
Guidance only — cannot be checked automatically.
|
|
112
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
112
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
113
113
|
Guidance only — cannot be checked automatically.
|
|
114
114
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
115
115
|
|
|
@@ -161,6 +161,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
161
161
|
|
|
162
162
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
163
163
|
Guidance only — cannot be checked automatically.
|
|
164
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
165
|
+
|
|
166
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
167
|
+
|
|
168
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
169
|
+
|
|
170
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
171
|
+
Guidance only — cannot be checked automatically.
|
|
164
172
|
|
|
165
173
|
## Anti-examples
|
|
166
174
|
|
|
@@ -203,7 +203,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
203
203
|
|
|
204
204
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
205
205
|
Guidance only — cannot be checked automatically.
|
|
206
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
206
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
207
207
|
Guidance only — cannot be checked automatically.
|
|
208
208
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
209
209
|
|
|
@@ -255,6 +255,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
255
255
|
|
|
256
256
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
257
257
|
Guidance only — cannot be checked automatically.
|
|
258
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
259
|
+
|
|
260
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
261
|
+
|
|
262
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
263
|
+
|
|
264
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
265
|
+
Guidance only — cannot be checked automatically.
|
|
258
266
|
|
|
259
267
|
## Anti-examples
|
|
260
268
|
|
|
@@ -66,7 +66,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
66
66
|
|
|
67
67
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
68
68
|
Guidance only — cannot be checked automatically.
|
|
69
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
69
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
70
70
|
Guidance only — cannot be checked automatically.
|
|
71
71
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
72
72
|
|
|
@@ -118,6 +118,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
118
118
|
|
|
119
119
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
120
120
|
Guidance only — cannot be checked automatically.
|
|
121
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
122
|
+
|
|
123
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
124
|
+
|
|
125
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
126
|
+
|
|
127
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
128
|
+
Guidance only — cannot be checked automatically.
|
|
121
129
|
|
|
122
130
|
## Anti-examples
|
|
123
131
|
|
|
@@ -80,7 +80,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
80
80
|
|
|
81
81
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
82
82
|
Guidance only — cannot be checked automatically.
|
|
83
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
83
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
84
84
|
Guidance only — cannot be checked automatically.
|
|
85
85
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
86
86
|
|
|
@@ -132,6 +132,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
132
132
|
|
|
133
133
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
134
134
|
Guidance only — cannot be checked automatically.
|
|
135
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
136
|
+
|
|
137
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
138
|
+
|
|
139
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
140
|
+
|
|
141
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
142
|
+
Guidance only — cannot be checked automatically.
|
|
135
143
|
|
|
136
144
|
## Anti-examples
|
|
137
145
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Button
|
|
4
4
|
|
|
5
|
-
Drives a visitor toward a conversion goal
|
|
5
|
+
Drives a visitor toward a conversion goal — a signup page, a pricing page, a demo booking — or performs the one action a section asks for, such as sending a newsletter form or opening a video. An `<a>` when given an href and a `<button>` when not, so a CTA that goes somewhere gets the browser's navigation and one that acts in place answers Space and does what the page says.
|
|
6
6
|
|
|
7
7
|
## Use when
|
|
8
8
|
|
|
@@ -12,16 +12,16 @@ Drives a visitor toward a conversion goal by navigating them to the next step in
|
|
|
12
12
|
|
|
13
13
|
## Do not use
|
|
14
14
|
|
|
15
|
-
- The action
|
|
16
|
-
- The words belong inside a sentence or a paragraph of body copy →
|
|
15
|
+
- The action belongs to an application surface — a trade form, a settings panel, a confirmation that removes something → nothing here does this
|
|
16
|
+
- The words belong inside a sentence or a paragraph of body copy → `Link`
|
|
17
17
|
- The control is a glyph alone, with no words → `ButtonIcon`
|
|
18
18
|
|
|
19
19
|
## Anatomy
|
|
20
20
|
|
|
21
21
|
Button renders 3 elements. A token binding names the part it applies to.
|
|
22
22
|
|
|
23
|
-
- `root` — `<
|
|
24
|
-
- `label` — `<span>`, class `dds-button__label`. The words, and the accessible name of the
|
|
23
|
+
- `root` — `<button>`, class `dds-button`. The control. An `<a>` when given an href and a `<button>` when not, the shape CardButton and ButtonIcon already take: an anchor keeps cmd-click and middle-click, shows its destination and gets its pending state from the browser chrome, and a button answers Space and does what the page says. Two components for that would be two names for one press. It carries the variant and the size, so the fill, the padding and the type step all follow one decision. It is inline-flex rather than flex — a CTA is as wide as its words plus its inset, and a block-level control in a hero would stretch to the section it sits in. It resets the font and the block padding a `<button>` brings from the user agent, so the two elements render one pill. Its own structural keywords are the contract's top-level staticCss, which is where the root's belong.
|
|
24
|
+
- `label` — `<span>`, class `dds-button__label`. The words, and the accessible name of the control. Always rendered — a CTA whose label is optional is a CTA that ships unnamed, and here the words are also the only thing that says where the visitor is going. A box of its own so the type step binds to the words rather than to the root, which would inherit it down onto the glyph beside them.
|
|
25
25
|
- `icon` — `<svg>`, class `dds-button__icon`. The box the mark sits in, and the mark is a Quill glyph rather than a shape this component draws. A part of its own because the size tokens have to land on the element that renders — the same reason Breadcrumb's separator-icon is a part. Its weight is the icon system's: Quill ships every glyph light, regular and solid, chosen at the import site. Takes the label's colour through currentColor, so one mark is correct on a brand fill and on an inverse one alike. It never shrinks: a CTA short of room would drop the mark before its words. On hover it slides one gap step forward. Rendered only when `showIcon` is set.
|
|
26
26
|
|
|
27
27
|
Apply these classes from the generated `buttonParts` constant rather than writing the strings by hand.
|
|
@@ -36,11 +36,11 @@ Apply these classes from the generated `buttonParts` constant rather than writin
|
|
|
36
36
|
### variant — `primary` | `secondary` | `inverse` (default `primary`)
|
|
37
37
|
|
|
38
38
|
- `primary` — The step the page was built to produce. Carries the brand fill, which is what makes it findable at a glance and what makes it meaningless once there are two — a section offering two brand fills has said nothing about either.
|
|
39
|
-
- `secondary` — A real destination that is not the one being pushed — compare plans, read the docs, talk to sales.
|
|
39
|
+
- `secondary` — A real destination that is not the one being pushed — compare plans, read the docs, talk to sales. The lightest tint the ramp offers, color.bg.subtle, the same fill product's secondary carries, so a CTA and its alternative read as one family across both packages. Hover and press are layered over the fill as a background-image rather than replacing it, which is how product darkens a tint that has no hover partner of its own. On the dark band, tone="inverse" keeps the fill and turns it white.
|
|
40
40
|
- `inverse` — A section that paints its own ground — a brand-coloured hero, a photo band, a dark takeover. There the brand fill is invisible against the fill behind it and a neutral edge is the wrong ink, so the only thing that reads is a solid at the far end of the neutral ramp: pure black in light, pure white in dark. It outranks everything near it, which is what makes it right there and wrong anywhere else.
|
|
41
41
|
|
|
42
42
|
Use when: Deciding how much of the section a destination claims. Primary is the default and the one to spend deliberately.
|
|
43
|
-
Never for: Ranking every link on a page against every other. Three tiers is the whole vocabulary here on purpose — a set of unjustified tiers is what the previous Button was deleted for. And never inverse on the ordinary page ground: against it the fill carries roughly six times the contrast of the brand, so the primary beside it stops reading as the primary and one-primary-per-
|
|
43
|
+
Never for: Ranking every link on a page against every other. Three tiers is the whole vocabulary here on purpose — a set of unjustified tiers is what the previous Button was deleted for. And never inverse on the ordinary page ground: against it the fill carries roughly six times the contrast of the brand, so the primary beside it stops reading as the primary and one-primary-per-action-group is broken without a second primary anywhere in sight.
|
|
44
44
|
|
|
45
45
|
### size — `sm` | `md` | `lg` (default `lg`)
|
|
46
46
|
|
|
@@ -50,15 +50,16 @@ Never for: Ranking every link on a page against every other. Three tiers is the
|
|
|
50
50
|
|
|
51
51
|
Use when: Matching the control to the density of the band it sits in, which on a marketing page is set by the section rather than by the button.
|
|
52
52
|
|
|
53
|
-
### tone — `default` | `
|
|
53
|
+
### tone — `default` | `inverse` | `brand` (default `default`)
|
|
54
54
|
|
|
55
55
|
- `default` — The page's own ground, which sets the ink this component was drawn against — every button on a white page
|
|
56
|
-
- `
|
|
56
|
+
- `inverse` — The control stands on the dark band, color.bg.brand-strong — a hero, a navigation bar at the top of one, a footer — which is the same near-black in light and dark. The secondary keeps its filled shape: a six-percent white tint with hover and press layered over it, and the label in color.fg.on-brand-strong. Every value is fixed, because the band is.
|
|
57
|
+
- `brand` — The control stands on the coral band, color.bg.brand — CtaBanner and CtaBannerSlider — which is the same coral in light and dark, so nothing on it switches either. variant="inverse" is a near-black pill with a white label in both themes, rather than turning white in dark beside a white secondary; the secondary is the same six-percent white tint it is on the dark band. Hover, press and the focus ring are the dark band's fixed values.
|
|
57
58
|
|
|
58
|
-
### href — `string`
|
|
59
|
+
### href — `string`
|
|
59
60
|
|
|
60
|
-
Use when:
|
|
61
|
-
Never for: A placeholder while the destination is undecided — a # or an empty string is a control that looks live, takes focus and goes nowhere. Nor javascript: or a handler dressed as a URL:
|
|
61
|
+
Use when: The press goes somewhere with a URL of its own — the ordinary case for a call to action on a marketing page. It makes this an anchor rather than a button, which is what gives a visitor cmd-click, a visible destination and a copyable link. `target` and `rel` are not props: the component is typed against AnchorHTMLAttributes, so they are already in reach and land on the anchor.
|
|
62
|
+
Never for: A placeholder while the destination is undecided — a # or an empty string is a control that looks live, takes focus and goes nowhere. Nor javascript: or a handler dressed as a URL: leave href out and pass onClick, and this renders a button that does the work in place.
|
|
62
63
|
|
|
63
64
|
### showIcon — `boolean` (default `false`)
|
|
64
65
|
|
|
@@ -77,7 +78,7 @@ its props — do not re-derive them from the variant descriptions above.
|
|
|
77
78
|
- **A call to action in a sticky navigation bar, a pricing row or a footer band** — `variant="primary"` `size="md"`, not `size="lg"`
|
|
78
79
|
These bands are sized by the page rather than by the button, and lg stands a step taller by size.control.lg — taller than the copy beside it in a nav bar or a pricing row, which is the one place a hero measure is wrong.
|
|
79
80
|
- **The lesser of two destinations offered together — Compare plans beside Sign up** — `variant="secondary"` `size="md"`, not `variant="primary"`
|
|
80
|
-
Two brand fills side by side ask the visitor to choose between two things that look equally urgent, which is the one-primary-per-
|
|
81
|
+
Two brand fills side by side ask the visitor to choose between two things that look equally urgent, which is the one-primary-per-action-group rule. Secondary keeps the shape and the target size and gives up the fill, so the pair reads as a route and an alternative rather than as two demands.
|
|
81
82
|
- **A call to action inside a section that paints its own ground — a brand-coloured hero, a photo band, a dark takeover** — `variant="inverse"` `size="lg"`, not `variant="primary"`
|
|
82
83
|
The brand fill is invisible against a brand ground and a neutral edge is the wrong ink over a photograph, so inverse is the only tier that reads there. It is also the one place its contrast is not a problem: it outranks the page's primary, and the page's primary is not in the band.
|
|
83
84
|
- **A shaped call to action that begins a sequence rather than merely going somewhere — the hero button that opens a signup flow** — `variant="primary"` `size="lg"` `showIcon`
|
|
@@ -87,12 +88,13 @@ its props — do not re-derive them from the variant descriptions above.
|
|
|
87
88
|
|
|
88
89
|
Guaranteed by the component. Write none of it by hand: the ids these attributes point at are generated per instance, so an attribute set from outside either says the same thing twice or points at nothing.
|
|
89
90
|
|
|
90
|
-
- Announced as: `
|
|
91
|
-
- `Enter` —
|
|
91
|
+
- Announced as: `button`
|
|
92
|
+
- `Enter` — press it. A button and an anchor both answer Enter, so this reads the same either way
|
|
93
|
+
- `Space` — press it, where it is a button. An anchor does not answer Space, and that difference belongs to the element rather than to this component — a visitor who knows the difference is told which by how it was announced
|
|
92
94
|
- accessible name
|
|
93
95
|
- focus-visible ring
|
|
94
|
-
- an href that resolves — an anchor without
|
|
95
|
-
- a label that names the destination rather than the gesture, because a page of
|
|
96
|
+
- an href that resolves, wherever one is given — an anchor without a real destination is announced as a link and goes nowhere
|
|
97
|
+
- a label that names the destination or the action rather than the gesture, because a page of controls read out of context as "click here" names nothing
|
|
96
98
|
|
|
97
99
|
## Rules
|
|
98
100
|
|
|
@@ -108,11 +110,23 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
108
110
|
|
|
109
111
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
110
112
|
Guidance only — cannot be checked automatically.
|
|
111
|
-
- **
|
|
113
|
+
- **A navigation bar holds at most two buttons: one primary, and one secondary beside it** — The bar's actions are the conversion and the way back in for a reader who already has an account — sign up and log in. That is two things, and they rank: the one the site wants is primary and the other is secondary. A third button is a third thing the bar is asking for, and a row of three pills beside a mark and a set of destinations stops reading as a pair of actions and starts reading as a second navigation.
|
|
114
|
+
|
|
115
|
+
A single button is the primary. Alone, there is nothing for a secondary to be quieter than, and a bar whose only action is the quiet one has hidden the thing it exists to offer. Two buttons are one primary and one secondary, never two of either: two primaries are two demands, and two secondaries leave the reader to guess which one the site meant.
|
|
116
|
+
|
|
117
|
+
A switcher is not a button here — a DropdownMenu or a ButtonIcon for the language or the theme — and does not count against the two.
|
|
118
|
+
|
|
119
|
+
Guidance rather than a count. The bar is drawn with a second copy of an action in compactAction for narrow widths, and a count of Buttons under Navbar cannot tell that slot from utilities or a ranked pair from two primaries. Navbar checks the pair itself, on what utilities is handed, and says so in the console.
|
|
112
120
|
Guidance only — cannot be checked automatically.
|
|
113
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
121
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
114
122
|
Guidance only — cannot be checked automatically.
|
|
115
|
-
- **At most one primary button
|
|
123
|
+
- **At most one primary button in a group of actions** — Two brand fills side by side ask the visitor to choose between two things that look equally urgent, and nothing tells them which one the page wants. So a group of actions — a hero's pair, a banner's pair, the buttons in a navigation bar — leads with at most one primary, and whatever sits beside it is secondary.
|
|
124
|
+
|
|
125
|
+
The limit belongs to the group, not the page. A landing page asks for the same thing more than once on purpose: the sign-up in the bar, again under the opening claim, again in a banner halfway down and in the closing band. Each of those is one ask repeated where the reader has arrived, not a second ask competing with the first, and a rule that counted primaries across the page would forbid the thing a marketing page is built to do. This rule came from Product as one primary per view, and there it is right: a view is one screen with one task, and two primaries on it really are two tasks. On a page that scrolls through several sections the view is the wrong unit. The group is the one a reader compares.
|
|
126
|
+
|
|
127
|
+
The group can lose its primary without a second one appearing. Inverse on the ordinary page ground carries roughly six times the contrast of the brand, so the primary beside it stops reading as the primary — the same fault, reached from the other side.
|
|
128
|
+
|
|
129
|
+
A navigation bar is the group with the tightest limit, and navbar-actions-are-a-pair states it: two buttons at most, one of each.
|
|
116
130
|
Machine-checkable — `dds lint` will enforce this once built.
|
|
117
131
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
118
132
|
|
|
@@ -164,21 +178,32 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
164
178
|
|
|
165
179
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
166
180
|
Guidance only — cannot be checked automatically.
|
|
181
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
182
|
+
|
|
183
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
184
|
+
|
|
185
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
186
|
+
|
|
187
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
188
|
+
Guidance only — cannot be checked automatically.
|
|
167
189
|
|
|
168
190
|
## Anti-examples
|
|
169
191
|
|
|
170
|
-
❌ Button for: The action
|
|
171
|
-
That is @deriv-com/dds-product's Button, which
|
|
192
|
+
❌ Button for: The action belongs to an application surface — a trade form, a settings panel, a confirmation that removes something
|
|
193
|
+
That is @deriv-com/dds-product's Button, which carries the loading state, the destructive tier and the density an application needs. This one stops at the three tiers a marketing page ranks its calls to action by.
|
|
172
194
|
→ nothing in this system does this. Not a gap waiting to be filled — the case belongs outside it.
|
|
173
195
|
|
|
174
196
|
❌ Button for: The words belong inside a sentence or a paragraph of body copy
|
|
175
|
-
A control shaped like a button interrupts prose, and a pill in the middle of a line breaks the line's rhythm.
|
|
176
|
-
→
|
|
197
|
+
A control shaped like a button interrupts prose, and a pill in the middle of a line breaks the line's rhythm. An inline destination is a Link, which takes its size and ink from the copy around it rather than this component shrunk down until it stops looking like a button.
|
|
198
|
+
→ use `Link` instead.
|
|
177
199
|
|
|
178
200
|
❌ Button for: The control is a glyph alone, with no words
|
|
179
201
|
This component's words are its accessible name, and there is nowhere else to put one — a glyph with no label beside it ships unnamed. ButtonIcon is that case, split out the way product split it out of its own Button: it carries a `label` prop that is never drawn, so the control is named for a screen reader without any words being set on the page. It takes the same three tiers and the same two steps as this component, so a glyph-alone control and a labelled CTA in one band rank against each other in one vocabulary.
|
|
180
202
|
→ use `ButtonIcon` instead.
|
|
181
203
|
|
|
204
|
+
❌ variant=primary + tone=brand
|
|
205
|
+
The primary is the coral fill, and tone="brand" says the button stands on the coral band: coral on coral is a button nobody can see. On the band the primary action is variant="inverse".
|
|
206
|
+
|
|
182
207
|
## Example
|
|
183
208
|
|
|
184
209
|
```tsx
|
|
@@ -258,7 +283,7 @@ import { Button } from '@deriv-com/dds-marketing'
|
|
|
258
283
|
|
|
259
284
|
### On a ground the section painted
|
|
260
285
|
|
|
261
|
-
|
|
286
|
+
tone="inverse" keeps the fill on a ground that runs against the mode. On the coral band, tone="brand" holds the near-black primary and the tinted secondary still in both themes.
|
|
262
287
|
|
|
263
288
|
```tsx
|
|
264
289
|
import { Button } from '@deriv-com/dds-marketing'
|
|
@@ -266,6 +291,9 @@ import { Button } from '@deriv-com/dds-marketing'
|
|
|
266
291
|
// secondary — on the page's ground
|
|
267
292
|
<Button href="/signup" variant="secondary">Create free demo account</Button>
|
|
268
293
|
|
|
269
|
-
// secondary, tone="
|
|
270
|
-
<Button href="/signup" variant="secondary" tone="
|
|
294
|
+
// secondary, tone="inverse" — a ground against the mode
|
|
295
|
+
<Button href="/signup" variant="secondary" tone="inverse">Create free demo account</Button>
|
|
296
|
+
|
|
297
|
+
// inverse, tone="brand" — on the coral band
|
|
298
|
+
<Button href="/signup" variant="inverse" tone="brand">Open account</Button>
|
|
271
299
|
```
|
|
@@ -60,12 +60,12 @@ Apply these classes from the generated `buttonIconParts` constant rather than wr
|
|
|
60
60
|
### variant — `primary` | `secondary` | `inverse` | `plain` (default `primary`)
|
|
61
61
|
|
|
62
62
|
- `primary` — The one glyph-alone press a section is built around — a play control over a hero, the single action a band exists for. Carries the brand fill, which is what makes it findable at a glance and what makes it meaningless once there are two.
|
|
63
|
-
- `secondary` — The ordinary case for these, because they usually arrive several at a time — a footer's social row, a carousel's two directions, a bar's dismiss.
|
|
64
|
-
- `inverse` — A section that paints its own ground — a brand-coloured band, a photo, a dark takeover. There the brand fill is invisible against the fill behind it and a neutral
|
|
65
|
-
- `plain` — The control sits on a surface that has already said what it is — the exit on a sheet, a step in a set of marks — and a
|
|
63
|
+
- `secondary` — The ordinary case for these, because they usually arrive several at a time — a footer's social row, a carousel's two directions, a bar's dismiss. Button's secondary, drawn as a circle: the lightest tint the ramp offers, color.bg.subtle, with hover and press layered over the fill as a background-image rather than replacing it, so a glyph-alone control and a labelled one beside it read as one family. On the dark band, tone="inverse" keeps the fill and turns it white.
|
|
64
|
+
- `inverse` — A section that paints its own ground — a brand-coloured band, a photo, a dark takeover. There the brand fill is invisible against the fill behind it and a neutral tint is lost over a photograph, so the only thing that reads is a solid at the far end of the neutral ramp: pure black in light, pure white in dark. It outranks everything near it, which is what makes it right there and wrong anywhere else.
|
|
65
|
+
- `plain` — The control sits on a surface that has already said what it is — the exit on a sheet, a step in a set of marks — and a tint behind it would be the loudest thing there. It keeps the target and the states and gives up only the fill, so what a reader presses is unchanged and what they see is the glyph.
|
|
66
66
|
|
|
67
67
|
Use when: Deciding how much of the section one press claims. The three tiers are Button's three, deliberately — a glyph-alone control and a labelled CTA in the same band have to rank against each other, and they cannot do that in two vocabularies.
|
|
68
|
-
Never for: Ranking a row of these against each other. A footer's five social links are peers; one of them drawn heavier says the other four are lesser, which is not a thing anybody meant to say. And never inverse on the ordinary page ground: against it the fill carries roughly six times the contrast of the brand, so the primary beside it stops reading as the primary and one-primary-per-
|
|
68
|
+
Never for: Ranking a row of these against each other. A footer's five social links are peers; one of them drawn heavier says the other four are lesser, which is not a thing anybody meant to say. And never inverse on the ordinary page ground: against it the fill carries roughly six times the contrast of the brand, so the primary beside it stops reading as the primary and one-primary-per-action-group is broken with no second primary anywhere in sight. And never for a control that has to be found rather than recognised: with no fill, a plain one is a glyph until it is hovered, so it belongs where the reader already knows something is — a corner, a row of marks, the end of a header — and not adrift on a page.
|
|
69
69
|
|
|
70
70
|
### size — `sm` | `md` | `lg` (default `md`)
|
|
71
71
|
|
|
@@ -79,7 +79,7 @@ Never for: Making one of a set stand out. Two of these side by side at different
|
|
|
79
79
|
### tone — `default` | `inverse` (default `default`)
|
|
80
80
|
|
|
81
81
|
- `default` — The control is on a light ground, which is every surface this package paints by default
|
|
82
|
-
- `inverse` — The control
|
|
82
|
+
- `inverse` — The control stands on the dark band, color.bg.brand-strong — a mark in a navigation bar on a hero, a social mark in a footer — which is the same near-black in light and dark. The ink and the tints move to the band's fixed roles; nothing else does
|
|
83
83
|
|
|
84
84
|
### icon — `node` **Required.**
|
|
85
85
|
|
|
@@ -107,11 +107,11 @@ Placement in, props out. When one of these describes what you are building, take
|
|
|
107
107
|
its props — do not re-derive them from the variant descriptions above.
|
|
108
108
|
|
|
109
109
|
- **A row of social accounts in the page footer** — `variant="secondary"` `size="md"`, not `variant="primary"`
|
|
110
|
-
These are destinations a visitor looks for rather than ones the page pushes, and there are several of them at once. The brand fill repeated five times across a footer is five primaries, which is the one-primary-per-
|
|
110
|
+
These are destinations a visitor looks for rather than ones the page pushes, and there are several of them at once. The brand fill repeated five times across a footer is five primaries in one group, which is the one-primary-per-action-group rule broken by a row nobody would call a call to action. Secondary keeps the circle and the target and gives up the fill.
|
|
111
111
|
- **Dismissing a promotional bar or a cookie band** — `variant="secondary"` `size="md"`
|
|
112
112
|
It is a button rather than an anchor — leave href off — because the page handles the press itself and nothing about it is a place a visitor could bookmark. Secondary rather than primary: the bar's own call to action is the primary, and a dismiss that outranks it is a band arguing with itself.
|
|
113
113
|
- **Playing a video in a hero, or over a photograph** — `variant="inverse"` `size="lg"`, not `variant="primary"`
|
|
114
|
-
A brand fill is invisible against a brand ground and a neutral
|
|
114
|
+
A brand fill is invisible against a brand ground and a neutral tint is lost over a photograph, so the only thing that reads there is a solid at the far end of the neutral ramp. lg because it is the one control in view and it is read at a distance, which is the case size.control.lg was cut for.
|
|
115
115
|
- **The previous and next controls of a carousel** — `variant="secondary"` `size="md"`, not `size="lg"`
|
|
116
116
|
A pair of peers, sized by the band they sit in rather than by themselves. lg stands a step taller than md, which puts it above the copy beside it in most bands — the one place a hero measure is wrong. Both take the same variant, because one of two directions drawn heavier says the other is unavailable.
|
|
117
117
|
|
|
@@ -143,7 +143,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
143
143
|
|
|
144
144
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
145
145
|
Guidance only — cannot be checked automatically.
|
|
146
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
146
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
147
147
|
Guidance only — cannot be checked automatically.
|
|
148
148
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
149
149
|
|
|
@@ -195,6 +195,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
195
195
|
|
|
196
196
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
197
197
|
Guidance only — cannot be checked automatically.
|
|
198
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
199
|
+
|
|
200
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
201
|
+
|
|
202
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
203
|
+
|
|
204
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
205
|
+
Guidance only — cannot be checked automatically.
|
|
198
206
|
|
|
199
207
|
## Anti-examples
|
|
200
208
|
|
package/.llm/components/card.md
CHANGED
|
@@ -50,9 +50,10 @@ Apply these classes from the generated `cardParts` constant rather than writing
|
|
|
50
50
|
|
|
51
51
|
## Props
|
|
52
52
|
|
|
53
|
-
### variant — `surface` | `surface-raised` | `plain` | `accent` | `accent-strong` (default `surface`)
|
|
53
|
+
### variant — `surface` | `surface-light` | `surface-raised` | `plain` | `accent` | `accent-strong` (default `surface`)
|
|
54
54
|
|
|
55
55
|
- `surface` — The default, and right for a card on the page. The marketing page is white and this is a step off it, so the card is told apart by being recessed — no shadow and no border, because the fill is already the edge
|
|
56
|
+
- `surface-light` — A light card among dark ones that has to stay light in both themes — a row mixing a dark, a coral and a grey card, where the grey one flipping to dark in dark mode would make two dark cards and break the set. gray.50 with gray.950 text, fixed. For an ordinary card that follows the theme, surface.
|
|
56
57
|
- `surface-raised` — The card sits on a color.bg.subtle band rather than on the page. There the recessed fill is only 1.09:1 against its ground and all but disappears; this one is 1.23:1 the other way, lifting off the band instead of sinking into it
|
|
57
58
|
- `plain` — An editorial card — an article, a post, a story — where the picture and the headline are what separate one card from the next. It paints no background, so it shows whatever is under it: the page, a subtle band, or a section that has taken a colour. The corner and the clip are still the card's, so a picture at the top of it meets a rounded edge rather than squaring one off It takes no corner either: radius.surface is the shape of a fill, and with no fill there is nothing to round — a rounded picture sitting on the page reads as a floating tile rather than as the art leading an article.
|
|
58
59
|
- `accent` — One card in a set is the promotional one and the page has already earned the colour. The coral is the loudest ground here, so a row of them is a row of nothing louder than the rest
|
|
@@ -91,7 +92,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
91
92
|
|
|
92
93
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
93
94
|
Guidance only — cannot be checked automatically.
|
|
94
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
95
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
95
96
|
Guidance only — cannot be checked automatically.
|
|
96
97
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
97
98
|
|
|
@@ -143,6 +144,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
143
144
|
|
|
144
145
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
145
146
|
Guidance only — cannot be checked automatically.
|
|
147
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
148
|
+
|
|
149
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
150
|
+
|
|
151
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
152
|
+
|
|
153
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
154
|
+
Guidance only — cannot be checked automatically.
|
|
146
155
|
|
|
147
156
|
## Anti-examples
|
|
148
157
|
|
|
@@ -174,6 +183,11 @@ import { Card, CardBody } from '@deriv-com/dds-marketing'
|
|
|
174
183
|
<CardBody title="Tight spreads" description="Competitive pricing on every market, with no hidden markup." />
|
|
175
184
|
</Card>
|
|
176
185
|
|
|
186
|
+
// surface-light — light in both themes
|
|
187
|
+
<Card variant="surface-light">
|
|
188
|
+
<CardBody title="Controlled risk" description="Set your limits with take profit and stop loss." />
|
|
189
|
+
</Card>
|
|
190
|
+
|
|
177
191
|
// surface-raised — on a subtle band
|
|
178
192
|
<Card variant="surface-raised">
|
|
179
193
|
<CardBody title="Fast execution" description="Orders filled in milliseconds, even when the market moves." />
|