@jirawatpyk/aura-react 4.4.1 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -5
- package/dist/aura.bundle.js +65 -56
- package/dist/cjs/index.cjs +65 -56
- package/dist/esm/Combobox.js +2 -2
- package/dist/esm/DataTable.js +23 -16
- package/dist/esm/DatePicker.js +1 -1
- package/dist/esm/Dialog.js +1 -1
- package/dist/esm/DropdownMenu.js +1 -1
- package/dist/esm/feedback.js +2 -2
- package/dist/esm/layout.js +1 -1
- package/dist/esm/layout2.js +9 -7
- package/dist/esm/locale.js +2 -2
- package/dist/esm/overlay.js +1 -1
- package/dist/index.d.ts +915 -752
- package/package.json +9 -8
- package/scripts/aura-theme.mjs +1 -1
- package/src/theme.js +0 -147
package/dist/esm/layout.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { useStrings
|
|
3
|
+
import { useStrings } from "./locale.js";
|
|
4
4
|
import { cx, useMaybeControlled, uid } from "./internal.js";
|
|
5
5
|
import { Icon } from "./Icon.js";
|
|
6
6
|
const h = React.createElement;
|
package/dist/esm/layout2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { useStrings
|
|
3
|
+
import { useStrings } from "./locale.js";
|
|
4
4
|
import { cx } from "./internal.js";
|
|
5
5
|
import { IconButton } from "./IconButton.js";
|
|
6
6
|
import { Drawer } from "./Dialog.js";
|
|
@@ -28,16 +28,17 @@ function subscribe(cb) {
|
|
|
28
28
|
function useResponsive(value) {
|
|
29
29
|
var bp = useBreakpoint();
|
|
30
30
|
if (value == null || typeof value !== "object") return value;
|
|
31
|
-
|
|
31
|
+
var map = value;
|
|
32
|
+
for (var i = ORDER.indexOf(bp); i >= 0; i--) if (map[ORDER[i]] !== void 0) return map[ORDER[i]];
|
|
32
33
|
return void 0;
|
|
33
34
|
}
|
|
34
35
|
function respVars(prefix, value, map) {
|
|
35
36
|
var style = {};
|
|
36
37
|
if (value == null) return style;
|
|
37
38
|
if (typeof value !== "object") value = { base: value };
|
|
38
|
-
var cur;
|
|
39
|
+
var byBp = value, cur;
|
|
39
40
|
ORDER.forEach(function(k) {
|
|
40
|
-
if (
|
|
41
|
+
if (byBp[k] !== void 0) cur = map ? map(byBp[k]) : byBp[k];
|
|
41
42
|
if (cur !== void 0) style["--" + prefix + "-" + k] = cur;
|
|
42
43
|
});
|
|
43
44
|
return style;
|
|
@@ -77,10 +78,11 @@ const AppShell = React.forwardRef(function AppShell2(props, ref) {
|
|
|
77
78
|
React.useEffect(function() {
|
|
78
79
|
if (!compact) setOpen(false);
|
|
79
80
|
}, [compact]);
|
|
80
|
-
var
|
|
81
|
-
|
|
81
|
+
var navEl = props.nav;
|
|
82
|
+
var nav = props.nav && React.isValidElement(props.nav) && compact ? React.cloneElement(navEl, { onChange: function(id) {
|
|
83
|
+
if (navEl.props.onChange) navEl.props.onChange(id);
|
|
82
84
|
setOpen(false);
|
|
83
|
-
}, className: cx(
|
|
85
|
+
}, className: cx(navEl.props.className, "is-in-drawer") }) : props.nav;
|
|
84
86
|
return h(
|
|
85
87
|
"div",
|
|
86
88
|
{ ref, className: cx("aura-shell", compact && "is-compact", props.className) },
|
package/dist/esm/locale.js
CHANGED
|
@@ -185,8 +185,8 @@ var STRINGS = {
|
|
|
185
185
|
var LocaleContext = React.createContext(null);
|
|
186
186
|
function AuraProvider(props) {
|
|
187
187
|
var value = React.useMemo(function() {
|
|
188
|
-
var base = STRINGS[props.locale] || STRINGS.en;
|
|
189
|
-
return { locale: props.locale || "en", calendar: props.calendar, strings: props.strings ? Object.assign({}, base, props.strings) : base };
|
|
188
|
+
var base = props.locale && STRINGS[props.locale] || STRINGS.en;
|
|
189
|
+
return { locale: props.locale || "en", calendar: props.calendar || null, strings: props.strings ? Object.assign({}, base, props.strings) : base };
|
|
190
190
|
}, [props.locale, props.calendar, props.strings]);
|
|
191
191
|
return h(LocaleContext.Provider, { value }, props.children);
|
|
192
192
|
}
|