@digigov/react-core 2.0.0-rc.21 → 2.0.0-rc.22
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/Base/index.web/index.js +2 -1
- package/Base/index.web.js.map +2 -2
- package/Chip/index.js.map +2 -2
- package/Drawer/index.d.ts +7 -5
- package/Drawer/index.js +25 -12
- package/Drawer/index.js.map +2 -2
- package/FilterContainer/index.d.ts +8 -6
- package/FilterContainer/index.js +24 -11
- package/FilterContainer/index.js.map +2 -2
- package/FilterHeadingContainer/index.d.ts +12 -0
- package/FilterHeadingContainer/index.js +12 -2
- package/FilterHeadingContainer/index.js.map +2 -2
- package/ModalContainer/index.js +4 -4
- package/ModalContainer/index.js.map +2 -2
- package/ResultsHeadingActions/index.js +2 -4
- package/ResultsHeadingActions/index.js.map +2 -2
- package/TextArea/index.web/index.js +2 -3
- package/TextArea/index.web.js.map +2 -2
- package/cjs/Base/index.web/index.js +2 -1
- package/cjs/Base/index.web.js.map +3 -3
- package/cjs/Chip/index.js.map +2 -2
- package/cjs/Drawer/index.js +25 -12
- package/cjs/Drawer/index.js.map +2 -2
- package/cjs/FilterContainer/index.js +24 -11
- package/cjs/FilterContainer/index.js.map +2 -2
- package/cjs/FilterHeadingContainer/index.js +12 -2
- package/cjs/FilterHeadingContainer/index.js.map +3 -3
- package/cjs/ModalContainer/index.js +4 -4
- package/cjs/ModalContainer/index.js.map +2 -2
- package/cjs/ResultsHeadingActions/index.js +2 -4
- package/cjs/ResultsHeadingActions/index.js.map +3 -3
- package/cjs/TextArea/index.web/index.js +2 -3
- package/cjs/TextArea/index.web.js.map +2 -2
- package/index.js +1 -1
- package/package.json +3 -3
- package/src/Accordion/__snapshots__/index.test.tsx.snap +2 -2
- package/src/AccordionControls/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AccordionSection/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AccordionSectionContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AccordionSectionSummary/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AccordionSectionSummaryHeading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AdminAside/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AdminContainer/__snapshots__/index.test.tsx.snap +3 -3
- package/src/AdminHeader/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AdminHeaderContent/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/AdminLayout/__snapshots__/index.test.tsx.snap +2 -2
- package/src/AdminMain/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AdminTopSection/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Aside/__snapshots__/index.test.tsx.snap +2 -2
- package/src/AutoCompleteAssistiveHint/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AutoCompleteContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AutoCompleteInput/__snapshots__/index.test.tsx.snap +3 -3
- package/src/AutoCompleteInputTypeahead/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AutoCompleteResultList/__snapshots__/index.test.tsx.snap +2 -2
- package/src/AutoCompleteResultListItem/__snapshots__/index.test.tsx.snap +3 -3
- package/src/AutoCompleteStatus/__snapshots__/index.test.tsx.snap +1 -1
- package/src/AutoCompleteStatusContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/BackLink/__snapshots__/index.test.tsx.snap +9 -3
- package/src/BannerContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Base/index.web.tsx +2 -2
- package/src/Blockquote/__snapshots__/index.test.tsx.snap +2 -2
- package/src/Bottom/__snapshots__/index.test.tsx.snap +1 -1
- package/src/BottomInfo/__snapshots__/index.test.tsx.snap +2 -2
- package/src/BottomInfoContainer/__snapshots__/index.test.tsx.snap +2 -2
- package/src/BottomInfoContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Breadcrumbs/__snapshots__/index.test.tsx.snap +1 -1
- package/src/BreadcrumbsList/__snapshots__/index.test.tsx.snap +1 -1
- package/src/BreadcrumbsListItem/__snapshots__/index.test.tsx.snap +2 -2
- package/src/Button/__snapshots__/index.test.tsx.snap +13 -13
- package/src/ButtonGroup/__snapshots__/index.test.tsx.snap +1 -1
- package/src/ButtonLink/__snapshots__/index.test.tsx.snap +12 -12
- package/src/CallToAction/__snapshots__/index.test.tsx.snap +6 -3
- package/src/Card/__snapshots__/index.test.tsx.snap +13 -13
- package/src/CardAction/__snapshots__/index.test.tsx.snap +1 -1
- package/src/CardContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/CardHeading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Checkbox/__snapshots__/index.test.tsx.snap +3 -3
- package/src/CheckboxConditional/__snapshots__/index.test.tsx.snap +1 -1
- package/src/CheckboxItem/__snapshots__/index.test.tsx.snap +4 -4
- package/src/Chip/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Chip/index.tsx +2 -1
- package/src/ChipContainer/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/ChipHeading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/ChipKeyValue/__snapshots__/index.test.tsx.snap +1 -1
- package/src/ChoiceDividerText/__snapshots__/index.test.tsx.snap +1 -1
- package/src/CircularProgress/__snapshots__/index.test.tsx.snap +7 -7
- package/src/CloseButton/__snapshots__/index.test.tsx.snap +9 -3
- package/src/Code/__snapshots__/index.test.tsx.snap +4 -4
- package/src/CodeBlockContainer/__snapshots__/index.test.tsx.snap +3 -9
- package/src/CodeBlockContent/__snapshots__/index.test.tsx.snap +17 -0
- package/src/CodeBlockHeader/__snapshots__/index.test.tsx.snap +13 -0
- package/src/Container/__snapshots__/index.test.tsx.snap +4 -4
- package/src/CopyToClipboardContainer/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/CopyToClipboardMessage/__snapshots__/index.test.tsx.snap +4 -4
- package/src/CopyrightContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/DateInputContainer/__snapshots__/index.test.tsx.snap +2 -2
- package/src/DateInputItem/__snapshots__/index.test.tsx.snap +4 -4
- package/src/Details/__snapshots__/index.test.tsx.snap +1 -1
- package/src/DetailsContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/DetailsSummary/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Drawer/__snapshots__/index.test.tsx.snap +38 -31
- package/src/Drawer/index.tsx +29 -16
- package/src/DrawerHeading/__snapshots__/index.test.tsx.snap +6 -3
- package/src/DropdownBase/__snapshots__/index.test.tsx.snap +7 -7
- package/src/DropdownButton/__snapshots__/index.test.tsx.snap +41 -23
- package/src/DropdownContent/__snapshots__/index.test.tsx.snap +2 -2
- package/src/ErrorMessage/__snapshots__/index.test.tsx.snap +1 -1
- package/src/ErrorSummary/__snapshots__/index.test.tsx.snap +3 -3
- package/src/FieldContainer/__snapshots__/index.test.tsx.snap +2 -2
- package/src/Fieldset/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FieldsetLegend/__snapshots__/index.test.tsx.snap +11 -11
- package/src/FileUpload/__snapshots__/index.test.tsx.snap +3 -3
- package/src/FileUploadContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FillableText/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FilterContainer/__snapshots__/index.test.tsx.snap +71 -3
- package/src/FilterContainer/index.test.tsx +21 -0
- package/src/FilterContainer/index.tsx +29 -16
- package/src/FilterContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FilterHeadingContainer/__snapshots__/index.test.tsx.snap +13 -1
- package/src/FilterHeadingContainer/index.test.tsx +10 -0
- package/src/FilterHeadingContainer/index.tsx +29 -2
- package/src/FilterOptionsSection/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/FilterSelectedHeading/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/FilterSelectedSection/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Footer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterContentLogos/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterHeading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterImage/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterInfo/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterInfoSection/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterLink/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterList/__snapshots__/index.test.tsx.snap +2 -2
- package/src/FooterListItem/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterNavigation/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FooterNavigationSection/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Form/__snapshots__/index.test.tsx.snap +1 -1
- package/src/FullPageBackground/__snapshots__/index.test.tsx.snap +1 -1
- package/src/GovGRLogo/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Grid/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Header/__snapshots__/index.test.tsx.snap +1 -1
- package/src/HeaderContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/HeaderLogo/__snapshots__/index.test.tsx.snap +1 -1
- package/src/HeaderNavMenuContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/HeaderSecondaryLogo/__snapshots__/index.test.tsx.snap +1 -1
- package/src/HeaderSection/__snapshots__/index.test.tsx.snap +1 -1
- package/src/HeaderTitle/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Heading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/HeadingCaption/__snapshots__/index.test.tsx.snap +1 -1
- package/src/HellenicRepublicLogo/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Hidden/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Hint/__snapshots__/index.test.tsx.snap +1 -1
- package/src/ImageLogo/__snapshots__/index.test.tsx.snap +3 -3
- package/src/ImageLogoSet/__snapshots__/index.test.tsx.snap +6 -6
- package/src/LabelContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/LabelTitle/__snapshots__/index.test.tsx.snap +11 -11
- package/src/LabeledText/__snapshots__/index.test.tsx.snap +2 -2
- package/src/Layout/__snapshots__/index.test.tsx.snap +2 -2
- package/src/LinkBase/__snapshots__/index.test.tsx.snap +2 -2
- package/src/List/__snapshots__/index.test.tsx.snap +7 -7
- package/src/ListItem/__snapshots__/index.test.tsx.snap +1 -1
- package/src/LoaderContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Main/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Masthead/__snapshots__/index.test.tsx.snap +2 -2
- package/src/MastheadBody/__snapshots__/index.test.tsx.snap +1 -1
- package/src/MastheadLogo/__snapshots__/index.test.tsx.snap +1 -1
- package/src/ModalAction/__snapshots__/index.test.tsx.snap +1 -1
- package/src/ModalContainer/__snapshots__/index.test.tsx.snap +4 -4
- package/src/ModalContainer/index.tsx +5 -5
- package/src/ModalContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/ModalHeading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Nav/__snapshots__/index.test.tsx.snap +8 -8
- package/src/NavList/__snapshots__/index.test.tsx.snap +3 -3
- package/src/NavListItemAction/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NavListItemActionContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NavListItemBadge/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NavListItemButton/__snapshots__/index.test.tsx.snap +13 -4
- package/src/NavListItemLink/__snapshots__/index.test.tsx.snap +2 -2
- package/src/NavMenuContainer/__snapshots__/index.test.tsx.snap +8 -8
- package/src/NavMenuContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NavMenuContentListBase/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NavMenuContentListItem/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NavMenuTitle/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NormalText/__snapshots__/index.test.tsx.snap +21 -21
- package/src/NotificationBannerContainer/__snapshots__/index.test.tsx.snap +4 -4
- package/src/NotificationBannerContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NotificationBannerHeader/__snapshots__/index.test.tsx.snap +2 -2
- package/src/NotificationBannerHeading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NotificationBannerLink/__snapshots__/index.test.tsx.snap +1 -1
- package/src/PageTitleCaption/__snapshots__/index.test.tsx.snap +1 -1
- package/src/PageTitleContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/PageTitleHeading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Pagination/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/PaginationLabelContainer/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/PaginationList/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/PaginationListItem/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/Panel/__snapshots__/index.test.tsx.snap +2 -2
- package/src/PanelBody/__snapshots__/index.test.tsx.snap +1 -1
- package/src/PanelTitle/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Paragraph/__snapshots__/index.test.tsx.snap +21 -21
- package/src/PhaseBanner/__snapshots__/index.test.tsx.snap +2 -2
- package/src/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +1 -1
- package/src/PhaseBannerTag/__snapshots__/index.test.tsx.snap +3 -3
- package/src/PhaseBannerText/__snapshots__/index.test.tsx.snap +1 -1
- package/src/RadioConditional/__snapshots__/index.test.tsx.snap +1 -1
- package/src/RadioContainer/__snapshots__/index.test.tsx.snap +3 -3
- package/src/RadioItem/__snapshots__/index.test.tsx.snap +4 -4
- package/src/ResultsActionBar/__snapshots__/indext.test.tsx.snap +1 -1
- package/src/ResultsHeading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/ResultsHeadingActions/__snapshots__/index.test.tsx.snap +1 -6
- package/src/ResultsHeadingActions/index.tsx +2 -7
- package/src/SearchButton/__snapshots__/index.test.tsx.snap +5 -2
- package/src/SearchContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Section/__snapshots__/index.test.tsx.snap +1 -1
- package/src/SectionBreak/__snapshots__/index.test.tsx.snap +6 -6
- package/src/SelectContainer/__snapshots__/index.test.tsx.snap +2 -2
- package/src/SelectOption/__snapshots__/index.test.tsx.snap +1 -1
- package/src/SingleCharacterInput/__snapshots__/index.test.tsx.snap +4 -4
- package/src/SingleCharacterInputs/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Skeleton/__snapshots__/index.test.tsx.snap +12 -12
- package/src/SkipLink/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Stack/__snapshots__/index.test.tsx.snap +31 -31
- package/src/StepNav/__snapshots__/index.test.tsx.snap +2 -2
- package/src/StepNavAccordion/__snapshots__/index.test.tsx.snap +1 -1
- package/src/StepNavAccordionContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/StepNavAccordionHeadingText/__snapshots__/index.test.tsx.snap +1 -1
- package/src/StepNavAccordionHeadingTitle/__snapshots__/index.test.tsx.snap +1 -1
- package/src/StepNavAccordionSummary/__snapshots__/index.test.tsx.snap +1 -1
- package/src/StepNavAccordionSummaryHeading/__snapshots__/index.test.tsx.snap +5 -5
- package/src/StepNavCircleNumber/__snapshots__/index.test.tsx.snap +2 -2
- package/src/StepNavControls/__snapshots__/index.test.tsx.snap +1 -1
- package/src/StepNavList/__snapshots__/index.test.tsx.snap +1 -1
- package/src/StepNavListItem/__snapshots__/index.test.tsx.snap +1 -1
- package/src/SummaryList/__snapshots__/index.test.tsx.snap +1 -1
- package/src/SummaryListItem/__snapshots__/index.test.tsx.snap +1 -1
- package/src/SummaryListItemAction/__snapshots__/index.test.tsx.snap +1 -1
- package/src/SummaryListItemKey/__snapshots__/index.test.tsx.snap +2 -2
- package/src/SummaryListItemValue/__snapshots__/index.test.tsx.snap +1 -1
- package/src/SvgIcon/__snapshots__/index.test.tsx.snap +17 -17
- package/src/Table/__snapshots__/index.test.tsx.snap +20 -10
- package/src/Table/index.test.tsx +6 -5
- package/src/TableBody/__snapshots__/index.test.tsx.snap +7 -5
- package/src/TableBody/index.test.tsx +2 -1
- package/src/TableCaption/__snapshots__/index.test.tsx.snap +41 -21
- package/src/TableCaption/index.test.tsx +6 -5
- package/src/TableContainer/__snapshots__/index.test.tsx.snap +2 -2
- package/src/TableDataCell/__snapshots__/index.test.tsx.snap +33 -9
- package/src/TableDataCell/index.test.tsx +5 -2
- package/src/TableHead/__snapshots__/index.test.tsx.snap +17 -5
- package/src/TableHead/index.test.tsx +4 -1
- package/src/TableHeadCell/__snapshots__/index.test.tsx.snap +213 -45
- package/src/TableHeadCell/index.test.tsx +17 -14
- package/src/TableLoaderBackground/__snapshots__/index.test.tsx.snap +1 -1
- package/src/TableNoDataRow/__snapshots__/index.test.tsx.snap +15 -9
- package/src/TableNoDataRow/index.test.tsx +3 -1
- package/src/TableRow/__snapshots__/index.test.tsx.snap +31 -13
- package/src/TableRow/index.test.tsx +5 -3
- package/src/TableSortIconContainer/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Tabs/__snapshots__/index.test.tsx.snap +2 -2
- package/src/TabsHeading/__snapshots__/index.test.tsx.snap +1 -1
- package/src/TabsList/__snapshots__/index.test.tsx.snap +1 -1
- package/src/TabsListItemBase/__snapshots__/index.test.tsx.snap +1 -1
- package/src/TabsPanelBase/__snapshots__/index.test.tsx.snap +3 -3
- package/src/TaskList/__snapshots__/index.test.tsx.snap +2 -2
- package/src/TaskListItem/__snapshots__/index.test.tsx.snap +1 -1
- package/src/TaskListItemContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/TaskListItemHeading/__snapshots__/index.test.tsx.snap +4 -4
- package/src/TaskListItemTag/__snapshots__/index.test.tsx.snap +4 -4
- package/src/TextArea/__snapshots__/index.test.tsx.snap +15 -2
- package/src/TextArea/index.test.tsx +11 -7
- package/src/TextArea/index.web.tsx +2 -4
- package/src/TextInput/__snapshots__/index.test.tsx.snap +43 -43
- package/src/Timeline/__snapshots__/index.test.tsx.snap +2 -2
- package/src/TimelineActions/__snapshots__/index.test.tsx.snap +1 -1
- package/src/TimelineContent/__snapshots__/index.test.tsx.snap +1 -1
- package/src/TimelineHeading/__snapshots__/index.test.tsx.snap +3 -3
- package/src/TimelineItem/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Top/__snapshots__/index.test.tsx.snap +1 -1
- package/src/Typography/__snapshots__/index.test.tsx.snap +1 -1
- package/src/VisuallyHidden/__snapshots__/index.test.tsx.snap +1 -1
- package/src/WarningText/__snapshots__/index.test.tsx.snap +11 -11
package/Base/index.web/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import clsx from "clsx";
|
|
2
3
|
import { basePropGenerator } from "@digigov/react-core/Base/utils";
|
|
3
4
|
const Base = React.forwardRef(function Base2({
|
|
4
5
|
as,
|
|
@@ -88,7 +89,7 @@ const Base = React.forwardRef(function Base2({
|
|
|
88
89
|
return /* @__PURE__ */ React.createElement(
|
|
89
90
|
Component,
|
|
90
91
|
{
|
|
91
|
-
className:
|
|
92
|
+
className: clsx(basePropToClassName, className),
|
|
92
93
|
ref,
|
|
93
94
|
...props
|
|
94
95
|
},
|
package/Base/index.web.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Base/index.web.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { basePropGenerator } from '@digigov/react-core/Base/utils';\
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,yBAAyB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport { basePropGenerator } from '@digigov/react-core/Base/utils';\ntype AsProp<C extends React.ElementType> = {\n as?: C;\n};\n\ntype PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);\n\n// This is the first reusable type utility we built\ntype PolymorphicComponentProp<\n C extends React.ElementType,\n Props = Record<string, unknown>,\n> = React.PropsWithChildren<Props & AsProp<C>> &\n Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;\n\n// This is a new type utitlity with ref!\ntype PolymorphicComponentPropWithRef<\n C extends React.ElementType,\n Props = Record<string, unknown>,\n> = PolymorphicComponentProp<C, Props> & { ref?: any };\n\n// This is the type for the \"ref\" only\ntype PolymorphicRef<C extends React.ElementType> =\n React.ComponentPropsWithRef<C>['ref'];\n\n/**\n * This is the updated component props using PolymorphicComponentPropWithRef\n */\nexport type BaseProps<C extends React.ElementType> =\n PolymorphicComponentPropWithRef<\n C,\n {\n /** margin is optional. It has not a default value. */\n margin?: SpacingValues | SpacingMediaValues;\n /** marginTop is optional. It has not a default value. */\n marginTop?: SpacingValues | SpacingMediaValues;\n /** marginBottom is optional. It has not a default value. */\n marginBottom?: SpacingValues | SpacingMediaValues;\n /** marginLeft is optional. It has not a default value. */\n marginLeft?: SpacingValues | SpacingMediaValues;\n /** marginRight is optional. It has not a default value. */\n marginRight?: SpacingValues | SpacingMediaValues;\n /** Alternative for margin. Margin is optional. It has not a default value. */\n m?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginTop. MarginTop is optional. It has not a default value. */\n mt?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginBottom. MarginBottom is optional. It has not a default value. */\n mb?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginLeft. MarginLeft is optional. It has not a default value. */\n ml?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginRight. MarginRight is optional. It has not a default value. */\n mr?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginX. MarginX is optional. It has not a default value. */\n mx?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginY. MarginY is optional. It has not a default value. */\n my?: SpacingValues | SpacingMediaValues;\n /** padding is optional. It has not a default value. */\n padding?: SpacingValues | SpacingMediaValues;\n /** paddingTop is optional. It has not a default value. */\n paddingTop?: SpacingValues | SpacingMediaValues;\n /** paddingBottom is optional. It has not a default value. */\n paddingBottom?: SpacingValues | SpacingMediaValues;\n /** paddingLeft is optional. It has not a default value. */\n paddingLeft?: SpacingValues | SpacingMediaValues;\n /** paddingRight is optional. It has not a default value. */\n paddingRight?: SpacingValues | SpacingMediaValues;\n /** Alternative for padding. Padding is optional. It has not a default value. */\n p?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingTop. PaddingTop is optional. It has not a default value. */\n pt?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingBottom. PaddingBottom is optional. It has not a default value. */\n pb?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingLeft. PaddingLeft is optional. It has not a default value. */\n pl?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingRight. PaddingRight is optional. It has not a default value. */\n pr?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingX. PaddingX is optional. It has not a default value. */\n px?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingY. PaddingY is optional. It has not a default value. */\n py?: SpacingValues | SpacingMediaValues;\n /** printHidden is optional. Default value is false. When true, the component is hidden at print. */\n printHidden?: boolean;\n /** printVisible is optional. When block, the component is displayed as block. When inline, the component is displayed as inline.*/\n printVisible?: 'block' | 'inline';\n /** Components will be hidden at all screen sizes. */\n hidden?: boolean;\n /** Components will be hidden from 'xs' screen size and up. */\n xsUpHidden?: boolean;\n /** Components will be hidden from 'sm' screen size and up. */\n smUpHidden?: boolean;\n /** Components will be hidden from 'md' screen size and up. */\n mdUpHidden?: boolean;\n /** Components will be hidden from 'lg' screen size and up. */\n lgUpHidden?: boolean;\n /** Components will be hidden from 'xl' screen size and up. */\n xlUpHidden?: boolean;\n /** Components will be hidden between xs and sm screen size. */\n xsHidden?: boolean;\n /** Components will be hidden between sm and md screen size. */\n smHidden?: boolean;\n /** Components will be hidden between md and lg screen size. */\n mdHidden?: boolean;\n /** Components will be hidden between lg and xl screen size. */\n lgHidden?: boolean;\n /** Components will be hidden between xl and 2xl screen size. */\n xlHidden?: boolean;\n /** display is optional. It has not a default value. */\n display?: 'flex' | 'block' | 'none';\n }\n >;\n\nexport type SpacingValues =\n | 0\n | 0.5\n | 1\n | 1.5\n | 2\n | 2.5\n | 3\n | 3.5\n | 4\n | 5\n | 6\n | 7\n | 8\n | 9\n | 10\n | 11\n | 12\n | 14\n | 16\n | 20\n | 24\n | 28\n | 32\n | 36\n | 40\n | 44\n | 48\n | 52\n | 56\n | 60\n | 64\n | 72\n | 80\n | 96;\n\nexport type SpacingMediaValues = {\n xs?: SpacingValues;\n sm?: SpacingValues;\n md?: SpacingValues;\n lg?: SpacingValues;\n xl?: SpacingValues;\n};\n\n/**\n * This is the type used in the type annotation for the component\n */\ntype BaseComponent = <C extends React.ElementType = 'span'>(\n props: BaseProps<C>\n) => React.ReactNode | null;\n\nexport const Base: BaseComponent = React.forwardRef(function Base<\n C extends React.ElementType = 'span',\n>(\n {\n as,\n display,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n children,\n className,\n ...props\n }: BaseProps<C>,\n ref?: PolymorphicRef<C>\n) {\n const Component = as || 'span';\n\n const basePropToClassName = basePropGenerator({\n display,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n });\n\n return (\n <Component\n className={clsx(basePropToClassName, className)}\n ref={ref}\n {...props}\n >\n {children}\n </Component>\n );\n});\n\nexport default Base;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,yBAAyB;AAiK3B,MAAM,OAAsB,MAAM,WAAW,SAASA,MAG3D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,YAAY,MAAM;AAExB,QAAM,sBAAsB,kBAAkB;AAAA,IAC5C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,KAAK,qBAAqB,SAAS;AAAA,MAC9C;AAAA,MACC,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,oBAAQ;",
|
|
6
6
|
"names": ["Base"]
|
|
7
7
|
}
|
package/Chip/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Chip/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\nimport { CloseIcon } from '@digigov/react-icons';\n\nexport interface ChipProps extends BaseProps<'li'> {\n /**\n\n */\n onDelete?: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;\n}\n/**\n * Chips can be used to represent small blocks of information.\n * Chip component must be inside ChipContainer component.\n */\nexport const Chip = React.forwardRef<HTMLLIElement, ChipProps>(function Chip(\n { className, onDelete, onClick, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"li\"\n ref={ref}\n className={clsx(className, {\n 'ds-chip': true,\n 'ds-chip--deletable': !!onDelete,\n })}\n {...props}\n onClick={onClick}\n >\n <Base
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAChC,SAAS,iBAAiB;AAYnB,MAAM,OAAO,MAAM,WAAqC,SAASA,MACtE,EAAE,WAAW,UAAU,SAAS,UAAU,GAAG,MAAM,GACnD,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,WAAW;AAAA,QACX,sBAAsB,CAAC,CAAC;AAAA,MAC1B,CAAC;AAAA,MACA,GAAG;AAAA,MACJ;AAAA;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\nimport { CloseIcon } from '@digigov/react-icons';\n\nexport interface ChipProps extends BaseProps<'li'> {\n /**\n\n */\n onDelete?: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;\n}\n/**\n * Chips can be used to represent small blocks of information.\n * Chip component must be inside ChipContainer component.\n */\nexport const Chip = React.forwardRef<HTMLLIElement, ChipProps>(function Chip(\n { className, onDelete, onClick, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"li\"\n ref={ref}\n className={clsx(className, {\n 'ds-chip': true,\n 'ds-chip--deletable': !!onDelete,\n })}\n {...props}\n onClick={onClick}\n >\n <Base\n as=\"div\"\n role={onClick && 'button'}\n tabIndex={onClick && 0}\n className=\"ds-chip__content\"\n >\n {children}\n {onDelete && (\n <CloseIcon\n onClick={(e) => {\n e.stopPropagation();\n onDelete(e);\n }}\n />\n )}\n </Base>\n </Base>\n );\n});\n\nexport default Chip;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAChC,SAAS,iBAAiB;AAYnB,MAAM,OAAO,MAAM,WAAqC,SAASA,MACtE,EAAE,WAAW,UAAU,SAAS,UAAU,GAAG,MAAM,GACnD,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,WAAW;AAAA,QACX,sBAAsB,CAAC,CAAC;AAAA,MAC1B,CAAC;AAAA,MACA,GAAG;AAAA,MACJ;AAAA;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,MAAM,WAAW;AAAA,QACjB,UAAU,WAAW;AAAA,QACrB,WAAU;AAAA;AAAA,MAET;AAAA,MACA,YACC;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,CAAC,MAAM;AACd,cAAE,gBAAgB;AAClB,qBAAS,CAAC;AAAA,UACZ;AAAA;AAAA,MACF;AAAA,IAEJ;AAAA,EACF;AAEJ,CAAC;AAED,IAAO,eAAQ;",
|
|
6
6
|
"names": ["Chip"]
|
|
7
7
|
}
|
package/Drawer/index.d.ts
CHANGED
|
@@ -18,12 +18,14 @@ export interface DrawerProps extends BaseProps<'div'> {
|
|
|
18
18
|
*/
|
|
19
19
|
direction?: 'right' | 'left';
|
|
20
20
|
/**
|
|
21
|
-
* upRelative is optional.
|
|
21
|
+
* upRelative is optional.
|
|
22
|
+
* This declares if the drawer is visible at what screens in a relative position.
|
|
23
|
+
* If not relative, it will be a drawer.
|
|
22
24
|
* The default value is never.
|
|
23
|
-
*
|
|
24
|
-
* @value 'md'
|
|
25
|
-
* @value 'lg'
|
|
26
|
-
* @value 'never'
|
|
25
|
+
* @value 'sm' The drawer will be visible and relative at small screens and up
|
|
26
|
+
* @value 'md' The drawer will be visible and relative at medium screens and up
|
|
27
|
+
* @value 'lg' The drawer will be visible and relative at large screens and up
|
|
28
|
+
* @value 'never' The drawer will never have relative position in the page
|
|
27
29
|
* @default 'never'
|
|
28
30
|
*/
|
|
29
31
|
upRelative?: 'sm' | 'md' | 'lg' | 'never';
|
package/Drawer/index.js
CHANGED
|
@@ -16,19 +16,32 @@ const Drawer = React.forwardRef(
|
|
|
16
16
|
{
|
|
17
17
|
as: "div",
|
|
18
18
|
ref,
|
|
19
|
-
className: clsx(
|
|
20
|
-
"ds-drawer": true,
|
|
21
|
-
"ds-drawer--relative-sm": upRelative === "sm",
|
|
22
|
-
"ds-drawer--relative-md": upRelative === "md",
|
|
23
|
-
"ds-drawer--relative-lg": upRelative === "lg",
|
|
24
|
-
"ds-drawer--closed": !open
|
|
25
|
-
|
|
26
|
-
"ds-drawer--left": direction === "left",
|
|
27
|
-
"ds-drawer--bg-secondary": bgColor === "secondary"
|
|
28
|
-
}),
|
|
29
|
-
...props
|
|
19
|
+
className: clsx({
|
|
20
|
+
"ds-drawer-container": true,
|
|
21
|
+
"ds-drawer-container--relative-sm": upRelative === "sm",
|
|
22
|
+
"ds-drawer-container--relative-md": upRelative === "md",
|
|
23
|
+
"ds-drawer-container--relative-lg": upRelative === "lg",
|
|
24
|
+
"ds-drawer-container--closed": !open
|
|
25
|
+
})
|
|
30
26
|
},
|
|
31
|
-
|
|
27
|
+
/* @__PURE__ */ React.createElement(
|
|
28
|
+
Base,
|
|
29
|
+
{
|
|
30
|
+
as: "div",
|
|
31
|
+
className: clsx(className, {
|
|
32
|
+
"ds-drawer": true,
|
|
33
|
+
"ds-drawer--relative-sm": upRelative === "sm",
|
|
34
|
+
"ds-drawer--relative-md": upRelative === "md",
|
|
35
|
+
"ds-drawer--relative-lg": upRelative === "lg",
|
|
36
|
+
"ds-drawer--closed": !open,
|
|
37
|
+
"ds-drawer--right": direction === "right",
|
|
38
|
+
"ds-drawer--left": direction === "left",
|
|
39
|
+
"ds-drawer--bg-secondary": bgColor === "secondary"
|
|
40
|
+
}),
|
|
41
|
+
...props
|
|
42
|
+
},
|
|
43
|
+
children
|
|
44
|
+
)
|
|
32
45
|
);
|
|
33
46
|
}
|
|
34
47
|
);
|
package/Drawer/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Drawer/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface DrawerProps extends BaseProps<'div'> {\n /**\n * open is optional.\n * This declares if the drawer is open at small screens.\n * @value true\n * @value false\n */\n open?: boolean;\n\n /**\n * direction is optional.\n * Add the direction of the drawer, when this is open at mobile view.\n * The default value is 'left'.\n * @value 'right'\n * @value 'left'\n * @default 'left'\n */\n direction?: 'right' | 'left';\n\n /**\n * upRelative is optional
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface DrawerProps extends BaseProps<'div'> {\n /**\n * open is optional.\n * This declares if the drawer is open at small screens.\n * @value true\n * @value false\n */\n open?: boolean;\n\n /**\n * direction is optional.\n * Add the direction of the drawer, when this is open at mobile view.\n * The default value is 'left'.\n * @value 'right'\n * @value 'left'\n * @default 'left'\n */\n direction?: 'right' | 'left';\n\n /**\n * upRelative is optional.\n * This declares if the drawer is visible at what screens in a relative position.\n * If not relative, it will be a drawer.\n * The default value is never.\n * @value 'sm' The drawer will be visible and relative at small screens and up\n * @value 'md' The drawer will be visible and relative at medium screens and up\n * @value 'lg' The drawer will be visible and relative at large screens and up\n * @value 'never' The drawer will never have relative position in the page\n * @default 'never'\n */\n upRelative?: 'sm' | 'md' | 'lg' | 'never';\n\n /**\n * bgColor is optional.\n * This defines the background color of the drawer.\n * @value 'base'\n * @value 'secondary'\n * @default 'base'\n */\n bgColor?: 'base' | 'secondary';\n}\n/**\n * Drawer can be used to provide access to destinations and app functionality.\n * It can either be permanently on-screen or controlled by a navigation menu icon.\n */\nexport const Drawer = React.forwardRef<HTMLDivElement, DrawerProps>(\n function Drawer(\n {\n open,\n direction = 'left',\n upRelative = 'never',\n bgColor,\n className,\n children,\n ...props\n },\n ref\n ) {\n return (\n <Base\n as=\"div\"\n ref={ref}\n className={clsx({\n 'ds-drawer-container': true,\n 'ds-drawer-container--relative-sm': upRelative === 'sm',\n 'ds-drawer-container--relative-md': upRelative === 'md',\n 'ds-drawer-container--relative-lg': upRelative === 'lg',\n 'ds-drawer-container--closed': !open,\n })}\n >\n <Base\n as=\"div\"\n className={clsx(className, {\n 'ds-drawer': true,\n 'ds-drawer--relative-sm': upRelative === 'sm',\n 'ds-drawer--relative-md': upRelative === 'md',\n 'ds-drawer--relative-lg': upRelative === 'lg',\n 'ds-drawer--closed': !open,\n 'ds-drawer--right': direction === 'right',\n 'ds-drawer--left': direction === 'left',\n 'ds-drawer--bg-secondary': bgColor === 'secondary',\n })}\n {...props}\n >\n {children}\n </Base>\n </Base>\n );\n }\n);\n\nexport default Drawer;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AA+CzB,MAAM,SAAS,MAAM;AAAA,EAC1B,SAASA,QACP;AAAA,IACE;AAAA,IACA,YAAY;AAAA,IACZ,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,KACA;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH;AAAA,QACA,WAAW,KAAK;AAAA,UACd,uBAAuB;AAAA,UACvB,oCAAoC,eAAe;AAAA,UACnD,oCAAoC,eAAe;AAAA,UACnD,oCAAoC,eAAe;AAAA,UACnD,+BAA+B,CAAC;AAAA,QAClC,CAAC;AAAA;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACC,IAAG;AAAA,UACH,WAAW,KAAK,WAAW;AAAA,YACzB,aAAa;AAAA,YACb,0BAA0B,eAAe;AAAA,YACzC,0BAA0B,eAAe;AAAA,YACzC,0BAA0B,eAAe;AAAA,YACzC,qBAAqB,CAAC;AAAA,YACtB,oBAAoB,cAAc;AAAA,YAClC,mBAAmB,cAAc;AAAA,YACjC,2BAA2B,YAAY;AAAA,UACzC,CAAC;AAAA,UACA,GAAG;AAAA;AAAA,QAEH;AAAA,MACH;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["Drawer"]
|
|
7
7
|
}
|
|
@@ -18,13 +18,15 @@ export interface FilterContainerProps extends BaseProps<'div'> {
|
|
|
18
18
|
*/
|
|
19
19
|
border?: boolean;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* positionRelative is optional.
|
|
22
|
+
* Use positionRelative prop to make the filter section to be visible and have position relative in the page.
|
|
23
|
+
* If not relative, the filter section will be a drawer.
|
|
22
24
|
* The default value is md.
|
|
23
|
-
* @value 'always'
|
|
24
|
-
* @value 'sm'
|
|
25
|
-
* @value 'md'
|
|
26
|
-
* @value 'lg'
|
|
27
|
-
* @value 'never'
|
|
25
|
+
* @value 'always' The filter section will always visible
|
|
26
|
+
* @value 'sm' The filter section will be visible at small screens and up
|
|
27
|
+
* @value 'md' The filter section will be visible at medium screens and up
|
|
28
|
+
* @value 'lg' The filter section will be visible at large screens and up
|
|
29
|
+
* @value 'never' The filter section will never have relative position in the page
|
|
28
30
|
* @default 'md'
|
|
29
31
|
*/
|
|
30
32
|
positionRelative?: 'always' | 'sm' | 'md' | 'lg' | 'never';
|
package/FilterContainer/index.js
CHANGED
|
@@ -14,18 +14,31 @@ const FilterContainer = React.forwardRef(function FilterContainer2({
|
|
|
14
14
|
{
|
|
15
15
|
as: "div",
|
|
16
16
|
ref,
|
|
17
|
-
className: clsx(
|
|
18
|
-
"ds-filter": true,
|
|
19
|
-
"ds-filter--
|
|
20
|
-
"ds-filter--
|
|
21
|
-
"ds-filter--position-relative-
|
|
22
|
-
"ds-filter--position-relative-
|
|
23
|
-
"ds-filter--
|
|
24
|
-
|
|
25
|
-
}),
|
|
26
|
-
...props
|
|
17
|
+
className: clsx({
|
|
18
|
+
"ds-filter-container": true,
|
|
19
|
+
"ds-filter-container--position-relative-always": positionRelative === "always",
|
|
20
|
+
"ds-filter-container--position-relative-sm": positionRelative === "sm",
|
|
21
|
+
"ds-filter-container--position-relative-md": positionRelative === "md",
|
|
22
|
+
"ds-filter-container--position-relative-lg": positionRelative === "lg",
|
|
23
|
+
"ds-filter-container--closed": !open
|
|
24
|
+
})
|
|
27
25
|
},
|
|
28
|
-
|
|
26
|
+
/* @__PURE__ */ React.createElement(
|
|
27
|
+
Base,
|
|
28
|
+
{
|
|
29
|
+
as: "div",
|
|
30
|
+
className: clsx(className, {
|
|
31
|
+
"ds-filter": true,
|
|
32
|
+
"ds-filter--border ": border,
|
|
33
|
+
"ds-filter--position-relative-always": positionRelative === "always",
|
|
34
|
+
"ds-filter--position-relative-sm": positionRelative === "sm",
|
|
35
|
+
"ds-filter--position-relative-md": positionRelative === "md",
|
|
36
|
+
"ds-filter--position-relative-lg": positionRelative === "lg"
|
|
37
|
+
}),
|
|
38
|
+
...props
|
|
39
|
+
},
|
|
40
|
+
children
|
|
41
|
+
)
|
|
29
42
|
);
|
|
30
43
|
});
|
|
31
44
|
var FilterContainer_default = FilterContainer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/FilterContainer/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface FilterContainerProps extends BaseProps<'div'> {\n /**\n * Use open prop to open the filters when at mobile.\n * The default value is false.\n * @value true\n * @value false\n * @default false\n */\n open?: boolean;\n\n /**\n * Use border prop to add a gray border at the filters section.\n * The default value is true.\n * @value true\n * @value false\n * @default true\n */\n border?: boolean;\n\n /**\n * Use
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface FilterContainerProps extends BaseProps<'div'> {\n /**\n * Use open prop to open the filters when at mobile.\n * The default value is false.\n * @value true\n * @value false\n * @default false\n */\n open?: boolean;\n\n /**\n * Use border prop to add a gray border at the filters section.\n * The default value is true.\n * @value true\n * @value false\n * @default true\n */\n border?: boolean;\n\n /**\n * positionRelative is optional.\n * Use positionRelative prop to make the filter section to be visible and have position relative in the page.\n * If not relative, the filter section will be a drawer.\n * The default value is md.\n * @value 'always' The filter section will always visible\n * @value 'sm' The filter section will be visible at small screens and up\n * @value 'md' The filter section will be visible at medium screens and up\n * @value 'lg' The filter section will be visible at large screens and up\n * @value 'never' The filter section will never have relative position in the page\n * @default 'md'\n */\n positionRelative?: 'always' | 'sm' | 'md' | 'lg' | 'never';\n}\n\n/**\n * Use FilterContainer component to wrap the filter area of the page\n * When the Filters are being used inside a Drawer component, you don't have to\n * use the FilterContainer component\n */\nexport const FilterContainer = React.forwardRef<\n HTMLDivElement,\n FilterContainerProps\n>(function FilterContainer(\n {\n className,\n border = true,\n open = false,\n positionRelative = 'md',\n children,\n ...props\n },\n ref\n) {\n return (\n <Base\n as=\"div\"\n ref={ref}\n className={clsx({\n 'ds-filter-container': true,\n 'ds-filter-container--position-relative-always': positionRelative === 'always',\n 'ds-filter-container--position-relative-sm': positionRelative === 'sm',\n 'ds-filter-container--position-relative-md': positionRelative === 'md',\n 'ds-filter-container--position-relative-lg': positionRelative === 'lg',\n 'ds-filter-container--closed': !open,\n })}\n >\n <Base\n as=\"div\"\n className={clsx(className, {\n 'ds-filter': true,\n 'ds-filter--border ': border,\n 'ds-filter--position-relative-always': positionRelative === 'always',\n 'ds-filter--position-relative-sm': positionRelative === 'sm',\n 'ds-filter--position-relative-md': positionRelative === 'md',\n 'ds-filter--position-relative-lg': positionRelative === 'lg',\n })}\n {...props}\n >\n {children}\n </Base>\n </Base>\n );\n});\n\nexport default FilterContainer;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAyCzB,MAAM,kBAAkB,MAAM,WAGnC,SAASA,iBACT;AAAA,EACE;AAAA,EACA,SAAS;AAAA,EACT,OAAO;AAAA,EACP,mBAAmB;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW,KAAK;AAAA,QACd,uBAAuB;AAAA,QACvB,iDAAiD,qBAAqB;AAAA,QACtE,6CAA6C,qBAAqB;AAAA,QAClE,6CAA6C,qBAAqB;AAAA,QAClE,6CAA6C,qBAAqB;AAAA,QAClE,+BAA+B,CAAC;AAAA,MAClC,CAAC;AAAA;AAAA,IAED;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,WAAW,KAAK,WAAW;AAAA,UACzB,aAAa;AAAA,UACb,sBAAsB;AAAA,UACtB,uCAAuC,qBAAqB;AAAA,UAC5D,mCAAmC,qBAAqB;AAAA,UACxD,mCAAmC,qBAAqB;AAAA,UACxD,mCAAmC,qBAAqB;AAAA,QAC1D,CAAC;AAAA,QACA,GAAG;AAAA;AAAA,MAEH;AAAA,IACH;AAAA,EACF;AAEJ,CAAC;AAED,IAAO,0BAAQ;",
|
|
6
6
|
"names": ["FilterContainer"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseProps } from '@digigov/react-core/Base';
|
|
3
3
|
export interface FilterHeadingContainerProps extends BaseProps<'div'> {
|
|
4
|
+
/**
|
|
5
|
+
* closeLabel is optional.
|
|
6
|
+
* This declares the label of the close icon.
|
|
7
|
+
* @default 'Κλείσιμο'
|
|
8
|
+
*/
|
|
9
|
+
closeLabel?: string;
|
|
10
|
+
/**
|
|
11
|
+
* onClick is optional.
|
|
12
|
+
* This declares the click event of the close icon.
|
|
13
|
+
* @default undefined
|
|
14
|
+
*/
|
|
15
|
+
onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
4
16
|
}
|
|
5
17
|
/**
|
|
6
18
|
* Use FilterHeadingContainer component inside FilterContainer
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import Base from "@digigov/react-core/Base";
|
|
4
|
-
|
|
4
|
+
import CloseButton from "@digigov/react-core/CloseButton";
|
|
5
|
+
const FilterHeadingContainer = React.forwardRef(function FilterHeadingContainer2({ onClick, closeLabel = "\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF", className, children, ...props }, ref) {
|
|
5
6
|
return /* @__PURE__ */ React.createElement(
|
|
6
7
|
Base,
|
|
7
8
|
{
|
|
@@ -12,7 +13,16 @@ const FilterHeadingContainer = React.forwardRef(function FilterHeadingContainer2
|
|
|
12
13
|
}),
|
|
13
14
|
...props
|
|
14
15
|
},
|
|
15
|
-
children
|
|
16
|
+
children,
|
|
17
|
+
onClick && /* @__PURE__ */ React.createElement(
|
|
18
|
+
CloseButton,
|
|
19
|
+
{
|
|
20
|
+
onClick: (e) => {
|
|
21
|
+
onClick(e);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
closeLabel
|
|
25
|
+
)
|
|
16
26
|
);
|
|
17
27
|
});
|
|
18
28
|
var FilterHeadingContainer_default = FilterHeadingContainer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/FilterHeadingContainer/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface FilterHeadingContainerProps extends BaseProps<'div'> { }\n/**\n * Use FilterHeadingContainer component inside FilterContainer\n * for filters heading title and close icon(for mobiles).\n * When the Filters are being used inside a Drawer component, you don't have to\n * use the FilterHeadingContainer component\n */\nexport const FilterHeadingContainer = React.forwardRef<\n HTMLDivElement,\n FilterHeadingContainerProps\n>(function FilterHeadingContainer({ className, children, ...props }
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\nimport CloseButton from '@digigov/react-core/CloseButton';\n\nexport interface FilterHeadingContainerProps extends BaseProps<'div'> {\n /**\n * closeLabel is optional.\n * This declares the label of the close icon.\n * @default '\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF'\n */\n closeLabel?: string;\n\n /**\n * onClick is optional.\n * This declares the click event of the close icon.\n * @default undefined\n */\n onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n}\n/**\n * Use FilterHeadingContainer component inside FilterContainer\n * for filters heading title and close icon(for mobiles).\n * When the Filters are being used inside a Drawer component, you don't have to\n * use the FilterHeadingContainer component\n */\nexport const FilterHeadingContainer = React.forwardRef<\n HTMLDivElement,\n FilterHeadingContainerProps\n>(function FilterHeadingContainer(\n { onClick, closeLabel = '\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF', className, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"div\"\n ref={ref}\n className={clsx(className, {\n 'ds-filter__heading': true,\n })}\n {...props}\n >\n {children}\n {onClick && (\n <CloseButton\n onClick={(e) => {\n onClick(e);\n }}\n >\n {closeLabel}\n </CloseButton>\n )}\n </Base>\n );\n});\n\nexport default FilterHeadingContainer;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAChC,OAAO,iBAAiB;AAuBjB,MAAM,yBAAyB,MAAM,WAG1C,SAASA,wBACT,EAAE,SAAS,aAAa,oDAAY,WAAW,UAAU,GAAG,MAAM,GAClE,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,sBAAsB;AAAA,MACxB,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,IACA,WACC;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,CAAC,MAAM;AACd,kBAAQ,CAAC;AAAA,QACX;AAAA;AAAA,MAEC;AAAA,IACH;AAAA,EAEJ;AAEJ,CAAC;AAED,IAAO,iCAAQ;",
|
|
6
6
|
"names": ["FilterHeadingContainer"]
|
|
7
7
|
}
|
package/ModalContainer/index.js
CHANGED
|
@@ -8,13 +8,13 @@ const ModalContainer = React.forwardRef(function ModalContainer2({ className, ga
|
|
|
8
8
|
ref,
|
|
9
9
|
as: "div",
|
|
10
10
|
className: clsx(className, {
|
|
11
|
-
"ds-modal": true,
|
|
12
|
-
"ds-modal--open": open,
|
|
13
|
-
"ds-modal--dense": dense
|
|
11
|
+
"ds-modal-container": true,
|
|
12
|
+
"ds-modal-container--open": open,
|
|
13
|
+
"ds-modal-container--dense": dense
|
|
14
14
|
}),
|
|
15
15
|
...props
|
|
16
16
|
},
|
|
17
|
-
/* @__PURE__ */ React.createElement(Base, { as: "div", className: "ds-
|
|
17
|
+
/* @__PURE__ */ React.createElement(Base, { as: "div", className: "ds-modal" }, gaps ? /* @__PURE__ */ React.createElement(Base, { as: "div", className: "ds-modal__body" }, children) : children)
|
|
18
18
|
);
|
|
19
19
|
});
|
|
20
20
|
var ModalContainer_default = ModalContainer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ModalContainer/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface ModalContainerProps extends BaseProps<'div'> {\n /**\n * @value true\n * @value false\n */\n open?: boolean;\n /**\n * dense is optional.\n * @value true ModalContainer and its children will be dense.\n * @value false\n * @default false\n */\n dense?: boolean;\n /**\n * gaps is optional.\n * @value false there will be no extra gaps among children components.\n * @value true\n * @default true\n */\n gaps?: boolean;\n}\n/**\n * Modals can be used to open a pop-up dialog box and provide critical information\n * or ask for a decision. Modals disable all app functionality when they appear, and\n * remain on screen until confirmed, dismissed, or a required action has been taken\n * Use Modal as parent component to wrap ModalHeading, ModalText and ModalAction components\n */\nexport const ModalContainer = React.forwardRef<\n HTMLDivElement,\n ModalContainerProps\n>(function ModalContainer(\n { className, gaps = true, children, open, dense, ...props },\n ref\n) {\n return (\n <Base\n ref={ref}\n as=\"div\"\n className={clsx(className, {\n 'ds-modal': true,\n 'ds-modal--open': open,\n 'ds-modal--dense': dense,\n })}\n {...props}\n >\n <Base as=\"div\" className=\"ds-
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AA6BzB,MAAM,iBAAiB,MAAM,WAGlC,SAASA,gBACT,EAAE,WAAW,OAAO,MAAM,UAAU,MAAM,OAAO,GAAG,MAAM,GAC1D,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAG;AAAA,MACH,WAAW,KAAK,WAAW;AAAA,QACzB,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface ModalContainerProps extends BaseProps<'div'> {\n /**\n * @value true\n * @value false\n */\n open?: boolean;\n /**\n * dense is optional.\n * @value true ModalContainer and its children will be dense.\n * @value false\n * @default false\n */\n dense?: boolean;\n /**\n * gaps is optional.\n * @value false there will be no extra gaps among children components.\n * @value true\n * @default true\n */\n gaps?: boolean;\n}\n/**\n * Modals can be used to open a pop-up dialog box and provide critical information\n * or ask for a decision. Modals disable all app functionality when they appear, and\n * remain on screen until confirmed, dismissed, or a required action has been taken\n * Use Modal as parent component to wrap ModalHeading, ModalText and ModalAction components\n */\nexport const ModalContainer = React.forwardRef<\n HTMLDivElement,\n ModalContainerProps\n>(function ModalContainer(\n { className, gaps = true, children, open, dense, ...props },\n ref\n) {\n return (\n <Base\n ref={ref}\n as=\"div\"\n className={clsx(className, {\n 'ds-modal-container': true,\n 'ds-modal-container--open': open,\n 'ds-modal-container--dense': dense,\n })}\n {...props}\n >\n <Base as=\"div\" className=\"ds-modal\">\n {gaps ? (\n <Base as=\"div\" className=\"ds-modal__body\">\n {children}\n </Base>\n ) : (\n children\n )}\n </Base>\n </Base>\n );\n});\n\nexport default ModalContainer;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AA6BzB,MAAM,iBAAiB,MAAM,WAGlC,SAASA,gBACT,EAAE,WAAW,OAAO,MAAM,UAAU,MAAM,OAAO,GAAG,MAAM,GAC1D,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAG;AAAA,MACH,WAAW,KAAK,WAAW;AAAA,QACzB,sBAAsB;AAAA,QACtB,4BAA4B;AAAA,QAC5B,6BAA6B;AAAA,MAC/B,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEJ,oCAAC,QAAK,IAAG,OAAM,WAAU,cACtB,OACC,oCAAC,QAAK,IAAG,OAAM,WAAU,oBACtB,QACH,IAEA,QAEJ;AAAA,EACF;AAEJ,CAAC;AAED,IAAO,yBAAQ;",
|
|
6
6
|
"names": ["ModalContainer"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import Base from "@digigov/react-core/Base";
|
|
4
|
-
|
|
5
|
-
const ResultsHeadingActions = React.forwardRef(function ResultsHeadingActions2({ className, onClick, children, ...props }, ref) {
|
|
4
|
+
const ResultsHeadingActions = React.forwardRef(function ResultsHeadingActions2({ className, children, ...props }, ref) {
|
|
6
5
|
return /* @__PURE__ */ React.createElement(
|
|
7
6
|
Base,
|
|
8
7
|
{
|
|
@@ -13,8 +12,7 @@ const ResultsHeadingActions = React.forwardRef(function ResultsHeadingActions2({
|
|
|
13
12
|
}),
|
|
14
13
|
...props
|
|
15
14
|
},
|
|
16
|
-
children
|
|
17
|
-
/* @__PURE__ */ React.createElement(Button, { className: "ds-link-filters" }, "\u03A6\u03AF\u03BB\u03C4\u03C1\u03B1")
|
|
15
|
+
children
|
|
18
16
|
);
|
|
19
17
|
});
|
|
20
18
|
var ResultsHeadingActions_default = ResultsHeadingActions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ResultsHeadingActions/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface ResultsHeadingActionsProps extends BaseProps<'div'> {}\n/**\n * Use ResultsHeadingActions component to wrap result actions.\n * ResultsHeadingActions component inside ResultsHeading component.\n */\nexport const ResultsHeadingActions = React.forwardRef<\n HTMLDivElement,\n ResultsHeadingActionsProps\n>(function ResultsHeadingActions({ className, children, ...props }, ref) {\n return (\n <Base\n as=\"div\"\n ref={ref}\n className={clsx(className, {\n 'ds-results__actions': true,\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default ResultsHeadingActions;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAOzB,MAAM,wBAAwB,MAAM,WAGzC,SAASA,uBAAsB,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,KAAK;AACvE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,uBAAuB;AAAA,MACzB,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,gCAAQ;",
|
|
6
6
|
"names": ["ResultsHeadingActions"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import Base from "@digigov/react-core/Base";
|
|
4
4
|
const TextArea = React.forwardRef(
|
|
5
|
-
function TextArea2({ name, rows, error, dense, className,
|
|
5
|
+
function TextArea2({ name, rows, error, dense, className, ...props }, ref) {
|
|
6
6
|
const defaultRows = dense ? 3 : 6;
|
|
7
7
|
return /* @__PURE__ */ React.createElement(
|
|
8
8
|
Base,
|
|
@@ -17,8 +17,7 @@ const TextArea = React.forwardRef(
|
|
|
17
17
|
"ds-input--error": error
|
|
18
18
|
}),
|
|
19
19
|
...props
|
|
20
|
-
}
|
|
21
|
-
children
|
|
20
|
+
}
|
|
22
21
|
);
|
|
23
22
|
}
|
|
24
23
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/TextArea/index.web.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface TextAreaProps extends BaseProps<'textarea'> {\n /**\n * error is optional. The default value is false.\n * Use this prop when there is an error at the input.\n * @value true\n * @value false\n */\n error?: boolean;\n /**\n * dense is optional.\n * @value true TextArea will be dense.\n * @value false\n * @default false\n */\n dense?: boolean;\n}\n/**\n * Textarea component is used when you need to let users enter an\n * amount of text that\u2019s longer than a single line.\n */\nexport const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n { name, rows, error, dense, className,
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAsBzB,MAAM,WAAW,MAAM;AAAA,EAC5B,SAASA,UACP,EAAE,MAAM,MAAM,OAAO,OAAO,WAAW,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface TextAreaProps extends BaseProps<'textarea'> {\n /**\n * error is optional. The default value is false.\n * Use this prop when there is an error at the input.\n * @value true\n * @value false\n */\n error?: boolean;\n /**\n * dense is optional.\n * @value true TextArea will be dense.\n * @value false\n * @default false\n */\n dense?: boolean;\n}\n/**\n * Textarea component is used when you need to let users enter an\n * amount of text that\u2019s longer than a single line.\n */\nexport const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n { name, rows, error, dense, className, ...props },\n ref\n ) {\n const defaultRows = dense ? 3 : 6;\n return (\n <Base\n as=\"textarea\"\n name={name}\n rows={rows || defaultRows}\n ref={ref}\n className={clsx(className, {\n 'ds-textarea': true,\n 'ds-textarea--dense': dense,\n 'ds-input--error': error,\n })}\n {...props}\n />\n );\n }\n);\n\nexport default TextArea;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAsBzB,MAAM,WAAW,MAAM;AAAA,EAC5B,SAASA,UACP,EAAE,MAAM,MAAM,OAAO,OAAO,WAAW,GAAG,MAAM,GAChD,KACA;AACA,UAAM,cAAc,QAAQ,IAAI;AAChC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH;AAAA,QACA,MAAM,QAAQ;AAAA,QACd;AAAA,QACA,WAAW,KAAK,WAAW;AAAA,UACzB,eAAe;AAAA,UACf,sBAAsB;AAAA,UACtB,mBAAmB;AAAA,QACrB,CAAC;AAAA,QACA,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,IAAO,oBAAQ;",
|
|
6
6
|
"names": ["TextArea"]
|
|
7
7
|
}
|
|
@@ -32,6 +32,7 @@ __export(index_web_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(index_web_exports);
|
|
34
34
|
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_clsx = __toESM(require("clsx"));
|
|
35
36
|
var import_utils = require("@digigov/react-core/Base/utils");
|
|
36
37
|
const Base = import_react.default.forwardRef(function Base2({
|
|
37
38
|
as,
|
|
@@ -121,7 +122,7 @@ const Base = import_react.default.forwardRef(function Base2({
|
|
|
121
122
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
122
123
|
Component,
|
|
123
124
|
{
|
|
124
|
-
className:
|
|
125
|
+
className: (0, import_clsx.default)(basePropToClassName, className),
|
|
125
126
|
ref,
|
|
126
127
|
...props
|
|
127
128
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Base/index.web.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { basePropGenerator } from '@digigov/react-core/Base/utils';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,mBAAkC;
|
|
6
|
-
"names": ["React", "Base"]
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport { basePropGenerator } from '@digigov/react-core/Base/utils';\ntype AsProp<C extends React.ElementType> = {\n as?: C;\n};\n\ntype PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);\n\n// This is the first reusable type utility we built\ntype PolymorphicComponentProp<\n C extends React.ElementType,\n Props = Record<string, unknown>,\n> = React.PropsWithChildren<Props & AsProp<C>> &\n Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;\n\n// This is a new type utitlity with ref!\ntype PolymorphicComponentPropWithRef<\n C extends React.ElementType,\n Props = Record<string, unknown>,\n> = PolymorphicComponentProp<C, Props> & { ref?: any };\n\n// This is the type for the \"ref\" only\ntype PolymorphicRef<C extends React.ElementType> =\n React.ComponentPropsWithRef<C>['ref'];\n\n/**\n * This is the updated component props using PolymorphicComponentPropWithRef\n */\nexport type BaseProps<C extends React.ElementType> =\n PolymorphicComponentPropWithRef<\n C,\n {\n /** margin is optional. It has not a default value. */\n margin?: SpacingValues | SpacingMediaValues;\n /** marginTop is optional. It has not a default value. */\n marginTop?: SpacingValues | SpacingMediaValues;\n /** marginBottom is optional. It has not a default value. */\n marginBottom?: SpacingValues | SpacingMediaValues;\n /** marginLeft is optional. It has not a default value. */\n marginLeft?: SpacingValues | SpacingMediaValues;\n /** marginRight is optional. It has not a default value. */\n marginRight?: SpacingValues | SpacingMediaValues;\n /** Alternative for margin. Margin is optional. It has not a default value. */\n m?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginTop. MarginTop is optional. It has not a default value. */\n mt?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginBottom. MarginBottom is optional. It has not a default value. */\n mb?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginLeft. MarginLeft is optional. It has not a default value. */\n ml?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginRight. MarginRight is optional. It has not a default value. */\n mr?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginX. MarginX is optional. It has not a default value. */\n mx?: SpacingValues | SpacingMediaValues;\n /** Alternative for marginY. MarginY is optional. It has not a default value. */\n my?: SpacingValues | SpacingMediaValues;\n /** padding is optional. It has not a default value. */\n padding?: SpacingValues | SpacingMediaValues;\n /** paddingTop is optional. It has not a default value. */\n paddingTop?: SpacingValues | SpacingMediaValues;\n /** paddingBottom is optional. It has not a default value. */\n paddingBottom?: SpacingValues | SpacingMediaValues;\n /** paddingLeft is optional. It has not a default value. */\n paddingLeft?: SpacingValues | SpacingMediaValues;\n /** paddingRight is optional. It has not a default value. */\n paddingRight?: SpacingValues | SpacingMediaValues;\n /** Alternative for padding. Padding is optional. It has not a default value. */\n p?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingTop. PaddingTop is optional. It has not a default value. */\n pt?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingBottom. PaddingBottom is optional. It has not a default value. */\n pb?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingLeft. PaddingLeft is optional. It has not a default value. */\n pl?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingRight. PaddingRight is optional. It has not a default value. */\n pr?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingX. PaddingX is optional. It has not a default value. */\n px?: SpacingValues | SpacingMediaValues;\n /** Alternative for paddingY. PaddingY is optional. It has not a default value. */\n py?: SpacingValues | SpacingMediaValues;\n /** printHidden is optional. Default value is false. When true, the component is hidden at print. */\n printHidden?: boolean;\n /** printVisible is optional. When block, the component is displayed as block. When inline, the component is displayed as inline.*/\n printVisible?: 'block' | 'inline';\n /** Components will be hidden at all screen sizes. */\n hidden?: boolean;\n /** Components will be hidden from 'xs' screen size and up. */\n xsUpHidden?: boolean;\n /** Components will be hidden from 'sm' screen size and up. */\n smUpHidden?: boolean;\n /** Components will be hidden from 'md' screen size and up. */\n mdUpHidden?: boolean;\n /** Components will be hidden from 'lg' screen size and up. */\n lgUpHidden?: boolean;\n /** Components will be hidden from 'xl' screen size and up. */\n xlUpHidden?: boolean;\n /** Components will be hidden between xs and sm screen size. */\n xsHidden?: boolean;\n /** Components will be hidden between sm and md screen size. */\n smHidden?: boolean;\n /** Components will be hidden between md and lg screen size. */\n mdHidden?: boolean;\n /** Components will be hidden between lg and xl screen size. */\n lgHidden?: boolean;\n /** Components will be hidden between xl and 2xl screen size. */\n xlHidden?: boolean;\n /** display is optional. It has not a default value. */\n display?: 'flex' | 'block' | 'none';\n }\n >;\n\nexport type SpacingValues =\n | 0\n | 0.5\n | 1\n | 1.5\n | 2\n | 2.5\n | 3\n | 3.5\n | 4\n | 5\n | 6\n | 7\n | 8\n | 9\n | 10\n | 11\n | 12\n | 14\n | 16\n | 20\n | 24\n | 28\n | 32\n | 36\n | 40\n | 44\n | 48\n | 52\n | 56\n | 60\n | 64\n | 72\n | 80\n | 96;\n\nexport type SpacingMediaValues = {\n xs?: SpacingValues;\n sm?: SpacingValues;\n md?: SpacingValues;\n lg?: SpacingValues;\n xl?: SpacingValues;\n};\n\n/**\n * This is the type used in the type annotation for the component\n */\ntype BaseComponent = <C extends React.ElementType = 'span'>(\n props: BaseProps<C>\n) => React.ReactNode | null;\n\nexport const Base: BaseComponent = React.forwardRef(function Base<\n C extends React.ElementType = 'span',\n>(\n {\n as,\n display,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n children,\n className,\n ...props\n }: BaseProps<C>,\n ref?: PolymorphicRef<C>\n) {\n const Component = as || 'span';\n\n const basePropToClassName = basePropGenerator({\n display,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n });\n\n return (\n <Component\n className={clsx(basePropToClassName, className)}\n ref={ref}\n {...props}\n >\n {children}\n </Component>\n );\n});\n\nexport default Base;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,mBAAkC;AAiK3B,MAAM,OAAsB,aAAAA,QAAM,WAAW,SAASC,MAG3D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,YAAY,MAAM;AAExB,QAAM,0BAAsB,gCAAkB;AAAA,IAC5C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SACE,6BAAAD,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,YAAAE,SAAK,qBAAqB,SAAS;AAAA,MAC9C;AAAA,MACC,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,oBAAQ;",
|
|
6
|
+
"names": ["React", "Base", "clsx"]
|
|
7
7
|
}
|
package/cjs/Chip/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Chip/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\nimport { CloseIcon } from '@digigov/react-icons';\n\nexport interface ChipProps extends BaseProps<'li'> {\n /**\n\n */\n onDelete?: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;\n}\n/**\n * Chips can be used to represent small blocks of information.\n * Chip component must be inside ChipContainer component.\n */\nexport const Chip = React.forwardRef<HTMLLIElement, ChipProps>(function Chip(\n { className, onDelete, onClick, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"li\"\n ref={ref}\n className={clsx(className, {\n 'ds-chip': true,\n 'ds-chip--deletable': !!onDelete,\n })}\n {...props}\n onClick={onClick}\n >\n <Base
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AAChC,yBAA0B;AAYnB,MAAM,OAAO,aAAAA,QAAM,WAAqC,SAASC,MACtE,EAAE,WAAW,UAAU,SAAS,UAAU,GAAG,MAAM,GACnD,KACA;AACA,SACE,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,WAAW;AAAA,QACX,sBAAsB,CAAC,CAAC;AAAA,MAC1B,CAAC;AAAA,MACA,GAAG;AAAA,MACJ;AAAA;AAAA,IAEA,6BAAAH,QAAA;AAAA,MAAC,YAAAE;AAAA,MAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\nimport { CloseIcon } from '@digigov/react-icons';\n\nexport interface ChipProps extends BaseProps<'li'> {\n /**\n\n */\n onDelete?: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;\n}\n/**\n * Chips can be used to represent small blocks of information.\n * Chip component must be inside ChipContainer component.\n */\nexport const Chip = React.forwardRef<HTMLLIElement, ChipProps>(function Chip(\n { className, onDelete, onClick, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"li\"\n ref={ref}\n className={clsx(className, {\n 'ds-chip': true,\n 'ds-chip--deletable': !!onDelete,\n })}\n {...props}\n onClick={onClick}\n >\n <Base\n as=\"div\"\n role={onClick && 'button'}\n tabIndex={onClick && 0}\n className=\"ds-chip__content\"\n >\n {children}\n {onDelete && (\n <CloseIcon\n onClick={(e) => {\n e.stopPropagation();\n onDelete(e);\n }}\n />\n )}\n </Base>\n </Base>\n );\n});\n\nexport default Chip;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AAChC,yBAA0B;AAYnB,MAAM,OAAO,aAAAA,QAAM,WAAqC,SAASC,MACtE,EAAE,WAAW,UAAU,SAAS,UAAU,GAAG,MAAM,GACnD,KACA;AACA,SACE,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,WAAW;AAAA,QACX,sBAAsB,CAAC,CAAC;AAAA,MAC1B,CAAC;AAAA,MACA,GAAG;AAAA,MACJ;AAAA;AAAA,IAEA,6BAAAH,QAAA;AAAA,MAAC,YAAAE;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,MAAM,WAAW;AAAA,QACjB,UAAU,WAAW;AAAA,QACrB,WAAU;AAAA;AAAA,MAET;AAAA,MACA,YACC,6BAAAF,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,CAAC,MAAM;AACd,cAAE,gBAAgB;AAClB,qBAAS,CAAC;AAAA,UACZ;AAAA;AAAA,MACF;AAAA,IAEJ;AAAA,EACF;AAEJ,CAAC;AAED,IAAO,eAAQ;",
|
|
6
6
|
"names": ["React", "Chip", "Base", "clsx"]
|
|
7
7
|
}
|
package/cjs/Drawer/index.js
CHANGED
|
@@ -49,19 +49,32 @@ const Drawer = import_react.default.forwardRef(
|
|
|
49
49
|
{
|
|
50
50
|
as: "div",
|
|
51
51
|
ref,
|
|
52
|
-
className: (0, import_clsx.default)(
|
|
53
|
-
"ds-drawer": true,
|
|
54
|
-
"ds-drawer--relative-sm": upRelative === "sm",
|
|
55
|
-
"ds-drawer--relative-md": upRelative === "md",
|
|
56
|
-
"ds-drawer--relative-lg": upRelative === "lg",
|
|
57
|
-
"ds-drawer--closed": !open
|
|
58
|
-
|
|
59
|
-
"ds-drawer--left": direction === "left",
|
|
60
|
-
"ds-drawer--bg-secondary": bgColor === "secondary"
|
|
61
|
-
}),
|
|
62
|
-
...props
|
|
52
|
+
className: (0, import_clsx.default)({
|
|
53
|
+
"ds-drawer-container": true,
|
|
54
|
+
"ds-drawer-container--relative-sm": upRelative === "sm",
|
|
55
|
+
"ds-drawer-container--relative-md": upRelative === "md",
|
|
56
|
+
"ds-drawer-container--relative-lg": upRelative === "lg",
|
|
57
|
+
"ds-drawer-container--closed": !open
|
|
58
|
+
})
|
|
63
59
|
},
|
|
64
|
-
|
|
60
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
61
|
+
import_Base.default,
|
|
62
|
+
{
|
|
63
|
+
as: "div",
|
|
64
|
+
className: (0, import_clsx.default)(className, {
|
|
65
|
+
"ds-drawer": true,
|
|
66
|
+
"ds-drawer--relative-sm": upRelative === "sm",
|
|
67
|
+
"ds-drawer--relative-md": upRelative === "md",
|
|
68
|
+
"ds-drawer--relative-lg": upRelative === "lg",
|
|
69
|
+
"ds-drawer--closed": !open,
|
|
70
|
+
"ds-drawer--right": direction === "right",
|
|
71
|
+
"ds-drawer--left": direction === "left",
|
|
72
|
+
"ds-drawer--bg-secondary": bgColor === "secondary"
|
|
73
|
+
}),
|
|
74
|
+
...props
|
|
75
|
+
},
|
|
76
|
+
children
|
|
77
|
+
)
|
|
65
78
|
);
|
|
66
79
|
}
|
|
67
80
|
);
|