pallote-react 0.16.14 → 0.16.16
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/dist/components/Button.d.ts +2 -2
- package/dist/components/Card.d.ts +1 -1
- package/dist/components/NavBar.d.ts +3 -3
- package/dist/components/Section.d.ts +1 -1
- package/dist/components/SectionContent.d.ts +1 -1
- package/dist/components/SectionHeader.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/package.json +1 -1
- package/dist/utilities/Text.d.ts +1 -1
- package/package.json +2 -2
|
@@ -11,8 +11,8 @@ export interface ButtonProps extends Omit<ComponentPropsWithoutRef<'button'>, 't
|
|
|
11
11
|
size?: ButtonSize;
|
|
12
12
|
color?: ButtonColor;
|
|
13
13
|
fullWidth?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
iconStart?: ReactNode;
|
|
15
|
+
iconEnd?: ReactNode;
|
|
16
16
|
type?: ButtonType;
|
|
17
17
|
to?: string;
|
|
18
18
|
[key: string]: unknown;
|
|
@@ -2,7 +2,7 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
type CardSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
3
|
type CardFill = 'default' | 'paper' | 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error';
|
|
4
4
|
type CardDirection = 'portrait' | 'landscape';
|
|
5
|
-
type CardAlign = '
|
|
5
|
+
type CardAlign = 'start' | 'center' | 'end';
|
|
6
6
|
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
size?: CardSize;
|
|
8
8
|
fill?: CardFill;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SectionProps } from './Section';
|
|
3
|
-
type NavBarAlign = '
|
|
3
|
+
type NavBarAlign = 'start' | 'end';
|
|
4
4
|
export interface NavBarProps extends Omit<SectionProps, 'children'> {
|
|
5
5
|
logo?: ReactNode;
|
|
6
|
-
|
|
6
|
+
logoPosition?: NavBarAlign;
|
|
7
7
|
className?: string;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export declare const NavBar: ({ logo,
|
|
10
|
+
export declare const NavBar: ({ logo, logoPosition, className, children, ...props }: NavBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
type SectionAlign = '
|
|
2
|
+
type SectionAlign = 'start' | 'center' | 'end';
|
|
3
3
|
type SectionColor = 'default' | 'paper' | 'primary' | 'primaryLight';
|
|
4
4
|
export interface SectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
align?: SectionAlign;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
type SectionContentAlign = '
|
|
2
|
+
type SectionContentAlign = 'start' | 'center' | 'end';
|
|
3
3
|
export interface SectionContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
align?: SectionContentAlign;
|
|
5
5
|
className?: string;
|
|
@@ -6,7 +6,7 @@ export interface SectionHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
6
6
|
titleLevel?: TitleLevel;
|
|
7
7
|
subtitle?: ReactNode;
|
|
8
8
|
actions?: ReactNode;
|
|
9
|
-
actionsPosition?: '
|
|
9
|
+
actionsPosition?: 'inline' | 'end';
|
|
10
10
|
className?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const SectionHeader: ({ label, title, titleLevel, subtitle, actions, actionsPosition, className, ...props }: SectionHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -319,14 +319,14 @@ const Breadcrumbs = ({ items, separator = "slash", className }) => (jsx("nav", {
|
|
|
319
319
|
className
|
|
320
320
|
]), children: jsx("ol", { children: items.map((item, index) => (jsx("li", { className: 'breadcrumbs_item', children: index === items.length - 1 ? (jsx("p", { "aria-current": "page", children: item.label })) : (jsx("a", { href: item.href, children: item.label })) }, index))) }) }));
|
|
321
321
|
|
|
322
|
-
const Button = forwardRef(({ component = 'button', kind, variant = 'fill', size = 'md', color = 'primary', fullWidth, disabled,
|
|
322
|
+
const Button = forwardRef(({ component = 'button', kind, variant = 'fill', size = 'md', color = 'primary', fullWidth, disabled, iconStart, iconEnd, className, children = 'button', type = 'button', ...props }, ref) => {
|
|
323
323
|
const Component = component;
|
|
324
324
|
let content;
|
|
325
325
|
if (kind === 'icon') {
|
|
326
326
|
content = children;
|
|
327
327
|
}
|
|
328
328
|
else {
|
|
329
|
-
content = (jsxs(Fragment, { children: [
|
|
329
|
+
content = (jsxs(Fragment, { children: [iconStart && iconStart, children, iconEnd && iconEnd] }));
|
|
330
330
|
}
|
|
331
331
|
return (jsx(Component, { className: classnames([
|
|
332
332
|
'button',
|
|
@@ -355,7 +355,7 @@ const Buttons = ({ direction = 'landscape', fullWidth, wide, className, children
|
|
|
355
355
|
]), ...props, children: children }));
|
|
356
356
|
};
|
|
357
357
|
|
|
358
|
-
const Card = ({ size = 'md', fill = 'paper', direction = 'portrait', align = '
|
|
358
|
+
const Card = ({ size = 'md', fill = 'paper', direction = 'portrait', align = 'start', hasShadow = false, transparent = false, className, children, ...props }) => {
|
|
359
359
|
return (jsx(Color, { fill: transparent ? undefined : fill, children: jsx("div", { className: classnames([
|
|
360
360
|
'card',
|
|
361
361
|
{
|
|
@@ -405,7 +405,7 @@ const CardMedia = ({ width, height, image, fullWidth, className, ...props }) =>
|
|
|
405
405
|
className
|
|
406
406
|
]), ...props, children: jsx("div", { className: 'card_mediaInner', style: {
|
|
407
407
|
width: width ? width + 'px' : undefined,
|
|
408
|
-
|
|
408
|
+
paddingBlockEnd: height,
|
|
409
409
|
backgroundImage: `url(${image})`
|
|
410
410
|
} }) }));
|
|
411
411
|
};
|
|
@@ -911,7 +911,7 @@ const Link = ({ component = 'a', icon, color, isExternal, href, className, child
|
|
|
911
911
|
'link',
|
|
912
912
|
{ [`text-${color}`]: color },
|
|
913
913
|
className
|
|
914
|
-
]), href:
|
|
914
|
+
]), href: href, target: isExternal ? '_blank' : undefined, rel: isExternal ? 'noopener noreferrer' : undefined, ...props, children: [children, icon && !isExternal && jsx("span", { className: 'link_icon', "aria-hidden": "true", children: icon }), isExternal && (jsxs(Fragment, { children: [jsx("span", { className: "sr-only", children: " (opens in new tab)" }), jsx("span", { className: 'link_icon', "aria-hidden": "true", children: jsx(o$1, {}) })] }))] }));
|
|
915
915
|
};
|
|
916
916
|
|
|
917
917
|
const List = ({ dense, className, children, ...props }) => {
|
|
@@ -952,10 +952,10 @@ const SectionHeader = ({ label, title, titleLevel = 2, subtitle, actions, action
|
|
|
952
952
|
'section_header',
|
|
953
953
|
`section_header-${titleLevel}`,
|
|
954
954
|
className
|
|
955
|
-
]), ...props, children: [label ? jsx(Text, { className: classnames('section_label'), children: label }) : null, jsxs("div", { className: "section_titleWrapper", children: [jsx(Text, { className: "section_title", variant: titleVariant, component: titleComponent, children: title }), actions && actionsPosition === '
|
|
955
|
+
]), ...props, children: [label ? jsx(Text, { className: classnames('section_label'), children: label }) : null, jsxs("div", { className: "section_titleWrapper", children: [jsx(Text, { className: "section_title", variant: titleVariant, component: titleComponent, children: title }), actions && actionsPosition === 'inline' ? (jsx(Display, { hide: "tablet", children: jsx("div", { className: "section_actions", children: actions }) })) : null] }), subtitle ? jsx("div", { className: classnames('section_subtitle'), children: subtitle }) : null, actions ? (actionsPosition === 'inline' ? (jsx(Display, { show: "tablet", children: jsx("div", { className: "section_actions", children: actions }) })) : (jsx("div", { className: "section_actions", children: actions }))) : null] }));
|
|
956
956
|
};
|
|
957
957
|
|
|
958
|
-
const Section = ({ align = '
|
|
958
|
+
const Section = ({ align = 'start', color = 'default', landing, className, children, ...props }) => {
|
|
959
959
|
return (jsx("div", { className: classnames([
|
|
960
960
|
'section',
|
|
961
961
|
{
|
|
@@ -975,7 +975,7 @@ const Section = ({ align = 'left', color = 'default', landing, className, childr
|
|
|
975
975
|
}) }) }));
|
|
976
976
|
};
|
|
977
977
|
|
|
978
|
-
const NavBar = ({ logo,
|
|
978
|
+
const NavBar = ({ logo, logoPosition, className, children, ...props }) => {
|
|
979
979
|
const [isOpen, setIsOpen] = useState(false);
|
|
980
980
|
const toggleNav = () => {
|
|
981
981
|
setIsOpen(!isOpen);
|
|
@@ -993,7 +993,7 @@ const NavBar = ({ logo, align, className, children, ...props }) => {
|
|
|
993
993
|
return (jsx("header", { children: jsxs(Section, { className: classnames([
|
|
994
994
|
'navbar',
|
|
995
995
|
{
|
|
996
|
-
[`navbar-${
|
|
996
|
+
[`navbar-${logoPosition}`]: logoPosition,
|
|
997
997
|
'js-opened': isOpen
|
|
998
998
|
},
|
|
999
999
|
className
|
|
@@ -1063,7 +1063,7 @@ const RadioButtons = ({ id, label = 'Label', direction = 'portrait', error, disa
|
|
|
1063
1063
|
]), children: children })] }));
|
|
1064
1064
|
};
|
|
1065
1065
|
|
|
1066
|
-
const SectionContent = ({ align = '
|
|
1066
|
+
const SectionContent = ({ align = 'start', className, children, ...props }) => {
|
|
1067
1067
|
return (jsx("div", { className: classnames([
|
|
1068
1068
|
'section_content',
|
|
1069
1069
|
{
|
package/dist/package.json
CHANGED
package/dist/utilities/Text.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
type TextVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle' | 'body' | 'caption' | 'overline';
|
|
3
|
-
type TextAlign = '
|
|
3
|
+
type TextAlign = 'start' | 'center' | 'end' | 'justify';
|
|
4
4
|
type TextWeight = 'regular' | 'bold';
|
|
5
5
|
type TextTransform = 'none' | 'capitalize' | 'uppercase' | 'lowercase' | 'initial' | 'inherit';
|
|
6
6
|
type TextColor = 'default' | 'alt' | 'disabled' | 'contrast' | 'contrastAlt' | 'contrastDisabled' | 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pallote-react",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"classnames": "^2.5.1",
|
|
25
25
|
"react-syntax-highlighter": "^15.6.1",
|
|
26
26
|
"sass": "^1.71.1",
|
|
27
|
-
"pallote-css": "^0.10.
|
|
27
|
+
"pallote-css": "^0.10.11"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@chromatic-com/storybook": "^3.2.4",
|