@hashicorp/mds-react 0.9.3 → 0.9.4
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/components/accordion/index.js +9 -0
- package/components/accordion/index.js.map +1 -0
- package/components/accordion/item/button.js +44 -0
- package/components/accordion/item/button.js.map +1 -0
- package/components/accordion/item/index.js +59 -0
- package/components/accordion/item/index.js.map +1 -0
- package/components/accordion/style.module.scss.js +24 -0
- package/components/accordion/style.module.scss.js.map +1 -0
- package/components/alert/alert.module.scss.js +29 -0
- package/components/alert/alert.module.scss.js.map +1 -0
- package/components/alert/icon.js +34 -0
- package/components/alert/icon.js.map +1 -0
- package/components/alert/index.js +97 -0
- package/components/alert/index.js.map +1 -0
- package/components/badge/index.js +50 -0
- package/components/badge/index.js.map +1 -0
- package/components/badge/style.module.scss.js +22 -0
- package/components/badge/style.module.scss.js.map +1 -0
- package/components/badge-count/index.js +29 -0
- package/components/badge-count/index.js.map +1 -0
- package/components/badge-count/style.module.scss.js +15 -0
- package/components/badge-count/style.module.scss.js.map +1 -0
- package/components/breadcrumbs/index.js +38 -0
- package/components/breadcrumbs/index.js.map +1 -0
- package/components/breadcrumbs/item/index.js +32 -0
- package/components/breadcrumbs/item/index.js.map +1 -0
- package/components/breadcrumbs/style.module.scss.js +27 -0
- package/components/breadcrumbs/style.module.scss.js.map +1 -0
- package/components/breadcrumbs/truncation-button/index.js +25 -0
- package/components/breadcrumbs/truncation-button/index.js.map +1 -0
- package/components/button/index.d.ts +2 -1
- package/components/button/index.js +119 -0
- package/components/button/index.js.map +1 -0
- package/components/button/styles.module.scss.js +32 -0
- package/components/button/styles.module.scss.js.map +1 -0
- package/components/card/card-thumbnail/card-thumbnail.module.css.js +8 -0
- package/components/card/card-thumbnail/card-thumbnail.module.css.js.map +1 -0
- package/components/card/card-thumbnail/index.js +23 -0
- package/components/card/card-thumbnail/index.js.map +1 -0
- package/components/card/index.d.ts +2 -1
- package/components/card/index.js +160 -0
- package/components/card/index.js.map +1 -0
- package/components/card/styles.module.css.js +29 -0
- package/components/card/styles.module.css.js.map +1 -0
- package/components/card/types.d.ts +1 -0
- package/components/code-block/code-block.module.scss.js +34 -0
- package/components/code-block/code-block.module.scss.js.map +1 -0
- package/components/code-block/code-lines/index.js +59 -0
- package/components/code-block/code-lines/index.js.map +1 -0
- package/components/code-block/code-lines/utils/split-html-into-lines.js +19 -0
- package/components/code-block/code-lines/utils/split-html-into-lines.js.map +1 -0
- package/components/code-block/code-lines/utils/split-jsx-into-lines.js +31 -0
- package/components/code-block/code-lines/utils/split-jsx-into-lines.js.map +1 -0
- package/components/code-block/hidden-copy-content/index.js +13 -0
- package/components/code-block/hidden-copy-content/index.js.map +1 -0
- package/components/code-block/index.js +88 -0
- package/components/code-block/index.js.map +1 -0
- package/components/code-block/utils/parse-highlighted-lines.js +39 -0
- package/components/code-block/utils/parse-highlighted-lines.js.map +1 -0
- package/components/code-block/utils/process-snippet.js +20 -0
- package/components/code-block/utils/process-snippet.js.map +1 -0
- package/components/code-block/utils/shellwords.js +33 -0
- package/components/code-block/utils/shellwords.js.map +1 -0
- package/components/combo-box-primitive/index.js +302 -0
- package/components/combo-box-primitive/index.js.map +1 -0
- package/components/dialog-primitive/dialog.module.scss.js +12 -0
- package/components/dialog-primitive/dialog.module.scss.js.map +1 -0
- package/components/dialog-primitive/index.js +15 -0
- package/components/dialog-primitive/index.js.map +1 -0
- package/components/disclosure-primitive/index.js +57 -0
- package/components/disclosure-primitive/index.js.map +1 -0
- package/components/disclosure-primitive/styles.module.css.js +7 -0
- package/components/disclosure-primitive/styles.module.css.js.map +1 -0
- package/components/disclosure-primitive/use-disclosure-primitive.js +17 -0
- package/components/disclosure-primitive/use-disclosure-primitive.js.map +1 -0
- package/components/dismiss-button/index.js +22 -0
- package/components/dismiss-button/index.js.map +1 -0
- package/components/dismiss-button/styles.module.scss.js +7 -0
- package/components/dismiss-button/styles.module.scss.js.map +1 -0
- package/components/dropdown/index.js +79 -0
- package/components/dropdown/index.js.map +1 -0
- package/components/dropdown/list-item/custom.js +9 -0
- package/components/dropdown/list-item/custom.js.map +1 -0
- package/components/dropdown/list-item/index.js +14 -0
- package/components/dropdown/list-item/index.js.map +1 -0
- package/components/dropdown/list-item/interactive.js +49 -0
- package/components/dropdown/list-item/interactive.js.map +1 -0
- package/components/dropdown/list-item/separator.js +17 -0
- package/components/dropdown/list-item/separator.js.map +1 -0
- package/components/dropdown/list-item/styles.module.css.js +26 -0
- package/components/dropdown/list-item/styles.module.css.js.map +1 -0
- package/components/dropdown/list-item/title.js +9 -0
- package/components/dropdown/list-item/title.js.map +1 -0
- package/components/dropdown/styles.module.css.js +24 -0
- package/components/dropdown/styles.module.css.js.map +1 -0
- package/components/dropdown/toggle-button/index.js +54 -0
- package/components/dropdown/toggle-button/index.js.map +1 -0
- package/components/dropdown/toggle-button/styles.module.scss.js +14 -0
- package/components/dropdown/toggle-button/styles.module.scss.js.map +1 -0
- package/components/flight-icon/flight-icon.module.css.js +12 -0
- package/components/flight-icon/flight-icon.module.css.js.map +1 -0
- package/components/flight-icon/index.js +58 -0
- package/components/flight-icon/index.js.map +1 -0
- package/components/form/checkbox/form-checkbox.module.css.js +8 -0
- package/components/form/checkbox/form-checkbox.module.css.js.map +1 -0
- package/components/form/checkbox/index.js +109 -0
- package/components/form/checkbox/index.js.map +1 -0
- package/components/form/error/form-error.module.css.js +14 -0
- package/components/form/error/form-error.module.css.js.map +1 -0
- package/components/form/error/index.js +22 -0
- package/components/form/error/index.js.map +1 -0
- package/components/form/field/form-field.module.css.js +17 -0
- package/components/form/field/form-field.module.css.js.map +1 -0
- package/components/form/field/index.js +46 -0
- package/components/form/field/index.js.map +1 -0
- package/components/form/fieldset/form-fieldset.module.css.js +19 -0
- package/components/form/fieldset/form-fieldset.module.css.js.map +1 -0
- package/components/form/fieldset/index.js +65 -0
- package/components/form/fieldset/index.js.map +1 -0
- package/components/form/file-input/form-file-input.module.scss.js +7 -0
- package/components/form/file-input/form-file-input.module.scss.js.map +1 -0
- package/components/form/file-input/index.js +68 -0
- package/components/form/file-input/index.js.map +1 -0
- package/components/form/helper-text/form-helper-text.module.css.js +7 -0
- package/components/form/helper-text/form-helper-text.module.css.js.map +1 -0
- package/components/form/helper-text/index.js +22 -0
- package/components/form/helper-text/index.js.map +1 -0
- package/components/form/indicator/form-indicator.module.css.js +8 -0
- package/components/form/indicator/form-indicator.module.css.js.map +1 -0
- package/components/form/indicator/index.js +23 -0
- package/components/form/indicator/index.js.map +1 -0
- package/components/form/label/form-label.module.css.js +10 -0
- package/components/form/label/form-label.module.css.js.map +1 -0
- package/components/form/label/index.js +33 -0
- package/components/form/label/index.js.map +1 -0
- package/components/form/legend/form-legend.module.css.js +10 -0
- package/components/form/legend/form-legend.module.css.js.map +1 -0
- package/components/form/legend/index.js +19 -0
- package/components/form/legend/index.js.map +1 -0
- package/components/form/radio/form-radio.module.scss.js +8 -0
- package/components/form/radio/form-radio.module.scss.js.map +1 -0
- package/components/form/radio/index.js +100 -0
- package/components/form/radio/index.js.map +1 -0
- package/components/form/radio-card/description.js +10 -0
- package/components/form/radio-card/description.js.map +1 -0
- package/components/form/radio-card/form-radio-card.module.css.js +30 -0
- package/components/form/radio-card/form-radio-card.module.css.js.map +1 -0
- package/components/form/radio-card/group.js +31 -0
- package/components/form/radio-card/group.js.map +1 -0
- package/components/form/radio-card/index.js +67 -0
- package/components/form/radio-card/index.js.map +1 -0
- package/components/form/radio-card/label.js +10 -0
- package/components/form/radio-card/label.js.map +1 -0
- package/components/form/select/form-select.module.css.js +14 -0
- package/components/form/select/form-select.module.css.js.map +1 -0
- package/components/form/select/index.js +79 -0
- package/components/form/select/index.js.map +1 -0
- package/components/form/super-select/form-super-select.module.css.js +22 -0
- package/components/form/super-select/form-super-select.module.css.js.map +1 -0
- package/components/form/super-select/index.js +170 -0
- package/components/form/super-select/index.js.map +1 -0
- package/components/form/text-input/index.js +91 -0
- package/components/form/text-input/index.js.map +1 -0
- package/components/form/text-input/styles.module.css.js +15 -0
- package/components/form/text-input/styles.module.css.js.map +1 -0
- package/components/form/textarea/form-textarea.module.css.js +14 -0
- package/components/form/textarea/form-textarea.module.css.js.map +1 -0
- package/components/form/textarea/index.js +74 -0
- package/components/form/textarea/index.js.map +1 -0
- package/components/form/toggle/form-toggle.module.scss.js +12 -0
- package/components/form/toggle/form-toggle.module.scss.js.map +1 -0
- package/components/form/toggle/index.js +102 -0
- package/components/form/toggle/index.js.map +1 -0
- package/components/hds/wrappers/tooltip.js +51 -0
- package/components/hds/wrappers/tooltip.js.map +1 -0
- package/components/icon-tile/index.js +50 -0
- package/components/icon-tile/index.js.map +1 -0
- package/components/icon-tile/style.module.scss.js +29 -0
- package/components/icon-tile/style.module.scss.js.map +1 -0
- package/components/index.d.ts +1 -1
- package/components/index.js +116 -73
- package/components/index.js.map +1 -1
- package/components/inline-link/index.js +33 -0
- package/components/inline-link/index.js.map +1 -0
- package/components/inline-link/inline-link.module.css.js +11 -0
- package/components/inline-link/inline-link.module.css.js.map +1 -0
- package/components/interactive/index.js +59 -0
- package/components/interactive/index.js.map +1 -0
- package/components/legacy-button/index.js +65 -0
- package/components/legacy-button/index.js.map +1 -0
- package/components/legacy-button/utils.js +39 -0
- package/components/legacy-button/utils.js.map +1 -0
- package/components/menu-primitive/index.js +68 -0
- package/components/menu-primitive/index.js.map +1 -0
- package/components/menu-primitive/styles.module.css.js +12 -0
- package/components/menu-primitive/styles.module.css.js.map +1 -0
- package/components/menu-primitive/use-menu-primitive.js +17 -0
- package/components/menu-primitive/use-menu-primitive.js.map +1 -0
- package/components/modal/index.js +61 -0
- package/components/modal/index.js.map +1 -0
- package/components/modal/modal.module.css.js +8 -0
- package/components/modal/modal.module.css.js.map +1 -0
- package/components/modal/use-modal.js +17 -0
- package/components/modal/use-modal.js.map +1 -0
- package/components/separator/index.js +15 -0
- package/components/separator/index.js.map +1 -0
- package/components/separator/separator.module.css.js +10 -0
- package/components/separator/separator.module.css.js.map +1 -0
- package/components/standalone-link/index.js +54 -0
- package/components/standalone-link/index.js.map +1 -0
- package/components/standalone-link/styles.module.scss.js +17 -0
- package/components/standalone-link/styles.module.scss.js.map +1 -0
- package/components/table/index.js +52 -0
- package/components/table/index.js.map +1 -0
- package/components/table/table.module.scss.js +33 -0
- package/components/table/table.module.scss.js.map +1 -0
- package/components/table/td.js +28 -0
- package/components/table/td.js.map +1 -0
- package/components/table/th-button-tooltip.js +24 -0
- package/components/table/th-button-tooltip.js.map +1 -0
- package/components/table/th.js +43 -0
- package/components/table/th.js.map +1 -0
- package/components/table/tr.js +9 -0
- package/components/table/tr.js.map +1 -0
- package/components/table/utils.js +28 -0
- package/components/table/utils.js.map +1 -0
- package/components/tabs/index.js +117 -0
- package/components/tabs/index.js.map +1 -0
- package/components/tabs/tab-panel.js +35 -0
- package/components/tabs/tab-panel.js.map +1 -0
- package/components/tabs/tab.js +70 -0
- package/components/tabs/tab.js.map +1 -0
- package/components/tabs/tabs.module.scss.js +22 -0
- package/components/tabs/tabs.module.scss.js.map +1 -0
- package/components/tabs/use-tabs-context.js +16 -0
- package/components/tabs/use-tabs-context.js.map +1 -0
- package/components/text/index.js +112 -0
- package/components/text/index.js.map +1 -0
- package/components/text/style.module.scss.js +9 -0
- package/components/text/style.module.scss.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js +62 -0
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js +20 -0
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/index.js +104 -0
- package/components/visualizations/bar-chart/horizontal-chart/index.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/legend/index.js +13 -0
- package/components/visualizations/bar-chart/horizontal-chart/legend/index.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js +14 -0
- package/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/style.module.css.js +28 -0
- package/components/visualizations/bar-chart/horizontal-chart/style.module.css.js.map +1 -0
- package/components/visualizations/bar-chart/index.js +37 -0
- package/components/visualizations/bar-chart/index.js.map +1 -0
- package/components/visualizations/bar-chart/style.module.css.js +12 -0
- package/components/visualizations/bar-chart/style.module.css.js.map +1 -0
- package/components/visualizations/donut-chart/components/arc-tooltip/index.js +14 -0
- package/components/visualizations/donut-chart/components/arc-tooltip/index.js.map +1 -0
- package/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js +10 -0
- package/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js.map +1 -0
- package/components/visualizations/donut-chart/components/external-arc-label/index.js +58 -0
- package/components/visualizations/donut-chart/components/external-arc-label/index.js.map +1 -0
- package/components/visualizations/donut-chart/components/external-arc-label/styles.module.css.js +16 -0
- package/components/visualizations/donut-chart/components/external-arc-label/styles.module.css.js.map +1 -0
- package/components/visualizations/donut-chart/components/internal-arc-label/index.js +42 -0
- package/components/visualizations/donut-chart/components/internal-arc-label/index.js.map +1 -0
- package/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js +14 -0
- package/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js.map +1 -0
- package/components/visualizations/donut-chart/index.js +90 -0
- package/components/visualizations/donut-chart/index.js.map +1 -0
- package/components/visualizations/donut-chart/styles.module.css.js +20 -0
- package/components/visualizations/donut-chart/styles.module.css.js.map +1 -0
- package/hooks/use-media-query/index.js +16 -0
- package/hooks/use-media-query/index.js.map +1 -0
- package/index.js +155 -101
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/patterns/card/newsroom-card/index.js +26 -0
- package/patterns/card/newsroom-card/index.js.map +1 -0
- package/patterns/card/newsroom-card/style.module.css.js +8 -0
- package/patterns/card/newsroom-card/style.module.css.js.map +1 -0
- package/patterns/card/partner-card/index.js +42 -0
- package/patterns/card/partner-card/index.js.map +1 -0
- package/patterns/card/partner-card/style.module.css.js +12 -0
- package/patterns/card/partner-card/style.module.css.js.map +1 -0
- package/patterns/card/person-card/index.js +52 -0
- package/patterns/card/person-card/index.js.map +1 -0
- package/patterns/card/person-card/style.module.css.js +12 -0
- package/patterns/card/person-card/style.module.css.js.map +1 -0
- package/patterns/card/primitives.js +77 -0
- package/patterns/card/primitives.js.map +1 -0
- package/patterns/card/promo-card/index.js +36 -0
- package/patterns/card/promo-card/index.js.map +1 -0
- package/patterns/card/resource-card/index.js +26 -0
- package/patterns/card/resource-card/index.js.map +1 -0
- package/patterns/card/style.module.css.js +30 -0
- package/patterns/card/style.module.css.js.map +1 -0
- package/patterns/card/thumbnails/index.js +25 -0
- package/patterns/card/thumbnails/index.js.map +1 -0
- package/patterns/card/unified-card/index.js +37 -0
- package/patterns/card/unified-card/index.js.map +1 -0
- package/patterns/copy-button/clipboard.js +78 -0
- package/patterns/copy-button/clipboard.js.map +1 -0
- package/patterns/copy-button/index.js +57 -0
- package/patterns/copy-button/index.js.map +1 -0
- package/patterns/copy-button/style.module.css.js +13 -0
- package/patterns/copy-button/style.module.css.js.map +1 -0
- package/patterns/index.js +32 -22
- package/patterns/index.js.map +1 -1
- package/patterns/layout/index.js +47 -0
- package/patterns/layout/index.js.map +1 -0
- package/patterns/layout/layout.module.css.js +20 -0
- package/patterns/layout/layout.module.css.js.map +1 -0
- package/patterns/product-badge/index.js +22 -0
- package/patterns/product-badge/index.js.map +1 -0
- package/patterns/product-badge/style.module.css.js +8 -0
- package/patterns/product-badge/style.module.css.js.map +1 -0
- package/patterns/product-logo/index.js +130 -0
- package/patterns/product-logo/index.js.map +1 -0
- package/patterns/product-logo/product-logo.module.css.js +13 -0
- package/patterns/product-logo/product-logo.module.css.js.map +1 -0
- package/patterns/related-content/index.js +65 -0
- package/patterns/related-content/index.js.map +1 -0
- package/patterns/related-content/style.module.css.js +22 -0
- package/patterns/related-content/style.module.css.js.map +1 -0
- package/style.css +1 -1
- package/utils/get-contrast-yiq.js +13 -0
- package/utils/get-contrast-yiq.js.map +1 -0
- package/utils/hooks/use-screen-size.js +10 -0
- package/utils/hooks/use-screen-size.js.map +1 -0
- package/utils/i18n/constants/index.js +98 -0
- package/utils/i18n/constants/index.js.map +1 -0
- package/utils/i18n/helpers/locale-provider.js +9 -0
- package/utils/i18n/helpers/locale-provider.js.map +1 -0
- package/utils/i18n/helpers/to-smart-sentence-case.js +12 -0
- package/utils/i18n/helpers/to-smart-sentence-case.js.map +1 -0
- package/utils/i18n/helpers/to-smart-title-case.js +10 -0
- package/utils/i18n/helpers/to-smart-title-case.js.map +1 -0
- package/utils/i18n/helpers/use-locale.js +14 -0
- package/utils/i18n/helpers/use-locale.js.map +1 -0
- package/utils/i18n/index.js +41 -0
- package/utils/i18n/index.js.map +1 -0
- package/utils/i18n/index2.js +33 -0
- package/utils/i18n/index2.js.map +1 -0
- package/utils/index.js +7 -7
- package/utils/make-normalizer/index.js +34 -0
- package/utils/make-normalizer/index.js.map +1 -0
- package/{index-DBjAbGt7.js → utils/mds-context/index.js} +20 -19
- package/utils/mds-context/index.js.map +1 -0
- package/index-B9mPJh9w.js +0 -579
- package/index-B9mPJh9w.js.map +0 -1
- package/index-BHBlMMNF.js +0 -16
- package/index-BHBlMMNF.js.map +0 -1
- package/index-C4GBbW3N.js +0 -3567
- package/index-C4GBbW3N.js.map +0 -1
- package/index-DBjAbGt7.js.map +0 -1
- package/index-WkGIywHj.js +0 -767
- package/index-WkGIywHj.js.map +0 -1
- package/use-screen-size-BOnkX_K-.js +0 -9
- package/use-screen-size-BOnkX_K-.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,105 +1,159 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Accordion as e } from "./components/accordion/index.js";
|
|
2
|
+
import { BADGE_COLORS as p, BADGE_SIZES as m, BADGE_TYPES as x, Badge as f } from "./components/badge/index.js";
|
|
3
|
+
import { BadgeCount as i } from "./components/badge-count/index.js";
|
|
4
|
+
import { Alert as n, AlertActions as l, AlertButton as T, AlertStandaloneLink as C } from "./components/alert/index.js";
|
|
5
|
+
import { Breadcrumbs as S } from "./components/breadcrumbs/index.js";
|
|
6
|
+
import { BUTTON_COLORS as A, BUTTON_ICON_POSITIONS as s, BUTTON_SIZES as L, Button as c } from "./components/button/index.js";
|
|
7
|
+
import { Card as _, CardContent as P } from "./components/card/index.js";
|
|
8
|
+
import { CodeBlock as B } from "./components/code-block/index.js";
|
|
9
|
+
import { DisclosurePrimitive as D } from "./components/disclosure-primitive/index.js";
|
|
10
|
+
import { useDisclosurePrimitive as R } from "./components/disclosure-primitive/use-disclosure-primitive.js";
|
|
11
|
+
import { Dropdown as F } from "./components/dropdown/index.js";
|
|
12
|
+
import { FLIGHT_ICON_SIZES as b, FlightIcon as k } from "./components/flight-icon/index.js";
|
|
13
|
+
import { CheckboxBase as M, CheckboxField as v, CheckboxGroup as Z } from "./components/form/checkbox/index.js";
|
|
14
|
+
import { Error as H } from "./components/form/error/index.js";
|
|
15
|
+
import { Field as Y } from "./components/form/field/index.js";
|
|
16
|
+
import { Fieldset as w } from "./components/form/fieldset/index.js";
|
|
17
|
+
import { FileInputBase as V, FileInputField as W } from "./components/form/file-input/index.js";
|
|
18
|
+
import { HelperText as q } from "./components/form/helper-text/index.js";
|
|
19
|
+
import { Indicator as Q } from "./components/form/indicator/index.js";
|
|
20
|
+
import { Label as oo } from "./components/form/label/index.js";
|
|
21
|
+
import { Legend as eo } from "./components/form/legend/index.js";
|
|
22
|
+
import { RadioBase as po, RadioField as mo, RadioGroup as xo } from "./components/form/radio/index.js";
|
|
23
|
+
import { RadioCard as ao } from "./components/form/radio-card/index.js";
|
|
24
|
+
import { SelectField as no } from "./components/form/select/index.js";
|
|
25
|
+
import { SuperSelectField as To } from "./components/form/super-select/index.js";
|
|
26
|
+
import { TextInput as Oo, TextInputBase as So } from "./components/form/text-input/index.js";
|
|
27
|
+
import { TextAreaField as Ao } from "./components/form/textarea/index.js";
|
|
28
|
+
import { ToggleBase as Lo, ToggleField as co, ToggleGroup as Io } from "./components/form/toggle/index.js";
|
|
29
|
+
import { IconTile as Po } from "./components/icon-tile/index.js";
|
|
30
|
+
import { InlineLink as Bo } from "./components/inline-link/index.js";
|
|
31
|
+
import { MDSButton as Do } from "./components/legacy-button/index.js";
|
|
32
|
+
import { ModalProvider as Ro } from "./components/modal/index.js";
|
|
33
|
+
import { Separator as Fo } from "./components/separator/index.js";
|
|
34
|
+
import { STANDALONE_LINK_COLORS as bo, STANDALONE_LINK_ICON_POSITIONS as ko, STANDALONE_LINK_SIZES as ho, StandaloneLink as Mo } from "./components/standalone-link/index.js";
|
|
35
|
+
import { Table as Zo } from "./components/table/index.js";
|
|
36
|
+
import { getDensity as Ho, getHorizontalAlignment as Ko, getScope as Yo, getVerticalAlignment as zo } from "./components/table/utils.js";
|
|
37
|
+
import { Tabs as Xo } from "./components/tabs/index.js";
|
|
38
|
+
import { useTabsContext as Wo } from "./components/tabs/use-tabs-context.js";
|
|
39
|
+
import { TEXT_COLORS as qo, TEXT_WEIGHTS as Jo, Text as Qo } from "./components/text/index.js";
|
|
40
|
+
import { BarChart as or } from "./components/visualizations/bar-chart/index.js";
|
|
41
|
+
import { DonutChart as er } from "./components/visualizations/donut-chart/index.js";
|
|
42
|
+
import { PartnerCard as pr } from "./patterns/card/partner-card/index.js";
|
|
43
|
+
import { CardPrimitives as xr } from "./patterns/card/primitives.js";
|
|
44
|
+
import { CopyButton as ar } from "./patterns/copy-button/index.js";
|
|
45
|
+
import { LAYOUT_APPEARANCES as dr, LAYOUT_BACKGROUNDS as nr, LAYOUT_PADDING as lr, Layout as Tr, normalizeLayoutProps as Cr } from "./patterns/layout/index.js";
|
|
46
|
+
import { ProductBadge as Sr } from "./patterns/product-badge/index.js";
|
|
47
|
+
import { PRODUCT_LOGO_COLORS as Ar, PRODUCT_LOGO_PRODUCTS as sr, PRODUCT_LOGO_SIZES as Lr, ProductLogo as cr, normalizeProductLogoProps as Ir } from "./patterns/product-logo/index.js";
|
|
48
|
+
import { RelatedContent as Pr } from "./patterns/related-content/index.js";
|
|
49
|
+
import { useLarge as Br, useMedium as Nr, useMediumUp as Dr, useSmall as Er } from "./utils/hooks/use-screen-size.js";
|
|
50
|
+
import { MDSProvider as Gr } from "./utils/mds-context/index.js";
|
|
51
|
+
import { AccordionContent as Ur, AccordionItem as br, AccordionToggle as kr } from "./components/accordion/item/index.js";
|
|
52
|
+
import { RadioCardGroup as Mr } from "./components/form/radio-card/group.js";
|
|
53
|
+
import { useModal as Zr } from "./components/modal/use-modal.js";
|
|
54
|
+
import { NewsroomCard as Hr } from "./patterns/card/newsroom-card/index.js";
|
|
55
|
+
import { PersonCard as Yr } from "./patterns/card/person-card/index.js";
|
|
56
|
+
import { PromoCard as wr } from "./patterns/card/promo-card/index.js";
|
|
57
|
+
import { ResourceCard as Vr } from "./patterns/card/resource-card/index.js";
|
|
58
|
+
import { UnifiedCard as jr } from "./patterns/card/unified-card/index.js";
|
|
6
59
|
export {
|
|
7
60
|
e as Accordion,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
61
|
+
Ur as AccordionContent,
|
|
62
|
+
br as AccordionItem,
|
|
63
|
+
kr as AccordionToggle,
|
|
64
|
+
n as Alert,
|
|
65
|
+
l as AlertActions,
|
|
66
|
+
T as AlertButton,
|
|
67
|
+
C as AlertStandaloneLink,
|
|
68
|
+
p as BADGE_COLORS,
|
|
69
|
+
m as BADGE_SIZES,
|
|
70
|
+
x as BADGE_TYPES,
|
|
71
|
+
A as BUTTON_COLORS,
|
|
72
|
+
s as BUTTON_ICON_POSITIONS,
|
|
73
|
+
L as BUTTON_SIZES,
|
|
74
|
+
f as Badge,
|
|
75
|
+
i as BadgeCount,
|
|
76
|
+
or as BarChart,
|
|
77
|
+
S as Breadcrumbs,
|
|
78
|
+
c as Button,
|
|
79
|
+
_ as Card,
|
|
80
|
+
P as CardContent,
|
|
81
|
+
xr as CardPrimitives,
|
|
82
|
+
M as CheckboxBase,
|
|
83
|
+
v as CheckboxField,
|
|
84
|
+
Z as CheckboxGroup,
|
|
85
|
+
B as CodeBlock,
|
|
86
|
+
ar as CopyButton,
|
|
87
|
+
D as DisclosurePrimitive,
|
|
88
|
+
er as DonutChart,
|
|
89
|
+
F as Dropdown,
|
|
90
|
+
H as Error,
|
|
91
|
+
b as FLIGHT_ICON_SIZES,
|
|
92
|
+
Y as Field,
|
|
93
|
+
w as Fieldset,
|
|
94
|
+
V as FileInputBase,
|
|
95
|
+
W as FileInputField,
|
|
96
|
+
k as FlightIcon,
|
|
97
|
+
q as HelperText,
|
|
98
|
+
Po as IconTile,
|
|
99
|
+
Q as Indicator,
|
|
100
|
+
Bo as InlineLink,
|
|
101
|
+
dr as LAYOUT_APPEARANCES,
|
|
102
|
+
nr as LAYOUT_BACKGROUNDS,
|
|
103
|
+
lr as LAYOUT_PADDING,
|
|
104
|
+
oo as Label,
|
|
105
|
+
Tr as Layout,
|
|
106
|
+
eo as Legend,
|
|
107
|
+
Do as MDSButton,
|
|
108
|
+
Gr as MDSProvider,
|
|
109
|
+
Ro as ModalProvider,
|
|
110
|
+
Hr as NewsroomCard,
|
|
111
|
+
Ar as PRODUCT_LOGO_COLORS,
|
|
112
|
+
sr as PRODUCT_LOGO_PRODUCTS,
|
|
113
|
+
Lr as PRODUCT_LOGO_SIZES,
|
|
114
|
+
pr as PartnerCard,
|
|
115
|
+
Yr as PersonCard,
|
|
116
|
+
Sr as ProductBadge,
|
|
117
|
+
cr as ProductLogo,
|
|
118
|
+
wr as PromoCard,
|
|
119
|
+
po as RadioBase,
|
|
120
|
+
ao as RadioCard,
|
|
121
|
+
Mr as RadioCardGroup,
|
|
122
|
+
mo as RadioField,
|
|
123
|
+
xo as RadioGroup,
|
|
124
|
+
Pr as RelatedContent,
|
|
125
|
+
Vr as ResourceCard,
|
|
126
|
+
bo as STANDALONE_LINK_COLORS,
|
|
127
|
+
ko as STANDALONE_LINK_ICON_POSITIONS,
|
|
128
|
+
ho as STANDALONE_LINK_SIZES,
|
|
129
|
+
no as SelectField,
|
|
130
|
+
Fo as Separator,
|
|
131
|
+
Mo as StandaloneLink,
|
|
132
|
+
To as SuperSelectField,
|
|
133
|
+
qo as TEXT_COLORS,
|
|
134
|
+
Jo as TEXT_WEIGHTS,
|
|
135
|
+
Zo as Table,
|
|
136
|
+
Xo as Tabs,
|
|
137
|
+
Qo as Text,
|
|
138
|
+
Ao as TextAreaField,
|
|
139
|
+
Oo as TextInput,
|
|
140
|
+
So as TextInputBase,
|
|
141
|
+
Lo as ToggleBase,
|
|
142
|
+
co as ToggleField,
|
|
143
|
+
Io as ToggleGroup,
|
|
144
|
+
jr as UnifiedCard,
|
|
145
|
+
Ho as getDensity,
|
|
146
|
+
Ko as getHorizontalAlignment,
|
|
147
|
+
Yo as getScope,
|
|
148
|
+
zo as getVerticalAlignment,
|
|
149
|
+
Cr as normalizeLayoutProps,
|
|
150
|
+
Ir as normalizeProductLogoProps,
|
|
151
|
+
R as useDisclosurePrimitive,
|
|
152
|
+
Br as useLarge,
|
|
153
|
+
Nr as useMedium,
|
|
154
|
+
Dr as useMediumUp,
|
|
155
|
+
Zr as useModal,
|
|
156
|
+
Er as useSmall,
|
|
157
|
+
Wo as useTabsContext
|
|
104
158
|
};
|
|
105
159
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { UnifiedCard as d } from "../unified-card/index.js";
|
|
3
|
+
import i from "./style.module.css.js";
|
|
4
|
+
const f = ({
|
|
5
|
+
heading: r,
|
|
6
|
+
date: o,
|
|
7
|
+
category: m,
|
|
8
|
+
link: a,
|
|
9
|
+
thumbnail: e,
|
|
10
|
+
withArrow: s = !1
|
|
11
|
+
}) => /* @__PURE__ */ t(
|
|
12
|
+
d,
|
|
13
|
+
{
|
|
14
|
+
heading: r,
|
|
15
|
+
meta: [o, m],
|
|
16
|
+
link: a,
|
|
17
|
+
thumbnail: e,
|
|
18
|
+
withArrow: s,
|
|
19
|
+
className: i.newsroomCard
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
f.displayName = "NewsroomCard";
|
|
23
|
+
export {
|
|
24
|
+
f as NewsroomCard
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/patterns/card/newsroom-card/index.tsx"],"sourcesContent":["import type { ThumbnailProps } from '../types'\nimport { UnifiedCard } from '../unified-card'\nimport s from './style.module.css'\n\ninterface NewsroomCardProps {\n\theading: string\n\tdate: string\n\tcategory: string\n\tlink: string\n\tthumbnail?: ThumbnailProps\n\twithArrow?: boolean\n}\n\nconst NewsroomCard = ({\n\theading,\n\tdate,\n\tcategory,\n\tlink,\n\tthumbnail,\n\twithArrow = false,\n}: NewsroomCardProps) => {\n\treturn (\n\t\t<UnifiedCard\n\t\t\theading={heading}\n\t\t\tmeta={[date, category]}\n\t\t\tlink={link}\n\t\t\tthumbnail={thumbnail}\n\t\t\twithArrow={withArrow}\n\t\t\tclassName={s.newsroomCard}\n\t\t/>\n\t)\n}\n\nNewsroomCard.displayName = 'NewsroomCard'\n\nexport type { NewsroomCardProps }\nexport { NewsroomCard }\n"],"names":["NewsroomCard","heading","date","category","link","thumbnail","withArrow","jsx","UnifiedCard","s"],"mappings":";;;AAaA,MAAMA,IAAe,CAAC;AAAA,EACrB,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AACb,MAEE,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACA,SAAAP;AAAA,IACA,MAAM,CAACC,GAAMC,CAAQ;AAAA,IACrB,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAWG,EAAE;AAAA,EAAA;AAAA;AAKhBT,EAAa,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useMDSImage as C } from "../../../utils/mds-context/index.js";
|
|
4
|
+
import { Badge as P } from "../../../components/badge/index.js";
|
|
5
|
+
import { Text as u } from "../../../components/text/index.js";
|
|
6
|
+
import { CardPrimitives as t } from "../primitives.js";
|
|
7
|
+
import o from "./style.module.css.js";
|
|
8
|
+
const N = ({
|
|
9
|
+
heading: n,
|
|
10
|
+
description: m,
|
|
11
|
+
meta: d,
|
|
12
|
+
link: c,
|
|
13
|
+
productBadges: e,
|
|
14
|
+
competencyBadges: a,
|
|
15
|
+
logo: i,
|
|
16
|
+
className: h
|
|
17
|
+
}) => {
|
|
18
|
+
const f = C(), p = e && e.length > 0, s = a && a.length > 0;
|
|
19
|
+
return /* @__PURE__ */ l(
|
|
20
|
+
t.Root,
|
|
21
|
+
{
|
|
22
|
+
link: c,
|
|
23
|
+
withArrow: !1,
|
|
24
|
+
isExternal: !1,
|
|
25
|
+
className: h,
|
|
26
|
+
"aria-label": n,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ r("div", { className: o.logoContainer, children: /* @__PURE__ */ r(f, { ...i, alt: i.alt, className: o.logo }) }),
|
|
29
|
+
/* @__PURE__ */ l(t.Content, { children: [
|
|
30
|
+
/* @__PURE__ */ r(t.Meta, { items: d }),
|
|
31
|
+
/* @__PURE__ */ r(u.Body, { tag: "p", size: "200", className: o.description, children: m }),
|
|
32
|
+
p || s ? /* @__PURE__ */ r(t.ProductBadges, { badges: e || [], children: s && a.map((g, x) => /* @__PURE__ */ r(P, { text: g, icon: "dot" }, x)) }) : null
|
|
33
|
+
] })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
N.displayName = "PartnerCard";
|
|
39
|
+
export {
|
|
40
|
+
N as PartnerCard
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/patterns/card/partner-card/index.tsx"],"sourcesContent":["'use client'\n\nimport type { MDSImageProps } from '../../../utils/mds-context'\nimport { useMDSImage } from '../../../utils/mds-context'\nimport { Badge } from '../../../components/badge'\nimport { Text } from '../../../components/text'\nimport { CardPrimitives } from '../primitives'\nimport type { CardPatternProps } from '../types'\nimport s from './style.module.css'\n\ninterface PartnerCardProps {\n\theading: string\n\tdescription: string\n\tmeta: string[]\n\tlink: string\n\tproductBadges?: CardPatternProps['productBadges']\n\tcompetencyBadges?: string[]\n\tlogo: MDSImageProps\n\tclassName?: string\n}\n\nconst PartnerCard = ({\n\theading,\n\tdescription,\n\tmeta,\n\tlink,\n\tproductBadges,\n\tcompetencyBadges,\n\tlogo,\n\tclassName,\n}: PartnerCardProps) => {\n\tconst Image = useMDSImage()\n\n\tconst hasProductBadges = productBadges && productBadges.length > 0\n\tconst hasCompetencyBadges = competencyBadges && competencyBadges.length > 0\n\n\treturn (\n\t\t<CardPrimitives.Root\n\t\t\tlink={link}\n\t\t\twithArrow={false}\n\t\t\tisExternal={false}\n\t\t\tclassName={className}\n\t\t\taria-label={heading}\n\t\t>\n\t\t\t<div className={s.logoContainer}>\n\t\t\t\t<Image {...logo} alt={logo.alt} className={s.logo} />\n\t\t\t</div>\n\t\t\t<CardPrimitives.Content>\n\t\t\t\t<CardPrimitives.Meta items={meta} />\n\t\t\t\t<Text.Body tag=\"p\" size=\"200\" className={s.description}>\n\t\t\t\t\t{description}\n\t\t\t\t</Text.Body>\n\t\t\t\t{hasProductBadges || hasCompetencyBadges ? (\n\t\t\t\t\t<CardPrimitives.ProductBadges badges={productBadges || []}>\n\t\t\t\t\t\t{hasCompetencyBadges &&\n\t\t\t\t\t\t\tcompetencyBadges.map((competencyBadge, stableIdx) => (\n\t\t\t\t\t\t\t\t<Badge key={stableIdx} text={competencyBadge} icon=\"dot\" />\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</CardPrimitives.ProductBadges>\n\t\t\t\t) : null}\n\t\t\t</CardPrimitives.Content>\n\t\t</CardPrimitives.Root>\n\t)\n}\n\nPartnerCard.displayName = 'PartnerCard'\n\nexport type { PartnerCardProps }\nexport { PartnerCard }\n"],"names":["PartnerCard","heading","description","meta","link","productBadges","competencyBadges","logo","className","Image","hasProductBadges","jsxs","CardPrimitives","jsx","s","Text","hasCompetencyBadges","competencyBadge","stableIdx","Badge"],"mappings":";;;;;;;AAqBqB,MACpBA,IAAA,CAAA;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,MAAAC;AAAA,EACD,WAAAC;AACC,MAAA;AAEA,QAAMC,MAAmB,GACnBC,IAAAL,KAAsBA,EAAoB,SAAiB,OAGhEC,KAAAA,EAAA,SAAA;AAAA,SAAgB,gBAAAK;AAAA,IAAfC,EAAA;AAAA,IAAA;AAAA,MAEA,MAAAR;AAAA,MACA;MACA,YAAA;AAAA,MACA,WAAAI;AAAA,MAEA,cAAAP;AAAA,MAAA,UAAA;AAAA,QAGA,gBAAAY,EAAA,OAAC,EAAA,4BACA,UAAA,gBAAAA,EAAAJ,GAAA,EAAA,GAAAF,GAAA,KAAAA,EAAA,KAAA,WAAAO,EAAA,KAAA,CAAA,EAAA,CAAA;AAAA,QAAA,gBAAAH,EAAAC,EAAC,SAAoB,EAAA,UAAO;AAAA,UAC5B,gBAAAC,EAACD,EAAU,MAAI,EAAI,OAAKT,EAAA,CAAM;AAAA,UAG7B,gBAAAU,EAAoBE,EAAA,MAAA,EAAA,KAAA,KAAA,MAAA,OAAA,WACnBD,EAAA,aAAe,UAAfZ,EAAqC,CAAA;AAAA,UAMnCQ,KACLM,IAAA,gBAAAH,EAAAD,EAAA,eAAA,EAAA,QAAAP,KAAA,CAAA,GAAA,UAAAW,KAAAV,EAAA,IAAA,CAAAW,GAAAC,MAAA,gBAAAL,EAAAM,GAAA,EAAA,MAAAF,GAAA,MAAA,MAAA,GAAAC,CAAA,CAAA,EAAA,CAAA,IAAA;AAAA,QAAA,EAAA,CAAA;AAAA,MAAA;AAAA,IACD;AAAA,EAEF;AAEA;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const o = "description__-1CDK", n = "logoContainer__9VUWm", t = "logo__E1-po", i = {
|
|
2
|
+
description: o,
|
|
3
|
+
logoContainer: n,
|
|
4
|
+
logo: t
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
i as default,
|
|
8
|
+
o as description,
|
|
9
|
+
t as logo,
|
|
10
|
+
n as logoContainer
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=style.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as s } from "react";
|
|
3
|
+
import { Text as d } from "../../../components/text/index.js";
|
|
4
|
+
import { IconGithub16 as p } from "@hashicorp/flight-icons/svg-react/github-16";
|
|
5
|
+
import { IconTwitter16 as h } from "@hashicorp/flight-icons/svg-react/twitter-16";
|
|
6
|
+
import { IconLinkedin16 as u } from "@hashicorp/flight-icons/svg-react/linkedin-16";
|
|
7
|
+
import { IconLink16 as f } from "@hashicorp/flight-icons/svg-react/link-16";
|
|
8
|
+
import { IconMail16 as w } from "@hashicorp/flight-icons/svg-react/mail-16";
|
|
9
|
+
import { CardPrimitives as i } from "../primitives.js";
|
|
10
|
+
import m from "./style.module.css.js";
|
|
11
|
+
const I = /* @__PURE__ */ new Map([
|
|
12
|
+
// null signals that we don't want to render any icon
|
|
13
|
+
["hashicorp.com", null],
|
|
14
|
+
[
|
|
15
|
+
"twitter.com",
|
|
16
|
+
/* @__PURE__ */ o(h, { "data-testid": "wpl-personcard-twitter-icon" })
|
|
17
|
+
],
|
|
18
|
+
["github.com", /* @__PURE__ */ o(p, { "data-testid": "wpl-personcard-github-icon" })],
|
|
19
|
+
[
|
|
20
|
+
"linkedin.com",
|
|
21
|
+
/* @__PURE__ */ o(u, { "data-testid": "wpl-personcard-linkedin-icon" })
|
|
22
|
+
],
|
|
23
|
+
["mailto:", /* @__PURE__ */ o(w, { "data-testid": "wpl-personcard-mail-icon" })]
|
|
24
|
+
]), b = s(function({ url: a }) {
|
|
25
|
+
const { protocol: t, host: r } = new URL(a), n = I.get(t === "mailto:" ? "mailto:" : r);
|
|
26
|
+
return n === null ? null : /* @__PURE__ */ o("div", { className: m.thumbnailIcon, children: n ?? /* @__PURE__ */ o(f, { "data-testid": "wpl-personcard-link-icon" }) });
|
|
27
|
+
}), g = ({
|
|
28
|
+
link: l,
|
|
29
|
+
thumbnail: a,
|
|
30
|
+
name: t,
|
|
31
|
+
location: r,
|
|
32
|
+
bio: n,
|
|
33
|
+
productBadges: c
|
|
34
|
+
}) => /* @__PURE__ */ e(i.Root, { link: l, withArrow: !1, "aria-label": t, children: [
|
|
35
|
+
/* @__PURE__ */ e("div", { className: m.thumbnailContainer, children: [
|
|
36
|
+
/* @__PURE__ */ o(i.PersonThumbnail, { ...a }),
|
|
37
|
+
/* @__PURE__ */ o(b, { url: l })
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ e(i.Content, { children: [
|
|
40
|
+
/* @__PURE__ */ e("div", { children: [
|
|
41
|
+
/* @__PURE__ */ o(i.Heading, { children: t }),
|
|
42
|
+
r ? /* @__PURE__ */ o(d.Body, { tag: "p", size: "200", className: m.location, children: r }) : null
|
|
43
|
+
] }),
|
|
44
|
+
n ? /* @__PURE__ */ o(i.Description, { children: n }) : null,
|
|
45
|
+
c && c?.length > 0 ? /* @__PURE__ */ o(i.ProductBadges, { badges: c }) : null
|
|
46
|
+
] })
|
|
47
|
+
] });
|
|
48
|
+
g.displayName = "PersonCard";
|
|
49
|
+
export {
|
|
50
|
+
g as PersonCard
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/patterns/card/person-card/index.tsx"],"sourcesContent":["import { memo, type ReactNode } from 'react'\nimport { Text } from '../../../components/text'\nimport { IconGithub16 } from '@hashicorp/flight-icons/svg-react/github-16'\nimport { IconTwitter16 } from '@hashicorp/flight-icons/svg-react/twitter-16'\nimport { IconLinkedin16 } from '@hashicorp/flight-icons/svg-react/linkedin-16'\nimport { IconLink16 } from '@hashicorp/flight-icons/svg-react/link-16'\nimport { IconMail16 } from '@hashicorp/flight-icons/svg-react/mail-16'\nimport type { ProductBadgesProps, ThumbnailProps } from '../types'\nimport { CardPrimitives } from '../primitives'\nimport s from './style.module.css'\n\ninterface PersonCardProps {\n\tthumbnail: ThumbnailProps\n\tlink: string\n\tname: string\n\tlocation?: string\n\tbio?: string\n\tproductBadges?: ProductBadgesProps['badges']\n}\n\n// Map of hostnames to icons.\n/* eslint-disable react/jsx-key */\nconst iconMap = new Map<string, ReactNode>([\n\t// null signals that we don't want to render any icon\n\t['hashicorp.com', null],\n\t[\n\t\t'twitter.com',\n\t\t<IconTwitter16 data-testid={'wpl-personcard-twitter-icon'} />,\n\t],\n\t['github.com', <IconGithub16 data-testid={'wpl-personcard-github-icon'} />],\n\t[\n\t\t'linkedin.com',\n\t\t<IconLinkedin16 data-testid={'wpl-personcard-linkedin-icon'} />,\n\t],\n\t['mailto:', <IconMail16 data-testid={'wpl-personcard-mail-icon'} />],\n])\n/* eslint-enable react/jsx-key */\n\nconst Icon = memo(function Icon({ url }: { url: string }) {\n\tconst { protocol, host } = new URL(url)\n\tconst icon = iconMap.get(protocol === 'mailto:' ? 'mailto:' : host)\n\n\t// If the icon value is null, don't render an icon\n\tif (icon === null) {\n\t\treturn null\n\t}\n\n\t// Render the icon or the default icon if the icon value is undefined\n\treturn (\n\t\t<div className={s.thumbnailIcon}>\n\t\t\t{icon ?? <IconLink16 data-testid={'wpl-personcard-link-icon'} />}\n\t\t</div>\n\t)\n})\n\nconst PersonCard = ({\n\tlink,\n\tthumbnail,\n\tname,\n\tlocation,\n\tbio,\n\tproductBadges,\n}: PersonCardProps) => {\n\treturn (\n\t\t<CardPrimitives.Root link={link} withArrow={false} aria-label={name}>\n\t\t\t<div className={s.thumbnailContainer}>\n\t\t\t\t<CardPrimitives.PersonThumbnail {...thumbnail} />\n\t\t\t\t<Icon url={link} />\n\t\t\t</div>\n\t\t\t<CardPrimitives.Content>\n\t\t\t\t<div>\n\t\t\t\t\t<CardPrimitives.Heading>{name}</CardPrimitives.Heading>\n\t\t\t\t\t{location ? (\n\t\t\t\t\t\t<Text.Body tag=\"p\" size=\"200\" className={s.location}>\n\t\t\t\t\t\t\t{location}\n\t\t\t\t\t\t</Text.Body>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t\t{bio ? (\n\t\t\t\t\t<CardPrimitives.Description>{bio}</CardPrimitives.Description>\n\t\t\t\t) : null}\n\t\t\t\t{productBadges && productBadges?.length > 0 ? (\n\t\t\t\t\t<CardPrimitives.ProductBadges badges={productBadges} />\n\t\t\t\t) : null}\n\t\t\t</CardPrimitives.Content>\n\t\t</CardPrimitives.Root>\n\t)\n}\n\nPersonCard.displayName = 'PersonCard'\n\nexport type { PersonCardProps }\nexport { PersonCard }\n"],"names":["iconMap","jsx","IconTwitter16","IconGithub16","IconLinkedin16","IconMail16","Icon","memo","url","protocol","host","icon","s","IconLink16","PersonCard","link","thumbnail","name","location","bio","productBadges","jsxs","CardPrimitives","Text"],"mappings":";;;;;;;;;;AAsBA,MAAMA,wBAAc,IAAuB;AAAA;AAAA,EAE1C,CAAC,iBAAiB,IAAI;AAAA,EACtB;AAAA,IACC;AAAA,IACA,gBAAAC,EAACC,GAAA,EAAc,eAAa,8BAAA,CAA+B;AAAA,EAAA;AAAA,EAE5D,CAAC,cAAc,gBAAAD,EAACE,GAAA,EAAa,eAAa,8BAA8B,CAAE;AAAA,EAC1E;AAAA,IACC;AAAA,IACA,gBAAAF,EAACG,GAAA,EAAe,eAAa,+BAAA,CAAgC;AAAA,EAAA;AAAA,EAE9D,CAAC,WAAW,gBAAAH,EAACI,GAAA,EAAW,eAAa,4BAA4B,CAAE;AACpE,CAAC,GAGKC,IAAOC,EAAK,SAAc,EAAE,KAAAC,KAAwB;AACzD,QAAM,EAAE,UAAAC,GAAU,MAAAC,EAAA,IAAS,IAAI,IAAIF,CAAG,GAChCG,IAAOX,EAAQ,IAAIS,MAAa,YAAY,YAAYC,CAAI;AAGlE,SAAIC,MAAS,OACL,OAKP,gBAAAV,EAAC,OAAA,EAAI,WAAWW,EAAE,eAChB,eAAQ,gBAAAX,EAACY,GAAA,EAAW,eAAa,2BAAA,CAA4B,EAAA,CAC/D;AAEF,CAAC,GAEKC,IAAa,CAAC;AAAA,EACnB,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,KAAAC;AAAA,EACA,eAAAC;AACD,MAEE,gBAAAC,EAACC,EAAe,MAAf,EAAoB,MAAAP,GAAY,WAAW,IAAO,cAAYE,GAC9D,UAAA;AAAA,EAAA,gBAAAI,EAAC,OAAA,EAAI,WAAWT,EAAE,oBACjB,UAAA;AAAA,IAAA,gBAAAX,EAACqB,EAAe,iBAAf,EAAgC,GAAGN,EAAA,CAAW;AAAA,IAC/C,gBAAAf,EAACK,GAAA,EAAK,KAAKS,EAAA,CAAM;AAAA,EAAA,GAClB;AAAA,EACA,gBAAAM,EAACC,EAAe,SAAf,EACA,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EACA,UAAA;AAAA,MAAA,gBAAApB,EAACqB,EAAe,SAAf,EAAwB,UAAAL,EAAA,CAAK;AAAA,MAC7BC,IACA,gBAAAjB,EAACsB,EAAK,MAAL,EAAU,KAAI,KAAI,MAAK,OAAM,WAAWX,EAAE,UACzC,aACF,IACG;AAAA,IAAA,GACL;AAAA,IACCO,IACA,gBAAAlB,EAACqB,EAAe,aAAf,EAA4B,aAAI,IAC9B;AAAA,IACHF,KAAiBA,GAAe,SAAS,IACzC,gBAAAnB,EAACqB,EAAe,eAAf,EAA6B,QAAQF,EAAA,CAAe,IAClD;AAAA,EAAA,EAAA,CACL;AAAA,GACD;AAIFN,EAAW,cAAc;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const n = "location__OjUu5", t = "thumbnailContainer__ATYhC", o = "thumbnailIcon__Sx-P-", a = {
|
|
2
|
+
location: n,
|
|
3
|
+
thumbnailContainer: t,
|
|
4
|
+
thumbnailIcon: o
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
a as default,
|
|
8
|
+
n as location,
|
|
9
|
+
t as thumbnailContainer,
|
|
10
|
+
o as thumbnailIcon
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=style.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as v } from "react";
|
|
3
|
+
import { Card as w } from "../../components/card/index.js";
|
|
4
|
+
import { Text as n } from "../../components/text/index.js";
|
|
5
|
+
import { IconArrowRight24 as C } from "@hashicorp/flight-icons/svg-react/arrow-right-24";
|
|
6
|
+
import { ProductBadge as x } from "../product-badge/index.js";
|
|
7
|
+
import { LogoThumbnail as P, PersonThumbnail as B, Thumbnail as D } from "./thumbnails/index.js";
|
|
8
|
+
import e from "./style.module.css.js";
|
|
9
|
+
import L from "classnames";
|
|
10
|
+
const d = v((a, t) => {
|
|
11
|
+
const {
|
|
12
|
+
withArrow: i = !0,
|
|
13
|
+
link: s,
|
|
14
|
+
clickHandler: h,
|
|
15
|
+
isExternal: N,
|
|
16
|
+
children: g,
|
|
17
|
+
className: f,
|
|
18
|
+
"aria-label": b
|
|
19
|
+
} = a;
|
|
20
|
+
return /* @__PURE__ */ o(
|
|
21
|
+
w,
|
|
22
|
+
{
|
|
23
|
+
className: L(e.card, f),
|
|
24
|
+
href: s,
|
|
25
|
+
onClickCapture: h,
|
|
26
|
+
isExternal: N,
|
|
27
|
+
ref: t,
|
|
28
|
+
"aria-label": b,
|
|
29
|
+
children: [
|
|
30
|
+
g,
|
|
31
|
+
/* @__PURE__ */ r("div", { className: e.cta, children: i ? /* @__PURE__ */ r(C, {}) : null })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
d.displayName = "CardPrimitives.Root";
|
|
37
|
+
const c = ({ items: a }) => /* @__PURE__ */ r("div", { className: e.meta, "data-testid": "wpl-card-meta", children: /* @__PURE__ */ r(n.Label, { children: a.map((t, i) => {
|
|
38
|
+
const s = i === a.length - 1;
|
|
39
|
+
return /* @__PURE__ */ o(y, { children: [
|
|
40
|
+
t,
|
|
41
|
+
s ? null : /* @__PURE__ */ r("span", { className: e.metaSeparator, "aria-hidden": !0, children: "|" })
|
|
42
|
+
] });
|
|
43
|
+
}) }) });
|
|
44
|
+
c.displayName = "Meta";
|
|
45
|
+
const l = ({ children: a }) => /* @__PURE__ */ r("div", { className: e.content, "data-testid": "wpl-card-content", children: a });
|
|
46
|
+
l.displayName = "Content";
|
|
47
|
+
const m = ({ as: a = "h2", children: t }) => /* @__PURE__ */ r(n.DisplayExpressive, { tag: a, size: "200", className: e.heading, children: t });
|
|
48
|
+
m.displayName = "Heading";
|
|
49
|
+
const p = ({ badges: a, children: t }) => /* @__PURE__ */ o("div", { className: e.productBadges, "data-testid": "wpl-card-badges", children: [
|
|
50
|
+
a.map((i, s) => /* @__PURE__ */ r(
|
|
51
|
+
x,
|
|
52
|
+
{
|
|
53
|
+
productName: i,
|
|
54
|
+
hasDot: !0
|
|
55
|
+
},
|
|
56
|
+
`product-badge-${s}`
|
|
57
|
+
)),
|
|
58
|
+
t
|
|
59
|
+
] });
|
|
60
|
+
p.displayName = "ProductBadges";
|
|
61
|
+
const u = ({ children: a }) => /* @__PURE__ */ r(n.Body, { tag: "p", size: "200", className: e.description, children: a });
|
|
62
|
+
u.displayName = "Description";
|
|
63
|
+
const M = {
|
|
64
|
+
Root: d,
|
|
65
|
+
Thumbnail: D,
|
|
66
|
+
PersonThumbnail: B,
|
|
67
|
+
LogoThumbnail: P,
|
|
68
|
+
Meta: c,
|
|
69
|
+
Content: l,
|
|
70
|
+
Heading: m,
|
|
71
|
+
Description: u,
|
|
72
|
+
ProductBadges: p
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
M as CardPrimitives
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.js","sources":["../../../src/patterns/card/primitives.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { Card as MDSCard } from '../../components/card'\nimport { Text } from '../../components/text'\nimport { IconArrowRight24 } from '@hashicorp/flight-icons/svg-react/arrow-right-24'\nimport { ProductBadge } from '../product-badge'\nimport { Thumbnail, PersonThumbnail, LogoThumbnail } from './thumbnails'\nimport type {\n\tCardPrimitiveProps,\n\tMetaProps,\n\tContentProps,\n\tHeadingProps,\n\tProductBadgesProps,\n\tDescriptionProps,\n} from './types'\nimport s from './style.module.css'\nimport classNames from 'classnames'\n\nconst Root = forwardRef<HTMLDivElement, CardPrimitiveProps>((props, ref) => {\n\tconst {\n\t\twithArrow = true,\n\t\tlink,\n\t\tclickHandler,\n\t\tisExternal,\n\t\tchildren,\n\t\tclassName,\n\t\t'aria-label': ariaLabel,\n\t} = props\n\n\treturn (\n\t\t<MDSCard\n\t\t\tclassName={classNames(s.card, className)}\n\t\t\thref={link}\n\t\t\tonClickCapture={clickHandler}\n\t\t\tisExternal={isExternal}\n\t\t\tref={ref}\n\t\t\taria-label={ariaLabel}\n\t\t>\n\t\t\t{children}\n\t\t\t<div className={s.cta}>{withArrow ? <IconArrowRight24 /> : null}</div>\n\t\t</MDSCard>\n\t)\n})\n\nRoot.displayName = 'CardPrimitives.Root'\n\nconst Meta = ({ items }: MetaProps) => {\n\treturn (\n\t\t<div className={s.meta} data-testid=\"wpl-card-meta\">\n\t\t\t<Text.Label>\n\t\t\t\t{items.map((item, stableIdx) => {\n\t\t\t\t\tconst isLastItem = stableIdx === items.length - 1\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{item}\n\t\t\t\t\t\t\t{!isLastItem ? (\n\t\t\t\t\t\t\t\t<span className={s.metaSeparator} aria-hidden={true}>\n\t\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</Text.Label>\n\t\t</div>\n\t)\n}\n\nMeta.displayName = 'Meta'\n\nconst Content = ({ children }: ContentProps) => {\n\treturn (\n\t\t<div className={s.content} data-testid=\"wpl-card-content\">\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nContent.displayName = 'Content'\n\nconst Heading = ({ as = 'h2', children }: HeadingProps) => {\n\treturn (\n\t\t<Text.DisplayExpressive tag={as} size=\"200\" className={s.heading}>\n\t\t\t{children}\n\t\t</Text.DisplayExpressive>\n\t)\n}\n\nHeading.displayName = 'Heading'\n\nconst ProductBadges = ({ badges, children }: ProductBadgesProps) => {\n\treturn (\n\t\t<div className={s.productBadges} data-testid=\"wpl-card-badges\">\n\t\t\t{badges.map((badge, stableIdx) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ProductBadge\n\t\t\t\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t\t\t\tkey={`product-badge-${stableIdx}`}\n\t\t\t\t\t\tproductName={badge}\n\t\t\t\t\t\thasDot={true}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t})}\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nProductBadges.displayName = 'ProductBadges'\n\nconst Description = ({ children }: DescriptionProps) => {\n\treturn (\n\t\t<Text.Body tag=\"p\" size=\"200\" className={s.description}>\n\t\t\t{children}\n\t\t</Text.Body>\n\t)\n}\n\nDescription.displayName = 'Description'\n\nconst CardPrimitives = {\n\tRoot,\n\tThumbnail,\n\tPersonThumbnail,\n\tLogoThumbnail,\n\tMeta,\n\tContent,\n\tHeading,\n\tDescription,\n\tProductBadges,\n}\n\nexport { CardPrimitives }\n"],"names":["Root","forwardRef","props","ref","withArrow","link","clickHandler","isExternal","children","className","ariaLabel","jsxs","MDSCard","classNames","s","jsx","IconArrowRight24","Meta","items","Text","item","stableIdx","isLastItem","Fragment","Content","Heading","as","ProductBadges","badges","badge","ProductBadge","Description","CardPrimitives","Thumbnail","PersonThumbnail","LogoThumbnail"],"mappings":";;;;;;;;;AAiBA,MAAMA,IAAOC,EAA+C,CAACC,GAAOC,MAAQ;AAC3E,QAAM;AAAA,IACL,WAAAC,IAAY;AAAA,IACZ,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAcC;AAAA,EAAA,IACXR;AAEJ,SACC,gBAAAS;AAAA,IAACC;AAAAA,IAAA;AAAA,MACA,WAAWC,EAAWC,EAAE,MAAML,CAAS;AAAA,MACvC,MAAMJ;AAAA,MACN,gBAAgBC;AAAA,MAChB,YAAAC;AAAA,MACA,KAAAJ;AAAA,MACA,cAAYO;AAAA,MAEX,UAAA;AAAA,QAAAF;AAAA,QACD,gBAAAO,EAAC,SAAI,WAAWD,EAAE,KAAM,UAAAV,IAAY,gBAAAW,EAACC,GAAA,CAAA,CAAiB,IAAK,KAAA,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGnE,CAAC;AAEDhB,EAAK,cAAc;AAEnB,MAAMiB,IAAO,CAAC,EAAE,OAAAC,QAEd,gBAAAH,EAAC,OAAA,EAAI,WAAWD,EAAE,MAAM,eAAY,iBACnC,UAAA,gBAAAC,EAACI,EAAK,OAAL,EACC,UAAAD,EAAM,IAAI,CAACE,GAAMC,MAAc;AAC/B,QAAMC,IAAaD,MAAcH,EAAM,SAAS;AAChD,SACC,gBAAAP,EAAAY,GAAA,EACE,UAAA;AAAA,IAAAH;AAAA,IACCE,IAIE,OAHH,gBAAAP,EAAC,QAAA,EAAK,WAAWD,EAAE,eAAe,eAAa,IAAM,UAAA,IAAA,CAErD;AAAA,EACG,GACL;AAEF,CAAC,GACF,GACD;AAIFG,EAAK,cAAc;AAEnB,MAAMO,IAAU,CAAC,EAAE,UAAAhB,0BAEhB,OAAA,EAAI,WAAWM,EAAE,SAAS,eAAY,oBACrC,UAAAN,GACF;AAIFgB,EAAQ,cAAc;AAEtB,MAAMC,IAAU,CAAC,EAAE,IAAAC,IAAK,MAAM,UAAAlB,QAE5B,gBAAAO,EAACI,EAAK,mBAAL,EAAuB,KAAKO,GAAI,MAAK,OAAM,WAAWZ,EAAE,SACvD,UAAAN,EAAA,CACF;AAIFiB,EAAQ,cAAc;AAEtB,MAAME,IAAgB,CAAC,EAAE,QAAAC,GAAQ,UAAApB,0BAE9B,OAAA,EAAI,WAAWM,EAAE,eAAe,eAAY,mBAC3C,UAAA;AAAA,EAAAc,EAAO,IAAI,CAACC,GAAOR,MAElB,gBAAAN;AAAA,IAACe;AAAA,IAAA;AAAA,MAGA,aAAaD;AAAA,MACb,QAAQ;AAAA,IAAA;AAAA,IAFH,iBAAiBR,CAAS;AAAA,EAAA,CAKjC;AAAA,EACAb;AAAA,GACF;AAIFmB,EAAc,cAAc;AAE5B,MAAMI,IAAc,CAAC,EAAE,UAAAvB,QAErB,gBAAAO,EAACI,EAAK,MAAL,EAAU,KAAI,KAAI,MAAK,OAAM,WAAWL,EAAE,aACzC,UAAAN,EAAA,CACF;AAIFuB,EAAY,cAAc;AAE1B,MAAMC,IAAiB;AAAA,EACtB,MAAAhC;AAAA,EACA,WAAAiC;AAAA,EACA,iBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,MAAAlB;AAAA,EACA,SAAAO;AAAA,EACA,SAAAC;AAAA,EACA,aAAAM;AAAA,EACA,eAAAJ;AACD;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { CardPrimitives as r } from "../primitives.js";
|
|
3
|
+
const f = ({
|
|
4
|
+
heading: e,
|
|
5
|
+
description: i,
|
|
6
|
+
eyebrow: o,
|
|
7
|
+
link: t,
|
|
8
|
+
clickHandler: m,
|
|
9
|
+
thumbnail: a,
|
|
10
|
+
withArrow: s = !1,
|
|
11
|
+
isExternal: d = !1,
|
|
12
|
+
className: c
|
|
13
|
+
}) => /* @__PURE__ */ n(
|
|
14
|
+
r.Root,
|
|
15
|
+
{
|
|
16
|
+
link: t,
|
|
17
|
+
withArrow: s,
|
|
18
|
+
isExternal: d,
|
|
19
|
+
className: c,
|
|
20
|
+
clickHandler: m,
|
|
21
|
+
"aria-label": e,
|
|
22
|
+
children: [
|
|
23
|
+
a ? /* @__PURE__ */ l(r.Thumbnail, { ...a }) : null,
|
|
24
|
+
/* @__PURE__ */ n(r.Content, { children: [
|
|
25
|
+
o ? /* @__PURE__ */ l(r.Meta, { items: [o] }) : null,
|
|
26
|
+
/* @__PURE__ */ l(r.Heading, { children: e }),
|
|
27
|
+
i ? /* @__PURE__ */ l(r.Description, { children: i }) : null
|
|
28
|
+
] })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
f.displayName = "PromoCard";
|
|
33
|
+
export {
|
|
34
|
+
f as PromoCard
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/patterns/card/promo-card/index.tsx"],"sourcesContent":["import { CardPrimitives } from '../primitives'\nimport type { ThumbnailProps } from '../types'\n\ninterface PromoCardProps {\n\theading: string\n\tdescription?: string\n\teyebrow?: string\n\tlink: string\n\tclickHandler?: () => void\n\tthumbnail?: ThumbnailProps\n\twithArrow?: boolean\n\tisExternal?: boolean\n\tclassName?: string\n}\n\nconst PromoCard = ({\n\theading,\n\tdescription,\n\teyebrow,\n\tlink,\n\tclickHandler,\n\tthumbnail,\n\twithArrow = false,\n\tisExternal = false,\n\tclassName,\n}: PromoCardProps) => {\n\treturn (\n\t\t<CardPrimitives.Root\n\t\t\tlink={link}\n\t\t\twithArrow={withArrow}\n\t\t\tisExternal={isExternal}\n\t\t\tclassName={className}\n\t\t\tclickHandler={clickHandler}\n\t\t\taria-label={heading}\n\t\t>\n\t\t\t{thumbnail ? <CardPrimitives.Thumbnail {...thumbnail} /> : null}\n\t\t\t<CardPrimitives.Content>\n\t\t\t\t{eyebrow ? <CardPrimitives.Meta items={[eyebrow]} /> : null}\n\t\t\t\t<CardPrimitives.Heading>{heading}</CardPrimitives.Heading>\n\t\t\t\t{description ? (\n\t\t\t\t\t<CardPrimitives.Description>{description}</CardPrimitives.Description>\n\t\t\t\t) : null}\n\t\t\t</CardPrimitives.Content>\n\t\t</CardPrimitives.Root>\n\t)\n}\n\nPromoCard.displayName = 'PromoCard'\n\nexport type { PromoCardProps }\nexport { PromoCard }\n"],"names":["PromoCard","heading","description","eyebrow","link","clickHandler","thumbnail","withArrow","isExternal","className","jsxs","CardPrimitives","jsx"],"mappings":";;AAeA,MAAMA,IAAY,CAAC;AAAA,EAClB,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,WAAAC;AACD,MAEE,gBAAAC;AAAA,EAACC,EAAe;AAAA,EAAf;AAAA,IACA,MAAAP;AAAA,IACA,WAAAG;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAJ;AAAA,IACA,cAAYJ;AAAA,IAEX,UAAA;AAAA,MAAAK,sBAAaK,EAAe,WAAf,EAA0B,GAAGL,GAAW,IAAK;AAAA,MAC3D,gBAAAI,EAACC,EAAe,SAAf,EACC,UAAA;AAAA,QAAAR,IAAU,gBAAAS,EAACD,EAAe,MAAf,EAAoB,OAAO,CAACR,CAAO,GAAG,IAAK;AAAA,QACvD,gBAAAS,EAACD,EAAe,SAAf,EAAwB,UAAAV,EAAA,CAAQ;AAAA,QAChCC,IACA,gBAAAU,EAACD,EAAe,aAAf,EAA4B,aAAY,IACtC;AAAA,MAAA,EAAA,CACL;AAAA,IAAA;AAAA,EAAA;AAAA;AAKHX,EAAU,cAAc;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { UnifiedCard as d } from "../unified-card/index.js";
|
|
3
|
+
const n = ({
|
|
4
|
+
heading: o,
|
|
5
|
+
date: r,
|
|
6
|
+
category: e,
|
|
7
|
+
link: m,
|
|
8
|
+
productBadges: s,
|
|
9
|
+
thumbnail: t,
|
|
10
|
+
isExternal: a
|
|
11
|
+
}) => /* @__PURE__ */ i(
|
|
12
|
+
d,
|
|
13
|
+
{
|
|
14
|
+
link: m,
|
|
15
|
+
meta: r ? [r, e] : [e],
|
|
16
|
+
productBadges: s,
|
|
17
|
+
thumbnail: t,
|
|
18
|
+
isExternal: a,
|
|
19
|
+
heading: o
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
n.displayName = "ResourceCard";
|
|
23
|
+
export {
|
|
24
|
+
n as ResourceCard
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|