@usefidel/design-system 0.16.0 → 0.17.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/dist/fidel.manifest.json +2 -2
- package/dist/icons.cjs +33 -1
- package/dist/icons.d.cts +11 -1
- package/dist/icons.d.ts +11 -1
- package/dist/icons.js +31 -2
- package/dist/index.cjs +240 -186
- package/dist/index.css +97 -0
- package/dist/index.d.cts +43 -2
- package/dist/index.d.ts +43 -2
- package/dist/index.js +238 -186
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1915,6 +1915,103 @@
|
|
|
1915
1915
|
filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.13));
|
|
1916
1916
|
}
|
|
1917
1917
|
|
|
1918
|
+
/* src/components/Callout/callout.css */
|
|
1919
|
+
.fds-callout {
|
|
1920
|
+
box-sizing: border-box;
|
|
1921
|
+
display: flex;
|
|
1922
|
+
align-items: center;
|
|
1923
|
+
gap: 14px;
|
|
1924
|
+
padding: 14px 16px;
|
|
1925
|
+
border: 1px solid var(--fds-callout-border);
|
|
1926
|
+
border-radius: var(--radius-lg, 12px);
|
|
1927
|
+
background: var(--fds-callout-bg);
|
|
1928
|
+
font-family: var(--font-body, "Rethink Sans", system-ui, sans-serif);
|
|
1929
|
+
color: var(--color-text, #171717);
|
|
1930
|
+
}
|
|
1931
|
+
.fds-callout__icon {
|
|
1932
|
+
display: inline-flex;
|
|
1933
|
+
align-items: center;
|
|
1934
|
+
justify-content: center;
|
|
1935
|
+
flex-shrink: 0;
|
|
1936
|
+
align-self: flex-start;
|
|
1937
|
+
width: 32px;
|
|
1938
|
+
height: 32px;
|
|
1939
|
+
border-radius: var(--radius-md, 8px);
|
|
1940
|
+
background: var(--color-bg, #ffffff);
|
|
1941
|
+
color: var(--fds-callout-icon);
|
|
1942
|
+
}
|
|
1943
|
+
.fds-callout__icon > svg {
|
|
1944
|
+
width: 16px;
|
|
1945
|
+
height: 16px;
|
|
1946
|
+
}
|
|
1947
|
+
.fds-callout__body {
|
|
1948
|
+
flex: 1;
|
|
1949
|
+
min-width: 0;
|
|
1950
|
+
}
|
|
1951
|
+
.fds-callout__title {
|
|
1952
|
+
display: flex;
|
|
1953
|
+
flex-wrap: wrap;
|
|
1954
|
+
align-items: center;
|
|
1955
|
+
gap: 4px 8px;
|
|
1956
|
+
margin: 0;
|
|
1957
|
+
font-size: var(--font-size-text-sm, 14px);
|
|
1958
|
+
line-height: 20px;
|
|
1959
|
+
font-weight: var(--font-weight-semibold, 600);
|
|
1960
|
+
}
|
|
1961
|
+
.fds-callout__aside {
|
|
1962
|
+
display: inline-flex;
|
|
1963
|
+
}
|
|
1964
|
+
.fds-callout__text {
|
|
1965
|
+
margin-top: 2px;
|
|
1966
|
+
font-size: 13px;
|
|
1967
|
+
line-height: 20px;
|
|
1968
|
+
color: var(--color-text-secondary, #525252);
|
|
1969
|
+
}
|
|
1970
|
+
.fds-callout__action {
|
|
1971
|
+
display: flex;
|
|
1972
|
+
flex-shrink: 0;
|
|
1973
|
+
gap: 8px;
|
|
1974
|
+
}
|
|
1975
|
+
@media (max-width: 480px) {
|
|
1976
|
+
.fds-callout {
|
|
1977
|
+
flex-wrap: wrap;
|
|
1978
|
+
}
|
|
1979
|
+
.fds-callout__action {
|
|
1980
|
+
flex-basis: 100%;
|
|
1981
|
+
padding-left: 46px;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
.fds-callout--neutral {
|
|
1985
|
+
--fds-callout-bg: var(--color-surface-subtle, #fafafa);
|
|
1986
|
+
--fds-callout-border: var(--color-border, #e5e5e5);
|
|
1987
|
+
--fds-callout-icon: var(--color-text-secondary, #525252);
|
|
1988
|
+
}
|
|
1989
|
+
.fds-callout--accent {
|
|
1990
|
+
--fds-callout-bg: var(--color-accent-subtle, #fff7ed);
|
|
1991
|
+
--fds-callout-border: var(--color-accent-muted, #fdba74);
|
|
1992
|
+
--fds-callout-icon: var(--color-accent, #ea580c);
|
|
1993
|
+
}
|
|
1994
|
+
.fds-callout--info {
|
|
1995
|
+
--fds-callout-bg: var(--color-info-surface, #eff6ff);
|
|
1996
|
+
--fds-callout-border: var(--color-info, #93c5fd);
|
|
1997
|
+
--fds-callout-icon: var(--color-info-strong, #2563eb);
|
|
1998
|
+
}
|
|
1999
|
+
.fds-callout--success {
|
|
2000
|
+
--fds-callout-bg: var(--color-success-bg, #f0fdf4);
|
|
2001
|
+
--fds-callout-border: var(--color-success, #86efac);
|
|
2002
|
+
--fds-callout-icon: var(--color-success-text, #15803d);
|
|
2003
|
+
}
|
|
2004
|
+
.fds-callout--warning {
|
|
2005
|
+
--fds-callout-bg: var(--color-warning-bg, #fffbeb);
|
|
2006
|
+
--fds-callout-border: var(--color-warning-border, #fcd34d);
|
|
2007
|
+
--fds-callout-icon: var(--color-warning-text, #92400e);
|
|
2008
|
+
}
|
|
2009
|
+
.fds-callout--danger {
|
|
2010
|
+
--fds-callout-bg: var(--color-error-bg, #fef2f2);
|
|
2011
|
+
--fds-callout-border: var(--color-error-border, #fecaca);
|
|
2012
|
+
--fds-callout-icon: var(--color-destructive, #eb2d2d);
|
|
2013
|
+
}
|
|
2014
|
+
|
|
1918
2015
|
/* src/components/Skeleton/skeleton.css */
|
|
1919
2016
|
.fds-skeleton {
|
|
1920
2017
|
display: block;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, AnchorHTMLAttributes, HTMLAttributes, InputHTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
4
|
type ButtonVariant = 'primary' | 'outlined' | 'text' | 'neutral' | 'link'
|
|
5
5
|
/** High-contrast near-black, for a page's main create action ("New comparison"). */
|
|
@@ -26,6 +26,25 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
26
26
|
*/
|
|
27
27
|
declare function Button({ variant, size, leftIcon, rightIcon, type, className, children, ...rest }: ButtonProps): react.JSX.Element;
|
|
28
28
|
|
|
29
|
+
interface ButtonLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
30
|
+
/** Where the link goes. */
|
|
31
|
+
href: string;
|
|
32
|
+
/** Visual style. @default 'primary' */
|
|
33
|
+
variant?: ButtonVariant;
|
|
34
|
+
/** Size step. @default 'medium' */
|
|
35
|
+
size?: ButtonSize;
|
|
36
|
+
/** Optional leading icon (rendered in a 20px slot). */
|
|
37
|
+
leftIcon?: ReactNode;
|
|
38
|
+
/** Optional trailing icon (rendered in a 20px slot). */
|
|
39
|
+
rightIcon?: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A link that looks like a Button. Use it when the action navigates (to a
|
|
43
|
+
* page or another site) rather than doing something on this page, so the
|
|
44
|
+
* browser keeps link behaviour: open in a new tab, copy link, status bar URL.
|
|
45
|
+
*/
|
|
46
|
+
declare function ButtonLink({ variant, size, leftIcon, rightIcon, className, children, ...rest }: ButtonLinkProps): react.JSX.Element;
|
|
47
|
+
|
|
29
48
|
interface MismatchProperty {
|
|
30
49
|
/** Property label, e.g. "color", "font-size". */
|
|
31
50
|
label: string;
|
|
@@ -536,6 +555,28 @@ declare function StackedCardsIllustration({ className }: {
|
|
|
536
555
|
className?: string;
|
|
537
556
|
}): react.JSX.Element;
|
|
538
557
|
|
|
558
|
+
/** Colour role. `accent` is the brand tint, for a prompt to act (an upgrade, a next step). */
|
|
559
|
+
type CalloutTone = Tone | 'accent';
|
|
560
|
+
interface CalloutProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
561
|
+
/** Colour role. @default 'neutral' */
|
|
562
|
+
tone?: CalloutTone;
|
|
563
|
+
/** Leading icon, drawn at 16px in a 32px tile. */
|
|
564
|
+
icon?: ReactNode;
|
|
565
|
+
/** One-line heading. */
|
|
566
|
+
title: ReactNode;
|
|
567
|
+
/** Shown after the title, e.g. a Badge. */
|
|
568
|
+
titleAside?: ReactNode;
|
|
569
|
+
/** Supporting text under the title. */
|
|
570
|
+
children?: ReactNode;
|
|
571
|
+
/** Trailing action(s), e.g. a ButtonLink. Moves under the text on phones. */
|
|
572
|
+
action?: ReactNode;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Fidel design-system Callout: a tinted row that tells the reader something
|
|
576
|
+
* about the page they are on and, optionally, what to do about it.
|
|
577
|
+
*/
|
|
578
|
+
declare function Callout({ tone, icon, title, titleAside, children, action, className, ...rest }: CalloutProps): react.JSX.Element;
|
|
579
|
+
|
|
539
580
|
type SkeletonShape = 'rect' | 'text' | 'circle';
|
|
540
581
|
interface SkeletonProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
541
582
|
/** rect: a block. text: line(s) at text height. circle: an avatar or icon. @default 'rect' */
|
|
@@ -562,4 +603,4 @@ interface SkeletonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
562
603
|
/** Wraps a skeleton layout and announces it once as loading (role="status"). */
|
|
563
604
|
declare function SkeletonGroup({ label, className, children, ...rest }: SkeletonGroupProps): react.JSX.Element;
|
|
564
605
|
|
|
565
|
-
export { AppNav, type AppNavProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type Breakpoint, Button, type ButtonProps, type ButtonSize, type ButtonVariant, type DiffElement, type DiffPropertyLine, DiffPropertyList, type DiffPropertyListProps, DiffSection, type DiffSectionProps, EmptyState, type EmptyStateProps, MismatchCard, type MismatchCardProps, type MismatchProperty, Modal, type ModalProps, type ModalSize, type ModalTone, MultiSelect, type MultiSelectOption, type MultiSelectProps, Pagination, type PaginationProps, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectOption, type SelectProps, SettingsSection, type SettingsSectionProps, Skeleton, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, type SkeletonShape, Split, type SplitProps, StackedCardsIllustration, TabNav, type TabNavProps, Tag, type TagProps, Toggle, type ToggleProps, type ToggleSize, type Tone, breakpoints };
|
|
606
|
+
export { AppNav, type AppNavProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type Breakpoint, Button, ButtonLink, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, Callout, type CalloutProps, type CalloutTone, type DiffElement, type DiffPropertyLine, DiffPropertyList, type DiffPropertyListProps, DiffSection, type DiffSectionProps, EmptyState, type EmptyStateProps, MismatchCard, type MismatchCardProps, type MismatchProperty, Modal, type ModalProps, type ModalSize, type ModalTone, MultiSelect, type MultiSelectOption, type MultiSelectProps, Pagination, type PaginationProps, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectOption, type SelectProps, SettingsSection, type SettingsSectionProps, Skeleton, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, type SkeletonShape, Split, type SplitProps, StackedCardsIllustration, TabNav, type TabNavProps, Tag, type TagProps, Toggle, type ToggleProps, type ToggleSize, type Tone, breakpoints };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, AnchorHTMLAttributes, HTMLAttributes, InputHTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
4
|
type ButtonVariant = 'primary' | 'outlined' | 'text' | 'neutral' | 'link'
|
|
5
5
|
/** High-contrast near-black, for a page's main create action ("New comparison"). */
|
|
@@ -26,6 +26,25 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
26
26
|
*/
|
|
27
27
|
declare function Button({ variant, size, leftIcon, rightIcon, type, className, children, ...rest }: ButtonProps): react.JSX.Element;
|
|
28
28
|
|
|
29
|
+
interface ButtonLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
30
|
+
/** Where the link goes. */
|
|
31
|
+
href: string;
|
|
32
|
+
/** Visual style. @default 'primary' */
|
|
33
|
+
variant?: ButtonVariant;
|
|
34
|
+
/** Size step. @default 'medium' */
|
|
35
|
+
size?: ButtonSize;
|
|
36
|
+
/** Optional leading icon (rendered in a 20px slot). */
|
|
37
|
+
leftIcon?: ReactNode;
|
|
38
|
+
/** Optional trailing icon (rendered in a 20px slot). */
|
|
39
|
+
rightIcon?: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A link that looks like a Button. Use it when the action navigates (to a
|
|
43
|
+
* page or another site) rather than doing something on this page, so the
|
|
44
|
+
* browser keeps link behaviour: open in a new tab, copy link, status bar URL.
|
|
45
|
+
*/
|
|
46
|
+
declare function ButtonLink({ variant, size, leftIcon, rightIcon, className, children, ...rest }: ButtonLinkProps): react.JSX.Element;
|
|
47
|
+
|
|
29
48
|
interface MismatchProperty {
|
|
30
49
|
/** Property label, e.g. "color", "font-size". */
|
|
31
50
|
label: string;
|
|
@@ -536,6 +555,28 @@ declare function StackedCardsIllustration({ className }: {
|
|
|
536
555
|
className?: string;
|
|
537
556
|
}): react.JSX.Element;
|
|
538
557
|
|
|
558
|
+
/** Colour role. `accent` is the brand tint, for a prompt to act (an upgrade, a next step). */
|
|
559
|
+
type CalloutTone = Tone | 'accent';
|
|
560
|
+
interface CalloutProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
561
|
+
/** Colour role. @default 'neutral' */
|
|
562
|
+
tone?: CalloutTone;
|
|
563
|
+
/** Leading icon, drawn at 16px in a 32px tile. */
|
|
564
|
+
icon?: ReactNode;
|
|
565
|
+
/** One-line heading. */
|
|
566
|
+
title: ReactNode;
|
|
567
|
+
/** Shown after the title, e.g. a Badge. */
|
|
568
|
+
titleAside?: ReactNode;
|
|
569
|
+
/** Supporting text under the title. */
|
|
570
|
+
children?: ReactNode;
|
|
571
|
+
/** Trailing action(s), e.g. a ButtonLink. Moves under the text on phones. */
|
|
572
|
+
action?: ReactNode;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Fidel design-system Callout: a tinted row that tells the reader something
|
|
576
|
+
* about the page they are on and, optionally, what to do about it.
|
|
577
|
+
*/
|
|
578
|
+
declare function Callout({ tone, icon, title, titleAside, children, action, className, ...rest }: CalloutProps): react.JSX.Element;
|
|
579
|
+
|
|
539
580
|
type SkeletonShape = 'rect' | 'text' | 'circle';
|
|
540
581
|
interface SkeletonProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
541
582
|
/** rect: a block. text: line(s) at text height. circle: an avatar or icon. @default 'rect' */
|
|
@@ -562,4 +603,4 @@ interface SkeletonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
562
603
|
/** Wraps a skeleton layout and announces it once as loading (role="status"). */
|
|
563
604
|
declare function SkeletonGroup({ label, className, children, ...rest }: SkeletonGroupProps): react.JSX.Element;
|
|
564
605
|
|
|
565
|
-
export { AppNav, type AppNavProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type Breakpoint, Button, type ButtonProps, type ButtonSize, type ButtonVariant, type DiffElement, type DiffPropertyLine, DiffPropertyList, type DiffPropertyListProps, DiffSection, type DiffSectionProps, EmptyState, type EmptyStateProps, MismatchCard, type MismatchCardProps, type MismatchProperty, Modal, type ModalProps, type ModalSize, type ModalTone, MultiSelect, type MultiSelectOption, type MultiSelectProps, Pagination, type PaginationProps, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectOption, type SelectProps, SettingsSection, type SettingsSectionProps, Skeleton, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, type SkeletonShape, Split, type SplitProps, StackedCardsIllustration, TabNav, type TabNavProps, Tag, type TagProps, Toggle, type ToggleProps, type ToggleSize, type Tone, breakpoints };
|
|
606
|
+
export { AppNav, type AppNavProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type Breakpoint, Button, ButtonLink, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, Callout, type CalloutProps, type CalloutTone, type DiffElement, type DiffPropertyLine, DiffPropertyList, type DiffPropertyListProps, DiffSection, type DiffSectionProps, EmptyState, type EmptyStateProps, MismatchCard, type MismatchCardProps, type MismatchProperty, Modal, type ModalProps, type ModalSize, type ModalTone, MultiSelect, type MultiSelectOption, type MultiSelectProps, Pagination, type PaginationProps, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectOption, type SelectProps, SettingsSection, type SettingsSectionProps, Skeleton, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, type SkeletonShape, Split, type SplitProps, StackedCardsIllustration, TabNav, type TabNavProps, Tag, type TagProps, Toggle, type ToggleProps, type ToggleSize, type Tone, breakpoints };
|