@dxos/react-ui 0.7.1 → 0.7.2-main.f1adc9f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +15 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +15 -7
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +15 -7
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +2 -0
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +2 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/components/Buttons/IconButton.tsx +5 -2
- package/src/components/Icon/Icon.tsx +5 -2
- package/src/components/ThemeProvider/ThemeProvider.tsx +3 -1
- package/src/components/Toolbar/Toolbar.tsx +3 -0
|
@@ -155,8 +155,10 @@ import { useId } from "@dxos/react-hooks";
|
|
|
155
155
|
|
|
156
156
|
// packages/ui/react-ui/src/components/Icon/Icon.tsx
|
|
157
157
|
import React3, { forwardRef as forwardRef2, memo } from "react";
|
|
158
|
+
var ICONS_URL = "/icons.svg";
|
|
158
159
|
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
159
|
-
const { tx } = useThemeContext();
|
|
160
|
+
const { tx, noCache } = useThemeContext();
|
|
161
|
+
const url = noCache ? `${ICONS_URL}?nocache=${(/* @__PURE__ */ new Date()).getMinutes()}` : ICONS_URL;
|
|
160
162
|
return /* @__PURE__ */ React3.createElement("svg", {
|
|
161
163
|
...props,
|
|
162
164
|
className: tx("icon.root", "icon", {
|
|
@@ -164,7 +166,7 @@ var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ icon, classNames,
|
|
|
164
166
|
}, classNames),
|
|
165
167
|
ref: forwardedRef
|
|
166
168
|
}, /* @__PURE__ */ React3.createElement("use", {
|
|
167
|
-
href:
|
|
169
|
+
href: `${url}#${icon}`
|
|
168
170
|
}));
|
|
169
171
|
}));
|
|
170
172
|
|
|
@@ -620,7 +622,7 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef9(({ tooltipPortal = true, toolti
|
|
|
620
622
|
ref: forwardedRef
|
|
621
623
|
})), tooltipPortal ? /* @__PURE__ */ React10.createElement(Tooltip.Portal, null, content) : content);
|
|
622
624
|
});
|
|
623
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ icon, size, iconOnly, label, classNames, ...props }, forwardedRef) => {
|
|
625
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ icon, size, iconOnly, label, classNames, iconClassNames, ...props }, forwardedRef) => {
|
|
624
626
|
const { tx } = useThemeContext();
|
|
625
627
|
return /* @__PURE__ */ React10.createElement(Button, {
|
|
626
628
|
...props,
|
|
@@ -628,7 +630,8 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ icon, size, iconOnly, la
|
|
|
628
630
|
ref: forwardedRef
|
|
629
631
|
}, /* @__PURE__ */ React10.createElement(Icon, {
|
|
630
632
|
icon,
|
|
631
|
-
size
|
|
633
|
+
size,
|
|
634
|
+
classNames: iconClassNames
|
|
632
635
|
}), /* @__PURE__ */ React10.createElement("span", {
|
|
633
636
|
className: iconOnly ? "sr-only" : void 0
|
|
634
637
|
}, label));
|
|
@@ -2850,6 +2853,9 @@ var ToolbarSeparator = (props) => {
|
|
|
2850
2853
|
...props
|
|
2851
2854
|
}));
|
|
2852
2855
|
};
|
|
2856
|
+
var ToolbarExpander = () => /* @__PURE__ */ React32.createElement("div", {
|
|
2857
|
+
className: "grow"
|
|
2858
|
+
});
|
|
2853
2859
|
var Toolbar = {
|
|
2854
2860
|
Root: ToolbarRoot,
|
|
2855
2861
|
Button: ToolbarButton,
|
|
@@ -2857,7 +2863,8 @@ var Toolbar = {
|
|
|
2857
2863
|
Toggle: ToolbarToggle,
|
|
2858
2864
|
ToggleGroup: ToolbarToggleGroup2,
|
|
2859
2865
|
ToggleGroupItem: ToolbarToggleGroupItem,
|
|
2860
|
-
Separator: ToolbarSeparator
|
|
2866
|
+
Separator: ToolbarSeparator,
|
|
2867
|
+
Expander: ToolbarExpander
|
|
2861
2868
|
};
|
|
2862
2869
|
|
|
2863
2870
|
// packages/ui/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
|
|
@@ -2871,7 +2878,7 @@ var hasIosKeyboard = () => {
|
|
|
2871
2878
|
|
|
2872
2879
|
// packages/ui/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
|
|
2873
2880
|
var ThemeContext = /* @__PURE__ */ createContext10(void 0);
|
|
2874
|
-
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", rootElevation = "base" }) => {
|
|
2881
|
+
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", rootElevation = "base", ...rest }) => {
|
|
2875
2882
|
useEffect7(() => {
|
|
2876
2883
|
if (document.defaultView) {
|
|
2877
2884
|
const kb = createKeyborg(document.defaultView);
|
|
@@ -2883,7 +2890,8 @@ var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx
|
|
|
2883
2890
|
value: {
|
|
2884
2891
|
tx,
|
|
2885
2892
|
themeMode,
|
|
2886
|
-
hasIosKeyboard: hasIosKeyboard()
|
|
2893
|
+
hasIosKeyboard: hasIosKeyboard(),
|
|
2894
|
+
...rest
|
|
2887
2895
|
}
|
|
2888
2896
|
}, /* @__PURE__ */ React33.createElement(TranslationsProvider, {
|
|
2889
2897
|
fallback,
|