@newtone-dev/ui-react-web 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/accordion/accordion.css +239 -0
- package/dist/accordion/accordion.d.ts +106 -0
- package/dist/accordion/accordion.d.ts.map +1 -0
- package/dist/accordion/accordion.js +15 -0
- package/dist/accordion/accordion.js.map +1 -0
- package/dist/accordion/index.d.ts +4 -0
- package/dist/accordion/index.d.ts.map +1 -0
- package/dist/accordion/index.js +3 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/action/action.css +86 -0
- package/dist/action/action.d.ts +62 -0
- package/dist/action/action.d.ts.map +1 -0
- package/dist/action/action.js +59 -0
- package/dist/action/action.js.map +1 -0
- package/dist/action/index.d.ts +4 -0
- package/dist/action/index.d.ts.map +1 -0
- package/dist/action/index.js +3 -0
- package/dist/action/index.js.map +1 -0
- package/dist/avatar/avatar.css +39 -0
- package/dist/avatar/avatar.d.ts +43 -0
- package/dist/avatar/avatar.d.ts.map +1 -0
- package/dist/avatar/avatar.js +38 -0
- package/dist/avatar/avatar.js.map +1 -0
- package/dist/avatar/index.d.ts +4 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/avatar/index.js +3 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/button/button.css +112 -0
- package/dist/button/button.d.ts +36 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.js +24 -0
- package/dist/button/button.js.map +1 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/button/index.js +2 -0
- package/dist/button/index.js.map +1 -0
- package/dist/card-box/card-box.css +75 -0
- package/dist/card-box/card-box.d.ts +114 -0
- package/dist/card-box/card-box.d.ts.map +1 -0
- package/dist/card-box/card-box.js +9 -0
- package/dist/card-box/card-box.js.map +1 -0
- package/dist/card-box/index.d.ts +4 -0
- package/dist/card-box/index.d.ts.map +1 -0
- package/dist/card-box/index.js +3 -0
- package/dist/card-box/index.js.map +1 -0
- package/dist/card-grid/card-grid.css +97 -0
- package/dist/card-grid/card-grid.d.ts +63 -0
- package/dist/card-grid/card-grid.d.ts.map +1 -0
- package/dist/card-grid/card-grid.js +27 -0
- package/dist/card-grid/card-grid.js.map +1 -0
- package/dist/card-grid/index.d.ts +4 -0
- package/dist/card-grid/index.d.ts.map +1 -0
- package/dist/card-grid/index.js +3 -0
- package/dist/card-grid/index.js.map +1 -0
- package/dist/color/gamut.d.ts +20 -0
- package/dist/color/gamut.d.ts.map +1 -0
- package/dist/color/gamut.js +72 -0
- package/dist/color/gamut.js.map +1 -0
- package/dist/color/index.d.ts +8 -0
- package/dist/color/index.d.ts.map +1 -0
- package/dist/color/index.js +21 -0
- package/dist/color/index.js.map +1 -0
- package/dist/color/oklch.d.ts +35 -0
- package/dist/color/oklch.d.ts.map +1 -0
- package/dist/color/oklch.js +103 -0
- package/dist/color/oklch.js.map +1 -0
- package/dist/color/scale.d.ts +20 -0
- package/dist/color/scale.d.ts.map +1 -0
- package/dist/color/scale.js +75 -0
- package/dist/color/scale.js.map +1 -0
- package/dist/color/seeds.d.ts +33 -0
- package/dist/color/seeds.d.ts.map +1 -0
- package/dist/color/seeds.js +148 -0
- package/dist/color/seeds.js.map +1 -0
- package/dist/control/control.css +203 -0
- package/dist/control/control.d.ts +112 -0
- package/dist/control/control.d.ts.map +1 -0
- package/dist/control/control.js +107 -0
- package/dist/control/control.js.map +1 -0
- package/dist/control/index.d.ts +4 -0
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/index.js +3 -0
- package/dist/control/index.js.map +1 -0
- package/dist/data-list/data-list.css +52 -0
- package/dist/data-list/data-list.d.ts +55 -0
- package/dist/data-list/data-list.d.ts.map +1 -0
- package/dist/data-list/data-list.js +51 -0
- package/dist/data-list/data-list.js.map +1 -0
- package/dist/data-list/index.d.ts +5 -0
- package/dist/data-list/index.d.ts.map +1 -0
- package/dist/data-list/index.js +3 -0
- package/dist/data-list/index.js.map +1 -0
- package/dist/data-list/row/row.d.ts +16 -0
- package/dist/data-list/row/row.d.ts.map +1 -0
- package/dist/data-list/row/row.js +15 -0
- package/dist/data-list/row/row.js.map +1 -0
- package/dist/feature-card/feature-card.css +93 -0
- package/dist/feature-card/feature-card.d.ts +68 -0
- package/dist/feature-card/feature-card.d.ts.map +1 -0
- package/dist/feature-card/feature-card.js +11 -0
- package/dist/feature-card/feature-card.js.map +1 -0
- package/dist/feature-card/index.d.ts +4 -0
- package/dist/feature-card/index.d.ts.map +1 -0
- package/dist/feature-card/index.js +3 -0
- package/dist/feature-card/index.js.map +1 -0
- package/dist/framed-icon/framed-icon.css +77 -0
- package/dist/framed-icon/framed-icon.d.ts +61 -0
- package/dist/framed-icon/framed-icon.d.ts.map +1 -0
- package/dist/framed-icon/framed-icon.js +14 -0
- package/dist/framed-icon/framed-icon.js.map +1 -0
- package/dist/framed-icon/index.d.ts +4 -0
- package/dist/framed-icon/index.d.ts.map +1 -0
- package/dist/framed-icon/index.js +3 -0
- package/dist/framed-icon/index.js.map +1 -0
- package/dist/gallery/gallery.css +165 -0
- package/dist/gallery/gallery.d.ts +85 -0
- package/dist/gallery/gallery.d.ts.map +1 -0
- package/dist/gallery/gallery.js +75 -0
- package/dist/gallery/gallery.js.map +1 -0
- package/dist/gallery/index.d.ts +4 -0
- package/dist/gallery/index.d.ts.map +1 -0
- package/dist/gallery/index.js +3 -0
- package/dist/gallery/index.js.map +1 -0
- package/dist/icon/icon.css +83 -0
- package/dist/icon/icon.d.ts +69 -0
- package/dist/icon/icon.d.ts.map +1 -0
- package/dist/icon/icon.js +18 -0
- package/dist/icon/icon.js.map +1 -0
- package/dist/icon/index.d.ts +4 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/icon/index.js +3 -0
- package/dist/icon/index.js.map +1 -0
- package/dist/icon-link/icon-link.css +57 -0
- package/dist/icon-link/icon-link.d.ts +47 -0
- package/dist/icon-link/icon-link.d.ts.map +1 -0
- package/dist/icon-link/icon-link.js +35 -0
- package/dist/icon-link/icon-link.js.map +1 -0
- package/dist/icon-link/index.d.ts +4 -0
- package/dist/icon-link/index.d.ts.map +1 -0
- package/dist/icon-link/index.js +3 -0
- package/dist/icon-link/index.js.map +1 -0
- package/dist/identity/identity.d.ts +25 -0
- package/dist/identity/identity.d.ts.map +1 -0
- package/dist/identity/identity.js +25 -0
- package/dist/identity/identity.js.map +1 -0
- package/dist/identity/index.d.ts +3 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +2 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/link.css +65 -0
- package/dist/link/link.d.ts +38 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js +22 -0
- package/dist/link/link.js.map +1 -0
- package/dist/logo-marquee/index.d.ts +4 -0
- package/dist/logo-marquee/index.d.ts.map +1 -0
- package/dist/logo-marquee/index.js +3 -0
- package/dist/logo-marquee/index.js.map +1 -0
- package/dist/logo-marquee/logo-marquee.css +227 -0
- package/dist/logo-marquee/logo-marquee.d.ts +69 -0
- package/dist/logo-marquee/logo-marquee.d.ts.map +1 -0
- package/dist/logo-marquee/logo-marquee.js +11 -0
- package/dist/logo-marquee/logo-marquee.js.map +1 -0
- package/dist/media-plate/index.d.ts +4 -0
- package/dist/media-plate/index.d.ts.map +1 -0
- package/dist/media-plate/index.js +3 -0
- package/dist/media-plate/index.js.map +1 -0
- package/dist/media-plate/media-plate.css +41 -0
- package/dist/media-plate/media-plate.d.ts +45 -0
- package/dist/media-plate/media-plate.d.ts.map +1 -0
- package/dist/media-plate/media-plate.js +5 -0
- package/dist/media-plate/media-plate.js.map +1 -0
- package/dist/media-window/media-window.css +82 -0
- package/dist/navbar/actions/actions.d.ts +14 -0
- package/dist/navbar/actions/actions.d.ts.map +1 -0
- package/dist/navbar/actions/actions.js +12 -0
- package/dist/navbar/actions/actions.js.map +1 -0
- package/dist/navbar/brand/brand.d.ts +12 -0
- package/dist/navbar/brand/brand.d.ts.map +1 -0
- package/dist/navbar/brand/brand.js +10 -0
- package/dist/navbar/brand/brand.js.map +1 -0
- package/dist/navbar/context.d.ts +12 -0
- package/dist/navbar/context.d.ts.map +1 -0
- package/dist/navbar/context.js +13 -0
- package/dist/navbar/context.js.map +1 -0
- package/dist/navbar/index.d.ts +8 -0
- package/dist/navbar/index.d.ts.map +1 -0
- package/dist/navbar/index.js +8 -0
- package/dist/navbar/index.js.map +1 -0
- package/dist/navbar/link/drawer/drawer.css +50 -0
- package/dist/navbar/link/drawer/drawer.d.ts +20 -0
- package/dist/navbar/link/drawer/drawer.d.ts.map +1 -0
- package/dist/navbar/link/drawer/drawer.js +44 -0
- package/dist/navbar/link/drawer/drawer.js.map +1 -0
- package/dist/navbar/link/link.css +54 -0
- package/dist/navbar/link/link.d.ts +30 -0
- package/dist/navbar/link/link.d.ts.map +1 -0
- package/dist/navbar/link/link.js +29 -0
- package/dist/navbar/link/link.js.map +1 -0
- package/dist/navbar/links/links.d.ts +14 -0
- package/dist/navbar/links/links.d.ts.map +1 -0
- package/dist/navbar/links/links.js +14 -0
- package/dist/navbar/links/links.js.map +1 -0
- package/dist/navbar/menu-button/menu-button.css +20 -0
- package/dist/navbar/menu-button/menu-button.d.ts +13 -0
- package/dist/navbar/menu-button/menu-button.d.ts.map +1 -0
- package/dist/navbar/menu-button/menu-button.js +20 -0
- package/dist/navbar/menu-button/menu-button.js.map +1 -0
- package/dist/navbar/navbar.css +179 -0
- package/dist/navbar/navbar.d.ts +58 -0
- package/dist/navbar/navbar.d.ts.map +1 -0
- package/dist/navbar/navbar.js +96 -0
- package/dist/navbar/navbar.js.map +1 -0
- package/dist/numbered-list/index.d.ts +4 -0
- package/dist/numbered-list/index.d.ts.map +1 -0
- package/dist/numbered-list/index.js +3 -0
- package/dist/numbered-list/index.js.map +1 -0
- package/dist/numbered-list/numbered-list.css +46 -0
- package/dist/numbered-list/numbered-list.d.ts +31 -0
- package/dist/numbered-list/numbered-list.d.ts.map +1 -0
- package/dist/numbered-list/numbered-list.js +26 -0
- package/dist/numbered-list/numbered-list.js.map +1 -0
- package/dist/on-media/on-media.css +198 -0
- package/dist/quick-action/index.d.ts +4 -0
- package/dist/quick-action/index.d.ts.map +1 -0
- package/dist/quick-action/index.js +3 -0
- package/dist/quick-action/index.js.map +1 -0
- package/dist/quick-action/quick-action.css +70 -0
- package/dist/quick-action/quick-action.d.ts +68 -0
- package/dist/quick-action/quick-action.d.ts.map +1 -0
- package/dist/quick-action/quick-action.js +54 -0
- package/dist/quick-action/quick-action.js.map +1 -0
- package/dist/segmented-control/index.d.ts +4 -0
- package/dist/segmented-control/index.d.ts.map +1 -0
- package/dist/segmented-control/index.js +3 -0
- package/dist/segmented-control/index.js.map +1 -0
- package/dist/segmented-control/segmented-control.css +206 -0
- package/dist/segmented-control/segmented-control.d.ts +91 -0
- package/dist/segmented-control/segmented-control.d.ts.map +1 -0
- package/dist/segmented-control/segmented-control.js +9 -0
- package/dist/segmented-control/segmented-control.js.map +1 -0
- package/dist/stat-card/index.d.ts +4 -0
- package/dist/stat-card/index.d.ts.map +1 -0
- package/dist/stat-card/index.js +3 -0
- package/dist/stat-card/index.js.map +1 -0
- package/dist/stat-card/stat-card.css +56 -0
- package/dist/stat-card/stat-card.d.ts +48 -0
- package/dist/stat-card/stat-card.d.ts.map +1 -0
- package/dist/stat-card/stat-card.js +11 -0
- package/dist/stat-card/stat-card.js.map +1 -0
- package/dist/surface/index.d.ts +3 -0
- package/dist/surface/index.d.ts.map +1 -0
- package/dist/surface/index.js +2 -0
- package/dist/surface/index.js.map +1 -0
- package/dist/surface/surface.d.ts +40 -0
- package/dist/surface/surface.d.ts.map +1 -0
- package/dist/surface/surface.js +22 -0
- package/dist/surface/surface.js.map +1 -0
- package/dist/tag/index.d.ts +4 -0
- package/dist/tag/index.d.ts.map +1 -0
- package/dist/tag/index.js +3 -0
- package/dist/tag/index.js.map +1 -0
- package/dist/tag/tag.css +77 -0
- package/dist/tag/tag.d.ts +80 -0
- package/dist/tag/tag.d.ts.map +1 -0
- package/dist/tag/tag.js +16 -0
- package/dist/tag/tag.js.map +1 -0
- package/dist/text/index.d.ts +3 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +2 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/text.css +232 -0
- package/dist/text/text.d.ts +64 -0
- package/dist/text/text.d.ts.map +1 -0
- package/dist/text/text.js +37 -0
- package/dist/text/text.js.map +1 -0
- package/dist/video-lightbox/index.d.ts +4 -0
- package/dist/video-lightbox/index.d.ts.map +1 -0
- package/dist/video-lightbox/index.js +3 -0
- package/dist/video-lightbox/index.js.map +1 -0
- package/dist/video-lightbox/video-lightbox.css +167 -0
- package/dist/video-lightbox/video-lightbox.d.ts +92 -0
- package/dist/video-lightbox/video-lightbox.d.ts.map +1 -0
- package/dist/video-lightbox/video-lightbox.js +31 -0
- package/dist/video-lightbox/video-lightbox.js.map +1 -0
- package/dist/wrapper/index.d.ts +3 -0
- package/dist/wrapper/index.d.ts.map +1 -0
- package/dist/wrapper/index.js +2 -0
- package/dist/wrapper/index.js.map +1 -0
- package/dist/wrapper/wrapper.d.ts +113 -0
- package/dist/wrapper/wrapper.d.ts.map +1 -0
- package/dist/wrapper/wrapper.js +83 -0
- package/dist/wrapper/wrapper.js.map +1 -0
- package/package.json +184 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A glyph from the family the seed names -- Material Symbols Rounded, served through the generated
|
|
4
|
+
* `tokens/fonts.css`. See the repo blueprint, section 4.1.4.
|
|
5
|
+
*
|
|
6
|
+
* **It spends what issue 024 built and holds none of its numbers.** Four custom properties reach
|
|
7
|
+
* this component: `--newtone-icon-family` and `--newtone-icon-weight`, which are read straight, and
|
|
8
|
+
* `--newtone-icon-opsz-min` / `--newtone-icon-opsz-max`, which are the bounds the optical size is
|
|
9
|
+
* clamped into. **The clamp is in icon.css and not here**, and that is forced rather than chosen: a
|
|
10
|
+
* custom property has no value until the browser resolves it, so clamping in JavaScript would mean
|
|
11
|
+
* either reading the computed style on mount -- which makes this a client component and paints the
|
|
12
|
+
* wrong optical size first -- or holding a copy of 20 and 48, which is the second source those two
|
|
13
|
+
* tokens exist to prevent.
|
|
14
|
+
*
|
|
15
|
+
* So the one thing this file computes is the pixel size, and it hands it over as `--newtone-icon-px`. The
|
|
16
|
+
* sheet spends it three times (font size, width, height) and a fourth time inside the clamp.
|
|
17
|
+
*
|
|
18
|
+
* **Three sizes, not five, and it was two until 2026-09-05.** The reference offers xs/sm/md/lg/xl at
|
|
19
|
+
* 16/20/24/32/40. `overview` rendered `md` at three call sites and `xl` at two and nothing at the
|
|
20
|
+
* other three, so this shipped with two --
|
|
21
|
+
* governance/evidence/size-an-api-from-call-sites-not-from-the-type.md. **The sentence that stood here was
|
|
22
|
+
* "a missing size is one line the day something asks for it", and five things were asking**:
|
|
23
|
+
* two band actions, eleven cards in one row, and two more a later issue turned into links. Every
|
|
24
|
+
* one of them is `arrow_outward` and the live page sets every one of them at 20px. So `sm` is here, and all five call sites moved in the same sitting -- three of
|
|
25
|
+
* them in bands already called done, because leaving those at 24 would ship one glyph at two sizes
|
|
26
|
+
* on one page.
|
|
27
|
+
*
|
|
28
|
+
* **What that retires is a concession recorded against a cause that was never true of this file.**
|
|
29
|
+
* Three documents said a third size for one arrow is what the smaller system exists to prevent.
|
|
30
|
+
* **This component is not part of the smaller system**: it was written here, for this rebuild, and
|
|
31
|
+
* Newtone has no opinion about how many sizes it has. The real cause was that nothing had asked --
|
|
32
|
+
* which is a cause that can stop being true, where *the system forbids it* cannot, and being blocked
|
|
33
|
+
* on the wrong one is how the concession survived three sittings unexamined.
|
|
34
|
+
* governance/deferrals/a-block-inherits-its-reason-and-nobody-rechecks-it.md, and the repo blueprint's section
|
|
35
|
+
* 4.1.4 carries the count.
|
|
36
|
+
*
|
|
37
|
+
* **Four as of 2026-09-06, and `lg` arrived exactly the way `sm` did.** A film tile puts a
|
|
38
|
+
* 32px `play_arrow` inside a 48px disc -- measured on the live page, not inferred from a scale --
|
|
39
|
+
* and 32 is the reference's `lg`. So the size is here because something asked, which is the same
|
|
40
|
+
* cause the paragraph above records for `sm` and the same one it says can stop being true.
|
|
41
|
+
* **`xs` (16px) still has no call site** and the counting rule is still refusing it.
|
|
42
|
+
*
|
|
43
|
+
* **No `color` prop, and that one is a refusal rather than a count.** The reference resolves a text
|
|
44
|
+
* role through a theme hook and sets it inline. Newtone forbids a component reading a role
|
|
45
|
+
* (blueprints/newtone/contracts/roles.md, section 3), so the glyph inherits `currentColor` from the
|
|
46
|
+
* text it sits beside -- which is what an icon beside a label wants anyway, and it means the two can
|
|
47
|
+
* never come apart.
|
|
48
|
+
*
|
|
49
|
+
* **`fill` is kept although `overview` passes it nowhere.** Zero of five call sites; the axis has to
|
|
50
|
+
* be written into `font-variation-settings` whichever way it goes, and issue 024 already settled
|
|
51
|
+
* `FILL` as the per-call-site axis on the argument that a filled icon and an outlined one appear on
|
|
52
|
+
* the same page and mean different things. The count is in the blueprint, section 4.1.4, and if the
|
|
53
|
+
* ten sections land without one, the prop goes.
|
|
54
|
+
*
|
|
55
|
+
* **Decorative, always.** The glyph is hidden from assistive technology, so the meaning has to be
|
|
56
|
+
* carried by adjacent text -- which it is at all five call sites. `translate="no"` stops a browser
|
|
57
|
+
* or an extension from translating the ligature text and turning the glyph back into a word.
|
|
58
|
+
*/
|
|
59
|
+
export type IconSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
60
|
+
export interface IconProps extends HTMLAttributes<HTMLElement> {
|
|
61
|
+
/** A Material Symbols ligature -- `trending_up`, `school`, `workspace_premium`. */
|
|
62
|
+
name: string;
|
|
63
|
+
/** 20px, 24px, 32px or 40px. Defaults to `md`, which is what most call sites take. */
|
|
64
|
+
size?: IconSize;
|
|
65
|
+
/** Fill the glyph (the family's `FILL` axis). Defaults to outlined. */
|
|
66
|
+
fill?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export declare function Icon({ name, size, fill, className, style, ...rest }: IconProps): import("react").JSX.Element;
|
|
69
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,OAAO,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAKhD,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC1D,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAA;IACZ,sFAAsF;IACtF,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAW,EAAE,IAAY,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,+BAwB7F"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** The pixel size each token names. The one place a number about an icon's size is written. */
|
|
3
|
+
const SIZE_PX = { sm: 20, md: 24, lg: 32, xl: 40 };
|
|
4
|
+
export function Icon({ name, size = 'md', fill = false, className, style, ...rest }) {
|
|
5
|
+
return (_jsx("span", { className: ['newtone-icon', className].filter(Boolean).join(' '),
|
|
6
|
+
// Two per-instance properties, and neither is a `--newtone-*` one -- this repo reads
|
|
7
|
+
// Newtone's vocabulary and declares none of it (section 5).
|
|
8
|
+
// The caller's style is merged UNDER the two properties below, not over them --
|
|
9
|
+
// unlike `Wrapper`, where the caller wins any tie. These two are what an Icon IS at
|
|
10
|
+
// this size and fill, so a call site that overwrote them would be asking for a
|
|
11
|
+
// different component. A caller may still add a margin.
|
|
12
|
+
style: {
|
|
13
|
+
...style,
|
|
14
|
+
'--newtone-icon-px': SIZE_PX[size],
|
|
15
|
+
'--newtone-icon-fill': fill ? 1 : 0,
|
|
16
|
+
}, translate: "no", "aria-hidden": true, ...rest, children: name }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/icon/icon.tsx"],"names":[],"mappings":";AA8DA,+FAA+F;AAC/F,MAAM,OAAO,GAA6B,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAA;AAW5E,MAAM,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAa;IAC1F,OAAO,CACH,eACI,SAAS,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAChE,qFAAqF;QACrF,4DAA4D;QAC5D,gFAAgF;QAChF,oFAAoF;QACpF,+EAA+E;QAC/E,wDAAwD;QACxD,KAAK,EACD;YACI,GAAG,KAAK;YACR,mBAAmB,EAAE,OAAO,CAAC,IAAI,CAAC;YAClC,qBAAqB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACrB,EAEtB,SAAS,EAAC,IAAI,0BAEV,IAAI,YAEP,IAAI,GACF,CACV,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/icon/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icon/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* A glyph-only link.
|
|
2
|
+
*
|
|
3
|
+
* THE BOX IS A TARGET AND THE GLYPH IS THE CONTENT, which is why the two sizes are unrelated: 44px
|
|
4
|
+
* is a floor for a finger and 20px is what `Icon size="sm"` draws. Shrinking the box to fit the
|
|
5
|
+
* glyph is the failure this component exists to make unavailable.
|
|
6
|
+
*
|
|
7
|
+
* ---- THE TRANSITION THAT IS NOT HERE, AND WHY IT IS NOT -------------------
|
|
8
|
+
*
|
|
9
|
+
* BOTH CALL SITES THIS ARRIVED FROM WRITE `transition: color 120ms ease` AND THIS FILE DOES NOT.
|
|
10
|
+
* Newtone has no motion vocabulary at all -- no duration, no easing, no named transition, and
|
|
11
|
+
* nothing that answers a reader who has asked their machine for less movement. `logo-marquee.css`
|
|
12
|
+
* is the one file in this library that declares motion, and the charter's binding table makes it
|
|
13
|
+
* the reason that component binds this library ALONE.
|
|
14
|
+
*
|
|
15
|
+
* So writing 120ms here would do two things, and the second is the expensive one: it would hard-code
|
|
16
|
+
* a value the shared vocabulary cannot express, which
|
|
17
|
+
* governance/code/a-component-stops-at-a-vocabulary-it-cannot-speak.md forbids by name; and it would
|
|
18
|
+
* make an icon link web-only, when a 44px target around a glyph is a native pattern on both other
|
|
19
|
+
* platforms.
|
|
20
|
+
*
|
|
21
|
+
* WHAT IS LOST IS A 120MS COLOUR FADE ON HOVER. The hover state is unchanged and instant. The
|
|
22
|
+
* trigger for the fade coming back is the token layer gaining a motion vocabulary -- which is one
|
|
23
|
+
* site and one moving thing today, and is not this component's to fire. */
|
|
24
|
+
.newtone-icon-link {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
inline-size: 2.75rem;
|
|
29
|
+
block-size: 2.75rem;
|
|
30
|
+
border-radius: var(--newtone-icon-link-radius);
|
|
31
|
+
color: var(--newtone-icon-link-rest);
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* THE SLOT IS SIZED HERE AND NOT BY WHAT GOES IN IT. A vendored `<svg>` has no intrinsic size worth
|
|
36
|
+
trusting and an `<Icon>` brings its own; stating 20px on the child makes the two interchangeable,
|
|
37
|
+
which is the whole point of the slot. `fill: currentColor` is what lets a brand mark follow the
|
|
38
|
+
rest and hover inks without the caller painting it. */
|
|
39
|
+
.newtone-icon-link > * {
|
|
40
|
+
inline-size: 1.25rem;
|
|
41
|
+
block-size: 1.25rem;
|
|
42
|
+
fill: currentColor;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.newtone-icon-link:hover,
|
|
46
|
+
.newtone-icon-link:focus-visible {
|
|
47
|
+
color: var(--newtone-icon-link-hover);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* The ring is this component's own and is authored in its own token group rather than borrowed from
|
|
51
|
+
`link`, because a ring around a 44px disc and a ring around a word in a sentence are two areas --
|
|
52
|
+
contracts/roles.md section 1. They start at the same four values; that is agreement, not a copy,
|
|
53
|
+
and either may move without the other. */
|
|
54
|
+
.newtone-icon-link:focus-visible {
|
|
55
|
+
outline: 2px solid var(--newtone-icon-link-focus-ring);
|
|
56
|
+
outline-offset: 2px;
|
|
57
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface IconLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> {
|
|
3
|
+
href: string;
|
|
4
|
+
/**
|
|
5
|
+
* The accessible name, and the only name this control has. Required: a link whose whole content
|
|
6
|
+
* is a decorative mark is a link with no text, which is the single most common way a row of
|
|
7
|
+
* social marks reaches a screen reader as *link, link, link*.
|
|
8
|
+
*/
|
|
9
|
+
label: string;
|
|
10
|
+
/**
|
|
11
|
+
* The mark. A slot rather than an `icon` name, and that was settled by the call sites rather
|
|
12
|
+
* than guessed -- see the docblock.
|
|
13
|
+
*/
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A link whose whole content is one mark -- a social account, a profile, an outward pointer in a
|
|
18
|
+
* row of them.
|
|
19
|
+
*
|
|
20
|
+
* **It is 44px around a 20px mark, and the 44 is the reason it is a component.** Both hand-written
|
|
21
|
+
* copies this replaced drew a 2.75rem box around a 1.25rem mark, and both got it right; the point
|
|
22
|
+
* is that the number is a floor rather than a taste -- the smallest target a finger reliably hits --
|
|
23
|
+
* and a floor written at each call site is a floor one call site eventually gets wrong.
|
|
24
|
+
*
|
|
25
|
+
* ---- why the mark is a SLOT and not an `icon` name ------------------------
|
|
26
|
+
*
|
|
27
|
+
* **The first draft took `icon: string` and rendered an `Icon`, and not one real call site could
|
|
28
|
+
* have used it.** Every known one passes a brand mark as inline SVG -- Instagram, TikTok, YouTube,
|
|
29
|
+
* Facebook, LinkedIn -- and **Material Symbols has a sun and a moon and has no Instagram.** A
|
|
30
|
+
* component that can only hold a ligature would have been sized from the box and not from what goes
|
|
31
|
+
* in it. governance/evidence/size-an-api-from-call-sites-not-from-the-type.md.
|
|
32
|
+
*
|
|
33
|
+
* So the slot is the interface: **the box, the floor and the name are this component's; the mark is
|
|
34
|
+
* the caller's.** An `<Icon>` passed in works exactly as a vendored `<svg>` does, and the sheet
|
|
35
|
+
* sizes whatever arrives.
|
|
36
|
+
*
|
|
37
|
+
* **There is no visible-label variant, and that is a refusal rather than an omission.** A mark with
|
|
38
|
+
* a word beside it is a `Link` with something in it and already works. What has no other spelling is
|
|
39
|
+
* the case where the mark IS the content.
|
|
40
|
+
*
|
|
41
|
+
* **It carries no `target` or `rel` of its own.** Every existing call site points off-site, so the
|
|
42
|
+
* temptation is to default `target="_blank"` here; opening a new tab is a decision about the
|
|
43
|
+
* reader's journey and belongs to the page that knows what the journey is. The attributes pass
|
|
44
|
+
* through, so a caller says it in one place.
|
|
45
|
+
*/
|
|
46
|
+
export declare function IconLink({ href, label, children, className, ...rest }: IconLinkProps): import("react").JSX.Element;
|
|
47
|
+
//# sourceMappingURL=icon-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-link.d.ts","sourceRoot":"","sources":["../../src/icon-link/icon-link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5D,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC5F,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAA;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,+BAcpF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* A link whose whole content is one mark -- a social account, a profile, an outward pointer in a
|
|
4
|
+
* row of them.
|
|
5
|
+
*
|
|
6
|
+
* **It is 44px around a 20px mark, and the 44 is the reason it is a component.** Both hand-written
|
|
7
|
+
* copies this replaced drew a 2.75rem box around a 1.25rem mark, and both got it right; the point
|
|
8
|
+
* is that the number is a floor rather than a taste -- the smallest target a finger reliably hits --
|
|
9
|
+
* and a floor written at each call site is a floor one call site eventually gets wrong.
|
|
10
|
+
*
|
|
11
|
+
* ---- why the mark is a SLOT and not an `icon` name ------------------------
|
|
12
|
+
*
|
|
13
|
+
* **The first draft took `icon: string` and rendered an `Icon`, and not one real call site could
|
|
14
|
+
* have used it.** Every known one passes a brand mark as inline SVG -- Instagram, TikTok, YouTube,
|
|
15
|
+
* Facebook, LinkedIn -- and **Material Symbols has a sun and a moon and has no Instagram.** A
|
|
16
|
+
* component that can only hold a ligature would have been sized from the box and not from what goes
|
|
17
|
+
* in it. governance/evidence/size-an-api-from-call-sites-not-from-the-type.md.
|
|
18
|
+
*
|
|
19
|
+
* So the slot is the interface: **the box, the floor and the name are this component's; the mark is
|
|
20
|
+
* the caller's.** An `<Icon>` passed in works exactly as a vendored `<svg>` does, and the sheet
|
|
21
|
+
* sizes whatever arrives.
|
|
22
|
+
*
|
|
23
|
+
* **There is no visible-label variant, and that is a refusal rather than an omission.** A mark with
|
|
24
|
+
* a word beside it is a `Link` with something in it and already works. What has no other spelling is
|
|
25
|
+
* the case where the mark IS the content.
|
|
26
|
+
*
|
|
27
|
+
* **It carries no `target` or `rel` of its own.** Every existing call site points off-site, so the
|
|
28
|
+
* temptation is to default `target="_blank"` here; opening a new tab is a decision about the
|
|
29
|
+
* reader's journey and belongs to the page that knows what the journey is. The attributes pass
|
|
30
|
+
* through, so a caller says it in one place.
|
|
31
|
+
*/
|
|
32
|
+
export function IconLink({ href, label, children, className, ...rest }) {
|
|
33
|
+
return (_jsx("a", { href: href, className: ['newtone-icon-link', className].filter(Boolean).join(' '), "aria-label": label, ...rest, children: children }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=icon-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-link.js","sourceRoot":"","sources":["../../src/icon-link/icon-link.tsx"],"names":[],"mappings":";AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAiB;IACjF,OAAO,CACH,YACI,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAIzD,KAAK,KACb,IAAI,YAEP,QAAQ,GACT,CACP,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/icon-link/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icon-link/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type Seeds } from '../color/index.js';
|
|
3
|
+
import { type SurfaceProps } from '../surface/index.js';
|
|
4
|
+
export interface IdentityProps extends Omit<SurfaceProps, 'children'> {
|
|
5
|
+
/**
|
|
6
|
+
* The palettes to re-derive here, shaped exactly like `seed.json`: group, then palette,
|
|
7
|
+
* then a hue and a saturation. Anything not named is inherited from the enclosing scope,
|
|
8
|
+
* so overriding `system.accent` alone gives a subtree wearing another brand over the
|
|
9
|
+
* site's own neutrals.
|
|
10
|
+
*/
|
|
11
|
+
seeds: Seeds;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A scoped seed set.
|
|
16
|
+
*
|
|
17
|
+
* Only the core layer is identity-dependent, so this writes fifty-one colour values per
|
|
18
|
+
* palette named and nothing else. The role layer's references and every component below
|
|
19
|
+
* them are untouched, because they never held a colour.
|
|
20
|
+
*
|
|
21
|
+
* Nesting is free: these are custom properties on an element, and CSS already inherits
|
|
22
|
+
* them down. An Identity inside an Identity composes with no code here.
|
|
23
|
+
*/
|
|
24
|
+
export declare function Identity({ seeds, style, ...rest }: IdentityProps): import("react").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/identity/identity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEhE,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;IACjE;;;;;OAKG;IACH,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,+BAShE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { seedProperties } from '../color/index.js';
|
|
4
|
+
import { Surface } from '../surface/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* A scoped seed set.
|
|
7
|
+
*
|
|
8
|
+
* Only the core layer is identity-dependent, so this writes fifty-one colour values per
|
|
9
|
+
* palette named and nothing else. The role layer's references and every component below
|
|
10
|
+
* them are untouched, because they never held a colour.
|
|
11
|
+
*
|
|
12
|
+
* Nesting is free: these are custom properties on an element, and CSS already inherits
|
|
13
|
+
* them down. An Identity inside an Identity composes with no code here.
|
|
14
|
+
*/
|
|
15
|
+
export function Identity({ seeds, style, ...rest }) {
|
|
16
|
+
const vars = useMemo(() => {
|
|
17
|
+
// seedProperties asks CSS.supports which coordinate to write, so it needs the DOM.
|
|
18
|
+
// There is no server story yet; see the blueprint's section 8.
|
|
19
|
+
if (typeof document === 'undefined')
|
|
20
|
+
return {};
|
|
21
|
+
return seedProperties(seeds);
|
|
22
|
+
}, [seeds]);
|
|
23
|
+
return _jsx(Surface, { ...rest, style: { ...vars, ...style } });
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/identity/identity.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAsC,MAAM,OAAO,CAAA;AACnE,OAAO,EAAE,cAAc,EAAc,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAqB,MAAM,qBAAqB,CAAA;AAahE;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,EAAiB;IAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE;QACtB,mFAAmF;QACnF,+DAA+D;QAC/D,IAAI,OAAO,QAAQ,KAAK,WAAW;YAAE,OAAO,EAAE,CAAA;QAC9C,OAAO,cAAc,CAAC,KAAK,CAAC,CAAA;IAChC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,OAAO,KAAC,OAAO,OAAK,IAAI,EAAE,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAmB,GAAI,CAAA;AAC/E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export { Surface } from './surface/index.js';
|
|
2
|
+
export type { SurfaceProps, Theme, Elevation, Mode } from './surface/index.js';
|
|
3
|
+
export { Wrapper } from './wrapper/index.js';
|
|
4
|
+
export type { WrapperProps, WrapperDirection, WrapperAlign, WrapperPadding, SpaceStep, } from './wrapper/index.js';
|
|
5
|
+
export { Button } from './button/index.js';
|
|
6
|
+
export type { ButtonProps, ButtonVariant } from './button/index.js';
|
|
7
|
+
export { Link } from './link/index.js';
|
|
8
|
+
export type { LinkProps, LinkVariant } from './link/index.js';
|
|
9
|
+
export { Text } from './text/index.js';
|
|
10
|
+
export type { TextProps, TextScale, TextFont, TextWeight, TextCase, TextFigures } from './text/index.js';
|
|
11
|
+
export { Navbar } from './navbar/index.js';
|
|
12
|
+
export type { NavbarProps, NavbarBrandProps, NavbarLinksProps, NavbarLinkProps, NavbarActionsProps, NavbarMenuButtonProps, } from './navbar/index.js';
|
|
13
|
+
export { Identity } from './identity/index.js';
|
|
14
|
+
export type { IdentityProps } from './identity/index.js';
|
|
15
|
+
export { Icon } from './icon/index.js';
|
|
16
|
+
export type { IconProps, IconSize } from './icon/index.js';
|
|
17
|
+
export { FramedIcon } from './framed-icon/index.js';
|
|
18
|
+
export type { FramedIconProps, FramedIconShape } from './framed-icon/index.js';
|
|
19
|
+
export { CardBox } from './card-box/index.js';
|
|
20
|
+
export type { CardBoxProps } from './card-box/index.js';
|
|
21
|
+
export { CardGrid } from './card-grid/index.js';
|
|
22
|
+
export type { CardGridProps } from './card-grid/index.js';
|
|
23
|
+
export { Tag } from './tag/index.js';
|
|
24
|
+
export type { TagProps, TagTone } from './tag/index.js';
|
|
25
|
+
export { StatCard } from './stat-card/index.js';
|
|
26
|
+
export type { StatCardProps } from './stat-card/index.js';
|
|
27
|
+
export { FeatureCard } from './feature-card/index.js';
|
|
28
|
+
export type { FeatureCardProps } from './feature-card/index.js';
|
|
29
|
+
export { LogoMarquee } from './logo-marquee/index.js';
|
|
30
|
+
export type { LogoMarqueeProps } from './logo-marquee/index.js';
|
|
31
|
+
export { Accordion } from './accordion/index.js';
|
|
32
|
+
export type { AccordionProps, AccordionItem } from './accordion/index.js';
|
|
33
|
+
export { SegmentedControl } from './segmented-control/index.js';
|
|
34
|
+
export type { SegmentedControlProps, SegmentedControlOption } from './segmented-control/index.js';
|
|
35
|
+
export { VideoLightbox } from './video-lightbox/index.js';
|
|
36
|
+
export type { VideoLightboxProps } from './video-lightbox/index.js';
|
|
37
|
+
export { Gallery } from './gallery/index.js';
|
|
38
|
+
export type { GalleryProps, GalleryImage } from './gallery/index.js';
|
|
39
|
+
export { MediaPlate } from './media-plate/index.js';
|
|
40
|
+
export type { MediaPlateProps } from './media-plate/index.js';
|
|
41
|
+
export { Avatar } from './avatar/index.js';
|
|
42
|
+
export type { AvatarProps } from './avatar/index.js';
|
|
43
|
+
export { IconLink } from './icon-link/index.js';
|
|
44
|
+
export type { IconLinkProps } from './icon-link/index.js';
|
|
45
|
+
export { NumberedList } from './numbered-list/index.js';
|
|
46
|
+
export type { NumberedListProps } from './numbered-list/index.js';
|
|
47
|
+
export { DataList } from './data-list/index.js';
|
|
48
|
+
export type { DataListProps, DataListRowProps } from './data-list/index.js';
|
|
49
|
+
export { Control } from './control/index.js';
|
|
50
|
+
export type { ControlProps, ControlVariant, ControlSize } from './control/index.js';
|
|
51
|
+
export { Action } from './action/index.js';
|
|
52
|
+
export type { ActionProps } from './action/index.js';
|
|
53
|
+
export { QuickAction } from './quick-action/index.js';
|
|
54
|
+
export type { QuickActionProps } from './quick-action/index.js';
|
|
55
|
+
export { maxChroma, deriveScale, seedProperties, validateSeeds, oklchToHex, oklchToLinearSrgb, hexToOklch, cssNumber, STEPS, } from './color/index.js';
|
|
56
|
+
export type { Oklch, Gamut, PaletteStep, Seed, SeedGroup, Seeds } from './color/index.js';
|
|
57
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { Surface } from './surface/index.js';
|
|
2
|
+
export { Wrapper } from './wrapper/index.js';
|
|
3
|
+
export { Button } from './button/index.js';
|
|
4
|
+
export { Link } from './link/index.js';
|
|
5
|
+
export { Text } from './text/index.js';
|
|
6
|
+
export { Navbar } from './navbar/index.js';
|
|
7
|
+
export { Identity } from './identity/index.js';
|
|
8
|
+
export { Icon } from './icon/index.js';
|
|
9
|
+
export { FramedIcon } from './framed-icon/index.js';
|
|
10
|
+
export { CardBox } from './card-box/index.js';
|
|
11
|
+
export { CardGrid } from './card-grid/index.js';
|
|
12
|
+
export { Tag } from './tag/index.js';
|
|
13
|
+
export { StatCard } from './stat-card/index.js';
|
|
14
|
+
export { FeatureCard } from './feature-card/index.js';
|
|
15
|
+
export { LogoMarquee } from './logo-marquee/index.js';
|
|
16
|
+
export { Accordion } from './accordion/index.js';
|
|
17
|
+
export { SegmentedControl } from './segmented-control/index.js';
|
|
18
|
+
export { VideoLightbox } from './video-lightbox/index.js';
|
|
19
|
+
export { Gallery } from './gallery/index.js';
|
|
20
|
+
export { MediaPlate } from './media-plate/index.js';
|
|
21
|
+
export { Avatar } from './avatar/index.js';
|
|
22
|
+
export { IconLink } from './icon-link/index.js';
|
|
23
|
+
export { NumberedList } from './numbered-list/index.js';
|
|
24
|
+
export { DataList } from './data-list/index.js';
|
|
25
|
+
export { Control } from './control/index.js';
|
|
26
|
+
export { Action } from './action/index.js';
|
|
27
|
+
export { QuickAction } from './quick-action/index.js';
|
|
28
|
+
export { maxChroma, deriveScale, seedProperties, validateSeeds, oklchToHex, oklchToLinearSrgb, hexToOklch, cssNumber, STEPS, } from './color/index.js';
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAQ5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAS1C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EACH,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,KAAK,GACR,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* Link's own styles. Every colour is a link.* token; nothing here names a colour, nothing here
|
|
2
|
+
mentions a facet, and nothing here reads a role or another component's group -- see
|
|
3
|
+
contracts/link.md, "How you know a library conforms", check 4.
|
|
4
|
+
|
|
5
|
+
Underline thickness and offset are literals, on the same decision that blocks radius and border
|
|
6
|
+
width in button.css: they are lengths, and the tokens repo has no length scale to point at.
|
|
7
|
+
Adding one for a single component is the move the system exists to prevent. */
|
|
8
|
+
|
|
9
|
+
.newtone-link {
|
|
10
|
+
color: var(--newtone-link-inline-rest-text);
|
|
11
|
+
text-decoration-line: underline;
|
|
12
|
+
text-decoration-color: var(--newtone-link-inline-rest-underline);
|
|
13
|
+
text-decoration-thickness: 1px;
|
|
14
|
+
text-underline-offset: 2px;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* :focus-visible, not :focus -- the contract is explicit, and focus is not optional. The ring is
|
|
19
|
+
per variant: it sits against that variant's own ground and covers a different amount of it. */
|
|
20
|
+
.newtone-link:focus-visible {
|
|
21
|
+
outline: 2px solid;
|
|
22
|
+
outline-offset: 2px;
|
|
23
|
+
border-radius: var(--newtone-link-radius);
|
|
24
|
+
}
|
|
25
|
+
.newtone-link--inline:focus-visible {
|
|
26
|
+
outline-color: var(--newtone-link-inline-focus-ring);
|
|
27
|
+
}
|
|
28
|
+
.newtone-link--standalone:focus-visible {
|
|
29
|
+
outline-color: var(--newtone-link-standalone-focus-ring);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* `inline` is underlined at rest and there is no way to turn it off. Inside a sentence colour is
|
|
33
|
+
the only other cue available, and colour alone does not survive a reader who cannot separate it
|
|
34
|
+
from the surrounding text. That makes the underline a floor rather than a style, which is why it
|
|
35
|
+
is written here as a fact instead of offered as a token -- a token would be a supported way to
|
|
36
|
+
break it. The underline carries its OWN colour, lower in contrast than the text: a full-strength
|
|
37
|
+
rule under a word is heavier than the word, and three links in a paragraph become a fence. */
|
|
38
|
+
.newtone-link--inline {
|
|
39
|
+
color: var(--newtone-link-inline-rest-text);
|
|
40
|
+
text-decoration-color: var(--newtone-link-inline-rest-underline);
|
|
41
|
+
}
|
|
42
|
+
.newtone-link--inline:hover {
|
|
43
|
+
color: var(--newtone-link-inline-hover-text);
|
|
44
|
+
text-decoration-color: var(--newtone-link-inline-hover-underline);
|
|
45
|
+
}
|
|
46
|
+
.newtone-link--inline:active {
|
|
47
|
+
color: var(--newtone-link-inline-pressed-text);
|
|
48
|
+
text-decoration-color: var(--newtone-link-inline-pressed-underline);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* `standalone` is button.md's description of tertiary minus the box: no fill, no border, and
|
|
52
|
+
nothing until interacted with. `transparent` at rest is the token's value, not this file's
|
|
53
|
+
choice -- the underline appears on hover because link.json says so. */
|
|
54
|
+
.newtone-link--standalone {
|
|
55
|
+
color: var(--newtone-link-standalone-rest-text);
|
|
56
|
+
text-decoration-color: var(--newtone-link-standalone-rest-underline);
|
|
57
|
+
}
|
|
58
|
+
.newtone-link--standalone:hover {
|
|
59
|
+
color: var(--newtone-link-standalone-hover-text);
|
|
60
|
+
text-decoration-color: var(--newtone-link-standalone-hover-underline);
|
|
61
|
+
}
|
|
62
|
+
.newtone-link--standalone:active {
|
|
63
|
+
color: var(--newtone-link-standalone-pressed-text);
|
|
64
|
+
text-decoration-color: var(--newtone-link-standalone-pressed-underline);
|
|
65
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type LinkVariant = 'inline' | 'standalone';
|
|
3
|
+
export interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'children' | 'href'> {
|
|
4
|
+
/**
|
|
5
|
+
* Where the link sits, not how heavy it is. `inline` is a destination named inside a running
|
|
6
|
+
* sentence; `standalone` is an action on a line of its own.
|
|
7
|
+
*
|
|
8
|
+
* **It defaults, and Button's `variant` deliberately does not.** A Button's variant is a choice
|
|
9
|
+
* about emphasis the caller always has an opinion about. A Link's variant is a fact about where
|
|
10
|
+
* the link already is, and nearly every link is inside a sentence. A default that matches the
|
|
11
|
+
* common case is not a default that hides a decision. See contracts/link.md, "Props".
|
|
12
|
+
*/
|
|
13
|
+
variant?: LinkVariant;
|
|
14
|
+
/**
|
|
15
|
+
* Required, and by the type rather than by a runtime check. **A Link with no destination is a
|
|
16
|
+
* Button.** This is the one place link.md is stricter than button.md.
|
|
17
|
+
*/
|
|
18
|
+
href: string;
|
|
19
|
+
/** The `label` slot. Required; a Link has no other slot in v1. */
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Discharges blueprints/newtone/contracts/link.md.
|
|
24
|
+
*
|
|
25
|
+
* **Link takes no facet props**, for the same reason Button does not: every colour it uses is a
|
|
26
|
+
* `link.*` token pointing at a palette step, and the Surface it sits on decides which theme those
|
|
27
|
+
* resolve in. An `inline` link inside an `emphasis` region re-colours with nothing passed to it.
|
|
28
|
+
*
|
|
29
|
+
* **It reads no `button.*` token, and that is the near-miss this component is most likely to
|
|
30
|
+
* suffer.** `standalone` and `button.tertiary` hold nearly the same values; pointing one at the
|
|
31
|
+
* other would look like removing a duplication. It is the error roles.md section 3 forbids one
|
|
32
|
+
* level up, repeated one level over -- two things that agree today are not therefore one thing.
|
|
33
|
+
*
|
|
34
|
+
* The underline on `inline` is not optional and there is no prop for it. Inside a sentence colour
|
|
35
|
+
* is the only other cue available, so it is an accessibility floor rather than a style.
|
|
36
|
+
*/
|
|
37
|
+
export declare function Link({ variant, href, children, className, ...rest }: LinkProps): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/link/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5D,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,YAAY,CAAA;AAEjD,MAAM,WAAW,SAAU,SAAQ,IAAI,CACnC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,MAAM,CACtB;IACG;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,kEAAkE;IAClE,QAAQ,EAAE,SAAS,CAAA;CACtB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,EAAE,OAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,+BAYzF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Discharges blueprints/newtone/contracts/link.md.
|
|
4
|
+
*
|
|
5
|
+
* **Link takes no facet props**, for the same reason Button does not: every colour it uses is a
|
|
6
|
+
* `link.*` token pointing at a palette step, and the Surface it sits on decides which theme those
|
|
7
|
+
* resolve in. An `inline` link inside an `emphasis` region re-colours with nothing passed to it.
|
|
8
|
+
*
|
|
9
|
+
* **It reads no `button.*` token, and that is the near-miss this component is most likely to
|
|
10
|
+
* suffer.** `standalone` and `button.tertiary` hold nearly the same values; pointing one at the
|
|
11
|
+
* other would look like removing a duplication. It is the error roles.md section 3 forbids one
|
|
12
|
+
* level up, repeated one level over -- two things that agree today are not therefore one thing.
|
|
13
|
+
*
|
|
14
|
+
* The underline on `inline` is not optional and there is no prop for it. Inside a sentence colour
|
|
15
|
+
* is the only other cue available, so it is an accessibility floor rather than a style.
|
|
16
|
+
*/
|
|
17
|
+
export function Link({ variant = 'inline', href, children, className, ...rest }) {
|
|
18
|
+
return (_jsx("a", { href: href, className: ['newtone-link', `newtone-link--${variant}`, className]
|
|
19
|
+
.filter(Boolean)
|
|
20
|
+
.join(' '), ...rest, children: children }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/link/link.tsx"],"names":[],"mappings":";AA2BA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAa;IACtF,OAAO,CACH,YACI,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,CAAC,cAAc,EAAE,iBAAiB,OAAO,EAAE,EAAE,SAAS,CAAC;aAC7D,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACV,IAAI,YAEP,QAAQ,GACT,CACP,CAAA;AACL,CAAC"}
|