@hashicorp/mds-react 0.9.12 → 0.9.14
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/item/index.js.map +1 -1
- package/components/accordion/style.module.scss +4 -4
- package/components/alert/alert.module.scss +2 -4
- package/components/alert/index.js.map +1 -1
- package/components/badge/index.js.map +1 -1
- package/components/badge/style.module.scss +1 -7
- package/components/badge-count/index.js.map +1 -1
- package/components/badge-count/style.module.scss +1 -6
- package/components/breadcrumbs/index.js.map +1 -1
- package/components/breadcrumbs/style.module.scss +2 -2
- package/components/button/button-primitive.js.map +1 -1
- package/components/button/styles.module.scss +9 -13
- package/components/card/index.js.map +1 -1
- package/components/code-block/code-block.module.scss +5 -11
- package/components/code-block/code-lines/utils/split-jsx-into-lines.js.map +1 -1
- package/components/code-block/hidden-copy-content/index.js.map +1 -1
- package/components/code-block/index.js.map +1 -1
- package/components/code-block/utils/parse-highlighted-lines.js.map +1 -1
- package/components/code-block/utils/shellwords.js.map +1 -1
- package/components/combo-box-primitive/index.js.map +1 -1
- package/components/dialog-primitive/index.js.map +1 -1
- package/components/disclosure-primitive/index.js.map +1 -1
- package/components/disclosure-primitive/use-disclosure-primitive.js.map +1 -1
- package/components/dismiss-button/styles.module.scss +1 -6
- package/components/dropdown/index.js.map +1 -1
- package/components/dropdown/list-item/styles.module.css +2 -6
- package/components/dropdown/list-item/title.js.map +1 -1
- package/components/dropdown/toggle-button/index.js.map +1 -1
- package/components/dropdown/toggle-button/styles.module.scss +5 -5
- package/components/flight-icon/index.js.map +1 -1
- package/components/form/checkbox/form-checkbox.module.css +4 -11
- package/components/form/file-input/form-file-input.module.scss +1 -1
- package/components/form/radio/form-radio.module.scss +2 -5
- package/components/form/radio-card/form-radio-card.module.css +1 -2
- package/components/form/radio-card/index.js.map +1 -1
- package/components/form/select/form-select.module.css +6 -14
- package/components/form/select/index.js.map +1 -1
- package/components/form/super-select/form-super-select.module.css +4 -10
- package/components/form/super-select/index.js.map +1 -1
- package/components/form/text-input/index.js.map +1 -1
- package/components/form/text-input/styles.module.css +7 -21
- package/components/form/textarea/form-textarea.module.css +1 -2
- package/components/form/textarea/index.js.map +1 -1
- package/components/form/toggle/form-toggle.module.scss +7 -20
- package/components/icon-tile/index.js.map +1 -1
- package/components/icon-tile/style.module.scss +3 -18
- package/components/index.d.ts +2 -0
- package/components/index.js +49 -45
- package/components/index.js.map +1 -1
- package/components/interactive/index.d.ts +2 -2
- package/components/interactive/index.js.map +1 -1
- package/components/legacy-button/index.js.map +1 -1
- package/components/legacy-button/utils.js.map +1 -1
- package/components/menu-primitive/index.js.map +1 -1
- package/components/menu-primitive/use-menu-primitive.js.map +1 -1
- package/components/modal/index.js.map +1 -1
- package/components/modal/use-modal.js.map +1 -1
- package/components/skeleton/index.d.ts +14 -0
- package/components/skeleton/index.js +30 -0
- package/components/skeleton/index.js.map +1 -0
- package/components/skeleton/skeleton-form/index.d.ts +7 -0
- package/components/skeleton/skeleton-form/index.js +19 -0
- package/components/skeleton/skeleton-form/index.js.map +1 -0
- package/components/skeleton/skeleton-form/skeleton-form.module.css +32 -0
- package/components/skeleton/skeleton-form/skeleton-form.module.css.js +11 -0
- package/components/skeleton/skeleton-form/skeleton-form.module.css.js.map +1 -0
- package/components/skeleton/skeleton.module.css +87 -0
- package/components/skeleton/skeleton.module.css.js +19 -0
- package/components/skeleton/skeleton.module.css.js.map +1 -0
- package/components/standalone-link/index.js.map +1 -1
- package/components/standalone-link/styles.module.scss +4 -6
- package/components/table/index.js.map +1 -1
- package/components/table/td.js.map +1 -1
- package/components/table/th.js.map +1 -1
- package/components/table/utils.js.map +1 -1
- package/components/tabs/index.js.map +1 -1
- package/components/tabs/tab-panel.js.map +1 -1
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.module.scss +11 -54
- package/components/tabs/use-tabs-context.js.map +1 -1
- package/components/text/index.js.map +1 -1
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js +19 -18
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js.map +1 -1
- package/components/visualizations/bar-chart/horizontal-chart/index.js +1 -1
- package/components/visualizations/bar-chart/horizontal-chart/index.js.map +1 -1
- package/components/visualizations/bar-chart/horizontal-chart/style.module.css +2 -2
- package/components/visualizations/bar-chart/style.module.css +2 -4
- package/components/visualizations/donut-chart/index.js +49 -48
- package/components/visualizations/donut-chart/index.js.map +1 -1
- package/components/visualizations/donut-chart/styles.module.css +2 -4
- package/index.js +107 -101
- package/index.js.map +1 -1
- package/package.json +8 -7
- package/patterns/card/style.module.css +0 -2
- package/patterns/card/unified-card/index.js.map +1 -1
- package/patterns/copy-button/index.d.ts +3 -3
- package/patterns/copy-button/index.js +17 -17
- package/patterns/copy-button/index.js.map +1 -1
- package/patterns/layout/layout.module.css +2 -8
- package/patterns/product-badge/style.module.css +1 -1
- package/patterns/related-content/style.module.css +1 -1
- package/style.css +1 -1
- package/styles/mixins/button.scss +18 -73
- package/styles/mixins/focus-ring.scss +1 -8
- package/{patterns/copy-button → utils}/clipboard.d.ts +5 -5
- package/{patterns/copy-button → utils}/clipboard.js +1 -1
- package/utils/clipboard.js.map +1 -0
- package/utils/get-contrast-yiq.js.map +1 -1
- package/utils/hooks/use-media-query/index.d.ts +1 -0
- package/utils/hooks/use-media-query/index.js +16 -0
- package/utils/hooks/use-media-query/index.js.map +1 -0
- package/utils/hooks/{use-screen-size.js → use-screen-size/index.js} +2 -2
- package/utils/hooks/use-screen-size/index.js.map +1 -0
- package/utils/i18n/constants/index.d.ts +14 -0
- package/utils/i18n/constants/index.js.map +1 -1
- package/utils/i18n/helpers/index.d.ts +1 -0
- package/utils/i18n/helpers/is-supported-local.d.ts +2 -0
- package/utils/i18n/helpers/{index.js → is-supported-local.js} +1 -1
- package/utils/i18n/helpers/is-supported-local.js.map +1 -0
- package/utils/i18n/helpers/locale-provider.d.ts +1 -1
- package/utils/i18n/helpers/locale-provider.js +1 -1
- package/utils/i18n/helpers/locale-provider.js.map +1 -1
- package/utils/i18n/helpers/to-smart-sentence-case.d.ts +1 -1
- package/utils/i18n/helpers/to-smart-sentence-case.js.map +1 -1
- package/utils/i18n/helpers/to-smart-title-case.d.ts +1 -1
- package/utils/i18n/helpers/to-smart-title-case.js.map +1 -1
- package/utils/i18n/helpers/use-locale.d.ts +1 -1
- package/utils/i18n/helpers/use-locale.js +6 -6
- package/utils/i18n/helpers/use-locale.js.map +1 -1
- package/utils/i18n/index.d.ts +1 -1
- package/utils/i18n/index.js.map +1 -1
- package/utils/i18n/types.d.ts +2 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +8 -6
- package/utils/index.js.map +1 -1
- package/utils/make-normalizer/index.js.map +1 -1
- package/utils/mds-context/index.js.map +1 -1
- package/hooks/use-media-query/index.js +0 -16
- package/hooks/use-media-query/index.js.map +0 -1
- package/patterns/copy-button/clipboard.js.map +0 -1
- package/utils/hooks/use-screen-size.js.map +0 -1
- package/utils/i18n/helpers/index.js.map +0 -1
- /package/utils/hooks/{use-screen-size.d.ts → use-screen-size/index.d.ts} +0 -0
package/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Accordion as e } from "./components/accordion/index.js";
|
|
2
2
|
import { BADGE_COLORS as p, BADGE_SIZES as m, BADGE_TYPES as x, Badge as f } from "./components/badge/index.js";
|
|
3
3
|
import { BadgeCount as i } from "./components/badge-count/index.js";
|
|
4
|
-
import { Alert as n, AlertActions as l, AlertButton as
|
|
5
|
-
import { Breadcrumbs as
|
|
6
|
-
import { BUTTON_COLORS as
|
|
4
|
+
import { Alert as n, AlertActions as l, AlertButton as C, AlertStandaloneLink as S } from "./components/alert/index.js";
|
|
5
|
+
import { Breadcrumbs as O } from "./components/breadcrumbs/index.js";
|
|
6
|
+
import { BUTTON_COLORS as c, BUTTON_ICON_POSITIONS as L, BUTTON_SIZES as s, Button as A } from "./components/button/index.js";
|
|
7
7
|
import { Card as _, CardContent as P } from "./components/card/index.js";
|
|
8
8
|
import { CodeBlock as B } from "./components/code-block/index.js";
|
|
9
9
|
import { DisclosurePrimitive as D } from "./components/disclosure-primitive/index.js";
|
|
10
10
|
import { useDisclosurePrimitive as R } from "./components/disclosure-primitive/use-disclosure-primitive.js";
|
|
11
|
-
import { Dropdown as
|
|
12
|
-
import { FLIGHT_ICON_SIZES as
|
|
13
|
-
import { CheckboxBase as v, CheckboxField as M, CheckboxGroup as
|
|
14
|
-
import { Error as
|
|
11
|
+
import { Dropdown as G } from "./components/dropdown/index.js";
|
|
12
|
+
import { FLIGHT_ICON_SIZES as k, FlightIcon as b } from "./components/flight-icon/index.js";
|
|
13
|
+
import { CheckboxBase as v, CheckboxField as M, CheckboxGroup as H } from "./components/form/checkbox/index.js";
|
|
14
|
+
import { Error as y } from "./components/form/error/index.js";
|
|
15
15
|
import { Field as Y } from "./components/form/field/index.js";
|
|
16
16
|
import { Fieldset as w } from "./components/form/fieldset/index.js";
|
|
17
17
|
import { FileInputBase as V, FileInputField as W } from "./components/form/file-input/index.js";
|
|
@@ -22,142 +22,148 @@ import { Legend as eo } from "./components/form/legend/index.js";
|
|
|
22
22
|
import { RadioBase as po, RadioField as mo, RadioGroup as xo } from "./components/form/radio/index.js";
|
|
23
23
|
import { RadioCard as ao } from "./components/form/radio-card/index.js";
|
|
24
24
|
import { SelectField as no } from "./components/form/select/index.js";
|
|
25
|
-
import { SuperSelectField as
|
|
26
|
-
import { TextInput as
|
|
27
|
-
import { TextAreaField as
|
|
25
|
+
import { SuperSelectField as Co } from "./components/form/super-select/index.js";
|
|
26
|
+
import { TextInput as To, TextInputBase as Oo } from "./components/form/text-input/index.js";
|
|
27
|
+
import { TextAreaField as co } from "./components/form/textarea/index.js";
|
|
28
28
|
import { ToggleBase as so, ToggleField as Ao, ToggleGroup as Io } from "./components/form/toggle/index.js";
|
|
29
29
|
import { IconTile as Po } from "./components/icon-tile/index.js";
|
|
30
30
|
import { InlineLink as Bo } from "./components/inline-link/index.js";
|
|
31
31
|
import { MDSButton as Do } from "./components/legacy-button/index.js";
|
|
32
32
|
import { ModalProvider as Ro } from "./components/modal/index.js";
|
|
33
|
-
import { Separator as
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
33
|
+
import { Separator as Go } from "./components/separator/index.js";
|
|
34
|
+
import { Skeleton as ko } from "./components/skeleton/index.js";
|
|
35
|
+
import { SkeletonForm as ho } from "./components/skeleton/skeleton-form/index.js";
|
|
36
|
+
import { STANDALONE_LINK_COLORS as Mo, STANDALONE_LINK_ICON_POSITIONS as Ho, STANDALONE_LINK_SIZES as Zo, StandaloneLink as yo } from "./components/standalone-link/index.js";
|
|
37
|
+
import { Table as Yo } from "./components/table/index.js";
|
|
38
|
+
import { getDensity as wo, getHorizontalAlignment as Xo, getScope as Vo, getVerticalAlignment as Wo } from "./components/table/utils.js";
|
|
39
|
+
import { Tabs as qo } from "./components/tabs/index.js";
|
|
40
|
+
import { useTabsContext as Qo } from "./components/tabs/use-tabs-context.js";
|
|
41
|
+
import { TEXT_COLORS as or, TEXT_WEIGHTS as rr, Text as er } from "./components/text/index.js";
|
|
42
|
+
import { BarChart as pr } from "./components/visualizations/bar-chart/index.js";
|
|
43
|
+
import { DonutChart as xr } from "./components/visualizations/donut-chart/index.js";
|
|
44
|
+
import { PartnerCard as ar } from "./patterns/card/partner-card/index.js";
|
|
45
|
+
import { CardPrimitives as dr } from "./patterns/card/primitives.js";
|
|
46
|
+
import { CopyButton as lr } from "./patterns/copy-button/index.js";
|
|
47
|
+
import { LAYOUT_APPEARANCES as Sr, LAYOUT_BACKGROUNDS as Tr, LAYOUT_PADDING as Or, Layout as ur, normalizeLayoutProps as cr } from "./patterns/layout/index.js";
|
|
48
|
+
import { ProductBadge as sr } from "./patterns/product-badge/index.js";
|
|
49
|
+
import { PRODUCT_LOGO_COLORS as Ir, PRODUCT_LOGO_PRODUCTS as _r, PRODUCT_LOGO_SIZES as Pr, ProductLogo as gr, normalizeProductLogoProps as Br } from "./patterns/product-logo/index.js";
|
|
50
|
+
import { RelatedContent as Dr } from "./patterns/related-content/index.js";
|
|
51
|
+
import { useLarge as Rr, useMedium as Fr, useMediumUp as Gr, useSmall as Ur } from "./utils/hooks/use-screen-size/index.js";
|
|
52
|
+
import { MDSProvider as br } from "./utils/mds-context/index.js";
|
|
53
|
+
import { onClipboardClickHandler as vr } from "./utils/clipboard.js";
|
|
54
|
+
import { AccordionContent as Hr, AccordionItem as Zr, AccordionToggle as yr } from "./components/accordion/item/index.js";
|
|
55
|
+
import { RadioCardGroup as Yr } from "./components/form/radio-card/group.js";
|
|
56
|
+
import { useModal as wr } from "./components/modal/use-modal.js";
|
|
57
|
+
import { NewsroomCard as Vr } from "./patterns/card/newsroom-card/index.js";
|
|
58
|
+
import { PersonCard as jr } from "./patterns/card/person-card/index.js";
|
|
59
|
+
import { PromoCard as Jr } from "./patterns/card/promo-card/index.js";
|
|
60
|
+
import { ResourceCard as $r } from "./patterns/card/resource-card/index.js";
|
|
61
|
+
import { UnifiedCard as re } from "./patterns/card/unified-card/index.js";
|
|
62
|
+
import { LocaleProvider as te } from "./utils/i18n/helpers/locale-provider.js";
|
|
63
|
+
import { useLocale as me } from "./utils/i18n/helpers/use-locale.js";
|
|
61
64
|
export {
|
|
62
65
|
e as Accordion,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
Hr as AccordionContent,
|
|
67
|
+
Zr as AccordionItem,
|
|
68
|
+
yr as AccordionToggle,
|
|
66
69
|
n as Alert,
|
|
67
70
|
l as AlertActions,
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
C as AlertButton,
|
|
72
|
+
S as AlertStandaloneLink,
|
|
70
73
|
p as BADGE_COLORS,
|
|
71
74
|
m as BADGE_SIZES,
|
|
72
75
|
x as BADGE_TYPES,
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
c as BUTTON_COLORS,
|
|
77
|
+
L as BUTTON_ICON_POSITIONS,
|
|
75
78
|
s as BUTTON_SIZES,
|
|
76
79
|
f as Badge,
|
|
77
80
|
i as BadgeCount,
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
pr as BarChart,
|
|
82
|
+
O as Breadcrumbs,
|
|
80
83
|
A as Button,
|
|
81
84
|
_ as Card,
|
|
82
85
|
P as CardContent,
|
|
83
|
-
|
|
86
|
+
dr as CardPrimitives,
|
|
84
87
|
v as CheckboxBase,
|
|
85
88
|
M as CheckboxField,
|
|
86
|
-
|
|
89
|
+
H as CheckboxGroup,
|
|
87
90
|
B as CodeBlock,
|
|
88
|
-
|
|
91
|
+
lr as CopyButton,
|
|
89
92
|
D as DisclosurePrimitive,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
xr as DonutChart,
|
|
94
|
+
G as Dropdown,
|
|
95
|
+
y as Error,
|
|
96
|
+
k as FLIGHT_ICON_SIZES,
|
|
94
97
|
Y as Field,
|
|
95
98
|
w as Fieldset,
|
|
96
99
|
V as FileInputBase,
|
|
97
100
|
W as FileInputField,
|
|
98
|
-
|
|
101
|
+
b as FlightIcon,
|
|
99
102
|
q as HelperText,
|
|
100
103
|
Po as IconTile,
|
|
101
104
|
Q as Indicator,
|
|
102
105
|
Bo as InlineLink,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
Sr as LAYOUT_APPEARANCES,
|
|
107
|
+
Tr as LAYOUT_BACKGROUNDS,
|
|
108
|
+
Or as LAYOUT_PADDING,
|
|
106
109
|
oo as Label,
|
|
107
|
-
|
|
110
|
+
ur as Layout,
|
|
108
111
|
eo as Legend,
|
|
109
|
-
|
|
112
|
+
te as LocaleProvider,
|
|
110
113
|
Do as MDSButton,
|
|
111
|
-
|
|
114
|
+
br as MDSProvider,
|
|
112
115
|
Ro as ModalProvider,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
Vr as NewsroomCard,
|
|
117
|
+
Ir as PRODUCT_LOGO_COLORS,
|
|
118
|
+
_r as PRODUCT_LOGO_PRODUCTS,
|
|
119
|
+
Pr as PRODUCT_LOGO_SIZES,
|
|
120
|
+
ar as PartnerCard,
|
|
121
|
+
jr as PersonCard,
|
|
122
|
+
sr as ProductBadge,
|
|
123
|
+
gr as ProductLogo,
|
|
124
|
+
Jr as PromoCard,
|
|
122
125
|
po as RadioBase,
|
|
123
126
|
ao as RadioCard,
|
|
124
|
-
|
|
127
|
+
Yr as RadioCardGroup,
|
|
125
128
|
mo as RadioField,
|
|
126
129
|
xo as RadioGroup,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
Dr as RelatedContent,
|
|
131
|
+
$r as ResourceCard,
|
|
132
|
+
Mo as STANDALONE_LINK_COLORS,
|
|
133
|
+
Ho as STANDALONE_LINK_ICON_POSITIONS,
|
|
134
|
+
Zo as STANDALONE_LINK_SIZES,
|
|
132
135
|
no as SelectField,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
Go as Separator,
|
|
137
|
+
ko as Skeleton,
|
|
138
|
+
ho as SkeletonForm,
|
|
139
|
+
yo as StandaloneLink,
|
|
140
|
+
Co as SuperSelectField,
|
|
141
|
+
or as TEXT_COLORS,
|
|
142
|
+
rr as TEXT_WEIGHTS,
|
|
143
|
+
Yo as Table,
|
|
144
|
+
qo as Tabs,
|
|
145
|
+
er as Text,
|
|
146
|
+
co as TextAreaField,
|
|
147
|
+
To as TextInput,
|
|
148
|
+
Oo as TextInputBase,
|
|
144
149
|
so as ToggleBase,
|
|
145
150
|
Ao as ToggleField,
|
|
146
151
|
Io as ToggleGroup,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
re as UnifiedCard,
|
|
153
|
+
wo as getDensity,
|
|
154
|
+
Xo as getHorizontalAlignment,
|
|
155
|
+
Vo as getScope,
|
|
156
|
+
Wo as getVerticalAlignment,
|
|
157
|
+
cr as normalizeLayoutProps,
|
|
158
|
+
Br as normalizeProductLogoProps,
|
|
159
|
+
vr as onClipboardClickHandler,
|
|
154
160
|
R as useDisclosurePrimitive,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
Rr as useLarge,
|
|
162
|
+
me as useLocale,
|
|
163
|
+
Fr as useMedium,
|
|
164
|
+
Gr as useMediumUp,
|
|
165
|
+
wr as useModal,
|
|
166
|
+
Ur as useSmall,
|
|
167
|
+
Qo as useTabsContext
|
|
162
168
|
};
|
|
163
169
|
//# 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/mds-react",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.14",
|
|
4
4
|
"description": "Materia Design System React components",
|
|
5
5
|
"author": "HashiCorp",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"**/*.css"
|
|
19
19
|
],
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=
|
|
21
|
+
"node": ">=20.x"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
@@ -61,17 +61,18 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@hashicorp/flight-icons": "^3.7.0",
|
|
64
|
-
"@nivo/pie": "^0.
|
|
65
|
-
"@react-spring/web": "^
|
|
64
|
+
"@nivo/pie": "^0.99.0",
|
|
65
|
+
"@react-spring/web": "^10.0.3",
|
|
66
|
+
"@usefy/use-resize-observer": "^0.2.6",
|
|
66
67
|
"classnames": "^2.3.2",
|
|
67
68
|
"react-focus-lock": "^2.13.6",
|
|
68
|
-
"react-wrap-balancer": "^
|
|
69
|
+
"react-wrap-balancer": "^1.1.1",
|
|
69
70
|
"use-resize-observer": "^9.1.0"
|
|
70
71
|
},
|
|
71
72
|
"peerDependencies": {
|
|
72
73
|
"@tippyjs/react": "^4.2.6",
|
|
73
|
-
"react": "^18.2.0",
|
|
74
|
-
"react-dom": "^18.2.0",
|
|
74
|
+
"react": "^18.2.0 || ^19.0",
|
|
75
|
+
"react-dom": "^18.2.0 || ^19.0",
|
|
75
76
|
"tippy.js": "^6.3.1"
|
|
76
77
|
}
|
|
77
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/patterns/card/unified-card/index.tsx"],"sourcesContent":["import { Badge } from '../../../components/badge'\nimport { CardPrimitives } from '../primitives'\nimport type { CardPatternProps } from '../types'\n\ninterface UnifiedCardProps extends CardPatternProps {\n\tbadges?: (string | string[])[]\n}\n\nconst UnifiedCard = ({\n\theading,\n\tmeta,\n\tlink,\n\tproductBadges,\n\tbadges,\n\tthumbnail,\n\twithArrow = false,\n\tisExternal = false,\n\tclassName,\n\t'aria-label': ariaLabel,\n}: UnifiedCardProps) => {\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\taria-label={ariaLabel || heading}\n\t\t>\n\t\t\t{thumbnail ? <CardPrimitives.Thumbnail {...thumbnail} /> : null}\n\t\t\t<CardPrimitives.Content>\n\t\t\t\t{meta && meta.length > 0 ? <CardPrimitives.Meta items={meta} /> : null}\n\t\t\t\t<CardPrimitives.Heading>{heading}</CardPrimitives.Heading>\n\t\t\t\t{productBadges && productBadges?.length > 0 ? (\n\t\t\t\t\t<CardPrimitives.ProductBadges badges={productBadges}>\n\t\t\t\t\t\t{badges && badges.length > 0\n\t\t\t\t\t\t\t? badges.map((badge, stableIdx) => {\n\t\t\t\t\t\t\t\t\tif (Array.isArray(badge)) {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Badge key={stableIdx} icon={badge[0]} text={badge[1]} />\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn <Badge key={stableIdx} text={badge} />\n\t\t\t\t\t\t\t
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/patterns/card/unified-card/index.tsx"],"sourcesContent":["import { Badge } from '../../../components/badge'\nimport { CardPrimitives } from '../primitives'\nimport type { CardPatternProps } from '../types'\n\ninterface UnifiedCardProps extends CardPatternProps {\n\tbadges?: (string | string[])[]\n}\n\nconst UnifiedCard = ({\n\theading,\n\tmeta,\n\tlink,\n\tproductBadges,\n\tbadges,\n\tthumbnail,\n\twithArrow = false,\n\tisExternal = false,\n\tclassName,\n\t'aria-label': ariaLabel,\n}: UnifiedCardProps) => {\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\taria-label={ariaLabel || heading}\n\t\t>\n\t\t\t{thumbnail ? <CardPrimitives.Thumbnail {...thumbnail} /> : null}\n\t\t\t<CardPrimitives.Content>\n\t\t\t\t{meta && meta.length > 0 ? <CardPrimitives.Meta items={meta} /> : null}\n\t\t\t\t<CardPrimitives.Heading>{heading}</CardPrimitives.Heading>\n\t\t\t\t{productBadges && productBadges?.length > 0 ? (\n\t\t\t\t\t<CardPrimitives.ProductBadges badges={productBadges}>\n\t\t\t\t\t\t{badges && badges.length > 0\n\t\t\t\t\t\t\t? badges.map((badge, stableIdx) => {\n\t\t\t\t\t\t\t\t\tif (Array.isArray(badge)) {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Badge key={stableIdx} icon={badge[0]} text={badge[1]} />\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn <Badge key={stableIdx} text={badge} />\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t: null}\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\nUnifiedCard.displayName = 'UnifiedCard'\n\nexport type { UnifiedCardProps }\nexport { UnifiedCard }\n"],"names":["UnifiedCard","heading","meta","link","productBadges","badges","thumbnail","withArrow","isExternal","className","ariaLabel","jsxs","CardPrimitives","jsx","badge","stableIdx","Badge"],"mappings":";;;AAQA,MAAMA,IAAc,CAAC;AAAA,EACpB,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,WAAAC;AAAA,EACA,cAAcC;AACf,MAEE,gBAAAC;AAAA,EAACC,EAAe;AAAA,EAAf;AAAA,IACA,MAAAT;AAAA,IACA,WAAAI;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAYC,KAAaT;AAAA,IAExB,UAAA;AAAA,MAAAK,sBAAaM,EAAe,WAAf,EAA0B,GAAGN,GAAW,IAAK;AAAA,MAC3D,gBAAAK,EAACC,EAAe,SAAf,EACC,UAAA;AAAA,QAAAV,KAAQA,EAAK,SAAS,IAAI,gBAAAW,EAACD,EAAe,MAAf,EAAoB,OAAOV,EAAA,CAAM,IAAK;AAAA,QAClE,gBAAAW,EAACD,EAAe,SAAf,EAAwB,UAAAX,EAAA,CAAQ;AAAA,QAChCG,KAAiBA,GAAe,SAAS,IACzC,gBAAAS,EAACD,EAAe,eAAf,EAA6B,QAAQR,GACpC,UAAAC,KAAUA,EAAO,SAAS,IACxBA,EAAO,IAAI,CAACS,GAAOC,MACf,MAAM,QAAQD,CAAK,IAErB,gBAAAD,EAACG,GAAA,EAAsB,MAAMF,EAAM,CAAC,GAAG,MAAMA,EAAM,CAAC,EAAA,GAAxCC,CAA2C,IAIlD,gBAAAF,EAACG,GAAA,EAAsB,MAAMF,EAAA,GAAjBC,CAAwB,CAC3C,IACA,KAAA,CACJ,IACG;AAAA,MAAA,EAAA,CACL;AAAA,IAAA;AAAA,EAAA;AAAA;AAKHf,EAAY,cAAc;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClipboardHandlerArgs } from '../../utils/clipboard';
|
|
2
2
|
export interface CopyButtonProps {
|
|
3
3
|
size?: 'small' | 'medium';
|
|
4
4
|
isIconOnly?: boolean;
|
|
@@ -7,8 +7,8 @@ export interface CopyButtonProps {
|
|
|
7
7
|
textToCopy?: string;
|
|
8
8
|
getTextFn?: () => string;
|
|
9
9
|
targetToCopy?: string | Element;
|
|
10
|
-
onSuccess?: (args:
|
|
11
|
-
onError?: (args:
|
|
10
|
+
onSuccess?: (args: ClipboardHandlerArgs) => void;
|
|
11
|
+
onError?: (args: ClipboardHandlerArgs) => void;
|
|
12
12
|
className?: string;
|
|
13
13
|
defaultIcon?: string;
|
|
14
14
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
3
3
|
import { useState as x, useRef as O } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { onClipboardClickHandler as R } from "../../utils/clipboard.js";
|
|
5
5
|
import U from "classnames";
|
|
6
6
|
import { Button as A } from "../../components/button/index.js";
|
|
7
7
|
import i from "./style.module.css.js";
|
|
8
8
|
const B = "clipboard-copy", D = "clipboard-checked", I = "clipboard-x", a = "idle", g = ({
|
|
9
9
|
size: u = "medium",
|
|
10
|
-
isIconOnly:
|
|
11
|
-
isFullWidth:
|
|
10
|
+
isIconOnly: l = !1,
|
|
11
|
+
isFullWidth: m = !1,
|
|
12
12
|
text: p,
|
|
13
|
-
textToCopy:
|
|
14
|
-
getTextFn:
|
|
15
|
-
targetToCopy:
|
|
13
|
+
textToCopy: d,
|
|
14
|
+
getTextFn: f,
|
|
15
|
+
targetToCopy: C,
|
|
16
16
|
onSuccess: r,
|
|
17
17
|
onError: c,
|
|
18
|
-
className:
|
|
18
|
+
className: S,
|
|
19
19
|
defaultIcon: y,
|
|
20
20
|
...N
|
|
21
21
|
}) => {
|
|
@@ -25,26 +25,26 @@ const B = "clipboard-copy", D = "clipboard-checked", I = "clipboard-x", a = "idl
|
|
|
25
25
|
}, 1500);
|
|
26
26
|
}, _ = (e) => {
|
|
27
27
|
o("success"), n(), r && r(e);
|
|
28
|
-
},
|
|
28
|
+
}, b = (e) => {
|
|
29
29
|
o("error"), n(), c && c(e);
|
|
30
30
|
};
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ E(
|
|
32
32
|
A,
|
|
33
33
|
{
|
|
34
|
-
className: U(i["copy-button"], i[t],
|
|
34
|
+
className: U(i["copy-button"], i[t], S),
|
|
35
35
|
size: u,
|
|
36
|
-
isFullWidth:
|
|
36
|
+
isFullWidth: m,
|
|
37
37
|
text: p,
|
|
38
38
|
icon: T,
|
|
39
|
-
isIconOnly:
|
|
39
|
+
isIconOnly: l,
|
|
40
40
|
color: "secondary",
|
|
41
41
|
iconPosition: "trailing",
|
|
42
42
|
...R({
|
|
43
|
-
text:
|
|
44
|
-
getTextFn:
|
|
45
|
-
target:
|
|
43
|
+
text: d,
|
|
44
|
+
getTextFn: f,
|
|
45
|
+
target: C,
|
|
46
46
|
onSuccess: _,
|
|
47
|
-
onError:
|
|
47
|
+
onError: b
|
|
48
48
|
}),
|
|
49
49
|
...N
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/patterns/copy-button/index.tsx"],"sourcesContent":["'use client'\n\nimport { useRef, useState } from 'react'\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/patterns/copy-button/index.tsx"],"sourcesContent":["'use client'\n\nimport { useRef, useState } from 'react'\nimport {\n\tonClipboardClickHandler,\n\ttype ClipboardHandlerArgs,\n} from '../../utils/clipboard'\nimport classNames from 'classnames'\nimport { Button } from '../../components/button'\nimport s from './style.module.css'\n\nexport interface CopyButtonProps {\n\tsize?: 'small' | 'medium'\n\tisIconOnly?: boolean\n\tisFullWidth?: boolean\n\ttext: string\n\ttextToCopy?: string\n\tgetTextFn?: () => string\n\ttargetToCopy?: string | Element\n\tonSuccess?: (args: ClipboardHandlerArgs) => void\n\tonError?: (args: ClipboardHandlerArgs) => void\n\tclassName?: string\n\tdefaultIcon?: string\n}\n\nconst DEFAULT_ICON = 'clipboard-copy'\nconst SUCCESS_ICON = 'clipboard-checked'\nconst ERROR_ICON = 'clipboard-x'\nconst DEFAULT_STATUS = 'idle'\n\nconst CopyButton = ({\n\tsize = 'medium',\n\tisIconOnly = false,\n\tisFullWidth = false,\n\ttext,\n\ttextToCopy,\n\tgetTextFn,\n\ttargetToCopy,\n\tonSuccess,\n\tonError,\n\tclassName,\n\tdefaultIcon,\n\t...rest\n}: CopyButtonProps) => {\n\tconst [status, setStatus] = useState(DEFAULT_STATUS)\n\tconst timer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\tconst icon =\n\t\tstatus === 'idle'\n\t\t\t? defaultIcon || DEFAULT_ICON\n\t\t\t: status === 'success'\n\t\t\t\t? SUCCESS_ICON\n\t\t\t\t: ERROR_ICON\n\n\tconst resetStatusDelayed = () => {\n\t\tif (timer.current) {\n\t\t\tclearTimeout(timer.current)\n\t\t}\n\t\ttimer.current = setTimeout(() => {\n\t\t\tsetStatus(DEFAULT_STATUS)\n\t\t}, 1500)\n\t}\n\n\tconst _onSuccess = (args: ClipboardHandlerArgs) => {\n\t\tsetStatus('success')\n\t\tresetStatusDelayed()\n\n\t\tif (onSuccess) {\n\t\t\tonSuccess(args)\n\t\t}\n\t}\n\n\tconst _onError = (args: ClipboardHandlerArgs) => {\n\t\tsetStatus('error')\n\t\tresetStatusDelayed()\n\n\t\tif (onError) {\n\t\t\tonError(args)\n\t\t}\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tclassName={classNames(s['copy-button'], s[status], className)}\n\t\t\tsize={size}\n\t\t\tisFullWidth={isFullWidth}\n\t\t\ttext={text}\n\t\t\ticon={icon}\n\t\t\tisIconOnly={isIconOnly}\n\t\t\tcolor=\"secondary\"\n\t\t\ticonPosition=\"trailing\"\n\t\t\t{...onClipboardClickHandler({\n\t\t\t\ttext: textToCopy,\n\t\t\t\tgetTextFn: getTextFn,\n\t\t\t\ttarget: targetToCopy,\n\t\t\t\tonSuccess: _onSuccess,\n\t\t\t\tonError: _onError,\n\t\t\t})}\n\t\t\t{...rest}\n\t\t/>\n\t)\n}\n\nCopyButton.displayName = 'CopyButton'\n\nexport { CopyButton }\n"],"names":["DEFAULT_ICON","SUCCESS_ICON","ERROR_ICON","DEFAULT_STATUS","CopyButton","size","isIconOnly","isFullWidth","text","textToCopy","getTextFn","targetToCopy","onSuccess","onError","className","defaultIcon","rest","status","setStatus","useState","timer","useRef","icon","resetStatusDelayed","_onSuccess","args","_onError","jsx","Button","classNames","s","onClipboardClickHandler"],"mappings":";;;;;;;AA0BA,MAAMA,IAAe,kBACfC,IAAa,qBACbC,IAAA,eAEAC,IAAc,QACnBC,IAAO,CAAA;AAAA,EACP,MAAAC,IAAA;AAAA,EACA,YAAAC;EACA,aAAAC,IAAA;AAAA,EACA,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACD,GAAAC;AACC,MAAA;AACA,QAAM,CAAAC,GAAQC,KAAiDC,EAAAhB,CAAA,GACzDiB,IACLC,EAAA,OAMKC,IAAAL,eAA2BF,KAAAf,IAAAiB,MAAA,YAAAhB,IAAAC,GAC5BqB,IAAe,MAAA;AAClB,IAAAH,EAAA,WACD,aAAAA,EAAA,OAAA,GAECA,EAAA,UAAU,WAAc,MAAA;QAClBjB,CAAA;AAAA,IACR,GAAA,IAAA;AAAA,EAEA,GACCqB,IAAU,CAAAC,MAAS;AACnB,IAAAP,WAAA,GAEAK,EAAe,GACdX,KACDA,EAAAa,CAAA;AAAA,EAGD,GACCC,IAAU,CAAAD,MAAO;AACjB,IAAAP,YAEAK,EAAa,GACZV,KACDA,EAAAY,CAAA;AAAA,EAGD;AACC,SAAC,gBAAAE;AAAA,IAAAC;AAAA,IAAA;AAAA,MAEA,WAAAC,EAAAC,EAAA,aAAA,GAAAA,EAAAb,CAAA,GAAAH,CAAA;AAAA,MACA,MAAAT;AAAA,MACA,aAAAE;AAAA,MACA,MAAAC;AAAA,MACA,MAAAc;AAAA,MACA,YAAAhB;AAAA,MACA,OAAA;AAAA,MACC;MAA2B,GAC3ByB,EAAM;AAAA,QACN,MAAAtB;AAAA,QACA,WAAAC;AAAA,QACA,QAAAC;AAAA,QACA,WAASa;AAAA,QACT,SAAAE;AAAA,MACA,CAAA;AAAA,MAAG,GAAAV;AAAA,IACL;AAAA,EAEF;AAEA;;"}
|
|
@@ -20,16 +20,10 @@
|
|
|
20
20
|
|
|
21
21
|
/* Background */
|
|
22
22
|
|
|
23
|
-
background-color: var(
|
|
24
|
-
--background-color-primary-override,
|
|
25
|
-
var(--mds-color-surface-primary)
|
|
26
|
-
);
|
|
23
|
+
background-color: var(--background-color-primary-override, var(--mds-color-surface-primary));
|
|
27
24
|
|
|
28
25
|
&.faint {
|
|
29
|
-
background-color: var(
|
|
30
|
-
--background-color-faint-override,
|
|
31
|
-
var(--mds-color-surface-faint)
|
|
32
|
-
);
|
|
26
|
+
background-color: var(--background-color-faint-override, var(--mds-color-surface-faint));
|
|
33
27
|
}
|
|
34
28
|
|
|
35
29
|
&.transparent {
|