@digigov/react-core 2.0.0-b3ec0588 → 2.0.0-rc.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/Accordion/index.d.ts +1 -1
- package/AccordionControls/index.d.ts +1 -1
- package/AccordionSection/index.d.ts +1 -1
- package/AccordionSectionContent/index.d.ts +1 -1
- package/AccordionSectionSummary/index.d.ts +1 -1
- package/AccordionSectionSummaryHeading/index.d.ts +1 -1
- package/AdminAside/index.d.ts +1 -1
- package/AdminContainer/index.d.ts +1 -1
- package/AdminHeader/index.d.ts +1 -1
- package/AdminHeaderContent/index.d.ts +1 -1
- package/AdminLayout/index.d.ts +1 -1
- package/AdminMain/index.d.ts +1 -1
- package/AdminTopSection/index.d.ts +1 -1
- package/Aside/index.d.ts +1 -1
- package/AutoCompleteAssistiveHint/index.d.ts +1 -1
- package/AutoCompleteInput/index.d.ts +1 -1
- package/AutoCompleteInputTypeahead/index.d.ts +1 -1
- package/AutoCompleteResultList/index.d.ts +1 -1
- package/AutoCompleteResultListItem/index.d.ts +1 -1
- package/AutoCompleteStatus/index.d.ts +1 -1
- package/AutoCompleteStatusWrapper/index.d.ts +1 -1
- package/AutoCompleteWrapper/index.d.ts +1 -1
- package/BackLink/index.d.ts +1 -1
- package/BackToTopContainer/index.d.ts +1 -1
- package/BackToTopLimit/index.d.ts +1 -1
- package/BackToTopLink/index.d.ts +1 -1
- package/BannerContainer/index.d.ts +1 -1
- package/Base/index.d.ts +39 -10
- package/Base/index.js +16 -2
- package/Blockquote/index.d.ts +1 -1
- package/Bottom/index.d.ts +1 -1
- package/BottomInfo/index.d.ts +1 -1
- package/BottomInfoContainer/index.d.ts +1 -1
- package/BottomInfoContent/index.d.ts +1 -1
- package/Breadcrumbs/index.d.ts +1 -1
- package/BreadcrumbsList/index.d.ts +1 -1
- package/BreadcrumbsListItem/index.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/ButtonGroup/index.d.ts +1 -1
- package/ButtonLink/index.d.ts +1 -1
- package/CallToAction/index.d.ts +1 -1
- package/Card/index.d.ts +1 -1
- package/CardAction/index.d.ts +1 -1
- package/CardContent/index.d.ts +1 -1
- package/CardHeading/index.d.ts +1 -1
- package/Checkbox/index.d.ts +1 -1
- package/CheckboxConditional/index.d.ts +1 -1
- package/CheckboxItem/index.d.ts +1 -1
- package/Chip/index.d.ts +1 -1
- package/ChipContainer/index.d.ts +1 -1
- package/ChipHeading/index.d.ts +1 -1
- package/ChipKeyValue/index.d.ts +1 -1
- package/ChoiceDividerText/index.d.ts +1 -1
- package/CircularProgress/index.d.ts +1 -1
- package/CloseButton/index.d.ts +1 -1
- package/Code/index.d.ts +1 -1
- package/CodeBlock/index.d.ts +1 -1
- package/Container/index.d.ts +1 -1
- package/CopyToClipboardContainer/index.d.ts +1 -1
- package/CopyToClipboardMessage/index.d.ts +1 -1
- package/CopyrightContainer/index.d.ts +1 -1
- package/DateInputContainer/index.d.ts +1 -1
- package/DateInputItem/index.d.ts +1 -1
- package/Details/index.d.ts +1 -1
- package/DetailsContent/index.d.ts +1 -1
- package/DetailsSummary/index.d.ts +1 -1
- package/Drawer/index.d.ts +1 -1
- package/DrawerHeading/index.d.ts +1 -1
- package/DropdownBase/index.d.ts +1 -1
- package/DropdownButton/index.d.ts +1 -1
- package/DropdownContent/index.d.ts +1 -1
- package/ErrorMessage/index.d.ts +1 -1
- package/ErrorSummary/index.d.ts +1 -1
- package/FieldContainer/index.d.ts +1 -1
- package/Fieldset/index.d.ts +1 -1
- package/FieldsetLegend/index.d.ts +1 -1
- package/FileUpload/index.d.ts +1 -1
- package/FileUploadContainer/index.d.ts +1 -1
- package/FillableText/index.d.ts +1 -1
- package/FilterContainer/index.d.ts +1 -1
- package/FilterContent/index.d.ts +1 -1
- package/FilterHeadingContainer/index.d.ts +1 -1
- package/FilterOptionsSection/index.d.ts +1 -1
- package/FilterSelectedHeading/index.d.ts +1 -1
- package/FilterSelectedSection/index.d.ts +1 -1
- package/Footer/index.d.ts +1 -1
- package/FooterContainer/index.d.ts +1 -1
- package/FooterContent/index.d.ts +1 -1
- package/FooterContentLogos/index.d.ts +1 -1
- package/FooterHeading/index.d.ts +1 -1
- package/FooterImage/index.d.ts +1 -1
- package/FooterInfo/index.d.ts +1 -1
- package/FooterInfoSection/index.d.ts +1 -1
- package/FooterLink/index.d.ts +1 -1
- package/FooterList/index.d.ts +1 -1
- package/FooterListItem/index.d.ts +1 -1
- package/FooterNavigation/index.d.ts +1 -1
- package/FooterNavigationSection/index.d.ts +1 -1
- package/Form/index.d.ts +1 -1
- package/FullPageBackground/index.d.ts +1 -1
- package/GovGRLogo/index.d.ts +1 -1
- package/Grid/index.d.ts +1 -1
- package/Header/index.d.ts +1 -1
- package/HeaderContent/index.d.ts +1 -1
- package/HeaderLogo/index.d.ts +1 -1
- package/HeaderNavMenuContent/index.d.ts +1 -1
- package/HeaderSecondaryLogo/index.d.ts +1 -1
- package/HeaderSection/index.d.ts +1 -1
- package/HeaderTitle/index.d.ts +1 -1
- package/Heading/index.d.ts +1 -1
- package/HeadingCaption/index.d.ts +1 -1
- package/HellenicRepublicLogo/index.d.ts +1 -1
- package/Hidden/index.d.ts +1 -1
- package/Hint/index.d.ts +1 -1
- package/ImageLogo/index.d.ts +1 -1
- package/ImageLogoSet/index.d.ts +1 -1
- package/KitchenSinkAllComponents/index.d.ts +1 -1
- package/KitchenSinkCard/index.d.ts +1 -1
- package/KitchenSinkCategory/index.d.ts +1 -1
- package/KitchenSinkContent/index.d.ts +1 -1
- package/KitchenSinkContentInfo/index.d.ts +1 -1
- package/KitchenSinkContentTags/index.d.ts +1 -1
- package/KitchenSinkHeading/index.d.ts +1 -1
- package/KitchenSinkLetterContent/index.d.ts +1 -1
- package/LabelContainer/index.d.ts +1 -1
- package/LabelTitle/index.d.ts +1 -1
- package/LabeledText/index.d.ts +1 -1
- package/Layout/index.d.ts +1 -1
- package/LinkBase/index.d.ts +1 -1
- package/List/index.d.ts +1 -1
- package/ListItem/index.d.ts +1 -1
- package/LoaderContainer/index.d.ts +1 -1
- package/Main/index.d.ts +1 -1
- package/Masthead/index.d.ts +1 -1
- package/MastheadBody/index.d.ts +1 -1
- package/MastheadLogo/index.d.ts +1 -1
- package/ModalAction/index.d.ts +1 -1
- package/ModalContainer/index.d.ts +1 -1
- package/ModalContent/index.d.ts +1 -1
- package/ModalHeading/index.d.ts +1 -1
- package/Nav/index.d.ts +1 -1
- package/NavList/index.d.ts +1 -1
- package/NavListItemAction/index.d.ts +1 -1
- package/NavListItemActionContainer/index.d.ts +1 -1
- package/NavListItemButton/index.d.ts +1 -1
- package/NavListItemLink/index.d.ts +1 -1
- package/NavMenuContainer/index.d.ts +1 -1
- package/NavMenuContent/index.d.ts +1 -1
- package/NavMenuContentListBase/index.d.ts +1 -1
- package/NavMenuContentListItem/index.d.ts +1 -1
- package/NavMenuTitle/index.d.ts +1 -1
- package/NormalText/index.d.ts +1 -1
- package/NotificationBannerContainer/index.d.ts +1 -1
- package/NotificationBannerContent/index.d.ts +1 -1
- package/NotificationBannerHeader/index.d.ts +1 -1
- package/NotificationBannerHeading/index.d.ts +1 -1
- package/NotificationBannerLink/index.d.ts +1 -1
- package/PageTitleCaption/index.d.ts +1 -1
- package/PageTitleContainer/index.d.ts +1 -1
- package/PageTitleHeading/index.d.ts +1 -1
- package/Pagination/index.d.ts +1 -1
- package/PaginationLabelContainer/index.d.ts +1 -1
- package/PaginationList/index.d.ts +1 -1
- package/PaginationListItem/index.d.ts +1 -1
- package/Panel/index.d.ts +1 -1
- package/PanelBody/index.d.ts +1 -1
- package/PanelTitle/index.d.ts +1 -1
- package/Paragraph/index.d.ts +1 -1
- package/PhaseBanner/index.d.ts +1 -1
- package/PhaseBannerHeaderContainer/index.d.ts +1 -1
- package/PhaseBannerTag/index.d.ts +1 -1
- package/PhaseBannerText/index.d.ts +1 -1
- package/RadioConditional/index.d.ts +1 -1
- package/RadioContainer/index.d.ts +1 -1
- package/RadioItem/index.d.ts +1 -1
- package/ResultsActionBar/index.d.ts +1 -1
- package/ResultsHeading/index.d.ts +1 -1
- package/ResultsHeadingActions/index.d.ts +1 -1
- package/SearchButton/index.d.ts +1 -1
- package/SearchContainer/index.d.ts +1 -1
- package/Section/index.d.ts +1 -1
- package/SectionBreak/index.d.ts +1 -1
- package/SelectContainer/index.d.ts +1 -1
- package/SelectOption/index.d.ts +1 -1
- package/SingleCharacterInput/index.d.ts +1 -1
- package/SingleCharacterInputs/index.d.ts +1 -1
- package/SkipLink/index.d.ts +1 -1
- package/Stack/index.d.ts +1 -1
- package/StepNav/index.d.ts +1 -1
- package/StepNavAccordion/index.d.ts +1 -1
- package/StepNavAccordionContent/index.d.ts +1 -1
- package/StepNavAccordionHeadingText/index.d.ts +1 -1
- package/StepNavAccordionHeadingTitle/index.d.ts +1 -1
- package/StepNavAccordionSummary/index.d.ts +1 -1
- package/StepNavAccordionSummaryHeading/index.d.ts +1 -1
- package/StepNavCircleNumber/index.d.ts +1 -1
- package/StepNavControls/index.d.ts +1 -1
- package/StepNavList/index.d.ts +1 -1
- package/StepNavListItem/index.d.ts +1 -1
- package/SummaryList/index.d.ts +1 -1
- package/SummaryListItem/index.d.ts +1 -1
- package/SummaryListItemAction/index.d.ts +1 -1
- package/SummaryListItemKey/index.d.ts +1 -1
- package/SummaryListItemValue/index.d.ts +1 -1
- package/SvgIcon/__snapshots__/index.test.tsx.snap +43 -20
- package/SvgIcon/index.d.ts +6 -5
- package/SvgIcon/index.test/index.js +25 -19
- package/Table/index.d.ts +1 -1
- package/TableBody/index.d.ts +1 -1
- package/TableCaption/index.d.ts +1 -1
- package/TableContainer/index.d.ts +1 -1
- package/TableDataCell/index.d.ts +1 -1
- package/TableHead/index.d.ts +1 -1
- package/TableHeadCell/index.d.ts +1 -1
- package/TableLoaderBackground/index.d.ts +1 -1
- package/TableNoDataRow/index.d.ts +1 -1
- package/TableRow/index.d.ts +1 -1
- package/TableSortIconContainer/index.d.ts +1 -1
- package/Tabs/index.d.ts +1 -1
- package/TabsHeading/index.d.ts +1 -1
- package/TabsList/index.d.ts +1 -1
- package/TabsListItemBase/index.d.ts +1 -1
- package/TabsPanelBase/index.d.ts +1 -1
- package/TaskList/index.d.ts +1 -1
- package/TaskListItem/index.d.ts +1 -1
- package/TaskListItemContent/index.d.ts +1 -1
- package/TaskListItemHeading/index.d.ts +1 -1
- package/TaskListItemTag/index.d.ts +1 -1
- package/TextArea/index.d.ts +1 -1
- package/TextInput/index.d.ts +1 -1
- package/Timeline/index.d.ts +1 -1
- package/TimelineActions/index.d.ts +1 -1
- package/TimelineContent/index.d.ts +1 -1
- package/TimelineHeading/index.d.ts +1 -1
- package/TimelineItem/index.d.ts +1 -1
- package/Top/index.d.ts +1 -1
- package/Typography/index.d.ts +1 -1
- package/Unpurge/index.js +1 -1
- package/VisuallyHidden/index.d.ts +1 -1
- package/WarningText/index.d.ts +1 -1
- package/cjs/Base/index.js +16 -2
- package/cjs/SvgIcon/__snapshots__/index.test.tsx.snap +43 -20
- package/cjs/SvgIcon/index.test/index.js +25 -19
- package/cjs/Unpurge/index.js +1 -1
- package/cjs/lazy/index.js +2137 -0
- package/index.js +1 -1
- package/lazy/index.js +1655 -0
- package/lazy/package.json +6 -0
- package/lazy.d.ts +239 -0
- package/package.json +3 -3
- package/src/Base/index.tsx +149 -59
- package/src/SvgIcon/__snapshots__/index.test.tsx.snap +43 -20
- package/src/SvgIcon/index.test.tsx +5 -2
- package/src/SvgIcon/index.tsx +6 -4
- package/src/Unpurge/index.tsx +136 -0
- package/src/lazy.js +240 -0
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/react-core",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc.0",
|
|
4
4
|
"description": "@digigov react core components",
|
|
5
5
|
"author": "GRNET Developers <devs@lists.grnet.gr>",
|
|
6
6
|
"license": "BSD-2-Clause",
|
|
7
7
|
"main": "./cjs/index.js",
|
|
8
8
|
"module": "./index.js",
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@digigov/css": "
|
|
11
|
-
"@digigov/react-icons": "2.0.0-
|
|
10
|
+
"@digigov/css": "1.3.0-rc.0",
|
|
11
|
+
"@digigov/react-icons": "2.0.0-rc.0",
|
|
12
12
|
"clsx": "1.1.1",
|
|
13
13
|
"react": "^16.8.0 || ^17.0.0",
|
|
14
14
|
"react-dom": "^16.8.0 || ^17.0.0"
|
package/src/Base/index.tsx
CHANGED
|
@@ -10,77 +10,139 @@ type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
|
10
10
|
// This is the first reusable type utility we built
|
|
11
11
|
type PolymorphicComponentProp<
|
|
12
12
|
C extends React.ElementType,
|
|
13
|
-
Props = Record<string, unknown
|
|
13
|
+
Props = Record<string, unknown>,
|
|
14
14
|
> = React.PropsWithChildren<Props & AsProp<C>> &
|
|
15
15
|
Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
16
16
|
|
|
17
17
|
// This is a new type utitlity with ref!
|
|
18
18
|
type PolymorphicComponentPropWithRef<
|
|
19
19
|
C extends React.ElementType,
|
|
20
|
-
Props = Record<string, unknown
|
|
20
|
+
Props = Record<string, unknown>,
|
|
21
21
|
> = PolymorphicComponentProp<C, Props> & { ref?: any };
|
|
22
22
|
|
|
23
23
|
// This is the type for the "ref" only
|
|
24
|
-
type PolymorphicRef<C extends React.ElementType> =
|
|
25
|
-
C
|
|
26
|
-
>['ref'];
|
|
24
|
+
type PolymorphicRef<C extends React.ElementType> =
|
|
25
|
+
React.ComponentPropsWithRef<C>['ref'];
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* This is the updated component props using PolymorphicComponentPropWithRef
|
|
30
29
|
*/
|
|
31
|
-
export type BaseProps<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
30
|
+
export type BaseProps<C extends React.ElementType> =
|
|
31
|
+
PolymorphicComponentPropWithRef<
|
|
32
|
+
C,
|
|
33
|
+
{
|
|
34
|
+
/** margin is optional. It has not a default value. */
|
|
35
|
+
margin?: spacingValues;
|
|
36
|
+
/** marginTop is optional. It has not a default value. */
|
|
37
|
+
marginTop?: spacingValues;
|
|
38
|
+
/** marginBottom is optional. It has not a default value. */
|
|
39
|
+
marginBottom?: spacingValues;
|
|
40
|
+
/** marginLeft is optional. It has not a default value. */
|
|
41
|
+
marginLeft?: spacingValues;
|
|
42
|
+
/** marginRight is optional. It has not a default value. */
|
|
43
|
+
marginRight?: spacingValues;
|
|
44
|
+
/** Alternative for margin. Margin is optional. It has not a default value. */
|
|
45
|
+
m?: spacingValues;
|
|
46
|
+
/** Alternative for marginTop. MarginTop is optional. It has not a default value. */
|
|
47
|
+
mt?: spacingValues;
|
|
48
|
+
/** Alternative for marginBottom. MarginBottom is optional. It has not a default value. */
|
|
49
|
+
mb?: spacingValues;
|
|
50
|
+
/** Alternative for marginLeft. MarginLeft is optional. It has not a default value. */
|
|
51
|
+
ml?: spacingValues;
|
|
52
|
+
/** Alternative for marginRight. MarginRight is optional. It has not a default value. */
|
|
53
|
+
mr?: spacingValues;
|
|
54
|
+
/** Alternative for marginX. MarginX is optional. It has not a default value. */
|
|
55
|
+
mx?: spacingValues;
|
|
56
|
+
/** Alternative for marginY. MarginY is optional. It has not a default value. */
|
|
57
|
+
my?: spacingValues;
|
|
58
|
+
/** padding is optional. It has not a default value. */
|
|
59
|
+
padding?: spacingValues;
|
|
60
|
+
/** paddingTop is optional. It has not a default value. */
|
|
61
|
+
paddingTop?: spacingValues;
|
|
62
|
+
/** paddingBottom is optional. It has not a default value. */
|
|
63
|
+
paddingBottom?: spacingValues;
|
|
64
|
+
/** paddingLeft is optional. It has not a default value. */
|
|
65
|
+
paddingLeft?: spacingValues;
|
|
66
|
+
/** paddingRight is optional. It has not a default value. */
|
|
67
|
+
paddingRight?: spacingValues;
|
|
68
|
+
/** Alternative for padding. Padding is optional. It has not a default value. */
|
|
69
|
+
p?: spacingValues;
|
|
70
|
+
/** Alternative for paddingTop. PaddingTop is optional. It has not a default value. */
|
|
71
|
+
pt?: spacingValues;
|
|
72
|
+
/** Alternative for paddingBottom. PaddingBottom is optional. It has not a default value. */
|
|
73
|
+
pb?: spacingValues;
|
|
74
|
+
/** Alternative for paddingLeft. PaddingLeft is optional. It has not a default value. */
|
|
75
|
+
pl?: spacingValues;
|
|
76
|
+
/** Alternative for paddingRight. PaddingRight is optional. It has not a default value. */
|
|
77
|
+
pr?: spacingValues;
|
|
78
|
+
/** Alternative for paddingX. PaddingX is optional. It has not a default value. */
|
|
79
|
+
px?: spacingValues;
|
|
80
|
+
/** Alternative for paddingY. PaddingY is optional. It has not a default value. */
|
|
81
|
+
py?: spacingValues;
|
|
82
|
+
/** printHidden is optional. Default value is false. When true, the component is hidden at print. */
|
|
83
|
+
printHidden?: boolean;
|
|
84
|
+
/** printVisible is optional. When block, the component is displayed as block. When inline, the component is displayed as inline.*/
|
|
85
|
+
printVisible?: 'block' | 'inline';
|
|
86
|
+
/** Components will be hidden at all screen sizes. */
|
|
87
|
+
hidden?: boolean;
|
|
88
|
+
/** Components will be hidden from 'xs' screen size and up. */
|
|
89
|
+
xsUpHidden?: boolean;
|
|
90
|
+
/** Components will be hidden from 'sm' screen size and up. */
|
|
91
|
+
smUpHidden?: boolean;
|
|
92
|
+
/** Components will be hidden from 'md' screen size and up. */
|
|
93
|
+
mdUpHidden?: boolean;
|
|
94
|
+
/** Components will be hidden from 'lg' screen size and up. */
|
|
95
|
+
lgUpHidden?: boolean;
|
|
96
|
+
/** Components will be hidden from 'xl' screen size and up. */
|
|
97
|
+
xlUpHidden?: boolean;
|
|
98
|
+
/** Components will be hidden between xs and sm screen size. */
|
|
99
|
+
xsHidden?: boolean;
|
|
100
|
+
/** Components will be hidden between sm and md screen size. */
|
|
101
|
+
smHidden?: boolean;
|
|
102
|
+
/** Components will be hidden between md and lg screen size. */
|
|
103
|
+
mdHidden?: boolean;
|
|
104
|
+
/** Components will be hidden between lg and xl screen size. */
|
|
105
|
+
lgHidden?: boolean;
|
|
106
|
+
/** Components will be hidden between xl and 2xl screen size. */
|
|
107
|
+
xlHidden?: boolean;
|
|
108
|
+
}
|
|
109
|
+
>;
|
|
110
|
+
|
|
111
|
+
type spacingValues =
|
|
112
|
+
| 0
|
|
113
|
+
| 0.5
|
|
114
|
+
| 1
|
|
115
|
+
| 1.5
|
|
116
|
+
| 2
|
|
117
|
+
| 2.5
|
|
118
|
+
| 3
|
|
119
|
+
| 3.5
|
|
120
|
+
| 4
|
|
121
|
+
| 5
|
|
122
|
+
| 6
|
|
123
|
+
| 7
|
|
124
|
+
| 8
|
|
125
|
+
| 9
|
|
126
|
+
| 10
|
|
127
|
+
| 11
|
|
128
|
+
| 12
|
|
129
|
+
| 14
|
|
130
|
+
| 16
|
|
131
|
+
| 20
|
|
132
|
+
| 24
|
|
133
|
+
| 28
|
|
134
|
+
| 32
|
|
135
|
+
| 36
|
|
136
|
+
| 40
|
|
137
|
+
| 44
|
|
138
|
+
| 48
|
|
139
|
+
| 52
|
|
140
|
+
| 56
|
|
141
|
+
| 60
|
|
142
|
+
| 64
|
|
143
|
+
| 72
|
|
144
|
+
| 80
|
|
145
|
+
| 96;
|
|
84
146
|
|
|
85
147
|
/**
|
|
86
148
|
* This is the type used in the type annotation for the component
|
|
@@ -90,7 +152,7 @@ type BaseComponent = <C extends React.ElementType = 'span'>(
|
|
|
90
152
|
) => React.ReactElement | null;
|
|
91
153
|
|
|
92
154
|
export const Base: BaseComponent = React.forwardRef(function Base<
|
|
93
|
-
C extends React.ElementType = 'span'
|
|
155
|
+
C extends React.ElementType = 'span',
|
|
94
156
|
>(
|
|
95
157
|
{
|
|
96
158
|
as,
|
|
@@ -99,11 +161,25 @@ export const Base: BaseComponent = React.forwardRef(function Base<
|
|
|
99
161
|
marginBottom,
|
|
100
162
|
marginLeft,
|
|
101
163
|
marginRight,
|
|
164
|
+
m,
|
|
165
|
+
mt,
|
|
166
|
+
mb,
|
|
167
|
+
ml,
|
|
168
|
+
mr,
|
|
169
|
+
mx,
|
|
170
|
+
my,
|
|
102
171
|
padding,
|
|
103
172
|
paddingTop,
|
|
104
173
|
paddingBottom,
|
|
105
174
|
paddingLeft,
|
|
106
175
|
paddingRight,
|
|
176
|
+
p,
|
|
177
|
+
pt,
|
|
178
|
+
pb,
|
|
179
|
+
pr,
|
|
180
|
+
pl,
|
|
181
|
+
px,
|
|
182
|
+
py,
|
|
107
183
|
printHidden,
|
|
108
184
|
printVisible,
|
|
109
185
|
hidden,
|
|
@@ -134,6 +210,13 @@ export const Base: BaseComponent = React.forwardRef(function Base<
|
|
|
134
210
|
marginBottom !== undefined ? true : undefined,
|
|
135
211
|
[`ds-mr-${marginRight}`]: marginRight !== undefined ? true : undefined,
|
|
136
212
|
[`ds-ml-${marginLeft}`]: marginLeft !== undefined ? true : undefined,
|
|
213
|
+
[`ds-m-${m}`]: m !== undefined ? true : undefined,
|
|
214
|
+
[`ds-mt-${mt}`]: mt !== undefined ? true : undefined,
|
|
215
|
+
[`ds-mb-${mb}`]: mb !== undefined ? true : undefined,
|
|
216
|
+
[`ds-mr-${mr}`]: mr !== undefined ? true : undefined,
|
|
217
|
+
[`ds-ml-${ml}`]: ml !== undefined ? true : undefined,
|
|
218
|
+
[`ds-mx-${mx}`]: mx !== undefined ? true : undefined,
|
|
219
|
+
[`ds-my-${my}`]: my !== undefined ? true : undefined,
|
|
137
220
|
[`ds-p-${padding}`]: padding !== undefined ? true : undefined,
|
|
138
221
|
[`ds-pt-${paddingTop}`]: paddingTop !== undefined ? true : undefined,
|
|
139
222
|
[`ds-pb-${paddingBottom}`]:
|
|
@@ -141,6 +224,13 @@ export const Base: BaseComponent = React.forwardRef(function Base<
|
|
|
141
224
|
[`ds-pr-${paddingRight}`]:
|
|
142
225
|
paddingRight !== undefined ? true : undefined,
|
|
143
226
|
[`ds-pl-${paddingLeft}`]: paddingLeft !== undefined ? true : undefined,
|
|
227
|
+
[`ds-p-${p}`]: p !== undefined ? true : undefined,
|
|
228
|
+
[`ds-pt-${pt}`]: pt !== undefined ? true : undefined,
|
|
229
|
+
[`ds-pb-${pb}`]: pb !== undefined ? true : undefined,
|
|
230
|
+
[`ds-pr-${pr}`]: pr !== undefined ? true : undefined,
|
|
231
|
+
[`ds-pl-${pl}`]: pl !== undefined ? true : undefined,
|
|
232
|
+
[`ds-px-${px}`]: px !== undefined ? true : undefined,
|
|
233
|
+
[`ds-py-${py}`]: py !== undefined ? true : undefined,
|
|
144
234
|
'ds-print-hidden': !!printHidden,
|
|
145
235
|
'ds-print-visible-block': printVisible === 'block',
|
|
146
236
|
'ds-print-visible-inline': printVisible === 'inline',
|
|
@@ -19,6 +19,29 @@ exports[`renders the SvgIcon with no props 1`] = `
|
|
|
19
19
|
</ForwardRef(SvgIcon)>
|
|
20
20
|
`;
|
|
21
21
|
|
|
22
|
+
exports[`renders the SvgIcon with prop color=base-content 1`] = `
|
|
23
|
+
<ForwardRef(SvgIcon)
|
|
24
|
+
color="base-content"
|
|
25
|
+
>
|
|
26
|
+
<ForwardRef(Base)
|
|
27
|
+
aria-hidden="true"
|
|
28
|
+
as="svg"
|
|
29
|
+
className="ds-svg-icon--base-content ds-svg-icon"
|
|
30
|
+
focusable="false"
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
>
|
|
33
|
+
<svg
|
|
34
|
+
aria-hidden="true"
|
|
35
|
+
className="ds-svg-icon--base-content ds-svg-icon"
|
|
36
|
+
focusable="false"
|
|
37
|
+
viewBox="0 0 24 24"
|
|
38
|
+
>
|
|
39
|
+
hello
|
|
40
|
+
</svg>
|
|
41
|
+
</ForwardRef(Base)>
|
|
42
|
+
</ForwardRef(SvgIcon)>
|
|
43
|
+
`;
|
|
44
|
+
|
|
22
45
|
exports[`renders the SvgIcon with prop color=dark 1`] = `
|
|
23
46
|
<ForwardRef(SvgIcon)
|
|
24
47
|
color="dark"
|
|
@@ -135,20 +158,20 @@ exports[`renders the SvgIcon with prop color=gray 1`] = `
|
|
|
135
158
|
</ForwardRef(SvgIcon)>
|
|
136
159
|
`;
|
|
137
160
|
|
|
138
|
-
exports[`renders the SvgIcon with prop color=
|
|
161
|
+
exports[`renders the SvgIcon with prop color=primary 1`] = `
|
|
139
162
|
<ForwardRef(SvgIcon)
|
|
140
|
-
color="
|
|
163
|
+
color="primary"
|
|
141
164
|
>
|
|
142
165
|
<ForwardRef(Base)
|
|
143
166
|
aria-hidden="true"
|
|
144
167
|
as="svg"
|
|
145
|
-
className="ds-svg-icon--
|
|
168
|
+
className="ds-svg-icon--primary ds-svg-icon"
|
|
146
169
|
focusable="false"
|
|
147
170
|
viewBox="0 0 24 24"
|
|
148
171
|
>
|
|
149
172
|
<svg
|
|
150
173
|
aria-hidden="true"
|
|
151
|
-
className="ds-svg-icon--
|
|
174
|
+
className="ds-svg-icon--primary ds-svg-icon"
|
|
152
175
|
focusable="false"
|
|
153
176
|
viewBox="0 0 24 24"
|
|
154
177
|
>
|
|
@@ -158,20 +181,20 @@ exports[`renders the SvgIcon with prop color=light 1`] = `
|
|
|
158
181
|
</ForwardRef(SvgIcon)>
|
|
159
182
|
`;
|
|
160
183
|
|
|
161
|
-
exports[`renders the SvgIcon with prop color=
|
|
184
|
+
exports[`renders the SvgIcon with prop color=success 1`] = `
|
|
162
185
|
<ForwardRef(SvgIcon)
|
|
163
|
-
color="
|
|
186
|
+
color="success"
|
|
164
187
|
>
|
|
165
188
|
<ForwardRef(Base)
|
|
166
189
|
aria-hidden="true"
|
|
167
190
|
as="svg"
|
|
168
|
-
className="ds-svg-icon--
|
|
191
|
+
className="ds-svg-icon--success ds-svg-icon"
|
|
169
192
|
focusable="false"
|
|
170
193
|
viewBox="0 0 24 24"
|
|
171
194
|
>
|
|
172
195
|
<svg
|
|
173
196
|
aria-hidden="true"
|
|
174
|
-
className="ds-svg-icon--
|
|
197
|
+
className="ds-svg-icon--success ds-svg-icon"
|
|
175
198
|
focusable="false"
|
|
176
199
|
viewBox="0 0 24 24"
|
|
177
200
|
>
|
|
@@ -181,20 +204,20 @@ exports[`renders the SvgIcon with prop color=primary 1`] = `
|
|
|
181
204
|
</ForwardRef(SvgIcon)>
|
|
182
205
|
`;
|
|
183
206
|
|
|
184
|
-
exports[`renders the SvgIcon with prop color=
|
|
207
|
+
exports[`renders the SvgIcon with prop color=warning 1`] = `
|
|
185
208
|
<ForwardRef(SvgIcon)
|
|
186
|
-
color="
|
|
209
|
+
color="warning"
|
|
187
210
|
>
|
|
188
211
|
<ForwardRef(Base)
|
|
189
212
|
aria-hidden="true"
|
|
190
213
|
as="svg"
|
|
191
|
-
className="ds-svg-icon--
|
|
214
|
+
className="ds-svg-icon--warning ds-svg-icon"
|
|
192
215
|
focusable="false"
|
|
193
216
|
viewBox="0 0 24 24"
|
|
194
217
|
>
|
|
195
218
|
<svg
|
|
196
219
|
aria-hidden="true"
|
|
197
|
-
className="ds-svg-icon--
|
|
220
|
+
className="ds-svg-icon--warning ds-svg-icon"
|
|
198
221
|
focusable="false"
|
|
199
222
|
viewBox="0 0 24 24"
|
|
200
223
|
>
|
|
@@ -204,20 +227,21 @@ exports[`renders the SvgIcon with prop color=success 1`] = `
|
|
|
204
227
|
</ForwardRef(SvgIcon)>
|
|
205
228
|
`;
|
|
206
229
|
|
|
207
|
-
exports[`renders the SvgIcon with prop color=warning 1`] = `
|
|
230
|
+
exports[`renders the SvgIcon with prop color=warning and size=sm 1`] = `
|
|
208
231
|
<ForwardRef(SvgIcon)
|
|
209
232
|
color="warning"
|
|
233
|
+
size="sm"
|
|
210
234
|
>
|
|
211
235
|
<ForwardRef(Base)
|
|
212
236
|
aria-hidden="true"
|
|
213
237
|
as="svg"
|
|
214
|
-
className="ds-svg-icon--warning ds-svg-icon"
|
|
238
|
+
className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
|
|
215
239
|
focusable="false"
|
|
216
240
|
viewBox="0 0 24 24"
|
|
217
241
|
>
|
|
218
242
|
<svg
|
|
219
243
|
aria-hidden="true"
|
|
220
|
-
className="ds-svg-icon--warning ds-svg-icon"
|
|
244
|
+
className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
|
|
221
245
|
focusable="false"
|
|
222
246
|
viewBox="0 0 24 24"
|
|
223
247
|
>
|
|
@@ -227,21 +251,20 @@ exports[`renders the SvgIcon with prop color=warning 1`] = `
|
|
|
227
251
|
</ForwardRef(SvgIcon)>
|
|
228
252
|
`;
|
|
229
253
|
|
|
230
|
-
exports[`renders the SvgIcon with prop color=
|
|
254
|
+
exports[`renders the SvgIcon with prop color=white 1`] = `
|
|
231
255
|
<ForwardRef(SvgIcon)
|
|
232
|
-
color="
|
|
233
|
-
size="sm"
|
|
256
|
+
color="white"
|
|
234
257
|
>
|
|
235
258
|
<ForwardRef(Base)
|
|
236
259
|
aria-hidden="true"
|
|
237
260
|
as="svg"
|
|
238
|
-
className="ds-svg-icon--
|
|
261
|
+
className="ds-svg-icon--white ds-svg-icon"
|
|
239
262
|
focusable="false"
|
|
240
263
|
viewBox="0 0 24 24"
|
|
241
264
|
>
|
|
242
265
|
<svg
|
|
243
266
|
aria-hidden="true"
|
|
244
|
-
className="ds-svg-icon--
|
|
267
|
+
className="ds-svg-icon--white ds-svg-icon"
|
|
245
268
|
focusable="false"
|
|
246
269
|
viewBox="0 0 24 24"
|
|
247
270
|
>
|
|
@@ -21,11 +21,14 @@ it('renders the SvgIcon with prop size=lg', () => {
|
|
|
21
21
|
it('renders the SvgIcon with prop size=xl', () => {
|
|
22
22
|
expect(mount(<SvgIcon size="xl">hello</SvgIcon>)).toMatchSnapshot();
|
|
23
23
|
});
|
|
24
|
+
it('renders the SvgIcon with prop color=base-content', () => {
|
|
25
|
+
expect(mount(<SvgIcon color="base-content">hello</SvgIcon>)).toMatchSnapshot();
|
|
26
|
+
});
|
|
24
27
|
it('renders the SvgIcon with prop color=dark', () => {
|
|
25
28
|
expect(mount(<SvgIcon color="dark">hello</SvgIcon>)).toMatchSnapshot();
|
|
26
29
|
});
|
|
27
|
-
it('renders the SvgIcon with prop color=
|
|
28
|
-
expect(mount(<SvgIcon color="
|
|
30
|
+
it('renders the SvgIcon with prop color=white', () => {
|
|
31
|
+
expect(mount(<SvgIcon color="white">hello</SvgIcon>)).toMatchSnapshot();
|
|
29
32
|
});
|
|
30
33
|
it('renders the SvgIcon with prop color=gray', () => {
|
|
31
34
|
expect(mount(<SvgIcon color="gray">hello</SvgIcon>)).toMatchSnapshot();
|
package/src/SvgIcon/index.tsx
CHANGED
|
@@ -18,20 +18,22 @@ export interface SvgIconProps extends BaseProps<'svg'> {
|
|
|
18
18
|
/**
|
|
19
19
|
* color property styles svg icon with Gov.gr palette's basic colors.
|
|
20
20
|
* color property is optional.
|
|
21
|
-
* @value '
|
|
22
|
-
* @value '
|
|
21
|
+
* @value 'base-content'
|
|
22
|
+
* @value 'dark', always dark, among all themes
|
|
23
|
+
* @value 'white', always white, among all themes
|
|
23
24
|
* @value 'gray'
|
|
24
25
|
* @value 'primary'
|
|
25
26
|
* @value 'success'
|
|
26
27
|
* @value 'warning'
|
|
27
28
|
* @value 'error'
|
|
28
|
-
* @value 'focus'
|
|
29
|
+
* @value 'focus', use only in focus state, in dark background
|
|
29
30
|
* @value 'info'
|
|
30
31
|
* @value 'link'
|
|
31
32
|
*/
|
|
32
33
|
color?:
|
|
34
|
+
| 'base-content'
|
|
33
35
|
| 'dark'
|
|
34
|
-
| '
|
|
36
|
+
| 'white'
|
|
35
37
|
| 'gray'
|
|
36
38
|
| 'primary'
|
|
37
39
|
| 'success'
|
package/src/Unpurge/index.tsx
CHANGED
|
@@ -179,6 +179,74 @@ function Unpurge() {
|
|
|
179
179
|
ds-mb-1.5
|
|
180
180
|
ds-mb-2.5
|
|
181
181
|
ds-mb-3.5
|
|
182
|
+
ds-mx-0
|
|
183
|
+
ds-mx-1
|
|
184
|
+
ds-mx-2
|
|
185
|
+
ds-mx-3
|
|
186
|
+
ds-mx-4
|
|
187
|
+
ds-mx-5
|
|
188
|
+
ds-mx-6
|
|
189
|
+
ds-mx-7
|
|
190
|
+
ds-mx-8
|
|
191
|
+
ds-mx-9
|
|
192
|
+
ds-mx-10
|
|
193
|
+
ds-mx-11
|
|
194
|
+
ds-mx-12
|
|
195
|
+
ds-mx-14
|
|
196
|
+
ds-mx-16
|
|
197
|
+
ds-mx-20
|
|
198
|
+
ds-mx-24
|
|
199
|
+
ds-mx-28
|
|
200
|
+
ds-mx-32
|
|
201
|
+
ds-mx-36
|
|
202
|
+
ds-mx-40
|
|
203
|
+
ds-mx-44
|
|
204
|
+
ds-mx-48
|
|
205
|
+
ds-mx-52
|
|
206
|
+
ds-mx-56
|
|
207
|
+
ds-mx-60
|
|
208
|
+
ds-mx-64
|
|
209
|
+
ds-mx-72
|
|
210
|
+
ds-mx-80
|
|
211
|
+
ds-mx-96
|
|
212
|
+
ds-mx-0.5
|
|
213
|
+
ds-mx-1.5
|
|
214
|
+
ds-mx-2.5
|
|
215
|
+
ds-mx-3.5
|
|
216
|
+
ds-my-0
|
|
217
|
+
ds-my-1
|
|
218
|
+
ds-my-2
|
|
219
|
+
ds-my-3
|
|
220
|
+
ds-my-4
|
|
221
|
+
ds-my-5
|
|
222
|
+
ds-my-6
|
|
223
|
+
ds-my-7
|
|
224
|
+
ds-my-8
|
|
225
|
+
ds-my-9
|
|
226
|
+
ds-my-10
|
|
227
|
+
ds-my-11
|
|
228
|
+
ds-my-12
|
|
229
|
+
ds-my-14
|
|
230
|
+
ds-my-16
|
|
231
|
+
ds-my-20
|
|
232
|
+
ds-my-24
|
|
233
|
+
ds-my-28
|
|
234
|
+
ds-my-32
|
|
235
|
+
ds-my-36
|
|
236
|
+
ds-my-40
|
|
237
|
+
ds-my-44
|
|
238
|
+
ds-my-48
|
|
239
|
+
ds-my-52
|
|
240
|
+
ds-my-56
|
|
241
|
+
ds-my-60
|
|
242
|
+
ds-my-64
|
|
243
|
+
ds-my-72
|
|
244
|
+
ds-my-80
|
|
245
|
+
ds-my-96
|
|
246
|
+
ds-my-0.5
|
|
247
|
+
ds-my-1.5
|
|
248
|
+
ds-my-2.5
|
|
249
|
+
ds-my-3.5
|
|
182
250
|
ds-p-0
|
|
183
251
|
ds-p-1
|
|
184
252
|
ds-p-2
|
|
@@ -354,6 +422,74 @@ function Unpurge() {
|
|
|
354
422
|
ds-pb-1.5
|
|
355
423
|
ds-pb-2.5
|
|
356
424
|
ds-pb-3.5
|
|
425
|
+
ds-px-0
|
|
426
|
+
ds-px-1
|
|
427
|
+
ds-px-2
|
|
428
|
+
ds-px-3
|
|
429
|
+
ds-px-4
|
|
430
|
+
ds-px-5
|
|
431
|
+
ds-px-6
|
|
432
|
+
ds-px-7
|
|
433
|
+
ds-px-8
|
|
434
|
+
ds-px-9
|
|
435
|
+
ds-px-10
|
|
436
|
+
ds-px-11
|
|
437
|
+
ds-px-12
|
|
438
|
+
ds-px-14
|
|
439
|
+
ds-px-16
|
|
440
|
+
ds-px-20
|
|
441
|
+
ds-px-24
|
|
442
|
+
ds-px-28
|
|
443
|
+
ds-px-32
|
|
444
|
+
ds-px-36
|
|
445
|
+
ds-px-40
|
|
446
|
+
ds-px-44
|
|
447
|
+
ds-px-48
|
|
448
|
+
ds-px-52
|
|
449
|
+
ds-px-56
|
|
450
|
+
ds-px-60
|
|
451
|
+
ds-px-64
|
|
452
|
+
ds-px-72
|
|
453
|
+
ds-px-80
|
|
454
|
+
ds-px-96
|
|
455
|
+
ds-px-0.5
|
|
456
|
+
ds-px-1.5
|
|
457
|
+
ds-px-2.5
|
|
458
|
+
ds-px-3.5
|
|
459
|
+
ds-py-0
|
|
460
|
+
ds-py-1
|
|
461
|
+
ds-py-2
|
|
462
|
+
ds-py-3
|
|
463
|
+
ds-py-4
|
|
464
|
+
ds-py-5
|
|
465
|
+
ds-py-6
|
|
466
|
+
ds-py-7
|
|
467
|
+
ds-py-8
|
|
468
|
+
ds-py-9
|
|
469
|
+
ds-py-10
|
|
470
|
+
ds-py-11
|
|
471
|
+
ds-py-12
|
|
472
|
+
ds-py-14
|
|
473
|
+
ds-py-16
|
|
474
|
+
ds-py-20
|
|
475
|
+
ds-py-24
|
|
476
|
+
ds-py-28
|
|
477
|
+
ds-py-32
|
|
478
|
+
ds-py-36
|
|
479
|
+
ds-py-40
|
|
480
|
+
ds-py-44
|
|
481
|
+
ds-py-48
|
|
482
|
+
ds-py-52
|
|
483
|
+
ds-py-56
|
|
484
|
+
ds-py-60
|
|
485
|
+
ds-py-64
|
|
486
|
+
ds-py-72
|
|
487
|
+
ds-py-80
|
|
488
|
+
ds-py-96
|
|
489
|
+
ds-py-0.5
|
|
490
|
+
ds-py-1.5
|
|
491
|
+
ds-py-2.5
|
|
492
|
+
ds-py-3.5
|
|
357
493
|
ds-gap-1
|
|
358
494
|
ds-gap-2
|
|
359
495
|
ds-gap-4
|