@react-spectrum/badge 3.0.2-nightly.3599 → 3.0.2-nightly.3603

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.css CHANGED
@@ -1 +1 @@
1
- .spectrum-Badge_a70f1a{width:fit-content;padding:var(--spectrum-global-dimension-size-50)0;border-radius:var(--spectrum-alias-border-radius-regular,var(--spectrum-global-dimension-size-50));font-size:var(--spectrum-global-dimension-size-150);line-height:var(--spectrum-global-font-line-height-medium,1.5);cursor:default;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;font-smoothing:subpixel-antialiased;display:inline-flex;position:relative}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a{padding-right:var(--spectrum-global-dimension-size-115)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a{padding-left:var(--spectrum-global-dimension-size-115)}.spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a{order:1}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a{padding-left:var(--spectrum-global-dimension-size-115)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a{padding-right:var(--spectrum-global-dimension-size-115)}.spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a{flex-shrink:0;order:0}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a+.spectrum-Badge-label_a70f1a{padding-left:var(--spectrum-global-dimension-size-100)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a+.spectrum-Badge-label_a70f1a,[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a:not([hidden])+.spectrum-Badge-icon_a70f1a{padding-right:var(--spectrum-global-dimension-size-100)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a:not([hidden])+.spectrum-Badge-icon_a70f1a{padding-left:var(--spectrum-global-dimension-size-100)}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a:only-child{padding-left:var(--spectrum-global-dimension-size-115)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a:only-child{padding-right:var(--spectrum-global-dimension-size-115)}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a:only-child{padding-left:var(--spectrum-global-dimension-size-50)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a:only-child,[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a:only-child{padding-right:var(--spectrum-global-dimension-size-50)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a:only-child{padding-left:var(--spectrum-global-dimension-size-50)}.spectrum-Badge--large_a70f1a{font-size:var(--spectrum-global-dimension-size-175);padding:var(--spectrum-global-dimension-size-100)var(--spectrum-global-dimension-size-150)}.spectrum-Badge--small_a70f1a{font-size:var(--spectrum-global-dimension-font-size-50);padding:var(--spectrum-global-dimension-size-40)var(--spectrum-global-dimension-size-85)}.spectrum-Badge_a70f1a{color:var(--spectrum-label-colored-text-color,var(--spectrum-global-color-static-white))}.spectrum-Badge--neutral_a70f1a{background-color:var(--spectrum-semantic-neutral-color-background,var(--spectrum-global-color-static-gray-700))}.spectrum-Badge--negative_a70f1a{background-color:var(--spectrum-semantic-negative-color-background,var(--spectrum-global-color-static-red-700))}.spectrum-Badge--yellow_a70f1a{color:var(--spectrum-global-color-static-black,#000);background-color:var(--spectrum-yellow-background-color-default)}.spectrum-Badge--seafoam_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-seafoam-background-color-default)}.spectrum-Badge--positive_a70f1a{background-color:var(--spectrum-semantic-positive-color-background,var(--spectrum-global-color-static-green-700))}.spectrum-Badge--info_a70f1a{background-color:var(--spectrum-semantic-informative-color-background,var(--spectrum-global-color-static-blue-700))}.spectrum-Badge--fuchsia_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-fuchsia-background-color-default)}.spectrum-Badge--indigo_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-indigo-background-color-default)}.spectrum-Badge--magenta_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-magenta-background-color-default)}.spectrum-Badge--purple_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-purple-background-color-default)}
1
+ .spectrum-Badge_a70f1a{width:-moz-fit-content;width:-moz-fit-content;width:fit-content;padding:var(--spectrum-global-dimension-size-50)0;border-radius:var(--spectrum-alias-border-radius-regular,var(--spectrum-global-dimension-size-50));font-size:var(--spectrum-global-dimension-size-150);line-height:var(--spectrum-global-font-line-height-medium,1.5);cursor:default;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;font-smoothing:subpixel-antialiased;display:inline-flex;position:relative}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a{padding-right:var(--spectrum-global-dimension-size-115)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a{padding-left:var(--spectrum-global-dimension-size-115)}.spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a{order:1}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a{padding-left:var(--spectrum-global-dimension-size-115)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a{padding-right:var(--spectrum-global-dimension-size-115)}.spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a{flex-shrink:0;order:0}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a+.spectrum-Badge-label_a70f1a{padding-left:var(--spectrum-global-dimension-size-100)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a+.spectrum-Badge-label_a70f1a,[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a:not([hidden])+.spectrum-Badge-icon_a70f1a{padding-right:var(--spectrum-global-dimension-size-100)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a:not([hidden])+.spectrum-Badge-icon_a70f1a{padding-left:var(--spectrum-global-dimension-size-100)}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a:only-child{padding-left:var(--spectrum-global-dimension-size-115)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-label_a70f1a:only-child{padding-right:var(--spectrum-global-dimension-size-115)}[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a:only-child{padding-left:var(--spectrum-global-dimension-size-50)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a:only-child,[dir=ltr] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a:only-child{padding-right:var(--spectrum-global-dimension-size-50)}[dir=rtl] .spectrum-Badge_a70f1a .spectrum-Badge-icon_a70f1a:only-child{padding-left:var(--spectrum-global-dimension-size-50)}.spectrum-Badge--large_a70f1a{font-size:var(--spectrum-global-dimension-size-175);padding:var(--spectrum-global-dimension-size-100)var(--spectrum-global-dimension-size-150)}.spectrum-Badge--small_a70f1a{font-size:var(--spectrum-global-dimension-font-size-50);padding:var(--spectrum-global-dimension-size-40)var(--spectrum-global-dimension-size-85)}.spectrum-Badge_a70f1a{color:var(--spectrum-label-colored-text-color,var(--spectrum-global-color-static-white))}.spectrum-Badge--neutral_a70f1a{background-color:var(--spectrum-semantic-neutral-color-background,var(--spectrum-global-color-static-gray-700))}.spectrum-Badge--negative_a70f1a{background-color:var(--spectrum-semantic-negative-color-background,var(--spectrum-global-color-static-red-700))}.spectrum-Badge--yellow_a70f1a{color:var(--spectrum-global-color-static-black,#000);background-color:var(--spectrum-yellow-background-color-default)}.spectrum-Badge--seafoam_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-seafoam-background-color-default)}.spectrum-Badge--positive_a70f1a{background-color:var(--spectrum-semantic-positive-color-background,var(--spectrum-global-color-static-green-700))}.spectrum-Badge--info_a70f1a{background-color:var(--spectrum-semantic-informative-color-background,var(--spectrum-global-color-static-blue-700))}.spectrum-Badge--fuchsia_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-fuchsia-background-color-default)}.spectrum-Badge--indigo_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-indigo-background-color-default)}.spectrum-Badge--magenta_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-magenta-background-color-default)}.spectrum-Badge--purple_a70f1a{color:var(--spectrum-gray-50);background-color:var(--spectrum-purple-background-color-default)}
package/dist/main.js CHANGED
@@ -13,7 +13,28 @@ function $parcel$interopDefault(a) {
13
13
  }
14
14
 
15
15
  $parcel$export(module.exports, "Badge", () => $f243611f87a6fe61$export$37acb3580601e69a);
16
-
16
+ /*
17
+ * Copyright 2022 Adobe. All rights reserved.
18
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
+ * you may not use this file except in compliance with the License. You may obtain a copy
20
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing, software distributed under
23
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
+ * OF ANY KIND, either express or implied. See the License for the specific language
25
+ * governing permissions and limitations under the License.
26
+ */ /// <reference types="css-module-types" />
27
+ /*
28
+ * Copyright 2022 Adobe. All rights reserved.
29
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
30
+ * you may not use this file except in compliance with the License. You may obtain a copy
31
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
32
+ *
33
+ * Unless required by applicable law or agreed to in writing, software distributed under
34
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
35
+ * OF ANY KIND, either express or implied. See the License for the specific language
36
+ * governing permissions and limitations under the License.
37
+ */
17
38
 
18
39
 
19
40
  var $0f362c72c73357fc$exports = {};
@@ -68,34 +89,33 @@ $0f362c72c73357fc$export$67ff21277f017a3f = "spectrum-Badge--purple_a70f1a";
68
89
 
69
90
 
70
91
  function $f243611f87a6fe61$var$Badge(props, ref) {
71
- let { children: children , variant: variant , ...otherProps } = $jLeOL$reactspectrumprovider.useProviderProps(props);
72
- let domRef = $jLeOL$reactspectrumutils.useDOMRef(ref);
73
- let { styleProps: styleProps } = $jLeOL$reactspectrumutils.useStyleProps(otherProps);
74
- let isTextOnly = ($parcel$interopDefault($jLeOL$react)).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ ($parcel$interopDefault($jLeOL$react)).isValidElement(c)
75
- );
76
- return(/*#__PURE__*/ ($parcel$interopDefault($jLeOL$react)).createElement("span", {
77
- ...$jLeOL$reactariautils.filterDOMProps(otherProps),
92
+ let { children: children , variant: variant , ...otherProps } = (0, $jLeOL$reactspectrumprovider.useProviderProps)(props);
93
+ let domRef = (0, $jLeOL$reactspectrumutils.useDOMRef)(ref);
94
+ let { styleProps: styleProps } = (0, $jLeOL$reactspectrumutils.useStyleProps)(otherProps);
95
+ let isTextOnly = (0, ($parcel$interopDefault($jLeOL$react))).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, ($parcel$interopDefault($jLeOL$react))).isValidElement(c));
96
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($jLeOL$react))).createElement("span", {
97
+ ...(0, $jLeOL$reactariautils.filterDOMProps)(otherProps),
78
98
  ...styleProps,
79
99
  role: "presentation",
80
- className: $jLeOL$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0f362c72c73357fc$exports)), 'spectrum-Badge', {
100
+ className: (0, $jLeOL$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($0f362c72c73357fc$exports))), "spectrum-Badge", {
81
101
  [`spectrum-Badge--${variant}`]: variant
82
102
  }, styleProps.className),
83
103
  ref: domRef
84
- }, /*#__PURE__*/ ($parcel$interopDefault($jLeOL$react)).createElement($jLeOL$reactspectrumutils.SlotProvider, {
104
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($jLeOL$react))).createElement((0, $jLeOL$reactspectrumutils.SlotProvider), {
85
105
  slots: {
86
106
  icon: {
87
- size: 'S',
88
- UNSAFE_className: $jLeOL$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0f362c72c73357fc$exports)), 'spectrum-Badge-icon')
107
+ size: "S",
108
+ UNSAFE_className: (0, $jLeOL$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($0f362c72c73357fc$exports))), "spectrum-Badge-icon")
89
109
  },
90
110
  text: {
91
- UNSAFE_className: $jLeOL$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0f362c72c73357fc$exports)), 'spectrum-Badge-label')
111
+ UNSAFE_className: (0, $jLeOL$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($0f362c72c73357fc$exports))), "spectrum-Badge-label")
92
112
  }
93
113
  }
94
- }, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ ($parcel$interopDefault($jLeOL$react)).createElement($jLeOL$reactspectrumtext.Text, null, children) : children)));
114
+ }, typeof children === "string" || isTextOnly ? /*#__PURE__*/ (0, ($parcel$interopDefault($jLeOL$react))).createElement((0, $jLeOL$reactspectrumtext.Text), null, children) : children));
95
115
  }
96
116
  /**
97
117
  * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.
98
- */ let $f243611f87a6fe61$export$37acb3580601e69a = /*#__PURE__*/ $jLeOL$react.forwardRef($f243611f87a6fe61$var$Badge);
118
+ */ let $f243611f87a6fe61$export$37acb3580601e69a = /*#__PURE__*/ (0, $jLeOL$react.forwardRef)($f243611f87a6fe61$var$Badge);
99
119
 
100
120
 
101
121
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAgC;AAChC,GAAsC;AACtC,GAAqC;AACrC,GAAuC;AACvC,GAAuC;AACvC,GAAyC;AACzC,GAA0C;AAC1C,GAAwC;AACxC,GAAyC;AACzC,GAA0C;AAC1C,G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I,EAAE,CAAG;gBACT,gBAAgB,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAAqB;YAC5D,CAAC;YACD,IAAI,EAAE,CAAC;gBACL,gBAAgB,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAAsB;YAC7D,CAAC;QACH,CAAC;OAGC,MAAM,CAAC,QAAQ,KAAK,CAAQ,WAAI,UAAU,sEACrC,6BAAI,QAAE,QAAQ,IACf,QAAQ;AAKtB,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAM,iBAAG,uBAAU,CAAC,2BAAK","sources":["packages/@react-spectrum/badge/src/index.ts","packages/@react-spectrum/badge/src/Badge.tsx","packages/@adobe/spectrum-css-temp/components/badge/vars.css"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Badge} from './Badge';\nexport type {SpectrumBadgeProps} from '@react-types/badge';\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {forwardRef} from 'react';\nimport {SpectrumBadgeProps} from '@react-types/badge';\nimport styles from '@adobe/spectrum-css-temp/components/badge/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction Badge(props: SpectrumBadgeProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n variant,\n ...otherProps\n } = useProviderProps(props);\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <span\n {...filterDOMProps(otherProps)}\n {...styleProps}\n role=\"presentation\"\n className={classNames(\n styles,\n 'spectrum-Badge',\n {\n [`spectrum-Badge--${variant}`]: variant\n },\n styleProps.className\n )}\n ref={domRef}>\n <SlotProvider\n slots={{\n icon: {\n size: 'S',\n UNSAFE_className: classNames(styles, 'spectrum-Badge-icon')\n },\n text: {\n UNSAFE_className: classNames(styles, 'spectrum-Badge-label')\n }\n }}>\n\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </SlotProvider>\n </span>\n );\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nlet _Badge = forwardRef(Badge);\nexport {_Badge as Badge};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GA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,MAAM;gBACJ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAM,AAAD,GAAG;YACvC;QACF;OAGE,OAAO,aAAa,YAAY,2BAC5B,0DAAC,CAAA,GAAA,6BAAI,AAAD,SAAG,YACP,QAAQ;AAKtB;AAEA;;CAEC,GACD,IAAI,0DAAS,CAAA,GAAA,uBAAS,EAAE;;ADxDxB","sources":["packages/@react-spectrum/badge/src/index.ts","packages/@react-spectrum/badge/src/Badge.tsx","packages/@adobe/spectrum-css-temp/components/badge/vars.css"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Badge} from './Badge';\nexport type {SpectrumBadgeProps} from '@react-types/badge';\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {forwardRef} from 'react';\nimport {SpectrumBadgeProps} from '@react-types/badge';\nimport styles from '@adobe/spectrum-css-temp/components/badge/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction Badge(props: SpectrumBadgeProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n variant,\n ...otherProps\n } = useProviderProps(props);\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <span\n {...filterDOMProps(otherProps)}\n {...styleProps}\n role=\"presentation\"\n className={classNames(\n styles,\n 'spectrum-Badge',\n {\n [`spectrum-Badge--${variant}`]: variant\n },\n styleProps.className\n )}\n ref={domRef}>\n <SlotProvider\n slots={{\n icon: {\n size: 'S',\n UNSAFE_className: classNames(styles, 'spectrum-Badge-icon')\n },\n text: {\n UNSAFE_className: classNames(styles, 'spectrum-Badge-label')\n }\n }}>\n\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </SlotProvider>\n </span>\n );\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nlet _Badge = forwardRef(Badge);\nexport {_Badge as Badge};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.mjs CHANGED
@@ -11,7 +11,28 @@ function $parcel$interopDefault(a) {
11
11
  function $parcel$export(e, n, v, s) {
12
12
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
13
  }
14
-
14
+ /*
15
+ * Copyright 2022 Adobe. All rights reserved.
16
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License. You may obtain a copy
18
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software distributed under
21
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22
+ * OF ANY KIND, either express or implied. See the License for the specific language
23
+ * governing permissions and limitations under the License.
24
+ */ /// <reference types="css-module-types" />
25
+ /*
26
+ * Copyright 2022 Adobe. All rights reserved.
27
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
28
+ * you may not use this file except in compliance with the License. You may obtain a copy
29
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software distributed under
32
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
33
+ * OF ANY KIND, either express or implied. See the License for the specific language
34
+ * governing permissions and limitations under the License.
35
+ */
15
36
 
16
37
 
17
38
  var $700c1b49452b6d47$exports = {};
@@ -66,34 +87,33 @@ $700c1b49452b6d47$export$67ff21277f017a3f = "spectrum-Badge--purple_a70f1a";
66
87
 
67
88
 
68
89
  function $c2a9f60d7159b63f$var$Badge(props, ref) {
69
- let { children: children , variant: variant , ...otherProps } = $ha4zE$useProviderProps(props);
70
- let domRef = $ha4zE$useDOMRef(ref);
71
- let { styleProps: styleProps } = $ha4zE$useStyleProps(otherProps);
72
- let isTextOnly = $ha4zE$react.Children.toArray(props.children).every((c)=>!/*#__PURE__*/ $ha4zE$react.isValidElement(c)
73
- );
74
- return(/*#__PURE__*/ $ha4zE$react.createElement("span", {
75
- ...$ha4zE$filterDOMProps(otherProps),
90
+ let { children: children , variant: variant , ...otherProps } = (0, $ha4zE$useProviderProps)(props);
91
+ let domRef = (0, $ha4zE$useDOMRef)(ref);
92
+ let { styleProps: styleProps } = (0, $ha4zE$useStyleProps)(otherProps);
93
+ let isTextOnly = (0, $ha4zE$react).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, $ha4zE$react).isValidElement(c));
94
+ return /*#__PURE__*/ (0, $ha4zE$react).createElement("span", {
95
+ ...(0, $ha4zE$filterDOMProps)(otherProps),
76
96
  ...styleProps,
77
97
  role: "presentation",
78
- className: $ha4zE$classNames((/*@__PURE__*/$parcel$interopDefault($700c1b49452b6d47$exports)), 'spectrum-Badge', {
98
+ className: (0, $ha4zE$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($700c1b49452b6d47$exports))), "spectrum-Badge", {
79
99
  [`spectrum-Badge--${variant}`]: variant
80
100
  }, styleProps.className),
81
101
  ref: domRef
82
- }, /*#__PURE__*/ $ha4zE$react.createElement($ha4zE$SlotProvider, {
102
+ }, /*#__PURE__*/ (0, $ha4zE$react).createElement((0, $ha4zE$SlotProvider), {
83
103
  slots: {
84
104
  icon: {
85
- size: 'S',
86
- UNSAFE_className: $ha4zE$classNames((/*@__PURE__*/$parcel$interopDefault($700c1b49452b6d47$exports)), 'spectrum-Badge-icon')
105
+ size: "S",
106
+ UNSAFE_className: (0, $ha4zE$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($700c1b49452b6d47$exports))), "spectrum-Badge-icon")
87
107
  },
88
108
  text: {
89
- UNSAFE_className: $ha4zE$classNames((/*@__PURE__*/$parcel$interopDefault($700c1b49452b6d47$exports)), 'spectrum-Badge-label')
109
+ UNSAFE_className: (0, $ha4zE$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($700c1b49452b6d47$exports))), "spectrum-Badge-label")
90
110
  }
91
111
  }
92
- }, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ $ha4zE$react.createElement($ha4zE$Text, null, children) : children)));
112
+ }, typeof children === "string" || isTextOnly ? /*#__PURE__*/ (0, $ha4zE$react).createElement((0, $ha4zE$Text), null, children) : children));
93
113
  }
94
114
  /**
95
115
  * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.
96
- */ let $c2a9f60d7159b63f$export$37acb3580601e69a = /*#__PURE__*/ $ha4zE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AC,kBAAK,YAAK,CAAC,cAAc,CAAC,CAAC;;IAE1F,MAAM,0CACH,CAAI;WACC,qBAAc,CAAC,UAAU;WACzB,UAAU;QACd,IAAI,EAAC,CAAc;QACnB,SAAS,EAAE,iBAAU,CACnB,gEAAM,EACN,CAAgB,iBAChB,CAAC;cACG,gBAAgB,EAAE,OAAO,KAAK,OAAO;QACzC,CAAC,EACD,UAAU,CAAC,SAAS;QAEtB,GAAG,EAAE,MAAM;gDACV,mBAAY;QACX,KAAK,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;gBACL,IAAI,EAAE,CAAG;gBACT,gBAAgB,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAAqB;YAC5D,CAAC;YACD,IAAI,EAAE,CAAC;gBACL,gBAAgB,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAAsB;YAC7D,CAAC;QACH,CAAC;OAGC,MAAM,CAAC,QAAQ,KAAK,CAAQ,WAAI,UAAU,4CACrC,WAAI,QAAE,QAAQ,IACf,QAAQ;AAKtB,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAM,iBAAG,iBAAU,CAAC,2BAAK","sources":["packages/@react-spectrum/badge/src/index.ts","packages/@react-spectrum/badge/src/Badge.tsx","packages/@adobe/spectrum-css-temp/components/badge/vars.css"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Badge} from './Badge';\nexport type {SpectrumBadgeProps} from '@react-types/badge';\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {forwardRef} from 'react';\nimport {SpectrumBadgeProps} from '@react-types/badge';\nimport styles from '@adobe/spectrum-css-temp/components/badge/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction Badge(props: SpectrumBadgeProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n variant,\n ...otherProps\n } = useProviderProps(props);\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <span\n {...filterDOMProps(otherProps)}\n {...styleProps}\n role=\"presentation\"\n className={classNames(\n styles,\n 'spectrum-Badge',\n {\n [`spectrum-Badge--${variant}`]: variant\n },\n styleProps.className\n )}\n ref={domRef}>\n <SlotProvider\n slots={{\n icon: {\n size: 'S',\n UNSAFE_className: classNames(styles, 'spectrum-Badge-icon')\n },\n text: {\n UNSAFE_className: classNames(styles, 'spectrum-Badge-label')\n }\n }}>\n\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </SlotProvider>\n </span>\n );\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nlet _Badge = forwardRef(Badge);\nexport {_Badge as Badge};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;ACZA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAdA,0CAAmC;AACnC,4CAAyC;AACzC,4CAAwC;AACxC,4CAA0C;AAC1C,4CAA0C;AAC1C,4CAA4C;AAC5C,4CAA6C;AAC7C,4CAA2C;AAC3C,4CAA4C;AAC5C,4CAA6C;AAC7C,4CAAyC;AACzC,2CAA4C;AAC5C,4CAA2C;AAC3C,2CAA4C;AAC5C,4CAA2C;;;;;ADQ3C,SAAS,4BAAM,KAAyB,EAAE,GAA2B,EAAE;IACrE,IAAI,YACF,SAAQ,WACR,QAAO,EACP,GAAG,YACJ,GAAG,CAAA,GAAA,uBAAe,EAAE;IACrB,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,cAAC,WAAU,EAAC,GAAG,CAAA,GAAA,oBAAa,AAAD,EAAE;IACjC,IAAI,aAAa,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,KAAK,CAAC,CAAA,IAAK,eAAC,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC;IAEzF,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAc,AAAD,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,MAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,yDAAM,OAAD,GACL,kBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC,EAAE;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,MAAM;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAM,AAAD,GAAG;YACvC;YACA,MAAM;gBACJ,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAM,AAAD,GAAG;YACvC;QACF;OAGE,OAAO,aAAa,YAAY,2BAC5B,gCAAC,CAAA,GAAA,WAAI,AAAD,SAAG,YACP,QAAQ;AAKtB;AAEA;;CAEC,GACD,IAAI,0DAAS,CAAA,GAAA,iBAAS,EAAE;;ADxDxB","sources":["packages/@react-spectrum/badge/src/index.ts","packages/@react-spectrum/badge/src/Badge.tsx","packages/@adobe/spectrum-css-temp/components/badge/vars.css"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Badge} from './Badge';\nexport type {SpectrumBadgeProps} from '@react-types/badge';\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {forwardRef} from 'react';\nimport {SpectrumBadgeProps} from '@react-types/badge';\nimport styles from '@adobe/spectrum-css-temp/components/badge/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\nfunction Badge(props: SpectrumBadgeProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n variant,\n ...otherProps\n } = useProviderProps(props);\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <span\n {...filterDOMProps(otherProps)}\n {...styleProps}\n role=\"presentation\"\n className={classNames(\n styles,\n 'spectrum-Badge',\n {\n [`spectrum-Badge--${variant}`]: variant\n },\n styleProps.className\n )}\n ref={domRef}>\n <SlotProvider\n slots={{\n icon: {\n size: 'S',\n UNSAFE_className: classNames(styles, 'spectrum-Badge-icon')\n },\n text: {\n UNSAFE_className: classNames(styles, 'spectrum-Badge-label')\n }\n }}>\n\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </SlotProvider>\n </span>\n );\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nlet _Badge = forwardRef(Badge);\nexport {_Badge as Badge};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.mjs.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/badge",
3
- "version": "3.0.2-nightly.3599+b35d5c02f",
3
+ "version": "3.0.2-nightly.3603+22cb32d32",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,15 +36,15 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@babel/runtime": "^7.6.2",
40
- "@react-aria/utils": "3.0.0-nightly.1899+b35d5c02f",
41
- "@react-spectrum/text": "3.3.4-nightly.3599+b35d5c02f",
42
- "@react-spectrum/utils": "3.0.0-nightly.1899+b35d5c02f",
43
- "@react-types/badge": "3.0.2-nightly.3599+b35d5c02f",
44
- "@react-types/shared": "3.0.0-nightly.1899+b35d5c02f"
39
+ "@react-aria/utils": "3.0.0-nightly.1903+22cb32d32",
40
+ "@react-spectrum/text": "3.3.4-nightly.3603+22cb32d32",
41
+ "@react-spectrum/utils": "3.0.0-nightly.1903+22cb32d32",
42
+ "@react-types/badge": "3.0.2-nightly.3603+22cb32d32",
43
+ "@react-types/shared": "3.0.0-nightly.1903+22cb32d32",
44
+ "@swc/helpers": "^0.4.14"
45
45
  },
46
46
  "devDependencies": {
47
- "@adobe/spectrum-css-temp": "3.0.0-nightly.1899+b35d5c02f"
47
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.1903+22cb32d32"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@react-spectrum/provider": "^3.0.0",
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "b35d5c02fe900badccd0cf1a8f23bb593419f238"
56
+ "gitHead": "22cb32d329e66c60f55d4fc4025d1d44bb015d71"
57
57
  }