@cityofportland/components-react 1.0.0-alpha.3 → 1.0.0-alpha.4
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 +11 -0
- package/dist/alert/alert.es.js +3473 -0
- package/dist/alert/index.d.ts +1 -0
- package/dist/box/box.d.ts +51 -0
- package/dist/box/box.es.js +4 -0
- package/dist/box/index.d.ts +1 -0
- package/dist/button/button.css +1 -0
- package/dist/button/button.d.ts +9 -0
- package/dist/button/button.es.js +34 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/city-seal/city-seal.css +1 -0
- package/dist/city-seal/city-seal.d.ts +18 -0
- package/dist/city-seal/city-seal.es.js +22 -0
- package/dist/city-seal/index.d.ts +1 -0
- package/dist/footer/footer.css +1 -0
- package/dist/footer/footer.d.ts +19 -0
- package/dist/footer/footer.es.js +10987 -0
- package/dist/footer/footer.test.d.ts +1 -0
- package/dist/footer/index.d.ts +1 -0
- package/dist/header/header.css +1 -0
- package/dist/header/header.d.ts +19 -0
- package/dist/header/header.es.js +43 -0
- package/dist/header/index.d.ts +1 -0
- package/dist/index/index.css +1 -0
- package/dist/index-C4cFhgXK.js +68 -0
- package/dist/index-IqW719eK.js +1484 -0
- package/dist/tag/index.d.ts +1 -0
- package/dist/tag/tag.css +1 -0
- package/dist/tag/tag.d.ts +7 -0
- package/dist/tag/tag.es.js +16 -0
- package/dist/utils.d.ts +3 -0
- package/package.json +8 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './alert';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BoxProps } from '@cityofportland/types/box';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Default HTML element type for the Box component
|
|
5
|
+
*/
|
|
6
|
+
type DefaultElementType = "div";
|
|
7
|
+
/**
|
|
8
|
+
* Props that are specific to the React implementation
|
|
9
|
+
*/
|
|
10
|
+
type ReactBoxOwnProps<E extends React.ElementType = DefaultElementType> = BoxProps & {
|
|
11
|
+
/**
|
|
12
|
+
* The HTML element or React component to render as
|
|
13
|
+
* @default "div"
|
|
14
|
+
*/
|
|
15
|
+
as?: E | string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Polymorphic Box props that merge own props with the element's native props
|
|
19
|
+
* Omits props that are defined in our own props to avoid conflicts
|
|
20
|
+
*/
|
|
21
|
+
export type ReactBoxProps<E extends React.ElementType = DefaultElementType> = ReactBoxOwnProps<E> & Omit<React.ComponentPropsWithoutRef<E>, keyof ReactBoxOwnProps<E>>;
|
|
22
|
+
/**
|
|
23
|
+
* Generic Box component type for use with forwardRef
|
|
24
|
+
*/
|
|
25
|
+
export type BoxComponent = <E extends React.ElementType = DefaultElementType>(props: ReactBoxProps<E> & {
|
|
26
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
27
|
+
}) => React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* A polymorphic Box component that allows users to customize the element tag
|
|
30
|
+
* and apply design token-based color schemes and variations.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Default div with primary color scheme
|
|
34
|
+
* <Box color="primary" variant="subtle">
|
|
35
|
+
* Content here
|
|
36
|
+
* </Box>
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // As a section element
|
|
40
|
+
* <Box as="section" color="info">
|
|
41
|
+
* Section content
|
|
42
|
+
* </Box>
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // With generic type for custom components
|
|
46
|
+
* <Box as={MyCustomComponent} color="success" myProp="value">
|
|
47
|
+
* Custom component content
|
|
48
|
+
* </Box>
|
|
49
|
+
*/
|
|
50
|
+
export declare const Box: BoxComponent;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './box';
|
|
@@ -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-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid}::backdrop{--tw-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid}}}@layer components{.button{--button-action-factor:.85}@media(prefers-color-scheme:dark){.button{--button-action-factor:1.15}}.button{--button-action-color:oklch(from var(--box-background-color) calc(l * var(--button-action-factor)) calc(c * var(--button-action-factor)) h);justify-content:center;align-items:center;gap:var(--spacing-xs,.5rem);overflow-wrap:anywhere;cursor:pointer;max-width:100%;transition-property:background-color,box-shadow,--tw-ring-offset-color,--tw-ring-offset-width;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s);--tw-duration:.2s;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-offset-color:var(--box-background-color);transition-duration:.2s;display:inline-flex}.button:focus{outline-style:var(--tw-outline-style);outline-width:var(--outline-width-lg,.25rem);outline-offset:var(--outline-offset-2xs,.25rem)}.button:focus-visible{outline-style:var(--tw-outline-style);outline-width:var(--outline-width-lg,.25rem);outline-offset:var(--outline-offset-2xs,.25rem)}.button.button--disabled,.button:disabled{background-color:var(--background-color-disabled-moderate,#dfe1e2);color:var(--text-color-disabled-emphasis,#a9aeb1);cursor:not-allowed}.button:not(:-webkit-any(.button--disabled,:disabled)):active{--tw-ring-offset-width:var(--ring-offset-width-2xs,.25rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--button-action-color)}.button:not(:-moz-any(.button--disabled,:disabled)):active{--tw-ring-offset-width:var(--ring-offset-width-2xs,.25rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--button-action-color)}.button:not(:is(.button--disabled,:disabled)):active{--tw-ring-offset-width:var(--ring-offset-width-2xs,.25rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--button-action-color)}@media(hover:hover){.button:not(:-webkit-any(.button--disabled,:disabled)):hover{--tw-ring-offset-width:var(--ring-offset-width-3xs,.125rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--button-action-color)}.button:not(:-moz-any(.button--disabled,:disabled)):hover{--tw-ring-offset-width:var(--ring-offset-width-3xs,.125rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--button-action-color)}.button:not(:is(.button--disabled,:disabled)):hover{--tw-ring-offset-width:var(--ring-offset-width-3xs,.125rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--button-action-color)}.button:not(:-webkit-any(.button--disabled,:disabled)):hover:active{--tw-ring-offset-width:var(--ring-offset-width-2xs,.25rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.button:not(:-moz-any(.button--disabled,:disabled)):hover:active{--tw-ring-offset-width:var(--ring-offset-width-2xs,.25rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.button:not(:is(.button--disabled,:disabled)):hover:active{--tw-ring-offset-width:var(--ring-offset-width-2xs,.25rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}}.button:not(:-webkit-any(.button--disabled,:disabled)):not(.button--outline){--tw-ring-color:var(--button-action-color)}.button:not(:-moz-any(.button--disabled,:disabled)):not(.button--outline){--tw-ring-color:var(--button-action-color)}.button:not(:is(.button--disabled,:disabled)):not(.button--outline){--tw-ring-color:var(--button-action-color)}.button:not(:-webkit-any(.button--disabled,:disabled)):not(.button--outline):active{background-color:var(--button-action-color)}.button:not(:-moz-any(.button--disabled,:disabled)):not(.button--outline):active{background-color:var(--button-action-color)}.button:not(:is(.button--disabled,:disabled)):not(.button--outline):active{background-color:var(--button-action-color)}@media(hover:hover){.button:not(:-webkit-any(.button--disabled,:disabled)):not(.button--outline):hover,.button:not(:-webkit-any(.button--disabled,:disabled)):not(.button--outline):hover:active{background-color:var(--button-action-color)}.button:not(:-moz-any(.button--disabled,:disabled)):not(.button--outline):hover,.button:not(:-moz-any(.button--disabled,:disabled)):not(.button--outline):hover:active{background-color:var(--button-action-color)}.button:not(:is(.button--disabled,:disabled)):not(.button--outline):hover,.button:not(:is(.button--disabled,:disabled)):not(.button--outline):hover:active{background-color:var(--button-action-color)}}.button.button--outline{color:inherit;--tw-inset-ring-color:var(--box-background-color);--tw-ring-offset-color:var(--box-background-color);background-color:#0000}.button.button--outline:active{--tw-ring-offset-width:var(--ring-offset-width-3xs,.125rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-inset-ring-color:var(--button-action-color)}.button.button--outline.button--disabled,.button.button--outline:disabled{background-color:var(--background-color-disabled-moderate,#dfe1e2);color:var(--text-color-disabled-emphasis,#a9aeb1);cursor:not-allowed}.button.button--outline:not(:-webkit-any(.button--disabled,:disabled)){--tw-inset-ring-shadow:inset 0 0 0 var(--ring-width-md,.125rem) var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.button.button--outline:not(:-moz-any(.button--disabled,:disabled)){--tw-inset-ring-shadow:inset 0 0 0 var(--ring-width-md,.125rem) var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.button.button--outline:not(:is(.button--disabled,:disabled)){--tw-inset-ring-shadow:inset 0 0 0 var(--ring-width-md,.125rem) var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.button.button--outline:not(:-webkit-any(.button--disabled,:disabled)):hover{--tw-inset-ring-color:var(--button-action-color)}.button.button--outline:not(:-moz-any(.button--disabled,:disabled)):hover{--tw-inset-ring-color:var(--button-action-color)}.button.button--outline:not(:is(.button--disabled,:disabled)):hover{--tw-inset-ring-color:var(--button-action-color)}.button.button--outline:not(:-webkit-any(.button--disabled,:disabled)):hover:active{--tw-ring-offset-width:var(--ring-offset-width-2xs,.25rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.button.button--outline:not(:-moz-any(.button--disabled,:disabled)):hover:active{--tw-ring-offset-width:var(--ring-offset-width-2xs,.25rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.button.button--outline:not(:is(.button--disabled,:disabled)):hover:active{--tw-ring-offset-width:var(--ring-offset-width-2xs,.25rem);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}}.button.button--3xs{padding-inline:var(--spacing-3xs,.125rem)}.button.button--2xs{padding-inline:var(--spacing-2xs,.25rem)}.button.button--xs{padding-inline:var(--spacing-xs,.5rem);padding-block:var(--spacing-3xs,.125rem)}.button.button--sm{padding-inline:var(--spacing-sm,.75rem);padding-block:var(--spacing-2xs,.25rem)}.button.button--md{padding-inline:var(--spacing-md,1rem);padding-block:var(--spacing-xs,.5rem)}.button.button--lg{padding-inline:var(--spacing-lg,1.25rem);padding-block:var(--spacing-sm,.75rem)}.button.button--xl{padding-inline:var(--spacing-xl,1.5rem);padding-block:var(--spacing-md,1rem)}.button.button--2xl{padding-inline:var(--spacing-2xl,2rem);padding-block:var(--spacing-lg,1.25rem)}.button.button--3xl{padding-inline:var(--spacing-3xl,2.5rem);padding-block:var(--spacing-xl,1.5rem)}.button.button--4xl{padding-inline:var(--spacing-4xl,3.5rem);padding-block:var(--spacing-2xl,2rem)}.button.button--5xl{padding-inline:var(--spacing-5xl,4rem);padding-block:var(--spacing-3xl,2.5rem)}}@property --tw-duration{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonProps } from '@cityofportland/types/button';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { ReactBoxProps } from '../box';
|
|
4
|
+
type ButtonElementType = "button" | "a";
|
|
5
|
+
declare const DefaultElementType: ButtonElementType;
|
|
6
|
+
type ButtonOwnProps = Omit<ButtonProps, keyof ReactBoxProps>;
|
|
7
|
+
export type ReactButtonProps<T extends ButtonElementType = typeof DefaultElementType> = React.PropsWithChildren<ButtonOwnProps & ReactBoxProps<T>>;
|
|
8
|
+
export declare const Button: <T extends ButtonElementType = typeof DefaultElementType>({ as, children, size, outline, disabled, className, ...props }: ReactButtonProps<T>) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { j as r } from "../index-IqW719eK.js";
|
|
2
|
+
import { B as m, m as b } from "../index-C4cFhgXK.js";
|
|
3
|
+
const f = "button", c = ({
|
|
4
|
+
as: o,
|
|
5
|
+
children: s = null,
|
|
6
|
+
size: e,
|
|
7
|
+
outline: n = !1,
|
|
8
|
+
disabled: t = !1,
|
|
9
|
+
className: a,
|
|
10
|
+
...u
|
|
11
|
+
}) => {
|
|
12
|
+
const l = o ?? f;
|
|
13
|
+
return /* @__PURE__ */ r.jsx(
|
|
14
|
+
m,
|
|
15
|
+
{
|
|
16
|
+
as: l,
|
|
17
|
+
className: b(
|
|
18
|
+
"button",
|
|
19
|
+
e && `button--${e}`,
|
|
20
|
+
t && "button--disabled",
|
|
21
|
+
n && "button--outline",
|
|
22
|
+
a
|
|
23
|
+
),
|
|
24
|
+
disabled: t,
|
|
25
|
+
"aria-disabled": t ? "true" : "false",
|
|
26
|
+
role: "button",
|
|
27
|
+
...u,
|
|
28
|
+
children: s
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
c as Button
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './button';
|