@darajs/components 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,8 @@
1
1
  import { Action, ComponentInstance, Condition, StyledComponentProps, Variable } from '@darajs/core';
2
- interface ButtonProps extends StyledComponentProps {
2
+ type OmitFromMappedType<Type, ToOmit> = {
3
+ [Property in keyof Type as Exclude<Property, ToOmit>]: Type[Property];
4
+ };
5
+ interface ButtonProps extends OmitFromMappedType<StyledComponentProps, 'children'> {
3
6
  children: Array<ComponentInstance> | string;
4
7
  /** Passthrough the className property */
5
8
  className: string;
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../js/common/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EACN,iBAAiB,EACjB,SAAS,EAGT,oBAAoB,EACpB,QAAQ,EAOX,MAAM,cAAc,CAAC;AAOtB,UAAU,WAAY,SAAQ,oBAAoB;IAC9C,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC;IAC5C,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IACvD,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,oGAAoG;IACpG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6CAA6C;IAC7C,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;CAClE;AA8BD;;;;GAIG;AACH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAwC/C;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../js/common/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EACN,iBAAiB,EACjB,SAAS,EAGT,oBAAoB,EACpB,QAAQ,EAOX,MAAM,cAAc,CAAC;AAOtB,KAAK,kBAAkB,CAAC,IAAI,EAAE,MAAM,IAAI;KACnC,QAAQ,IAAI,MAAM,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;CACxE,CAAC;AAEF,UAAU,WAAY,SAAQ,kBAAkB,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9E,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC;IAC5C,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IACvD,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,oGAAoG;IACpG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6CAA6C;IAC7C,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;CAClE;AA8BD;;;;GAIG;AACH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAwC/C;AAED,eAAe,MAAM,CAAC"}
@@ -29,7 +29,7 @@ const StyledButton = injectCss(styled(UiButton) `
29
29
  */
30
30
  function Button(props) {
31
31
  var _a, _b, _c, _d;
32
- const [style, css] = useComponentStyles(props);
32
+ const [style, css] = useComponentStyles(props); // the styles hook doesn't care about children though here it's wider, includes string
33
33
  const onClick = useAction(props.onclick);
34
34
  const loading = useActionIsLoading(props.onclick);
35
35
  const disabled = useConditionOrVariable(props.disabled);
@@ -1 +1 @@
1
- {"version":3,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AAC,QAAQ,KAAK,QAAQ,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,0CAAE,IAAI,MAAK,MAAM,EACxF,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAC5B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,KAAK,kBACD,GAAG,EAAE,SAAS,IACX,KAAK,GAEZ,OAAO,EAAE,KAAK,CAAC,OAAO,aAErB,KAAK,CAAC,IAAI,IAAI,CACX,KAAC,IAAI,IACD,KAAK,EAAE;oBACH,KAAK,EAAE,SAAS;oBAChB,MAAM,EAAE,SAAS;iBACpB,GACH,CACL,EACD,KAAC,UAAU,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,YACnF,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;oBACjC,KAAK,CAAC,QAAQ;oBAClB,CAAC,CAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAC,gBAAgB,IAAC,SAAS,EAAE,KAAK,IAAO,UAAU,KAAK,CAAC,GAAG,EAAE,CAAI,CAAC,GACnF,IACX,CAClB,CAAC;AACN,CAAC;AAED,eAAe,MAAM,CAAC"}
@@ -6330,7 +6330,7 @@
6330
6330
  }
6331
6331
  };
6332
6332
  };
6333
- const flip$3 = function(options) {
6333
+ const flip$4 = function(options) {
6334
6334
  if (options === void 0) {
6335
6335
  options = {};
6336
6336
  }
@@ -6640,7 +6640,7 @@
6640
6640
  y: crossAxis * crossAxisMulti
6641
6641
  };
6642
6642
  }
6643
- const offset$3 = function(options) {
6643
+ const offset$4 = function(options) {
6644
6644
  if (options === void 0) {
6645
6645
  options = 0;
6646
6646
  }
@@ -6670,7 +6670,7 @@
6670
6670
  }
6671
6671
  };
6672
6672
  };
6673
- const shift$2 = function(options) {
6673
+ const shift$3 = function(options) {
6674
6674
  if (options === void 0) {
6675
6675
  options = {};
6676
6676
  }
@@ -6803,7 +6803,7 @@
6803
6803
  }
6804
6804
  };
6805
6805
  };
6806
- const size$2 = function(options) {
6806
+ const size$3 = function(options) {
6807
6807
  if (options === void 0) {
6808
6808
  options = {};
6809
6809
  }
@@ -7427,11 +7427,11 @@
7427
7427
  }
7428
7428
  };
7429
7429
  }
7430
- const offset$2 = offset$3;
7430
+ const offset$3 = offset$4;
7431
7431
  autoPlacement;
7432
- const shift$1 = shift$2;
7433
- const flip$2 = flip$3;
7434
- const size$1 = size$2;
7432
+ const shift$2 = shift$3;
7433
+ const flip$3 = flip$4;
7434
+ const size$2 = size$3;
7435
7435
  hide$2;
7436
7436
  arrow$2;
7437
7437
  inline;
@@ -7666,6 +7666,22 @@
7666
7666
  floatingStyles
7667
7667
  }), [data2, update2, refs, elements, floatingStyles]);
7668
7668
  }
7669
+ const offset$2 = (options, deps) => ({
7670
+ ...offset$3(options),
7671
+ options: [options, deps]
7672
+ });
7673
+ const shift$1 = (options, deps) => ({
7674
+ ...shift$2(options),
7675
+ options: [options, deps]
7676
+ });
7677
+ const flip$2 = (options, deps) => ({
7678
+ ...flip$3(options),
7679
+ options: [options, deps]
7680
+ });
7681
+ const size$1 = (options, deps) => ({
7682
+ ...size$2(options),
7683
+ options: [options, deps]
7684
+ });
7669
7685
  const SafeReact = {
7670
7686
  ...React__namespace
7671
7687
  };
@@ -37006,16 +37022,10 @@
37006
37022
  });
37007
37023
  const role = useRole(context2, { role: "combobox" });
37008
37024
  const { getReferenceProps, getFloatingProps } = useInteractions([role]);
37009
- const menuProps = getMenuProps();
37010
- const setMenuRef = menuProps.ref;
37011
- const setFloatingRef = refs.setFloating;
37012
- const mergedRefs = React.useCallback((node2) => {
37013
- setFloatingRef(node2);
37014
- setMenuRef(node2);
37015
- }, [setFloatingRef, setMenuRef]);
37025
+ const menuProps = React.useMemo(() => getMenuProps({ ref: refs.setFloating }), [refs.setFloating, getMenuProps]);
37016
37026
  return jsxRuntime.exports.jsx(Tooltip$1, { content: props.errorMsg, disabled: !props.errorMsg, styling: "error", children: jsxRuntime.exports.jsxs(Wrapper$a, { className: props.className, isDisabled: props.disabled, isErrored: !!props.errorMsg, isOpen, style: props.style, children: [jsxRuntime.exports.jsxs(InputWrapper$4, { disabled: props.disabled, isOpen, ref: refs.setReference, children: [jsxRuntime.exports.jsx(Input$2, Object.assign({}, getInputProps({
37017
37027
  disabled: props.disabled
37018
- }), getReferenceProps(), { placeholder: (_f = selectedItem === null ? props.placeholder : selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) !== null && _f !== void 0 ? _f : props.placeholder, size: props.size })), jsxRuntime.exports.jsx(ChevronButton$1, Object.assign({}, getToggleButtonProps(), { children: jsxRuntime.exports.jsx(Chevron$2, { disabled: props.disabled, isOpen }) }))] }), ReactDOM__default.default.createPortal(jsxRuntime.exports.jsxs(DropdownList$3, Object.assign({}, menuProps, getFloatingProps(), { ref: mergedRefs, isOpen, style: Object.assign(Object.assign({}, floatingStyles), { zIndex: 9999 }), children: [filteredItems.length > 0 && filteredItems.map((item, index2) => React.createElement(ListItem, Object.assign({}, getItemProps({ index: index2, item }), { hovered: index2 === highlightedIndex, key: `item-${index2}`, size: props.size, title: item.label }), item.label)), filteredItems.length === 0 && jsxRuntime.exports.jsx(NoItemsLabel$1, { children: "No Items" })] })), document.body)] }) });
37028
+ }), getReferenceProps(), { placeholder: (_f = selectedItem === null ? props.placeholder : selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) !== null && _f !== void 0 ? _f : props.placeholder, size: props.size })), jsxRuntime.exports.jsx(ChevronButton$1, Object.assign({}, getToggleButtonProps(), { children: jsxRuntime.exports.jsx(Chevron$2, { disabled: props.disabled, isOpen }) }))] }), ReactDOM__default.default.createPortal(jsxRuntime.exports.jsxs(DropdownList$3, Object.assign({}, menuProps, getFloatingProps(), { isOpen, style: Object.assign(Object.assign({}, floatingStyles), { zIndex: 9999 }), children: [filteredItems.length > 0 && filteredItems.map((item, index2) => React.createElement(ListItem, Object.assign({}, getItemProps({ index: index2, item }), { hovered: index2 === highlightedIndex, key: `item-${index2}`, size: props.size, title: item.label }), item.label)), filteredItems.length === 0 && jsxRuntime.exports.jsx(NoItemsLabel$1, { children: "No Items" })] })), document.body)] }) });
37019
37029
  }
37020
37030
  styled__default.default(List)`
37021
37031
  overflow-y: auto;
@@ -45682,17 +45692,12 @@
45682
45692
  });
45683
45693
  const role = useRole(context2, { role: "listbox" });
45684
45694
  const { getReferenceProps, getFloatingProps } = useInteractions([role]);
45685
- const menuProps = getMenuProps();
45686
- const setMenuRef = menuProps.ref;
45687
- const setFloatingRef = refs.setFloating;
45688
- const mergedRefs = React.useCallback((node2) => {
45689
- setFloatingRef(node2);
45690
- setMenuRef(node2);
45691
- }, [setFloatingRef, setMenuRef]);
45695
+ const menuProps = React.useMemo(() => getMenuProps({ ref: refs.setFloating }), [getMenuProps, refs.setFloating]);
45696
+ const toggleProps = React.useMemo(() => getToggleButtonProps(), [getToggleButtonProps]);
45692
45697
  return jsxRuntime.exports.jsxs(Wrapper$7, { className: props.className, isDisabled: props.disabled, isOpen, maxRows, maxWidth, style: props.style, children: [jsxRuntime.exports.jsx(Tooltip$1, { content: props.errorMsg, disabled: !props.errorMsg, styling: "error", children: jsxRuntime.exports.jsxs(InputWrapper$3, { isDisabled: props.disabled, isOpen, ref: refs.setReference, children: [jsxRuntime.exports.jsxs(TagWrapper, { maxRows, children: [selectedItems.map((selectedItem, index2) => jsxRuntime.exports.jsxs(Tag$1, Object.assign({ disabled: props.disabled }, getSelectedItemProps({ index: index2, selectedItem }), { children: [jsxRuntime.exports.jsx(TagText, { children: selectedItem.label }), jsxRuntime.exports.jsx(Cross$1, { asButton: true, onClick: (e3) => {
45693
45698
  e3.stopPropagation();
45694
45699
  return removeSelectedItem(selectedItem);
45695
- } })] }), selectedItem.value)), jsxRuntime.exports.jsx(Input$1, Object.assign({}, getInputProps(getDropdownProps({ preventKeyAction: isOpen })), getReferenceProps(), { disabled: props.disabled, placeholder: props.placeholder, size: props.size, style: { flex: "1 1 5ch" } }))] }), jsxRuntime.exports.jsx(ChevronButton, Object.assign({}, getToggleButtonProps(), { children: jsxRuntime.exports.jsx(Chevron$2, { disabled: props.disabled, isOpen }) }))] }) }), ReactDOM__default.default.createPortal(jsxRuntime.exports.jsxs(DropdownList$1, Object.assign({}, menuProps, getFloatingProps(), { ref: mergedRefs, isOpen, style: Object.assign(Object.assign({}, floatingStyles), { zIndex: 9999 }), children: [filteredItems.length > 0 && filteredItems.map((item, index2) => React.createElement(ListItem, Object.assign({}, getItemProps({ index: index2, item }), { hovered: index2 === highlightedIndex, key: `item-${index2}`, size: props.size, title: item.label }), item.label)), filteredItems.length === 0 && jsxRuntime.exports.jsx(NoItemsLabel, { children: "No Items" })] })), document.body)] });
45700
+ } })] }), selectedItem.value)), jsxRuntime.exports.jsx(Input$1, Object.assign({}, getInputProps(getDropdownProps({ preventKeyAction: isOpen })), getReferenceProps(), { disabled: props.disabled, placeholder: props.placeholder, size: props.size, style: { flex: "1 1 5ch" } }))] }), jsxRuntime.exports.jsx(ChevronButton, Object.assign({}, toggleProps, { children: jsxRuntime.exports.jsx(Chevron$2, { disabled: props.disabled, isOpen }) }))] }) }), ReactDOM__default.default.createPortal(jsxRuntime.exports.jsxs(DropdownList$1, Object.assign({}, menuProps, getFloatingProps(), { isOpen, style: Object.assign(Object.assign({}, floatingStyles), { zIndex: 9999 }), children: [filteredItems.length > 0 && filteredItems.map((item, index2) => React.createElement(ListItem, Object.assign({}, getItemProps({ index: index2, item }), { hovered: index2 === highlightedIndex, key: `item-${index2}`, size: props.size, title: item.label }), item.label)), filteredItems.length === 0 && jsxRuntime.exports.jsx(NoItemsLabel, { children: "No Items" })] })), document.body)] });
45696
45701
  }
45697
45702
  var __rest$8 = globalThis && globalThis.__rest || function(s2, e3) {
45698
45703
  var t2 = {};
@@ -45809,16 +45814,15 @@
45809
45814
  });
45810
45815
  const role = useRole(context2, { role: "listbox" });
45811
45816
  const { getReferenceProps, getFloatingProps } = useInteractions([role]);
45812
- const menuProps = getMenuProps();
45813
- const setMenuRef = menuProps.ref;
45814
45817
  const setFloatingRef = refs.setFloating;
45815
45818
  const { dropdownRef } = props;
45816
45819
  const mergedDropdownRef = React__namespace.useCallback((node2) => {
45817
45820
  setFloatingRef(node2);
45818
- setMenuRef(node2);
45819
45821
  dropdownRef === null || dropdownRef === void 0 ? void 0 : dropdownRef(node2);
45820
- }, [setFloatingRef, setMenuRef, dropdownRef]);
45821
- return jsxRuntime.exports.jsx(Tooltip$1, { content: props.errorMsg, disabled: !props.errorMsg, styling: "error", children: jsxRuntime.exports.jsxs(Wrapper$6, { className: props.className, isDisabled: props.disabled, isErrored: !!props.errorMsg, isOpen, onClick: props.onClick, style: props.style, children: [jsxRuntime.exports.jsxs(SelectButton, Object.assign({ disabled: props.disabled, isOpen }, getToggleButtonProps({ disabled: props.disabled, ref: refs.setReference }), getReferenceProps(), { type: "button", children: [jsxRuntime.exports.jsx(SelectedItem, { size: props.size, children: (_b = (_a3 = selectedItem === null ? props.placeholder : selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) !== null && _a3 !== void 0 ? _a3 : props.placeholder) !== null && _b !== void 0 ? _b : "Select" }), jsxRuntime.exports.jsx(Chevron$2, { disabled: props.disabled, isOpen })] })), ReactDOM__default.default.createPortal(jsxRuntime.exports.jsx(DropdownList, Object.assign({}, menuProps, getFloatingProps(), { ref: mergedDropdownRef, className: `${(_c = menuProps === null || menuProps === void 0 ? void 0 : menuProps.className) !== null && _c !== void 0 ? _c : ""} ${props.itemClass}`, isOpen, maxItems: props.maxItems, style: Object.assign(Object.assign({}, floatingStyles), { zIndex: 9999 }), children: props.items.map((item, index2) => {
45822
+ }, [setFloatingRef, dropdownRef]);
45823
+ const menuProps = React__namespace.useMemo(() => getMenuProps({ ref: mergedDropdownRef }), [mergedDropdownRef, getMenuProps]);
45824
+ const toggleButtonProps = React__namespace.useMemo(() => getToggleButtonProps({ disabled: props.disabled, ref: refs.setReference }), [props.disabled, refs.setReference, getToggleButtonProps]);
45825
+ return jsxRuntime.exports.jsx(Tooltip$1, { content: props.errorMsg, disabled: !props.errorMsg, styling: "error", children: jsxRuntime.exports.jsxs(Wrapper$6, { className: props.className, isDisabled: props.disabled, isErrored: !!props.errorMsg, isOpen, onClick: props.onClick, style: props.style, children: [jsxRuntime.exports.jsxs(SelectButton, Object.assign({ disabled: props.disabled, isOpen }, toggleButtonProps, getReferenceProps(), { type: "button", children: [jsxRuntime.exports.jsx(SelectedItem, { size: props.size, children: (_b = (_a3 = selectedItem === null ? props.placeholder : selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) !== null && _a3 !== void 0 ? _a3 : props.placeholder) !== null && _b !== void 0 ? _b : "Select" }), jsxRuntime.exports.jsx(Chevron$2, { disabled: props.disabled, isOpen })] })), ReactDOM__default.default.createPortal(jsxRuntime.exports.jsx(DropdownList, Object.assign({}, menuProps, getFloatingProps(), { className: `${(_c = menuProps === null || menuProps === void 0 ? void 0 : menuProps.className) !== null && _c !== void 0 ? _c : ""} ${props.itemClass}`, isOpen, maxItems: props.maxItems, style: Object.assign(Object.assign({}, floatingStyles), { zIndex: 9999 }), children: props.items.map((item, index2) => {
45822
45826
  const _a4 = getItemProps({ index: index2, item }), { itemClassName } = _a4, itemProps = __rest$8(_a4, ["itemClassName"]);
45823
45827
  return React.createElement(ListItem, Object.assign({}, itemProps, { className: `${itemClassName} ${props.itemClass}`, hovered: index2 === highlightedIndex, key: `item-${index2}`, size: props.size, title: item.label }), item.label);
45824
45828
  }) })), document.body)] }) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darajs/components",
3
- "version": "1.9.2",
3
+ "version": "1.9.4",
4
4
  "description": "Components for the Dara framework",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -54,14 +54,14 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@bokeh/bokehjs": "~3.1.1",
57
- "@darajs/core": "1.9.2",
58
- "@darajs/styled-components": "~1.9.4",
59
- "@darajs/ui-causal-graph-editor": "~1.9.4",
60
- "@darajs/ui-code-editor": "~1.9.4",
61
- "@darajs/ui-components": "~1.9.4",
62
- "@darajs/ui-hierarchy-viewer": "~1.9.4",
63
- "@darajs/ui-icons": "~1.9.4",
64
- "@darajs/ui-utils": "~1.9.4",
57
+ "@darajs/core": "1.9.4",
58
+ "@darajs/styled-components": "~1.9.5",
59
+ "@darajs/ui-causal-graph-editor": "~1.9.5",
60
+ "@darajs/ui-code-editor": "~1.9.5",
61
+ "@darajs/ui-components": "~1.9.5",
62
+ "@darajs/ui-hierarchy-viewer": "~1.9.5",
63
+ "@darajs/ui-icons": "~1.9.5",
64
+ "@darajs/ui-utils": "~1.9.5",
65
65
  "@popperjs/core": "2.4.0",
66
66
  "date-fns": "2.9.0",
67
67
  "immer": "^10.0.0",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "1292fb6a764c0c3e3f0f920042fc1ebd1120f34c"
86
+ "gitHead": "93bfab036ab085ffb04bdede295927c1b58bea2b"
87
87
  }