@deephaven/components 0.72.1-beta.5 → 0.72.1-core-plugins.9
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/css/BaseStyleSheet.css.map +1 -1
- package/dist/BasicModal.js +2 -2
- package/dist/BasicModal.js.map +1 -1
- package/dist/Button.d.ts +1 -1
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +12 -2
- package/dist/Button.js.map +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/Checkbox.js.map +1 -1
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComponentUtils.d.ts +34 -0
- package/dist/ComponentUtils.d.ts.map +1 -0
- package/dist/ComponentUtils.js +49 -0
- package/dist/ComponentUtils.js.map +1 -0
- package/dist/CustomTimeSelect.css.map +1 -1
- package/dist/DateTimeInput.d.ts +3 -3
- package/dist/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput.js +1 -1
- package/dist/DateTimeInput.js.map +1 -1
- package/dist/DraggableItemList.css.map +1 -1
- package/dist/ErrorView.css +77 -0
- package/dist/ErrorView.css.map +1 -0
- package/dist/ErrorView.d.ts +16 -0
- package/dist/ErrorView.d.ts.map +1 -0
- package/dist/ErrorView.js +73 -0
- package/dist/ErrorView.js.map +1 -0
- package/dist/HierarchicalCheckboxMenu.css.map +1 -1
- package/dist/HierarchicalCheckboxMenu.js +1 -1
- package/dist/HierarchicalCheckboxMenu.js.map +1 -1
- package/dist/LoadingOverlay.css +2 -1
- package/dist/LoadingOverlay.css.map +1 -1
- package/dist/RadioGroup.js +2 -2
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioItem.js +2 -2
- package/dist/RadioItem.js.map +1 -1
- package/dist/SearchInput.css.map +1 -1
- package/dist/SearchableCombobox.d.ts +2 -2
- package/dist/SearchableCombobox.d.ts.map +1 -1
- package/dist/SearchableCombobox.js.map +1 -1
- package/dist/Select.d.ts +1 -1
- package/dist/SocketedButton.d.ts.map +1 -1
- package/dist/SocketedButton.js +12 -2
- package/dist/SocketedButton.js.map +1 -1
- package/dist/{ButtonGroup.d.ts → SplitButtonGroup.d.ts} +5 -5
- package/dist/SplitButtonGroup.d.ts.map +1 -0
- package/dist/{ButtonGroup.js → SplitButtonGroup.js} +6 -6
- package/dist/SplitButtonGroup.js.map +1 -0
- package/dist/TimeSlider.css.map +1 -1
- package/dist/TimeSlider.module.css.map +1 -1
- package/dist/XComponent.d.ts +38 -0
- package/dist/XComponent.d.ts.map +1 -0
- package/dist/XComponent.js +70 -0
- package/dist/XComponent.js.map +1 -0
- package/dist/XComponentMap.d.ts +15 -0
- package/dist/XComponentMap.d.ts.map +1 -0
- package/dist/XComponentMap.js +20 -0
- package/dist/XComponentMap.js.map +1 -0
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/navigation/MenuItem.css.map +1 -1
- package/dist/navigation/NavTab.d.ts.map +1 -1
- package/dist/navigation/NavTab.js +28 -7
- package/dist/navigation/NavTab.js.map +1 -1
- package/dist/navigation/NavTabList.css.map +1 -1
- package/dist/navigation/NavTabList.d.ts +5 -0
- package/dist/navigation/NavTabList.d.ts.map +1 -1
- package/dist/navigation/NavTabList.js.map +1 -1
- package/dist/spectrum/ActionGroup.d.ts +14 -0
- package/dist/spectrum/ActionGroup.d.ts.map +1 -0
- package/dist/spectrum/ActionGroup.js +42 -0
- package/dist/spectrum/ActionGroup.js.map +1 -0
- package/dist/spectrum/ActionMenu.d.ts +15 -0
- package/dist/spectrum/ActionMenu.d.ts.map +1 -0
- package/dist/spectrum/ActionMenu.js +35 -0
- package/dist/spectrum/ActionMenu.js.map +1 -0
- package/dist/spectrum/Heading.d.ts +4 -1
- package/dist/spectrum/Heading.d.ts.map +1 -1
- package/dist/spectrum/Heading.js +5 -3
- package/dist/spectrum/Heading.js.map +1 -1
- package/dist/spectrum/ItemContent.d.ts +15 -0
- package/dist/spectrum/ItemContent.d.ts.map +1 -0
- package/dist/spectrum/{picker/PickerItemContent.js → ItemContent.js} +44 -19
- package/dist/spectrum/ItemContent.js.map +1 -0
- package/dist/spectrum/ItemTooltip.d.ts +12 -0
- package/dist/spectrum/ItemTooltip.d.ts.map +1 -0
- package/dist/spectrum/ItemTooltip.js +30 -0
- package/dist/spectrum/ItemTooltip.js.map +1 -0
- package/dist/spectrum/ListActionGroup.d.ts +19 -0
- package/dist/spectrum/ListActionGroup.d.ts.map +1 -0
- package/dist/spectrum/ListActionGroup.js +9 -0
- package/dist/spectrum/ListActionGroup.js.map +1 -0
- package/dist/spectrum/ListActionMenu.d.ts +19 -0
- package/dist/spectrum/ListActionMenu.d.ts.map +1 -0
- package/dist/spectrum/ListActionMenu.js +9 -0
- package/dist/spectrum/ListActionMenu.js.map +1 -0
- package/dist/spectrum/Text.d.ts +4 -1
- package/dist/spectrum/Text.d.ts.map +1 -1
- package/dist/spectrum/Text.js +5 -4
- package/dist/spectrum/Text.js.map +1 -1
- package/dist/spectrum/View.d.ts +20 -3
- package/dist/spectrum/View.d.ts.map +1 -1
- package/dist/spectrum/View.js +47 -10
- package/dist/spectrum/View.js.map +1 -1
- package/dist/spectrum/buttons.d.ts +1 -1
- package/dist/spectrum/buttons.d.ts.map +1 -1
- package/dist/spectrum/buttons.js +3 -1
- package/dist/spectrum/buttons.js.map +1 -1
- package/dist/spectrum/collections.d.ts +1 -1
- package/dist/spectrum/collections.d.ts.map +1 -1
- package/dist/spectrum/collections.js +12 -1
- package/dist/spectrum/collections.js.map +1 -1
- package/dist/spectrum/comboBox/ComboBox.d.ts +17 -0
- package/dist/spectrum/comboBox/ComboBox.d.ts.map +1 -0
- package/dist/spectrum/comboBox/ComboBox.js +44 -0
- package/dist/spectrum/comboBox/ComboBox.js.map +1 -0
- package/dist/spectrum/comboBox/ComboBoxNormalized.d.ts +15 -0
- package/dist/spectrum/comboBox/ComboBoxNormalized.d.ts.map +1 -0
- package/dist/spectrum/comboBox/ComboBoxNormalized.js +42 -0
- package/dist/spectrum/comboBox/ComboBoxNormalized.js.map +1 -0
- package/dist/spectrum/comboBox/index.d.ts +3 -0
- package/dist/spectrum/comboBox/index.d.ts.map +1 -0
- package/dist/spectrum/comboBox/index.js +3 -0
- package/dist/spectrum/comboBox/index.js.map +1 -0
- package/dist/spectrum/forms.d.ts +2 -1
- package/dist/spectrum/forms.d.ts.map +1 -1
- package/dist/spectrum/forms.js +1 -1
- package/dist/spectrum/forms.js.map +1 -1
- package/dist/spectrum/icons.d.ts +2 -0
- package/dist/spectrum/icons.d.ts.map +1 -0
- package/dist/spectrum/icons.js +3 -0
- package/dist/spectrum/icons.js.map +1 -0
- package/dist/spectrum/index.d.ts +9 -1
- package/dist/spectrum/index.d.ts.map +1 -1
- package/dist/spectrum/index.js +9 -1
- package/dist/spectrum/index.js.map +1 -1
- package/dist/spectrum/listView/ListView.d.ts +14 -0
- package/dist/spectrum/listView/ListView.d.ts.map +1 -0
- package/dist/spectrum/listView/ListView.js +43 -0
- package/dist/spectrum/listView/ListView.js.map +1 -0
- package/dist/spectrum/listView/ListViewNormalized.d.ts +23 -0
- package/dist/spectrum/listView/ListViewNormalized.d.ts.map +1 -0
- package/dist/spectrum/listView/ListViewNormalized.js +82 -0
- package/dist/spectrum/listView/ListViewNormalized.js.map +1 -0
- package/dist/spectrum/listView/ListViewWrapper.css +48 -0
- package/dist/spectrum/listView/ListViewWrapper.css.map +1 -0
- package/dist/spectrum/listView/ListViewWrapper.d.ts +21 -0
- package/dist/spectrum/listView/ListViewWrapper.d.ts.map +1 -0
- package/dist/spectrum/listView/ListViewWrapper.js +71 -0
- package/dist/spectrum/listView/ListViewWrapper.js.map +1 -0
- package/dist/spectrum/listView/index.d.ts +4 -0
- package/dist/spectrum/listView/index.d.ts.map +1 -0
- package/dist/spectrum/listView/index.js +4 -0
- package/dist/spectrum/listView/index.js.map +1 -0
- package/dist/spectrum/picker/Picker.d.ts +17 -31
- package/dist/spectrum/picker/Picker.d.ts.map +1 -1
- package/dist/spectrum/picker/Picker.js +31 -130
- package/dist/spectrum/picker/Picker.js.map +1 -1
- package/dist/spectrum/picker/PickerNormalized.d.ts +10 -0
- package/dist/spectrum/picker/PickerNormalized.d.ts.map +1 -0
- package/dist/spectrum/picker/PickerNormalized.js +37 -0
- package/dist/spectrum/picker/PickerNormalized.js.map +1 -0
- package/dist/spectrum/picker/PickerProps.d.ts +64 -0
- package/dist/spectrum/picker/PickerProps.d.ts.map +1 -0
- package/dist/spectrum/picker/PickerProps.js +2 -0
- package/dist/spectrum/picker/PickerProps.js.map +1 -0
- package/dist/spectrum/picker/index.d.ts +6 -1
- package/dist/spectrum/picker/index.d.ts.map +1 -1
- package/dist/spectrum/picker/index.js +6 -1
- package/dist/spectrum/picker/index.js.map +1 -1
- package/dist/spectrum/picker/useMultiRef.d.ts +9 -0
- package/dist/spectrum/picker/useMultiRef.d.ts.map +1 -0
- package/dist/spectrum/picker/useMultiRef.js +25 -0
- package/dist/spectrum/picker/useMultiRef.js.map +1 -0
- package/dist/spectrum/picker/usePickerItemScale.d.ts +9 -0
- package/dist/spectrum/picker/usePickerItemScale.d.ts.map +1 -0
- package/dist/spectrum/picker/usePickerItemScale.js +17 -0
- package/dist/spectrum/picker/usePickerItemScale.js.map +1 -0
- package/dist/spectrum/picker/usePickerNormalizedProps.d.ts +27 -0
- package/dist/spectrum/picker/usePickerNormalizedProps.d.ts.map +1 -0
- package/dist/spectrum/picker/usePickerNormalizedProps.js +101 -0
- package/dist/spectrum/picker/usePickerNormalizedProps.js.map +1 -0
- package/dist/spectrum/picker/usePickerProps.d.ts +28 -0
- package/dist/spectrum/picker/usePickerProps.d.ts.map +1 -0
- package/dist/spectrum/picker/usePickerProps.js +75 -0
- package/dist/spectrum/picker/usePickerProps.js.map +1 -0
- package/dist/spectrum/picker/usePickerScrollOnOpen.d.ts +22 -0
- package/dist/spectrum/picker/usePickerScrollOnOpen.d.ts.map +1 -0
- package/dist/spectrum/picker/usePickerScrollOnOpen.js +33 -0
- package/dist/spectrum/picker/usePickerScrollOnOpen.js.map +1 -0
- package/dist/spectrum/shared.d.ts +15 -9
- package/dist/spectrum/shared.d.ts.map +1 -1
- package/dist/spectrum/shared.js +16 -1
- package/dist/spectrum/shared.js.map +1 -1
- package/dist/spectrum/utils/index.d.ts +7 -0
- package/dist/spectrum/utils/index.d.ts.map +1 -1
- package/dist/spectrum/utils/index.js +7 -0
- package/dist/spectrum/utils/index.js.map +1 -1
- package/dist/spectrum/utils/itemUtils.d.ts +80 -27
- package/dist/spectrum/utils/itemUtils.d.ts.map +1 -1
- package/dist/spectrum/utils/itemUtils.js +106 -111
- package/dist/spectrum/utils/itemUtils.js.map +1 -1
- package/dist/spectrum/utils/itemWrapperUtils.d.ts +28 -0
- package/dist/spectrum/utils/itemWrapperUtils.d.ts.map +1 -0
- package/dist/spectrum/utils/itemWrapperUtils.js +111 -0
- package/dist/spectrum/utils/itemWrapperUtils.js.map +1 -0
- package/dist/spectrum/utils/propsUtils.d.ts +14 -0
- package/dist/spectrum/utils/propsUtils.d.ts.map +1 -0
- package/dist/spectrum/utils/propsUtils.js +93 -0
- package/dist/spectrum/utils/propsUtils.js.map +1 -0
- package/dist/spectrum/utils/useOnChangeTrackUncontrolled.d.ts +19 -0
- package/dist/spectrum/utils/useOnChangeTrackUncontrolled.d.ts.map +1 -0
- package/dist/spectrum/utils/useOnChangeTrackUncontrolled.js +31 -0
- package/dist/spectrum/utils/useOnChangeTrackUncontrolled.js.map +1 -0
- package/dist/spectrum/utils/useRenderNormalizedItem.d.ts +25 -0
- package/dist/spectrum/utils/useRenderNormalizedItem.d.ts.map +1 -0
- package/dist/spectrum/utils/useRenderNormalizedItem.js +87 -0
- package/dist/spectrum/utils/useRenderNormalizedItem.js.map +1 -0
- package/dist/spectrum/utils/useStaticItemInitialScrollPosition.d.ts +10 -0
- package/dist/spectrum/utils/useStaticItemInitialScrollPosition.d.ts.map +1 -0
- package/dist/spectrum/utils/useStaticItemInitialScrollPosition.js +27 -0
- package/dist/spectrum/utils/useStaticItemInitialScrollPosition.js.map +1 -0
- package/dist/spectrum/utils/useStringifiedMultiSelection.d.ts +43 -0
- package/dist/spectrum/utils/useStringifiedMultiSelection.d.ts.map +1 -0
- package/dist/spectrum/utils/useStringifiedMultiSelection.js +53 -0
- package/dist/spectrum/utils/useStringifiedMultiSelection.js.map +1 -0
- package/dist/spectrum/utils/useStringifiedSelection.d.ts +33 -0
- package/dist/spectrum/utils/useStringifiedSelection.d.ts.map +1 -0
- package/dist/spectrum/utils/useStringifiedSelection.js +50 -0
- package/dist/spectrum/utils/useStringifiedSelection.js.map +1 -0
- package/dist/theme/SpectrumThemeProvider.js +2 -2
- package/dist/theme/SpectrumThemeProvider.js.map +1 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/theme-spectrum/theme-spectrum-overrides.css +1 -1
- package/dist/theme/theme-spectrum/theme-spectrum-overrides.css.map +1 -1
- package/dist/theme/useSpectrumThemeProvider.d.ts +4 -0
- package/dist/theme/useSpectrumThemeProvider.d.ts.map +1 -0
- package/dist/theme/useSpectrumThemeProvider.js +4 -0
- package/dist/theme/useSpectrumThemeProvider.js.map +1 -0
- package/package.json +11 -10
- package/scss/new_variables.scss +1 -1
- package/scss/util.scss +4 -0
- package/dist/ButtonGroup.d.ts.map +0 -1
- package/dist/ButtonGroup.js.map +0 -1
- package/dist/ButtonOld.d.ts +0 -12
- package/dist/ButtonOld.d.ts.map +0 -1
- package/dist/ButtonOld.js +0 -43
- package/dist/ButtonOld.js.map +0 -1
- package/dist/ComboBox.d.ts +0 -120
- package/dist/ComboBox.d.ts.map +0 -1
- package/dist/ComboBox.js +0 -497
- package/dist/ComboBox.js.map +0 -1
- package/dist/spectrum/picker/PickerItemContent.d.ts +0 -11
- package/dist/spectrum/picker/PickerItemContent.d.ts.map +0 -1
- package/dist/spectrum/picker/PickerItemContent.js.map +0 -1
- package/dist/spectrum/pickers.d.ts +0 -2
- package/dist/spectrum/pickers.d.ts.map +0 -1
- package/dist/spectrum/pickers.js +0 -2
- package/dist/spectrum/pickers.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionGroup.js","names":["useMemo","ActionGroup","SpectrumActionGroup","cl","wrapItemChildren","jsx","_jsx","_ref","defaultSelectedKeys","disabledKeys","children","selectedKeys","UNSAFE_className","onChange","onSelectionChange","props","_objectWithoutProperties","_excluded","wrappedChildren","_objectSpread"],"sources":["../../src/spectrum/ActionGroup.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n ActionGroup as SpectrumActionGroup,\n SpectrumActionGroupProps,\n} from '@adobe/react-spectrum';\nimport cl from 'classnames';\nimport { ItemsOrPrimitiveChildren } from './shared';\nimport { MultipleItemSelectionProps, wrapItemChildren } from './utils';\n\nexport type ActionGroupProps<T> = Omit<\n SpectrumActionGroupProps<T>,\n | 'children'\n | 'selectedKeys'\n | 'defaultSelectedKeys'\n | 'disabledKeys'\n | 'onSelectionChange'\n> &\n MultipleItemSelectionProps & {\n children: ItemsOrPrimitiveChildren<T>;\n };\n\n/**\n * Augmented version of the Spectrum ActionGroup component that supports\n * primitive item children.\n */\nexport function ActionGroup<T>({\n defaultSelectedKeys,\n disabledKeys,\n children,\n selectedKeys,\n UNSAFE_className,\n onChange,\n onSelectionChange,\n ...props\n}: ActionGroupProps<T>): JSX.Element {\n const wrappedChildren = useMemo(\n () =>\n typeof children === 'function'\n ? children\n : wrapItemChildren(children, null),\n [children]\n );\n\n return (\n <SpectrumActionGroup\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n UNSAFE_className={cl('dh-action-group', UNSAFE_className)}\n defaultSelectedKeys={\n defaultSelectedKeys as SpectrumActionGroupProps<T>['defaultSelectedKeys']\n }\n disabledKeys={disabledKeys as SpectrumActionGroupProps<T>['disabledKeys']}\n selectedKeys={selectedKeys as SpectrumActionGroupProps<T>['selectedKeys']}\n onSelectionChange={onChange ?? onSelectionChange}\n >\n {wrappedChildren}\n </SpectrumActionGroup>\n );\n}\n\nexport default ActionGroup;\n"],"mappings":";;;;;;;;AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SACEC,WAAW,IAAIC,mBAAmB,QAE7B,uBAAuB;AAC9B,OAAOC,EAAE,MAAM,YAAY;AAAC,SAESC,gBAAgB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAcrD;AACA;AACA;AACA;AACA,OAAO,SAASL,WAAWA,CAAAM,IAAA,EASU;EAAA,IATN;MAC7BC,mBAAmB;MACnBC,YAAY;MACZC,QAAQ;MACRC,YAAY;MACZC,gBAAgB;MAChBC,QAAQ;MACRC;IAEmB,CAAC,GAAAP,IAAA;IADjBQ,KAAK,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA;EAER,IAAMC,eAAe,GAAGlB,OAAO,CAC7B,MACE,OAAOU,QAAQ,KAAK,UAAU,GAC1BA,QAAQ,GACRN,gBAAgB,CAACM,QAAQ,EAAE,IAAI,CAAC,EACtC,CAACA,QAAQ,CACX,CAAC;EAED,oBACEJ,IAAA,CAACJ;EACC;EAAA,EAAAiB,aAAA,CAAAA,aAAA,KACIJ,KAAK;IACTH,gBAAgB,EAAET,EAAE,CAAC,iBAAiB,EAAES,gBAAgB,CAAE;IAC1DJ,mBAAmB,EACjBA,mBACD;IACDC,YAAY,EAAEA,YAA4D;IAC1EE,YAAY,EAAEA,YAA4D;IAC1EG,iBAAiB,EAAED,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAIC,iBAAkB;IAAAJ,QAAA,EAEhDQ;EAAe,EACG,CAAC;AAE1B;AAEA,eAAejB,WAAW"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SpectrumActionMenuProps } from '@adobe/react-spectrum';
|
|
3
|
+
import { ItemsOrPrimitiveChildren } from './shared';
|
|
4
|
+
import { ItemKey } from './utils';
|
|
5
|
+
export type ActionMenuProps<T> = Omit<SpectrumActionMenuProps<T>, 'children' | 'disabledKeys'> & {
|
|
6
|
+
disabledKeys?: Iterable<ItemKey>;
|
|
7
|
+
children: ItemsOrPrimitiveChildren<T>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Augmented version of the Spectrum ActionMenu component that supports
|
|
11
|
+
* primitive item children.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ActionMenu<T>({ disabledKeys, children, UNSAFE_className, ...props }: ActionMenuProps<T>): JSX.Element;
|
|
14
|
+
export default ActionMenu;
|
|
15
|
+
//# sourceMappingURL=ActionMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionMenu.d.ts","sourceRoot":"","sources":["../../src/spectrum/ActionMenu.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,OAAO,EAAoB,MAAM,SAAS,CAAC;AAEpD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,IAAI,CACnC,uBAAuB,CAAC,CAAC,CAAC,EAC1B,UAAU,GAAG,cAAc,CAC5B,GAAG;IACF,YAAY,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAC5B,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CAmBlC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var _excluded = ["disabledKeys", "children", "UNSAFE_className"];
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
|
+
import { useMemo } from 'react';
|
|
10
|
+
import { ActionMenu as SpectrumActionMenu } from '@adobe/react-spectrum';
|
|
11
|
+
import cl from 'classnames';
|
|
12
|
+
import { wrapItemChildren } from "./utils/index.js";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
/**
|
|
15
|
+
* Augmented version of the Spectrum ActionMenu component that supports
|
|
16
|
+
* primitive item children.
|
|
17
|
+
*/
|
|
18
|
+
export function ActionMenu(_ref) {
|
|
19
|
+
var {
|
|
20
|
+
disabledKeys,
|
|
21
|
+
children,
|
|
22
|
+
UNSAFE_className
|
|
23
|
+
} = _ref,
|
|
24
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
var wrappedChildren = useMemo(() => typeof children === 'function' ? children : wrapItemChildren(children, null), [children]);
|
|
26
|
+
return /*#__PURE__*/_jsx(SpectrumActionMenu
|
|
27
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
28
|
+
, _objectSpread(_objectSpread({}, props), {}, {
|
|
29
|
+
UNSAFE_className: cl('dh-action-menu', UNSAFE_className),
|
|
30
|
+
disabledKeys: disabledKeys,
|
|
31
|
+
children: wrappedChildren
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
export default ActionMenu;
|
|
35
|
+
//# sourceMappingURL=ActionMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionMenu.js","names":["useMemo","ActionMenu","SpectrumActionMenu","cl","wrapItemChildren","jsx","_jsx","_ref","disabledKeys","children","UNSAFE_className","props","_objectWithoutProperties","_excluded","wrappedChildren","_objectSpread"],"sources":["../../src/spectrum/ActionMenu.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n ActionMenu as SpectrumActionMenu,\n SpectrumActionMenuProps,\n} from '@adobe/react-spectrum';\nimport cl from 'classnames';\nimport { ItemsOrPrimitiveChildren } from './shared';\nimport { ItemKey, wrapItemChildren } from './utils';\n\nexport type ActionMenuProps<T> = Omit<\n SpectrumActionMenuProps<T>,\n 'children' | 'disabledKeys'\n> & {\n disabledKeys?: Iterable<ItemKey>;\n children: ItemsOrPrimitiveChildren<T>;\n};\n\n/**\n * Augmented version of the Spectrum ActionMenu component that supports\n * primitive item children.\n */\nexport function ActionMenu<T>({\n disabledKeys,\n children,\n UNSAFE_className,\n ...props\n}: ActionMenuProps<T>): JSX.Element {\n const wrappedChildren = useMemo(\n () =>\n typeof children === 'function'\n ? children\n : wrapItemChildren(children, null),\n [children]\n );\n\n return (\n <SpectrumActionMenu\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n UNSAFE_className={cl('dh-action-menu', UNSAFE_className)}\n disabledKeys={disabledKeys as SpectrumActionMenuProps<T>['disabledKeys']}\n >\n {wrappedChildren}\n </SpectrumActionMenu>\n );\n}\n\nexport default ActionMenu;\n"],"mappings":";;;;;;;;AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SACEC,UAAU,IAAIC,kBAAkB,QAE3B,uBAAuB;AAC9B,OAAOC,EAAE,MAAM,YAAY;AAAC,SAEVC,gBAAgB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUlC;AACA;AACA;AACA;AACA,OAAO,SAASL,UAAUA,CAAAM,IAAA,EAKU;EAAA,IALN;MAC5BC,YAAY;MACZC,QAAQ;MACRC;IAEkB,CAAC,GAAAH,IAAA;IADhBI,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAER,IAAMC,eAAe,GAAGd,OAAO,CAC7B,MACE,OAAOS,QAAQ,KAAK,UAAU,GAC1BA,QAAQ,GACRL,gBAAgB,CAACK,QAAQ,EAAE,IAAI,CAAC,EACtC,CAACA,QAAQ,CACX,CAAC;EAED,oBACEH,IAAA,CAACJ;EACC;EAAA,EAAAa,aAAA,CAAAA,aAAA,KACIJ,KAAK;IACTD,gBAAgB,EAAEP,EAAE,CAAC,gBAAgB,EAAEO,gBAAgB,CAAE;IACzDF,YAAY,EAAEA,YAA2D;IAAAC,QAAA,EAExEK;EAAe,EACE,CAAC;AAEzB;AAEA,eAAeb,UAAU"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type HeadingProps as SpectrumHeadingProps } from '@adobe/react-spectrum';
|
|
3
|
+
import type { DOMRefValue } from '@react-types/shared';
|
|
3
4
|
import { type ColorValue } from '../theme/colorUtils';
|
|
4
5
|
export type HeadingProps = SpectrumHeadingProps & {
|
|
5
6
|
color?: ColorValue;
|
|
@@ -13,6 +14,8 @@ export type HeadingProps = SpectrumHeadingProps & {
|
|
|
13
14
|
* @returns The Heading component
|
|
14
15
|
*
|
|
15
16
|
*/
|
|
16
|
-
export declare
|
|
17
|
+
export declare const Heading: import("react").ForwardRefExoticComponent<SpectrumHeadingProps & {
|
|
18
|
+
color?: ColorValue;
|
|
19
|
+
} & import("react").RefAttributes<DOMRefValue<HTMLHeadingElement>>>;
|
|
17
20
|
export default Heading;
|
|
18
21
|
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../src/spectrum/Heading.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,KAAK,YAAY,IAAI,oBAAoB,EAC1C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG;IAChD,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AAEH,
|
|
1
|
+
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../src/spectrum/Heading.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,KAAK,YAAY,IAAI,oBAAoB,EAC1C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG;IAChD,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AAEH,eAAO,MAAM,OAAO;YAbV,UAAU;mEA2BlB,CAAC;AAIH,eAAe,OAAO,CAAC"}
|
package/dist/spectrum/Heading.js
CHANGED
|
@@ -7,7 +7,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
7
7
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
8
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
9
|
/* eslint-disable react/jsx-props-no-spreading */
|
|
10
|
-
import { useMemo } from 'react';
|
|
10
|
+
import { forwardRef, useMemo } from 'react';
|
|
11
11
|
import { Heading as SpectrumHeading } from '@adobe/react-spectrum';
|
|
12
12
|
import { colorValueStyle } from "../theme/colorUtils.js";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -21,7 +21,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
export
|
|
24
|
+
export var Heading = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
25
25
|
var {
|
|
26
26
|
color,
|
|
27
27
|
UNSAFE_style
|
|
@@ -31,8 +31,10 @@ export function Heading(props) {
|
|
|
31
31
|
color: colorValueStyle(color)
|
|
32
32
|
}), [color, UNSAFE_style]);
|
|
33
33
|
return /*#__PURE__*/_jsx(SpectrumHeading, _objectSpread(_objectSpread({}, rest), {}, {
|
|
34
|
+
ref: forwardedRef,
|
|
34
35
|
UNSAFE_style: style
|
|
35
36
|
}));
|
|
36
|
-
}
|
|
37
|
+
});
|
|
38
|
+
Heading.displayName = 'Heading';
|
|
37
39
|
export default Heading;
|
|
38
40
|
//# sourceMappingURL=Heading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.js","names":["useMemo","Heading","SpectrumHeading","colorValueStyle","jsx","_jsx","props","color","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread"],"sources":["../../src/spectrum/Heading.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { useMemo } from 'react';\nimport {\n Heading as SpectrumHeading,\n type HeadingProps as SpectrumHeadingProps,\n} from '@adobe/react-spectrum';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type HeadingProps = SpectrumHeadingProps & {\n color?: ColorValue;\n};\n\n/**\n * A Heading component that re-exports the Spectrum Heading component.\n * It overrides ColorValues to accept CSS color strings and custom\n * variable names from our color paletee and semantic colors.\n *\n * @param props The props for the Heading component\n * @returns The Heading component\n *\n */\n\nexport
|
|
1
|
+
{"version":3,"file":"Heading.js","names":["forwardRef","useMemo","Heading","SpectrumHeading","colorValueStyle","jsx","_jsx","props","forwardedRef","color","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread","ref","displayName"],"sources":["../../src/spectrum/Heading.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { forwardRef, useMemo } from 'react';\nimport {\n Heading as SpectrumHeading,\n type HeadingProps as SpectrumHeadingProps,\n} from '@adobe/react-spectrum';\nimport type { DOMRefValue } from '@react-types/shared';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type HeadingProps = SpectrumHeadingProps & {\n color?: ColorValue;\n};\n\n/**\n * A Heading component that re-exports the Spectrum Heading component.\n * It overrides ColorValues to accept CSS color strings and custom\n * variable names from our color paletee and semantic colors.\n *\n * @param props The props for the Heading component\n * @returns The Heading component\n *\n */\n\nexport const Heading = forwardRef<\n DOMRefValue<HTMLHeadingElement>,\n HeadingProps\n>((props, forwardedRef): JSX.Element => {\n const { color, UNSAFE_style, ...rest } = props;\n const style = useMemo(\n () => ({\n ...UNSAFE_style,\n color: colorValueStyle(color),\n }),\n [color, UNSAFE_style]\n );\n\n return <SpectrumHeading {...rest} ref={forwardedRef} UNSAFE_style={style} />;\n});\n\nHeading.displayName = 'Heading';\n\nexport default Heading;\n"],"mappings":";;;;;;;;AAAA;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SACEC,OAAO,IAAIC,eAAe,QAErB,uBAAuB;AAAC,SAELC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,IAAMJ,OAAO,gBAAGF,UAAU,CAG/B,CAACO,KAAK,EAAEC,YAAY,KAAkB;EACtC,IAAM;MAAEC,KAAK;MAAEC;IAAsB,CAAC,GAAGH,KAAK;IAAdI,IAAI,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA;EAC9C,IAAMC,KAAK,GAAGb,OAAO,CACnB,MAAAc,aAAA,CAAAA,aAAA,KACKL,YAAY;IACfD,KAAK,EAAEL,eAAe,CAACK,KAAK;EAAC,EAC7B,EACF,CAACA,KAAK,EAAEC,YAAY,CACtB,CAAC;EAED,oBAAOJ,IAAA,CAACH,eAAe,EAAAY,aAAA,CAAAA,aAAA,KAAKJ,IAAI;IAAEK,GAAG,EAAER,YAAa;IAACE,YAAY,EAAEI;EAAM,EAAE,CAAC;AAC9E,CAAC,CAAC;AAEFZ,OAAO,CAACe,WAAW,GAAG,SAAS;AAE/B,eAAef,OAAO"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TooltipOptions } from './utils';
|
|
3
|
+
export interface ItemContentProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
tooltipOptions?: TooltipOptions | null;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Item content. Text content will be wrapped in a Spectrum Text
|
|
9
|
+
* component with ellipsis overflow handling. If text content overflows and
|
|
10
|
+
* tooltipOptions are provided a tooltip will be displayed when hovering over
|
|
11
|
+
* the item content.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ItemContent({ children: content, tooltipOptions, }: ItemContentProps): JSX.Element | null;
|
|
14
|
+
export default ItemContent;
|
|
15
|
+
//# sourceMappingURL=ItemContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemContent.d.ts","sourceRoot":"","sources":["../../src/spectrum/ItemContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAEV,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIzC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EAAE,OAAO,EACjB,cAAc,GACf,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAsEvC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -3,21 +3,40 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
4
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
5
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
-
import { Children, cloneElement, isValidElement } from 'react';
|
|
7
|
-
import { Text } from '@adobe/react-spectrum';
|
|
6
|
+
import { Children, cloneElement, isValidElement, useState } from 'react';
|
|
8
7
|
import cl from 'classnames';
|
|
9
|
-
import { isElementOfType } from '@deephaven/react-hooks';
|
|
10
|
-
import
|
|
8
|
+
import { isElementOfType, useCheckOverflow } from '@deephaven/react-hooks';
|
|
9
|
+
import { NON_BREAKING_SPACE } from '@deephaven/utils';
|
|
10
|
+
import { Text } from "./Text.js";
|
|
11
|
+
import ItemTooltip from "./ItemTooltip.js";
|
|
12
|
+
import stylesCommon from "../SpectrumComponent.module.css";
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
15
|
-
* component with ellipsis overflow handling.
|
|
17
|
+
* Item content. Text content will be wrapped in a Spectrum Text
|
|
18
|
+
* component with ellipsis overflow handling. If text content overflows and
|
|
19
|
+
* tooltipOptions are provided a tooltip will be displayed when hovering over
|
|
20
|
+
* the item content.
|
|
16
21
|
*/
|
|
17
|
-
export function
|
|
22
|
+
export function ItemContent(_ref) {
|
|
18
23
|
var {
|
|
19
|
-
children: content
|
|
24
|
+
children: content,
|
|
25
|
+
tooltipOptions
|
|
20
26
|
} = _ref;
|
|
27
|
+
var {
|
|
28
|
+
checkOverflow,
|
|
29
|
+
isOverflowing,
|
|
30
|
+
resetIsOverflowing
|
|
31
|
+
} = useCheckOverflow();
|
|
32
|
+
var [previousContent, setPreviousContent] = useState(content);
|
|
33
|
+
|
|
34
|
+
// Reset `isOverflowing` if content changes. It will get re-calculated as
|
|
35
|
+
// `Text` components render.
|
|
36
|
+
if (previousContent !== content) {
|
|
37
|
+
setPreviousContent(content);
|
|
38
|
+
resetIsOverflowing();
|
|
39
|
+
}
|
|
21
40
|
if ( /*#__PURE__*/isValidElement(content)) {
|
|
22
41
|
return content;
|
|
23
42
|
}
|
|
@@ -25,7 +44,7 @@ export function PickerItemContent(_ref) {
|
|
|
25
44
|
/* eslint-disable no-param-reassign */
|
|
26
45
|
if (content === '') {
|
|
27
46
|
// Prevent the item height from collapsing when the content is empty
|
|
28
|
-
content =
|
|
47
|
+
content = NON_BREAKING_SPACE;
|
|
29
48
|
} else if (typeof content === 'boolean') {
|
|
30
49
|
// Boolean values need to be stringified to render
|
|
31
50
|
content = String(content);
|
|
@@ -38,21 +57,27 @@ export function PickerItemContent(_ref) {
|
|
|
38
57
|
// <Text>Some Label</Text>
|
|
39
58
|
// <Text slot="description">Some Description</Text>
|
|
40
59
|
// </Item>
|
|
41
|
-
content = Children.map(content,
|
|
60
|
+
content = Children.map(content, el => isElementOfType(el, Text) ? /*#__PURE__*/cloneElement(el, _objectSpread(_objectSpread({}, el.props), {}, {
|
|
61
|
+
ref: checkOverflow,
|
|
42
62
|
UNSAFE_className: cl(el.props.UNSAFE_className, stylesCommon.spectrumEllipsis)
|
|
43
63
|
})) : el);
|
|
44
64
|
}
|
|
65
|
+
if (typeof content === 'string' || typeof content === 'number') {
|
|
66
|
+
content = /*#__PURE__*/_jsx(Text, {
|
|
67
|
+
ref: checkOverflow,
|
|
68
|
+
UNSAFE_className: stylesCommon.spectrumEllipsis,
|
|
69
|
+
children: content
|
|
70
|
+
});
|
|
71
|
+
}
|
|
45
72
|
/* eslint-enable no-param-reassign */
|
|
46
73
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
children: content
|
|
50
|
-
}) :
|
|
51
|
-
/*#__PURE__*/
|
|
52
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
53
|
-
_jsx(_Fragment, {
|
|
74
|
+
var tooltip = tooltipOptions == null || !isOverflowing ? null : /*#__PURE__*/_jsx(ItemTooltip, {
|
|
75
|
+
options: tooltipOptions,
|
|
54
76
|
children: content
|
|
55
77
|
});
|
|
78
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
79
|
+
children: [content, tooltip]
|
|
80
|
+
});
|
|
56
81
|
}
|
|
57
|
-
export default
|
|
58
|
-
//# sourceMappingURL=
|
|
82
|
+
export default ItemContent;
|
|
83
|
+
//# sourceMappingURL=ItemContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemContent.js","names":["Children","cloneElement","isValidElement","useState","cl","isElementOfType","useCheckOverflow","NON_BREAKING_SPACE","Text","ItemTooltip","stylesCommon","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ItemContent","_ref","children","content","tooltipOptions","checkOverflow","isOverflowing","resetIsOverflowing","previousContent","setPreviousContent","String","Array","isArray","map","el","_objectSpread","props","ref","UNSAFE_className","spectrumEllipsis","tooltip","options"],"sources":["../../src/spectrum/ItemContent.tsx"],"sourcesContent":["import {\n Children,\n cloneElement,\n isValidElement,\n ReactNode,\n useState,\n} from 'react';\nimport cl from 'classnames';\nimport { isElementOfType, useCheckOverflow } from '@deephaven/react-hooks';\nimport { NON_BREAKING_SPACE } from '@deephaven/utils';\nimport { Text } from './Text';\nimport { TooltipOptions } from './utils';\nimport ItemTooltip from './ItemTooltip';\nimport stylesCommon from '../SpectrumComponent.module.scss';\n\nexport interface ItemContentProps {\n children: ReactNode;\n tooltipOptions?: TooltipOptions | null;\n}\n\n/**\n * Item content. Text content will be wrapped in a Spectrum Text\n * component with ellipsis overflow handling. If text content overflows and\n * tooltipOptions are provided a tooltip will be displayed when hovering over\n * the item content.\n */\nexport function ItemContent({\n children: content,\n tooltipOptions,\n}: ItemContentProps): JSX.Element | null {\n const { checkOverflow, isOverflowing, resetIsOverflowing } =\n useCheckOverflow();\n\n const [previousContent, setPreviousContent] = useState(content);\n\n // Reset `isOverflowing` if content changes. It will get re-calculated as\n // `Text` components render.\n if (previousContent !== content) {\n setPreviousContent(content);\n resetIsOverflowing();\n }\n\n if (isValidElement(content)) {\n return content;\n }\n\n /* eslint-disable no-param-reassign */\n if (content === '') {\n // Prevent the item height from collapsing when the content is empty\n content = NON_BREAKING_SPACE;\n } else if (typeof content === 'boolean') {\n // Boolean values need to be stringified to render\n content = String(content);\n } else if (Array.isArray(content)) {\n // For cases where there are multiple `Text` children, add a css class to\n // handle overflow. The primary use case for multiple text nodes is when a\n // description is provided for an item. e.g.\n // <Item textValue=\"Some Text\">\n // <SomeIcon />\n // <Text>Some Label</Text>\n // <Text slot=\"description\">Some Description</Text>\n // </Item>\n content = Children.map(content, el =>\n isElementOfType(el, Text)\n ? cloneElement(el, {\n ...el.props,\n ref: checkOverflow,\n UNSAFE_className: cl(\n el.props.UNSAFE_className,\n stylesCommon.spectrumEllipsis\n ),\n })\n : el\n );\n }\n\n if (typeof content === 'string' || typeof content === 'number') {\n content = (\n <Text\n ref={checkOverflow}\n UNSAFE_className={stylesCommon.spectrumEllipsis}\n >\n {content}\n </Text>\n );\n }\n /* eslint-enable no-param-reassign */\n\n const tooltip =\n tooltipOptions == null || !isOverflowing ? null : (\n <ItemTooltip options={tooltipOptions}>{content}</ItemTooltip>\n );\n\n return (\n <>\n {content}\n {tooltip}\n </>\n );\n}\n\nexport default ItemContent;\n"],"mappings":";;;;;AAAA,SACEA,QAAQ,EACRC,YAAY,EACZC,cAAc,EAEdC,QAAQ,QACH,OAAO;AACd,OAAOC,EAAE,MAAM,YAAY;AAC3B,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,wBAAwB;AAC1E,SAASC,kBAAkB,QAAQ,kBAAkB;AAAC,SAC7CC,IAAI;AAAA,OAENC,WAAW;AAAA,OACXC,YAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAOnB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAAC,IAAA,EAGc;EAAA,IAHb;IAC1BC,QAAQ,EAAEC,OAAO;IACjBC;EACgB,CAAC,GAAAH,IAAA;EACjB,IAAM;IAAEI,aAAa;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GACxDlB,gBAAgB,CAAC,CAAC;EAEpB,IAAM,CAACmB,eAAe,EAAEC,kBAAkB,CAAC,GAAGvB,QAAQ,CAACiB,OAAO,CAAC;;EAE/D;EACA;EACA,IAAIK,eAAe,KAAKL,OAAO,EAAE;IAC/BM,kBAAkB,CAACN,OAAO,CAAC;IAC3BI,kBAAkB,CAAC,CAAC;EACtB;EAEA,kBAAItB,cAAc,CAACkB,OAAO,CAAC,EAAE;IAC3B,OAAOA,OAAO;EAChB;;EAEA;EACA,IAAIA,OAAO,KAAK,EAAE,EAAE;IAClB;IACAA,OAAO,GAAGb,kBAAkB;EAC9B,CAAC,MAAM,IAAI,OAAOa,OAAO,KAAK,SAAS,EAAE;IACvC;IACAA,OAAO,GAAGO,MAAM,CAACP,OAAO,CAAC;EAC3B,CAAC,MAAM,IAAIQ,KAAK,CAACC,OAAO,CAACT,OAAO,CAAC,EAAE;IACjC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACAA,OAAO,GAAGpB,QAAQ,CAAC8B,GAAG,CAACV,OAAO,EAAEW,EAAE,IAChC1B,eAAe,CAAC0B,EAAE,EAAEvB,IAAI,CAAC,gBACrBP,YAAY,CAAC8B,EAAE,EAAAC,aAAA,CAAAA,aAAA,KACVD,EAAE,CAACE,KAAK;MACXC,GAAG,EAAEZ,aAAa;MAClBa,gBAAgB,EAAE/B,EAAE,CAClB2B,EAAE,CAACE,KAAK,CAACE,gBAAgB,EACzBzB,YAAY,CAAC0B,gBACf;IAAC,EACF,CAAC,GACFL,EACN,CAAC;EACH;EAEA,IAAI,OAAOX,OAAO,KAAK,QAAQ,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC9DA,OAAO,gBACLR,IAAA,CAACJ,IAAI;MACH0B,GAAG,EAAEZ,aAAc;MACnBa,gBAAgB,EAAEzB,YAAY,CAAC0B,gBAAiB;MAAAjB,QAAA,EAE/CC;IAAO,CACJ,CACP;EACH;EACA;;EAEA,IAAMiB,OAAO,GACXhB,cAAc,IAAI,IAAI,IAAI,CAACE,aAAa,GAAG,IAAI,gBAC7CX,IAAA,CAACH,WAAW;IAAC6B,OAAO,EAAEjB,cAAe;IAAAF,QAAA,EAAEC;EAAO,CAAc,CAC7D;EAEH,oBACEJ,KAAA,CAAAF,SAAA;IAAAK,QAAA,GACGC,OAAO,EACPiB,OAAO;EAAA,CACR,CAAC;AAEP;AAEA,eAAepB,WAAW"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TooltipOptions } from './utils';
|
|
3
|
+
export interface ItemTooltipProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
options: TooltipOptions;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Tooltip for `<Item>` content.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ItemTooltip({ children, options, }: ItemTooltipProps): JSX.Element;
|
|
11
|
+
export default ItemTooltip;
|
|
12
|
+
//# sourceMappingURL=ItemTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemTooltip.d.ts","sourceRoot":"","sources":["../../src/spectrum/ItemTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAKzC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAO,GACR,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAehC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isElementOfType } from '@deephaven/react-hooks';
|
|
2
|
+
import { Tooltip } from "../popper/index.js";
|
|
3
|
+
import { Flex } from "./layout.js";
|
|
4
|
+
import { Text } from "./Text.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* Tooltip for `<Item>` content.
|
|
8
|
+
*/
|
|
9
|
+
export function ItemTooltip(_ref) {
|
|
10
|
+
var {
|
|
11
|
+
children,
|
|
12
|
+
options
|
|
13
|
+
} = _ref;
|
|
14
|
+
if (Array.isArray(children)) {
|
|
15
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
16
|
+
options: options,
|
|
17
|
+
children: /*#__PURE__*/_jsx(Flex, {
|
|
18
|
+
direction: "column",
|
|
19
|
+
alignItems: "start",
|
|
20
|
+
children: children.filter(node => isElementOfType(node, Text))
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
25
|
+
options: options,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export default ItemTooltip;
|
|
30
|
+
//# sourceMappingURL=ItemTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemTooltip.js","names":["isElementOfType","Tooltip","Flex","Text","jsx","_jsx","ItemTooltip","_ref","children","options","Array","isArray","direction","alignItems","filter","node"],"sources":["../../src/spectrum/ItemTooltip.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport { isElementOfType } from '@deephaven/react-hooks';\nimport { TooltipOptions } from './utils';\nimport { Tooltip } from '../popper';\nimport { Flex } from './layout';\nimport { Text } from './Text';\n\nexport interface ItemTooltipProps {\n children: ReactNode;\n options: TooltipOptions;\n}\n\n/**\n * Tooltip for `<Item>` content.\n */\nexport function ItemTooltip({\n children,\n options,\n}: ItemTooltipProps): JSX.Element {\n if (Array.isArray(children)) {\n return (\n <Tooltip options={options}>\n {/* Multiple children scenarios include a `<Text>` node for the label \n and at least 1 of an optional icon or `<Text slot=\"description\">` node.\n In such cases we only show the label and description `<Text>` nodes. */}\n <Flex direction=\"column\" alignItems=\"start\">\n {children.filter(node => isElementOfType(node, Text))}\n </Flex>\n </Tooltip>\n );\n }\n\n return <Tooltip options={options}>{children}</Tooltip>;\n}\n\nexport default ItemTooltip;\n"],"mappings":"AACA,SAASA,eAAe,QAAQ,wBAAwB;AAAC,SAEhDC,OAAO;AAAA,SACPC,IAAI;AAAA,SACJC,IAAI;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOb;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAAC,IAAA,EAGO;EAAA,IAHN;IAC1BC,QAAQ;IACRC;EACgB,CAAC,GAAAF,IAAA;EACjB,IAAIG,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,EAAE;IAC3B,oBACEH,IAAA,CAACJ,OAAO;MAACQ,OAAO,EAAEA,OAAQ;MAAAD,QAAA,eAIxBH,IAAA,CAACH,IAAI;QAACU,SAAS,EAAC,QAAQ;QAACC,UAAU,EAAC,OAAO;QAAAL,QAAA,EACxCA,QAAQ,CAACM,MAAM,CAACC,IAAI,IAAIf,eAAe,CAACe,IAAI,EAAEZ,IAAI,CAAC;MAAC,CACjD;IAAC,CACA,CAAC;EAEd;EAEA,oBAAOE,IAAA,CAACJ,OAAO;IAACQ,OAAO,EAAEA,OAAQ;IAAAD,QAAA,EAAEA;EAAQ,CAAU,CAAC;AACxD;AAEA,eAAeF,WAAW"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionGroupProps } from './ActionGroup';
|
|
2
|
+
import { ItemKey, ItemSelection } from './utils';
|
|
3
|
+
export interface ListActionGroupProps<T> extends Omit<ActionGroupProps<T>, 'onAction' | 'onChange' | 'onSelectionChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* Handler that is called when an item is pressed.
|
|
6
|
+
*/
|
|
7
|
+
onAction: (actionKey: ItemKey, listItemKey: ItemKey) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Handler that is called when the selection change.
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (selection: ItemSelection, listItemKey: ItemKey) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* This component doesn't actually render anything. It is a prop container that
|
|
15
|
+
* gets passed to `NormalizedListView`. The actual `ActionGroup` elements will
|
|
16
|
+
* be created from this component's props on each item in the list view.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ListActionGroup<T>(_props: ListActionGroupProps<T>): null;
|
|
19
|
+
//# sourceMappingURL=ListActionGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListActionGroup.d.ts","sourceRoot":"","sources":["../../src/spectrum/ListActionGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,oBAAoB,CAAC,CAAC,CACrC,SAAQ,IAAI,CACV,gBAAgB,CAAC,CAAC,CAAC,EACnB,UAAU,GAAG,UAAU,GAAG,mBAAmB,CAC9C;IACD;;OAEG;IACH,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAE7D;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;CACrE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,IAAI,CAExE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This component doesn't actually render anything. It is a prop container that
|
|
3
|
+
* gets passed to `NormalizedListView`. The actual `ActionGroup` elements will
|
|
4
|
+
* be created from this component's props on each item in the list view.
|
|
5
|
+
*/
|
|
6
|
+
export function ListActionGroup(_props) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ListActionGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListActionGroup.js","names":["ListActionGroup","_props"],"sources":["../../src/spectrum/ListActionGroup.tsx"],"sourcesContent":["import { ActionGroupProps } from './ActionGroup';\nimport { ItemKey, ItemSelection } from './utils';\n\nexport interface ListActionGroupProps<T>\n extends Omit<\n ActionGroupProps<T>,\n 'onAction' | 'onChange' | 'onSelectionChange'\n > {\n /**\n * Handler that is called when an item is pressed.\n */\n onAction: (actionKey: ItemKey, listItemKey: ItemKey) => void;\n\n /**\n * Handler that is called when the selection change.\n */\n onChange?: (selection: ItemSelection, listItemKey: ItemKey) => void;\n}\n\n/**\n * This component doesn't actually render anything. It is a prop container that\n * gets passed to `NormalizedListView`. The actual `ActionGroup` elements will\n * be created from this component's props on each item in the list view.\n */\nexport function ListActionGroup<T>(_props: ListActionGroupProps<T>): null {\n return null;\n}\n"],"mappings":"AAmBA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAeA,CAAIC,MAA+B,EAAQ;EACxE,OAAO,IAAI;AACb"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionMenuProps } from './ActionMenu';
|
|
2
|
+
import { ItemKey } from './utils';
|
|
3
|
+
export interface ListActionMenuProps<T> extends Omit<ActionMenuProps<T>, 'onAction' | 'onOpenChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* Handler that is called when an item is pressed.
|
|
6
|
+
*/
|
|
7
|
+
onAction: (actionKey: ItemKey, listItemKey: ItemKey) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Handler that is called when the the menu is opened or closed.
|
|
10
|
+
*/
|
|
11
|
+
onOpenChange?: (isOpen: boolean, listItemKey: ItemKey) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* This component doesn't actually render anything. It is a prop container that
|
|
15
|
+
* gets passed to `NormalizedListView`. The actual `ActionMenu` elements will
|
|
16
|
+
* be created from this component's props on each item in the list view.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ListActionMenu<T>(_props: ListActionMenuProps<T>): null;
|
|
19
|
+
//# sourceMappingURL=ListActionMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListActionMenu.d.ts","sourceRoot":"","sources":["../../src/spectrum/ListActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,WAAW,mBAAmB,CAAC,CAAC,CACpC,SAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,cAAc,CAAC;IAC7D;;OAEG;IACH,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAE7D;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;CAChE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,CAEtE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This component doesn't actually render anything. It is a prop container that
|
|
3
|
+
* gets passed to `NormalizedListView`. The actual `ActionMenu` elements will
|
|
4
|
+
* be created from this component's props on each item in the list view.
|
|
5
|
+
*/
|
|
6
|
+
export function ListActionMenu(_props) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ListActionMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListActionMenu.js","names":["ListActionMenu","_props"],"sources":["../../src/spectrum/ListActionMenu.tsx"],"sourcesContent":["import { ActionMenuProps } from './ActionMenu';\nimport { ItemKey } from './utils';\n\nexport interface ListActionMenuProps<T>\n extends Omit<ActionMenuProps<T>, 'onAction' | 'onOpenChange'> {\n /**\n * Handler that is called when an item is pressed.\n */\n onAction: (actionKey: ItemKey, listItemKey: ItemKey) => void;\n\n /**\n * Handler that is called when the the menu is opened or closed.\n */\n onOpenChange?: (isOpen: boolean, listItemKey: ItemKey) => void;\n}\n\n/**\n * This component doesn't actually render anything. It is a prop container that\n * gets passed to `NormalizedListView`. The actual `ActionMenu` elements will\n * be created from this component's props on each item in the list view.\n */\nexport function ListActionMenu<T>(_props: ListActionMenuProps<T>): null {\n return null;\n}\n"],"mappings":"AAgBA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,cAAcA,CAAIC,MAA8B,EAAQ;EACtE,OAAO,IAAI;AACb"}
|
package/dist/spectrum/Text.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type TextProps as SpectrumTextProps } from '@adobe/react-spectrum';
|
|
3
|
+
import type { DOMRefValue } from '@react-types/shared';
|
|
3
4
|
import { type ColorValue } from '../theme/colorUtils';
|
|
4
5
|
export type TextProps = SpectrumTextProps & {
|
|
5
6
|
color?: ColorValue;
|
|
@@ -13,6 +14,8 @@ export type TextProps = SpectrumTextProps & {
|
|
|
13
14
|
* @returns The Text component
|
|
14
15
|
*
|
|
15
16
|
*/
|
|
16
|
-
export declare
|
|
17
|
+
export declare const Text: import("react").ForwardRefExoticComponent<SpectrumTextProps & {
|
|
18
|
+
color?: ColorValue;
|
|
19
|
+
} & import("react").RefAttributes<DOMRefValue<HTMLSpanElement>>>;
|
|
17
20
|
export default Text;
|
|
18
21
|
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/spectrum/Text.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,KAAK,SAAS,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG;IAC1C,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/spectrum/Text.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,KAAK,SAAS,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG;IAC1C,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI;YAZP,UAAU;gEAyBnB,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
package/dist/spectrum/Text.js
CHANGED
|
@@ -7,7 +7,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
7
7
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
8
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
9
|
/* eslint-disable react/jsx-props-no-spreading */
|
|
10
|
-
import { useMemo } from 'react';
|
|
10
|
+
import { forwardRef, useMemo } from 'react';
|
|
11
11
|
import { Text as SpectrumText } from '@adobe/react-spectrum';
|
|
12
12
|
import { colorValueStyle } from "../theme/colorUtils.js";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -20,8 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
20
20
|
* @returns The Text component
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
export function Text(props) {
|
|
23
|
+
export var Text = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
25
24
|
var {
|
|
26
25
|
color,
|
|
27
26
|
UNSAFE_style
|
|
@@ -31,8 +30,10 @@ export function Text(props) {
|
|
|
31
30
|
color: colorValueStyle(color)
|
|
32
31
|
}), [color, UNSAFE_style]);
|
|
33
32
|
return /*#__PURE__*/_jsx(SpectrumText, _objectSpread(_objectSpread({}, rest), {}, {
|
|
33
|
+
ref: forwardedRef,
|
|
34
34
|
UNSAFE_style: style
|
|
35
35
|
}));
|
|
36
|
-
}
|
|
36
|
+
});
|
|
37
|
+
Text.displayName = 'Text';
|
|
37
38
|
export default Text;
|
|
38
39
|
//# sourceMappingURL=Text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","names":["useMemo","Text","SpectrumText","colorValueStyle","jsx","_jsx","props","color","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread"],"sources":["../../src/spectrum/Text.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { useMemo } from 'react';\nimport {\n Text as SpectrumText,\n type TextProps as SpectrumTextProps,\n} from '@adobe/react-spectrum';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type TextProps = SpectrumTextProps & {\n color?: ColorValue;\n};\n\n/**\n * A Text component that re-exports the Spectrum Text component.\n * It overrides ColorValues to accept CSS color strings and custom\n * variable names from our color paletee and semantic colors.\n *\n * @param props The props for the Text component\n * @returns The Text component\n *\n */\
|
|
1
|
+
{"version":3,"file":"Text.js","names":["forwardRef","useMemo","Text","SpectrumText","colorValueStyle","jsx","_jsx","props","forwardedRef","color","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread","ref","displayName"],"sources":["../../src/spectrum/Text.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { forwardRef, useMemo } from 'react';\nimport {\n Text as SpectrumText,\n type TextProps as SpectrumTextProps,\n} from '@adobe/react-spectrum';\nimport type { DOMRefValue } from '@react-types/shared';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type TextProps = SpectrumTextProps & {\n color?: ColorValue;\n};\n\n/**\n * A Text component that re-exports the Spectrum Text component.\n * It overrides ColorValues to accept CSS color strings and custom\n * variable names from our color paletee and semantic colors.\n *\n * @param props The props for the Text component\n * @returns The Text component\n *\n */\nexport const Text = forwardRef<DOMRefValue<HTMLSpanElement>, TextProps>(\n (props, forwardedRef): JSX.Element => {\n const { color, UNSAFE_style, ...rest } = props;\n const style = useMemo(\n () => ({\n ...UNSAFE_style,\n color: colorValueStyle(color),\n }),\n [color, UNSAFE_style]\n );\n\n return <SpectrumText {...rest} ref={forwardedRef} UNSAFE_style={style} />;\n }\n);\n\nText.displayName = 'Text';\n\nexport default Text;\n"],"mappings":";;;;;;;;AAAA;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SACEC,IAAI,IAAIC,YAAY,QAEf,uBAAuB;AAAC,SAELC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMJ,IAAI,gBAAGF,UAAU,CAC5B,CAACO,KAAK,EAAEC,YAAY,KAAkB;EACpC,IAAM;MAAEC,KAAK;MAAEC;IAAsB,CAAC,GAAGH,KAAK;IAAdI,IAAI,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA;EAC9C,IAAMC,KAAK,GAAGb,OAAO,CACnB,MAAAc,aAAA,CAAAA,aAAA,KACKL,YAAY;IACfD,KAAK,EAAEL,eAAe,CAACK,KAAK;EAAC,EAC7B,EACF,CAACA,KAAK,EAAEC,YAAY,CACtB,CAAC;EAED,oBAAOJ,IAAA,CAACH,YAAY,EAAAY,aAAA,CAAAA,aAAA,KAAKJ,IAAI;IAAEK,GAAG,EAAER,YAAa;IAACE,YAAY,EAAEI;EAAM,EAAE,CAAC;AAC3E,CACF,CAAC;AAEDZ,IAAI,CAACe,WAAW,GAAG,MAAM;AAEzB,eAAef,IAAI"}
|
package/dist/spectrum/View.d.ts
CHANGED
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type ViewProps as SpectrumViewProps } from '@adobe/react-spectrum';
|
|
3
|
+
import type { DOMRefValue } from '@react-types/shared';
|
|
3
4
|
import { type ColorValue } from '../theme/colorUtils';
|
|
4
|
-
export type ViewProps = Omit<SpectrumViewProps<6>, 'backgroundColor'> & {
|
|
5
|
+
export type ViewProps = Omit<SpectrumViewProps<6>, 'backgroundColor' | 'borderColor' | 'borderStartColor' | 'borderEndColor' | 'borderTopColor' | 'borderBottomColor' | 'borderXColor' | 'borderYColor'> & {
|
|
5
6
|
backgroundColor?: ColorValue;
|
|
7
|
+
borderColor?: ColorValue;
|
|
8
|
+
borderStartColor?: ColorValue;
|
|
9
|
+
borderEndColor?: ColorValue;
|
|
10
|
+
borderTopColor?: ColorValue;
|
|
11
|
+
borderBottomColor?: ColorValue;
|
|
12
|
+
borderXColor?: ColorValue;
|
|
13
|
+
borderYColor?: ColorValue;
|
|
6
14
|
};
|
|
7
15
|
/**
|
|
8
16
|
* A View component that re-exports the Spectrum View component.
|
|
9
17
|
* However, it overrides ColorValues to accept CSS color strings and
|
|
10
|
-
* our custom variable names from our color
|
|
18
|
+
* our custom variable names from our color palette and semantic colors.
|
|
11
19
|
*
|
|
12
20
|
* @param props The props for the View component
|
|
13
21
|
* @returns The View component
|
|
14
22
|
*
|
|
15
23
|
*/
|
|
16
|
-
export declare
|
|
24
|
+
export declare const View: import("react").ForwardRefExoticComponent<Omit<SpectrumViewProps<6>, "backgroundColor" | "borderColor" | "borderStartColor" | "borderEndColor" | "borderTopColor" | "borderBottomColor" | "borderXColor" | "borderYColor"> & {
|
|
25
|
+
backgroundColor?: ColorValue;
|
|
26
|
+
borderColor?: ColorValue;
|
|
27
|
+
borderStartColor?: ColorValue;
|
|
28
|
+
borderEndColor?: ColorValue;
|
|
29
|
+
borderTopColor?: ColorValue;
|
|
30
|
+
borderBottomColor?: ColorValue;
|
|
31
|
+
borderXColor?: ColorValue;
|
|
32
|
+
borderYColor?: ColorValue;
|
|
33
|
+
} & import("react").RefAttributes<DOMRefValue<HTMLElement>>>;
|
|
17
34
|
export default View;
|
|
18
35
|
//# sourceMappingURL=View.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../src/spectrum/View.tsx"],"names":[],"mappings":";AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../src/spectrum/View.tsx"],"names":[],"mappings":";AAEA,OAAO,EAGL,KAAK,SAAS,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,iBAAiB,CAAC,CAAC,CAAC,EAClB,iBAAiB,GACjB,aAAa,GACb,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,cAAc,GACd,cAAc,CACjB,GAAG;IACF,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI;sBAnBG,UAAU;kBACd,UAAU;uBACL,UAAU;qBACZ,UAAU;qBACV,UAAU;wBACP,UAAU;mBACf,UAAU;mBACV,UAAU;4DA8E1B,CAAC;AAIF,eAAe,IAAI,CAAC"}
|