@neko-os/ui 0.6.1 → 0.6.3

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,4 +1,4 @@
1
- var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/menu/HorizontalMenu.js";var _excluded = ["item", "linkPaddingH", "handlePress", "linkProps", "activeIndex", "activeKey", "activeColor", "color", "sizeCode", "index"],_excluded2 = ["active", "key", "disabled"],_excluded3 = ["gap", "height", "items", "onChange", "onChangeIndex", "activeIndex"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { omit, pipe } from 'ramda';
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/menu/HorizontalMenu.js";var _excluded = ["item", "linkPaddingH", "handlePress", "linkProps", "activeIndex", "activeKey", "activeColor", "color", "height", "sizeCode", "index"],_excluded2 = ["active", "key", "disabled"],_excluded3 = ["gap", "height", "items", "onChange", "onChangeIndex", "activeIndex"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import { omit, pipe } from 'ramda';
2
2
  import React from 'react';
3
3
 
4
4
  import { IconText } from "../../presentation/IconLabel";
@@ -6,11 +6,19 @@ import { Link } from "../Link";
6
6
  import { SubmenuWrapper } from "./SubmenuWrapper";
7
7
  import { View } from "../../structure/View";
8
8
  import { useColorConverter } from "../../../modifiers/colorConverter";
9
+ import { useDefaultModifier } from "../../../modifiers/default";
9
10
  import { useSizeConverter } from "../../../modifiers/sizeConverter";
10
11
  import { useThemeComponentModifier } from "../../../modifiers/themeComponent";import { jsx as _jsx } from "react/jsx-runtime";
11
12
 
12
- function Item(_ref)
13
+ var DEFAULT_PROPS = function DEFAULT_PROPS(_ref) {var _ref2 = _slicedToArray(_ref, 1),sizeCode = _ref2[0].sizeCode;return {
14
+ gap: 'sm',
15
+ height: sizeCode,
16
+ size: sizeCode,
17
+ linkPaddingH: 'md',
18
+ activeColor: 'primary'
19
+ };};
13
20
 
21
+ function Item(_ref3)
14
22
 
15
23
 
16
24
 
@@ -21,7 +29,9 @@ function Item(_ref)
21
29
 
22
30
 
23
31
 
24
- {var item = _ref.item,_ref$linkPaddingH = _ref.linkPaddingH,linkPaddingH = _ref$linkPaddingH === void 0 ? 'md' : _ref$linkPaddingH,handlePress = _ref.handlePress,linkProps = _ref.linkProps,activeIndex = _ref.activeIndex,activeKey = _ref.activeKey,_ref$activeColor = _ref.activeColor,activeColor = _ref$activeColor === void 0 ? 'primary' : _ref$activeColor,color = _ref.color,sizeCode = _ref.sizeCode,index = _ref.index,props = _objectWithoutProperties(_ref, _excluded);
32
+
33
+
34
+ {var item = _ref3.item,_ref3$linkPaddingH = _ref3.linkPaddingH,linkPaddingH = _ref3$linkPaddingH === void 0 ? 'md' : _ref3$linkPaddingH,handlePress = _ref3.handlePress,linkProps = _ref3.linkProps,activeIndex = _ref3.activeIndex,activeKey = _ref3.activeKey,_ref3$activeColor = _ref3.activeColor,activeColor = _ref3$activeColor === void 0 ? 'primary' : _ref3$activeColor,color = _ref3.color,height = _ref3.height,sizeCode = _ref3.sizeCode,index = _ref3.index,props = _objectWithoutProperties(_ref3, _excluded);
25
35
  activeColor = activeColor || 'primary';
26
36
  var _omit = omit(['onClick', 'onPress'], item),active = _omit.active,key = _omit.key,disabled = _omit.disabled,childProps = _objectWithoutProperties(_omit, _excluded2);
27
37
  if (!active && activeIndex >= 0) active = activeIndex === index;
@@ -34,25 +44,26 @@ function Item(_ref)
34
44
  activeKey: activeKey,
35
45
  color: color,
36
46
  placement: "bottomRight",
37
- hideIcon: true, children:
47
+ hideIcon: true,
48
+ height: height, children:
38
49
 
39
50
  _jsx(Link, Object.assign({
40
51
 
41
- fullH: true,
42
52
  center: true,
43
53
  paddingH: linkPaddingH,
44
- disabled: disabled },
54
+ disabled: disabled,
55
+ height: height },
45
56
  linkProps, {
46
57
  onPress: function onPress() {return handlePress(item, index);}, children:
47
58
 
48
59
  _jsx(IconText, Object.assign({
49
60
  color: active ? activeColor : color,
50
- fullH: true,
51
61
  marginT: 3,
52
62
  borderB: 3,
53
63
  borderColor: active ? activeColor : 'transparent',
54
64
  transition: "border-color 0.6s ease",
55
- size: sizeCode },
65
+ size: sizeCode,
66
+ height: height },
56
67
  childProps)
57
68
  ) }), key || index
58
69
  ) }
@@ -63,11 +74,12 @@ function Item(_ref)
63
74
  export function HorizontalMenu(rootProps) {var _this = this;
64
75
  var _pipe = pipe(
65
76
  useColorConverter(),
66
- useSizeConverter('icons', 'md'),
67
- useThemeComponentModifier('HorizontalMenu')
77
+ useSizeConverter('elementHeights', 'md'),
78
+ useThemeComponentModifier('HorizontalMenu'),
79
+ useDefaultModifier(DEFAULT_PROPS)
68
80
  )([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_pipe2$ = _pipe2[0],sizeCode = _pipe2$.sizeCode,color = _pipe2$.color,formattedProps = _pipe2[1];
69
81
 
70
- var _formattedProps$gap = formattedProps.gap,gap = _formattedProps$gap === void 0 ? 'sm' : _formattedProps$gap,_formattedProps$heigh = formattedProps.height,height = _formattedProps$heigh === void 0 ? 50 : _formattedProps$heigh,items = formattedProps.items,onChange = formattedProps.onChange,onChangeIndex = formattedProps.onChangeIndex,activeIndex = formattedProps.activeIndex,props = _objectWithoutProperties(formattedProps, _excluded3);
82
+ var gap = formattedProps.gap,height = formattedProps.height,items = formattedProps.items,onChange = formattedProps.onChange,onChangeIndex = formattedProps.onChangeIndex,activeIndex = formattedProps.activeIndex,props = _objectWithoutProperties(formattedProps, _excluded3);
71
83
 
72
84
  var handlePress = React.useCallback(
73
85
  function (item, index) {
@@ -88,6 +100,7 @@ export function HorizontalMenu(rootProps) {var _this = this;
88
100
  handlePress: handlePress,
89
101
  color: color,
90
102
  sizeCode: sizeCode,
103
+ height: height,
91
104
  index: index,
92
105
  activeIndex: activeIndex },
93
106
  props), item.key || index
@@ -1,4 +1,4 @@
1
- var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/upload/Upload.js";var _excluded = ["children", "onChange", "onUpload", "value", "accept", "multiple", "maxCount", "disabled", "dnd"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React, { useRef, useState, useCallback } from 'react';
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/upload/Upload.js";var _excluded = ["children", "onChange", "onUpload", "value", "accept", "multiple", "maxCount", "disabled", "dnd", "onAddPress"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React, { useRef, useState, useCallback } from 'react';
2
2
 
3
3
  import { View } from "../../structure/View";
4
4
  import { useUploadState } from "./useUploadState";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -13,16 +13,18 @@ function normalizeFile(file) {
13
13
  };
14
14
  }
15
15
 
16
- export function Upload(_ref) {var children = _ref.children,onChange = _ref.onChange,onUpload = _ref.onUpload,valueProp = _ref.value,accept = _ref.accept,_ref$multiple = _ref.multiple,multiple = _ref$multiple === void 0 ? false : _ref$multiple,maxCount = _ref.maxCount,_ref$disabled = _ref.disabled,disabled = _ref$disabled === void 0 ? false : _ref$disabled,_ref$dnd = _ref.dnd,dnd = _ref$dnd === void 0 ? true : _ref$dnd,props = _objectWithoutProperties(_ref, _excluded);
16
+ export function Upload(_ref) {var children = _ref.children,onChange = _ref.onChange,onUpload = _ref.onUpload,valueProp = _ref.value,accept = _ref.accept,_ref$multiple = _ref.multiple,multiple = _ref$multiple === void 0 ? false : _ref$multiple,maxCount = _ref.maxCount,_ref$disabled = _ref.disabled,disabled = _ref$disabled === void 0 ? false : _ref$disabled,_ref$dnd = _ref.dnd,dnd = _ref$dnd === void 0 ? true : _ref$dnd,onAddPress = _ref.onAddPress,props = _objectWithoutProperties(_ref, _excluded);
17
17
  var _useUploadState = useUploadState({ onUpload: onUpload, onChange: onChange, multiple: multiple, maxCount: maxCount, value: valueProp }),value = _useUploadState.value,addFiles = _useUploadState.addFiles,remove = _useUploadState.remove;
18
18
  var inputRef = useRef();
19
19
  var _useState = useState(false),_useState2 = _slicedToArray(_useState, 2),isDragging = _useState2[0],setIsDragging = _useState2[1];
20
20
  var dragCounter = useRef(0);
21
21
 
22
- var handleClick = useCallback(function () {var _inputRef$current;
22
+ var handleClick = useCallback(function () {
23
23
  if (disabled) return;
24
- (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.click();
25
- }, [disabled]);
24
+ var open = function open() {var _inputRef$current;return (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.click();};
25
+ if (onAddPress) return onAddPress(open);
26
+ open();
27
+ }, [disabled, onAddPress]);
26
28
 
27
29
  var handleInputChange = useCallback(
28
30
  function (e) {
@@ -1,4 +1,4 @@
1
- var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/upload/Upload.native.js";var _excluded = ["children", "onChange", "onUpload", "value", "accept", "multiple", "maxCount", "disabled", "persistTo", "saveToLibrary", "compress"];function asyncGeneratorStep(n, t, e, r, o, a, c) {try {var i = n[a](c),u = i.value;} catch (n) {return void e(n);}i.done ? t(u) : Promise.resolve(u).then(r, o);}function _asyncToGenerator(n) {return function () {var t = this,e = arguments;return new Promise(function (r, o) {var a = n.apply(t, e);function _next(n) {asyncGeneratorStep(a, r, o, _next, _throw, "next", n);}function _throw(n) {asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);}_next(void 0);});};}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React, { useState, useCallback } from 'react';
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/upload/Upload.native.js";var _excluded = ["children", "onChange", "onUpload", "value", "accept", "multiple", "maxCount", "disabled", "onAddPress", "persistTo", "saveToLibrary", "compress"];function asyncGeneratorStep(n, t, e, r, o, a, c) {try {var i = n[a](c),u = i.value;} catch (n) {return void e(n);}i.done ? t(u) : Promise.resolve(u).then(r, o);}function _asyncToGenerator(n) {return function () {var t = this,e = arguments;return new Promise(function (r, o) {var a = n.apply(t, e);function _next(n) {asyncGeneratorStep(a, r, o, _next, _throw, "next", n);}function _throw(n) {asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);}_next(void 0);});};}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React, { useState, useCallback } from 'react';
2
2
 
3
3
  import { BottomDrawer } from "../../modals/bottomDrawer";
4
4
  import { Icon } from "../../presentation/Icon";
@@ -43,7 +43,7 @@ function getMediaTypes(accept) {
43
43
  return undefined;
44
44
  }
45
45
 
46
- export function Upload(_ref) {var children = _ref.children,onChange = _ref.onChange,onUpload = _ref.onUpload,valueProp = _ref.value,accept = _ref.accept,_ref$multiple = _ref.multiple,multiple = _ref$multiple === void 0 ? false : _ref$multiple,maxCount = _ref.maxCount,_ref$disabled = _ref.disabled,disabled = _ref$disabled === void 0 ? false : _ref$disabled,persistTo = _ref.persistTo,saveToLibrary = _ref.saveToLibrary,_ref$compress = _ref.compress,compress = _ref$compress === void 0 ? true : _ref$compress,props = _objectWithoutProperties(_ref, _excluded);
46
+ export function Upload(_ref) {var children = _ref.children,onChange = _ref.onChange,onUpload = _ref.onUpload,valueProp = _ref.value,accept = _ref.accept,_ref$multiple = _ref.multiple,multiple = _ref$multiple === void 0 ? false : _ref$multiple,maxCount = _ref.maxCount,_ref$disabled = _ref.disabled,disabled = _ref$disabled === void 0 ? false : _ref$disabled,onAddPress = _ref.onAddPress,persistTo = _ref.persistTo,saveToLibrary = _ref.saveToLibrary,_ref$compress = _ref.compress,compress = _ref$compress === void 0 ? true : _ref$compress,props = _objectWithoutProperties(_ref, _excluded);
47
47
  var _useUploadState = useUploadState({ onUpload: onUpload, onChange: onChange, multiple: multiple, maxCount: maxCount, value: valueProp }),value = _useUploadState.value,addFiles = _useUploadState.addFiles,remove = _useUploadState.remove;
48
48
  var _useState = useState(false),_useState2 = _slicedToArray(_useState, 2),open = _useState2[0],setOpen = _useState2[1];
49
49
 
@@ -62,8 +62,10 @@ export function Upload(_ref) {var children = _ref.children,onChange = _ref.onCha
62
62
 
63
63
  var handlePress = useCallback(function () {
64
64
  if (disabled) return;
65
- setOpen(true);
66
- }, [disabled]);
65
+ var open = function open() {return setOpen(true);};
66
+ if (onAddPress) return onAddPress(open);
67
+ open();
68
+ }, [disabled, onAddPress]);
67
69
 
68
70
 
69
71
 
@@ -8,9 +8,9 @@ export function PopoverContent(_ref) {var children = _ref.children,_ref$placemen
8
8
  br: "sm",
9
9
  className: "neko-popover-content",
10
10
  bg: "overlayBG",
11
- border: true,
12
- borderColor: "divider_op40" },
13
- props, { children:
11
+ border: true },
12
+ props, {
13
+ borderColor: "divider", children:
14
14
 
15
15
  children })
16
16
  ));
package/dist/i18n/I18n.js CHANGED
@@ -35,7 +35,6 @@ var _excluded = ["ns", "context", "default"];function _objectWithoutProperties(e
35
35
  }
36
36
  var langData = (_this$resources$this$2 = this.resources[this.language]) == null ? void 0 : _this$resources$this$2[ns];
37
37
  var value = this._resolveKey(langData, key, count, context);
38
- if (context) console.log(context, value);
39
38
 
40
39
  if (!value) {var _this$resources$this$3, _ref, _this$_resolveKey;
41
40
  var fallbackData = (_this$resources$this$3 = this.resources[this.fallback]) == null ? void 0 : _this$resources$this$3[ns];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neko-os/ui",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "author": "Christian Storch <ccstorch@gmail.com>",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -6,9 +6,18 @@ import { Link } from '../Link'
6
6
  import { SubmenuWrapper } from './SubmenuWrapper'
7
7
  import { View } from '../../structure/View'
8
8
  import { useColorConverter } from '../../../modifiers/colorConverter'
9
+ import { useDefaultModifier } from '../../../modifiers/default'
9
10
  import { useSizeConverter } from '../../../modifiers/sizeConverter'
10
11
  import { useThemeComponentModifier } from '../../../modifiers/themeComponent'
11
12
 
13
+ const DEFAULT_PROPS = ([{ sizeCode }]) => ({
14
+ gap: 'sm',
15
+ height: sizeCode,
16
+ size: sizeCode,
17
+ linkPaddingH: 'md',
18
+ activeColor: 'primary',
19
+ })
20
+
12
21
  function Item({
13
22
  item,
14
23
  linkPaddingH = 'md',
@@ -18,6 +27,7 @@ function Item({
18
27
  activeKey,
19
28
  activeColor = 'primary',
20
29
  color,
30
+ height,
21
31
  sizeCode,
22
32
  index,
23
33
  ...props
@@ -35,24 +45,25 @@ function Item({
35
45
  color={color}
36
46
  placement="bottomRight"
37
47
  hideIcon
48
+ height={height}
38
49
  >
39
50
  <Link
40
51
  key={key || index}
41
- fullH
42
52
  center
43
53
  paddingH={linkPaddingH}
44
54
  disabled={disabled}
55
+ height={height}
45
56
  {...linkProps}
46
57
  onPress={() => handlePress(item, index)}
47
58
  >
48
59
  <IconText
49
60
  color={active ? activeColor : color}
50
- fullH
51
61
  marginT={3}
52
62
  borderB={3}
53
63
  borderColor={active ? activeColor : 'transparent'}
54
64
  transition="border-color 0.6s ease"
55
65
  size={sizeCode}
66
+ height={height}
56
67
  {...childProps}
57
68
  />
58
69
  </Link>
@@ -63,11 +74,12 @@ function Item({
63
74
  export function HorizontalMenu(rootProps) {
64
75
  const [{ sizeCode, color }, formattedProps] = pipe(
65
76
  useColorConverter(),
66
- useSizeConverter('icons', 'md'),
67
- useThemeComponentModifier('HorizontalMenu') //
77
+ useSizeConverter('elementHeights', 'md'),
78
+ useThemeComponentModifier('HorizontalMenu'),
79
+ useDefaultModifier(DEFAULT_PROPS)
68
80
  )([{}, rootProps])
69
81
 
70
- let { gap = 'sm', height = 50, items, onChange, onChangeIndex, activeIndex, ...props } = formattedProps
82
+ let { gap, height, items, onChange, onChangeIndex, activeIndex, ...props } = formattedProps
71
83
 
72
84
  const handlePress = React.useCallback(
73
85
  (item, index) => {
@@ -88,6 +100,7 @@ export function HorizontalMenu(rootProps) {
88
100
  handlePress={handlePress}
89
101
  color={color}
90
102
  sizeCode={sizeCode}
103
+ height={height}
91
104
  index={index}
92
105
  activeIndex={activeIndex}
93
106
  {...props}
@@ -13,7 +13,7 @@ function normalizeFile(file) {
13
13
  }
14
14
  }
15
15
 
16
- export function Upload({ children, onChange, onUpload, value: valueProp, accept, multiple = false, maxCount, disabled = false, dnd = true, ...props }) {
16
+ export function Upload({ children, onChange, onUpload, value: valueProp, accept, multiple = false, maxCount, disabled = false, dnd = true, onAddPress, ...props }) {
17
17
  const { value, addFiles, remove } = useUploadState({ onUpload, onChange, multiple, maxCount, value: valueProp })
18
18
  const inputRef = useRef()
19
19
  const [isDragging, setIsDragging] = useState(false)
@@ -21,8 +21,10 @@ export function Upload({ children, onChange, onUpload, value: valueProp, accept,
21
21
 
22
22
  const handleClick = useCallback(() => {
23
23
  if (disabled) return
24
- inputRef.current?.click()
25
- }, [disabled])
24
+ const open = () => inputRef.current?.click()
25
+ if (onAddPress) return onAddPress(open)
26
+ open()
27
+ }, [disabled, onAddPress])
26
28
 
27
29
  const handleInputChange = useCallback(
28
30
  (e) => {
@@ -43,7 +43,7 @@ function getMediaTypes(accept) {
43
43
  return undefined
44
44
  }
45
45
 
46
- export function Upload({ children, onChange, onUpload, value: valueProp, accept, multiple = false, maxCount, disabled = false, persistTo, saveToLibrary, compress = true, ...props }) {
46
+ export function Upload({ children, onChange, onUpload, value: valueProp, accept, multiple = false, maxCount, disabled = false, onAddPress, persistTo, saveToLibrary, compress = true, ...props }) {
47
47
  const { value, addFiles, remove } = useUploadState({ onUpload, onChange, multiple, maxCount, value: valueProp })
48
48
  const [open, setOpen] = useState(false)
49
49
 
@@ -62,8 +62,10 @@ export function Upload({ children, onChange, onUpload, value: valueProp, accept,
62
62
 
63
63
  const handlePress = useCallback(() => {
64
64
  if (disabled) return
65
- setOpen(true)
66
- }, [disabled])
65
+ const open = () => setOpen(true)
66
+ if (onAddPress) return onAddPress(open)
67
+ open()
68
+ }, [disabled, onAddPress])
67
69
 
68
70
  // NOTE: keep the drawer OPEN while presenting the native picker, and close it
69
71
  // only after the picker returns. The drawer is a RN <Modal>; closing it first
@@ -9,8 +9,8 @@ export function PopoverContent({ children, placement = 'bottom', ...props }) {
9
9
  className="neko-popover-content"
10
10
  bg="overlayBG"
11
11
  border
12
- borderColor="divider_op40"
13
12
  {...props}
13
+ borderColor="divider"
14
14
  >
15
15
  {children}
16
16
  </Card>
package/src/i18n/I18n.js CHANGED
@@ -35,7 +35,6 @@ export class I18n {
35
35
  }
36
36
  const langData = this.resources[this.language]?.[ns]
37
37
  let value = this._resolveKey(langData, key, count, context)
38
- if (context) console.log(context, value)
39
38
 
40
39
  if (!value) {
41
40
  const fallbackData = this.resources[this.fallback]?.[ns]