@cityofportland/components-react 1.0.0-alpha.3 → 1.0.0-alpha.5
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/README.md +30 -259
- package/dist/alert/alert.css +1 -0
- package/dist/alert/alert.d.ts +95 -0
- package/dist/alert/alert.es.js +88 -0
- package/dist/box/box.css +1 -0
- package/dist/box/box.d.ts +89 -0
- package/dist/box/box.es.js +56 -0
- package/dist/button/button.css +1 -0
- package/dist/button/button.d.ts +128 -0
- package/dist/button/button.es.js +40 -0
- package/dist/card/card.css +1 -0
- package/dist/card/card.d.ts +66 -0
- package/dist/card/card.es.js +75 -0
- package/dist/city-seal/city-seal.css +1 -0
- package/dist/city-seal/city-seal.d.ts +39 -0
- package/dist/city-seal/city-seal.es.js +17 -0
- package/dist/footer/footer.css +1 -0
- package/dist/footer/footer.d.ts +63 -0
- package/dist/footer/footer.es.js +10987 -0
- package/dist/header/header.css +1 -0
- package/dist/header/header.d.ts +85 -0
- package/dist/header/header.es.js +44 -0
- package/dist/icon/icon.css +1 -0
- package/dist/icon/icon.d.ts +31 -0
- package/dist/icon/icon.es.js +31 -0
- package/dist/index-IqW719eK.js +1484 -0
- package/dist/tag/tag.css +1 -0
- package/dist/tag/tag.d.ts +28 -0
- package/dist/tag/tag.es.js +17 -0
- package/dist/utilities/utilities.css +1 -0
- package/dist/utils-DpTd6iI4.js +7 -0
- package/package.json +9 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after{--tw-font-weight:initial}::backdrop{--tw-font-weight:initial}}}@layer components{.header{width:100%;padding-block:var(--spacing-md,1rem);padding-inline:var(--spacing-xl,1.5rem);justify-content:space-between;align-items:center;gap:var(--spacing-sm,.75rem);flex-wrap:wrap;display:flex}.header__branding{align-items:center;gap:var(--spacing-md,1rem);font-size:var(--text-heading-lg,1.34375rem);--tw-font-weight:var(--font-weight-bold,700);font-weight:var(--font-weight-bold,700);flex:none;display:flex}.header__branding .header__logo{flex:none;justify-content:center;align-items:center;display:inline-flex}.header__branding .header__title{gap:var(--spacing-xs,.5rem);flex-direction:column;display:flex}.header__content{align-items:center;gap:var(--spacing-lg,1.25rem);flex-wrap:wrap;display:flex}.header__nav-list{margin:var(--spacing-none,0);padding:var(--spacing-none,0);align-items:center;gap:var(--spacing-lg,1.25rem);flex-direction:row;list-style-type:none;display:flex}.header__nav-item{margin:var(--spacing-none,0)}}@property --tw-font-weight{syntax:"*";inherits:false}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Available color schemes based on design system color tokens
|
|
5
|
+
*/
|
|
6
|
+
declare const BOX_COLORS: readonly ["default", "inverse", "primary", "secondary", "success", "danger", "warning", "info", "fixed", "disabled", "fixed"];
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Available color variations based on design system tokens
|
|
10
|
+
*/
|
|
11
|
+
declare const BOX_VARIANTS: readonly ["subtle", "moderate", "emphasis", "strong", "light", "dark"];
|
|
12
|
+
|
|
13
|
+
declare type BoxColorScheme = (typeof BOX_COLORS)[number];
|
|
14
|
+
|
|
15
|
+
declare type BoxColorVariation = (typeof BOX_VARIANTS)[number];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Core box properties shared across all framework implementations
|
|
19
|
+
*/
|
|
20
|
+
declare interface BoxProps {
|
|
21
|
+
/**
|
|
22
|
+
* HTML element type to render the Box as. Defaults to 'div'.
|
|
23
|
+
* @default "div"
|
|
24
|
+
*/
|
|
25
|
+
as?: keyof HTMLElementTagNameMap;
|
|
26
|
+
/**
|
|
27
|
+
* Color scheme for background and content colors
|
|
28
|
+
*/
|
|
29
|
+
color?: BoxColorScheme;
|
|
30
|
+
/**
|
|
31
|
+
* Color variation within the chosen color scheme
|
|
32
|
+
*/
|
|
33
|
+
variant?: BoxColorVariation;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Default HTML element type for the Box component
|
|
38
|
+
*/
|
|
39
|
+
declare type DefaultElementType = "div";
|
|
40
|
+
|
|
41
|
+
export declare const Header: default_2.FC<ReactHeaderProps>;
|
|
42
|
+
|
|
43
|
+
export declare const HeaderBranding: <E extends HeaderBrandingTypes = "a">({ children, className, ...props }: ReactHeaderBrandingProps<E>) => default_2.JSX.Element;
|
|
44
|
+
|
|
45
|
+
declare type HeaderBrandingTypes = "a" | "div" | "span";
|
|
46
|
+
|
|
47
|
+
export declare const HeaderContent: default_2.FC<ReactHeaderContentProps>;
|
|
48
|
+
|
|
49
|
+
export declare const HeaderLogo: default_2.FC<ReactHeaderLogoProps>;
|
|
50
|
+
|
|
51
|
+
export declare const HeaderNavLink: default_2.FC<ReactHeaderNavLinkProps>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Props that are specific to the React implementation
|
|
55
|
+
*/
|
|
56
|
+
declare type ReactBoxOwnProps<E extends default_2.ElementType = DefaultElementType> = Omit<BoxProps, "as"> & {
|
|
57
|
+
/**
|
|
58
|
+
* The HTML element or React component to render as
|
|
59
|
+
* @default "div"
|
|
60
|
+
*/
|
|
61
|
+
as?: E;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Polymorphic Box props that merge own props with the element's native props
|
|
66
|
+
* Omits props that are defined in our own props to avoid conflicts
|
|
67
|
+
*/
|
|
68
|
+
declare type ReactBoxProps<E extends default_2.ElementType = DefaultElementType> = ReactBoxOwnProps<E> & Omit<default_2.ComponentPropsWithoutRef<E>, keyof ReactBoxOwnProps<E>>;
|
|
69
|
+
|
|
70
|
+
export declare type ReactHeaderBrandingProps<E extends HeaderBrandingTypes = "a"> = ReactBoxProps<E> & {
|
|
71
|
+
children?: default_2.ReactNode;
|
|
72
|
+
className?: string;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export declare type ReactHeaderContentProps = default_2.PropsWithChildren;
|
|
76
|
+
|
|
77
|
+
export declare type ReactHeaderLogoProps = default_2.PropsWithChildren;
|
|
78
|
+
|
|
79
|
+
export declare type ReactHeaderNavLinkProps = default_2.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
80
|
+
href?: string;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export declare type ReactHeaderProps = default_2.PropsWithChildren<Omit<ReactBoxProps<"header">, "as">>;
|
|
84
|
+
|
|
85
|
+
export { }
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { j as s } from "../index-IqW719eK.js";
|
|
2
|
+
import { Box as t } from "../box/box.es.js";
|
|
3
|
+
import { CitySeal as i } from "../city-seal/city-seal.es.js";
|
|
4
|
+
import { m } from "../utils-DpTd6iI4.js";
|
|
5
|
+
const j = ({
|
|
6
|
+
children: e,
|
|
7
|
+
className: a,
|
|
8
|
+
...r
|
|
9
|
+
}) => /* @__PURE__ */ s.jsx(t, { className: m(["header__branding"], a), ...r, children: e }), p = ({
|
|
10
|
+
children: e = /* @__PURE__ */ s.jsx(i, { size: "sm" })
|
|
11
|
+
}) => /* @__PURE__ */ s.jsx("span", { className: "header__logo", children: e }), N = ({
|
|
12
|
+
children: e
|
|
13
|
+
}) => /* @__PURE__ */ s.jsx("div", { className: "header__content", children: e }), _ = ({
|
|
14
|
+
children: e,
|
|
15
|
+
href: a = "#",
|
|
16
|
+
className: r = "",
|
|
17
|
+
...o
|
|
18
|
+
}) => {
|
|
19
|
+
const n = m(["link", r]);
|
|
20
|
+
return /* @__PURE__ */ s.jsx("a", { href: a, className: n, ...o, children: e });
|
|
21
|
+
}, f = ({
|
|
22
|
+
children: e,
|
|
23
|
+
className: a,
|
|
24
|
+
color: r,
|
|
25
|
+
variant: o,
|
|
26
|
+
...n
|
|
27
|
+
}) => /* @__PURE__ */ s.jsx(
|
|
28
|
+
t,
|
|
29
|
+
{
|
|
30
|
+
as: "header",
|
|
31
|
+
color: r,
|
|
32
|
+
variant: o,
|
|
33
|
+
className: ["header", a].filter(Boolean).join(" "),
|
|
34
|
+
...n,
|
|
35
|
+
children: e
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
export {
|
|
39
|
+
f as Header,
|
|
40
|
+
j as HeaderBranding,
|
|
41
|
+
N as HeaderContent,
|
|
42
|
+
p as HeaderLogo,
|
|
43
|
+
_ as HeaderNavLink
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.icon,.icon svg{fill:currentColor;flex-shrink:0;width:auto;display:block}:is(.icon,.icon svg).icon--xs{height:var(--height-400,1rem)}:is(.icon,.icon svg).icon--xs svg{height:var(--height-400,1rem)}:is(.icon,.icon svg).icon--sm{height:var(--height-600,1.5rem)}:is(.icon,.icon svg).icon--sm svg{height:var(--height-600,1.5rem)}:is(.icon,.icon svg).icon--md{height:var(--height-1000,2.5rem)}:is(.icon,.icon svg).icon--md svg{height:var(--height-1000,2.5rem)}:is(.icon,.icon svg).icon--lg{height:var(--height-1500,3.75rem)}:is(.icon,.icon svg).icon--lg svg{height:var(--height-1500,3.75rem)}}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare const Icon: default_2.FC<ReactIconProps>;
|
|
4
|
+
|
|
5
|
+
declare const ICON_SIZES: readonly ["xs", "sm", "md", "lg"];
|
|
6
|
+
|
|
7
|
+
declare type IconDefinition = {
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
comments?: string[];
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
paths: {
|
|
14
|
+
d: string;
|
|
15
|
+
fill?: string;
|
|
16
|
+
[index: string]: string | undefined;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
declare interface IconProps {
|
|
21
|
+
icon: IconDefinition;
|
|
22
|
+
size?: IconSize;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare type IconSize = (typeof ICON_SIZES)[number];
|
|
26
|
+
|
|
27
|
+
export declare interface ReactIconProps extends IconProps {
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as r } from "../index-IqW719eK.js";
|
|
2
|
+
function c({
|
|
3
|
+
className: i = "",
|
|
4
|
+
size: s
|
|
5
|
+
}) {
|
|
6
|
+
const t = /* @__PURE__ */ new Set(["icon"]);
|
|
7
|
+
return s && t.add(`icon--${s}`), i && i.split(" ").forEach((o) => t.add(o)), Array.from(t).join(" ");
|
|
8
|
+
}
|
|
9
|
+
const d = ({
|
|
10
|
+
className: i,
|
|
11
|
+
icon: s,
|
|
12
|
+
size: t,
|
|
13
|
+
...o
|
|
14
|
+
}) => {
|
|
15
|
+
const n = c({
|
|
16
|
+
className: i,
|
|
17
|
+
size: t
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ r.jsx(
|
|
20
|
+
"svg",
|
|
21
|
+
{
|
|
22
|
+
viewBox: `0 0 ${s.width} ${s.height}`,
|
|
23
|
+
className: n,
|
|
24
|
+
...o,
|
|
25
|
+
children: s.paths.map((a) => /* @__PURE__ */ r.jsx("path", { ...a }))
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
d as Icon
|
|
31
|
+
};
|