@openedx/paragon 22.12.0 → 22.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert/_variables.scss +2 -1
- package/dist/Annotation/index.js.map +1 -1
- package/dist/Annotation/index.scss +6 -5
- package/dist/Avatar/index.js.map +1 -1
- package/dist/AvatarButton/index.js.map +1 -1
- package/dist/Breadcrumb/index.js.map +1 -1
- package/dist/Bubble/index.js +1 -0
- package/dist/Bubble/index.js.map +1 -1
- package/dist/Bubble/index.scss +3 -2
- package/dist/Button/deprecated/index.js.map +1 -1
- package/dist/Button/index.scss +19 -18
- package/dist/Card/CardCarousel/CardCarouselHeader.js +2 -2
- package/dist/Card/CardCarousel/CardCarouselHeader.js.map +1 -1
- package/dist/Card/CardFooter.js.map +1 -1
- package/dist/Card/CardHeader.js +1 -1
- package/dist/Card/CardHeader.js.map +1 -1
- package/dist/Card/CardImageCap.js.map +1 -1
- package/dist/Card/CardStatus.js.map +1 -1
- package/dist/Card/_variables.scss +3 -2
- package/dist/Card/index.js.map +1 -1
- package/dist/Card/index.scss +10 -9
- package/dist/Chip/ChipIcon.d.ts +1 -1
- package/dist/Chip/index.js +1 -0
- package/dist/Chip/index.js.map +1 -1
- package/dist/ChipCarousel/index.js.map +1 -1
- package/dist/Collapsible/index.js.map +1 -1
- package/dist/ColorPicker/index.js +1 -1
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ColorPicker/index.scss +2 -1
- package/dist/DataTable/CollapsibleButtonGroup.js +2 -2
- package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
- package/dist/DataTable/DropdownFilters.js +1 -1
- package/dist/DataTable/DropdownFilters.js.map +1 -1
- package/dist/DataTable/TableRow.js.map +1 -1
- package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
- package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/TextFilter.js.map +1 -1
- package/dist/DataTable/index.scss +14 -13
- package/dist/DataTable/utils/getVisibleColumns.js +1 -1
- package/dist/DataTable/utils/getVisibleColumns.js.map +1 -1
- package/dist/Dropdown/_variables.scss +2 -1
- package/dist/Dropdown/deprecated/DropdownMenu.js +15 -19
- package/dist/Dropdown/deprecated/DropdownMenu.js.map +1 -1
- package/dist/Dropdown/deprecated/index.js +1 -1
- package/dist/Dropdown/deprecated/index.js.map +1 -1
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Dropzone/DefaultContent.js.map +1 -1
- package/dist/Dropzone/UploadProgress.js.map +1 -1
- package/dist/Dropzone/index.scss +3 -2
- package/dist/Fieldset/index.js.map +1 -1
- package/dist/Form/FormAutosuggest.js +1 -1
- package/dist/Form/FormAutosuggest.js.map +1 -1
- package/dist/Form/FormControl.js.map +1 -1
- package/dist/Form/FormControlDecorator.js.map +1 -1
- package/dist/Form/FormGroupContext.d.ts +1 -1
- package/dist/Form/FormGroupContext.js.map +1 -1
- package/dist/Form/FormText.js.map +1 -1
- package/dist/Form/_index.scss +9 -7
- package/dist/Form/_variables.scss +4 -2
- package/dist/Form/fieldUtils.js.map +1 -1
- package/dist/Hyperlink/index.js +1 -0
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Hyperlink/index.scss +3 -1
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/index.d.ts +13 -8
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButtonToggle/index.js.map +1 -1
- package/dist/IconButtonToggle/index.scss +3 -1
- package/dist/Input/index.js.map +1 -1
- package/dist/InputSelect/index.js.map +1 -1
- package/dist/Layout/index.js.map +1 -1
- package/dist/ListBox/index.js.map +1 -1
- package/dist/ListBoxOption/index.js.map +1 -1
- package/dist/Menu/SelectMenu.js +1 -1
- package/dist/Menu/SelectMenu.js.map +1 -1
- package/dist/Menu/index.js +1 -1
- package/dist/Menu/index.js.map +1 -1
- package/dist/Modal/ModalContext.d.ts +1 -1
- package/dist/Modal/ModalDialog.d.ts +1 -1
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/ModalDialogBody.js +1 -1
- package/dist/Modal/ModalDialogBody.js.map +1 -1
- package/dist/Modal/ModalDialogHeroBackground.js.map +1 -1
- package/dist/Modal/ModalLayer.d.ts +3 -3
- package/dist/Modal/ModalLayer.js.map +1 -1
- package/dist/Modal/ModalPopup.js.map +1 -1
- package/dist/Modal/_ModalDialog.scss +3 -1
- package/dist/Modal/index.js +3 -1
- package/dist/Modal/index.js.map +1 -1
- package/dist/Modal/index.scss +3 -5
- package/dist/Nav/_mixins.scss +3 -1
- package/dist/Overlay/index.d.ts +2 -2
- package/dist/PageBanner/index.js.map +1 -1
- package/dist/PageBanner/index.scss +2 -1
- package/dist/Pagination/PaginationContext.js.map +1 -1
- package/dist/Pagination/index.js.map +1 -1
- package/dist/Popover/_variables.scss +2 -1
- package/dist/Popover/index.js.map +1 -1
- package/dist/ProductTour/Checkpoint.scss +9 -8
- package/dist/ProductTour/index.js +1 -1
- package/dist/ProductTour/index.js.map +1 -1
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/Scrollable/index.js +1 -1
- package/dist/Scrollable/index.js.map +1 -1
- package/dist/SearchField/SearchFieldAdvanced.js.map +1 -1
- package/dist/SearchField/index.scss +2 -1
- package/dist/SelectableBox/SelectableBoxSet.js.map +1 -1
- package/dist/Sheet/index.js.map +1 -1
- package/dist/Stack/index.js.map +1 -1
- package/dist/StatefulButton/index.js.map +1 -1
- package/dist/StatusAlert/index.js.map +1 -1
- package/dist/Stepper/StepperHeader.js +1 -1
- package/dist/Stepper/StepperHeader.js.map +1 -1
- package/dist/Stepper/StepperHeaderStep.js.map +1 -1
- package/dist/Sticky/index.js.map +1 -1
- package/dist/Table/_variables.scss +2 -1
- package/dist/Tabs/deprecated/index.js.map +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Tabs/index.js.map +1 -1
- package/dist/Toast/ToastContainer.scss +1 -1
- package/dist/Toast/index.scss +2 -2
- package/dist/Truncate/index.js +1 -1
- package/dist/Truncate/index.js.map +1 -1
- package/dist/ValidationFormGroup/index.js.map +1 -1
- package/dist/asInput/index.js.map +1 -1
- package/dist/hooks/useArrowKeyNavigationHook.d.ts +10 -0
- package/dist/hooks/{useArrowKeyNavigation.js → useArrowKeyNavigationHook.js} +13 -11
- package/dist/hooks/useArrowKeyNavigationHook.js.map +1 -0
- package/dist/hooks/useIndexOfLastVisibleChildHook.d.ts +12 -0
- package/dist/hooks/{useIndexOfLastVisibleChild.js → useIndexOfLastVisibleChildHook.js} +16 -12
- package/dist/hooks/useIndexOfLastVisibleChildHook.js.map +1 -0
- package/dist/hooks/useIsVisibleHook.d.ts +3 -0
- package/dist/hooks/{useIsVisible.js → useIsVisibleHook.js} +2 -2
- package/dist/hooks/useIsVisibleHook.js.map +1 -0
- package/dist/hooks/useToggleHook.d.ts +12 -0
- package/dist/hooks/useToggleHook.js +31 -0
- package/dist/hooks/useToggleHook.js.map +1 -0
- package/dist/hooks/useWindowSizeHook.d.ts +6 -0
- package/dist/hooks/{useWindowSize.js → useWindowSizeHook.js} +1 -1
- package/dist/hooks/useWindowSizeHook.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/paragon.css +1 -45
- package/dist/utils/newId.js.map +1 -1
- package/dist/withDeprecatedProps.js.map +1 -1
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/CHANGELOG.md +50 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/LICENSE +7 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/README.md +37 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.d.ts +20 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.js +79 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.js.map +1 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/package.json +40 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/tsconfig.json +4 -0
- package/icons/package.json +1 -1
- package/package.json +12 -19
- package/scss/core/_exports.module.scss +7 -6
- package/scss/core/_functions.scss +9 -7
- package/scss/core/_typography.scss +2 -1
- package/scss/core/_utilities.scss +2 -1
- package/scss/core/_variables.scss +98 -95
- package/src/Alert/_variables.scss +2 -1
- package/src/Annotation/index.scss +6 -5
- package/src/Breadcrumb/Breadcrumb.test.jsx +3 -2
- package/src/Bubble/index.scss +3 -2
- package/src/Bubble/index.tsx +1 -0
- package/src/Button/deprecated/Button.test.jsx +6 -4
- package/src/Button/index.scss +19 -18
- package/src/Card/CardCarousel/tests/CardCarouselControls.test.jsx +6 -4
- package/src/Card/_variables.scss +3 -2
- package/src/Card/index.scss +10 -9
- package/src/Chip/index.tsx +1 -0
- package/src/Collapsible/Collapsible.test.jsx +15 -7
- package/src/ColorPicker/ColorPicker.test.jsx +9 -16
- package/src/ColorPicker/index.jsx +1 -1
- package/src/ColorPicker/index.scss +2 -1
- package/src/DataTable/CollapsibleButtonGroup.jsx +2 -2
- package/src/DataTable/DropdownFilters.jsx +1 -1
- package/src/DataTable/dataviews.mdx +1 -8
- package/src/DataTable/index.scss +14 -13
- package/src/DataTable/selection/tests/ControlledSelectHeader.test.jsx +6 -4
- package/src/DataTable/tests/BulkActions.test.jsx +2 -4
- package/src/DataTable/tests/DataViewToggle.test.jsx +3 -7
- package/src/DataTable/tests/DropdownFilters.test.jsx +1 -1
- package/src/DataTable/tests/TableActions.test.jsx +1 -1
- package/src/Dropdown/_variables.scss +2 -1
- package/src/Dropdown/deprecated/Dropdown.test.jsx +43 -27
- package/src/Dropzone/README.md +3 -3
- package/src/Dropzone/index.scss +3 -2
- package/src/Dropzone/tests/__snapshots__/Dropzone.test.jsx.snap +10 -1
- package/src/Form/FormAutosuggest.jsx +1 -1
- package/src/Form/FormGroupContext.tsx +1 -1
- package/src/Form/_index.scss +9 -7
- package/src/Form/_variables.scss +4 -2
- package/src/Form/tests/FormAutosuggest.test.jsx +76 -57
- package/src/Form/tests/FormCheckboxSet.test.jsx +3 -2
- package/src/Form/tests/FormControl.test.jsx +9 -6
- package/src/Form/tests/FormRadioSet.test.jsx +3 -2
- package/src/Hyperlink/index.scss +3 -1
- package/src/Hyperlink/index.tsx +1 -0
- package/src/IconButtonToggle/IconButtonToggle.test.jsx +3 -2
- package/src/IconButtonToggle/index.scss +3 -1
- package/src/ListBox/ListBox.test.jsx +8 -4
- package/src/Menu/Menu.test.jsx +15 -10
- package/src/Menu/SelectMenu.jsx +1 -1
- package/src/Menu/index.jsx +1 -1
- package/src/Modal/ModalDialogBody.jsx +1 -1
- package/src/Modal/_ModalDialog.scss +3 -1
- package/src/Modal/index.jsx +2 -0
- package/src/Modal/index.scss +3 -5
- package/src/Modal/tests/ModalLayer.test.tsx +3 -2
- package/src/Nav/_mixins.scss +3 -1
- package/src/OverflowScroll/data/tests/useOverflowScroll.test.jsx +1 -2
- package/src/OverflowScroll/data/tests/useOverflowScrollActions.test.jsx +1 -1
- package/src/OverflowScroll/data/tests/useOverflowScrollElementAttributes.test.jsx +1 -1
- package/src/OverflowScroll/data/tests/useOverflowScrollEventListeners.test.jsx +1 -2
- package/src/PageBanner/index.scss +2 -1
- package/src/Pagination/Pagination.test.jsx +36 -28
- package/src/Popover/_variables.scss +2 -1
- package/src/ProductTour/Checkpoint.scss +9 -8
- package/src/ProductTour/Checkpoint.test.jsx +3 -2
- package/src/ProductTour/ProductTour.test.jsx +11 -24
- package/src/ProductTour/index.jsx +1 -1
- package/src/Scrollable/Scrollable.test.jsx +2 -2
- package/src/Scrollable/index.jsx +1 -1
- package/src/SearchField/index.scss +2 -1
- package/src/SelectableBox/tests/SelectableBox.test.jsx +3 -2
- package/src/StatusAlert/StatusAlert.test.jsx +6 -2
- package/src/Stepper/StepperHeader.jsx +1 -1
- package/src/Stepper/tests/Stepper.test.jsx +1 -1
- package/src/Table/_variables.scss +2 -1
- package/src/Tabs/Tabs.test.jsx +1 -1
- package/src/Tabs/deprecated/Tabs.test.jsx +6 -4
- package/src/Tabs/index.jsx +1 -1
- package/src/Toast/ToastContainer.scss +1 -1
- package/src/Toast/index.scss +2 -2
- package/src/Truncate/index.jsx +1 -1
- package/src/hooks/tests/{useIndexOfLastVisibleChild.test.jsx → useIndexOfLastVisibleChild.test.tsx} +2 -2
- package/src/hooks/tests/{useToggle.test.jsx → useToggle.test.tsx} +2 -1
- package/src/hooks/{useArrowKeyNavigation.jsx → useArrowKeyNavigationHook.tsx} +41 -13
- package/src/hooks/{useIndexOfLastVisibleChild.jsx → useIndexOfLastVisibleChildHook.tsx} +22 -16
- package/src/hooks/{useIsVisible.jsx → useIsVisibleHook.tsx} +6 -3
- package/src/hooks/useToggleHook.tsx +42 -0
- package/src/hooks/{useWindowSize.jsx → useWindowSizeHook.tsx} +7 -2
- package/src/index.d.ts +5 -5
- package/src/index.js +5 -5
- package/dist/hooks/useArrowKeyNavigation.js.map +0 -1
- package/dist/hooks/useIndexOfLastVisibleChild.js.map +0 -1
- package/dist/hooks/useIsVisible.js.map +0 -1
- package/dist/hooks/useToggle.js +0 -38
- package/dist/hooks/useToggle.js.map +0 -1
- package/dist/hooks/useWindowSize.js.map +0 -1
- package/src/DataTable/tests/utils.js +0 -9
- package/src/hooks/useToggle.jsx +0 -37
- /package/src/hooks/tests/{useWindowSize.test.jsx → useWindowSize.test.tsx} +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
// Alerts
|
|
2
3
|
//
|
|
3
4
|
// Define alert colors, border radius, and padding.
|
|
@@ -21,4 +22,4 @@ $alert-font-size: .875rem !default;
|
|
|
21
22
|
$alert-line-height: 1.5rem !default;
|
|
22
23
|
$alert-content-color: $gray-700 !default;
|
|
23
24
|
|
|
24
|
-
$alert-actions-gap: map
|
|
25
|
+
$alert-actions-gap: map.get($spacers, 3);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","Annotation","forwardRef","_ref","ref","className","variant","children","arrowPlacement","props","createElement","defaultProps","undefined","propTypes","node","isRequired","string","oneOf"],"sources":["../../src/Annotation/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst Annotation = React.forwardRef(({\n className,\n variant,\n children,\n arrowPlacement,\n ...props\n}, ref) => (\n <span\n className={classNames(\n className,\n 'pgn__annotation',\n `pgn__annotation-${variant}-${arrowPlacement}`,\n )}\n ref={ref}\n {...props}\n >\n {children}\n </span>\n));\n\nAnnotation.defaultProps = {\n className: undefined,\n variant: 'success',\n arrowPlacement: 'bottom',\n};\n\nAnnotation.propTypes = {\n /** Specifies contents of the component. */\n children: PropTypes.node.isRequired,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies variant to use. */\n variant: PropTypes.oneOf(['error', 'success', 'warning', 'light', 'dark']),\n /** Specifies arrow position. */\n arrowPlacement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),\n};\n\nexport default Annotation;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,MAAMC,UAAU,gBAAGH,KAAK,CAACI,UAAU,CAAC,CAAAC,IAAA,EAMjCC,GAAG;EAAA,IAN+B;IACnCC,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,cAAc;IACd,GAAGC;EACL,CAAC,GAAAN,IAAA;EAAA,oBACCL,KAAA,CAAAY,aAAA;IACEL,SAAS,EAAEL,UAAU,CACnBK,SAAS,EACT,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","Annotation","forwardRef","_ref","ref","className","variant","children","arrowPlacement","props","createElement","defaultProps","undefined","propTypes","node","isRequired","string","oneOf"],"sources":["../../src/Annotation/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst Annotation = React.forwardRef(({\n className,\n variant,\n children,\n arrowPlacement,\n ...props\n}, ref) => (\n <span\n className={classNames(\n className,\n 'pgn__annotation',\n `pgn__annotation-${variant}-${arrowPlacement}`,\n )}\n ref={ref}\n {...props}\n >\n {children}\n </span>\n));\n\nAnnotation.defaultProps = {\n className: undefined,\n variant: 'success',\n arrowPlacement: 'bottom',\n};\n\nAnnotation.propTypes = {\n /** Specifies contents of the component. */\n children: PropTypes.node.isRequired,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies variant to use. */\n variant: PropTypes.oneOf(['error', 'success', 'warning', 'light', 'dark']),\n /** Specifies arrow position. */\n arrowPlacement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),\n};\n\nexport default Annotation;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,MAAMC,UAAU,gBAAGH,KAAK,CAACI,UAAU,CAAC,CAAAC,IAAA,EAMjCC,GAAG;EAAA,IAN+B;IACnCC,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,cAAc;IACd,GAAGC;EACL,CAAC,GAAAN,IAAA;EAAA,oBACCL,KAAA,CAAAY,aAAA;IACEL,SAAS,EAAEL,UAAU,CACnBK,SAAS,EACT,iBAAiB,EACjB,mBAAmBC,OAAO,IAAIE,cAAc,EAC9C,CAAE;IACFJ,GAAG,EAAEA,GAAI;IAAA,GACLK;EAAK,GAERF,QACG,CAAC;AAAA,CACR,CAAC;AAEFN,UAAU,CAACU,YAAY,GAAG;EACxBN,SAAS,EAAEO,SAAS;EACpBN,OAAO,EAAE,SAAS;EAClBE,cAAc,EAAE;AAClB,CAAC;AAEDP,UAAU,CAACY,SAAS,GAAG;EACrB;EACAN,QAAQ,EAAER,SAAS,CAACe,IAAI,CAACC,UAAU;EACnC;EACAV,SAAS,EAAEN,SAAS,CAACiB,MAAM;EAC3B;EACAV,OAAO,EAAEP,SAAS,CAACkB,KAAK,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1E;EACAT,cAAc,EAAET,SAAS,CAACkB,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC;AACpE,CAAC;AAED,eAAehB,UAAU","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@import "variables";
|
|
2
3
|
|
|
3
4
|
@mixin triangle($color, $direction) {
|
|
@@ -66,8 +67,8 @@ $arrow-directions: top, right, bottom, left;
|
|
|
66
67
|
@each $name, $colors in $annotation-variants {
|
|
67
68
|
@each $direction in $arrow-directions {
|
|
68
69
|
.pgn__annotation-#{$name}-#{$direction} {
|
|
69
|
-
background-color: map
|
|
70
|
-
color: map
|
|
70
|
+
background-color: map.get($colors, "background-color");
|
|
71
|
+
color: map.get($colors, "color");
|
|
71
72
|
|
|
72
73
|
// set additional margin to arrow side of the Annotation
|
|
73
74
|
margin-#{$direction}: $annotation-arrow-border-width + $annotation-arrow-side-margin;
|
|
@@ -85,7 +86,7 @@ $arrow-directions: top, right, bottom, left;
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
&::after {
|
|
88
|
-
@include triangle(map
|
|
89
|
+
@include triangle(map.get($colors, "background-color"), $direction);
|
|
89
90
|
|
|
90
91
|
[dir="rtl"] & {
|
|
91
92
|
@if $direction == left {
|
|
@@ -94,7 +95,7 @@ $arrow-directions: top, right, bottom, left;
|
|
|
94
95
|
border-width:
|
|
95
96
|
$annotation-arrow-border-width 0 $annotation-arrow-border-width
|
|
96
97
|
$annotation-arrow-border-width;
|
|
97
|
-
border-left-color: map
|
|
98
|
+
border-left-color: map.get($colors, "background-color");
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
@else if $direction == right {
|
|
@@ -103,7 +104,7 @@ $arrow-directions: top, right, bottom, left;
|
|
|
103
104
|
border-width:
|
|
104
105
|
$annotation-arrow-border-width $annotation-arrow-border-width
|
|
105
106
|
$annotation-arrow-border-width 0;
|
|
106
|
-
border-right-color: map
|
|
107
|
+
border-right-color: map.get($colors, "background-color");
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
}
|
package/dist/Avatar/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","defaultAvatar","Avatar","_ref","alt","size","src","attrs","createElement","className","propTypes","string","oneOf","defaultProps","undefined"],"sources":["../../src/Avatar/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport defaultAvatar from './default-avatar.svg';\n\nfunction Avatar({\n alt,\n size,\n src,\n ...attrs\n}) {\n return (\n <img\n {...attrs}\n className={classNames(\n 'pgn__avatar',\n `pgn__avatar-${size}`,\n attrs.className,\n )}\n src={src || defaultAvatar}\n alt={alt}\n />\n );\n}\n\nAvatar.propTypes = {\n /** Alt text. Usually the user's name */\n alt: PropTypes.string,\n /** Size of the avatar */\n size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'huge']),\n /** Image src of the avatar image */\n src: PropTypes.string,\n};\n\nAvatar.defaultProps = {\n alt: '',\n size: 'md',\n src: undefined,\n};\n\nexport default Avatar;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,aAAa,MAAM,sBAAsB;AAEhD,SAASC,MAAMA,CAAAC,IAAA,EAKZ;EAAA,IALa;IACdC,GAAG;IACHC,IAAI;IACJC,GAAG;IACH,GAAGC;EACL,CAAC,GAAAJ,IAAA;EACC,oBACEL,KAAA,CAAAU,aAAA;IAAA,GACMD,KAAK;IACTE,SAAS,EAAET,UAAU,CACnB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","defaultAvatar","Avatar","_ref","alt","size","src","attrs","createElement","className","propTypes","string","oneOf","defaultProps","undefined"],"sources":["../../src/Avatar/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport defaultAvatar from './default-avatar.svg';\n\nfunction Avatar({\n alt,\n size,\n src,\n ...attrs\n}) {\n return (\n <img\n {...attrs}\n className={classNames(\n 'pgn__avatar',\n `pgn__avatar-${size}`,\n attrs.className,\n )}\n src={src || defaultAvatar}\n alt={alt}\n />\n );\n}\n\nAvatar.propTypes = {\n /** Alt text. Usually the user's name */\n alt: PropTypes.string,\n /** Size of the avatar */\n size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'huge']),\n /** Image src of the avatar image */\n src: PropTypes.string,\n};\n\nAvatar.defaultProps = {\n alt: '',\n size: 'md',\n src: undefined,\n};\n\nexport default Avatar;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,aAAa,MAAM,sBAAsB;AAEhD,SAASC,MAAMA,CAAAC,IAAA,EAKZ;EAAA,IALa;IACdC,GAAG;IACHC,IAAI;IACJC,GAAG;IACH,GAAGC;EACL,CAAC,GAAAJ,IAAA;EACC,oBACEL,KAAA,CAAAU,aAAA;IAAA,GACMD,KAAK;IACTE,SAAS,EAAET,UAAU,CACnB,aAAa,EACb,eAAeK,IAAI,EAAE,EACrBE,KAAK,CAACE,SACR,CAAE;IACFH,GAAG,EAAEA,GAAG,IAAIL,aAAc;IAC1BG,GAAG,EAAEA;EAAI,CACV,CAAC;AAEN;AAEAF,MAAM,CAACQ,SAAS,GAAG;EACjB;EACAN,GAAG,EAAEL,SAAS,CAACY,MAAM;EACrB;EACAN,IAAI,EAAEN,SAAS,CAACa,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;EACpE;EACAN,GAAG,EAAEP,SAAS,CAACY;AACjB,CAAC;AAEDT,MAAM,CAACW,YAAY,GAAG;EACpBT,GAAG,EAAE,EAAE;EACPC,IAAI,EAAE,IAAI;EACVC,GAAG,EAAEQ;AACP,CAAC;AAED,eAAeZ,MAAM","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","Button","Avatar","buttonSizesToAvatarSize","sm","md","lg","AvatarButton","forwardRef","_ref","ref","children","className","showLabel","size","src","attrs","avatarSize","createElement","alt","propTypes","string","bool","oneOf","variant","defaultProps","undefined"],"sources":["../../src/AvatarButton/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Button from '../Button';\nimport Avatar from '../Avatar';\n\nconst buttonSizesToAvatarSize = {\n sm: 'xs',\n md: 'sm',\n lg: 'md',\n};\n\nconst AvatarButton = React.forwardRef(({\n children,\n className,\n showLabel,\n size,\n src,\n ...attrs\n}, ref) => {\n const avatarSize = buttonSizesToAvatarSize[size] || 'sm';\n return (\n <Button\n {...attrs}\n className={classNames(\n 'btn-avatar', // the public class name for custom styling\n 'pgn__avatar-button-avatar',\n `pgn__avatar-button-avatar-${size}`,\n className,\n { 'pgn__avatar-button-hide-label': !showLabel },\n )}\n size={size}\n ref={ref}\n >\n <Avatar src={src} alt={showLabel ? '' : children} size={avatarSize} />\n {showLabel && children}\n </Button>\n );\n});\n\nAvatarButton.propTypes = {\n /** The button text */\n children: PropTypes.string,\n /** A class name to append to the button */\n className: PropTypes.string,\n /** Show the label or only the avatar */\n showLabel: PropTypes.bool,\n /** The button size */\n size: PropTypes.oneOf(['sm', 'md', 'lg']),\n /** Image src of the avatar image */\n src: PropTypes.string,\n /** The button style variant to use */\n variant: PropTypes.string,\n};\n\nAvatarButton.defaultProps = {\n children: undefined,\n className: undefined,\n showLabel: true,\n size: 'md',\n src: undefined,\n variant: 'tertiary',\n};\n\nexport default AvatarButton;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,MAAM,MAAM,WAAW;AAE9B,MAAMC,uBAAuB,GAAG;EAC9BC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,YAAY,gBAAGT,KAAK,CAACU,UAAU,CAAC,CAAAC,IAAA,EAOnCC,GAAG,KAAK;EAAA,IAP4B;IACrCC,QAAQ;IACRC,SAAS;IACTC,SAAS;IACTC,IAAI;IACJC,GAAG;IACH,GAAGC;EACL,CAAC,GAAAP,IAAA;EACC,MAAMQ,UAAU,GAAGd,uBAAuB,CAACW,IAAI,CAAC,IAAI,IAAI;EACxD,oBACEhB,KAAA,CAAAoB,aAAA,CAACjB,MAAM;IAAA,GACDe,KAAK;IACTJ,SAAS,EAAEZ,UAAU,CACnB,YAAY;IAAE;IACd,2BAA2B,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","Button","Avatar","buttonSizesToAvatarSize","sm","md","lg","AvatarButton","forwardRef","_ref","ref","children","className","showLabel","size","src","attrs","avatarSize","createElement","alt","propTypes","string","bool","oneOf","variant","defaultProps","undefined"],"sources":["../../src/AvatarButton/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Button from '../Button';\nimport Avatar from '../Avatar';\n\nconst buttonSizesToAvatarSize = {\n sm: 'xs',\n md: 'sm',\n lg: 'md',\n};\n\nconst AvatarButton = React.forwardRef(({\n children,\n className,\n showLabel,\n size,\n src,\n ...attrs\n}, ref) => {\n const avatarSize = buttonSizesToAvatarSize[size] || 'sm';\n return (\n <Button\n {...attrs}\n className={classNames(\n 'btn-avatar', // the public class name for custom styling\n 'pgn__avatar-button-avatar',\n `pgn__avatar-button-avatar-${size}`,\n className,\n { 'pgn__avatar-button-hide-label': !showLabel },\n )}\n size={size}\n ref={ref}\n >\n <Avatar src={src} alt={showLabel ? '' : children} size={avatarSize} />\n {showLabel && children}\n </Button>\n );\n});\n\nAvatarButton.propTypes = {\n /** The button text */\n children: PropTypes.string,\n /** A class name to append to the button */\n className: PropTypes.string,\n /** Show the label or only the avatar */\n showLabel: PropTypes.bool,\n /** The button size */\n size: PropTypes.oneOf(['sm', 'md', 'lg']),\n /** Image src of the avatar image */\n src: PropTypes.string,\n /** The button style variant to use */\n variant: PropTypes.string,\n};\n\nAvatarButton.defaultProps = {\n children: undefined,\n className: undefined,\n showLabel: true,\n size: 'md',\n src: undefined,\n variant: 'tertiary',\n};\n\nexport default AvatarButton;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,MAAM,MAAM,WAAW;AAE9B,MAAMC,uBAAuB,GAAG;EAC9BC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,YAAY,gBAAGT,KAAK,CAACU,UAAU,CAAC,CAAAC,IAAA,EAOnCC,GAAG,KAAK;EAAA,IAP4B;IACrCC,QAAQ;IACRC,SAAS;IACTC,SAAS;IACTC,IAAI;IACJC,GAAG;IACH,GAAGC;EACL,CAAC,GAAAP,IAAA;EACC,MAAMQ,UAAU,GAAGd,uBAAuB,CAACW,IAAI,CAAC,IAAI,IAAI;EACxD,oBACEhB,KAAA,CAAAoB,aAAA,CAACjB,MAAM;IAAA,GACDe,KAAK;IACTJ,SAAS,EAAEZ,UAAU,CACnB,YAAY;IAAE;IACd,2BAA2B,EAC3B,6BAA6Bc,IAAI,EAAE,EACnCF,SAAS,EACT;MAAE,+BAA+B,EAAE,CAACC;IAAU,CAChD,CAAE;IACFC,IAAI,EAAEA,IAAK;IACXJ,GAAG,EAAEA;EAAI,gBAETZ,KAAA,CAAAoB,aAAA,CAAChB,MAAM;IAACa,GAAG,EAAEA,GAAI;IAACI,GAAG,EAAEN,SAAS,GAAG,EAAE,GAAGF,QAAS;IAACG,IAAI,EAAEG;EAAW,CAAE,CAAC,EACrEJ,SAAS,IAAIF,QACR,CAAC;AAEb,CAAC,CAAC;AAEFJ,YAAY,CAACa,SAAS,GAAG;EACvB;EACAT,QAAQ,EAAEZ,SAAS,CAACsB,MAAM;EAC1B;EACAT,SAAS,EAAEb,SAAS,CAACsB,MAAM;EAC3B;EACAR,SAAS,EAAEd,SAAS,CAACuB,IAAI;EACzB;EACAR,IAAI,EAAEf,SAAS,CAACwB,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;EACzC;EACAR,GAAG,EAAEhB,SAAS,CAACsB,MAAM;EACrB;EACAG,OAAO,EAAEzB,SAAS,CAACsB;AACrB,CAAC;AAEDd,YAAY,CAACkB,YAAY,GAAG;EAC1Bd,QAAQ,EAAEe,SAAS;EACnBd,SAAS,EAAEc,SAAS;EACpBb,SAAS,EAAE,IAAI;EACfC,IAAI,EAAE,IAAI;EACVC,GAAG,EAAEW,SAAS;EACdF,OAAO,EAAE;AACX,CAAC;AAED,eAAejB,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","BreadcrumbLink","ChevronRight","Icon","Breadcrumb","_ref","links","activeLabel","spacer","clickHandler","variant","isMobile","ariaLabel","linkAs","props","linkCount","length","displayLinks","createElement","className","map","link","i","Fragment","key","label","as","linkProps","role","src","id","propTypes","arrayOf","shape","string","isRequired","element","func","oneOf","bool","elementType","defaultProps","undefined"],"sources":["../../src/Breadcrumb/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport BreadcrumbLink from './BreadcrumbLink';\nimport { ChevronRight } from '../../icons';\nimport Icon from '../Icon';\n\nfunction Breadcrumb({\n links, activeLabel, spacer, clickHandler,\n variant, isMobile, ariaLabel, linkAs, ...props\n}) {\n const linkCount = links.length;\n const displayLinks = isMobile ? [links[linkCount - 1]] : links;\n\n return (\n <nav\n aria-label={ariaLabel}\n className={classNames('pgn__breadcrumb', `pgn__breadcrumb-${variant}`)}\n {...props}\n >\n <ol className={classNames('list-inline', { 'is-mobile': isMobile })}>\n {displayLinks.map((link, i) => (\n <React.Fragment key={link.label}>\n <li className={classNames('list-inline-item')}>\n <BreadcrumbLink as={linkAs} clickHandler={clickHandler} linkProps={link} />\n </li>\n {(activeLabel || ((i + 1) < linkCount))\n && (\n <li className=\"list-inline-item\" role=\"presentation\">\n {spacer || <Icon src={ChevronRight} id={`spacer-${i}`} />}\n </li>\n )}\n </React.Fragment>\n ))}\n {!isMobile && activeLabel && <li className=\"list-inline-item active\" key=\"active\" aria-current=\"page\">{activeLabel}</li>}\n </ol>\n </nav>\n );\n}\n\nBreadcrumb.propTypes = {\n /** An array of objects describing links to be rendered. The contents of an object depend on the value of `linkAs`\n * prop as these objects will get passed down as props to the underlying component defined by `linkAs` prop.\n */\n links: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string,\n })).isRequired,\n /** allows to add a label that is not a link to the end of the breadcrumb. */\n activeLabel: PropTypes.string,\n /** label of the element */\n ariaLabel: PropTypes.string,\n /** allows to add a custom element between the breadcrumb items.\n * Defaults to `>` rendered using the `Icon` component. */\n spacer: PropTypes.element,\n /** allows to add a custom function to be called `onClick` of a breadcrumb link.\n * The use case for this is for adding custom analytics to the component. */\n clickHandler: PropTypes.func,\n /** The `Breadcrumbs` style variant to use. */\n variant: PropTypes.oneOf(['light', 'dark']),\n /** The `Breadcrumbs` mobile variant view. */\n isMobile: PropTypes.bool,\n /** Specifies the base element to use when rendering links, you should generally use either plain 'a' or\n * [react-router's Link](https://reactrouter.com/en/main/components/link).\n */\n linkAs: PropTypes.elementType,\n};\n\nBreadcrumb.defaultProps = {\n activeLabel: undefined,\n ariaLabel: 'breadcrumb',\n spacer: undefined,\n clickHandler: undefined,\n variant: 'light',\n isMobile: false,\n linkAs: 'a',\n};\n\nexport default Breadcrumb;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAOC,IAAI,MAAM,SAAS;AAE1B,SAASC,UAAUA,CAAAC,IAAA,EAGhB;EAAA,IAHiB;IAClBC,KAAK;IAAEC,WAAW;IAAEC,MAAM;IAAEC,YAAY;IACxCC,OAAO;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,MAAM;IAAE,GAAGC;EAC3C,CAAC,GAAAT,IAAA;EACC,MAAMU,SAAS,GAAGT,KAAK,CAACU,MAAM;EAC9B,MAAMC,YAAY,GAAGN,QAAQ,GAAG,CAACL,KAAK,CAACS,SAAS,GAAG,CAAC,CAAC,CAAC,GAAGT,KAAK;EAE9D,oBACER,KAAA,CAAAoB,aAAA;IACE,cAAYN,SAAU;IACtBO,SAAS,EAAEnB,UAAU,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","BreadcrumbLink","ChevronRight","Icon","Breadcrumb","_ref","links","activeLabel","spacer","clickHandler","variant","isMobile","ariaLabel","linkAs","props","linkCount","length","displayLinks","createElement","className","map","link","i","Fragment","key","label","as","linkProps","role","src","id","propTypes","arrayOf","shape","string","isRequired","element","func","oneOf","bool","elementType","defaultProps","undefined"],"sources":["../../src/Breadcrumb/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport BreadcrumbLink from './BreadcrumbLink';\nimport { ChevronRight } from '../../icons';\nimport Icon from '../Icon';\n\nfunction Breadcrumb({\n links, activeLabel, spacer, clickHandler,\n variant, isMobile, ariaLabel, linkAs, ...props\n}) {\n const linkCount = links.length;\n const displayLinks = isMobile ? [links[linkCount - 1]] : links;\n\n return (\n <nav\n aria-label={ariaLabel}\n className={classNames('pgn__breadcrumb', `pgn__breadcrumb-${variant}`)}\n {...props}\n >\n <ol className={classNames('list-inline', { 'is-mobile': isMobile })}>\n {displayLinks.map((link, i) => (\n <React.Fragment key={link.label}>\n <li className={classNames('list-inline-item')}>\n <BreadcrumbLink as={linkAs} clickHandler={clickHandler} linkProps={link} />\n </li>\n {(activeLabel || ((i + 1) < linkCount))\n && (\n <li className=\"list-inline-item\" role=\"presentation\">\n {spacer || <Icon src={ChevronRight} id={`spacer-${i}`} />}\n </li>\n )}\n </React.Fragment>\n ))}\n {!isMobile && activeLabel && <li className=\"list-inline-item active\" key=\"active\" aria-current=\"page\">{activeLabel}</li>}\n </ol>\n </nav>\n );\n}\n\nBreadcrumb.propTypes = {\n /** An array of objects describing links to be rendered. The contents of an object depend on the value of `linkAs`\n * prop as these objects will get passed down as props to the underlying component defined by `linkAs` prop.\n */\n links: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string,\n })).isRequired,\n /** allows to add a label that is not a link to the end of the breadcrumb. */\n activeLabel: PropTypes.string,\n /** label of the element */\n ariaLabel: PropTypes.string,\n /** allows to add a custom element between the breadcrumb items.\n * Defaults to `>` rendered using the `Icon` component. */\n spacer: PropTypes.element,\n /** allows to add a custom function to be called `onClick` of a breadcrumb link.\n * The use case for this is for adding custom analytics to the component. */\n clickHandler: PropTypes.func,\n /** The `Breadcrumbs` style variant to use. */\n variant: PropTypes.oneOf(['light', 'dark']),\n /** The `Breadcrumbs` mobile variant view. */\n isMobile: PropTypes.bool,\n /** Specifies the base element to use when rendering links, you should generally use either plain 'a' or\n * [react-router's Link](https://reactrouter.com/en/main/components/link).\n */\n linkAs: PropTypes.elementType,\n};\n\nBreadcrumb.defaultProps = {\n activeLabel: undefined,\n ariaLabel: 'breadcrumb',\n spacer: undefined,\n clickHandler: undefined,\n variant: 'light',\n isMobile: false,\n linkAs: 'a',\n};\n\nexport default Breadcrumb;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAOC,IAAI,MAAM,SAAS;AAE1B,SAASC,UAAUA,CAAAC,IAAA,EAGhB;EAAA,IAHiB;IAClBC,KAAK;IAAEC,WAAW;IAAEC,MAAM;IAAEC,YAAY;IACxCC,OAAO;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,MAAM;IAAE,GAAGC;EAC3C,CAAC,GAAAT,IAAA;EACC,MAAMU,SAAS,GAAGT,KAAK,CAACU,MAAM;EAC9B,MAAMC,YAAY,GAAGN,QAAQ,GAAG,CAACL,KAAK,CAACS,SAAS,GAAG,CAAC,CAAC,CAAC,GAAGT,KAAK;EAE9D,oBACER,KAAA,CAAAoB,aAAA;IACE,cAAYN,SAAU;IACtBO,SAAS,EAAEnB,UAAU,CAAC,iBAAiB,EAAE,mBAAmBU,OAAO,EAAE,CAAE;IAAA,GACnEI;EAAK,gBAEThB,KAAA,CAAAoB,aAAA;IAAIC,SAAS,EAAEnB,UAAU,CAAC,aAAa,EAAE;MAAE,WAAW,EAAEW;IAAS,CAAC;EAAE,GACjEM,YAAY,CAACG,GAAG,CAAC,CAACC,IAAI,EAAEC,CAAC,kBACxBxB,KAAA,CAAAoB,aAAA,CAACpB,KAAK,CAACyB,QAAQ;IAACC,GAAG,EAAEH,IAAI,CAACI;EAAM,gBAC9B3B,KAAA,CAAAoB,aAAA;IAAIC,SAAS,EAAEnB,UAAU,CAAC,kBAAkB;EAAE,gBAC5CF,KAAA,CAAAoB,a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B9B,SAAS,EAAE,YAAY;EACvBJ,MAAM,EAAEkC,SAAS;EACjBjC,YAAY,EAAEiC,SAAS;EACvBhC,OAAO,EAAE,OAAO;EAChBC,QAAQ,EAAE,KAAK;EACfE,MAAM,EAAE;AACV,CAAC;AAED,eAAeT,UAAU","ignoreList":[]}
|
package/dist/Bubble/index.js
CHANGED
|
@@ -22,6 +22,7 @@ const Bubble = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
22
22
|
});
|
|
23
23
|
Bubble.propTypes = {
|
|
24
24
|
/** Specifies contents of the component. */
|
|
25
|
+
// @ts-ignore
|
|
25
26
|
children: PropTypes.node,
|
|
26
27
|
/** The `Bubble` style variant to use. */
|
|
27
28
|
variant: PropTypes.oneOf(STYLE_VARIANTS),
|
package/dist/Bubble/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","STYLE_VARIANTS","Bubble","forwardRef","_ref","ref","variant","className","children","disabled","expandable","props","createElement","propTypes","node","oneOf","bool","string","defaultProps","undefined"],"sources":["../../src/Bubble/index.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst STYLE_VARIANTS = ['primary', 'success', 'error', 'warning'] as const;\n\nexport type BubbleVariant = typeof STYLE_VARIANTS[number];\n\nexport interface BubbleProps {\n children: React.ReactNode;\n variant?: BubbleVariant;\n disabled?: boolean;\n className?: string;\n expandable?: boolean;\n}\n\nconst Bubble = React.forwardRef<HTMLDivElement, BubbleProps>(({\n variant,\n className,\n children,\n disabled,\n expandable,\n ...props\n}, ref) => (\n <div\n ref={ref}\n className={classNames(\n 'pgn__bubble',\n `pgn__bubble-${variant}`,\n className,\n { disabled, expandable },\n )}\n {...props}\n >\n {children}\n </div>\n));\n\nBubble.propTypes = {\n /** Specifies contents of the component. */\n children: PropTypes.node,\n /** The `Bubble` style variant to use. */\n variant: PropTypes.oneOf(STYLE_VARIANTS),\n /** Activates disabled variant. */\n disabled: PropTypes.bool,\n /** A class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies whether to add padding to the `Bubble` or not. */\n expandable: PropTypes.bool,\n};\n\nBubble.defaultProps = {\n children: null,\n variant: 'primary',\n disabled: false,\n className: undefined,\n expandable: false,\n};\n\nexport default Bubble;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,MAAMC,cAAc,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAU;AAY1E,MAAMC,MAAM,gBAAGJ,KAAK,CAACK,UAAU,CAA8B,CAAAC,IAAA,EAO1DC,GAAG;EAAA,IAPwD;IAC5DC,OAAO;IACPC,SAAS;IACTC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACV,GAAGC;EACL,CAAC,GAAAP,IAAA;EAAA,oBACCN,KAAA,CAAAc,aAAA;IACEP,GAAG,EAAEA,GAAI;IACTE,SAAS,EAAEP,UAAU,CACnB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","STYLE_VARIANTS","Bubble","forwardRef","_ref","ref","variant","className","children","disabled","expandable","props","createElement","propTypes","node","oneOf","bool","string","defaultProps","undefined"],"sources":["../../src/Bubble/index.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst STYLE_VARIANTS = ['primary', 'success', 'error', 'warning'] as const;\n\nexport type BubbleVariant = typeof STYLE_VARIANTS[number];\n\nexport interface BubbleProps {\n children: React.ReactNode;\n variant?: BubbleVariant;\n disabled?: boolean;\n className?: string;\n expandable?: boolean;\n}\n\nconst Bubble = React.forwardRef<HTMLDivElement, BubbleProps>(({\n variant,\n className,\n children,\n disabled,\n expandable,\n ...props\n}, ref) => (\n <div\n ref={ref}\n className={classNames(\n 'pgn__bubble',\n `pgn__bubble-${variant}`,\n className,\n { disabled, expandable },\n )}\n {...props}\n >\n {children}\n </div>\n));\n\nBubble.propTypes = {\n /** Specifies contents of the component. */\n // @ts-ignore\n children: PropTypes.node,\n /** The `Bubble` style variant to use. */\n variant: PropTypes.oneOf(STYLE_VARIANTS),\n /** Activates disabled variant. */\n disabled: PropTypes.bool,\n /** A class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies whether to add padding to the `Bubble` or not. */\n expandable: PropTypes.bool,\n};\n\nBubble.defaultProps = {\n children: null,\n variant: 'primary',\n disabled: false,\n className: undefined,\n expandable: false,\n};\n\nexport default Bubble;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,MAAMC,cAAc,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAU;AAY1E,MAAMC,MAAM,gBAAGJ,KAAK,CAACK,UAAU,CAA8B,CAAAC,IAAA,EAO1DC,GAAG;EAAA,IAPwD;IAC5DC,OAAO;IACPC,SAAS;IACTC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACV,GAAGC;EACL,CAAC,GAAAP,IAAA;EAAA,oBACCN,KAAA,CAAAc,aAAA;IACEP,GAAG,EAAEA,GAAI;IACTE,SAAS,EAAEP,UAAU,CACnB,aAAa,EACb,eAAeM,OAAO,EAAE,EACxBC,SAAS,EACT;MAAEE,QAAQ;MAAEC;IAAW,CACzB,CAAE;IAAA,GACEC;EAAK,GAERH,QACE,CAAC;AAAA,CACP,CAAC;AAEFN,MAAM,CAACW,SAAS,GAAG;EACjB;EACA;EACAL,QAAQ,EAAET,SAAS,CAACe,IAAI;EACxB;EACAR,OAAO,EAAEP,SAAS,CAACgB,KAAK,CAACd,cAAc,CAAC;EACxC;EACAQ,QAAQ,EAAEV,SAAS,CAACiB,IAAI;EACxB;EACAT,SAAS,EAAER,SAAS,CAACkB,MAAM;EAC3B;EACAP,UAAU,EAAEX,SAAS,CAACiB;AACxB,CAAC;AAEDd,MAAM,CAACgB,YAAY,GAAG;EACpBV,QAAQ,EAAE,IAAI;EACdF,OAAO,EAAE,SAAS;EAClBG,QAAQ,EAAE,KAAK;EACfF,SAAS,EAAEY,SAAS;EACpBT,UAAU,EAAE;AACd,CAAC;AAED,eAAeR,MAAM","ignoreList":[]}
|
package/dist/Bubble/index.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@import "variables";
|
|
2
3
|
|
|
3
4
|
.pgn__bubble {
|
|
@@ -12,8 +13,8 @@
|
|
|
12
13
|
|
|
13
14
|
@each $name, $colors in $bubble-variants {
|
|
14
15
|
&.pgn__bubble-#{$name} {
|
|
15
|
-
background-color: map
|
|
16
|
-
color: map
|
|
16
|
+
background-color: map.get($colors, "background-color");
|
|
17
|
+
color: map.get($colors, "color");
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classNames","PropTypes","withDeprecatedProps","DeprTypes","DeprecatedButton","Component","constructor","props","onBlur","onKeyDown","bind","onClick","setRefs","e","buttonRef","focus","input","inputRef","render","buttonType","className","children","isClose","type","other","createElement","undefined","close","ref","buttonPropTypes","string","node","isRequired","oneOfType","func","shape","current","instanceOf","element","bool","variant","oneOf","propTypes","defaultProps","label","deprType","MOVED","newName","FORMAT","expect","value","transform","Array","isArray","join","message"],"sources":["../../../src/Button/deprecated/index.jsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n\nimport withDeprecatedProps, { DeprTypes } from '../../withDeprecatedProps';\n\nclass DeprecatedButton extends React.Component {\n constructor(props) {\n super(props);\n\n const {\n onBlur,\n onKeyDown,\n } = props;\n\n this.onBlur = onBlur.bind(this);\n this.onKeyDown = onKeyDown.bind(this);\n this.onClick = this.onClick.bind(this);\n this.setRefs = this.setRefs.bind(this);\n }\n\n /*\n The button component is given focus explicitly in its onClick to account\n for the fact that an HTML <button> element in Firefox and Safari does not get\n focus on onClick.\n\n See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button.\n */\n onClick(e) {\n this.buttonRef.focus();\n this.props.onClick(e);\n }\n\n /*\n The button component needs a ref to itself to be able to force\n focus in its onClick function (buttonRef). It also needs to accept\n a callback function from parent components to give those parents\n a reference to their child button (e.g. for the modal component).\n Therefore, both have been wrapped in a function bound on the class,\n since one cannot set two ref attributes on a component.\n */\n setRefs(input) {\n this.buttonRef = input;\n this.props.inputRef(input);\n }\n\n render() {\n const {\n buttonType,\n className,\n children,\n isClose,\n type,\n /* inputRef is not used directly in the render, but it needs to be assigned\n here to prevent it from being passed to the HTML button component as part\n of other.\n */\n inputRef,\n ...other\n } = this.props;\n\n return (\n <button\n {...other}\n className={classNames([\n 'btn',\n className,\n ], {\n [`btn-${buttonType}`]: buttonType !== undefined,\n }, {\n close: isClose,\n })}\n onBlur={this.onBlur}\n onClick={this.onClick}\n onKeyDown={this.onKeyDown}\n // eslint-disable-next-line react/button-has-type\n type={type}\n ref={this.setRefs}\n\n >\n {children}\n </button>\n );\n }\n}\n\nexport const buttonPropTypes = {\n /** Used to determine the type of button to be rendered. See [Bootstrap's buttons documentation](https://getbootstrap.com/docs/4.0/components/buttons/) for a list of applicable button types. For example, `buttonType=\"light\"`. The default is `undefined`. */\n buttonType: PropTypes.string,\n /** Specifies Bootstrap class names to apply to the button. See [Bootstrap's buttons documentation](https://getbootstrap.com/docs/4.0/components/buttons/) for a list of applicable class names. The default is an empty array. */\n className: PropTypes.string,\n /** Specifies the text that is displayed within the button. */\n children: PropTypes.node.isRequired,\n // eslint-disable-next-line max-len\n /** A function that defines a reference for the button. An example `inputRef` from the calling component could look something like: `inputRef={(input) => { this.button = input; }}`. The default is an empty function. */\n inputRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.instanceOf(PropTypes.element) }),\n ]),\n /** Used to determine if the button is a \"Close\" style button to leverage bootstrap styling. Example use case is with the Status Alert [dismiss button](https://getbootstrap.com/docs/4.0/components/alerts/#dismissing). The default is false. */\n isClose: PropTypes.bool,\n // eslint-disable-next-line max-len\n /** A function that would specify what the button should do when the `onBlur` event is triggered. For example, the button could change in color or `buttonType` when focus is changed. The default is an empty function. */\n onBlur: PropTypes.func,\n // eslint-disable-next-line max-len\n /** A function that would specify what the button should do when the `onClick` event is triggered. For example, the button could launch a `Modal`. The default is an empty function. */\n onClick: PropTypes.func,\n // eslint-disable-next-line max-len\n /** A function that would specify what the button should do when the `onKeyDown` event is triggered. For example, this could handle using the `Escape` key to trigger the button's action. The default is an empty function. */\n onKeyDown: PropTypes.func,\n /** Used to set the `type` attribute on the `button` tag. The default type is `button`. */\n type: PropTypes.string,\n /** Specifies variant to use. */\n variant: PropTypes.oneOf([\n 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light', 'link', 'outline-primary',\n 'outline-secondary', 'outline-success', 'outline-danger', 'outline-warning', 'outline-info', 'outline-dark', 'outline-light',\n ]),\n};\n\nDeprecatedButton.propTypes = buttonPropTypes;\n\nDeprecatedButton.defaultProps = {\n buttonType: undefined,\n className: undefined,\n inputRef: () => {},\n isClose: false,\n onBlur: () => {},\n onKeyDown: () => {},\n onClick: () => {},\n type: 'button',\n variant: 'outline-primary',\n};\n\nexport default withDeprecatedProps(DeprecatedButton, 'Button', {\n label: {\n deprType: DeprTypes.MOVED,\n newName: 'children',\n },\n className: {\n deprType: DeprTypes.FORMAT,\n expect: value => typeof value === 'string',\n transform: value => (Array.isArray(value) ? value.join(' ') : value),\n message: 'It should be a string.',\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,2BAA2B;AAE1E,MAAMC,gBAAgB,SAASL,KAAK,CAACM,SAAS,CAAC;EAC7CC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,MAAM;MACJC,MAAM;MACNC;IACF,CAAC,GAAGF,KAAK;IAET,IAAI,CAACC,MAAM,GAAGA,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC;IAC/B,IAAI,CAACD,SAAS,GAAGA,SAAS,CAACC,IAAI,CAAC,IAAI,CAAC;IACrC,IAAI,CAACC,OAAO,GAAG,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAC;IACtC,IAAI,CAACE,OAAO,GAAG,IAAI,CAACA,OAAO,CAACF,IAAI,CAAC,IAAI,CAAC;EACxC;;EAEA;AACF;AACA;AACA;AACA;AACA;EAEEC,OAAOA,CAACE,CAAC,EAAE;IACT,IAAI,CAACC,SAAS,CAACC,KAAK,CAAC,CAAC;IACtB,IAAI,CAACR,KAAK,CAACI,OAAO,CAACE,CAAC,CAAC;EACvB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACED,OAAOA,CAACI,KAAK,EAAE;IACb,IAAI,CAACF,SAAS,GAAGE,KAAK;IACtB,IAAI,CAACT,KAAK,CAACU,QAAQ,CAACD,KAAK,CAAC;EAC5B;EAEAE,MAAMA,CAAA,EAAG;IACP,MAAM;MACJC,UAAU;MACVC,SAAS;MACTC,QAAQ;MACRC,OAAO;MACPC,IAAI;MACJ;AACN;AACA;AACA;MACMN,QAAQ;MACR,GAAGO;IACL,CAAC,GAAG,IAAI,CAACjB,KAAK;IAEd,oBACER,KAAA,CAAA0B,aAAA;MAAA,GACMD,KAAK;MACTJ,SAAS,EAAEpB,UAAU,CAAC,CACpB,KAAK,EACLoB,SAAS,CACV,EAAE;QACD,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classNames","PropTypes","withDeprecatedProps","DeprTypes","DeprecatedButton","Component","constructor","props","onBlur","onKeyDown","bind","onClick","setRefs","e","buttonRef","focus","input","inputRef","render","buttonType","className","children","isClose","type","other","createElement","undefined","close","ref","buttonPropTypes","string","node","isRequired","oneOfType","func","shape","current","instanceOf","element","bool","variant","oneOf","propTypes","defaultProps","label","deprType","MOVED","newName","FORMAT","expect","value","transform","Array","isArray","join","message"],"sources":["../../../src/Button/deprecated/index.jsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n\nimport withDeprecatedProps, { DeprTypes } from '../../withDeprecatedProps';\n\nclass DeprecatedButton extends React.Component {\n constructor(props) {\n super(props);\n\n const {\n onBlur,\n onKeyDown,\n } = props;\n\n this.onBlur = onBlur.bind(this);\n this.onKeyDown = onKeyDown.bind(this);\n this.onClick = this.onClick.bind(this);\n this.setRefs = this.setRefs.bind(this);\n }\n\n /*\n The button component is given focus explicitly in its onClick to account\n for the fact that an HTML <button> element in Firefox and Safari does not get\n focus on onClick.\n\n See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button.\n */\n onClick(e) {\n this.buttonRef.focus();\n this.props.onClick(e);\n }\n\n /*\n The button component needs a ref to itself to be able to force\n focus in its onClick function (buttonRef). It also needs to accept\n a callback function from parent components to give those parents\n a reference to their child button (e.g. for the modal component).\n Therefore, both have been wrapped in a function bound on the class,\n since one cannot set two ref attributes on a component.\n */\n setRefs(input) {\n this.buttonRef = input;\n this.props.inputRef(input);\n }\n\n render() {\n const {\n buttonType,\n className,\n children,\n isClose,\n type,\n /* inputRef is not used directly in the render, but it needs to be assigned\n here to prevent it from being passed to the HTML button component as part\n of other.\n */\n inputRef,\n ...other\n } = this.props;\n\n return (\n <button\n {...other}\n className={classNames([\n 'btn',\n className,\n ], {\n [`btn-${buttonType}`]: buttonType !== undefined,\n }, {\n close: isClose,\n })}\n onBlur={this.onBlur}\n onClick={this.onClick}\n onKeyDown={this.onKeyDown}\n // eslint-disable-next-line react/button-has-type\n type={type}\n ref={this.setRefs}\n\n >\n {children}\n </button>\n );\n }\n}\n\nexport const buttonPropTypes = {\n /** Used to determine the type of button to be rendered. See [Bootstrap's buttons documentation](https://getbootstrap.com/docs/4.0/components/buttons/) for a list of applicable button types. For example, `buttonType=\"light\"`. The default is `undefined`. */\n buttonType: PropTypes.string,\n /** Specifies Bootstrap class names to apply to the button. See [Bootstrap's buttons documentation](https://getbootstrap.com/docs/4.0/components/buttons/) for a list of applicable class names. The default is an empty array. */\n className: PropTypes.string,\n /** Specifies the text that is displayed within the button. */\n children: PropTypes.node.isRequired,\n // eslint-disable-next-line max-len\n /** A function that defines a reference for the button. An example `inputRef` from the calling component could look something like: `inputRef={(input) => { this.button = input; }}`. The default is an empty function. */\n inputRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.instanceOf(PropTypes.element) }),\n ]),\n /** Used to determine if the button is a \"Close\" style button to leverage bootstrap styling. Example use case is with the Status Alert [dismiss button](https://getbootstrap.com/docs/4.0/components/alerts/#dismissing). The default is false. */\n isClose: PropTypes.bool,\n // eslint-disable-next-line max-len\n /** A function that would specify what the button should do when the `onBlur` event is triggered. For example, the button could change in color or `buttonType` when focus is changed. The default is an empty function. */\n onBlur: PropTypes.func,\n // eslint-disable-next-line max-len\n /** A function that would specify what the button should do when the `onClick` event is triggered. For example, the button could launch a `Modal`. The default is an empty function. */\n onClick: PropTypes.func,\n // eslint-disable-next-line max-len\n /** A function that would specify what the button should do when the `onKeyDown` event is triggered. For example, this could handle using the `Escape` key to trigger the button's action. The default is an empty function. */\n onKeyDown: PropTypes.func,\n /** Used to set the `type` attribute on the `button` tag. The default type is `button`. */\n type: PropTypes.string,\n /** Specifies variant to use. */\n variant: PropTypes.oneOf([\n 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light', 'link', 'outline-primary',\n 'outline-secondary', 'outline-success', 'outline-danger', 'outline-warning', 'outline-info', 'outline-dark', 'outline-light',\n ]),\n};\n\nDeprecatedButton.propTypes = buttonPropTypes;\n\nDeprecatedButton.defaultProps = {\n buttonType: undefined,\n className: undefined,\n inputRef: () => {},\n isClose: false,\n onBlur: () => {},\n onKeyDown: () => {},\n onClick: () => {},\n type: 'button',\n variant: 'outline-primary',\n};\n\nexport default withDeprecatedProps(DeprecatedButton, 'Button', {\n label: {\n deprType: DeprTypes.MOVED,\n newName: 'children',\n },\n className: {\n deprType: DeprTypes.FORMAT,\n expect: value => typeof value === 'string',\n transform: value => (Array.isArray(value) ? value.join(' ') : value),\n message: 'It should be a string.',\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,2BAA2B;AAE1E,MAAMC,gBAAgB,SAASL,KAAK,CAACM,SAAS,CAAC;EAC7CC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,MAAM;MACJC,MAAM;MACNC;IACF,CAAC,GAAGF,KAAK;IAET,IAAI,CAACC,MAAM,GAAGA,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC;IAC/B,IAAI,CAACD,SAAS,GAAGA,SAAS,CAACC,IAAI,CAAC,IAAI,CAAC;IACrC,IAAI,CAACC,OAAO,GAAG,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAC;IACtC,IAAI,CAACE,OAAO,GAAG,IAAI,CAACA,OAAO,CAACF,IAAI,CAAC,IAAI,CAAC;EACxC;;EAEA;AACF;AACA;AACA;AACA;AACA;EAEEC,OAAOA,CAACE,CAAC,EAAE;IACT,IAAI,CAACC,SAAS,CAACC,KAAK,CAAC,CAAC;IACtB,IAAI,CAACR,KAAK,CAACI,OAAO,CAACE,CAAC,CAAC;EACvB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACED,OAAOA,CAACI,KAAK,EAAE;IACb,IAAI,CAACF,SAAS,GAAGE,KAAK;IACtB,IAAI,CAACT,KAAK,CAACU,QAAQ,CAACD,KAAK,CAAC;EAC5B;EAEAE,MAAMA,CAAA,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@import "variables";
|
|
2
3
|
@import "~bootstrap/scss/button-group";
|
|
3
4
|
|
|
4
5
|
@mixin button-variant(
|
|
5
|
-
$background, $border, $hover-background:
|
|
6
|
-
$hover-border:
|
|
7
|
-
$active-border:
|
|
6
|
+
$background, $border, $hover-background: color.adjust($background, $lightness: -7.5%),
|
|
7
|
+
$hover-border: color.adjust($border, $lightness: -10%), $active-background: color.adjust($background, $lightness: -10%),
|
|
8
|
+
$active-border: color.adjust($border, $lightness: -12.5%), $color: color-yiq($background), $hover-color: color-yiq($hover-background),
|
|
8
9
|
$active-color: color-yiq($active-background)
|
|
9
10
|
) {
|
|
10
11
|
color: $color;
|
|
@@ -36,8 +37,8 @@
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
&:not(:disabled
|
|
40
|
-
&:not(:disabled
|
|
40
|
+
&:not(:disabled, .disabled):active,
|
|
41
|
+
&:not(:disabled, .disabled).active,
|
|
41
42
|
.show > &.dropdown-toggle {
|
|
42
43
|
color: $active-color;
|
|
43
44
|
background-color: $active-background;
|
|
@@ -71,8 +72,8 @@
|
|
|
71
72
|
border-color: $color;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
&:not(:disabled
|
|
75
|
-
&:not(:disabled
|
|
75
|
+
&:not(:disabled, .disabled):active,
|
|
76
|
+
&:not(:disabled, .disabled).active,
|
|
76
77
|
.show > &.dropdown-toggle {
|
|
77
78
|
color: color-yiq($active-background);
|
|
78
79
|
background-color: $active-background;
|
|
@@ -109,10 +110,10 @@
|
|
|
109
110
|
border-color: transparent;
|
|
110
111
|
background-color: $background;
|
|
111
112
|
|
|
112
|
-
&:not(:disabled
|
|
113
|
+
&:not(:disabled, .disabled) {
|
|
113
114
|
@include hover {
|
|
114
|
-
color:
|
|
115
|
-
background-color:
|
|
115
|
+
color: color.adjust($color, $lightness: -7.5%);
|
|
116
|
+
background-color: color.adjust($background, $lightness: -7.5%);
|
|
116
117
|
border-color: transparent;
|
|
117
118
|
}
|
|
118
119
|
}
|
|
@@ -123,10 +124,10 @@
|
|
|
123
124
|
background-color: $background;
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
&:not(:disabled
|
|
127
|
-
&:not(:disabled
|
|
127
|
+
&:not(:disabled, .disabled):active,
|
|
128
|
+
&:not(:disabled, .disabled).active,
|
|
128
129
|
.show > &.dropdown-toggle {
|
|
129
|
-
color:
|
|
130
|
+
color: color.adjust($color, $lightness: -10%);
|
|
130
131
|
background: #EEEEEE;
|
|
131
132
|
}
|
|
132
133
|
}
|
|
@@ -256,10 +257,10 @@ fieldset:disabled a.btn {
|
|
|
256
257
|
$active-border: theme-color($color, "active");
|
|
257
258
|
|
|
258
259
|
// Defaults
|
|
259
|
-
$hover-background:
|
|
260
|
-
$hover-border:
|
|
261
|
-
$active-background:
|
|
262
|
-
$active-border:
|
|
260
|
+
$hover-background: color.adjust($background, $lightness: -7.5%) !default;
|
|
261
|
+
$hover-border: color.adjust($border, $lightness: -10%) !default;
|
|
262
|
+
$active-background: color.adjust($background, $lightness: -10%) !default;
|
|
263
|
+
$active-border: color.adjust($border, $lightness: -12.5%) !default;
|
|
263
264
|
|
|
264
265
|
@include button-variant(
|
|
265
266
|
$background,
|
|
@@ -476,7 +477,7 @@ input[type="button"] {
|
|
|
476
477
|
}
|
|
477
478
|
}
|
|
478
479
|
|
|
479
|
-
[dir="rtl"] .btn-group > .btn:not(:last-child
|
|
480
|
+
[dir="rtl"] .btn-group > .btn:not(:last-child, .dropdown-toggle),
|
|
480
481
|
[dir="rtl"] .btn-group > .btn-group:not(:last-child) > .btn {
|
|
481
482
|
border-top-left-radius: 0;
|
|
482
483
|
border-bottom-left-radius: 0;
|
|
@@ -8,7 +8,7 @@ const getFormattedTitle = title => {
|
|
|
8
8
|
if (!title) {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
-
if (
|
|
11
|
+
if (/*#__PURE__*/isValidElement(title)) {
|
|
12
12
|
return title;
|
|
13
13
|
}
|
|
14
14
|
return /*#__PURE__*/React.createElement(CardCarouselTitle, null, title);
|
|
@@ -17,7 +17,7 @@ const getFormattedSubtitle = subtitle => {
|
|
|
17
17
|
if (!subtitle) {
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
-
if (
|
|
20
|
+
if (/*#__PURE__*/isValidElement(subtitle)) {
|
|
21
21
|
return subtitle;
|
|
22
22
|
}
|
|
23
23
|
return /*#__PURE__*/React.createElement(CardCarouselSubtitle, null, subtitle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardCarouselHeader.js","names":["React","useContext","isValidElement","PropTypes","CardCarouselTitle","CardCarouselSubtitle","DefaultCardCarouselControls","CardCarouselContext","getFormattedTitle","title","createElement","getFormattedSubtitle","subtitle","CardCarouselHeader","_ref","CardCarouselControls","customCardCarouselControls","carouselTitle","carouselSubtitle","className","propTypes","node","defaultProps","undefined"],"sources":["../../../src/Card/CardCarousel/CardCarouselHeader.jsx"],"sourcesContent":["import React, { useContext, isValidElement } from 'react';\nimport PropTypes from 'prop-types';\nimport CardCarouselTitle from './CardCarouselTitle';\nimport CardCarouselSubtitle from './CardCarouselSubtitle';\nimport DefaultCardCarouselControls from './CardCarouselControls';\nimport { CardCarouselContext } from './CardCarouselProvider';\n\nconst getFormattedTitle = (title) => {\n if (!title) {\n return null;\n }\n if (isValidElement(title)) {\n return title;\n }\n return <CardCarouselTitle>{title}</CardCarouselTitle>;\n};\n\nconst getFormattedSubtitle = (subtitle) => {\n if (!subtitle) {\n return null;\n }\n if (isValidElement(subtitle)) {\n return subtitle;\n }\n return <CardCarouselSubtitle>{subtitle}</CardCarouselSubtitle>;\n};\n\nfunction CardCarouselHeader({ title, subtitle }) {\n const { CardCarouselControls: customCardCarouselControls } = useContext(CardCarouselContext);\n const CardCarouselControls = customCardCarouselControls || DefaultCardCarouselControls;\n\n const carouselTitle = getFormattedTitle(title);\n const carouselSubtitle = getFormattedSubtitle(subtitle);\n\n return (\n <div className=\"pgn__card-carousel-header\">\n <div>\n {carouselTitle}\n {carouselSubtitle}\n </div>\n <CardCarouselControls />\n </div>\n );\n}\n\nCardCarouselHeader.propTypes = {\n title: PropTypes.node,\n subtitle: PropTypes.node,\n};\n\nCardCarouselHeader.defaultProps = {\n title: undefined,\n subtitle: undefined,\n};\n\nexport default CardCarouselHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,cAAc,QAAQ,OAAO;AACzD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,2BAA2B,MAAM,wBAAwB;AAChE,SAASC,mBAAmB,QAAQ,wBAAwB;AAE5D,MAAMC,iBAAiB,GAAIC,KAAK,IAAK;EACnC,IAAI,CAACA,KAAK,EAAE;IACV,OAAO,IAAI;EACb;EACA,
|
|
1
|
+
{"version":3,"file":"CardCarouselHeader.js","names":["React","useContext","isValidElement","PropTypes","CardCarouselTitle","CardCarouselSubtitle","DefaultCardCarouselControls","CardCarouselContext","getFormattedTitle","title","createElement","getFormattedSubtitle","subtitle","CardCarouselHeader","_ref","CardCarouselControls","customCardCarouselControls","carouselTitle","carouselSubtitle","className","propTypes","node","defaultProps","undefined"],"sources":["../../../src/Card/CardCarousel/CardCarouselHeader.jsx"],"sourcesContent":["import React, { useContext, isValidElement } from 'react';\nimport PropTypes from 'prop-types';\nimport CardCarouselTitle from './CardCarouselTitle';\nimport CardCarouselSubtitle from './CardCarouselSubtitle';\nimport DefaultCardCarouselControls from './CardCarouselControls';\nimport { CardCarouselContext } from './CardCarouselProvider';\n\nconst getFormattedTitle = (title) => {\n if (!title) {\n return null;\n }\n if (isValidElement(title)) {\n return title;\n }\n return <CardCarouselTitle>{title}</CardCarouselTitle>;\n};\n\nconst getFormattedSubtitle = (subtitle) => {\n if (!subtitle) {\n return null;\n }\n if (isValidElement(subtitle)) {\n return subtitle;\n }\n return <CardCarouselSubtitle>{subtitle}</CardCarouselSubtitle>;\n};\n\nfunction CardCarouselHeader({ title, subtitle }) {\n const { CardCarouselControls: customCardCarouselControls } = useContext(CardCarouselContext);\n const CardCarouselControls = customCardCarouselControls || DefaultCardCarouselControls;\n\n const carouselTitle = getFormattedTitle(title);\n const carouselSubtitle = getFormattedSubtitle(subtitle);\n\n return (\n <div className=\"pgn__card-carousel-header\">\n <div>\n {carouselTitle}\n {carouselSubtitle}\n </div>\n <CardCarouselControls />\n </div>\n );\n}\n\nCardCarouselHeader.propTypes = {\n title: PropTypes.node,\n subtitle: PropTypes.node,\n};\n\nCardCarouselHeader.defaultProps = {\n title: undefined,\n subtitle: undefined,\n};\n\nexport default CardCarouselHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,cAAc,QAAQ,OAAO;AACzD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,2BAA2B,MAAM,wBAAwB;AAChE,SAASC,mBAAmB,QAAQ,wBAAwB;AAE5D,MAAMC,iBAAiB,GAAIC,KAAK,IAAK;EACnC,IAAI,CAACA,KAAK,EAAE;IACV,OAAO,IAAI;EACb;EACA,iBAAIP,cAAc,CAACO,KAAK,CAAC,EAAE;IACzB,OAAOA,KAAK;EACd;EACA,oBAAOT,KAAA,CAAAU,aAAA,CAACN,iBAAiB,QAAEK,KAAyB,CAAC;AACvD,CAAC;AAED,MAAME,oBAAoB,GAAIC,QAAQ,IAAK;EACzC,IAAI,CAACA,QAAQ,EAAE;IACb,OAAO,IAAI;EACb;EACA,iBAAIV,cAAc,CAACU,QAAQ,CAAC,EAAE;IAC5B,OAAOA,QAAQ;EACjB;EACA,oBAAOZ,KAAA,CAAAU,aAAA,CAACL,oBAAoB,QAAEO,QAA+B,CAAC;AAChE,CAAC;AAED,SAASC,kBAAkBA,CAAAC,IAAA,EAAsB;EAAA,IAArB;IAAEL,KAAK;IAAEG;EAAS,CAAC,GAAAE,IAAA;EAC7C,MAAM;IAAEC,oBAAoB,EAAEC;EAA2B,CAAC,GAAGf,UAAU,CAACM,mBAAmB,CAAC;EAC5F,MAAMQ,oBAAoB,GAAGC,0BAA0B,IAAIV,2BAA2B;EAEtF,MAAMW,aAAa,GAAGT,iBAAiB,CAACC,KAAK,CAAC;EAC9C,MAAMS,gBAAgB,GAAGP,oBAAoB,CAACC,QAAQ,CAAC;EAEvD,oBACEZ,KAAA,CAAAU,aAAA;IAAKS,SAAS,EAAC;EAA2B,gBACxCnB,KAAA,CAAAU,aAAA,cACGO,aAAa,EACbC,gBACE,CAAC,eACNlB,KAAA,CAAAU,aAAA,CAACK,oBAAoB,MAAE,CACpB,CAAC;AAEV;AAEAF,kBAAkB,CAACO,SAAS,GAAG;EAC7BX,KAAK,EAAEN,SAAS,CAACkB,IAAI;EACrBT,QAAQ,EAAET,SAAS,CAACkB;AACtB,CAAC;AAEDR,kBAAkB,CAACS,YAAY,GAAG;EAChCb,KAAK,EAAEc,SAAS;EAChBX,QAAQ,EAAEW;AACZ,CAAC;AAED,eAAeV,kBAAkB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardFooter.js","names":["React","useContext","PropTypes","classNames","Skeleton","CardContext","IS_LOADING_HEIGHT_VALUE","CardFooter","forwardRef","_ref","ref","children","className","isStacked","textElement","skeletonHeight","skeletonWidth","orientation","cardOrientation","isLoading","footerOrientation","wrapperClassName","textElementClassName","createElement","containerClassName","height","width","propTypes","node","string","bool","oneOf","number","defaultProps","undefined"],"sources":["../../src/Card/CardFooter.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Skeleton from 'react-loading-skeleton';\nimport CardContext from './CardContext';\n\nconst IS_LOADING_HEIGHT_VALUE = 18;\n\nconst CardFooter = React.forwardRef(({\n children,\n className,\n isStacked,\n textElement,\n skeletonHeight,\n skeletonWidth,\n orientation,\n}, ref) => {\n const { orientation: cardOrientation, isLoading } = useContext(CardContext);\n const footerOrientation = orientation || cardOrientation;\n const wrapperClassName = `pgn__card-footer ${footerOrientation}${isStacked ? '-stacked' : ''}`;\n const textElementClassName = `pgn__card-footer-text ${footerOrientation}${isStacked ? '-stacked' : ''}`;\n\n if (isLoading) {\n return (\n <div className={classNames(className, wrapperClassName)}>\n <Skeleton\n containerClassName=\"pgn__card-footer-loader\"\n height={skeletonHeight}\n width={skeletonWidth}\n />\n </div>\n );\n }\n\n return (\n <div className={classNames(className, wrapperClassName)} ref={ref}>\n {textElement && <div className={textElementClassName}>{textElement}</div>}\n {children}\n </div>\n );\n});\n\nCardFooter.propTypes = {\n /** Specifies contents of the component. */\n children: PropTypes.node,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Optional node to display near actions. Should be either a plain text or an element containing text (e.g. link). */\n textElement: PropTypes.node,\n /** Specifies whether to use stacked variant. */\n isStacked: PropTypes.bool,\n /** Specifies which orientation to use. This prop will override context value if provided. */\n orientation: PropTypes.oneOf(['horizontal', 'vertical']),\n /** Specifies height of skeleton in loading state. */\n skeletonHeight: PropTypes.number,\n /** Specifies width of skeleton in loading state. */\n skeletonWidth: PropTypes.number,\n};\n\nCardFooter.defaultProps = {\n children: null,\n className: undefined,\n textElement: undefined,\n isStacked: false,\n orientation: undefined,\n skeletonHeight: IS_LOADING_HEIGHT_VALUE,\n skeletonWidth: undefined,\n};\n\nexport default CardFooter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,WAAW,MAAM,eAAe;AAEvC,MAAMC,uBAAuB,GAAG,EAAE;AAElC,MAAMC,UAAU,gBAAGP,KAAK,CAACQ,UAAU,CAAC,CAAAC,IAAA,EAQjCC,GAAG,KAAK;EAAA,IAR0B;IACnCC,QAAQ;IACRC,SAAS;IACTC,SAAS;IACTC,WAAW;IACXC,cAAc;IACdC,aAAa;IACbC;EACF,CAAC,GAAAR,IAAA;EACC,MAAM;IAAEQ,WAAW,EAAEC,eAAe;IAAEC;EAAU,CAAC,GAAGlB,UAAU,CAACI,WAAW,CAAC;EAC3E,MAAMe,iBAAiB,GAAGH,WAAW,IAAIC,eAAe;EACxD,MAAMG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"CardFooter.js","names":["React","useContext","PropTypes","classNames","Skeleton","CardContext","IS_LOADING_HEIGHT_VALUE","CardFooter","forwardRef","_ref","ref","children","className","isStacked","textElement","skeletonHeight","skeletonWidth","orientation","cardOrientation","isLoading","footerOrientation","wrapperClassName","textElementClassName","createElement","containerClassName","height","width","propTypes","node","string","bool","oneOf","number","defaultProps","undefined"],"sources":["../../src/Card/CardFooter.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Skeleton from 'react-loading-skeleton';\nimport CardContext from './CardContext';\n\nconst IS_LOADING_HEIGHT_VALUE = 18;\n\nconst CardFooter = React.forwardRef(({\n children,\n className,\n isStacked,\n textElement,\n skeletonHeight,\n skeletonWidth,\n orientation,\n}, ref) => {\n const { orientation: cardOrientation, isLoading } = useContext(CardContext);\n const footerOrientation = orientation || cardOrientation;\n const wrapperClassName = `pgn__card-footer ${footerOrientation}${isStacked ? '-stacked' : ''}`;\n const textElementClassName = `pgn__card-footer-text ${footerOrientation}${isStacked ? '-stacked' : ''}`;\n\n if (isLoading) {\n return (\n <div className={classNames(className, wrapperClassName)}>\n <Skeleton\n containerClassName=\"pgn__card-footer-loader\"\n height={skeletonHeight}\n width={skeletonWidth}\n />\n </div>\n );\n }\n\n return (\n <div className={classNames(className, wrapperClassName)} ref={ref}>\n {textElement && <div className={textElementClassName}>{textElement}</div>}\n {children}\n </div>\n );\n});\n\nCardFooter.propTypes = {\n /** Specifies contents of the component. */\n children: PropTypes.node,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Optional node to display near actions. Should be either a plain text or an element containing text (e.g. link). */\n textElement: PropTypes.node,\n /** Specifies whether to use stacked variant. */\n isStacked: PropTypes.bool,\n /** Specifies which orientation to use. This prop will override context value if provided. */\n orientation: PropTypes.oneOf(['horizontal', 'vertical']),\n /** Specifies height of skeleton in loading state. */\n skeletonHeight: PropTypes.number,\n /** Specifies width of skeleton in loading state. */\n skeletonWidth: PropTypes.number,\n};\n\nCardFooter.defaultProps = {\n children: null,\n className: undefined,\n textElement: undefined,\n isStacked: false,\n orientation: undefined,\n skeletonHeight: IS_LOADING_HEIGHT_VALUE,\n skeletonWidth: undefined,\n};\n\nexport default CardFooter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,WAAW,MAAM,eAAe;AAEvC,MAAMC,uBAAuB,GAAG,EAAE;AAElC,MAAMC,UAAU,gBAAGP,KAAK,CAACQ,UAAU,CAAC,CAAAC,IAAA,EAQjCC,GAAG,KAAK;EAAA,IAR0B;IACnCC,QAAQ;IACRC,SAAS;IACTC,SAAS;IACTC,WAAW;IACXC,cAAc;IACdC,aAAa;IACbC;EACF,CAAC,GAAAR,IAAA;EACC,MAAM;IAAEQ,WAAW,EAAEC,eAAe;IAAEC;EAAU,CAAC,GAAGlB,UAAU,CAACI,WAAW,CAAC;EAC3E,MAAMe,iBAAiB,GAAGH,WAAW,IAAIC,eAAe;EACxD,MAAMG,gBAAgB,GAAG,oBAAoBD,iBAAiB,GAAGP,SAAS,GAAG,UAAU,GAAG,EAAE,EAAE;EAC9F,MAAMS,oBAAoB,GAAG,yBAAyBF,iBAAiB,GAAGP,SAAS,GAAG,UAAU,GAAG,EAAE,EAAE;EAEvG,IAAIM,SAAS,EAAE;IACb,o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wardRef((_ref, ref) => {
|
|
|
18
18
|
isLoading
|
|
19
19
|
} = useContext(CardContext);
|
|
20
20
|
const cloneActions = useCallback(Action => {
|
|
21
|
-
if (
|
|
21
|
+
if (/*#__PURE__*/React.isValidElement(Action)) {
|
|
22
22
|
const {
|
|
23
23
|
children
|
|
24
24
|
} = Action.props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.js","names":["React","useCallback","useContext","PropTypes","classNames","Skeleton","CardContext","SKELETON_HEIGHT_VALUE","CardHeader","forwardRef","_ref","ref","actions","className","size","subtitle","title","skeletonHeight","skeletonWidth","isLoading","cloneActions","Action","isValidElement","children","props","addtlActionProps","Array","isArray","map","cloneElement","createElement","containerClassName","height","width","propTypes","node","string","oneOf","number","defaultProps"],"sources":["../../src/Card/CardHeader.jsx"],"sourcesContent":["import React, { useCallback, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Skeleton from 'react-loading-skeleton';\nimport CardContext from './CardContext';\n\nconst SKELETON_HEIGHT_VALUE = 20;\n\nconst CardHeader = React.forwardRef(({\n actions,\n className,\n size,\n subtitle,\n title,\n skeletonHeight,\n skeletonWidth,\n}, ref) => {\n const { isLoading } = useContext(CardContext);\n const cloneActions = useCallback(\n (Action) => {\n if (React.isValidElement(Action)) {\n const { children } = Action.props;\n const addtlActionProps = {\n size,\n children: Array.isArray(children) ? children.map(cloneActions) : cloneActions(children),\n };\n return React.cloneElement(Action, addtlActionProps);\n }\n\n return Action;\n },\n [size],\n );\n\n if (isLoading) {\n return (\n <div className={classNames('pgn__card-header', className)}>\n <Skeleton\n containerClassName=\"pgn__card-header-loader\"\n height={skeletonHeight}\n width={skeletonWidth}\n />\n </div>\n );\n }\n\n return (\n <div className={classNames('pgn__card-header', className)} ref={ref}>\n <div className=\"pgn__card-header-content\">\n {title && <div className={`pgn__card-header-title-${size}`}>{title}</div>}\n {subtitle && <div className={`pgn__card-header-subtitle-${size}`}>{subtitle}</div>}\n </div>\n {actions && (\n <div className=\"pgn__card-header-actions\">\n {size !== 'md' ? cloneActions(actions) : actions}\n </div>\n )}\n </div>\n );\n});\n\nCardHeader.propTypes = {\n /** Optional node to render on the top right of the card header,\n * i.e. ActionRow or a DropdownMenu.\n * */\n actions: PropTypes.node,\n /** The class name for the CardHeader component */\n className: PropTypes.string,\n /** The title for the CardHeader component */\n title: PropTypes.node,\n /** The size of the CardHeader component */\n size: PropTypes.oneOf(['sm', 'md']),\n /** The subtitle of the CardHeader component */\n subtitle: PropTypes.node,\n /** Specifies height of skeleton in loading state. */\n skeletonHeight: PropTypes.number,\n /** Specifies width of skeleton in loading state. */\n skeletonWidth: PropTypes.number,\n};\n\nCardHeader.defaultProps = {\n actions: null,\n className: null,\n size: 'md',\n title: null,\n subtitle: null,\n skeletonHeight: SKELETON_HEIGHT_VALUE,\n skeletonWidth: null,\n};\n\nexport default CardHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,UAAU,QAAQ,OAAO;AACtD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,WAAW,MAAM,eAAe;AAEvC,MAAMC,qBAAqB,GAAG,EAAE;AAEhC,MAAMC,UAAU,gBAAGR,KAAK,CAACS,UAAU,CAAC,CAAAC,IAAA,EAQjCC,GAAG,KAAK;EAAA,IAR0B;IACnCC,OAAO;IACPC,SAAS;IACTC,IAAI;IACJC,QAAQ;IACRC,KAAK;IACLC,cAAc;IACdC;EACF,CAAC,GAAAR,IAAA;EACC,MAAM;IAAES;EAAU,CAAC,GAAGjB,UAAU,CAACI,WAAW,CAAC;EAC7C,MAAMc,YAAY,GAAGnB,WAAW,CAC7BoB,MAAM,IAAK;IACV,
|
|
1
|
+
{"version":3,"file":"CardHeader.js","names":["React","useCallback","useContext","PropTypes","classNames","Skeleton","CardContext","SKELETON_HEIGHT_VALUE","CardHeader","forwardRef","_ref","ref","actions","className","size","subtitle","title","skeletonHeight","skeletonWidth","isLoading","cloneActions","Action","isValidElement","children","props","addtlActionProps","Array","isArray","map","cloneElement","createElement","containerClassName","height","width","propTypes","node","string","oneOf","number","defaultProps"],"sources":["../../src/Card/CardHeader.jsx"],"sourcesContent":["import React, { useCallback, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Skeleton from 'react-loading-skeleton';\nimport CardContext from './CardContext';\n\nconst SKELETON_HEIGHT_VALUE = 20;\n\nconst CardHeader = React.forwardRef(({\n actions,\n className,\n size,\n subtitle,\n title,\n skeletonHeight,\n skeletonWidth,\n}, ref) => {\n const { isLoading } = useContext(CardContext);\n const cloneActions = useCallback(\n (Action) => {\n if (React.isValidElement(Action)) {\n const { children } = Action.props;\n const addtlActionProps = {\n size,\n children: Array.isArray(children) ? children.map(cloneActions) : cloneActions(children),\n };\n return React.cloneElement(Action, addtlActionProps);\n }\n\n return Action;\n },\n [size],\n );\n\n if (isLoading) {\n return (\n <div className={classNames('pgn__card-header', className)}>\n <Skeleton\n containerClassName=\"pgn__card-header-loader\"\n height={skeletonHeight}\n width={skeletonWidth}\n />\n </div>\n );\n }\n\n return (\n <div className={classNames('pgn__card-header', className)} ref={ref}>\n <div className=\"pgn__card-header-content\">\n {title && <div className={`pgn__card-header-title-${size}`}>{title}</div>}\n {subtitle && <div className={`pgn__card-header-subtitle-${size}`}>{subtitle}</div>}\n </div>\n {actions && (\n <div className=\"pgn__card-header-actions\">\n {size !== 'md' ? cloneActions(actions) : actions}\n </div>\n )}\n </div>\n );\n});\n\nCardHeader.propTypes = {\n /** Optional node to render on the top right of the card header,\n * i.e. ActionRow or a DropdownMenu.\n * */\n actions: PropTypes.node,\n /** The class name for the CardHeader component */\n className: PropTypes.string,\n /** The title for the CardHeader component */\n title: PropTypes.node,\n /** The size of the CardHeader component */\n size: PropTypes.oneOf(['sm', 'md']),\n /** The subtitle of the CardHeader component */\n subtitle: PropTypes.node,\n /** Specifies height of skeleton in loading state. */\n skeletonHeight: PropTypes.number,\n /** Specifies width of skeleton in loading state. */\n skeletonWidth: PropTypes.number,\n};\n\nCardHeader.defaultProps = {\n actions: null,\n className: null,\n size: 'md',\n title: null,\n subtitle: null,\n skeletonHeight: SKELETON_HEIGHT_VALUE,\n skeletonWidth: null,\n};\n\nexport default CardHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,UAAU,QAAQ,OAAO;AACtD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,WAAW,MAAM,eAAe;AAEvC,MAAMC,qBAAqB,GAAG,EAAE;AAEhC,MAAMC,UAAU,gBAAGR,KAAK,CAACS,UAAU,CAAC,CAAAC,IAAA,EAQjCC,GAAG,KAAK;EAAA,IAR0B;IACnCC,OAAO;IACPC,SAAS;IACTC,IAAI;IACJC,QAAQ;IACRC,KAAK;IACLC,cAAc;IACdC;EACF,CAAC,GAAAR,IAAA;EACC,MAAM;IAAES;EAAU,CAAC,GAAGjB,UAAU,CAACI,WAAW,CAAC;EAC7C,MAAMc,YAAY,GAAGnB,WAAW,CAC7BoB,MAAM,IAAK;IACV,iBAAIrB,KAAK,CAACsB,cAAc,CAACD,MAAM,CAAC,EAAE;MAChC,MAAM;QAAEE;MAAS,CAAC,GAAGF,MAAM,CAACG,KAAK;MACjC,MAAMC,gBAAgB,GAAG;QACvBX,IAAI;QACJS,QAAQ,EAAEG,KAAK,CAACC,OAAO,CAACJ,QAAQ,CAAC,GAAGA,QAAQ,CAACK,GAAG,CAACR,YAAY,CAAC,GAAGA,YAAY,CAACG,QAAQ;MACxF,CAAC;MACD,oBAAOvB,KAAK,CAAC6B,YAAY,CAACR,MAAM,EAAEI,gBAAgB,CAAC;IACrD;IAEA,OAAOJ,MAAM;EACf,CAAC,EACD,CAACP,IAAI,CACP,CAAC;EAED,IAAIK,SAAS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AAU,CAAC+B,YAAY,GAAG;EACxB3B,OAAO,EAAE,IAAI;EACbC,SAAS,EAAE,IAAI;EACfC,IAAI,EAAE,IAAI;EACVE,KAAK,EAAE,IAAI;EACXD,QAAQ,EAAE,IAAI;EACdE,cAAc,EAAEV,qBAAqB;EACrCW,aAAa,EAAE;AACjB,CAAC;AAED,eAAeV,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardImageCap.js","names":["React","useContext","useState","PropTypes","classNames","Skeleton","CardContext","cardSrcFallbackImg","SKELETON_HEIGHT_VALUE","LOGO_SKELETON_HEIGHT_VALUE","CardImageCap","forwardRef","_ref","ref","src","fallbackSrc","srcAlt","logoSrc","fallbackLogoSrc","logoAlt","skeletonHeight","skeletonWidth","logoSkeleton","logoSkeletonHeight","logoSkeletonWidth","className","imageLoadingType","orientation","isLoading","showImageCap","setShowImageCap","showLogoCap","setShowLogoCap","wrapperClassName","createElement","containerClassName","height","width","handleSrcFallback","event","altSrc","imageKey","currentTarget","endsWith","show","onError","onLoad","alt","loading","propTypes","string","number","bool","oneOf","defaultProps","undefined"],"sources":["../../src/Card/CardImageCap.jsx"],"sourcesContent":["import React, { useContext, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Skeleton from 'react-loading-skeleton';\nimport CardContext from './CardContext';\nimport { cardSrcFallbackImg } from './CardFallbackDefaultImage';\n\nconst SKELETON_HEIGHT_VALUE = 140;\nconst LOGO_SKELETON_HEIGHT_VALUE = 41;\n\nconst CardImageCap = React.forwardRef(({\n src,\n fallbackSrc,\n srcAlt,\n logoSrc,\n fallbackLogoSrc,\n logoAlt,\n skeletonHeight,\n skeletonWidth,\n logoSkeleton,\n logoSkeletonHeight,\n logoSkeletonWidth,\n className,\n imageLoadingType,\n}, ref) => {\n const { orientation, isLoading } = useContext(CardContext);\n const [showImageCap, setShowImageCap] = useState(false);\n const [showLogoCap, setShowLogoCap] = useState(false);\n\n const wrapperClassName = `pgn__card-wrapper-image-cap ${orientation}`;\n\n if (isLoading) {\n return (\n <div\n className={classNames(wrapperClassName, className)}\n data-testid=\"image-loader-wrapper\"\n >\n <Skeleton\n containerClassName=\"pgn__card-image-cap-loader\"\n height={orientation === 'horizontal' ? '100%' : skeletonHeight}\n width={skeletonWidth}\n />\n {logoSkeleton && (\n <Skeleton\n containerClassName=\"pgn__card-logo-cap\"\n height={logoSkeletonHeight}\n width={logoSkeletonWidth}\n />\n )}\n </div>\n );\n }\n\n const handleSrcFallback = (event, altSrc, imageKey) => {\n const { currentTarget } = event;\n\n if (!altSrc || currentTarget.src.endsWith(altSrc)) {\n if (imageKey === 'imageCap') {\n currentTarget.src = cardSrcFallbackImg;\n } else {\n setShowLogoCap(false);\n }\n\n return;\n }\n\n currentTarget.src = altSrc;\n };\n\n return (\n <div className={classNames(className, wrapperClassName)} ref={ref}>\n {!!src && (\n <img\n className={classNames('pgn__card-image-cap', { show: showImageCap })}\n src={src}\n onError={(event) => handleSrcFallback(event, fallbackSrc, 'imageCap')}\n onLoad={() => setShowImageCap(true)}\n alt={srcAlt}\n loading={imageLoadingType}\n />\n )}\n {!!logoSrc && (\n <img\n className={classNames('pgn__card-logo-cap', { show: showLogoCap })}\n src={logoSrc}\n onError={(event) => handleSrcFallback(event, fallbackLogoSrc, 'logoCap')}\n onLoad={() => setShowLogoCap(true)}\n alt={logoAlt}\n loading={imageLoadingType}\n />\n )}\n </div>\n );\n});\n\nCardImageCap.propTypes = {\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies image src. */\n src: PropTypes.string,\n /** Specifies fallback image src. */\n fallbackSrc: PropTypes.string,\n /** Specifies image alt text. */\n srcAlt: PropTypes.string,\n /** Specifies logo src to put on top of the image. */\n logoSrc: PropTypes.string,\n /** Specifies fallback image logo src. */\n fallbackLogoSrc: PropTypes.string,\n /** Specifies logo image alt text. */\n logoAlt: PropTypes.string,\n /** Specifies height of Image skeleton in loading state. */\n skeletonHeight: PropTypes.number,\n /** Specifies width of Image skeleton in loading state. */\n skeletonWidth: PropTypes.number,\n /** Specifies whether the cap should be displayed during loading. */\n logoSkeleton: PropTypes.bool,\n /** Specifies height of Logo skeleton in loading state. */\n logoSkeletonHeight: PropTypes.number,\n /** Specifies width of Logo skeleton in loading state. */\n logoSkeletonWidth: PropTypes.number,\n /** Specifies loading type for images */\n imageLoadingType: PropTypes.oneOf(['eager', 'lazy']),\n};\n\nCardImageCap.defaultProps = {\n src: undefined,\n fallbackSrc: cardSrcFallbackImg,\n logoSrc: undefined,\n fallbackLogoSrc: undefined,\n className: undefined,\n srcAlt: undefined,\n logoAlt: undefined,\n skeletonHeight: SKELETON_HEIGHT_VALUE,\n logoSkeleton: false,\n logoSkeletonHeight: LOGO_SKELETON_HEIGHT_VALUE,\n skeletonWidth: undefined,\n logoSkeletonWidth: undefined,\n imageLoadingType: 'eager',\n};\n\nexport default CardImageCap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AACnD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,WAAW,MAAM,eAAe;AACvC,SAASC,kBAAkB,QAAQ,4BAA4B;AAE/D,MAAMC,qBAAqB,GAAG,GAAG;AACjC,MAAMC,0BAA0B,GAAG,EAAE;AAErC,MAAMC,YAAY,gBAAGV,KAAK,CAACW,UAAU,CAAC,CAAAC,IAAA,EAcnCC,GAAG,KAAK;EAAA,IAd4B;IACrCC,GAAG;IACHC,WAAW;IACXC,MAAM;IACNC,OAAO;IACPC,eAAe;IACfC,OAAO;IACPC,cAAc;IACdC,aAAa;IACbC,YAAY;IACZC,kBAAkB;IAClBC,iBAAiB;IACjBC,SAAS;IACTC;EACF,CAAC,GAAAd,IAAA;EACC,MAAM;IAAEe,WAAW;IAAEC;EAAU,CAAC,GAAG3B,UAAU,CAACK,WAAW,CAAC;EAC1D,MAAM,CAACuB,YAAY,EAAEC,eAAe,CAAC,GAAG5B,QAAQ,CAAC,KAAK,CAAC;EACvD,MAAM,CAAC6B,WAAW,EAAEC,cAAc,CAAC,GAAG9B,QAAQ,CAAC,KAAK,CAAC;EAErD,MAAM+B,gBAAgB,
|
|
1
|
+
{"version":3,"file":"CardImageCap.js","names":["React","useContext","useState","PropTypes","classNames","Skeleton","CardContext","cardSrcFallbackImg","SKELETON_HEIGHT_VALUE","LOGO_SKELETON_HEIGHT_VALUE","CardImageCap","forwardRef","_ref","ref","src","fallbackSrc","srcAlt","logoSrc","fallbackLogoSrc","logoAlt","skeletonHeight","skeletonWidth","logoSkeleton","logoSkeletonHeight","logoSkeletonWidth","className","imageLoadingType","orientation","isLoading","showImageCap","setShowImageCap","showLogoCap","setShowLogoCap","wrapperClassName","createElement","containerClassName","height","width","handleSrcFallback","event","altSrc","imageKey","currentTarget","endsWith","show","onError","onLoad","alt","loading","propTypes","string","number","bool","oneOf","defaultProps","undefined"],"sources":["../../src/Card/CardImageCap.jsx"],"sourcesContent":["import React, { useContext, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Skeleton from 'react-loading-skeleton';\nimport CardContext from './CardContext';\nimport { cardSrcFallbackImg } from './CardFallbackDefaultImage';\n\nconst SKELETON_HEIGHT_VALUE = 140;\nconst LOGO_SKELETON_HEIGHT_VALUE = 41;\n\nconst CardImageCap = React.forwardRef(({\n src,\n fallbackSrc,\n srcAlt,\n logoSrc,\n fallbackLogoSrc,\n logoAlt,\n skeletonHeight,\n skeletonWidth,\n logoSkeleton,\n logoSkeletonHeight,\n logoSkeletonWidth,\n className,\n imageLoadingType,\n}, ref) => {\n const { orientation, isLoading } = useContext(CardContext);\n const [showImageCap, setShowImageCap] = useState(false);\n const [showLogoCap, setShowLogoCap] = useState(false);\n\n const wrapperClassName = `pgn__card-wrapper-image-cap ${orientation}`;\n\n if (isLoading) {\n return (\n <div\n className={classNames(wrapperClassName, className)}\n data-testid=\"image-loader-wrapper\"\n >\n <Skeleton\n containerClassName=\"pgn__card-image-cap-loader\"\n height={orientation === 'horizontal' ? '100%' : skeletonHeight}\n width={skeletonWidth}\n />\n {logoSkeleton && (\n <Skeleton\n containerClassName=\"pgn__card-logo-cap\"\n height={logoSkeletonHeight}\n width={logoSkeletonWidth}\n />\n )}\n </div>\n );\n }\n\n const handleSrcFallback = (event, altSrc, imageKey) => {\n const { currentTarget } = event;\n\n if (!altSrc || currentTarget.src.endsWith(altSrc)) {\n if (imageKey === 'imageCap') {\n currentTarget.src = cardSrcFallbackImg;\n } else {\n setShowLogoCap(false);\n }\n\n return;\n }\n\n currentTarget.src = altSrc;\n };\n\n return (\n <div className={classNames(className, wrapperClassName)} ref={ref}>\n {!!src && (\n <img\n className={classNames('pgn__card-image-cap', { show: showImageCap })}\n src={src}\n onError={(event) => handleSrcFallback(event, fallbackSrc, 'imageCap')}\n onLoad={() => setShowImageCap(true)}\n alt={srcAlt}\n loading={imageLoadingType}\n />\n )}\n {!!logoSrc && (\n <img\n className={classNames('pgn__card-logo-cap', { show: showLogoCap })}\n src={logoSrc}\n onError={(event) => handleSrcFallback(event, fallbackLogoSrc, 'logoCap')}\n onLoad={() => setShowLogoCap(true)}\n alt={logoAlt}\n loading={imageLoadingType}\n />\n )}\n </div>\n );\n});\n\nCardImageCap.propTypes = {\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies image src. */\n src: PropTypes.string,\n /** Specifies fallback image src. */\n fallbackSrc: PropTypes.string,\n /** Specifies image alt text. */\n srcAlt: PropTypes.string,\n /** Specifies logo src to put on top of the image. */\n logoSrc: PropTypes.string,\n /** Specifies fallback image logo src. */\n fallbackLogoSrc: PropTypes.string,\n /** Specifies logo image alt text. */\n logoAlt: PropTypes.string,\n /** Specifies height of Image skeleton in loading state. */\n skeletonHeight: PropTypes.number,\n /** Specifies width of Image skeleton in loading state. */\n skeletonWidth: PropTypes.number,\n /** Specifies whether the cap should be displayed during loading. */\n logoSkeleton: PropTypes.bool,\n /** Specifies height of Logo skeleton in loading state. */\n logoSkeletonHeight: PropTypes.number,\n /** Specifies width of Logo skeleton in loading state. */\n logoSkeletonWidth: PropTypes.number,\n /** Specifies loading type for images */\n imageLoadingType: PropTypes.oneOf(['eager', 'lazy']),\n};\n\nCardImageCap.defaultProps = {\n src: undefined,\n fallbackSrc: cardSrcFallbackImg,\n logoSrc: undefined,\n fallbackLogoSrc: undefined,\n className: undefined,\n srcAlt: undefined,\n logoAlt: undefined,\n skeletonHeight: SKELETON_HEIGHT_VALUE,\n logoSkeleton: false,\n logoSkeletonHeight: LOGO_SKELETON_HEIGHT_VALUE,\n skeletonWidth: undefined,\n logoSkeletonWidth: undefined,\n imageLoadingType: 'eager',\n};\n\nexport default CardImageCap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AACnD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,WAAW,MAAM,eAAe;AACvC,SAASC,kBAAkB,QAAQ,4BAA4B;AAE/D,MAAMC,qBAAqB,GAAG,GAAG;AACjC,MAAMC,0BAA0B,GAAG,EAAE;AAErC,MAAMC,YAAY,gBAAGV,KAAK,CAACW,UAAU,CAAC,CAAAC,IAAA,EAcnCC,GAAG,KAAK;EAAA,IAd4B;IACrCC,GAAG;IACHC,WAAW;IACXC,MAAM;IACNC,OAAO;IACPC,eAAe;IACfC,OAAO;IACPC,cAAc;IACdC,aAAa;IACbC,YAAY;IACZC,kBAAkB;IAClBC,iBAAiB;IACjBC,SAAS;IACTC;EACF,CAAC,GAAAd,IAAA;EACC,MAAM;IAAEe,WAAW;IAAEC;EAAU,CAAC,GAAG3B,UAAU,CAACK,WAAW,CAAC;EAC1D,MAAM,CAACuB,YAAY,EAAEC,eAAe,CAAC,GAAG5B,QAAQ,CAAC,KAAK,CAAC;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BAAkB,EAAEpB,SAAS,CAACgD,MAAM;EACpC;EACA3B,iBAAiB,EAAErB,SAAS,CAACgD,MAAM;EACnC;EACAzB,gBAAgB,EAAEvB,SAAS,CAACkD,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC;AACrD,CAAC;AAED3C,YAAY,CAAC4C,YAAY,GAAG;EAC1BxC,GAAG,EAAEyC,SAAS;EACdxC,WAAW,EAAER,kBAAkB;EAC/BU,OAAO,EAAEsC,SAAS;EAClBrC,eAAe,EAAEqC,SAAS;EAC1B9B,SAAS,EAAE8B,SAAS;EACpBvC,MAAM,EAAEuC,SAAS;EACjBpC,OAAO,EAAEoC,SAAS;EAClBnC,cAAc,EAAEZ,qBAAqB;EACrCc,YAAY,EAAE,KAAK;EACnBC,kBAAkB,EAAEd,0BAA0B;EAC9CY,aAAa,EAAEkC,SAAS;EACxB/B,iBAAiB,EAAE+B,SAAS;EAC5B7B,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAehB,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardStatus.js","names":["React","useContext","PropTypes","classNames","Skeleton","Icon","CardContext","CardStatus","forwardRef","_ref","ref","className","children","variant","icon","title","actions","props","isLoading","createElement","src","propTypes","node","isRequired","string","func","oneOf","oneOfType","element","defaultProps","undefined"],"sources":["../../src/Card/CardStatus.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Skeleton from 'react-loading-skeleton';\nimport Icon from '../Icon';\nimport CardContext from './CardContext';\n\nconst CardStatus = React.forwardRef(({\n className,\n children,\n variant,\n icon,\n title,\n actions,\n ...props\n}, ref) => {\n const { isLoading } = useContext(CardContext);\n\n if (isLoading) {\n return (\n <div\n className={classNames(\n 'pgn__card-status',\n className,\n )}\n data-testid=\"card-status-skeleton\"\n ref={ref}\n >\n <Skeleton />\n </div>\n );\n }\n\n return (\n <div\n className={classNames(\n 'pgn__card-status',\n `pgn__card-status__${variant}`,\n className,\n )}\n ref={ref}\n {...props}\n >\n <div className=\"pgn__card-status__content\">\n {icon && <Icon className=\"pgn__card-status__content-icon\" src={icon} />}\n <div className=\"pgn__card-status__message-content\">\n {title && <div className=\"pgn__card-status__heading\">{title}</div>}\n {children}\n </div>\n </div>\n {!!actions && (\n <div className=\"pgn__card-status__actions\">\n {actions}\n </div>\n )}\n </div>\n );\n});\n\nCardStatus.propTypes = {\n /** Specifies the content of the component. */\n children: PropTypes.node.isRequired,\n /** The class to append to the base element. */\n className: PropTypes.string,\n /** Icon that will be shown in the top-left corner. */\n icon: PropTypes.func,\n /** Specifies variant to use. */\n variant: PropTypes.oneOf([\n 'primary',\n 'success',\n 'danger',\n 'warning',\n ]),\n /** Specifies title for the `Card.Status`. */\n title: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),\n /** Specifies any optional actions, e.g. button(s). */\n actions: PropTypes.node,\n};\n\nCardStatus.defaultProps = {\n className: undefined,\n icon: undefined,\n variant: 'warning',\n title: undefined,\n actions: undefined,\n};\n\nexport default CardStatus;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,WAAW,MAAM,eAAe;AAEvC,MAAMC,UAAU,gBAAGP,KAAK,CAACQ,UAAU,CAAC,CAAAC,IAAA,EAQjCC,GAAG,KAAK;EAAA,IAR0B;IACnCC,SAAS;IACTC,QAAQ;IACRC,OAAO;IACPC,IAAI;IACJC,KAAK;IACLC,OAAO;IACP,GAAGC;EACL,CAAC,GAAAR,IAAA;EACC,MAAM;IAAES;EAAU,CAAC,GAAGjB,UAAU,CAACK,WAAW,CAAC;EAE7C,IAAIY,SAAS,EAAE;IACb,oBACElB,KAAA,CAAAmB,aAAA;MACER,SAAS,EAAER,UAAU,CACnB,kBAAkB,EAClBQ,SACF,CAAE;MACF,eAAY,sBAAsB;MAClCD,GAAG,EAAEA;IAAI,gBAETV,KAAA,CAAAmB,aAAA,CAACf,QAAQ,MAAE,CACR,CAAC;EAEV;EAEA,oBACEJ,KAAA,CAAAmB,aAAA;IACER,SAAS,EAAER,UAAU,CACnB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"CardStatus.js","names":["React","useContext","PropTypes","classNames","Skeleton","Icon","CardContext","CardStatus","forwardRef","_ref","ref","className","children","variant","icon","title","actions","props","isLoading","createElement","src","propTypes","node","isRequired","string","func","oneOf","oneOfType","element","defaultProps","undefined"],"sources":["../../src/Card/CardStatus.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Skeleton from 'react-loading-skeleton';\nimport Icon from '../Icon';\nimport CardContext from './CardContext';\n\nconst CardStatus = React.forwardRef(({\n className,\n children,\n variant,\n icon,\n title,\n actions,\n ...props\n}, ref) => {\n const { isLoading } = useContext(CardContext);\n\n if (isLoading) {\n return (\n <div\n className={classNames(\n 'pgn__card-status',\n className,\n )}\n data-testid=\"card-status-skeleton\"\n ref={ref}\n >\n <Skeleton />\n </div>\n );\n }\n\n return (\n <div\n className={classNames(\n 'pgn__card-status',\n `pgn__card-status__${variant}`,\n className,\n )}\n ref={ref}\n {...props}\n >\n <div className=\"pgn__card-status__content\">\n {icon && <Icon className=\"pgn__card-status__content-icon\" src={icon} />}\n <div className=\"pgn__card-status__message-content\">\n {title && <div className=\"pgn__card-status__heading\">{title}</div>}\n {children}\n </div>\n </div>\n {!!actions && (\n <div className=\"pgn__card-status__actions\">\n {actions}\n </div>\n )}\n </div>\n );\n});\n\nCardStatus.propTypes = {\n /** Specifies the content of the component. */\n children: PropTypes.node.isRequired,\n /** The class to append to the base element. */\n className: PropTypes.string,\n /** Icon that will be shown in the top-left corner. */\n icon: PropTypes.func,\n /** Specifies variant to use. */\n variant: PropTypes.oneOf([\n 'primary',\n 'success',\n 'danger',\n 'warning',\n ]),\n /** Specifies title for the `Card.Status`. */\n title: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),\n /** Specifies any optional actions, e.g. button(s). */\n actions: PropTypes.node,\n};\n\nCardStatus.defaultProps = {\n className: undefined,\n icon: undefined,\n variant: 'warning',\n title: undefined,\n actions: undefined,\n};\n\nexport default CardStatus;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,WAAW,MAAM,eAAe;AAEvC,MAAMC,UAAU,gBAAGP,KAAK,CAACQ,UAAU,CAAC,CAAAC,IAAA,EAQjCC,GAAG,KAAK;EAAA,IAR0B;IACnCC,SAAS;IACTC,QAAQ;IACRC,OAAO;IACPC,IAAI;IACJC,KAAK;IACLC,OAAO;IACP,GAAGC;EACL,CAAC,GAAAR,IAAA;EACC,MAAM;IAAES;EAAU,CAAC,GAAGjB,UAAU,CAACK,WAAW,CAAC;EAE7C,IAAIY,SAAS,EAAE;IACb,oBACElB,KAAA,CAAAmB,aAAA;MACER,SAAS,EAAER,UAAU,CACnB,kBAAkB,EAClBQ,SACF,CAAE;MACF,eAAY,sBAAsB;MAClCD,GAAG,EAAEA;IAAI,gBAETV,KAAA,CAAAmB,aAAA,CAACf,QAAQ,MAAE,CACR,CAAC;EAEV;EAEA,oBACEJ,KAAA,CAAAmB,aAAA;IACER,SAAS,EAAER,UAAU,CACnB,kBAAkB,EAClB,qBAAqBU,OAAO,EAAE,EAC9BF,SACF,CAAE;IACFD,GAAG,EAAEA,GAAI;IAAA,GACLO;EAAK,gBAETjB,KAAA,CAAAmB,aAAA;IAAKR,SAAS,EAAC;EAA2B,GACvCG,IAAI,iBAAId,KAAA,CAAAmB,aAAA,CAACd,IAAI;IAACM,SAAS,EAAC,gCAAgC;IAACS,GAAG,EAAEN;EAAK,CAAE,CAAC,eACvEd,KAAA,CAAAmB,aAAA;IAAKR,SAAS,EAAC;EAAmC,GAC/CI,KAAK,iBAAIf,KAAA,CAAAmB,aAAA;IAAKR,SAAS,EAAC;EAA2B,GAAEI,KAAW,CAAC,EACjEH,QACE,CACF,CAAC,EACL,CAAC,CAACI,OAAO,iBACRhB,KAAA,CAAAmB,aAAA;IAAKR,SAAS,EAAC;EAA2B,GACvCK,OACE,CAEJ,CAAC;AAEV,CAAC,CAAC;AAEFT,UAAU,CAACc,SAAS,GAAG;EACrB;EACAT,QAAQ,EAAEV,SAAS,CAACoB,IAAI,CAACC,UAAU;EACnC;EACAZ,SAAS,EAAET,SAAS,CAACsB,MAAM;EAC3B;EACAV,IAAI,EAAEZ,SAAS,CAACuB,IAAI;EACpB;EACAZ,OAAO,EAAEX,SAAS,CAACwB,KAAK,CAAC,CACvB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,CACV,CAAC;EACF;EACAX,KAAK,EAAEb,SAAS,CAACyB,SAAS,CAAC,CAACzB,SAAS,CAAC0B,OAAO,EAAE1B,SAAS,CAACsB,MAAM,CAAC,CAAC;EACjE;EACAR,OAAO,EAAEd,SAAS,CAACoB;AACrB,CAAC;AAEDf,UAAU,CAACsB,YAAY,GAAG;EACxBlB,SAAS,EAAEmB,SAAS;EACpBhB,IAAI,EAAEgB,SAAS;EACfjB,OAAO,EAAE,SAAS;EAClBE,KAAK,EAAEe,SAAS;EAChBd,OAAO,EAAEc;AACX,CAAC;AAED,eAAevB,UAAU","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
// Card
|
|
2
3
|
|
|
3
4
|
$card-spacer-y: .75rem !default;
|
|
@@ -21,8 +22,8 @@ $card-img-overlay-padding: 1.25rem !default;
|
|
|
21
22
|
$card-group-margin: calc($grid-gutter-width / 2) !default;
|
|
22
23
|
$card-deck-margin: $card-group-margin !default;
|
|
23
24
|
$card-grid-margin: $card-group-margin !default;
|
|
24
|
-
$card-deck-margin-bottom:
|
|
25
|
-
$card-grid-margin-bottom:
|
|
25
|
+
$card-deck-margin-bottom: map.get($spacers, 3) !default;
|
|
26
|
+
$card-grid-margin-bottom: map.get($spacers, 3) !default;
|
|
26
27
|
|
|
27
28
|
$card-columns-count: 3 !default;
|
|
28
29
|
$card-columns-gap: 1.25rem !default;
|
package/dist/Card/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","BaseCard","PropTypes","classNames","CardContext","CardContextProvider","CardHeader","CardDivider","CardSection","CardFooter","CardImageCap","CardBody","CardStatus","withDeprecatedProps","DeprTypes","CARD_VARIANTS","Card","forwardRef","_ref","ref","orientation","isLoading","className","isClickable","muted","variant","props","resolvedVariant","createElement","horizontal","clickable","tabIndex","default","CardColumns","CardDeck","CardCarousel","CardImg","CardGroup","CardGrid","propTypes","string","oneOf","bool","defaultProps","undefined","CardWithDeprecatedProp","deprType","REMOVED","message","Status","Header","Divider","Section","Footer","ImageCap","Context","Body"],"sources":["../../src/Card/index.jsx"],"sourcesContent":["import React from 'react';\nimport BaseCard from 'react-bootstrap/Card';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport CardContext, { CardContextProvider } from './CardContext';\nimport CardHeader from './CardHeader';\nimport CardDivider from './CardDivider';\nimport CardSection from './CardSection';\nimport CardFooter from './CardFooter';\nimport CardImageCap from './CardImageCap';\nimport CardBody from './CardBody';\nimport CardStatus from './CardStatus';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nexport const CARD_VARIANTS = ['light', 'dark', 'muted'];\n\nconst Card = React.forwardRef(({\n orientation,\n isLoading,\n className,\n isClickable,\n muted,\n variant,\n ...props\n}, ref) => {\n const resolvedVariant = muted ? 'muted' : variant;\n\n return (\n <CardContextProvider\n orientation={orientation}\n isLoading={isLoading}\n variant={resolvedVariant}\n >\n <BaseCard\n {...props}\n className={classNames(className, 'pgn__card', {\n horizontal: orientation === 'horizontal',\n clickable: isClickable,\n [`pgn__card-${resolvedVariant}`]: resolvedVariant,\n })}\n ref={ref}\n tabIndex={isClickable ? 0 : -1}\n />\n </CardContextProvider>\n );\n});\n\nexport { default as CardColumns } from 'react-bootstrap/CardColumns';\nexport { default as CardDeck } from './CardDeck';\nexport { default as CardCarousel } from './CardCarousel/CardCarousel';\nexport { default as CardImg } from 'react-bootstrap/CardImg';\nexport { default as CardGroup } from 'react-bootstrap/CardGroup';\nexport { default as CardGrid } from './CardGrid';\n\nCard.propTypes = {\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies which orientation to use. */\n orientation: PropTypes.oneOf(['vertical', 'horizontal']),\n /** Specifies whether the `Card` is clickable, if `true` appropriate `hover` and `focus` styling will be added. */\n isClickable: PropTypes.bool,\n /** Specifies loading state. */\n isLoading: PropTypes.bool,\n /** Specifies `Card` style variant. */\n variant: PropTypes.oneOf(CARD_VARIANTS),\n /** **Deprecated**. Specifies whether `Card` uses `muted` variant. Use `variant=\"muted\"` instead. */\n muted: PropTypes.bool,\n};\n\nCard.defaultProps = {\n ...BaseCard.defaultProps,\n className: undefined,\n orientation: 'vertical',\n isClickable: false,\n variant: 'light',\n isLoading: false,\n};\n\nconst CardWithDeprecatedProp = withDeprecatedProps(Card, 'Card', {\n muted: {\n deprType: DeprTypes.REMOVED,\n message: 'Use \"variant\" prop instead, i.e. variant=\"muted\"',\n },\n});\n\nCardWithDeprecatedProp.Status = CardStatus;\nCardWithDeprecatedProp.Header = CardHeader;\nCardWithDeprecatedProp.Divider = CardDivider;\nCardWithDeprecatedProp.Section = CardSection;\nCardWithDeprecatedProp.Footer = CardFooter;\nCardWithDeprecatedProp.ImageCap = CardImageCap;\nCardWithDeprecatedProp.Context = CardContext;\nCardWithDeprecatedProp.Body = CardBody;\n\nexport default CardWithDeprecatedProp;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,IAAIC,mBAAmB,QAAQ,eAAe;AAChE,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,OAAO,MAAMC,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;AAEvD,MAAMC,IAAI,gBAAGhB,KAAK,CAACiB,UAAU,CAAC,CAAAC,IAAA,EAQ3BC,GAAG,KAAK;EAAA,IARoB;IAC7BC,WAAW;IACXC,SAAS;IACTC,SAAS;IACTC,WAAW;IACXC,KAAK;IACLC,OAAO;IACP,GAAGC;EACL,CAAC,GAAAR,IAAA;EACC,MAAMS,eAAe,GAAGH,KAAK,GAAG,OAAO,GAAGC,OAAO;EAEjD,oBACEzB,KAAA,CAAA4B,aAAA,CAACvB,mBAAmB;IAClBe,WAAW,EAAEA,WAAY;IACzBC,SAAS,EAAEA,SAAU;IACrBI,OAAO,EAAEE;EAAgB,gBAEzB3B,KAAA,CAAA4B,aAAA,CAAC3B,QAAQ;IAAA,GACHyB,KAAK;IACTJ,SAAS,EAAEnB,UAAU,CAACmB,SAAS,EAAE,WAAW,EAAE;MAC5CO,UAAU,EAAET,WAAW,KAAK,YAAY;MACxCU,SAAS,EAAEP,WAAW;MACtB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","BaseCard","PropTypes","classNames","CardContext","CardContextProvider","CardHeader","CardDivider","CardSection","CardFooter","CardImageCap","CardBody","CardStatus","withDeprecatedProps","DeprTypes","CARD_VARIANTS","Card","forwardRef","_ref","ref","orientation","isLoading","className","isClickable","muted","variant","props","resolvedVariant","createElement","horizontal","clickable","tabIndex","default","CardColumns","CardDeck","CardCarousel","CardImg","CardGroup","CardGrid","propTypes","string","oneOf","bool","defaultProps","undefined","CardWithDeprecatedProp","deprType","REMOVED","message","Status","Header","Divider","Section","Footer","ImageCap","Context","Body"],"sources":["../../src/Card/index.jsx"],"sourcesContent":["import React from 'react';\nimport BaseCard from 'react-bootstrap/Card';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport CardContext, { CardContextProvider } from './CardContext';\nimport CardHeader from './CardHeader';\nimport CardDivider from './CardDivider';\nimport CardSection from './CardSection';\nimport CardFooter from './CardFooter';\nimport CardImageCap from './CardImageCap';\nimport CardBody from './CardBody';\nimport CardStatus from './CardStatus';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nexport const CARD_VARIANTS = ['light', 'dark', 'muted'];\n\nconst Card = React.forwardRef(({\n orientation,\n isLoading,\n className,\n isClickable,\n muted,\n variant,\n ...props\n}, ref) => {\n const resolvedVariant = muted ? 'muted' : variant;\n\n return (\n <CardContextProvider\n orientation={orientation}\n isLoading={isLoading}\n variant={resolvedVariant}\n >\n <BaseCard\n {...props}\n className={classNames(className, 'pgn__card', {\n horizontal: orientation === 'horizontal',\n clickable: isClickable,\n [`pgn__card-${resolvedVariant}`]: resolvedVariant,\n })}\n ref={ref}\n tabIndex={isClickable ? 0 : -1}\n />\n </CardContextProvider>\n );\n});\n\nexport { default as CardColumns } from 'react-bootstrap/CardColumns';\nexport { default as CardDeck } from './CardDeck';\nexport { default as CardCarousel } from './CardCarousel/CardCarousel';\nexport { default as CardImg } from 'react-bootstrap/CardImg';\nexport { default as CardGroup } from 'react-bootstrap/CardGroup';\nexport { default as CardGrid } from './CardGrid';\n\nCard.propTypes = {\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies which orientation to use. */\n orientation: PropTypes.oneOf(['vertical', 'horizontal']),\n /** Specifies whether the `Card` is clickable, if `true` appropriate `hover` and `focus` styling will be added. */\n isClickable: PropTypes.bool,\n /** Specifies loading state. */\n isLoading: PropTypes.bool,\n /** Specifies `Card` style variant. */\n variant: PropTypes.oneOf(CARD_VARIANTS),\n /** **Deprecated**. Specifies whether `Card` uses `muted` variant. Use `variant=\"muted\"` instead. */\n muted: PropTypes.bool,\n};\n\nCard.defaultProps = {\n ...BaseCard.defaultProps,\n className: undefined,\n orientation: 'vertical',\n isClickable: false,\n variant: 'light',\n isLoading: false,\n};\n\nconst CardWithDeprecatedProp = withDeprecatedProps(Card, 'Card', {\n muted: {\n deprType: DeprTypes.REMOVED,\n message: 'Use \"variant\" prop instead, i.e. variant=\"muted\"',\n },\n});\n\nCardWithDeprecatedProp.Status = CardStatus;\nCardWithDeprecatedProp.Header = CardHeader;\nCardWithDeprecatedProp.Divider = CardDivider;\nCardWithDeprecatedProp.Section = CardSection;\nCardWithDeprecatedProp.Footer = CardFooter;\nCardWithDeprecatedProp.ImageCap = CardImageCap;\nCardWithDeprecatedProp.Context = CardContext;\nCardWithDeprecatedProp.Body = CardBody;\n\nexport default CardWithDeprecatedProp;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,IAAIC,mBAAmB,QAAQ,eAAe;AAChE,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,OAAO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