@react-fabric/core 1.0.0-beta.60 → 1.0.0-beta.62
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/components/_breadcrumbs.css +2 -0
- package/css/components/_button.css +16 -2
- package/css/components/_icon.css +1 -1
- package/css/components/_modal.css +2 -2
- package/css/core/_theme.css +1 -1
- package/css/reset/_reset.css +5 -1
- package/css/reset/_theme.css +3 -3
- package/css/styles.css +2 -0
- package/css/theme/_colors.css +2 -2
- package/dist/cjs/components/animations/Animations.js +54 -49
- package/dist/cjs/components/button/Button.js +2 -2
- package/dist/cjs/components/callout/Callout.js +4 -4
- package/dist/cjs/components/collapsable/Collapsable.js +4 -5
- package/dist/cjs/components/dropdown/Dropdown.js +13 -1
- package/dist/cjs/components/dropdown/DropdownTool.js +1 -2
- package/dist/cjs/components/icon/Icon.js +24 -24
- package/dist/cjs/components/media/Media.js +9 -8
- package/dist/cjs/components/menu/Menu.js +5 -5
- package/dist/cjs/components/menu/MenuItem.js +1 -2
- package/dist/cjs/components/navigator/Navigator.js +4 -5
- package/dist/cjs/components/panel/Panel.js +7 -7
- package/dist/cjs/components/tabpanel/Tab.js +0 -1
- package/dist/cjs/components/tabpanel/TabPanel.js +3 -2
- package/dist/cjs/core/aside/Aside.js +3 -4
- package/dist/cjs/core/page/Page.js +1 -1
- package/dist/cjs/core/theme/ThemeProvider.js +3 -2
- package/dist/cjs/hooks/useNavigator.js +9 -8
- package/dist/cjs/hooks/useOverlayService.js +34 -13
- package/dist/cjs/hooks/useStepper.js +0 -1
- package/dist/cjs/i18n/index.js +4 -4
- package/dist/cjs/index.js +4 -8
- package/dist/cjs/overlays/alert/Alert.js +1 -2
- package/dist/cjs/overlays/flyout/Flyout.js +2 -3
- package/dist/cjs/overlays/modal/Modal.js +2 -3
- package/dist/cjs/overlays/toast/Toast.js +2 -3
- package/dist/cjs/overlays/tooltip/Tooltip.js +1 -2
- package/dist/cjs/typography/Copy.js +1 -2
- package/dist/esm/components/animations/Animations.js +51 -47
- package/dist/esm/components/button/Button.js +2 -2
- package/dist/esm/components/callout/Callout.js +4 -4
- package/dist/esm/components/collapsable/Collapsable.js +4 -5
- package/dist/esm/components/dropdown/Dropdown.js +14 -2
- package/dist/esm/components/dropdown/DropdownTool.js +1 -2
- package/dist/esm/components/icon/Icon.js +24 -24
- package/dist/esm/components/media/Media.js +9 -8
- package/dist/esm/components/menu/Menu.js +5 -5
- package/dist/esm/components/menu/MenuItem.js +1 -2
- package/dist/esm/components/navigator/Navigator.js +4 -5
- package/dist/esm/components/panel/Panel.js +8 -8
- package/dist/esm/components/tabpanel/Tab.js +0 -1
- package/dist/esm/components/tabpanel/TabPanel.js +3 -2
- package/dist/esm/core/aside/Aside.js +4 -5
- package/dist/esm/core/page/Page.js +2 -2
- package/dist/esm/core/theme/ThemeProvider.js +3 -2
- package/dist/esm/hooks/useNavigator.js +10 -9
- package/dist/esm/hooks/useOverlayService.js +35 -14
- package/dist/esm/hooks/useStepper.js +0 -1
- package/dist/esm/i18n/index.js +2 -2
- package/dist/esm/index.js +1 -2
- package/dist/esm/overlays/alert/Alert.js +1 -2
- package/dist/esm/overlays/flyout/Flyout.js +3 -4
- package/dist/esm/overlays/modal/Modal.js +3 -4
- package/dist/esm/overlays/toast/Toast.js +2 -3
- package/dist/esm/overlays/tooltip/Tooltip.js +1 -2
- package/dist/esm/typography/Copy.js +1 -2
- package/dist/types/components/animations/Animations.d.ts +28 -9
- package/dist/types/components/collapsable/Collapsable.d.ts +2 -2
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/menu/types.d.ts +6 -1
- package/dist/types/components/navigator/Navigator.d.ts +6 -0
- package/dist/types/components/panel/Panel.d.ts +1 -1
- package/dist/types/core/aside/Aside.d.ts +1 -1
- package/dist/types/core/theme/ThemeProvider.d.ts +2 -2
- package/dist/types/hooks/useOverlayService.d.ts +3 -5
- package/dist/types/index.d.ts +0 -1
- package/dist/types/types/index.d.ts +9 -3
- package/package.json +6 -3
- package/src/components/animations/Animations.tsx +53 -45
- package/src/components/button/Button.tsx +4 -2
- package/src/components/callout/Callout.tsx +4 -5
- package/src/components/collapsable/Collapsable.tsx +4 -5
- package/src/components/dropdown/Dropdown.tsx +23 -6
- package/src/components/dropdown/DropdownTool.tsx +1 -2
- package/src/components/icon/Icon.tsx +22 -22
- package/src/components/index.ts +5 -4
- package/src/components/media/Media.tsx +7 -8
- package/src/components/menu/Menu.tsx +4 -4
- package/src/components/menu/MenuItem.tsx +1 -1
- package/src/components/menu/types.ts +6 -1
- package/src/components/navigator/Navigator.tsx +11 -5
- package/src/components/panel/Panel.tsx +14 -8
- package/src/components/tabpanel/TabPanel.tsx +2 -1
- package/src/core/aside/Aside.tsx +4 -5
- package/src/core/page/Page.tsx +2 -2
- package/src/core/theme/ThemeProvider.tsx +4 -2
- package/src/hooks/useNavigator.tsx +10 -11
- package/src/hooks/useOverlayService.tsx +29 -16
- package/src/i18n/index.ts +2 -2
- package/src/index.ts +0 -1
- package/src/overlays/alert/Alert.tsx +1 -2
- package/src/overlays/flyout/Flyout.tsx +3 -4
- package/src/overlays/modal/Modal.tsx +3 -4
- package/src/overlays/toast/Toast.tsx +2 -3
- package/src/overlays/tooltip/Tooltip.tsx +1 -2
- package/src/types/index.ts +32 -2
- package/src/typography/Copy.tsx +1 -2
- package/css/flags.rect.css +0 -1607
- package/css/flags.wavy.css +0 -1606
- package/dist/cjs/types/icons.js +0 -212
- package/dist/esm/types/icons.js +0 -214
- package/dist/types/types/icons.d.ts +0 -210
- package/src/types/icons.ts +0 -451
- /package/dist/cjs/i18n/{ar.json.js → ar/core.json.js} +0 -0
- /package/dist/cjs/i18n/{en.json.js → en/core.json.js} +0 -0
- /package/dist/esm/i18n/{ar.json.js → ar/core.json.js} +0 -0
- /package/dist/esm/i18n/{en.json.js → en/core.json.js} +0 -0
- /package/src/i18n/{ar.json → ar/core.json} +0 -0
- /package/src/i18n/{en.json → en/core.json} +0 -0
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
@layer components {
|
|
25
25
|
.fabric-buttonWrapper {
|
|
26
|
-
--color: var(--color-
|
|
26
|
+
--color: var(--color-tint-600);
|
|
27
|
+
--color-muted: var(--color-tint-300);
|
|
27
28
|
|
|
28
29
|
font-size: 1rem;
|
|
29
30
|
border-radius: var(--rounding);
|
|
@@ -99,6 +100,11 @@
|
|
|
99
100
|
flex: 0 1 1em;
|
|
100
101
|
}
|
|
101
102
|
}
|
|
103
|
+
|
|
104
|
+
[data-color-scheme="dark"] .fabric-buttonWrapper {
|
|
105
|
+
--color: var(--color-tint-500);
|
|
106
|
+
--color-muted: var(--color-tint-200);
|
|
107
|
+
}
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
@layer utilities {
|
|
@@ -132,6 +138,10 @@
|
|
|
132
138
|
--bg-click: color-mix(in lab, var(--color) 25%, var(--fabric-bg));
|
|
133
139
|
--bg-active: color-mix(in lab, var(--color) 24%, var(--fabric-bg));
|
|
134
140
|
|
|
141
|
+
&[data-color="primary"] {
|
|
142
|
+
--color: var(--color-primary-500);
|
|
143
|
+
}
|
|
144
|
+
|
|
135
145
|
&[data-color="accent"] {
|
|
136
146
|
--color: var(--color-accent-500);
|
|
137
147
|
}
|
|
@@ -152,6 +162,10 @@
|
|
|
152
162
|
--color: var(--color-warning-500);
|
|
153
163
|
}
|
|
154
164
|
|
|
165
|
+
&[data-color="muted"] {
|
|
166
|
+
--color: var(--color-muted);
|
|
167
|
+
}
|
|
168
|
+
|
|
155
169
|
&[data-variant="outline"] {
|
|
156
170
|
--outline: var(--color);
|
|
157
171
|
}
|
|
@@ -265,7 +279,7 @@
|
|
|
265
279
|
|
|
266
280
|
.fabric-buttonIcon,
|
|
267
281
|
.fabric-buttonLabel {
|
|
268
|
-
|
|
282
|
+
translate: 0 1px;
|
|
269
283
|
}
|
|
270
284
|
}
|
|
271
285
|
|
package/css/components/_icon.css
CHANGED
package/css/core/_theme.css
CHANGED
package/css/reset/_reset.css
CHANGED
|
@@ -78,6 +78,10 @@
|
|
|
78
78
|
border-color: color-mix(in oklab, var(--fabric-bg) 65%, var(--color-tint));
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
[class*="shadow"] {
|
|
82
|
+
--tw-shadow-color: var(--fabric-shadow);
|
|
83
|
+
}
|
|
84
|
+
|
|
81
85
|
[class*="ring"] {
|
|
82
86
|
--tw-ring-color: color-mix(
|
|
83
87
|
in oklab,
|
|
@@ -223,7 +227,7 @@
|
|
|
223
227
|
unicode-bidi: plaintext;
|
|
224
228
|
}
|
|
225
229
|
|
|
226
|
-
[dir="rtl"] {
|
|
230
|
+
[dir="rtl"] :not:where(:dir(ltr), [dir="ltr"]) {
|
|
227
231
|
p,
|
|
228
232
|
pre,
|
|
229
233
|
h1,
|
package/css/reset/_theme.css
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
[data-color-scheme="light"] {
|
|
64
64
|
--fabric-bg: var(--color-white);
|
|
65
65
|
--fabric-text: var(--color-black);
|
|
66
|
-
--fabric-input:
|
|
66
|
+
--fabric-input: #fdfdfd;
|
|
67
67
|
--fabric-input-focus: #fff;
|
|
68
68
|
--fabric-shadow: #8ba0b0;
|
|
69
69
|
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
[data-color-scheme="dark"] {
|
|
74
74
|
--fabric-bg: var(--color-black);
|
|
75
75
|
--fabric-text: var(--color-white);
|
|
76
|
-
--fabric-input:
|
|
77
|
-
--fabric-input-focus:
|
|
76
|
+
--fabric-input: #141A1F;
|
|
77
|
+
--fabric-input-focus: #0a1218;
|
|
78
78
|
--fabric-shadow: #010101;
|
|
79
79
|
|
|
80
80
|
color-scheme: dark;
|
package/css/styles.css
CHANGED
package/css/theme/_colors.css
CHANGED
|
@@ -83,35 +83,31 @@ var AnimationIndicator = function AnimationIndicator(_ref) {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* A component that displays
|
|
87
|
-
* It
|
|
88
|
-
* This component is typically used to indicate loading states in the UI.
|
|
89
|
-
*
|
|
90
|
-
* @param {Object} props - The properties for the AnimationBars component.
|
|
91
|
-
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
|
|
92
|
-
* @param {number | string} [props.size="2rem"] - The size of the bars.
|
|
93
|
-
* @returns {JSX.Element} The rendered AnimationBars component.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```jsx
|
|
97
|
-
* <AnimationBars color="primary-500" size="3rem" />
|
|
98
|
-
* ```
|
|
86
|
+
* A component that displays a loading animation with a customizable icon, color, size, and mask blur.
|
|
87
|
+
* It is typically used to indicate loading states in the UI.
|
|
99
88
|
*
|
|
100
|
-
* @
|
|
89
|
+
* @param {Object} props - The properties for the AnimationLoader component.
|
|
90
|
+
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the loader icon.
|
|
91
|
+
* @param {number | string} [props.size="2rem"] - The size of the loader icon.
|
|
92
|
+
* @param {string} props.icon - The icon to be displayed as the loader.
|
|
93
|
+
* @param {"sm" | "md" | "lg"} [props.maskBlur] - The blur effect for the background mask.
|
|
94
|
+
* @returns {JSX.Element} The rendered AnimationLoader component.
|
|
101
95
|
*/
|
|
102
|
-
var
|
|
96
|
+
var AnimationLoader = function AnimationLoader(_ref2) {
|
|
103
97
|
var _ref2$color = _ref2.color,
|
|
104
98
|
color = _ref2$color === void 0 ? "tint-500" : _ref2$color,
|
|
105
99
|
_ref2$size = _ref2.size,
|
|
106
|
-
size = _ref2$size === void 0 ? "2rem" : _ref2$size
|
|
100
|
+
size = _ref2$size === void 0 ? "2rem" : _ref2$size,
|
|
101
|
+
icon = _ref2.icon,
|
|
102
|
+
maskBlur = _ref2.maskBlur;
|
|
107
103
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
108
|
-
className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait"),
|
|
104
|
+
className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait", maskBlur === "sm" && "backdrop-blur-sm", maskBlur === "md" && "backdrop-blur-md", maskBlur === "lg" && "backdrop-blur-lg"),
|
|
109
105
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
110
|
-
className: classNames("outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm rounded"),
|
|
106
|
+
className: classNames("outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm leading-0 rounded"),
|
|
111
107
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
112
|
-
className: classNames("
|
|
108
|
+
className: classNames("aspect-square", icon),
|
|
113
109
|
style: {
|
|
114
|
-
|
|
110
|
+
fontSize: size,
|
|
115
111
|
color: getColor.getColor(color)
|
|
116
112
|
}
|
|
117
113
|
})
|
|
@@ -119,42 +115,50 @@ var AnimationBars = function AnimationBars(_ref2) {
|
|
|
119
115
|
});
|
|
120
116
|
};
|
|
121
117
|
|
|
118
|
+
/**
|
|
119
|
+
* A component that displays an animated bars loader.
|
|
120
|
+
* It can be customized with color and size properties.
|
|
121
|
+
* This component is typically used to indicate loading states in the UI.
|
|
122
|
+
*
|
|
123
|
+
* @param {Object} props - The properties for the LoadingBars component.
|
|
124
|
+
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
|
|
125
|
+
* @param {number | string} [props.size="2rem"] - The size of the bars.
|
|
126
|
+
* @returns {JSX.Element} The rendered LoadingBars component.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```jsx
|
|
130
|
+
* <LoadingBars color="primary-500" size="3rem" />
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
134
|
+
*/
|
|
135
|
+
var LoadingBars = function LoadingBars(props) {
|
|
136
|
+
return /*#__PURE__*/jsxRuntime.jsx(AnimationLoader, _objectSpread({
|
|
137
|
+
icon: "icon-[svg-spinners--bars-scale-fade]"
|
|
138
|
+
}, props));
|
|
139
|
+
};
|
|
140
|
+
|
|
122
141
|
/**
|
|
123
142
|
* A component that displays a spinner animation.
|
|
124
143
|
* It can be customized with color and size properties.
|
|
125
144
|
* This component is typically used to indicate loading states in the UI.
|
|
126
145
|
*
|
|
127
|
-
* @param {Object} props - The properties for the
|
|
146
|
+
* @param {Object} props - The properties for the LoadingSpinner component.
|
|
128
147
|
* @param {ColorType | PaletteType | string} [props.color="tint-700"] - The color of the spinner.
|
|
129
148
|
* @param {number | string} [props.size="2rem"] - The size of the spinner.
|
|
130
|
-
* @returns {JSX.Element} The rendered
|
|
149
|
+
* @returns {JSX.Element} The rendered LoadingSpinner component.
|
|
131
150
|
*
|
|
132
151
|
* @example
|
|
133
152
|
* ```jsx
|
|
134
|
-
* <
|
|
153
|
+
* <LoadingSpinner color="primary-500" size="3rem" />
|
|
135
154
|
* ```
|
|
136
155
|
*
|
|
137
156
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
138
157
|
*/
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
size = _ref3$size === void 0 ? "2rem" : _ref3$size;
|
|
144
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
145
|
-
className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait"),
|
|
146
|
-
"data-ref": "spinner",
|
|
147
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
148
|
-
className: classNames("outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm rounded"),
|
|
149
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
150
|
-
className: classNames("fabric-spinner"),
|
|
151
|
-
style: {
|
|
152
|
-
width: size,
|
|
153
|
-
color: getColor.getColor(color)
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
})
|
|
157
|
-
});
|
|
158
|
+
var LoadingSpinner = function LoadingSpinner(props) {
|
|
159
|
+
return /*#__PURE__*/jsxRuntime.jsx(AnimationLoader, _objectSpread({
|
|
160
|
+
icon: "icon-[svg-spinners--eclipse]"
|
|
161
|
+
}, props));
|
|
158
162
|
};
|
|
159
163
|
|
|
160
164
|
/**
|
|
@@ -174,9 +178,9 @@ var AnimationSpinner = function AnimationSpinner(_ref3) {
|
|
|
174
178
|
*
|
|
175
179
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
176
180
|
*/
|
|
177
|
-
var Skeleton = function Skeleton(
|
|
178
|
-
var className =
|
|
179
|
-
rest = _objectWithoutProperties(
|
|
181
|
+
var Skeleton = function Skeleton(_ref3) {
|
|
182
|
+
var className = _ref3.className,
|
|
183
|
+
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
180
184
|
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
|
|
181
185
|
className: classNames(className, "p-2 animate-pulse flex gap-2 max-w-lg"),
|
|
182
186
|
"data-ref": "skeleton"
|
|
@@ -212,7 +216,7 @@ var Skeleton = function Skeleton(_ref4) {
|
|
|
212
216
|
*
|
|
213
217
|
* @returns {JSX.Element} The rendered Loading component.
|
|
214
218
|
*/
|
|
215
|
-
var
|
|
219
|
+
var LoadingLine = function LoadingLine() {
|
|
216
220
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
217
221
|
className: classNames("fabric-loader", "area-[loader] relative overflow-x-clip"),
|
|
218
222
|
"data-ref": "loading",
|
|
@@ -222,8 +226,9 @@ var Loading = function Loading() {
|
|
|
222
226
|
});
|
|
223
227
|
};
|
|
224
228
|
|
|
225
|
-
exports.AnimationBars = AnimationBars;
|
|
226
229
|
exports.AnimationIndicator = AnimationIndicator;
|
|
227
|
-
exports.
|
|
228
|
-
exports.
|
|
230
|
+
exports.AnimationLoader = AnimationLoader;
|
|
231
|
+
exports.LoadingBars = LoadingBars;
|
|
232
|
+
exports.LoadingLine = LoadingLine;
|
|
233
|
+
exports.LoadingSpinner = LoadingSpinner;
|
|
229
234
|
exports.Skeleton = Skeleton;
|
|
@@ -50,7 +50,7 @@ var Button = function Button(_ref) {
|
|
|
50
50
|
className = _ref.className,
|
|
51
51
|
active = _ref.active,
|
|
52
52
|
_ref$color = _ref.color,
|
|
53
|
-
color = _ref$color === void 0 ? "
|
|
53
|
+
color = _ref$color === void 0 ? "default" : _ref$color,
|
|
54
54
|
icon = _ref.icon,
|
|
55
55
|
_ref$iconAlign = _ref.iconAlign,
|
|
56
56
|
iconAlign = _ref$iconAlign === void 0 ? "start" : _ref$iconAlign,
|
|
@@ -142,7 +142,7 @@ var Button = function Button(_ref) {
|
|
|
142
142
|
"data-size": size,
|
|
143
143
|
"data-loading": busy || loading,
|
|
144
144
|
"data-disabled": disabled,
|
|
145
|
-
children: [hotKey && /*#__PURE__*/jsxRuntime.jsx(HotKey.HotKey, {
|
|
145
|
+
children: [!disabled && hotKey && /*#__PURE__*/jsxRuntime.jsx(HotKey.HotKey, {
|
|
146
146
|
keyCombo: hotKey,
|
|
147
147
|
handler: hotKeyHandler.current
|
|
148
148
|
}), /*#__PURE__*/jsxRuntime.jsx(TooltipWrapper, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
5
|
var classNames = require('classnames');
|
|
6
|
-
var icons = require('../../types/icons.js');
|
|
7
6
|
var Icon = require('../icon/Icon.js');
|
|
8
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
8
|
|
|
@@ -13,7 +12,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
12
|
// colors for different callout types
|
|
14
13
|
var colors = {
|
|
15
14
|
none: "bg-base text-tint-900 border-tint-100",
|
|
16
|
-
|
|
15
|
+
"default": "bg-tint-50/50 text-tint-800 border-tint-300",
|
|
16
|
+
muted: "bg-tint-50/50 text-muted border-muted",
|
|
17
17
|
primary: "bg-primary-50/50 text-primary-800 border-primary-300",
|
|
18
18
|
accent: "bg-accent-50/50 text-accent-800 border-accent-300",
|
|
19
19
|
info: "bg-info-50/50 text-info-800 border-info-300",
|
|
@@ -51,7 +51,7 @@ var colors = {
|
|
|
51
51
|
var Callout = function Callout(_ref) {
|
|
52
52
|
var children = _ref.children,
|
|
53
53
|
_ref$color = _ref.color,
|
|
54
|
-
color = _ref$color === void 0 ? "
|
|
54
|
+
color = _ref$color === void 0 ? "default" : _ref$color,
|
|
55
55
|
legend = _ref.legend,
|
|
56
56
|
title = _ref.title,
|
|
57
57
|
icon = _ref.icon,
|
|
@@ -86,7 +86,7 @@ var Callout = function Callout(_ref) {
|
|
|
86
86
|
size: "md",
|
|
87
87
|
"data-ref": "calloutClose",
|
|
88
88
|
className: classNames("absolute end-2", legend ? "top-0" : "top-2"),
|
|
89
|
-
icon:
|
|
89
|
+
icon: "icon-[mdi--close]",
|
|
90
90
|
onClick: onClose
|
|
91
91
|
})]
|
|
92
92
|
}));
|
|
@@ -6,7 +6,6 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
6
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
7
|
var classNames = require('classnames');
|
|
8
8
|
var react = require('react');
|
|
9
|
-
var icons = require('../../types/icons.js');
|
|
10
9
|
var Icon = require('../icon/Icon.js');
|
|
11
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
11
|
|
|
@@ -26,8 +25,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
26
25
|
* ```jsx
|
|
27
26
|
* <Collapsable
|
|
28
27
|
* iconAlign="start"
|
|
29
|
-
* iconOpen=
|
|
30
|
-
* iconClosed=
|
|
28
|
+
* iconOpen="icon-[mdi--chevron-down]"
|
|
29
|
+
* iconClosed="icon-[mdi--chevron-right]"
|
|
31
30
|
* open={true}
|
|
32
31
|
* onOpen={() => console.log("Opened")}
|
|
33
32
|
* onClose={() => console.log("Closed")}
|
|
@@ -49,9 +48,9 @@ var Collapsable = function Collapsable(_ref) {
|
|
|
49
48
|
iconAlign = _ref.iconAlign,
|
|
50
49
|
stickyHeader = _ref.stickyHeader,
|
|
51
50
|
_ref$iconClosed = _ref.iconClosed,
|
|
52
|
-
iconClosed = _ref$iconClosed === void 0 ?
|
|
51
|
+
iconClosed = _ref$iconClosed === void 0 ? "icon-[mdi--chevron-right]" : _ref$iconClosed,
|
|
53
52
|
_ref$iconOpen = _ref.iconOpen,
|
|
54
|
-
iconOpen = _ref$iconOpen === void 0 ?
|
|
53
|
+
iconOpen = _ref$iconOpen === void 0 ? "icon-[mdi--chevron-down]" : _ref$iconOpen,
|
|
55
54
|
open = _ref.open;
|
|
56
55
|
_ref.onClose;
|
|
57
56
|
_ref.onOpen;
|
|
@@ -32,6 +32,7 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
32
32
|
isOpen = _useState2[0],
|
|
33
33
|
setIsOpen = _useState2[1];
|
|
34
34
|
var tree = react.useFloatingTree();
|
|
35
|
+
var nodeId = react.useFloatingNodeId();
|
|
35
36
|
var _useMemo = react$1.useMemo(function () {
|
|
36
37
|
return react$1.Children.toArray(children);
|
|
37
38
|
}, [children]),
|
|
@@ -39,6 +40,7 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
39
40
|
anchor = _useMemo2[0],
|
|
40
41
|
panel = _useMemo2[1];
|
|
41
42
|
var _useFloating = react.useFloating({
|
|
43
|
+
nodeId: "dropdown-".concat(nodeId),
|
|
42
44
|
open: isOpen,
|
|
43
45
|
onOpenChange: function onOpenChange(open, _, reason) {
|
|
44
46
|
var _ref2;
|
|
@@ -80,6 +82,10 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
80
82
|
}
|
|
81
83
|
return undefined;
|
|
82
84
|
}, [refs, isOpen, fitToParent]);
|
|
85
|
+
var dismissDropdown = react$1.useCallback(function () {
|
|
86
|
+
setIsOpen(false);
|
|
87
|
+
onClose === null || onClose === void 0 || onClose();
|
|
88
|
+
}, []);
|
|
83
89
|
var tryClosing = react$1.useCallback(function (e) {
|
|
84
90
|
var _refs$floating$curren, _refs$floating$curren2;
|
|
85
91
|
if (!((_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 && _refs$floating$curren.contains(e.target.closest("[data-dropdown-dismiss='false']"))) && (!!closeOnClick || (_refs$floating$curren2 = refs.floating.current) !== null && _refs$floating$curren2 !== void 0 && _refs$floating$curren2.contains(e.target.closest("[data-dropdown-dismiss='true']")))) {
|
|
@@ -139,7 +145,9 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
139
145
|
role: "none",
|
|
140
146
|
className: classNames("fabric-dropdownBody", dropdownClassName, !plainDropdown && "shadow-lg bg-base ring-1 ring-tint-100", "rounded-capped overflow-auto scroll-thin grid max-h-[70vh]"),
|
|
141
147
|
onMouseUpCapture: tryClosing,
|
|
142
|
-
children: panel
|
|
148
|
+
children: /*#__PURE__*/react$1.cloneElement(panel, {
|
|
149
|
+
dismiss: dismissDropdown
|
|
150
|
+
})
|
|
143
151
|
}), showArrow && /*#__PURE__*/jsxRuntime.jsx(react.FloatingArrow, {
|
|
144
152
|
ref: arrowRef,
|
|
145
153
|
context: context,
|
|
@@ -184,6 +192,10 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
184
192
|
* @see {@link https://floating-ui.com/docs/react} for more details on Floating UI.
|
|
185
193
|
*/
|
|
186
194
|
var Dropdown = function Dropdown(props) {
|
|
195
|
+
var tree = react.useFloatingTree();
|
|
196
|
+
if (tree) {
|
|
197
|
+
return /*#__PURE__*/jsxRuntime.jsx(DropdownElement, _objectSpread({}, props));
|
|
198
|
+
}
|
|
187
199
|
return /*#__PURE__*/jsxRuntime.jsx(react.FloatingTree, {
|
|
188
200
|
children: /*#__PURE__*/jsxRuntime.jsx(DropdownElement, _objectSpread({}, props))
|
|
189
201
|
});
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
5
|
var classNames = require('classnames');
|
|
6
|
-
var icons = require('../../types/icons.js');
|
|
7
6
|
var Icon = require('../icon/Icon.js');
|
|
8
7
|
var Dropdown = require('./Dropdown.js');
|
|
9
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -19,7 +18,7 @@ var DropdownTool = function DropdownTool(_ref) {
|
|
|
19
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
19
|
return /*#__PURE__*/jsxRuntime.jsxs(Dropdown.Dropdown, _objectSpread(_objectSpread({}, props), {}, {
|
|
21
20
|
children: [/*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
22
|
-
icon: icon !== null && icon !== void 0 ? icon :
|
|
21
|
+
icon: icon !== null && icon !== void 0 ? icon : "icon-[mdi--menu-down]",
|
|
23
22
|
className: classNames("outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer", className, groupHover && "hidden group-hover/tool:inline-block data-dropdown-open:inline-block")
|
|
24
23
|
}), children]
|
|
25
24
|
}));
|
|
@@ -114,31 +114,31 @@ var Icon = function Icon(_ref) {
|
|
|
114
114
|
/** ***************** render icon *******************/
|
|
115
115
|
var iconEl = react.useMemo(function () {
|
|
116
116
|
if ( /*#__PURE__*/react.isValidElement(icon)) return icon;
|
|
117
|
-
if (
|
|
118
|
-
|
|
117
|
+
if (utilities.isString(icon)) {
|
|
118
|
+
return isSvg ? /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
119
|
+
viewBox: viewBox,
|
|
120
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
121
|
+
fill: "currentColor",
|
|
122
|
+
d: icon.toString()
|
|
123
|
+
})
|
|
124
|
+
}) : (icon === null || icon === void 0 ? void 0 : icon.toString().length) <= 4 ? /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
125
|
+
role: "img",
|
|
126
|
+
children: /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
127
|
+
x: "50%",
|
|
128
|
+
y: "50%",
|
|
129
|
+
dy: ".1em",
|
|
130
|
+
dominantBaseline: "middle",
|
|
131
|
+
textAnchor: "middle",
|
|
132
|
+
style: {
|
|
133
|
+
fontSize: SvgTextSize[icon.length]
|
|
134
|
+
},
|
|
135
|
+
children: icon
|
|
136
|
+
})
|
|
137
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
138
|
+
className: "".concat(icon)
|
|
139
|
+
});
|
|
119
140
|
}
|
|
120
|
-
|
|
121
|
-
viewBox: viewBox,
|
|
122
|
-
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
123
|
-
fill: "currentColor",
|
|
124
|
-
d: icon.toString()
|
|
125
|
-
})
|
|
126
|
-
}) : (icon === null || icon === void 0 ? void 0 : icon.toString().length) <= 4 ? /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
127
|
-
role: "img",
|
|
128
|
-
children: /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
129
|
-
x: "50%",
|
|
130
|
-
y: "50%",
|
|
131
|
-
dy: ".1em",
|
|
132
|
-
dominantBaseline: "middle",
|
|
133
|
-
textAnchor: "middle",
|
|
134
|
-
style: {
|
|
135
|
-
fontSize: SvgTextSize[icon.length]
|
|
136
|
-
},
|
|
137
|
-
children: icon
|
|
138
|
-
})
|
|
139
|
-
}) : /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
140
|
-
className: "".concat(icon)
|
|
141
|
-
});
|
|
141
|
+
throw Error("Invalid icon expected string");
|
|
142
142
|
}, [icon, isSvg, viewBox]);
|
|
143
143
|
return /*#__PURE__*/jsxRuntime.jsxs("dfn", _objectSpread(_objectSpread({
|
|
144
144
|
"data-ref": "icon",
|
|
@@ -6,7 +6,6 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
|
|
|
6
6
|
var utilities = require('@react-fabric/utilities');
|
|
7
7
|
var classNames = require('classnames');
|
|
8
8
|
var react = require('react');
|
|
9
|
-
var icons = require('../../types/icons.js');
|
|
10
9
|
var Button = require('../button/Button.js');
|
|
11
10
|
var Icon = require('../icon/Icon.js');
|
|
12
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -21,8 +20,10 @@ var cover = {
|
|
|
21
20
|
contain: "object-contain"
|
|
22
21
|
};
|
|
23
22
|
var loadIndicator = /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
24
|
-
className: classNames("fabric-mediaPlaceholder", "absolute z-1 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-
|
|
25
|
-
children: "
|
|
23
|
+
className: classNames("fabric-mediaPlaceholder", "absolute z-1 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-sm text-gray"),
|
|
24
|
+
children: /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
25
|
+
className: "icon-[svg-spinners--pulse-rings-2]"
|
|
26
|
+
})
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -94,7 +95,7 @@ var Image = function Image(_ref) {
|
|
|
94
95
|
}), errored && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
95
96
|
size: "2rem",
|
|
96
97
|
className: "absolute text-tint-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
97
|
-
icon:
|
|
98
|
+
icon: "icon-[mdi--image-off-outline]"
|
|
98
99
|
})]
|
|
99
100
|
}));
|
|
100
101
|
};
|
|
@@ -211,7 +212,7 @@ var Video = function Video(_ref2) {
|
|
|
211
212
|
rounded: true,
|
|
212
213
|
variant: "link",
|
|
213
214
|
className: "fabric-mediaControlPlaceholder",
|
|
214
|
-
icon:
|
|
215
|
+
icon: "icon-[mdi--dots-vertical]",
|
|
215
216
|
"aria-label": "controls"
|
|
216
217
|
}), /*#__PURE__*/jsxRuntime.jsx(Button.Button, {
|
|
217
218
|
rounded: true,
|
|
@@ -221,7 +222,7 @@ var Video = function Video(_ref2) {
|
|
|
221
222
|
onClick: function onClick() {
|
|
222
223
|
videoRef.current && (videoRef.current.volume = videoRef.current.volume ? 0 : 1);
|
|
223
224
|
},
|
|
224
|
-
icon: volume ?
|
|
225
|
+
icon: volume ? "icon-[mdi--volume]" : "icon-[mdi--volume-mute]"
|
|
225
226
|
}), /*#__PURE__*/jsxRuntime.jsx(Button.Button, {
|
|
226
227
|
rounded: true,
|
|
227
228
|
variant: "link",
|
|
@@ -231,13 +232,13 @@ var Video = function Video(_ref2) {
|
|
|
231
232
|
var _videoRef$current3, _videoRef$current4, _videoRef$current5;
|
|
232
233
|
(_videoRef$current3 = videoRef.current) !== null && _videoRef$current3 !== void 0 && _videoRef$current3.paused ? (_videoRef$current4 = videoRef.current) === null || _videoRef$current4 === void 0 ? void 0 : _videoRef$current4.play() : (_videoRef$current5 = videoRef.current) === null || _videoRef$current5 === void 0 ? void 0 : _videoRef$current5.pause();
|
|
233
234
|
},
|
|
234
|
-
icon: state ?
|
|
235
|
+
icon: state ? "icon-[mdi--pause]" : "icon-[mdi--play]"
|
|
235
236
|
})]
|
|
236
237
|
})]
|
|
237
238
|
}), errored && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
238
239
|
size: "2rem",
|
|
239
240
|
className: "absolute text-tint-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
240
|
-
icon:
|
|
241
|
+
icon: "icon-[mdi--video-off-outline]"
|
|
241
242
|
})]
|
|
242
243
|
}));
|
|
243
244
|
};
|
|
@@ -8,13 +8,12 @@ var utilities = require('@react-fabric/utilities');
|
|
|
8
8
|
var classNames = require('classnames');
|
|
9
9
|
var react$1 = require('react');
|
|
10
10
|
var HotKeyWrapper = require('../../hotkeys/HotKeyWrapper.js');
|
|
11
|
-
var icons = require('../../types/icons.js');
|
|
12
11
|
var cloneElement = require('../../utils/cloneElement.js');
|
|
13
12
|
var nodeCheck = require('../../utils/nodeCheck.js');
|
|
14
13
|
var MenuItem = require('./MenuItem.js');
|
|
15
14
|
var jsxRuntime = require('react/jsx-runtime');
|
|
16
15
|
|
|
17
|
-
var _excluded = ["children", "minimal", "menuClassName", "onClick", "trigger", "ref"];
|
|
16
|
+
var _excluded = ["children", "minimal", "menuClassName", "onClick", "trigger", "ref", "forDropdown"];
|
|
18
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
19
|
// FIXME: refactor menu implementation to differentiate between static and floating menus, implement context wrapper for each menu level
|
|
@@ -28,6 +27,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
28
27
|
_ref$trigger = _ref.trigger,
|
|
29
28
|
trigger = _ref$trigger === void 0 ? "hover" : _ref$trigger,
|
|
30
29
|
ref = _ref.ref,
|
|
30
|
+
forDropdown = _ref.forDropdown,
|
|
31
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
32
|
var _useState = react$1.useState(false),
|
|
33
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -42,9 +42,9 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
42
42
|
var tree = react.useFloatingTree();
|
|
43
43
|
var nodeId = react.useFloatingNodeId();
|
|
44
44
|
var parentId = react.useFloatingParentNodeId();
|
|
45
|
-
var isNested = parentId !== null;
|
|
45
|
+
var isNested = parentId !== null && !forDropdown;
|
|
46
46
|
var _useFloating = react.useFloating({
|
|
47
|
-
nodeId: nodeId,
|
|
47
|
+
nodeId: "menu-".concat(nodeId),
|
|
48
48
|
open: !isNested || isOpen,
|
|
49
49
|
onOpenChange: function onOpenChange(open, event, reason) {
|
|
50
50
|
isNested && setIsOpen(open);
|
|
@@ -166,7 +166,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
166
166
|
}))), {}, {
|
|
167
167
|
"data-open": isOpen,
|
|
168
168
|
minimal: minimal,
|
|
169
|
-
altIcon:
|
|
169
|
+
altIcon: "icon-[mdi--menu-right]",
|
|
170
170
|
ref: utilities.mergeRefs(refs.setReference, ref)
|
|
171
171
|
})), /*#__PURE__*/jsxRuntime.jsx(react.FloatingList, {
|
|
172
172
|
elementsRef: elementsRef,
|
|
@@ -15,7 +15,6 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
15
15
|
var Tooltip = require('../../overlays/tooltip/Tooltip.js');
|
|
16
16
|
var Badge = require('../badge/Badge.js');
|
|
17
17
|
var Icon = require('../icon/Icon.js');
|
|
18
|
-
require('../../types/icons.js');
|
|
19
18
|
require('../../hotkeys/HotKeyWrapper.js');
|
|
20
19
|
|
|
21
20
|
var _excluded = ["as", "label", "color", "className", "icon", "appendLabel", "altIcon", "id", "active", "disabled", "onClick", "badge", "hotKey", "tabIndex", "minimal", "data-open", "ref"],
|
|
@@ -133,7 +132,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
133
132
|
(_onClick === null || _onClick === void 0 ? void 0 : _onClick(e)) !== false && (tree === null || tree === void 0 ? void 0 : tree.events.emit("click"));
|
|
134
133
|
}
|
|
135
134
|
}, minimal ? {} : aria), {}, {
|
|
136
|
-
children: [hotKey && /*#__PURE__*/jsxRuntime.jsx(HotKey.HotKey, {
|
|
135
|
+
children: [!disabled && hotKey && /*#__PURE__*/jsxRuntime.jsx(HotKey.HotKey, {
|
|
137
136
|
keyCombo: hotKey,
|
|
138
137
|
handler: function handler() {
|
|
139
138
|
var _elRef$current2, _elRef$current2$click;
|