@react-spectrum/s2 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionBar.cjs.map +1 -1
- package/dist/ActionBar.css.map +1 -1
- package/dist/ActionBar.mjs.map +1 -1
- package/dist/ActionButton.cjs +26 -7
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +74 -18
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +26 -7
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/Add.cjs.map +1 -1
- package/dist/Add.mjs.map +1 -1
- package/dist/Asterisk.cjs.map +1 -1
- package/dist/Asterisk.mjs.map +1 -1
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs +3 -2
- package/dist/ButtonGroup.cjs.map +1 -1
- package/dist/ButtonGroup.css.map +1 -1
- package/dist/ButtonGroup.mjs +3 -2
- package/dist/ButtonGroup.mjs.map +1 -1
- package/dist/Card.cjs +1 -1
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +1 -1
- package/dist/Card.mjs.map +1 -1
- package/dist/CenterBaseline.cjs.map +1 -1
- package/dist/CenterBaseline.css.map +1 -1
- package/dist/CenterBaseline.mjs.map +1 -1
- package/dist/Checkmark.cjs.map +1 -1
- package/dist/Checkmark.mjs.map +1 -1
- package/dist/Chevron.cjs.map +1 -1
- package/dist/Chevron.mjs.map +1 -1
- package/dist/ColorHandle.cjs.map +1 -1
- package/dist/ColorHandle.css.map +1 -1
- package/dist/ColorHandle.mjs.map +1 -1
- package/dist/ColorSwatchPicker.cjs +2 -2
- package/dist/ColorSwatchPicker.cjs.map +1 -1
- package/dist/ColorSwatchPicker.css.map +1 -1
- package/dist/ColorSwatchPicker.mjs +2 -2
- package/dist/ColorSwatchPicker.mjs.map +1 -1
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/Content.cjs +6 -6
- package/dist/Content.cjs.map +1 -1
- package/dist/Content.mjs +6 -6
- package/dist/Content.mjs.map +1 -1
- package/dist/Cross.cjs.map +1 -1
- package/dist/Cross.mjs.map +1 -1
- package/dist/Dash.cjs.map +1 -1
- package/dist/Dash.mjs.map +1 -1
- package/dist/DialogContainer.cjs.map +1 -1
- package/dist/DialogContainer.mjs.map +1 -1
- package/dist/DialogTrigger.cjs.map +1 -1
- package/dist/DialogTrigger.mjs.map +1 -1
- package/dist/Disclosure.cjs +24 -21
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +12 -20
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +24 -21
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs +6 -0
- package/dist/Divider.cjs.map +1 -1
- package/dist/Divider.css +8 -0
- package/dist/Divider.css.map +1 -1
- package/dist/Divider.mjs +6 -0
- package/dist/Divider.mjs.map +1 -1
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs.map +1 -1
- package/dist/Image.cjs +1 -1
- package/dist/Image.cjs.map +1 -1
- package/dist/Image.css.map +1 -1
- package/dist/Image.mjs +1 -1
- package/dist/Image.mjs.map +1 -1
- package/dist/ImageCoordinator.cjs.map +1 -1
- package/dist/ImageCoordinator.mjs.map +1 -1
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.css.map +1 -1
- package/dist/Link.mjs.map +1 -1
- package/dist/LinkOut.cjs.map +1 -1
- package/dist/LinkOut.mjs.map +1 -1
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs.map +1 -1
- package/dist/NotificationBadge.cjs +163 -0
- package/dist/NotificationBadge.cjs.map +1 -0
- package/dist/NotificationBadge.css +227 -0
- package/dist/NotificationBadge.css.map +1 -0
- package/dist/NotificationBadge.mjs +157 -0
- package/dist/NotificationBadge.mjs.map +1 -0
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs.map +1 -1
- package/dist/Provider.cjs.map +1 -1
- package/dist/Provider.css.map +1 -1
- package/dist/Provider.mjs.map +1 -1
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs +2 -2
- package/dist/StatusLight.cjs.map +1 -1
- package/dist/StatusLight.css.map +1 -1
- package/dist/StatusLight.mjs +2 -2
- package/dist/StatusLight.mjs.map +1 -1
- package/dist/Tabs.cjs +1 -0
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +1 -0
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TabsPicker.cjs.map +1 -1
- package/dist/TabsPicker.css.map +1 -1
- package/dist/TabsPicker.mjs.map +1 -1
- package/dist/Toast.cjs +557 -0
- package/dist/Toast.cjs.map +1 -0
- package/dist/Toast.css +461 -0
- package/dist/Toast.css.map +1 -0
- package/dist/Toast.mjs +551 -0
- package/dist/Toast.mjs.map +1 -0
- package/dist/Toast_module.cjs +70 -0
- package/dist/Toast_module.cjs.map +1 -0
- package/dist/Toast_module.css +119 -0
- package/dist/Toast_module.css.map +1 -0
- package/dist/Toast_module.mjs +72 -0
- package/dist/Toast_module.mjs.map +1 -0
- package/dist/ToggleButton.cjs.map +1 -1
- package/dist/ToggleButton.css.map +1 -1
- package/dist/ToggleButton.mjs.map +1 -1
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/TreeView.cjs.map +1 -1
- package/dist/TreeView.css.map +1 -1
- package/dist/TreeView.mjs.map +1 -1
- package/dist/ar-AE.cjs +6 -1
- package/dist/ar-AE.cjs.map +1 -1
- package/dist/ar-AE.mjs +6 -1
- package/dist/ar-AE.mjs.map +1 -1
- package/dist/bg-BG.cjs +6 -1
- package/dist/bg-BG.cjs.map +1 -1
- package/dist/bg-BG.mjs +6 -1
- package/dist/bg-BG.mjs.map +1 -1
- package/dist/cs-CZ.cjs +10 -2
- package/dist/cs-CZ.cjs.map +1 -1
- package/dist/cs-CZ.mjs +10 -2
- package/dist/cs-CZ.mjs.map +1 -1
- package/dist/da-DK.cjs +8 -3
- package/dist/da-DK.cjs.map +1 -1
- package/dist/da-DK.mjs +8 -3
- package/dist/da-DK.mjs.map +1 -1
- package/dist/de-DE.cjs +7 -3
- package/dist/de-DE.cjs.map +1 -1
- package/dist/de-DE.mjs +7 -3
- package/dist/de-DE.mjs.map +1 -1
- package/dist/el-GR.cjs +6 -1
- package/dist/el-GR.cjs.map +1 -1
- package/dist/el-GR.mjs +6 -1
- package/dist/el-GR.mjs.map +1 -1
- package/dist/en-US.cjs +6 -1
- package/dist/en-US.cjs.map +1 -1
- package/dist/en-US.mjs +6 -1
- package/dist/en-US.mjs.map +1 -1
- package/dist/es-ES.cjs +10 -6
- package/dist/es-ES.cjs.map +1 -1
- package/dist/es-ES.mjs +10 -6
- package/dist/es-ES.mjs.map +1 -1
- package/dist/et-EE.cjs +6 -1
- package/dist/et-EE.cjs.map +1 -1
- package/dist/et-EE.mjs +6 -1
- package/dist/et-EE.mjs.map +1 -1
- package/dist/fi-FI.cjs +7 -2
- package/dist/fi-FI.cjs.map +1 -1
- package/dist/fi-FI.mjs +7 -2
- package/dist/fi-FI.mjs.map +1 -1
- package/dist/fr-FR.cjs +7 -3
- package/dist/fr-FR.cjs.map +1 -1
- package/dist/fr-FR.mjs +7 -3
- package/dist/fr-FR.mjs.map +1 -1
- package/dist/he-IL.cjs +9 -5
- package/dist/he-IL.cjs.map +1 -1
- package/dist/he-IL.mjs +9 -5
- package/dist/he-IL.mjs.map +1 -1
- package/dist/hr-HR.cjs +11 -3
- package/dist/hr-HR.cjs.map +1 -1
- package/dist/hr-HR.mjs +11 -3
- package/dist/hr-HR.mjs.map +1 -1
- package/dist/hu-HU.cjs +6 -1
- package/dist/hu-HU.cjs.map +1 -1
- package/dist/hu-HU.mjs +6 -1
- package/dist/hu-HU.mjs.map +1 -1
- package/dist/it-IT.cjs +6 -2
- package/dist/it-IT.cjs.map +1 -1
- package/dist/it-IT.mjs +6 -2
- package/dist/it-IT.mjs.map +1 -1
- package/dist/ja-JP.cjs +7 -2
- package/dist/ja-JP.cjs.map +1 -1
- package/dist/ja-JP.mjs +7 -2
- package/dist/ja-JP.mjs.map +1 -1
- package/dist/ko-KR.cjs +8 -3
- package/dist/ko-KR.cjs.map +1 -1
- package/dist/ko-KR.mjs +8 -3
- package/dist/ko-KR.mjs.map +1 -1
- package/dist/lt-LT.cjs +8 -3
- package/dist/lt-LT.cjs.map +1 -1
- package/dist/lt-LT.mjs +8 -3
- package/dist/lt-LT.mjs.map +1 -1
- package/dist/lv-LV.cjs +9 -4
- package/dist/lv-LV.cjs.map +1 -1
- package/dist/lv-LV.mjs +9 -4
- package/dist/lv-LV.mjs.map +1 -1
- package/dist/main.cjs +9 -0
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +6 -2
- package/dist/module.mjs.map +1 -1
- package/dist/nb-NO.cjs +12 -4
- package/dist/nb-NO.cjs.map +1 -1
- package/dist/nb-NO.mjs +12 -4
- package/dist/nb-NO.mjs.map +1 -1
- package/dist/nl-NL.cjs +6 -1
- package/dist/nl-NL.cjs.map +1 -1
- package/dist/nl-NL.mjs +6 -1
- package/dist/nl-NL.mjs.map +1 -1
- package/dist/pl-PL.cjs +11 -3
- package/dist/pl-PL.cjs.map +1 -1
- package/dist/pl-PL.mjs +11 -3
- package/dist/pl-PL.mjs.map +1 -1
- package/dist/pressScale.cjs.map +1 -1
- package/dist/pressScale.mjs.map +1 -1
- package/dist/pt-BR.cjs +6 -1
- package/dist/pt-BR.cjs.map +1 -1
- package/dist/pt-BR.mjs +6 -1
- package/dist/pt-BR.mjs.map +1 -1
- package/dist/pt-PT.cjs +6 -1
- package/dist/pt-PT.cjs.map +1 -1
- package/dist/pt-PT.mjs +6 -1
- package/dist/pt-PT.mjs.map +1 -1
- package/dist/ro-RO.cjs +8 -4
- package/dist/ro-RO.cjs.map +1 -1
- package/dist/ro-RO.mjs +8 -4
- package/dist/ro-RO.mjs.map +1 -1
- package/dist/ru-RU.cjs +11 -3
- package/dist/ru-RU.cjs.map +1 -1
- package/dist/ru-RU.mjs +11 -3
- package/dist/ru-RU.mjs.map +1 -1
- package/dist/sk-SK.cjs +10 -2
- package/dist/sk-SK.cjs.map +1 -1
- package/dist/sk-SK.mjs +10 -2
- package/dist/sk-SK.mjs.map +1 -1
- package/dist/sl-SI.cjs +11 -3
- package/dist/sl-SI.cjs.map +1 -1
- package/dist/sl-SI.mjs +11 -3
- package/dist/sl-SI.mjs.map +1 -1
- package/dist/sr-SP.cjs +10 -2
- package/dist/sr-SP.cjs.map +1 -1
- package/dist/sr-SP.mjs +10 -2
- package/dist/sr-SP.mjs.map +1 -1
- package/dist/sv-SE.cjs +6 -2
- package/dist/sv-SE.cjs.map +1 -1
- package/dist/sv-SE.mjs +6 -2
- package/dist/sv-SE.mjs.map +1 -1
- package/dist/tr-TR.cjs +7 -2
- package/dist/tr-TR.cjs.map +1 -1
- package/dist/tr-TR.mjs +7 -2
- package/dist/tr-TR.mjs.map +1 -1
- package/dist/types.d.ts +97 -29
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.cjs +10 -2
- package/dist/uk-UA.cjs.map +1 -1
- package/dist/uk-UA.mjs +10 -2
- package/dist/uk-UA.mjs.map +1 -1
- package/dist/zh-CN.cjs +6 -1
- package/dist/zh-CN.cjs.map +1 -1
- package/dist/zh-CN.mjs +6 -1
- package/dist/zh-CN.mjs.map +1 -1
- package/dist/zh-TW.cjs +6 -1
- package/dist/zh-TW.cjs.map +1 -1
- package/dist/zh-TW.mjs +6 -1
- package/dist/zh-TW.mjs.map +1 -1
- package/icons/Skeleton.cjs.map +1 -1
- package/icons/Skeleton.css.map +1 -1
- package/icons/Skeleton.mjs.map +1 -1
- package/package.json +21 -19
- package/src/ActionBar.tsx +9 -2
- package/src/ActionButton.tsx +38 -3
- package/src/Breadcrumbs.tsx +1 -1
- package/src/Button.tsx +2 -2
- package/src/ButtonGroup.tsx +4 -2
- package/src/Calendar.tsx +2 -1
- package/src/Card.tsx +1 -1
- package/src/CenterBaseline.tsx +1 -1
- package/src/ColorHandle.tsx +2 -2
- package/src/ColorSwatchPicker.tsx +2 -1
- package/src/ComboBox.tsx +2 -2
- package/src/Content.tsx +6 -6
- package/src/DateField.tsx +1 -1
- package/src/DatePicker.tsx +1 -1
- package/src/DateRangePicker.tsx +1 -1
- package/src/DialogContainer.tsx +2 -2
- package/src/DialogTrigger.tsx +2 -1
- package/src/Disclosure.tsx +18 -24
- package/src/Divider.tsx +2 -0
- package/src/Field.tsx +2 -2
- package/src/Image.tsx +1 -1
- package/src/ImageCoordinator.tsx +3 -3
- package/src/Link.tsx +1 -1
- package/src/ListBox.tsx +3 -2
- package/src/Menu.tsx +5 -5
- package/src/NotificationBadge.tsx +172 -0
- package/src/Picker.tsx +2 -2
- package/src/Provider.tsx +1 -1
- package/src/RangeCalendar.tsx +2 -1
- package/src/Skeleton.tsx +4 -4
- package/src/Slider.tsx +1 -1
- package/src/StatusLight.tsx +2 -2
- package/src/Tabs.tsx +4 -3
- package/src/TabsPicker.tsx +1 -1
- package/src/TimeField.tsx +1 -1
- package/src/Toast.module.css +153 -0
- package/src/Toast.tsx +579 -0
- package/src/ToggleButton.tsx +1 -1
- package/src/Toolbar.tsx +2 -1
- package/src/Tooltip.tsx +2 -2
- package/src/TreeView.tsx +2 -2
- package/src/index.ts +6 -1
- package/src/page.macro.ts +3 -3
- package/src/pressScale.ts +1 -1
- package/src/style-utils.ts +2 -2
- package/style/dist/main.cjs +18 -18
- package/style/dist/module.mjs +9 -9
- package/style/dist/spectrum-theme.cjs +191 -191
- package/style/dist/spectrum-theme.cjs.map +1 -1
- package/style/dist/spectrum-theme.mjs +183 -183
- package/style/dist/spectrum-theme.mjs.map +1 -1
- package/style/dist/style-macro.cjs +74 -74
- package/style/dist/style-macro.cjs.map +1 -1
- package/style/dist/style-macro.mjs +68 -68
- package/style/dist/style-macro.mjs.map +1 -1
- package/style/dist/types.d.ts +4 -4
- package/style/dist/types.d.ts.map +1 -1
- package/style/spectrum-theme.ts +5 -5
- package/style/style-macro.ts +3 -3
- package/style/tokens.ts +22 -6
package/dist/Cross.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAWc,kDAAe,KAA2F;IACvH,IAAI,QAAC,OAAO,KAAK,GAAG,YAAW,GAAG;IAClC,OAAQ;QACN,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAO;gBAAG,GAAG,UAAU;;QACjC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAQ;gBAAG,GAAG,UAAU;;QAClC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAS;gBAAG,GAAG,UAAU;;QACnC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAU;gBAAG,GAAG,UAAU;;QACpC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;IAClC;AACF","sources":["packages/@react-spectrum/s2/ui-icons/Cross.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Cross_L from './S2_CrossSize200.svg';\nimport Cross_M from './S2_CrossSize100.svg';\nimport Cross_S from './S2_CrossSize75.svg';\nimport Cross_XL from './S2_CrossSize300.svg';\nimport Cross_XXL from './S2_CrossSize400.svg';\nimport Cross_XXXL from './S2_CrossSize500.svg';\nimport Cross_XXXXL from './S2_CrossSize600.svg';\nimport {SVGProps} from 'react';\n\nexport default function Cross(props: SVGProps<SVGSVGElement> & {size?: 'M' | 'L' | 'XL' | 'XXL' | 'XXXL' | 'XXXXL' | 'S'}) {\n let {size = 'M', ...otherProps} = props;\n switch (size) {\n case 'M':\n return <Cross_M {...otherProps} />;\n case 'L':\n return <Cross_L {...otherProps} />;\n case 'XL':\n return <Cross_XL {...otherProps} />;\n case 'XXL':\n return <Cross_XXL {...otherProps} />;\n case 'XXXL':\n return <Cross_XXXL {...otherProps} />;\n case 'XXXXL':\n return <Cross_XXXXL {...otherProps} />;\n case 'S':\n return <Cross_S {...otherProps} />;\n }\n}\n"],"names":[],"version":3,"file":"Cross.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAWc,kDAAe,KAA2F;IACvH,IAAI,QAAC,OAAO,KAAK,GAAG,YAAW,GAAG;IAClC,OAAQ;QACN,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAO;gBAAG,GAAG,UAAU;;QACjC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAQ;gBAAG,GAAG,UAAU;;QAClC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAS;gBAAG,GAAG,UAAU;;QACnC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAU;gBAAG,GAAG,UAAU;;QACpC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;IAClC;AACF","sources":["packages/@react-spectrum/s2/ui-icons/Cross.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Cross_L from './S2_CrossSize200.svg';\nimport Cross_M from './S2_CrossSize100.svg';\nimport Cross_S from './S2_CrossSize75.svg';\nimport Cross_XL from './S2_CrossSize300.svg';\nimport Cross_XXL from './S2_CrossSize400.svg';\nimport Cross_XXXL from './S2_CrossSize500.svg';\nimport Cross_XXXXL from './S2_CrossSize600.svg';\nimport {ReactNode, SVGProps} from 'react';\n\nexport default function Cross(props: SVGProps<SVGSVGElement> & {size?: 'M' | 'L' | 'XL' | 'XXL' | 'XXXL' | 'XXXXL' | 'S'}): ReactNode {\n let {size = 'M', ...otherProps} = props;\n switch (size) {\n case 'M':\n return <Cross_M {...otherProps} />;\n case 'L':\n return <Cross_L {...otherProps} />;\n case 'XL':\n return <Cross_XL {...otherProps} />;\n case 'XXL':\n return <Cross_XXL {...otherProps} />;\n case 'XXXL':\n return <Cross_XXXL {...otherProps} />;\n case 'XXXXL':\n return <Cross_XXXXL {...otherProps} />;\n case 'S':\n return <Cross_S {...otherProps} />;\n }\n}\n"],"names":[],"version":3,"file":"Cross.cjs.map"}
|
package/dist/Cross.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAWc,kDAAe,KAA2F;IACvH,IAAI,QAAC,OAAO,KAAK,GAAG,YAAW,GAAG;IAClC,OAAQ;QACN,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAO;gBAAG,GAAG,UAAU;;QACjC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAQ;gBAAG,GAAG,UAAU;;QAClC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAS;gBAAG,GAAG,UAAU;;QACnC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAU;gBAAG,GAAG,UAAU;;QACpC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;IAClC;AACF","sources":["packages/@react-spectrum/s2/ui-icons/Cross.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Cross_L from './S2_CrossSize200.svg';\nimport Cross_M from './S2_CrossSize100.svg';\nimport Cross_S from './S2_CrossSize75.svg';\nimport Cross_XL from './S2_CrossSize300.svg';\nimport Cross_XXL from './S2_CrossSize400.svg';\nimport Cross_XXXL from './S2_CrossSize500.svg';\nimport Cross_XXXXL from './S2_CrossSize600.svg';\nimport {SVGProps} from 'react';\n\nexport default function Cross(props: SVGProps<SVGSVGElement> & {size?: 'M' | 'L' | 'XL' | 'XXL' | 'XXXL' | 'XXXXL' | 'S'}) {\n let {size = 'M', ...otherProps} = props;\n switch (size) {\n case 'M':\n return <Cross_M {...otherProps} />;\n case 'L':\n return <Cross_L {...otherProps} />;\n case 'XL':\n return <Cross_XL {...otherProps} />;\n case 'XXL':\n return <Cross_XXL {...otherProps} />;\n case 'XXXL':\n return <Cross_XXXL {...otherProps} />;\n case 'XXXXL':\n return <Cross_XXXXL {...otherProps} />;\n case 'S':\n return <Cross_S {...otherProps} />;\n }\n}\n"],"names":[],"version":3,"file":"Cross.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAWc,kDAAe,KAA2F;IACvH,IAAI,QAAC,OAAO,KAAK,GAAG,YAAW,GAAG;IAClC,OAAQ;QACN,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAO;gBAAG,GAAG,UAAU;;QACjC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAQ;gBAAG,GAAG,UAAU;;QAClC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAS;gBAAG,GAAG,UAAU;;QACnC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAU;gBAAG,GAAG,UAAU;;QACpC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;IAClC;AACF","sources":["packages/@react-spectrum/s2/ui-icons/Cross.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Cross_L from './S2_CrossSize200.svg';\nimport Cross_M from './S2_CrossSize100.svg';\nimport Cross_S from './S2_CrossSize75.svg';\nimport Cross_XL from './S2_CrossSize300.svg';\nimport Cross_XXL from './S2_CrossSize400.svg';\nimport Cross_XXXL from './S2_CrossSize500.svg';\nimport Cross_XXXXL from './S2_CrossSize600.svg';\nimport {ReactNode, SVGProps} from 'react';\n\nexport default function Cross(props: SVGProps<SVGSVGElement> & {size?: 'M' | 'L' | 'XL' | 'XXL' | 'XXXL' | 'XXXXL' | 'S'}): ReactNode {\n let {size = 'M', ...otherProps} = props;\n switch (size) {\n case 'M':\n return <Cross_M {...otherProps} />;\n case 'L':\n return <Cross_L {...otherProps} />;\n case 'XL':\n return <Cross_XL {...otherProps} />;\n case 'XXL':\n return <Cross_XXL {...otherProps} />;\n case 'XXXL':\n return <Cross_XXXL {...otherProps} />;\n case 'XXXXL':\n return <Cross_XXXXL {...otherProps} />;\n case 'S':\n return <Cross_S {...otherProps} />;\n }\n}\n"],"names":[],"version":3,"file":"Cross.mjs.map"}
|
package/dist/Dash.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AASc,kDAAc,KAAuE;IAClG,IAAI,QAAC,OAAO,KAAK,GAAG,YAAW,GAAG;IAClC,OAAQ;QACN,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAK;gBAAG,GAAG,UAAU;;QAC/B,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAK;gBAAG,GAAG,UAAU;;QAC/B,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAK;gBAAG,GAAG,UAAU;;IACjC;AACF","sources":["packages/@react-spectrum/s2/ui-icons/Dash.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Dash_L from './S2_DashSize200.svg';\nimport Dash_M from './S2_DashSize100.svg';\nimport Dash_S from './S2_DashSize75.svg';\nimport Dash_XL from './S2_DashSize300.svg';\nimport Dash_XS from './S2_DashSize50.svg';\nimport {SVGProps} from 'react';\n\nexport default function Dash(props: SVGProps<SVGSVGElement> & {size?: 'M' | 'L' | 'XL' | 'XS' | 'S'}) {\n let {size = 'M', ...otherProps} = props;\n switch (size) {\n case 'M':\n return <Dash_M {...otherProps} />;\n case 'L':\n return <Dash_L {...otherProps} />;\n case 'XL':\n return <Dash_XL {...otherProps} />;\n case 'XS':\n return <Dash_XS {...otherProps} />;\n case 'S':\n return <Dash_S {...otherProps} />;\n }\n}\n"],"names":[],"version":3,"file":"Dash.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AASc,kDAAc,KAAuE;IAClG,IAAI,QAAC,OAAO,KAAK,GAAG,YAAW,GAAG;IAClC,OAAQ;QACN,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAK;gBAAG,GAAG,UAAU;;QAC/B,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAK;gBAAG,GAAG,UAAU;;QAC/B,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gCAAC,CAAA,GAAA,iCAAK;gBAAG,GAAG,UAAU;;IACjC;AACF","sources":["packages/@react-spectrum/s2/ui-icons/Dash.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Dash_L from './S2_DashSize200.svg';\nimport Dash_M from './S2_DashSize100.svg';\nimport Dash_S from './S2_DashSize75.svg';\nimport Dash_XL from './S2_DashSize300.svg';\nimport Dash_XS from './S2_DashSize50.svg';\nimport {ReactNode, SVGProps} from 'react';\n\nexport default function Dash(props: SVGProps<SVGSVGElement> & {size?: 'M' | 'L' | 'XL' | 'XS' | 'S'}): ReactNode {\n let {size = 'M', ...otherProps} = props;\n switch (size) {\n case 'M':\n return <Dash_M {...otherProps} />;\n case 'L':\n return <Dash_L {...otherProps} />;\n case 'XL':\n return <Dash_XL {...otherProps} />;\n case 'XS':\n return <Dash_XS {...otherProps} />;\n case 'S':\n return <Dash_S {...otherProps} />;\n }\n}\n"],"names":[],"version":3,"file":"Dash.cjs.map"}
|
package/dist/Dash.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AASc,kDAAc,KAAuE;IAClG,IAAI,QAAC,OAAO,KAAK,GAAG,YAAW,GAAG;IAClC,OAAQ;QACN,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAK;gBAAG,GAAG,UAAU;;QAC/B,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAK;gBAAG,GAAG,UAAU;;QAC/B,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAK;gBAAG,GAAG,UAAU;;IACjC;AACF","sources":["packages/@react-spectrum/s2/ui-icons/Dash.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Dash_L from './S2_DashSize200.svg';\nimport Dash_M from './S2_DashSize100.svg';\nimport Dash_S from './S2_DashSize75.svg';\nimport Dash_XL from './S2_DashSize300.svg';\nimport Dash_XS from './S2_DashSize50.svg';\nimport {SVGProps} from 'react';\n\nexport default function Dash(props: SVGProps<SVGSVGElement> & {size?: 'M' | 'L' | 'XL' | 'XS' | 'S'}) {\n let {size = 'M', ...otherProps} = props;\n switch (size) {\n case 'M':\n return <Dash_M {...otherProps} />;\n case 'L':\n return <Dash_L {...otherProps} />;\n case 'XL':\n return <Dash_XL {...otherProps} />;\n case 'XS':\n return <Dash_XS {...otherProps} />;\n case 'S':\n return <Dash_S {...otherProps} />;\n }\n}\n"],"names":[],"version":3,"file":"Dash.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AASc,kDAAc,KAAuE;IAClG,IAAI,QAAC,OAAO,KAAK,GAAG,YAAW,GAAG;IAClC,OAAQ;QACN,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAK;gBAAG,GAAG,UAAU;;QAC/B,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAK;gBAAG,GAAG,UAAU;;QAC/B,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAM;gBAAG,GAAG,UAAU;;QAChC,KAAK;YACH,qBAAO,gBAAC,CAAA,GAAA,wCAAK;gBAAG,GAAG,UAAU;;IACjC;AACF","sources":["packages/@react-spectrum/s2/ui-icons/Dash.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Dash_L from './S2_DashSize200.svg';\nimport Dash_M from './S2_DashSize100.svg';\nimport Dash_S from './S2_DashSize75.svg';\nimport Dash_XL from './S2_DashSize300.svg';\nimport Dash_XS from './S2_DashSize50.svg';\nimport {ReactNode, SVGProps} from 'react';\n\nexport default function Dash(props: SVGProps<SVGSVGElement> & {size?: 'M' | 'L' | 'XL' | 'XS' | 'S'}): ReactNode {\n let {size = 'M', ...otherProps} = props;\n switch (size) {\n case 'M':\n return <Dash_M {...otherProps} />;\n case 'L':\n return <Dash_L {...otherProps} />;\n case 'XL':\n return <Dash_XL {...otherProps} />;\n case 'XS':\n return <Dash_XS {...otherProps} />;\n case 'S':\n return <Dash_S {...otherProps} />;\n }\n}\n"],"names":[],"version":3,"file":"Dash.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAgB,KAA2B;IACzD,IAAI,YACF,QAAQ,aACR,SAAS,EACV,GAAG;IAEJ,IAAI,aAAa,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;IACxC,IAAI,WAAW,MAAM,GAAG,GACtB,MAAM,IAAI,MAAM;IAGlB,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAuB;IAE9D,6EAA6E;IAC7E,0DAA0D;IAC1D,IAAI,QAAkC;IACtC,IAAI,MAAM,OAAO,CAAC,WAChB,QAAQ,SAAS,IAAI,CAAC,CAAA,GAAA,sCAAI,EAAE,cAAc;SACrC,kBAAI,CAAA,GAAA,sCAAI,EAAE,cAAc,CAAC,WAC9B,QAAQ;IAGV,IAAI,SAAS,UAAU,WACrB,aAAa;IAGf,IAAI,eAAe,CAAC;QAClB,IAAI,CAAC,QACH;IAEJ;IAEA,qBACE,gCAAC,CAAA,GAAA,uCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,QAAQ,CAAC,CAAC;0BAAO;QAAY;kBACzD;;AAGP;AASO,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,4CAAgB,EAAE,CAAA,GAAA,uCAAW;IAC3C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,OAAO;QACL;YACE,SAAS,eAAe;QAC1B;IACF;AACF","sources":["packages/@react-spectrum/s2/src/DialogContainer.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {ModalContext, useSlottedContext} from 'react-aria-components';\nimport React, {ReactElement, useState} from 'react';\nimport {SpectrumDialogContainerProps} from '@react-types/dialog';\n\nexport interface DialogContainerProps extends Omit<SpectrumDialogContainerProps, 'type' | 'isDismissable' | 'isKeyboardDismissDisabled'> {}\n\n/**\n * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding\n * it in a modal. Useful in cases where there is no trigger element\n * or when the trigger unmounts while the dialog is open.\n */\nexport function DialogContainer(props: DialogContainerProps) {\n let {\n children,\n onDismiss\n } = props;\n\n let childArray = React.Children.toArray(children);\n if (childArray.length > 1) {\n throw new Error('Only a single child can be passed to DialogContainer.');\n }\n\n let [lastChild, setLastChild] = useState<ReactElement | null>(null);\n\n // React.Children.toArray mutates the children, and we need them to be stable\n // between renders so that the lastChild comparison works.\n let child: ReactElement | undefined = undefined;\n if (Array.isArray(children)) {\n child = children.find(React.isValidElement);\n } else if (React.isValidElement(children)) {\n child = children;\n }\n\n if (child && child !== lastChild) {\n setLastChild(child);\n }\n\n let onOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onDismiss();\n }\n };\n\n return (\n <ModalContext.Provider value={{isOpen: !!child, onOpenChange}}>\n {lastChild}\n </ModalContext.Provider>\n );\n}\n\nexport interface DialogContainerValue {\n /**\n * A handler to programmatically dismiss the dialog.\n */\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useSlottedContext(ModalContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n dismiss() {\n context?.onOpenChange?.(false);\n }\n };\n}\n"],"names":[],"version":3,"file":"DialogContainer.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAgB,KAA2B;IACzD,IAAI,YACF,QAAQ,aACR,SAAS,EACV,GAAG;IAEJ,IAAI,aAAa,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;IACxC,IAAI,WAAW,MAAM,GAAG,GACtB,MAAM,IAAI,MAAM;IAGlB,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAuB;IAE9D,6EAA6E;IAC7E,0DAA0D;IAC1D,IAAI,QAAkC;IACtC,IAAI,MAAM,OAAO,CAAC,WAChB,QAAQ,SAAS,IAAI,CAAC,CAAA,GAAA,sCAAI,EAAE,cAAc;SACrC,kBAAI,CAAA,GAAA,sCAAI,EAAE,cAAc,CAAC,WAC9B,QAAQ;IAGV,IAAI,SAAS,UAAU,WACrB,aAAa;IAGf,IAAI,eAAe,CAAC;QAClB,IAAI,CAAC,QACH;IAEJ;IAEA,qBACE,gCAAC,CAAA,GAAA,uCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,QAAQ,CAAC,CAAC;0BAAO;QAAY;kBACzD;;AAGP;AASO,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,4CAAgB,EAAE,CAAA,GAAA,uCAAW;IAC3C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,OAAO;QACL;YACE,SAAS,eAAe;QAC1B;IACF;AACF","sources":["packages/@react-spectrum/s2/src/DialogContainer.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {ModalContext, useSlottedContext} from 'react-aria-components';\nimport React, {ReactElement, ReactNode, useState} from 'react';\nimport {SpectrumDialogContainerProps} from '@react-types/dialog';\n\nexport interface DialogContainerProps extends Omit<SpectrumDialogContainerProps, 'type' | 'isDismissable' | 'isKeyboardDismissDisabled'> {}\n\n/**\n * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding\n * it in a modal. Useful in cases where there is no trigger element\n * or when the trigger unmounts while the dialog is open.\n */\nexport function DialogContainer(props: DialogContainerProps): ReactNode {\n let {\n children,\n onDismiss\n } = props;\n\n let childArray = React.Children.toArray(children);\n if (childArray.length > 1) {\n throw new Error('Only a single child can be passed to DialogContainer.');\n }\n\n let [lastChild, setLastChild] = useState<ReactElement | null>(null);\n\n // React.Children.toArray mutates the children, and we need them to be stable\n // between renders so that the lastChild comparison works.\n let child: ReactElement | undefined = undefined;\n if (Array.isArray(children)) {\n child = children.find(React.isValidElement);\n } else if (React.isValidElement(children)) {\n child = children;\n }\n\n if (child && child !== lastChild) {\n setLastChild(child);\n }\n\n let onOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onDismiss();\n }\n };\n\n return (\n <ModalContext.Provider value={{isOpen: !!child, onOpenChange}}>\n {lastChild}\n </ModalContext.Provider>\n );\n}\n\nexport interface DialogContainerValue {\n /**\n * A handler to programmatically dismiss the dialog.\n */\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useSlottedContext(ModalContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n dismiss() {\n context?.onOpenChange?.(false);\n }\n };\n}\n"],"names":[],"version":3,"file":"DialogContainer.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAgB,KAA2B;IACzD,IAAI,YACF,QAAQ,aACR,SAAS,EACV,GAAG;IAEJ,IAAI,aAAa,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;IACxC,IAAI,WAAW,MAAM,GAAG,GACtB,MAAM,IAAI,MAAM;IAGlB,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,eAAO,EAAuB;IAE9D,6EAA6E;IAC7E,0DAA0D;IAC1D,IAAI,QAAkC;IACtC,IAAI,MAAM,OAAO,CAAC,WAChB,QAAQ,SAAS,IAAI,CAAC,CAAA,GAAA,YAAI,EAAE,cAAc;SACrC,kBAAI,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC,WAC9B,QAAQ;IAGV,IAAI,SAAS,UAAU,WACrB,aAAa;IAGf,IAAI,eAAe,CAAC;QAClB,IAAI,CAAC,QACH;IAEJ;IAEA,qBACE,gBAAC,CAAA,GAAA,mBAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,QAAQ,CAAC,CAAC;0BAAO;QAAY;kBACzD;;AAGP;AASO,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,wBAAgB,EAAE,CAAA,GAAA,mBAAW;IAC3C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,OAAO;QACL;YACE,SAAS,eAAe;QAC1B;IACF;AACF","sources":["packages/@react-spectrum/s2/src/DialogContainer.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {ModalContext, useSlottedContext} from 'react-aria-components';\nimport React, {ReactElement, useState} from 'react';\nimport {SpectrumDialogContainerProps} from '@react-types/dialog';\n\nexport interface DialogContainerProps extends Omit<SpectrumDialogContainerProps, 'type' | 'isDismissable' | 'isKeyboardDismissDisabled'> {}\n\n/**\n * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding\n * it in a modal. Useful in cases where there is no trigger element\n * or when the trigger unmounts while the dialog is open.\n */\nexport function DialogContainer(props: DialogContainerProps) {\n let {\n children,\n onDismiss\n } = props;\n\n let childArray = React.Children.toArray(children);\n if (childArray.length > 1) {\n throw new Error('Only a single child can be passed to DialogContainer.');\n }\n\n let [lastChild, setLastChild] = useState<ReactElement | null>(null);\n\n // React.Children.toArray mutates the children, and we need them to be stable\n // between renders so that the lastChild comparison works.\n let child: ReactElement | undefined = undefined;\n if (Array.isArray(children)) {\n child = children.find(React.isValidElement);\n } else if (React.isValidElement(children)) {\n child = children;\n }\n\n if (child && child !== lastChild) {\n setLastChild(child);\n }\n\n let onOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onDismiss();\n }\n };\n\n return (\n <ModalContext.Provider value={{isOpen: !!child, onOpenChange}}>\n {lastChild}\n </ModalContext.Provider>\n );\n}\n\nexport interface DialogContainerValue {\n /**\n * A handler to programmatically dismiss the dialog.\n */\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useSlottedContext(ModalContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n dismiss() {\n context?.onOpenChange?.(false);\n }\n };\n}\n"],"names":[],"version":3,"file":"DialogContainer.mjs.map"}
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAgB,KAA2B;IACzD,IAAI,YACF,QAAQ,aACR,SAAS,EACV,GAAG;IAEJ,IAAI,aAAa,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;IACxC,IAAI,WAAW,MAAM,GAAG,GACtB,MAAM,IAAI,MAAM;IAGlB,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,eAAO,EAAuB;IAE9D,6EAA6E;IAC7E,0DAA0D;IAC1D,IAAI,QAAkC;IACtC,IAAI,MAAM,OAAO,CAAC,WAChB,QAAQ,SAAS,IAAI,CAAC,CAAA,GAAA,YAAI,EAAE,cAAc;SACrC,kBAAI,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC,WAC9B,QAAQ;IAGV,IAAI,SAAS,UAAU,WACrB,aAAa;IAGf,IAAI,eAAe,CAAC;QAClB,IAAI,CAAC,QACH;IAEJ;IAEA,qBACE,gBAAC,CAAA,GAAA,mBAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,QAAQ,CAAC,CAAC;0BAAO;QAAY;kBACzD;;AAGP;AASO,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,wBAAgB,EAAE,CAAA,GAAA,mBAAW;IAC3C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,OAAO;QACL;YACE,SAAS,eAAe;QAC1B;IACF;AACF","sources":["packages/@react-spectrum/s2/src/DialogContainer.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {ModalContext, useSlottedContext} from 'react-aria-components';\nimport React, {ReactElement, ReactNode, useState} from 'react';\nimport {SpectrumDialogContainerProps} from '@react-types/dialog';\n\nexport interface DialogContainerProps extends Omit<SpectrumDialogContainerProps, 'type' | 'isDismissable' | 'isKeyboardDismissDisabled'> {}\n\n/**\n * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding\n * it in a modal. Useful in cases where there is no trigger element\n * or when the trigger unmounts while the dialog is open.\n */\nexport function DialogContainer(props: DialogContainerProps): ReactNode {\n let {\n children,\n onDismiss\n } = props;\n\n let childArray = React.Children.toArray(children);\n if (childArray.length > 1) {\n throw new Error('Only a single child can be passed to DialogContainer.');\n }\n\n let [lastChild, setLastChild] = useState<ReactElement | null>(null);\n\n // React.Children.toArray mutates the children, and we need them to be stable\n // between renders so that the lastChild comparison works.\n let child: ReactElement | undefined = undefined;\n if (Array.isArray(children)) {\n child = children.find(React.isValidElement);\n } else if (React.isValidElement(children)) {\n child = children;\n }\n\n if (child && child !== lastChild) {\n setLastChild(child);\n }\n\n let onOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onDismiss();\n }\n };\n\n return (\n <ModalContext.Provider value={{isOpen: !!child, onOpenChange}}>\n {lastChild}\n </ModalContext.Provider>\n );\n}\n\nexport interface DialogContainerValue {\n /**\n * A handler to programmatically dismiss the dialog.\n */\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useSlottedContext(ModalContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n dismiss() {\n context?.onOpenChange?.(false);\n }\n };\n}\n"],"names":[],"version":3,"file":"DialogContainer.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAc,KAAyB;IACrD,qBACE,gCAAC,CAAA,GAAA,wCAAgB;QAAG,GAAG,KAAK;kBAG1B,cAAA,gCAAC,CAAA,GAAA,2CAAa;YAAE,WAAW;sBACxB,MAAM,QAAQ;;;AAIvB","sources":["packages/@react-spectrum/s2/src/DialogTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {DialogTrigger as AriaDialogTrigger, DialogTriggerProps as AriaDialogTriggerProps} from 'react-aria-components';\nimport {PressResponder} from '@react-aria/interactions';\nimport {ReactNode} from 'react';\n\nexport interface DialogTriggerProps extends AriaDialogTriggerProps {}\n\n/**\n * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's\n * open state with the trigger's press state. Additionally, it allows you to customize the type and\n * positioning of the Dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps): ReactNode {\n return (\n <AriaDialogTrigger {...props}>\n {/* RAC sets isPressed via PressResponder when the dialog is open.\n We don't want press scaling to appear to get \"stuck\", so override this. */}\n <PressResponder isPressed={false}>\n {props.children}\n </PressResponder>\n </AriaDialogTrigger>\n );\n}\n"],"names":[],"version":3,"file":"DialogTrigger.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAc,KAAyB;IACrD,qBACE,gBAAC,CAAA,GAAA,oBAAgB;QAAG,GAAG,KAAK;kBAG1B,cAAA,gBAAC,CAAA,GAAA,qBAAa;YAAE,WAAW;sBACxB,MAAM,QAAQ;;;AAIvB","sources":["packages/@react-spectrum/s2/src/DialogTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {DialogTrigger as AriaDialogTrigger, DialogTriggerProps as AriaDialogTriggerProps} from 'react-aria-components';\nimport {PressResponder} from '@react-aria/interactions';\nimport {ReactNode} from 'react';\n\nexport interface DialogTriggerProps extends AriaDialogTriggerProps {}\n\n/**\n * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's\n * open state with the trigger's press state. Additionally, it allows you to customize the type and\n * positioning of the Dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps): ReactNode {\n return (\n <AriaDialogTrigger {...props}>\n {/* RAC sets isPressed via PressResponder when the dialog is open.\n We don't want press scaling to appear to get \"stuck\", so override this. */}\n <PressResponder isPressed={false}>\n {props.children}\n </PressResponder>\n </AriaDialogTrigger>\n );\n}\n"],"names":[],"version":3,"file":"DialogTrigger.mjs.map"}
|
package/dist/Disclosure.cjs
CHANGED
|
@@ -107,17 +107,17 @@ const $4e301a98f0cc4e4f$var$buttonStyles = function anonymous(props) {
|
|
|
107
107
|
rules += ' _d-enzrfpb';
|
|
108
108
|
rules += ' _da';
|
|
109
109
|
if (props.size === "XL") {
|
|
110
|
-
rules += ' _ebo';
|
|
111
|
-
rules += ' _en';
|
|
112
|
-
} else if (props.size === "L") {
|
|
113
|
-
rules += ' _ebm';
|
|
114
|
-
rules += ' _ej';
|
|
115
|
-
} else if (props.size === "M") {
|
|
116
110
|
rules += ' _ebl';
|
|
117
111
|
rules += ' _ek';
|
|
118
|
-
} else if (props.size === "
|
|
112
|
+
} else if (props.size === "L") {
|
|
119
113
|
rules += ' _ebj';
|
|
120
114
|
rules += ' _ei';
|
|
115
|
+
} else if (props.size === "M") {
|
|
116
|
+
rules += ' _ebh';
|
|
117
|
+
rules += ' _eg';
|
|
118
|
+
} else if (props.size === "S") {
|
|
119
|
+
rules += ' _ebf';
|
|
120
|
+
rules += ' _ee';
|
|
121
121
|
}
|
|
122
122
|
rules += ' _fd';
|
|
123
123
|
rules += ' _g-1x99dlob';
|
|
@@ -166,21 +166,21 @@ const $4e301a98f0cc4e4f$var$buttonStyles = function anonymous(props) {
|
|
|
166
166
|
rules += ' _ka';
|
|
167
167
|
rules += ' __S-yksgrp';
|
|
168
168
|
if (props.size === "XL") {
|
|
169
|
-
if (props.density === "spacious") rules += ' -_375tou_o-_q';
|
|
170
|
-
else if (props.density === "regular") rules += ' -_375tou_o-_i';
|
|
171
|
-
else if (props.density === "compact") rules += ' -_375tou_o-_a';
|
|
172
|
-
} else if (props.size === "L") {
|
|
173
169
|
if (props.density === "spacious") rules += ' -_375tou_o-_i';
|
|
174
170
|
else if (props.density === "regular") rules += ' -_375tou_o-_a';
|
|
175
171
|
else if (props.density === "compact") rules += ' -_375tou_o-2';
|
|
176
|
-
} else if (props.size === "
|
|
172
|
+
} else if (props.size === "L") {
|
|
177
173
|
if (props.density === "spacious") rules += ' -_375tou_o-_a';
|
|
178
174
|
else if (props.density === "regular") rules += ' -_375tou_o-2';
|
|
179
175
|
else if (props.density === "compact") rules += ' -_375tou_o-U';
|
|
180
|
-
} else if (props.size === "
|
|
176
|
+
} else if (props.size === "M") {
|
|
181
177
|
if (props.density === "spacious") rules += ' -_375tou_o-2';
|
|
182
178
|
else if (props.density === "regular") rules += ' -_375tou_o-U';
|
|
183
179
|
else if (props.density === "compact") rules += ' -_375tou_o-M';
|
|
180
|
+
} else if (props.size === "S") {
|
|
181
|
+
if (props.density === "spacious") rules += ' -_375tou_o-U';
|
|
182
|
+
else if (props.density === "regular") rules += ' -_375tou_o-M';
|
|
183
|
+
else if (props.density === "compact") rules += ' -_375tou_o-G';
|
|
184
184
|
}
|
|
185
185
|
rules += ' -_375tp0_u-a';
|
|
186
186
|
rules += ' -_375tp1_v-a';
|
|
@@ -202,15 +202,18 @@ function $4e301a98f0cc4e4f$var$DisclosureHeaderWithForwardRef(props, ref) {
|
|
|
202
202
|
let { UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style, children: children } = props;
|
|
203
203
|
let domRef = (0, $5FRIp$reactspectrumutils.useDOMRef)(ref);
|
|
204
204
|
let { size: size, isQuiet: isQuiet, density: density } = (0, $5FRIp$reactariacomponents.useSlottedContext)($4e301a98f0cc4e4f$export$d665dd135a51b28a);
|
|
205
|
-
|
|
206
|
-
S: 'XS',
|
|
207
|
-
M: 'S',
|
|
208
|
-
L: 'M',
|
|
209
|
-
XL: 'L'
|
|
210
|
-
};
|
|
211
|
-
// maps to one size smaller in the compact density to ensure there is space between the top and bottom of the action button and container
|
|
205
|
+
// Shift button size down by 2 for compact density, 1 for regular/spacious to ensure there is space between the top and bottom of the action button and container
|
|
212
206
|
let newSize = size;
|
|
213
|
-
|
|
207
|
+
const sizes = [
|
|
208
|
+
'XS',
|
|
209
|
+
'S',
|
|
210
|
+
'M',
|
|
211
|
+
'L',
|
|
212
|
+
'XL'
|
|
213
|
+
];
|
|
214
|
+
const currentIndex = sizes.indexOf(size ?? 'M');
|
|
215
|
+
const shift = density === 'compact' ? 2 : 1;
|
|
216
|
+
newSize = sizes[Math.max(0, currentIndex - shift)];
|
|
214
217
|
return /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $5FRIp$reactariacomponents.Provider), {
|
|
215
218
|
values: [
|
|
216
219
|
[
|
package/dist/Disclosure.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+BM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAuE;AAEpH,MAAM;;;;;;;;;;;;;;;;;;;;;;AA2BC,MAAM,0DAAa,CAAA,GAAA,uBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAA2B;IAC1G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,QACF,OAAO,cACP,UAAU,oBACV,OAAO,gBACP,YAAY,oBACZ,mBAAmB,IACpB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI,YAAY,CAAA,GAAA,uBAAS,EAAE,+CAAuB;IAElD,qBACE,gCAAC,CAAA,GAAA,mCAAO;QACN,QA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,oCAAa,EAAE;IAChC,IAAI,QAAC,IAAI,EAAC,GAAG,CAAA,GAAA,4CAAgB,EAAE;IAC/B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAqB;IACnD,IAAI,WAAW,CAAA,GAAA,mCAAQ,EAAE;IACzB,qBACE,gCAAC,CAAA,GAAA,0CAAiB;QACf,GAAG,QAAQ;QACZ,KAAK;QACL,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,kCAAY;kBAAC;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB","sources":["packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {ActionButtonContext} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of a DisclosureTitle and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Partial<DisclosureProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 1,\n isQuiet: 0,\n isInGroup: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: 200\n}, getAllowedOverrides());\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = forwardRef(function Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n let isInGroup = useContext(DisclosureContext) !== null;\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet, isInGroup}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n});\n\nexport interface DisclosureTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\ninterface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0,\n flexGrow: 1,\n display: 'flex',\n flexShrink: 1,\n minWidth: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n flexGrow: 1,\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-300', 'transparent-white-300')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nconst InternalDisclosureHeader = createContext<{} | null>(null);\n\nfunction DisclosureHeaderWithForwardRef(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_className,\n UNSAFE_style,\n children\n } = props;\n let domRef = useDOMRef(ref);\n let {size, isQuiet, density} = useSlottedContext(DisclosureContext)!;\n\n let mapSize = {\n S: 'XS',\n M: 'S',\n L: 'M',\n XL: 'L'\n };\n\n // maps to one size smaller in the compact density to ensure there is space between the top and bottom of the action button and container\n let newSize : 'XS' | 'S' | 'M' | 'L' | 'XL' | undefined = size;\n if (density === 'compact') {\n newSize = mapSize[size ?? 'M'] as 'XS' | 'S' | 'M' | 'L';\n }\n\n return (\n <Provider\n values={[\n [ActionButtonContext, {size: newSize, isQuiet}],\n [InternalDisclosureHeader, {}]\n ]}>\n <div\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + style({display: 'flex', alignItems: 'center', gap: 4})}\n ref={domRef}>\n {children}\n </div>\n </Provider>\n );\n}\n\n/**\n * A wrapper element for the disclosure title that can contain other elements not part of the trigger.\n */\nexport const DisclosureHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosureHeaderWithForwardRef);\n\n/**\n * A disclosure title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const DisclosureTitle = forwardRef(function DisclosureTitle(props: DisclosureTitleProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n\n let buttonTrigger = (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n let ctx = useContext(InternalDisclosureHeader);\n if (ctx) {\n return buttonTrigger;\n }\n\n return (\n <DisclosureHeader>\n {buttonTrigger}\n </DisclosureHeader>\n );\n});\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: 9,\n L: 12,\n XL: 15\n }\n }\n }\n});\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nexport const DisclosurePanel = forwardRef(function DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n});\n\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+BM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAuE;AAEpH,MAAM;;;;;;;;;;;;;;;;;;;;;;AA2BC,MAAM,0DAAa,CAAA,GAAA,uBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAA2B;IAC1G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,QACF,OAAO,cACP,UAAU,oBACV,OAAO,gBACP,YAAY,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E,gCAAC;kBACE;;AAGP;AAMA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBC,MAAM,0DAAkB,CAAA,GAAA,uBAAS,EAAE,SAAS,gBAAgB,KAA2B,EAAE,GAA2B;IACzH,IAAI,gBACF,YAAY,oBACZ,mBAAmB,IACnB,GAAG,YACJ,GAAG;IACJ,MAAM,WAAW,CAAA,GAAA,oCAAa,EAAE;IAChC,IAAI,QAAC,IAAI,EAAC,GAAG,CAAA,GAAA,4CAAgB,EAAE;IAC/B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAqB;IACnD,IAAI,WAAW,CAAA,GAAA,mCAAQ,EAAE;IACzB,qBACE,gCAAC,CAAA,GAAA,0CAAiB;QACf,GAAG,QAAQ;QACZ,KAAK;QACL,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,kCAAY;kBAAC;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB","sources":["packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {ActionButtonContext} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of a DisclosureTitle and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Partial<DisclosureProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 1,\n isQuiet: 0,\n isInGroup: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: 200\n}, getAllowedOverrides());\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = forwardRef(function Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n let isInGroup = useContext(DisclosureContext) !== null;\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet, isInGroup}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n});\n\nexport interface DisclosureTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\ninterface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0,\n flexGrow: 1,\n display: 'flex',\n flexShrink: 1,\n minWidth: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'title-sm',\n M: 'title',\n L: 'title-lg',\n XL: 'title-xl'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n flexGrow: 1,\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 18,\n regular: 24,\n spacious: 32\n }\n },\n M: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n L: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n XL: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-300', 'transparent-white-300')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nconst InternalDisclosureHeader = createContext<{} | null>(null);\n\nfunction DisclosureHeaderWithForwardRef(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_className,\n UNSAFE_style,\n children\n } = props;\n let domRef = useDOMRef(ref);\n let {size, isQuiet, density} = useSlottedContext(DisclosureContext)!;\n\n // Shift button size down by 2 for compact density, 1 for regular/spacious to ensure there is space between the top and bottom of the action button and container\n let newSize : 'XS' | 'S' | 'M' | 'L' | 'XL' | undefined = size;\n const sizes = ['XS', 'S', 'M', 'L', 'XL'];\n const currentIndex = sizes.indexOf(size ?? 'M');\n const shift = density === 'compact' ? 2 : 1;\n newSize = sizes[Math.max(0, currentIndex - shift)] as 'XS' | 'S' | 'M' | 'L' | 'XL';\n\n return (\n <Provider\n values={[\n [ActionButtonContext, {size: newSize, isQuiet}],\n [InternalDisclosureHeader, {}]\n ]}>\n <div\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + style({display: 'flex', alignItems: 'center', gap: 4})}\n ref={domRef}>\n {children}\n </div>\n </Provider>\n );\n}\n\n/**\n * A wrapper element for the disclosure title that can contain other elements not part of the trigger.\n */\nexport const DisclosureHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosureHeaderWithForwardRef);\n\n/**\n * A disclosure title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const DisclosureTitle = forwardRef(function DisclosureTitle(props: DisclosureTitleProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n\n let buttonTrigger = (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n let ctx = useContext(InternalDisclosureHeader);\n if (ctx) {\n return buttonTrigger;\n }\n\n return (\n <DisclosureHeader>\n {buttonTrigger}\n </DisclosureHeader>\n );\n});\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: 9,\n L: 12,\n XL: 15\n }\n }\n }\n});\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nexport const DisclosurePanel = forwardRef(function DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n});\n\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}
|
package/dist/Disclosure.css
CHANGED
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
outline-offset: -2px;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
._ee {
|
|
75
|
+
font-size: .875rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
74
78
|
._ei {
|
|
75
79
|
font-size: 1.125rem;
|
|
76
80
|
}
|
|
@@ -79,14 +83,6 @@
|
|
|
79
83
|
font-size: 1.25rem;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
|
-
._ej {
|
|
83
|
-
font-size: 1.375rem;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
._en {
|
|
87
|
-
font-size: 1.75rem;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
86
|
._fd {
|
|
91
87
|
font-variation-settings: "wght" 700;
|
|
92
88
|
font-synthesis-weight: none;
|
|
@@ -213,6 +209,10 @@
|
|
|
213
209
|
-webkit-tap-highlight-color: #0000;
|
|
214
210
|
}
|
|
215
211
|
|
|
212
|
+
.-_375tou_o-G {
|
|
213
|
+
--o: calc(1.125rem * var(--s2-scale));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
216
|
.-_375tou_o-M {
|
|
217
217
|
--o: calc(1.5rem * var(--s2-scale));
|
|
218
218
|
}
|
|
@@ -233,10 +233,6 @@
|
|
|
233
233
|
--o: calc(3.5rem * var(--s2-scale));
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
.-_375tou_o-_q {
|
|
237
|
-
--o: calc(4rem * var(--s2-scale));
|
|
238
|
-
}
|
|
239
|
-
|
|
240
236
|
.-_375tp0_u-a {
|
|
241
237
|
--u: 0px;
|
|
242
238
|
}
|
|
@@ -404,6 +400,10 @@
|
|
|
404
400
|
|
|
405
401
|
@layer _.b.b {
|
|
406
402
|
@media not ((hover: hover) and (pointer: fine)) {
|
|
403
|
+
._ebf {
|
|
404
|
+
font-size: 1.0625rem;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
407
|
._ebj {
|
|
408
408
|
font-size: 1.375rem;
|
|
409
409
|
}
|
|
@@ -412,14 +412,6 @@
|
|
|
412
412
|
font-size: 1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;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAsLD","sources":["af82a6f8008c749b","packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["@import \"02b9b02b69a441b2\";\n@import \"80d1cf6aba9342e9\";\n@import \"d47c144c912b2c65\";\n@import \"54c3947845455457\";\n@import \"47e48706d70658de\";\n@import \"879f5cdc449bf13e\";\n","/*\n * Copyright 2024 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 {ActionButtonContext} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of a DisclosureTitle and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Partial<DisclosureProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 1,\n isQuiet: 0,\n isInGroup: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: 200\n}, getAllowedOverrides());\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = forwardRef(function Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n let isInGroup = useContext(DisclosureContext) !== null;\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet, isInGroup}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n});\n\nexport interface DisclosureTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\ninterface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0,\n flexGrow: 1,\n display: 'flex',\n flexShrink: 1,\n minWidth: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n flexGrow: 1,\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-300', 'transparent-white-300')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nconst InternalDisclosureHeader = createContext<{} | null>(null);\n\nfunction DisclosureHeaderWithForwardRef(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_className,\n UNSAFE_style,\n children\n } = props;\n let domRef = useDOMRef(ref);\n let {size, isQuiet, density} = useSlottedContext(DisclosureContext)!;\n\n let mapSize = {\n S: 'XS',\n M: 'S',\n L: 'M',\n XL: 'L'\n };\n\n // maps to one size smaller in the compact density to ensure there is space between the top and bottom of the action button and container\n let newSize : 'XS' | 'S' | 'M' | 'L' | 'XL' | undefined = size;\n if (density === 'compact') {\n newSize = mapSize[size ?? 'M'] as 'XS' | 'S' | 'M' | 'L';\n }\n\n return (\n <Provider\n values={[\n [ActionButtonContext, {size: newSize, isQuiet}],\n [InternalDisclosureHeader, {}]\n ]}>\n <div\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + style({display: 'flex', alignItems: 'center', gap: 4})}\n ref={domRef}>\n {children}\n </div>\n </Provider>\n );\n}\n\n/**\n * A wrapper element for the disclosure title that can contain other elements not part of the trigger.\n */\nexport const DisclosureHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosureHeaderWithForwardRef);\n\n/**\n * A disclosure title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const DisclosureTitle = forwardRef(function DisclosureTitle(props: DisclosureTitleProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n\n let buttonTrigger = (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n let ctx = useContext(InternalDisclosureHeader);\n if (ctx) {\n return buttonTrigger;\n }\n\n return (\n <DisclosureHeader>\n {buttonTrigger}\n </DisclosureHeader>\n );\n});\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: 9,\n L: 12,\n XL: 15\n }\n }\n }\n});\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nexport const DisclosurePanel = forwardRef(function DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n});\n\n"],"names":[],"version":3,"file":"Disclosure.css.map"}
|
|
1
|
+
{"mappings":"AC2CmB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAsEE;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAQA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA4EC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAuCwB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6D1B;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA9PD;EAAA;;;;EAAA;;;;EA8EE;;;;EAgLD;;;;EAAA;;;;;AAhLC;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAgLD","sources":["af82a6f8008c749b","packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["@import \"02b9b02b69a441b2\";\n@import \"80d1cf6aba9342e9\";\n@import \"d47c144c912b2c65\";\n@import \"54c3947845455457\";\n@import \"47e48706d70658de\";\n@import \"879f5cdc449bf13e\";\n","/*\n * Copyright 2024 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 {ActionButtonContext} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of a DisclosureTitle and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Partial<DisclosureProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 1,\n isQuiet: 0,\n isInGroup: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: 200\n}, getAllowedOverrides());\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = forwardRef(function Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n let isInGroup = useContext(DisclosureContext) !== null;\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet, isInGroup}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n});\n\nexport interface DisclosureTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\ninterface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0,\n flexGrow: 1,\n display: 'flex',\n flexShrink: 1,\n minWidth: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'title-sm',\n M: 'title',\n L: 'title-lg',\n XL: 'title-xl'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n flexGrow: 1,\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 18,\n regular: 24,\n spacious: 32\n }\n },\n M: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n L: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n XL: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-300', 'transparent-white-300')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nconst InternalDisclosureHeader = createContext<{} | null>(null);\n\nfunction DisclosureHeaderWithForwardRef(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_className,\n UNSAFE_style,\n children\n } = props;\n let domRef = useDOMRef(ref);\n let {size, isQuiet, density} = useSlottedContext(DisclosureContext)!;\n\n // Shift button size down by 2 for compact density, 1 for regular/spacious to ensure there is space between the top and bottom of the action button and container\n let newSize : 'XS' | 'S' | 'M' | 'L' | 'XL' | undefined = size;\n const sizes = ['XS', 'S', 'M', 'L', 'XL'];\n const currentIndex = sizes.indexOf(size ?? 'M');\n const shift = density === 'compact' ? 2 : 1;\n newSize = sizes[Math.max(0, currentIndex - shift)] as 'XS' | 'S' | 'M' | 'L' | 'XL';\n\n return (\n <Provider\n values={[\n [ActionButtonContext, {size: newSize, isQuiet}],\n [InternalDisclosureHeader, {}]\n ]}>\n <div\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + style({display: 'flex', alignItems: 'center', gap: 4})}\n ref={domRef}>\n {children}\n </div>\n </Provider>\n );\n}\n\n/**\n * A wrapper element for the disclosure title that can contain other elements not part of the trigger.\n */\nexport const DisclosureHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosureHeaderWithForwardRef);\n\n/**\n * A disclosure title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const DisclosureTitle = forwardRef(function DisclosureTitle(props: DisclosureTitleProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n\n let buttonTrigger = (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n let ctx = useContext(InternalDisclosureHeader);\n if (ctx) {\n return buttonTrigger;\n }\n\n return (\n <DisclosureHeader>\n {buttonTrigger}\n </DisclosureHeader>\n );\n});\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: 9,\n L: 12,\n XL: 15\n }\n }\n }\n});\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nexport const DisclosurePanel = forwardRef(function DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n});\n\n"],"names":[],"version":3,"file":"Disclosure.css.map"}
|
package/dist/Disclosure.mjs
CHANGED
|
@@ -97,17 +97,17 @@ const $cf1d656285911959$var$buttonStyles = function anonymous(props) {
|
|
|
97
97
|
rules += ' _d-enzrfpb';
|
|
98
98
|
rules += ' _da';
|
|
99
99
|
if (props.size === "XL") {
|
|
100
|
-
rules += ' _ebo';
|
|
101
|
-
rules += ' _en';
|
|
102
|
-
} else if (props.size === "L") {
|
|
103
|
-
rules += ' _ebm';
|
|
104
|
-
rules += ' _ej';
|
|
105
|
-
} else if (props.size === "M") {
|
|
106
100
|
rules += ' _ebl';
|
|
107
101
|
rules += ' _ek';
|
|
108
|
-
} else if (props.size === "
|
|
102
|
+
} else if (props.size === "L") {
|
|
109
103
|
rules += ' _ebj';
|
|
110
104
|
rules += ' _ei';
|
|
105
|
+
} else if (props.size === "M") {
|
|
106
|
+
rules += ' _ebh';
|
|
107
|
+
rules += ' _eg';
|
|
108
|
+
} else if (props.size === "S") {
|
|
109
|
+
rules += ' _ebf';
|
|
110
|
+
rules += ' _ee';
|
|
111
111
|
}
|
|
112
112
|
rules += ' _fd';
|
|
113
113
|
rules += ' _g-1x99dlob';
|
|
@@ -156,21 +156,21 @@ const $cf1d656285911959$var$buttonStyles = function anonymous(props) {
|
|
|
156
156
|
rules += ' _ka';
|
|
157
157
|
rules += ' __S-yksgrp';
|
|
158
158
|
if (props.size === "XL") {
|
|
159
|
-
if (props.density === "spacious") rules += ' -_375tou_o-_q';
|
|
160
|
-
else if (props.density === "regular") rules += ' -_375tou_o-_i';
|
|
161
|
-
else if (props.density === "compact") rules += ' -_375tou_o-_a';
|
|
162
|
-
} else if (props.size === "L") {
|
|
163
159
|
if (props.density === "spacious") rules += ' -_375tou_o-_i';
|
|
164
160
|
else if (props.density === "regular") rules += ' -_375tou_o-_a';
|
|
165
161
|
else if (props.density === "compact") rules += ' -_375tou_o-2';
|
|
166
|
-
} else if (props.size === "
|
|
162
|
+
} else if (props.size === "L") {
|
|
167
163
|
if (props.density === "spacious") rules += ' -_375tou_o-_a';
|
|
168
164
|
else if (props.density === "regular") rules += ' -_375tou_o-2';
|
|
169
165
|
else if (props.density === "compact") rules += ' -_375tou_o-U';
|
|
170
|
-
} else if (props.size === "
|
|
166
|
+
} else if (props.size === "M") {
|
|
171
167
|
if (props.density === "spacious") rules += ' -_375tou_o-2';
|
|
172
168
|
else if (props.density === "regular") rules += ' -_375tou_o-U';
|
|
173
169
|
else if (props.density === "compact") rules += ' -_375tou_o-M';
|
|
170
|
+
} else if (props.size === "S") {
|
|
171
|
+
if (props.density === "spacious") rules += ' -_375tou_o-U';
|
|
172
|
+
else if (props.density === "regular") rules += ' -_375tou_o-M';
|
|
173
|
+
else if (props.density === "compact") rules += ' -_375tou_o-G';
|
|
174
174
|
}
|
|
175
175
|
rules += ' -_375tp0_u-a';
|
|
176
176
|
rules += ' -_375tp1_v-a';
|
|
@@ -192,15 +192,18 @@ function $cf1d656285911959$var$DisclosureHeaderWithForwardRef(props, ref) {
|
|
|
192
192
|
let { UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style, children: children } = props;
|
|
193
193
|
let domRef = (0, $7VHtn$useDOMRef)(ref);
|
|
194
194
|
let { size: size, isQuiet: isQuiet, density: density } = (0, $7VHtn$useSlottedContext)($cf1d656285911959$export$d665dd135a51b28a);
|
|
195
|
-
|
|
196
|
-
S: 'XS',
|
|
197
|
-
M: 'S',
|
|
198
|
-
L: 'M',
|
|
199
|
-
XL: 'L'
|
|
200
|
-
};
|
|
201
|
-
// maps to one size smaller in the compact density to ensure there is space between the top and bottom of the action button and container
|
|
195
|
+
// Shift button size down by 2 for compact density, 1 for regular/spacious to ensure there is space between the top and bottom of the action button and container
|
|
202
196
|
let newSize = size;
|
|
203
|
-
|
|
197
|
+
const sizes = [
|
|
198
|
+
'XS',
|
|
199
|
+
'S',
|
|
200
|
+
'M',
|
|
201
|
+
'L',
|
|
202
|
+
'XL'
|
|
203
|
+
];
|
|
204
|
+
const currentIndex = sizes.indexOf(size ?? 'M');
|
|
205
|
+
const shift = density === 'compact' ? 2 : 1;
|
|
206
|
+
newSize = sizes[Math.max(0, currentIndex - shift)];
|
|
204
207
|
return /*#__PURE__*/ (0, $7VHtn$jsx)((0, $7VHtn$Provider), {
|
|
205
208
|
values: [
|
|
206
209
|
[
|
package/dist/Disclosure.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+BM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAuE;AAEpH,MAAM;;;;;;;;;;;;;;;;;;;;;;AA2BC,MAAM,0DAAa,CAAA,GAAA,iBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAA2B;IAC1G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,QACF,OAAO,cACP,UAAU,oBACV,OAAO,gBACP,YAAY,oBACZ,mBAAmB,IACpB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,YAAY,CAAA,GAAA,iBAAS,EAAE,+CAAuB;IAElD,qBACE,gBAAC,CAAA,GAAA,eAAO;QACN,QAAQ;YACN;gBAAC;gBAAmB;0BAAC;6BAAM;6BAAS;gBAAO;aAAE;SAC9C;kBACD,cAAA,gBAAC,CAAA,GAAA,iBAAY;YACV,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,iCAAW;yBAAC;2BAAS;YAAS,GAAG,MAAM,MAAM;sBAClF,MAAM,QAAQ;;;AAIvB;AAgBA,MAAM;AAQN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EN,MAAM;;;;;;;;;;;AAaN,MAAM,+DAA2B,CAAA,GAAA,oBAAY,EA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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 {ActionButtonContext} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of a DisclosureTitle and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Partial<DisclosureProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 1,\n isQuiet: 0,\n isInGroup: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: 200\n}, getAllowedOverrides());\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = forwardRef(function Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n let isInGroup = useContext(DisclosureContext) !== null;\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet, isInGroup}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n});\n\nexport interface DisclosureTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\ninterface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0,\n flexGrow: 1,\n display: 'flex',\n flexShrink: 1,\n minWidth: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n flexGrow: 1,\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-300', 'transparent-white-300')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nconst InternalDisclosureHeader = createContext<{} | null>(null);\n\nfunction DisclosureHeaderWithForwardRef(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_className,\n UNSAFE_style,\n children\n } = props;\n let domRef = useDOMRef(ref);\n let {size, isQuiet, density} = useSlottedContext(DisclosureContext)!;\n\n let mapSize = {\n S: 'XS',\n M: 'S',\n L: 'M',\n XL: 'L'\n };\n\n // maps to one size smaller in the compact density to ensure there is space between the top and bottom of the action button and container\n let newSize : 'XS' | 'S' | 'M' | 'L' | 'XL' | undefined = size;\n if (density === 'compact') {\n newSize = mapSize[size ?? 'M'] as 'XS' | 'S' | 'M' | 'L';\n }\n\n return (\n <Provider\n values={[\n [ActionButtonContext, {size: newSize, isQuiet}],\n [InternalDisclosureHeader, {}]\n ]}>\n <div\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + style({display: 'flex', alignItems: 'center', gap: 4})}\n ref={domRef}>\n {children}\n </div>\n </Provider>\n );\n}\n\n/**\n * A wrapper element for the disclosure title that can contain other elements not part of the trigger.\n */\nexport const DisclosureHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosureHeaderWithForwardRef);\n\n/**\n * A disclosure title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const DisclosureTitle = forwardRef(function DisclosureTitle(props: DisclosureTitleProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n\n let buttonTrigger = (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n let ctx = useContext(InternalDisclosureHeader);\n if (ctx) {\n return buttonTrigger;\n }\n\n return (\n <DisclosureHeader>\n {buttonTrigger}\n </DisclosureHeader>\n );\n});\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: 9,\n L: 12,\n XL: 15\n }\n }\n }\n});\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nexport const DisclosurePanel = forwardRef(function DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n});\n\n"],"names":[],"version":3,"file":"Disclosure.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+BM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAuE;AAEpH,MAAM;;;;;;;;;;;;;;;;;;;;;;AA2BC,MAAM,0DAAa,CAAA,GAAA,iBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAA2B;IAC1G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,QACF,OAAO,cACP,UAAU,oBACV,OAAO,gBACP,YAAY,oBACZ,mBAAmB,IACpB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,YAAY,CAAA,GAAA,iBAAS,EAAE,+CAAuB;IAElD,qBACE,gBAAC,CAAA,GAAA,eAAO;QACN,QAAQ;YACN;gBAAC;gBAAmB;0BAAC;6BAAM;6BAAS;gBAAO;aAAE;SAC9C;kBACD,cAAA,gBAAC,CAAA,GAAA,iBAAY;YACV,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,iCAAW;yBAAC;2BAAS;YAAS,GAAG,MAAM,MAAM;sBAClF,MAAM,QAAQ;;;AAIvB;AAgBA,MAAM;AAQN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;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QACf,GAAG,QAAQ;QACZ,KAAK;QACL,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,kCAAY;kBAAC;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB","sources":["packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {ActionButtonContext} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of a DisclosureTitle and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Partial<DisclosureProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 1,\n isQuiet: 0,\n isInGroup: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: 200\n}, getAllowedOverrides());\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = forwardRef(function Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n let isInGroup = useContext(DisclosureContext) !== null;\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet, isInGroup}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n});\n\nexport interface DisclosureTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\ninterface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0,\n flexGrow: 1,\n display: 'flex',\n flexShrink: 1,\n minWidth: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'title-sm',\n M: 'title',\n L: 'title-lg',\n XL: 'title-xl'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n flexGrow: 1,\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 18,\n regular: 24,\n spacious: 32\n }\n },\n M: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n L: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n XL: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-300', 'transparent-white-300')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nconst InternalDisclosureHeader = createContext<{} | null>(null);\n\nfunction DisclosureHeaderWithForwardRef(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_className,\n UNSAFE_style,\n children\n } = props;\n let domRef = useDOMRef(ref);\n let {size, isQuiet, density} = useSlottedContext(DisclosureContext)!;\n\n // Shift button size down by 2 for compact density, 1 for regular/spacious to ensure there is space between the top and bottom of the action button and container\n let newSize : 'XS' | 'S' | 'M' | 'L' | 'XL' | undefined = size;\n const sizes = ['XS', 'S', 'M', 'L', 'XL'];\n const currentIndex = sizes.indexOf(size ?? 'M');\n const shift = density === 'compact' ? 2 : 1;\n newSize = sizes[Math.max(0, currentIndex - shift)] as 'XS' | 'S' | 'M' | 'L' | 'XL';\n\n return (\n <Provider\n values={[\n [ActionButtonContext, {size: newSize, isQuiet}],\n [InternalDisclosureHeader, {}]\n ]}>\n <div\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + style({display: 'flex', alignItems: 'center', gap: 4})}\n ref={domRef}>\n {children}\n </div>\n </Provider>\n );\n}\n\n/**\n * A wrapper element for the disclosure title that can contain other elements not part of the trigger.\n */\nexport const DisclosureHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosureHeaderWithForwardRef);\n\n/**\n * A disclosure title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const DisclosureTitle = forwardRef(function DisclosureTitle(props: DisclosureTitleProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n\n let buttonTrigger = (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n let ctx = useContext(InternalDisclosureHeader);\n if (ctx) {\n return buttonTrigger;\n }\n\n return (\n <DisclosureHeader>\n {buttonTrigger}\n </DisclosureHeader>\n );\n});\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: 9,\n L: 12,\n XL: 15\n }\n }\n }\n});\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nexport const DisclosurePanel = forwardRef(function DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n});\n\n"],"names":[],"version":3,"file":"Disclosure.mjs.map"}
|
package/dist/Divider.cjs
CHANGED
|
@@ -38,6 +38,8 @@ const $2d04acb918636de0$export$e8c9778bf415dd08 = function anonymous(props, over
|
|
|
38
38
|
let $B = false;
|
|
39
39
|
let $y = false;
|
|
40
40
|
let $z = false;
|
|
41
|
+
let $__a = false;
|
|
42
|
+
let $_9 = false;
|
|
41
43
|
let $l = false;
|
|
42
44
|
for (let p of matches){
|
|
43
45
|
if (/^\s*_5/.test(p)) $_5 = true;
|
|
@@ -45,6 +47,8 @@ const $2d04acb918636de0$export$e8c9778bf415dd08 = function anonymous(props, over
|
|
|
45
47
|
if (/^\s*B/.test(p)) $B = true;
|
|
46
48
|
if (/^\s*y/.test(p)) $y = true;
|
|
47
49
|
if (/^\s*z/.test(p)) $z = true;
|
|
50
|
+
if (/^\s*__a/.test(p)) $__a = true;
|
|
51
|
+
if (/^\s*_9/.test(p)) $_9 = true;
|
|
48
52
|
if (/^\s*l/.test(p)) $l = true;
|
|
49
53
|
}
|
|
50
54
|
if (props.staticColor === "white") rules += ' -_1de2x0q_b-b';
|
|
@@ -65,6 +69,8 @@ const $2d04acb918636de0$export$e8c9778bf415dd08 = function anonymous(props, over
|
|
|
65
69
|
if (!$B) rules += ' Ba';
|
|
66
70
|
if (!$y) rules += ' ya';
|
|
67
71
|
if (!$z) rules += ' za';
|
|
72
|
+
if (!$__a) rules += ' __a-3t1x';
|
|
73
|
+
if (!$_9) rules += ' _9-3t1x';
|
|
68
74
|
if (props.orientation === "horizontal") {
|
|
69
75
|
if (props.size === "L") rules += ' k-3761a9';
|
|
70
76
|
else if (props.size === "S") rules += ' k-375yri';
|